@wavv/ui 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +1 -1
- package/build/cjs/types/components/Accordion.d.ts +3 -3
- package/build/cjs/types/components/Button/ButtonTypes.d.ts +4 -0
- package/build/esm/index.js +1 -1
- package/build/esm/types/components/Accordion.d.ts +3 -3
- package/build/esm/types/components/Button/ButtonTypes.d.ts +4 -0
- package/build/index.d.ts +7 -3
- package/package.json +1 -1
package/build/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
(c) Sindre Sorhus
|
|
22
22
|
@license MIT
|
|
23
23
|
*/
|
|
24
|
-
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))o.call(n,l)&&(c[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(c[s[f]]=n[s[f]])}}return c}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV)var r=n(2),o=n(4),i=n(3),a={};e.exports=function(e,n,s,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var f;try{r("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",c||"React class",s,l,typeof e[l]),f=e[l](n,l,c,s,null,i)}catch(e){f=e}if(o(!f||f instanceof Error,"%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).",c||"React class",s,l,typeof f),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=u?u():"";o(!1,"Failed %s type: %s%s",s,f.message,null!=p?p:"")}}}}).call(t,n(0))},function(e,t,n){var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="insert",o="backspace",i=t.isInvalidKey=function(e){return"Backspace"!==e&&!/[0-9]/.test(e)},a=function(e){return e.start!==e.end};t.update=function(e,t,n){var r=a(t);return"Backspace"===n?s(e,t):function(e,t,n){return!(10===u(e).length&&!n||i(t))}(e,n,r)?c(e,t,n):{phoneNumber:e,cursorPosition:t.start}};var s=t.backspace=function(e,t){var n=t.start,r=t.end,i=e;if(!a(t)&&n>0&&e[n-1].match(/[0-9]/)&&(i=e.substring(0,n-1)+i.substring(n)),a(t)){var s=e.substring(n,r).replace(/\d/g,"");i=e.substring(0,n)+s+i.substring(r)}var c=p(e,i,t,o);return{phoneNumber:f(i),cursorPosition:c}},c=t.insert=function(e,t,n){t.start,t.end;var o=e;a(t)&&(o=l(e,n,t)),a(t)||(o=l(e,n,t));var i=p(e,o,t,r);return{phoneNumber:f(o),cursorPosition:i}},u=t.normalize=function(e){return e.replace(/\D/g,"")},l=t.insertChars=function(e,t,n){return e.substring(0,n.start)+t+e.substring(n.end)},f=t.format=function(e){var t=u(e),n=t.substring(0,3),r=t.substring(3,6),o=t.substring(6,11);return o?"("+n+") "+r+"-"+o:r?n+"-"+r:t},p=t.getCursorPosition=function(e,t,n,i){if(n.start===e.length)return f(t).length;if(0===n.start){if(i===o)return 0;if(i===r)return 1}if(i===o){var s=/[^0-9]/g;if(a(n)&&s.test(e.substring(n.start,n.end)))return n.start;if(!a(n)&&s.test(e[n.start-1]))return n.start-1}var c=e.substring(n.end).match(/[0-9]/g),u=c?c.length:0,l=f(t),p=d(l,u);return l.length-p},d=t.getCharCountFromEndWithNumbers=function(e,t){var n=e.split("");n.reverse();var r=0,o=n.reduce((function(e,n){return r===t?e:(/[0-9]/.test(n)&&r++,e+1)}),0);return r<t?0:o}}]);const Dr=t=>{var{size:n,color:r,margin:o,marginTop:i,marginBottom:s,marginRight:c,marginLeft:u}=t,l=a(t,["size","color","margin","marginTop","marginBottom","marginRight","marginLeft"]);const f={margin:o,marginTop:i,marginBottom:s,marginRight:c,marginLeft:u};return e.jsx(Ir,Object.assign({},f,{children:e.jsx(an,Object.assign({},l,{size:n,name:"loading",color:r,inheritColor:!r}))}))},Rr=n.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Ir=J.div({animation:`${Rr} 1s linear infinite`,width:"max-content",height:"max-content"},(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Nr=(e,n,r=!0)=>{const[o,i]=t.useState(!1);return{focused:o,handleFocus:t=>{r&&i(!0),e&&e(t)},handleBlur:e=>{i(!1),n&&n(e)}}},Lr=e=>!!e||null!=e&&""!==e,Br=J.div((({theme:{input:e},backgroundColor:t,borderRadius:n,borderless:r,borderColor:o,textOnly:i,focused:a,invalid:s,disabled:c,hasLabel:u,pointer:l})=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",minHeight:u?48:40,height:u?48:40,padding:"5px 16px",boxSizing:"border-box",color:c?e.labelColor.disabled:e.labelColor.default,backgroundColor:e.background.default,borderBottom:r?void 0:"1px solid",borderColor:o||e.borderColor.default,borderRadius:null!=n?n:4,borderBottomLeftRadius:0,borderBottomRightRadius:0,cursor:l?"pointer":void 0,"&:hover":{backgroundColor:c||i||t?void 0:e.background.hover,borderColor:a||c||r||s?void 0:e.borderColor.hover,Label:{color:a||c?void 0:e.labelColor.hover}}})),(({theme:{input:e},focused:t})=>({backgroundColor:t?e.background.focused:void 0,borderColor:t?e.borderColor.focused:void 0})),(({theme:{input:e},invalid:t})=>({borderColor:t?e.borderColor.error:void 0})),(({theme:{input:e},disabled:t,readOnly:n})=>({backgroundColor:t?e.background.disabled:void 0,borderColor:t?e.borderColor.disabled:void 0,pointerEvents:t||n?"none":void 0})),(({borderless:e})=>({border:e?"none":void 0})),(({theme:e,textOnly:t,disabled:n})=>({padding:t?0:void 0,backgroundColor:t?"transparent":void 0,width:t?"max-content":void 0,height:t?"max-content":void 0,minHeight:t?"max-content":void 0,color:t&&n?e.scale4:void 0})),(({backgroundColor:e})=>({backgroundColor:e})),(({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a})=>({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a}))),Fr=J.div((({readOnly:e})=>({display:"flex",flexDirection:"column",boxSizing:"border-box",width:"100%",position:"relative","& > label, & > input":{pointerEvents:e?"none":void 0,caretColor:e?"transparent":void 0}}))),zr=J.label((({theme:{font:e,input:t},filled:n,focused:r})=>({fontSize:n||r?e.size.sm:e.size.lg,color:n?t.labelColor.filled:t.labelColor.default,position:"relative",top:n||r?void 0:1})),(({theme:{input:e},disabled:t})=>({color:t?e.labelColor.disabled:void 0})),(({theme:{input:e},focused:t})=>({color:t?e.labelColor.focused:void 0})));var Vr={Container:Br,Wrapper:Fr,Label:zr,useInputFocus:Nr,isInputFilled:Lr};const Hr=(n,r)=>{const o=e=>t.cloneElement(e,r);return"string"==typeof n?e.jsx(an,Object.assign({name:n,inheritColor:!0},r)):"object"==typeof n&&"props"in n&&"trigger"in n.props?t.cloneElement(n,{trigger:o(n.props.trigger)}):"object"==typeof n&&"props"in n?o(n):e.jsx(an,Object.assign({},n,r))},Ur=t.forwardRef(((r,o)=>{var{id:i,label:s,placeholder:c,placeholderColor:u,description:l,isLoading:f,search:p,phone:d,textOnly:h,iconLeft:g,iconRight:y,invalid:v,borderless:m,borderRadius:b,borderColor:w,backgroundColor:x,fontSize:_,width:C,height:S,margin:O,marginLeft:k,marginRight:E,marginTop:j,marginBottom:A,containerRef:T,value:M,disabled:P,readOnly:D,preventFocus:R,pointer:I,onChange:N,onClick:L,onClear:B,onFocus:F,onBlur:z}=r,V=a(r,["id","label","placeholder","placeholderColor","description","isLoading","search","phone","textOnly","iconLeft","iconRight","invalid","borderless","borderRadius","borderColor","backgroundColor","fontSize","width","height","margin","marginLeft","marginRight","marginTop","marginBottom","containerRef","value","disabled","readOnly","preventFocus","pointer","onChange","onClick","onClear","onFocus","onBlur"]);const{focused:H,handleFocus:U,handleBlur:K}=Nr(F,z,!R&&!D),W=t.useRef(null),{color:$}=n.useTheme(),[q,G]=t.useState(h?50:void 0),Z=t.useRef(null);t.useLayoutEffect((()=>{if(h&&Z){const{current:e}=Z,t=null==e?void 0:e.offsetWidth;"number"==typeof t&&G(t+3)}}),[h,M,c,Z]);const Y=h?M||c:M,X=M&&B&&!f,J=()=>{H||U()},Q=()=>{H&&K()};t.useImperativeHandle(o,(()=>({focus:J,blur:Q,hasFocus:H}))),t.useEffect((()=>{var e;H&&(null===(e=W.current)||void 0===e||e.focus())}),[H]);return e.jsxs(Br,Object.assign({ref:T,invalid:v,textOnly:h,borderless:m||h,borderRadius:b,borderColor:w,backgroundColor:x,width:C,height:S,margin:O,marginLeft:k,marginRight:E,marginTop:j,marginBottom:A,focused:H,disabled:P,hasLabel:!!s,onClick:e=>{R||D||J(),L&&L(e)},pointer:I,readOnly:D},{children:[p&&e.jsx(an,{name:"search",marginRight:8,inheritColor:!0}),g&&Hr(g,{marginRight:8}),e.jsxs(Fr,Object.assign({readOnly:D||R},{children:[h&&e.jsx(qr,Object.assign({ref:Z,fontSize:_},{children:Y})),s&&!h&&e.jsx(zr,Object.assign({htmlFor:i||s,filled:Lr(M),focused:H,disabled:P},{children:s})),e.jsx(Kr,Object.assign({id:i||s,ref:W,value:M,placeholder:c,placeholderColor:u,onChange:e=>{if(d){const{value:t}=e.target,n=Pr.normalize(t);if(n.length>10)return;const r=Pr.format(n);N&&N(e,r,n)}else N&&N(e)},onFocus:U,onBlur:K,disabled:P,hide:!(Lr(M)||!s||H||h),width:q,fontSize:_},V))]})),y&&Hr(y),f&&e.jsx(Dr,{}),X&&e.jsx(Wr,Object.assign({onClick:B},{children:e.jsx(an,{name:"close-circle-outline",color:$.brand})})),l&&e.jsx($r,Object.assign({invalid:v},{children:l}))]}))})),Kr=J.input((({theme:{font:e,input:t,size:n,accent:r},fontSize:o,hide:i,disabled:a,width:s,placeholderColor:c})=>({outline:"none",border:"none",color:a?t.color.disabled:t.color.default,caretColor:r,backgroundColor:"transparent",paddingLeft:0,fontSize:o||e.size.lg,fontFamily:e.family.default,width:s||"100%",height:"100%",marginRight:n.sm,boxSizing:"border-box",opacity:i?0:1,position:i?"absolute":void 0,"&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active":{transition:"background-color 0s 50000s",WebkitTextFillColor:t.color.default},"&::placeholder":{color:c||t.color.placeholder,opacity:1}}))),Wr=J.div({height:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:4}),$r=J.div((({theme:{font:e,input:t},invalid:n})=>({color:n?t.color.descriptionError:t.color.description,fontSize:e.size.sm,position:"absolute",left:0,top:"calc(100% + 4px)"}))),qr=J.div((({theme:{font:e},fontSize:t})=>({position:"absolute",width:"max-content",opacity:0,fontSize:t||e.size.lg,zIndex:-1}))),Gr=({id:n,children:o,containerRef:i,parentSelector:a,width:s,maxHeight:c=200,offsetY:u,offsetX:l,centerY:f,centerX:p,direction:d})=>{const[h,g]=t.useState(),y=t.useRef(null);t.useLayoutEffect((()=>{const{current:e}=i||y;if(e&&d){const{scrollWidth:t,scrollHeight:n}=e,r="left"===d||"right"===d;g((r?t:n<c?n:c)+((r?l:u)||4))}}),[i,d]);const v=e.jsx(Zr,Object.assign({id:n,ref:i||y,offsetX:l,offsetY:u,width:s,maxHeight:c,centerY:f,centerX:p,optionsPosition:{direction:d,amount:h}},{children:o}));if(a){const e=document.querySelector(a);return e?r.createPortal(v,e):v}return v};Gr.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:s,contentPosition:c,color:u,accented:l}=t,f=a(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e.jsx(Yr,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:s,contentPosition:c,color:u,accented:l,tabIndex:s?-1:0},f,{children:n}))};const Zr=J.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),Yr=J.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),Xr=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Jr=(n,r,o,i,s)=>{const{selected:c}=s,u=((t,n,r,o)=>{if(t&&t.length>0)return Xr(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e.jsxs(Gr.Item,Object.assign({id:t.id,onClick:o},{children:[t.leftElement||null,t.header&&t.body?e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e.jsx(Qr,{children:t.header}),e.jsx(eo,{children:t.body})]})):t.label,t.rightElement&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:t.rightElement}))]}),t.id)}));return[]})(n,o,i,a(s,["selected"])),l=((e,n,r)=>e?Mr(e).map((e=>e?t.cloneElement(e,{setValue:n,close:r}):null)):[])(r,o,i),f=[...u,...l];return Mr(f).map(((e,n)=>e?t.cloneElement(e,{selected:c===n}):null))},Qr=J.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),eo=J.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),to=e=>t.Children.toArray(e).filter((e=>"string"==typeof e)).join("").trim(),no=r=>{var{onChange:o,onTextChange:i,afterShow:s,afterHide:c,onFocus:u,onBlur:l,onError:f,placeholder:p,placeholderColor:d,value:h,options:g,children:y,borderless:v,borderColor:m,backgroundColor:b,hideIcon:w,clearOnSelect:x,textOnly:_,width:C,height:S,isLoading:O,margin:k,marginTop:E,marginBottom:j,marginRight:A,marginLeft:T,label:M,id:P,name:D,trigger:R,centerY:I,centerX:N,offsetY:L,offsetX:B,direction:F,fontSize:z,description:V,disabled:H,invalid:U,search:K,filter:W,restrictInput:$,inputRef:q,optionsParent:G}=r,Z=a(r,["onChange","onTextChange","afterShow","afterHide","onFocus","onBlur","onError","placeholder","placeholderColor","value","options","children","borderless","borderColor","backgroundColor","hideIcon","clearOnSelect","textOnly","width","height","isLoading","margin","marginTop","marginBottom","marginRight","marginLeft","label","id","name","trigger","centerY","centerX","offsetY","offsetX","direction","fontSize","description","disabled","invalid","search","filter","restrictInput","inputRef","optionsParent"]);const[Y,X]=t.useState(""),[J,Q]=t.useState(""),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[oe,ie]=t.useState(!1),ae=t.useRef(null),{input:se}=n.useTheme(),ce={margin:k,marginTop:E,marginBottom:j,marginRight:A,marginLeft:T},ue=e=>{e&&e.stopPropagation(),!ee&&s&&s(),ee&&c&&c(),te((e=>!e))};t.useEffect((()=>{var e;if(ee&&K){null===(e=(q||ae).current)||void 0===e||e.focus()}}),[ee,K]),t.useEffect((()=>{f&&f(oe)}),[oe]),t.useEffect((()=>{i&&i(J)}),[J]);const le=st(ue,ee,G?[G,`${G} *`]:void 0),fe=(e,t)=>{if(void 0===e)return!1;return e.toString().toLowerCase()===t.toLowerCase()},pe=e=>{const t=ye().find((t=>{let n=fe(t.label,e);return!n&&"id"in t&&(n=fe(t.id,e)),n||!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value||(n=fe(t.value,e)),n}));return t},de=e=>"function"==typeof $?!$(e):$,he=e=>ge(null,e),ge=(e,t)=>{let n,r=!1;if("string"==typeof e){n=(e=>{if(de(e))return pe(e)||null;return{id:wr(),label:e,value:e}})(e);const t=de(e);null===n&&t&&(r=!0)}else n=e;ee&&ue(t),X((null==n?void 0:n.label)||""),o&&void 0!==n&&o(n),r?ie(!0):(oe&&ie(!1),x&&X(""),Q(""))};t.useEffect((()=>{""===h&&he()}),[h]);const ye=()=>{const e=Mr(y).map((e=>{const t=e;let n=t.props.displayText||"";return!M&&t.props.children&&(n=to(t.props.children)),{id:t.props.id,label:n,onClick:t.props.onClick}}));return[...Xr(g||[],{search:K,filter:W,inputText:J}),...e]},ve={options:ye(),select:ge,open:ue,close:ue,searchText:K?J:void 0,isOpen:ee,isFocused:ne},[me,be]=lt(ve),we=Jr(g||[],y,ge,ue,{selected:me,search:K,filter:W,inputText:J}),xe=ee?"caret-up":"caret-down",_e=_&&!H?d||se.color.default:void 0,Ce=a(Z,["onClear","phone"]);return e.jsx(ro,Object.assign({textOnly:_,altTrigger:!!R,width:C,height:S,focused:ne,search:K},ce,{children:e.jsxs(oo,Object.assign({ref:le},{children:[R?e.jsx(io,Object.assign({id:P,onClick:ue,tabIndex:0,onFocus:()=>re(!0),onBlur:()=>re(!1)},{children:R})):e.jsx(so,Object.assign({shake:oe},{children:e.jsx(Ur,Object.assign({},Ce,{ref:q||ae,id:P,name:D,label:M,fontSize:z,pointer:!0,preventFocus:!K,value:J||h||Y,placeholder:p||"Select",placeholderColor:_e,iconRight:w||O?void 0:xe,borderless:v,borderColor:m,backgroundColor:b,isLoading:O,textOnly:_,description:V,disabled:H,invalid:oe||U,onClick:ue,onChange:e=>{var t;const{value:n}=e.target,r=null===(t=(q||ae).current)||void 0===t?void 0:t.hasFocus;K?(Q(n),!ee&&r&&te(!0),oe&&ie(!1)):n||he(e);const o=pe(n),i=de(n),a=""===n||i&&!r;o&&!(K&&(!i||r))?ge(o,e):K&&!a||he(e)},onFocus:e=>{re(!0),u&&u(e)},onBlur:e=>{var t;if(re(!1),l&&l(e),K&&J&&e){const{relatedTarget:n}=e;(null===(t=null==be?void 0:be.current)||void 0===t?void 0:t.contains(n))||ge(J,e)}}}))})),ee&&we.length>0&&e.jsx(Gr,Object.assign({containerRef:be,parentSelector:G,width:!R&&!_||G?"100%":void 0,centerY:I,centerX:N,offsetY:L,offsetX:B,direction:F},{children:we}))]}))}))};no.Item=({value:t,displayText:n,setValue:r,close:o,children:i,contentPosition:a,color:s,accented:c,onClick:u,id:l})=>{const f=u?e=>{u&&u(e),o&&o()}:e=>{const o={id:l,label:n||to(i)||"",value:t};r&&r(o,e)};return e.jsx(Gr.Item,Object.assign({id:l,contentPosition:a,color:s,onClick:f,accented:c},{children:i}))};const ro=J.div({display:"flex",boxSizing:"border-box"},(({theme:{accent:e},focused:t,search:n,altTrigger:r,textOnly:o})=>({width:r||o?"max-content":"100%",flexDirection:"column",outline:!t||n||r?void 0:`${e} solid 1px`})),(({width:e,height:t})=>({width:e,height:t})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),oo=J.div({position:"relative",width:"100%",height:"inherit"}),io=J.div((({theme:{accent:e}})=>({display:"flex",height:"inherit","&:focus-visible":{outline:`${e} solid 1px`}}))),ao=n.keyframes({"10%":{transform:"translate3d(-1px, 0, 0)"},"30%":{transform:"translate3d(2px, 0, 0)"},"50%":{transform:"translate3d(-2px, 0, 0)"},"70%":{transform:"translate3d(2px, 0, 0)"},"90%":{transform:"translate3d(-1px, 0, 0)"}}),so=J.div((({shake:e})=>({"& input":{animation:e?`${ao} .5s linear`:void 0}}))),co=n=>{var{children:r,disabled:o,outline:i,size:s,small:c,large:u,secondary:l,negative:f,positive:p,caution:d,collapse:h}=n,g=a(n,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(r){const n=t.Children.count(r);return e.jsx(uo,Object.assign({},g,{children:t.Children.map(r,((e,r)=>{let a;if(n>1&&(a=0===r?"right":r===n-1?"left":"middle"),e){let n=e;"trigger"in e.props&&(n=e.props.trigger);const r=n,g=c||r.props.small,y=u||r.props.large,v=s||r.props.size,m=o||r.props.disabled,b=i||r.props.outline,w=l||r.props.secondary,x=f||r.props.negative,_=p||r.props.positive,C=d||r.props.caution,S=h||r.props.collapse,O=t.cloneElement(n,{joined:a,size:v,small:g,large:y,disabled:m,outline:b,secondary:w,negative:x,positive:_,caution:C,collapse:S});return"trigger"in e.props?t.cloneElement(e,{trigger:O}):O}return null}))}))}return null},uo=J.div((({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i})=>({display:"inline-flex",margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i}))),lo=({size:t})=>e.jsx(fo,Object.assign({className:"button-loader"},{children:e.jsx(Dr,{size:t})})),fo=J.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),po=t=>{const{content:n,children:r,dropdown:o,options:i}=t,s=a(t,["content","children","dropdown","options"]),c=n||r;return o&&i?e.jsx(go,Object.assign({options:i},s,{children:c})):e.jsx(ho,Object.assign({},s,{children:c}))};po.Group=co;const ho=t=>{var{children:r,onClick:o,icon:i,iconPosition:s,joined:c,size:u,small:l,large:f,isLoading:p,collapse:d,backgroundColor:h,color:g,type:y}=t,v=a(t,["children","onClick","icon","iconPosition","joined","size","small","large","isLoading","collapse","backgroundColor","color","type"]);const{button:m}=n.useTheme(),b=i&&(!r||d),w="right"===s;let x=u||"medium";l?x="small":f&&(x="large");const _=m[x],{iconSize:C}=_,S=d&&i;return e.jsxs(yo,Object.assign({},v,{type:y||"button",size:x,iconOnly:b,iconRight:w,joined:c,onClick:o,isLoading:p,color:g,backgroundColor:h},{children:[i?e.jsx(an,{size:C,name:i,marginRight:b||w?0:4,marginLeft:!b&&w?4:0,inheritColor:!0}):null,!S&&e.jsx("span",{children:r}),p&&e.jsx(lo,{size:C})]}))},go=n=>{var{children:r,options:o,onClick:i,afterShow:s,afterHide:c,secondary:u,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:v,isLoading:m,direction:b,collapse:w,width:x}=n,_=a(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width"]);const[C,S]=t.useState(!1),O={secondary:u,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:v},k=t.useMemo((()=>`button-dropdown-${wr()}`),[]);return e.jsx(vo,Object.assign({id:k},{children:e.jsxs(co,Object.assign({width:w?void 0:x},{children:[e.jsx(ho,Object.assign({},O,_,{width:x&&!w?"100%":void 0,collapse:w,isLoading:m,onClick:e=>{i&&i(e)}},{children:e.jsx(mo,{children:r})})),e.jsx(no,{options:o,direction:b,optionsParent:`#${k}`,afterShow:()=>{s&&s(),S(!0)},afterHide:()=>{c&&c(),S(!1)},trigger:e.jsx(ho,Object.assign({},O,{icon:C?"caret-up":"caret-down",preventPointerEvents:m,tabIndex:-1}))})]}))}))},yo=J.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:u})=>{const l=i||a&&!o,f=n[r],p=c||"max-content",{height:d,font:h,padding:g,iconOnlyPadding:y}=f,v=u||d,m=a||l?y:g;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:h,width:l?v:p,height:v,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:l?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${m}px`,position:"relative","&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:u,link:l})=>{const{button:f,size:p}=e;let d=f.primary;u?d=f.subtle:l?d=f.link:c?d=f.disabled:o?d=f.negative:i?d=f.positive:a?d=f.caution:s&&(d=f.secondary);const h=r?d.outlineBackground:d.background;let g=r?d.outlineColor:d.color;if(l||u){let e=f.subtle;l&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const y="left"===t||"middle"===t,v="right"===t||"middle"===t,m=n?p.xs:p.sm;return{backgroundColor:h.default,color:g.default,border:r&&!l?"1px solid":"none",borderColor:d.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?d.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?d.border.active:void 0},"&:disabled":{backgroundColor:u?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:y?0:void 0,borderBottomLeftRadius:y?0:void 0,borderTopRightRadius:v?0:void 0,borderBottomRightRadius:v?0:void 0,paddingLeft:y?m:void 0,paddingRight:v?m:void 0,borderRight:v?`1px solid ${r?d.border.default:d.divider}`:void 0,borderLeft:y?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?Qn:tr,i="dark"===e?tr:Qn;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),(({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o})=>({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o}))),vo=J.div({display:"inline-flex",flexDirection:"column",position:"relative"}),mo=J.div({marginRight:8}),bo=t=>{var{value:n,max:r=100,step:o=1,width:i,height:s,disabled:c,onChange:u}=t,l=a(t,["value","max","step","width","height","disabled","onChange"]);return e.jsx(xo,Object.assign({},l,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;u&&u(+t)},step:o,width:i,height:s,disabled:c,readOnly:!u}))},wo=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),xo=J.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i,margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l})=>{const f=o?e.scale0:e.scale1,p=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${p} 0%, ${p} ${t}%, ${f} ${t}%, ${f} 100%)`,"&::-webkit-slider-thumb":wo(e,o||i),"&::-moz-range-thumb":wo(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`},margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l}})),_o=t.forwardRef(((n,r)=>{var{src:o,title:i,width:s,infoPosition:c,centerAlignContent:u,small:l,collapsed:f,hideSliderOnStop:p,hideTimeOnStop:d,fontSizeTitle:h,fontSizeTime:g,onPlay:y,onPause:v,onStop:m}=n,b=a(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[w,x]=t.useState(!1),[_,C]=t.useState(!0),[S,O]=t.useState(0),[k,E]=t.useState(0),[j,A]=t.useState(""),[T,M]=t.useState(""),P=t.useRef(null),D=()=>{const{current:e}=P;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},R=()=>{const{current:e}=P;e&&e.pause()},I=()=>{const{current:e}=P;e&&e.load()};t.useImperativeHandle(r,(()=>({play:D,pause:R,stop:I})),[P,w]);const N=e=>{x(!1),C(!0),m&&m(e)};t.useEffect((()=>{(()=>{const{current:e}=P;!!e&&e.paused})()}),[w]);const L=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},B=_&&p,F=_&&d;return e.jsxs(Co,Object.assign({width:s},b,{children:[e.jsx(po,{outline:!0,small:l,icon:w?"pause":"play",onClick:()=>{w?R():D()},marginRight:8}),!f&&e.jsxs(So,Object.assign({alignDataTop:"top"===c},{children:[!B&&e.jsx(bo,{value:S,max:k,step:.1,onChange:e=>{(null==P?void 0:P.current)&&(P.current.currentTime=e)}}),e.jsxs(Oo,Object.assign({alignTop:"top"===c,noSlider:B,relative:u||B},{children:[i?e.jsx(ko,Object.assign({fontSize:h},{children:i})):e.jsx("div",{}),!F&&e.jsxs(ko,Object.assign({secondary:!0,fontSize:g},{children:[j&&!_?`${j} / `:"",T]}))]}))]})),e.jsxs("audio",Object.assign({ref:P,onPlay:e=>{x(!0),C(!1),y&&y(e)},onPause:e=>{x(!1),v&&v(e)},onEmptied:N,onEnded:N,onTimeUpdate:()=>{const{current:e}=P;if(e){const{currentTime:t}=e,n=L(t);O(t),A(n)}},onDurationChange:()=>{const{current:e}=P;if(e){const{duration:t}=e,n=L(t);E(t),M(n)}}},{children:[e.jsx("track",{kind:"captions"}),e.jsx("source",{src:o})]}))]}))})),Co=J.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),So=J.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),Oo=J.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),ko=J.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var Eo={};
|
|
24
|
+
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))o.call(n,l)&&(c[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(c[s[f]]=n[s[f]])}}return c}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV)var r=n(2),o=n(4),i=n(3),a={};e.exports=function(e,n,s,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var f;try{r("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",c||"React class",s,l,typeof e[l]),f=e[l](n,l,c,s,null,i)}catch(e){f=e}if(o(!f||f instanceof Error,"%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).",c||"React class",s,l,typeof f),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=u?u():"";o(!1,"Failed %s type: %s%s",s,f.message,null!=p?p:"")}}}}).call(t,n(0))},function(e,t,n){var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="insert",o="backspace",i=t.isInvalidKey=function(e){return"Backspace"!==e&&!/[0-9]/.test(e)},a=function(e){return e.start!==e.end};t.update=function(e,t,n){var r=a(t);return"Backspace"===n?s(e,t):function(e,t,n){return!(10===u(e).length&&!n||i(t))}(e,n,r)?c(e,t,n):{phoneNumber:e,cursorPosition:t.start}};var s=t.backspace=function(e,t){var n=t.start,r=t.end,i=e;if(!a(t)&&n>0&&e[n-1].match(/[0-9]/)&&(i=e.substring(0,n-1)+i.substring(n)),a(t)){var s=e.substring(n,r).replace(/\d/g,"");i=e.substring(0,n)+s+i.substring(r)}var c=p(e,i,t,o);return{phoneNumber:f(i),cursorPosition:c}},c=t.insert=function(e,t,n){t.start,t.end;var o=e;a(t)&&(o=l(e,n,t)),a(t)||(o=l(e,n,t));var i=p(e,o,t,r);return{phoneNumber:f(o),cursorPosition:i}},u=t.normalize=function(e){return e.replace(/\D/g,"")},l=t.insertChars=function(e,t,n){return e.substring(0,n.start)+t+e.substring(n.end)},f=t.format=function(e){var t=u(e),n=t.substring(0,3),r=t.substring(3,6),o=t.substring(6,11);return o?"("+n+") "+r+"-"+o:r?n+"-"+r:t},p=t.getCursorPosition=function(e,t,n,i){if(n.start===e.length)return f(t).length;if(0===n.start){if(i===o)return 0;if(i===r)return 1}if(i===o){var s=/[^0-9]/g;if(a(n)&&s.test(e.substring(n.start,n.end)))return n.start;if(!a(n)&&s.test(e[n.start-1]))return n.start-1}var c=e.substring(n.end).match(/[0-9]/g),u=c?c.length:0,l=f(t),p=d(l,u);return l.length-p},d=t.getCharCountFromEndWithNumbers=function(e,t){var n=e.split("");n.reverse();var r=0,o=n.reduce((function(e,n){return r===t?e:(/[0-9]/.test(n)&&r++,e+1)}),0);return r<t?0:o}}]);const Dr=t=>{var{size:n,color:r,margin:o,marginTop:i,marginBottom:s,marginRight:c,marginLeft:u}=t,l=a(t,["size","color","margin","marginTop","marginBottom","marginRight","marginLeft"]);const f={margin:o,marginTop:i,marginBottom:s,marginRight:c,marginLeft:u};return e.jsx(Ir,Object.assign({},f,{children:e.jsx(an,Object.assign({},l,{size:n,name:"loading",color:r,inheritColor:!r}))}))},Rr=n.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Ir=J.div({animation:`${Rr} 1s linear infinite`,width:"max-content",height:"max-content"},(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Nr=(e,n,r=!0)=>{const[o,i]=t.useState(!1);return{focused:o,handleFocus:t=>{r&&i(!0),e&&e(t)},handleBlur:e=>{i(!1),n&&n(e)}}},Lr=e=>!!e||null!=e&&""!==e,Br=J.div((({theme:{input:e},backgroundColor:t,borderRadius:n,borderless:r,borderColor:o,textOnly:i,focused:a,invalid:s,disabled:c,hasLabel:u,pointer:l})=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",minHeight:u?48:40,height:u?48:40,padding:"5px 16px",boxSizing:"border-box",color:c?e.labelColor.disabled:e.labelColor.default,backgroundColor:e.background.default,borderBottom:r?void 0:"1px solid",borderColor:o||e.borderColor.default,borderRadius:null!=n?n:4,borderBottomLeftRadius:0,borderBottomRightRadius:0,cursor:l?"pointer":void 0,"&:hover":{backgroundColor:c||i||t?void 0:e.background.hover,borderColor:a||c||r||s?void 0:e.borderColor.hover,Label:{color:a||c?void 0:e.labelColor.hover}}})),(({theme:{input:e},focused:t})=>({backgroundColor:t?e.background.focused:void 0,borderColor:t?e.borderColor.focused:void 0})),(({theme:{input:e},invalid:t})=>({borderColor:t?e.borderColor.error:void 0})),(({theme:{input:e},disabled:t,readOnly:n})=>({backgroundColor:t?e.background.disabled:void 0,borderColor:t?e.borderColor.disabled:void 0,pointerEvents:t||n?"none":void 0})),(({borderless:e})=>({border:e?"none":void 0})),(({theme:e,textOnly:t,disabled:n})=>({padding:t?0:void 0,backgroundColor:t?"transparent":void 0,width:t?"max-content":void 0,height:t?"max-content":void 0,minHeight:t?"max-content":void 0,color:t&&n?e.scale4:void 0})),(({backgroundColor:e})=>({backgroundColor:e})),(({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a})=>({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a}))),Fr=J.div((({readOnly:e})=>({display:"flex",flexDirection:"column",boxSizing:"border-box",width:"100%",position:"relative","& > label, & > input":{pointerEvents:e?"none":void 0,caretColor:e?"transparent":void 0}}))),zr=J.label((({theme:{font:e,input:t},filled:n,focused:r})=>({fontSize:n||r?e.size.sm:e.size.lg,color:n?t.labelColor.filled:t.labelColor.default,position:"relative",top:n||r?void 0:1})),(({theme:{input:e},disabled:t})=>({color:t?e.labelColor.disabled:void 0})),(({theme:{input:e},focused:t})=>({color:t?e.labelColor.focused:void 0})));var Vr={Container:Br,Wrapper:Fr,Label:zr,useInputFocus:Nr,isInputFilled:Lr};const Hr=(n,r)=>{const o=e=>t.cloneElement(e,r);return"string"==typeof n?e.jsx(an,Object.assign({name:n,inheritColor:!0},r)):"object"==typeof n&&"props"in n&&"trigger"in n.props?t.cloneElement(n,{trigger:o(n.props.trigger)}):"object"==typeof n&&"props"in n?o(n):e.jsx(an,Object.assign({},n,r))},Ur=t.forwardRef(((r,o)=>{var{id:i,label:s,placeholder:c,placeholderColor:u,description:l,isLoading:f,search:p,phone:d,textOnly:h,iconLeft:g,iconRight:y,invalid:v,borderless:m,borderRadius:b,borderColor:w,backgroundColor:x,fontSize:_,width:C,height:S,margin:O,marginLeft:k,marginRight:E,marginTop:j,marginBottom:A,containerRef:T,value:M,disabled:P,readOnly:D,preventFocus:R,pointer:I,onChange:N,onClick:L,onClear:B,onFocus:F,onBlur:z}=r,V=a(r,["id","label","placeholder","placeholderColor","description","isLoading","search","phone","textOnly","iconLeft","iconRight","invalid","borderless","borderRadius","borderColor","backgroundColor","fontSize","width","height","margin","marginLeft","marginRight","marginTop","marginBottom","containerRef","value","disabled","readOnly","preventFocus","pointer","onChange","onClick","onClear","onFocus","onBlur"]);const{focused:H,handleFocus:U,handleBlur:K}=Nr(F,z,!R&&!D),W=t.useRef(null),{color:$}=n.useTheme(),[q,G]=t.useState(h?50:void 0),Z=t.useRef(null);t.useLayoutEffect((()=>{if(h&&Z){const{current:e}=Z,t=null==e?void 0:e.offsetWidth;"number"==typeof t&&G(t+3)}}),[h,M,c,Z]);const Y=h?M||c:M,X=M&&B&&!f,J=()=>{H||U()},Q=()=>{H&&K()};t.useImperativeHandle(o,(()=>({focus:J,blur:Q,hasFocus:H}))),t.useEffect((()=>{var e;H&&(null===(e=W.current)||void 0===e||e.focus())}),[H]);return e.jsxs(Br,Object.assign({ref:T,invalid:v,textOnly:h,borderless:m||h,borderRadius:b,borderColor:w,backgroundColor:x,width:C,height:S,margin:O,marginLeft:k,marginRight:E,marginTop:j,marginBottom:A,focused:H,disabled:P,hasLabel:!!s,onClick:e=>{R||D||J(),L&&L(e)},pointer:I,readOnly:D},{children:[p&&e.jsx(an,{name:"search",marginRight:8,inheritColor:!0}),g&&Hr(g,{marginRight:8}),e.jsxs(Fr,Object.assign({readOnly:D||R},{children:[h&&e.jsx(qr,Object.assign({ref:Z,fontSize:_},{children:Y})),s&&!h&&e.jsx(zr,Object.assign({htmlFor:i||s,filled:Lr(M),focused:H,disabled:P},{children:s})),e.jsx(Kr,Object.assign({id:i||s,ref:W,value:M,placeholder:c,placeholderColor:u,onChange:e=>{if(d){const{value:t}=e.target,n=Pr.normalize(t);if(n.length>10)return;const r=Pr.format(n);N&&N(e,r,n)}else N&&N(e)},onFocus:U,onBlur:K,disabled:P,hide:!(Lr(M)||!s||H||h),width:q,fontSize:_},V))]})),y&&Hr(y),f&&e.jsx(Dr,{}),X&&e.jsx(Wr,Object.assign({onClick:B},{children:e.jsx(an,{name:"close-circle-outline",color:$.brand})})),l&&e.jsx($r,Object.assign({invalid:v},{children:l}))]}))})),Kr=J.input((({theme:{font:e,input:t,size:n,accent:r},fontSize:o,hide:i,disabled:a,width:s,placeholderColor:c})=>({outline:"none",border:"none",color:a?t.color.disabled:t.color.default,caretColor:r,backgroundColor:"transparent",paddingLeft:0,fontSize:o||e.size.lg,fontFamily:e.family.default,width:s||"100%",height:"100%",marginRight:n.sm,boxSizing:"border-box",opacity:i?0:1,position:i?"absolute":void 0,"&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active":{transition:"background-color 0s 50000s",WebkitTextFillColor:t.color.default},"&::placeholder":{color:c||t.color.placeholder,opacity:1}}))),Wr=J.div({height:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:4}),$r=J.div((({theme:{font:e,input:t},invalid:n})=>({color:n?t.color.descriptionError:t.color.description,fontSize:e.size.sm,position:"absolute",left:0,top:"calc(100% + 4px)"}))),qr=J.div((({theme:{font:e},fontSize:t})=>({position:"absolute",width:"max-content",opacity:0,fontSize:t||e.size.lg,zIndex:-1}))),Gr=({id:n,children:o,containerRef:i,parentSelector:a,width:s,maxHeight:c=200,offsetY:u,offsetX:l,centerY:f,centerX:p,direction:d})=>{const[h,g]=t.useState(),y=t.useRef(null);t.useLayoutEffect((()=>{const{current:e}=i||y;if(e&&d){const{scrollWidth:t,scrollHeight:n}=e,r="left"===d||"right"===d;g((r?t:n<c?n:c)+((r?l:u)||4))}}),[i,d]);const v=e.jsx(Zr,Object.assign({id:n,ref:i||y,offsetX:l,offsetY:u,width:s,maxHeight:c,centerY:f,centerX:p,optionsPosition:{direction:d,amount:h}},{children:o}));if(a){const e=document.querySelector(a);return e?r.createPortal(v,e):v}return v};Gr.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:s,contentPosition:c,color:u,accented:l}=t,f=a(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e.jsx(Yr,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:s,contentPosition:c,color:u,accented:l,tabIndex:s?-1:0},f,{children:n}))};const Zr=J.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),Yr=J.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),Xr=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Jr=(n,r,o,i,s)=>{const{selected:c}=s,u=((t,n,r,o)=>{if(t&&t.length>0)return Xr(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e.jsxs(Gr.Item,Object.assign({id:t.id,onClick:o},{children:[t.leftElement||null,t.header&&t.body?e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e.jsx(Qr,{children:t.header}),e.jsx(eo,{children:t.body})]})):t.label,t.rightElement&&e.jsx("div",Object.assign({style:{marginLeft:"auto"}},{children:t.rightElement}))]}),t.id)}));return[]})(n,o,i,a(s,["selected"])),l=((e,n,r)=>e?Mr(e).map((e=>e?t.cloneElement(e,{setValue:n,close:r}):null)):[])(r,o,i),f=[...u,...l];return Mr(f).map(((e,n)=>e?t.cloneElement(e,{selected:c===n}):null))},Qr=J.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),eo=J.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),to=e=>t.Children.toArray(e).filter((e=>"string"==typeof e)).join("").trim(),no=r=>{var{onChange:o,onTextChange:i,afterShow:s,afterHide:c,onFocus:u,onBlur:l,onError:f,placeholder:p,placeholderColor:d,value:h,options:g,children:y,borderless:v,borderColor:m,backgroundColor:b,hideIcon:w,clearOnSelect:x,textOnly:_,width:C,height:S,isLoading:O,margin:k,marginTop:E,marginBottom:j,marginRight:A,marginLeft:T,label:M,id:P,name:D,trigger:R,centerY:I,centerX:N,offsetY:L,offsetX:B,direction:F,fontSize:z,description:V,disabled:H,invalid:U,search:K,filter:W,restrictInput:$,inputRef:q,optionsParent:G}=r,Z=a(r,["onChange","onTextChange","afterShow","afterHide","onFocus","onBlur","onError","placeholder","placeholderColor","value","options","children","borderless","borderColor","backgroundColor","hideIcon","clearOnSelect","textOnly","width","height","isLoading","margin","marginTop","marginBottom","marginRight","marginLeft","label","id","name","trigger","centerY","centerX","offsetY","offsetX","direction","fontSize","description","disabled","invalid","search","filter","restrictInput","inputRef","optionsParent"]);const[Y,X]=t.useState(""),[J,Q]=t.useState(""),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[oe,ie]=t.useState(!1),ae=t.useRef(null),{input:se}=n.useTheme(),ce={margin:k,marginTop:E,marginBottom:j,marginRight:A,marginLeft:T},ue=e=>{e&&e.stopPropagation(),!ee&&s&&s(),ee&&c&&c(),te((e=>!e))};t.useEffect((()=>{var e;if(ee&&K){null===(e=(q||ae).current)||void 0===e||e.focus()}}),[ee,K]),t.useEffect((()=>{f&&f(oe)}),[oe]),t.useEffect((()=>{i&&i(J)}),[J]);const le=st(ue,ee,G?[G,`${G} *`]:void 0),fe=(e,t)=>{if(void 0===e)return!1;return e.toString().toLowerCase()===t.toLowerCase()},pe=e=>{const t=ye().find((t=>{let n=fe(t.label,e);return!n&&"id"in t&&(n=fe(t.id,e)),n||!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value||(n=fe(t.value,e)),n}));return t},de=e=>"function"==typeof $?!$(e):$,he=e=>ge(null,e),ge=(e,t)=>{let n,r=!1;if("string"==typeof e){n=(e=>{if(de(e))return pe(e)||null;return{id:wr(),label:e,value:e}})(e);const t=de(e);null===n&&t&&(r=!0)}else n=e;ee&&ue(t),X((null==n?void 0:n.label)||""),o&&void 0!==n&&o(n),r?ie(!0):(oe&&ie(!1),x&&X(""),Q(""))};t.useEffect((()=>{""===h&&he()}),[h]);const ye=()=>{const e=Mr(y).map((e=>{const t=e;let n=t.props.displayText||"";return!M&&t.props.children&&(n=to(t.props.children)),{id:t.props.id,label:n,onClick:t.props.onClick}}));return[...Xr(g||[],{search:K,filter:W,inputText:J}),...e]},ve={options:ye(),select:ge,open:ue,close:ue,searchText:K?J:void 0,isOpen:ee,isFocused:ne},[me,be]=lt(ve),we=Jr(g||[],y,ge,ue,{selected:me,search:K,filter:W,inputText:J}),xe=ee?"caret-up":"caret-down",_e=_&&!H?d||se.color.default:void 0,Ce=a(Z,["onClear","phone"]);return e.jsx(ro,Object.assign({textOnly:_,altTrigger:!!R,width:C,height:S,focused:ne,search:K},ce,{children:e.jsxs(oo,Object.assign({ref:le},{children:[R?e.jsx(io,Object.assign({id:P,onClick:ue,tabIndex:0,onFocus:()=>re(!0),onBlur:()=>re(!1)},{children:R})):e.jsx(so,Object.assign({shake:oe},{children:e.jsx(Ur,Object.assign({},Ce,{ref:q||ae,id:P,name:D,label:M,fontSize:z,pointer:!0,preventFocus:!K,value:J||h||Y,placeholder:p||"Select",placeholderColor:_e,iconRight:w||O?void 0:xe,borderless:v,borderColor:m,backgroundColor:b,isLoading:O,textOnly:_,description:V,disabled:H,invalid:oe||U,onClick:ue,onChange:e=>{var t;const{value:n}=e.target,r=null===(t=(q||ae).current)||void 0===t?void 0:t.hasFocus;K?(Q(n),!ee&&r&&te(!0),oe&&ie(!1)):n||he(e);const o=pe(n),i=de(n),a=""===n||i&&!r;o&&!(K&&(!i||r))?ge(o,e):K&&!a||he(e)},onFocus:e=>{re(!0),u&&u(e)},onBlur:e=>{var t;if(re(!1),l&&l(e),K&&J&&e){const{relatedTarget:n}=e;(null===(t=null==be?void 0:be.current)||void 0===t?void 0:t.contains(n))||ge(J,e)}}}))})),ee&&we.length>0&&e.jsx(Gr,Object.assign({containerRef:be,parentSelector:G,width:!R&&!_||G?"100%":void 0,centerY:I,centerX:N,offsetY:L,offsetX:B,direction:F},{children:we}))]}))}))};no.Item=({value:t,displayText:n,setValue:r,close:o,children:i,contentPosition:a,color:s,accented:c,onClick:u,id:l})=>{const f=u?e=>{u&&u(e),o&&o()}:e=>{const o={id:l,label:n||to(i)||"",value:t};r&&r(o,e)};return e.jsx(Gr.Item,Object.assign({id:l,contentPosition:a,color:s,onClick:f,accented:c},{children:i}))};const ro=J.div({display:"flex",boxSizing:"border-box"},(({theme:{accent:e},focused:t,search:n,altTrigger:r,textOnly:o})=>({width:r||o?"max-content":"100%",flexDirection:"column",outline:!t||n||r?void 0:`${e} solid 1px`})),(({width:e,height:t})=>({width:e,height:t})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),oo=J.div({position:"relative",width:"100%",height:"inherit"}),io=J.div((({theme:{accent:e}})=>({display:"flex",height:"inherit","&:focus-visible":{outline:`${e} solid 1px`}}))),ao=n.keyframes({"10%":{transform:"translate3d(-1px, 0, 0)"},"30%":{transform:"translate3d(2px, 0, 0)"},"50%":{transform:"translate3d(-2px, 0, 0)"},"70%":{transform:"translate3d(2px, 0, 0)"},"90%":{transform:"translate3d(-1px, 0, 0)"}}),so=J.div((({shake:e})=>({"& input":{animation:e?`${ao} .5s linear`:void 0}}))),co=n=>{var{children:r,disabled:o,outline:i,size:s,small:c,large:u,secondary:l,negative:f,positive:p,caution:d,collapse:h}=n,g=a(n,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(r){const n=t.Children.count(r);return e.jsx(uo,Object.assign({},g,{children:t.Children.map(r,((e,r)=>{let a;if(n>1&&(a=0===r?"right":r===n-1?"left":"middle"),e){let n=e;"trigger"in e.props&&(n=e.props.trigger);const r=n,g=c||r.props.small,y=u||r.props.large,v=s||r.props.size,m=o||r.props.disabled,b=i||r.props.outline,w=l||r.props.secondary,x=f||r.props.negative,_=p||r.props.positive,C=d||r.props.caution,S=h||r.props.collapse,O=t.cloneElement(n,{joined:a,size:v,small:g,large:y,disabled:m,outline:b,secondary:w,negative:x,positive:_,caution:C,collapse:S});return"trigger"in e.props?t.cloneElement(e,{trigger:O}):O}return null}))}))}return null},uo=J.div((({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i})=>({display:"inline-flex",margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i}))),lo=({size:t})=>e.jsx(fo,Object.assign({className:"button-loader"},{children:e.jsx(Dr,{size:t})})),fo=J.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),po=t=>{const{content:n,children:r,dropdown:o,options:i}=t,s=a(t,["content","children","dropdown","options"]),c=n||r;return o&&i?e.jsx(go,Object.assign({options:i},s,{children:c})):e.jsx(ho,Object.assign({},s,{children:c}))};po.Group=co;const ho=t=>{var{children:r,onClick:o,icon:i,iconPosition:s,iconColor:c,joined:u,size:l,small:f,large:p,isLoading:d,collapse:h,backgroundColor:g,color:y,type:v,animation:m}=t,b=a(t,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation"]);const{button:w}=n.useTheme(),x=i&&(!r||h),_="right"===s;let C=l||"medium";f?C="small":p&&(C="large");const S=w[C],{iconSize:O}=S,k=h&&i;return e.jsxs(yo,Object.assign({},b,{type:v||"button",size:C,iconOnly:x,iconRight:_,joined:u,onClick:o,isLoading:d,color:y,backgroundColor:g,animation:m},{children:[i?e.jsx(an,{size:O,name:i,marginRight:x||_?0:4,marginLeft:!x&&_?4:0,color:c,inheritColor:!c}):null,!k&&e.jsx("span",{children:r}),d&&e.jsx(lo,{size:O})]}))},go=n=>{var{children:r,options:o,onClick:i,afterShow:s,afterHide:c,secondary:u,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:v,isLoading:m,direction:b,collapse:w,width:x}=n,_=a(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width"]);const[C,S]=t.useState(!1),O={secondary:u,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:v},k=t.useMemo((()=>`button-dropdown-${wr()}`),[]);return e.jsx(vo,Object.assign({id:k},{children:e.jsxs(co,Object.assign({width:w?void 0:x},{children:[e.jsx(ho,Object.assign({},O,_,{width:x&&!w?"100%":void 0,collapse:w,isLoading:m,onClick:e=>{i&&i(e)}},{children:e.jsx(mo,{children:r})})),e.jsx(no,{options:o,direction:b,optionsParent:`#${k}`,afterShow:()=>{s&&s(),S(!0)},afterHide:()=>{c&&c(),S(!1)},trigger:e.jsx(ho,Object.assign({},O,{icon:C?"caret-up":"caret-down",preventPointerEvents:m,tabIndex:-1}))})]}))}))},yo=J.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:u,animation:l})=>{const f=i||a&&!o,p=n[r],d=c||"max-content",{height:h,font:g,padding:y,iconOnlyPadding:v}=p,m=u||h,b=a||f?v:y;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:d,height:m,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:f?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${b}px`,position:"relative",animation:l,"&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:u,link:l})=>{const{button:f,size:p}=e;let d=f.primary;u?d=f.subtle:l?d=f.link:c?d=f.disabled:o?d=f.negative:i?d=f.positive:a?d=f.caution:s&&(d=f.secondary);const h=r?d.outlineBackground:d.background;let g=r?d.outlineColor:d.color;if(l||u){let e=f.subtle;l&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const y="left"===t||"middle"===t,v="right"===t||"middle"===t,m=n?p.xs:p.sm;return{backgroundColor:h.default,color:g.default,border:r&&!l?"1px solid":"none",borderColor:d.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?d.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?d.border.active:void 0},"&:disabled":{backgroundColor:u?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:y?0:void 0,borderBottomLeftRadius:y?0:void 0,borderTopRightRadius:v?0:void 0,borderBottomRightRadius:v?0:void 0,paddingLeft:y?m:void 0,paddingRight:v?m:void 0,borderRight:v?`1px solid ${r?d.border.default:d.divider}`:void 0,borderLeft:y?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?Qn:tr,i="dark"===e?tr:Qn;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),(({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o})=>({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o}))),vo=J.div({display:"inline-flex",flexDirection:"column",position:"relative"}),mo=J.div({marginRight:8}),bo=t=>{var{value:n,max:r=100,step:o=1,width:i,height:s,disabled:c,onChange:u}=t,l=a(t,["value","max","step","width","height","disabled","onChange"]);return e.jsx(xo,Object.assign({},l,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;u&&u(+t)},step:o,width:i,height:s,disabled:c,readOnly:!u}))},wo=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),xo=J.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i,margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l})=>{const f=o?e.scale0:e.scale1,p=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${p} 0%, ${p} ${t}%, ${f} ${t}%, ${f} 100%)`,"&::-webkit-slider-thumb":wo(e,o||i),"&::-moz-range-thumb":wo(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`},margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l}})),_o=t.forwardRef(((n,r)=>{var{src:o,title:i,width:s,infoPosition:c,centerAlignContent:u,small:l,collapsed:f,hideSliderOnStop:p,hideTimeOnStop:d,fontSizeTitle:h,fontSizeTime:g,onPlay:y,onPause:v,onStop:m}=n,b=a(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[w,x]=t.useState(!1),[_,C]=t.useState(!0),[S,O]=t.useState(0),[k,E]=t.useState(0),[j,A]=t.useState(""),[T,M]=t.useState(""),P=t.useRef(null),D=()=>{const{current:e}=P;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},R=()=>{const{current:e}=P;e&&e.pause()},I=()=>{const{current:e}=P;e&&e.load()};t.useImperativeHandle(r,(()=>({play:D,pause:R,stop:I})),[P,w]);const N=e=>{x(!1),C(!0),m&&m(e)};t.useEffect((()=>{(()=>{const{current:e}=P;!!e&&e.paused})()}),[w]);const L=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},B=_&&p,F=_&&d;return e.jsxs(Co,Object.assign({width:s},b,{children:[e.jsx(po,{outline:!0,small:l,icon:w?"pause":"play",onClick:()=>{w?R():D()},marginRight:8}),!f&&e.jsxs(So,Object.assign({alignDataTop:"top"===c},{children:[!B&&e.jsx(bo,{value:S,max:k,step:.1,onChange:e=>{(null==P?void 0:P.current)&&(P.current.currentTime=e)}}),e.jsxs(Oo,Object.assign({alignTop:"top"===c,noSlider:B,relative:u||B},{children:[i?e.jsx(ko,Object.assign({fontSize:h},{children:i})):e.jsx("div",{}),!F&&e.jsxs(ko,Object.assign({secondary:!0,fontSize:g},{children:[j&&!_?`${j} / `:"",T]}))]}))]})),e.jsxs("audio",Object.assign({ref:P,onPlay:e=>{x(!0),C(!1),y&&y(e)},onPause:e=>{x(!1),v&&v(e)},onEmptied:N,onEnded:N,onTimeUpdate:()=>{const{current:e}=P;if(e){const{currentTime:t}=e,n=L(t);O(t),A(n)}},onDurationChange:()=>{const{current:e}=P;if(e){const{duration:t}=e,n=L(t);E(t),M(n)}}},{children:[e.jsx("track",{kind:"captions"}),e.jsx("source",{src:o})]}))]}))})),Co=J.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),So=J.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),Oo=J.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),ko=J.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var Eo={};
|
|
25
25
|
/*!
|
|
26
26
|
Copyright (c) 2018 Jed Watson.
|
|
27
27
|
Licensed under the MIT License (MIT), see
|
|
@@ -19,11 +19,11 @@ type AccordionProps = {
|
|
|
19
19
|
/** The background color of Item drawers */
|
|
20
20
|
innerBackground?: string;
|
|
21
21
|
/** The width of the Accordion */
|
|
22
|
-
width?: number;
|
|
22
|
+
width?: number | string;
|
|
23
23
|
/** The maxHeight of the Accordion. Drawers will scroll to accommodate */
|
|
24
|
-
maxHeight?: number;
|
|
24
|
+
maxHeight?: number | string;
|
|
25
25
|
/** The height of the Accordion. Drawers will scroll to accommodate */
|
|
26
|
-
height?: number;
|
|
26
|
+
height?: number | string;
|
|
27
27
|
} & Margin;
|
|
28
28
|
declare const Accordion: {
|
|
29
29
|
({ children, defaultItem, preventCollapse, triggers, spaced, background, innerBackground, width, maxHeight, height, ...rest }: AccordionProps): JSX.Element;
|
|
@@ -17,6 +17,8 @@ type ButtonBaseProps = {
|
|
|
17
17
|
icon?: IconNames;
|
|
18
18
|
/** Positions the icon to the left or right of the button text */
|
|
19
19
|
iconPosition?: 'left' | 'right';
|
|
20
|
+
/** Sets the icon's color independently of the button's color */
|
|
21
|
+
iconColor?: string;
|
|
20
22
|
/** Defines the size of the button */
|
|
21
23
|
size?: 'small' | 'medium' | 'large';
|
|
22
24
|
/** Reduces the size of the button */
|
|
@@ -27,6 +29,8 @@ type ButtonBaseProps = {
|
|
|
27
29
|
isLoading?: boolean;
|
|
28
30
|
/** Removes the text on a button if the button has an icon */
|
|
29
31
|
collapse?: boolean;
|
|
32
|
+
/** CSS Animation shorthand property */
|
|
33
|
+
animation?: string;
|
|
30
34
|
/** The function to be called when the button is clicked */
|
|
31
35
|
onClick?: (event: MouseEvent) => void;
|
|
32
36
|
/** Sets the text backgroundColor of the button */
|
package/build/esm/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
|
|
|
21
21
|
(c) Sindre Sorhus
|
|
22
22
|
@license MIT
|
|
23
23
|
*/
|
|
24
|
-
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))o.call(n,l)&&(c[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(c[s[f]]=n[s[f]])}}return c}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV)var r=n(2),o=n(4),i=n(3),a={};e.exports=function(e,n,s,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var f;try{r("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",c||"React class",s,l,typeof e[l]),f=e[l](n,l,c,s,null,i)}catch(e){f=e}if(o(!f||f instanceof Error,"%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).",c||"React class",s,l,typeof f),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=u?u():"";o(!1,"Failed %s type: %s%s",s,f.message,null!=p?p:"")}}}}).call(t,n(0))},function(e,t,n){var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="insert",o="backspace",i=t.isInvalidKey=function(e){return"Backspace"!==e&&!/[0-9]/.test(e)},a=function(e){return e.start!==e.end};t.update=function(e,t,n){var r=a(t);return"Backspace"===n?s(e,t):function(e,t,n){return!(10===u(e).length&&!n||i(t))}(e,n,r)?c(e,t,n):{phoneNumber:e,cursorPosition:t.start}};var s=t.backspace=function(e,t){var n=t.start,r=t.end,i=e;if(!a(t)&&n>0&&e[n-1].match(/[0-9]/)&&(i=e.substring(0,n-1)+i.substring(n)),a(t)){var s=e.substring(n,r).replace(/\d/g,"");i=e.substring(0,n)+s+i.substring(r)}var c=p(e,i,t,o);return{phoneNumber:f(i),cursorPosition:c}},c=t.insert=function(e,t,n){t.start,t.end;var o=e;a(t)&&(o=l(e,n,t)),a(t)||(o=l(e,n,t));var i=p(e,o,t,r);return{phoneNumber:f(o),cursorPosition:i}},u=t.normalize=function(e){return e.replace(/\D/g,"")},l=t.insertChars=function(e,t,n){return e.substring(0,n.start)+t+e.substring(n.end)},f=t.format=function(e){var t=u(e),n=t.substring(0,3),r=t.substring(3,6),o=t.substring(6,11);return o?"("+n+") "+r+"-"+o:r?n+"-"+r:t},p=t.getCursorPosition=function(e,t,n,i){if(n.start===e.length)return f(t).length;if(0===n.start){if(i===o)return 0;if(i===r)return 1}if(i===o){var s=/[^0-9]/g;if(a(n)&&s.test(e.substring(n.start,n.end)))return n.start;if(!a(n)&&s.test(e[n.start-1]))return n.start-1}var c=e.substring(n.end).match(/[0-9]/g),u=c?c.length:0,l=f(t),p=d(l,u);return l.length-p},d=t.getCharCountFromEndWithNumbers=function(e,t){var n=e.split("");n.reverse();var r=0,o=n.reduce((function(e,n){return r===t?e:(/[0-9]/.test(n)&&r++,e+1)}),0);return r<t?0:o}}]);const so=t=>{var{size:n,color:r,margin:o,marginTop:i,marginBottom:a,marginRight:s,marginLeft:c}=t,u=P(t,["size","color","margin","marginTop","marginBottom","marginRight","marginLeft"]);const l={margin:o,marginTop:i,marginBottom:a,marginRight:s,marginLeft:c};return e(uo,Object.assign({},l,{children:e(Rn,Object.assign({},u,{size:n,name:"loading",color:r,inheritColor:!r}))}))},co=k({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),uo=Oe.div({animation:`${co} 1s linear infinite`,width:"max-content",height:"max-content"},(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),lo=(e,t,n=!0)=>{const[r,o]=v(!1);return{focused:r,handleFocus:t=>{n&&o(!0),e&&e(t)},handleBlur:e=>{o(!1),t&&t(e)}}},fo=e=>!!e||null!=e&&""!==e,po=Oe.div((({theme:{input:e},backgroundColor:t,borderRadius:n,borderless:r,borderColor:o,textOnly:i,focused:a,invalid:s,disabled:c,hasLabel:u,pointer:l})=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",minHeight:u?48:40,height:u?48:40,padding:"5px 16px",boxSizing:"border-box",color:c?e.labelColor.disabled:e.labelColor.default,backgroundColor:e.background.default,borderBottom:r?void 0:"1px solid",borderColor:o||e.borderColor.default,borderRadius:null!=n?n:4,borderBottomLeftRadius:0,borderBottomRightRadius:0,cursor:l?"pointer":void 0,"&:hover":{backgroundColor:c||i||t?void 0:e.background.hover,borderColor:a||c||r||s?void 0:e.borderColor.hover,Label:{color:a||c?void 0:e.labelColor.hover}}})),(({theme:{input:e},focused:t})=>({backgroundColor:t?e.background.focused:void 0,borderColor:t?e.borderColor.focused:void 0})),(({theme:{input:e},invalid:t})=>({borderColor:t?e.borderColor.error:void 0})),(({theme:{input:e},disabled:t,readOnly:n})=>({backgroundColor:t?e.background.disabled:void 0,borderColor:t?e.borderColor.disabled:void 0,pointerEvents:t||n?"none":void 0})),(({borderless:e})=>({border:e?"none":void 0})),(({theme:e,textOnly:t,disabled:n})=>({padding:t?0:void 0,backgroundColor:t?"transparent":void 0,width:t?"max-content":void 0,height:t?"max-content":void 0,minHeight:t?"max-content":void 0,color:t&&n?e.scale4:void 0})),(({backgroundColor:e})=>({backgroundColor:e})),(({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a})=>({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a}))),ho=Oe.div((({readOnly:e})=>({display:"flex",flexDirection:"column",boxSizing:"border-box",width:"100%",position:"relative","& > label, & > input":{pointerEvents:e?"none":void 0,caretColor:e?"transparent":void 0}}))),go=Oe.label((({theme:{font:e,input:t},filled:n,focused:r})=>({fontSize:n||r?e.size.sm:e.size.lg,color:n?t.labelColor.filled:t.labelColor.default,position:"relative",top:n||r?void 0:1})),(({theme:{input:e},disabled:t})=>({color:t?e.labelColor.disabled:void 0})),(({theme:{input:e},focused:t})=>({color:t?e.labelColor.focused:void 0})));var yo={Container:po,Wrapper:ho,Label:go,useInputFocus:lo,isInputFilled:fo};const vo=(t,n)=>{const r=e=>h(e,n);return"string"==typeof t?e(Rn,Object.assign({name:t,inheritColor:!0},n)):"object"==typeof t&&"props"in t&&"trigger"in t.props?h(t,{trigger:r(t.props.trigger)}):"object"==typeof t&&"props"in t?r(t):e(Rn,Object.assign({},t,n))},mo=f(((n,r)=>{var{id:o,label:i,placeholder:a,placeholderColor:s,description:c,isLoading:u,search:l,phone:f,textOnly:p,iconLeft:d,iconRight:h,invalid:b,borderless:x,borderRadius:_,borderColor:C,backgroundColor:O,fontSize:S,width:k,height:A,margin:T,marginLeft:j,marginRight:M,marginTop:D,marginBottom:R,containerRef:I,value:N,disabled:L,readOnly:B,preventFocus:F,pointer:z,onChange:V,onClick:H,onClear:U,onFocus:K,onBlur:W}=n,$=P(n,["id","label","placeholder","placeholderColor","description","isLoading","search","phone","textOnly","iconLeft","iconRight","invalid","borderless","borderRadius","borderColor","backgroundColor","fontSize","width","height","margin","marginLeft","marginRight","marginTop","marginBottom","containerRef","value","disabled","readOnly","preventFocus","pointer","onChange","onClick","onClear","onFocus","onBlur"]);const{focused:q,handleFocus:G,handleBlur:Z}=lo(K,W,!F&&!B),Y=g(null),{color:X}=E(),[J,Q]=v(p?50:void 0),ee=g(null);m((()=>{if(p&&ee){const{current:e}=ee,t=null==e?void 0:e.offsetWidth;"number"==typeof t&&Q(t+3)}}),[p,N,a,ee]);const te=p?N||a:N,ne=N&&U&&!u,re=()=>{q||G()},oe=()=>{q&&Z()};w(r,(()=>({focus:re,blur:oe,hasFocus:q}))),y((()=>{var e;q&&(null===(e=Y.current)||void 0===e||e.focus())}),[q]);return t(po,Object.assign({ref:I,invalid:b,textOnly:p,borderless:x||p,borderRadius:_,borderColor:C,backgroundColor:O,width:k,height:A,margin:T,marginLeft:j,marginRight:M,marginTop:D,marginBottom:R,focused:q,disabled:L,hasLabel:!!i,onClick:e=>{F||B||re(),H&&H(e)},pointer:z,readOnly:B},{children:[l&&e(Rn,{name:"search",marginRight:8,inheritColor:!0}),d&&vo(d,{marginRight:8}),t(ho,Object.assign({readOnly:B||F},{children:[p&&e(_o,Object.assign({ref:ee,fontSize:S},{children:te})),i&&!p&&e(go,Object.assign({htmlFor:o||i,filled:fo(N),focused:q,disabled:L},{children:i})),e(bo,Object.assign({id:o||i,ref:Y,value:N,placeholder:a,placeholderColor:s,onChange:e=>{if(f){const{value:t}=e.target,n=ao.normalize(t);if(n.length>10)return;const r=ao.format(n);V&&V(e,r,n)}else V&&V(e)},onFocus:G,onBlur:Z,disabled:L,hide:!(fo(N)||!i||q||p),width:J,fontSize:S},$))]})),h&&vo(h),u&&e(so,{}),ne&&e(wo,Object.assign({onClick:U},{children:e(Rn,{name:"close-circle-outline",color:X.brand})})),c&&e(xo,Object.assign({invalid:b},{children:c}))]}))})),bo=Oe.input((({theme:{font:e,input:t,size:n,accent:r},fontSize:o,hide:i,disabled:a,width:s,placeholderColor:c})=>({outline:"none",border:"none",color:a?t.color.disabled:t.color.default,caretColor:r,backgroundColor:"transparent",paddingLeft:0,fontSize:o||e.size.lg,fontFamily:e.family.default,width:s||"100%",height:"100%",marginRight:n.sm,boxSizing:"border-box",opacity:i?0:1,position:i?"absolute":void 0,"&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active":{transition:"background-color 0s 50000s",WebkitTextFillColor:t.color.default},"&::placeholder":{color:c||t.color.placeholder,opacity:1}}))),wo=Oe.div({height:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:4}),xo=Oe.div((({theme:{font:e,input:t},invalid:n})=>({color:n?t.color.descriptionError:t.color.description,fontSize:e.size.sm,position:"absolute",left:0,top:"calc(100% + 4px)"}))),_o=Oe.div((({theme:{font:e},fontSize:t})=>({position:"absolute",width:"max-content",opacity:0,fontSize:t||e.size.lg,zIndex:-1}))),Co=({id:t,children:n,containerRef:r,parentSelector:o,width:i,maxHeight:a=200,offsetY:s,offsetX:c,centerY:u,centerX:l,direction:f})=>{const[p,d]=v(),h=g(null);m((()=>{const{current:e}=r||h;if(e&&f){const{scrollWidth:t,scrollHeight:n}=e,r="left"===f||"right"===f;d((r?t:n<a?n:a)+((r?c:s)||4))}}),[r,f]);const y=e(Oo,Object.assign({id:t,ref:r||h,offsetX:c,offsetY:s,width:i,maxHeight:a,centerY:u,centerX:l,optionsPosition:{direction:f,amount:p}},{children:n}));if(o){const e=document.querySelector(o);return e?T.createPortal(y,e):y}return y};Co.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:u}=t,l=P(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e(So,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:u,tabIndex:a?-1:0},l,{children:n}))};const Oo=Oe.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),So=Oe.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),ko=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Eo=(n,r,o,i,a)=>{const{selected:s}=a,c=((n,r,o,i)=>{if(n&&n.length>0)return ko(n,i).map((n=>{const i=n.onClick?e=>{n.onClick&&n.onClick(e),o()}:e=>r(n,e);return t(Co.Item,Object.assign({id:n.id,onClick:i},{children:[n.leftElement||null,n.header&&n.body?t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e(Ao,{children:n.header}),e(To,{children:n.body})]})):n.label,n.rightElement&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:n.rightElement}))]}),n.id)}));return[]})(n,o,i,P(a,["selected"])),u=((e,t,n)=>e?io(e).map((e=>e?h(e,{setValue:t,close:n}):null)):[])(r,o,i),l=[...c,...u];return io(l).map(((e,t)=>e?h(e,{selected:s===t}):null))},Ao=Oe.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),To=Oe.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),jo=e=>p.toArray(e).filter((e=>"string"==typeof e)).join("").trim(),Mo=n=>{var{onChange:r,onTextChange:o,afterShow:i,afterHide:a,onFocus:s,onBlur:c,onError:u,placeholder:l,placeholderColor:f,value:p,options:d,children:h,borderless:m,borderColor:b,backgroundColor:w,hideIcon:x,clearOnSelect:_,textOnly:C,width:O,height:S,isLoading:k,margin:A,marginTop:T,marginBottom:j,marginRight:M,marginLeft:D,label:R,id:I,name:N,trigger:L,centerY:B,centerX:F,offsetY:z,offsetX:V,direction:H,fontSize:U,description:K,disabled:W,invalid:$,search:q,filter:G,restrictInput:Z,inputRef:Y,optionsParent:X}=n,J=P(n,["onChange","onTextChange","afterShow","afterHide","onFocus","onBlur","onError","placeholder","placeholderColor","value","options","children","borderless","borderColor","backgroundColor","hideIcon","clearOnSelect","textOnly","width","height","isLoading","margin","marginTop","marginBottom","marginRight","marginLeft","label","id","name","trigger","centerY","centerX","offsetY","offsetX","direction","fontSize","description","disabled","invalid","search","filter","restrictInput","inputRef","optionsParent"]);const[Q,ee]=v(""),[te,ne]=v(""),[re,oe]=v(!1),[ie,ae]=v(!1),[se,ce]=v(!1),ue=g(null),{input:le}=E(),fe={margin:A,marginTop:T,marginBottom:j,marginRight:M,marginLeft:D},pe=e=>{e&&e.stopPropagation(),!re&&i&&i(),re&&a&&a(),oe((e=>!e))};y((()=>{var e;if(re&&q){null===(e=(Y||ue).current)||void 0===e||e.focus()}}),[re,q]),y((()=>{u&&u(se)}),[se]),y((()=>{o&&o(te)}),[te]);const de=Dt(pe,re,X?[X,`${X} *`]:void 0),he=(e,t)=>{if(void 0===e)return!1;return e.toString().toLowerCase()===t.toLowerCase()},ge=e=>{const t=be().find((t=>{let n=he(t.label,e);return!n&&"id"in t&&(n=he(t.id,e)),n||!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value||(n=he(t.value,e)),n}));return t},ye=e=>"function"==typeof Z?!Z(e):Z,ve=e=>me(null,e),me=(e,t)=>{let n,o=!1;if("string"==typeof e){n=(e=>{if(ye(e))return ge(e)||null;return{id:Gr(),label:e,value:e}})(e);const t=ye(e);null===n&&t&&(o=!0)}else n=e;re&&pe(t),ee((null==n?void 0:n.label)||""),r&&void 0!==n&&r(n),o?ce(!0):(se&&ce(!1),_&&ee(""),ne(""))};y((()=>{""===p&&ve()}),[p]);const be=()=>{const e=io(h).map((e=>{const t=e;let n=t.props.displayText||"";return!R&&t.props.children&&(n=jo(t.props.children)),{id:t.props.id,label:n,onClick:t.props.onClick}}));return[...ko(d||[],{search:q,filter:G,inputText:te}),...e]},we={options:be(),select:me,open:pe,close:pe,searchText:q?te:void 0,isOpen:re,isFocused:ie},[xe,_e]=Bt(we),Ce=Eo(d||[],h,me,pe,{selected:xe,search:q,filter:G,inputText:te}),Oe=re?"caret-up":"caret-down",Se=C&&!W?f||le.color.default:void 0,ke=P(J,["onClear","phone"]);return e(Po,Object.assign({textOnly:C,altTrigger:!!L,width:O,height:S,focused:ie,search:q},fe,{children:t(Do,Object.assign({ref:de},{children:[L?e(Ro,Object.assign({id:I,onClick:pe,tabIndex:0,onFocus:()=>ae(!0),onBlur:()=>ae(!1)},{children:L})):e(No,Object.assign({shake:se},{children:e(mo,Object.assign({},ke,{ref:Y||ue,id:I,name:N,label:R,fontSize:U,pointer:!0,preventFocus:!q,value:te||p||Q,placeholder:l||"Select",placeholderColor:Se,iconRight:x||k?void 0:Oe,borderless:m,borderColor:b,backgroundColor:w,isLoading:k,textOnly:C,description:K,disabled:W,invalid:se||$,onClick:pe,onChange:e=>{var t;const{value:n}=e.target,r=null===(t=(Y||ue).current)||void 0===t?void 0:t.hasFocus;q?(ne(n),!re&&r&&oe(!0),se&&ce(!1)):n||ve(e);const o=ge(n),i=ye(n),a=""===n||i&&!r;o&&!(q&&(!i||r))?me(o,e):q&&!a||ve(e)},onFocus:e=>{ae(!0),s&&s(e)},onBlur:e=>{var t;if(ae(!1),c&&c(e),q&&te&&e){const{relatedTarget:n}=e;(null===(t=null==_e?void 0:_e.current)||void 0===t?void 0:t.contains(n))||me(te,e)}}}))})),re&&Ce.length>0&&e(Co,Object.assign({containerRef:_e,parentSelector:X,width:!L&&!C||X?"100%":void 0,centerY:B,centerX:F,offsetY:z,offsetX:V,direction:H},{children:Ce}))]}))}))};Mo.Item=({value:t,displayText:n,setValue:r,close:o,children:i,contentPosition:a,color:s,accented:c,onClick:u,id:l})=>{const f=u?e=>{u&&u(e),o&&o()}:e=>{const o={id:l,label:n||jo(i)||"",value:t};r&&r(o,e)};return e(Co.Item,Object.assign({id:l,contentPosition:a,color:s,onClick:f,accented:c},{children:i}))};const Po=Oe.div({display:"flex",boxSizing:"border-box"},(({theme:{accent:e},focused:t,search:n,altTrigger:r,textOnly:o})=>({width:r||o?"max-content":"100%",flexDirection:"column",outline:!t||n||r?void 0:`${e} solid 1px`})),(({width:e,height:t})=>({width:e,height:t})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Do=Oe.div({position:"relative",width:"100%",height:"inherit"}),Ro=Oe.div((({theme:{accent:e}})=>({display:"flex",height:"inherit","&:focus-visible":{outline:`${e} solid 1px`}}))),Io=k({"10%":{transform:"translate3d(-1px, 0, 0)"},"30%":{transform:"translate3d(2px, 0, 0)"},"50%":{transform:"translate3d(-2px, 0, 0)"},"70%":{transform:"translate3d(2px, 0, 0)"},"90%":{transform:"translate3d(-1px, 0, 0)"}}),No=Oe.div((({shake:e})=>({"& input":{animation:e?`${Io} .5s linear`:void 0}}))),Lo=t=>{var{children:n,disabled:r,outline:o,size:i,small:a,large:s,secondary:c,negative:u,positive:l,caution:f,collapse:d}=t,g=P(t,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(n){const t=p.count(n);return e(Bo,Object.assign({},g,{children:p.map(n,((e,n)=>{let p;if(t>1&&(p=0===n?"right":n===t-1?"left":"middle"),e){let t=e;"trigger"in e.props&&(t=e.props.trigger);const n=t,g=a||n.props.small,y=s||n.props.large,v=i||n.props.size,m=r||n.props.disabled,b=o||n.props.outline,w=c||n.props.secondary,x=u||n.props.negative,_=l||n.props.positive,C=f||n.props.caution,O=d||n.props.collapse,S=h(t,{joined:p,size:v,small:g,large:y,disabled:m,outline:b,secondary:w,negative:x,positive:_,caution:C,collapse:O});return"trigger"in e.props?h(e,{trigger:S}):S}return null}))}))}return null},Bo=Oe.div((({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i})=>({display:"inline-flex",margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i}))),Fo=({size:t})=>e(zo,Object.assign({className:"button-loader"},{children:e(so,{size:t})})),zo=Oe.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),Vo=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=P(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e(Uo,Object.assign({options:i},a,{children:s})):e(Ho,Object.assign({},a,{children:s}))};Vo.Group=Lo;const Ho=n=>{var{children:r,onClick:o,icon:i,iconPosition:a,joined:s,size:c,small:u,large:l,isLoading:f,collapse:p,backgroundColor:d,color:h,type:g}=n,y=P(n,["children","onClick","icon","iconPosition","joined","size","small","large","isLoading","collapse","backgroundColor","color","type"]);const{button:v}=E(),m=i&&(!r||p),b="right"===a;let w=c||"medium";u?w="small":l&&(w="large");const x=v[w],{iconSize:_}=x,C=p&&i;return t(Ko,Object.assign({},y,{type:g||"button",size:w,iconOnly:m,iconRight:b,joined:s,onClick:o,isLoading:f,color:h,backgroundColor:d},{children:[i?e(Rn,{size:_,name:i,marginRight:m||b?0:4,marginLeft:!m&&b?4:0,inheritColor:!0}):null,!C&&e("span",{children:r}),f&&e(Fo,{size:_})]}))},Uo=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:c,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:m,isLoading:b,direction:w,collapse:x,width:_}=n,C=P(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width"]);const[O,S]=v(!1),k={secondary:c,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:m},E=u((()=>`button-dropdown-${Gr()}`),[]);return e(Wo,Object.assign({id:E},{children:t(Lo,Object.assign({width:x?void 0:_},{children:[e(Ho,Object.assign({},k,C,{width:_&&!x?"100%":void 0,collapse:x,isLoading:b,onClick:e=>{i&&i(e)}},{children:e($o,{children:r})})),e(Mo,{options:o,direction:w,optionsParent:`#${E}`,afterShow:()=>{a&&a(),S(!0)},afterHide:()=>{s&&s(),S(!1)},trigger:e(Ho,Object.assign({},k,{icon:O?"caret-up":"caret-down",preventPointerEvents:b,tabIndex:-1}))})]}))}))},Ko=Oe.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:u})=>{const l=i||a&&!o,f=n[r],p=c||"max-content",{height:d,font:h,padding:g,iconOnlyPadding:y}=f,v=u||d,m=a||l?y:g;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:h,width:l?v:p,height:v,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:l?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${m}px`,position:"relative","&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:u,link:l})=>{const{button:f,size:p}=e;let d=f.primary;u?d=f.subtle:l?d=f.link:c?d=f.disabled:o?d=f.negative:i?d=f.positive:a?d=f.caution:s&&(d=f.secondary);const h=r?d.outlineBackground:d.background;let g=r?d.outlineColor:d.color;if(l||u){let e=f.subtle;l&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const y="left"===t||"middle"===t,v="right"===t||"middle"===t,m=n?p.xs:p.sm;return{backgroundColor:h.default,color:g.default,border:r&&!l?"1px solid":"none",borderColor:d.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?d.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?d.border.active:void 0},"&:disabled":{backgroundColor:u?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:y?0:void 0,borderBottomLeftRadius:y?0:void 0,borderTopRightRadius:v?0:void 0,borderBottomRightRadius:v?0:void 0,paddingLeft:y?m:void 0,paddingRight:v?m:void 0,borderRight:v?`1px solid ${r?d.border.default:d.divider}`:void 0,borderLeft:y?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?Er:Tr,i="dark"===e?Tr:Er;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),(({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o})=>({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o}))),Wo=Oe.div({display:"inline-flex",flexDirection:"column",position:"relative"}),$o=Oe.div({marginRight:8}),qo=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:c}=t,u=P(t,["value","max","step","width","height","disabled","onChange"]);return e(Zo,Object.assign({},u,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;c&&c(+t)},step:o,width:i,height:a,disabled:s,readOnly:!c}))},Go=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),Zo=Oe.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i,margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l})=>{const f=o?e.scale0:e.scale1,p=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${p} 0%, ${p} ${t}%, ${f} ${t}%, ${f} 100%)`,"&::-webkit-slider-thumb":Go(e,o||i),"&::-moz-range-thumb":Go(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`},margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l}})),Yo=f(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:c,small:u,collapsed:l,hideSliderOnStop:f,hideTimeOnStop:p,fontSizeTitle:d,fontSizeTime:h,onPlay:m,onPause:b,onStop:x}=n,_=P(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[C,O]=v(!1),[S,k]=v(!0),[E,A]=v(0),[T,j]=v(0),[M,D]=v(""),[R,I]=v(""),N=g(null),L=()=>{const{current:e}=N;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},B=()=>{const{current:e}=N;e&&e.pause()},F=()=>{const{current:e}=N;e&&e.load()};w(r,(()=>({play:L,pause:B,stop:F})),[N,C]);const z=e=>{O(!1),k(!0),x&&x(e)};y((()=>{(()=>{const{current:e}=N;!!e&&e.paused})()}),[C]);const V=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},H=S&&f,U=S&&p;return t(Xo,Object.assign({width:a},_,{children:[e(Vo,{outline:!0,small:u,icon:C?"pause":"play",onClick:()=>{C?B():L()},marginRight:8}),!l&&t(Jo,Object.assign({alignDataTop:"top"===s},{children:[!H&&e(qo,{value:E,max:T,step:.1,onChange:e=>{(null==N?void 0:N.current)&&(N.current.currentTime=e)}}),t(Qo,Object.assign({alignTop:"top"===s,noSlider:H,relative:c||H},{children:[i?e(ei,Object.assign({fontSize:d},{children:i})):e("div",{}),!U&&t(ei,Object.assign({secondary:!0,fontSize:h},{children:[M&&!S?`${M} / `:"",R]}))]}))]})),t("audio",Object.assign({ref:N,onPlay:e=>{O(!0),k(!1),m&&m(e)},onPause:e=>{O(!1),b&&b(e)},onEmptied:z,onEnded:z,onTimeUpdate:()=>{const{current:e}=N;if(e){const{currentTime:t}=e,n=V(t);A(t),D(n)}},onDurationChange:()=>{const{current:e}=N;if(e){const{duration:t}=e,n=V(t);j(t),I(n)}}},{children:[e("track",{kind:"captions"}),e("source",{src:o})]}))]}))})),Xo=Oe.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Jo=Oe.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),Qo=Oe.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),ei=Oe.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var ti={};
|
|
24
|
+
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))o.call(n,l)&&(c[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(c[s[f]]=n[s[f]])}}return c}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV)var r=n(2),o=n(4),i=n(3),a={};e.exports=function(e,n,s,c,u){if("production"!==t.env.NODE_ENV)for(var l in e)if(e.hasOwnProperty(l)){var f;try{r("function"==typeof e[l],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",c||"React class",s,l,typeof e[l]),f=e[l](n,l,c,s,null,i)}catch(e){f=e}if(o(!f||f instanceof Error,"%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).",c||"React class",s,l,typeof f),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=u?u():"";o(!1,"Failed %s type: %s%s",s,f.message,null!=p?p:"")}}}}).call(t,n(0))},function(e,t,n){var r=n(1),o=n(2),i=n(3);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="insert",o="backspace",i=t.isInvalidKey=function(e){return"Backspace"!==e&&!/[0-9]/.test(e)},a=function(e){return e.start!==e.end};t.update=function(e,t,n){var r=a(t);return"Backspace"===n?s(e,t):function(e,t,n){return!(10===u(e).length&&!n||i(t))}(e,n,r)?c(e,t,n):{phoneNumber:e,cursorPosition:t.start}};var s=t.backspace=function(e,t){var n=t.start,r=t.end,i=e;if(!a(t)&&n>0&&e[n-1].match(/[0-9]/)&&(i=e.substring(0,n-1)+i.substring(n)),a(t)){var s=e.substring(n,r).replace(/\d/g,"");i=e.substring(0,n)+s+i.substring(r)}var c=p(e,i,t,o);return{phoneNumber:f(i),cursorPosition:c}},c=t.insert=function(e,t,n){t.start,t.end;var o=e;a(t)&&(o=l(e,n,t)),a(t)||(o=l(e,n,t));var i=p(e,o,t,r);return{phoneNumber:f(o),cursorPosition:i}},u=t.normalize=function(e){return e.replace(/\D/g,"")},l=t.insertChars=function(e,t,n){return e.substring(0,n.start)+t+e.substring(n.end)},f=t.format=function(e){var t=u(e),n=t.substring(0,3),r=t.substring(3,6),o=t.substring(6,11);return o?"("+n+") "+r+"-"+o:r?n+"-"+r:t},p=t.getCursorPosition=function(e,t,n,i){if(n.start===e.length)return f(t).length;if(0===n.start){if(i===o)return 0;if(i===r)return 1}if(i===o){var s=/[^0-9]/g;if(a(n)&&s.test(e.substring(n.start,n.end)))return n.start;if(!a(n)&&s.test(e[n.start-1]))return n.start-1}var c=e.substring(n.end).match(/[0-9]/g),u=c?c.length:0,l=f(t),p=d(l,u);return l.length-p},d=t.getCharCountFromEndWithNumbers=function(e,t){var n=e.split("");n.reverse();var r=0,o=n.reduce((function(e,n){return r===t?e:(/[0-9]/.test(n)&&r++,e+1)}),0);return r<t?0:o}}]);const so=t=>{var{size:n,color:r,margin:o,marginTop:i,marginBottom:a,marginRight:s,marginLeft:c}=t,u=P(t,["size","color","margin","marginTop","marginBottom","marginRight","marginLeft"]);const l={margin:o,marginTop:i,marginBottom:a,marginRight:s,marginLeft:c};return e(uo,Object.assign({},l,{children:e(Rn,Object.assign({},u,{size:n,name:"loading",color:r,inheritColor:!r}))}))},co=k({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),uo=Oe.div({animation:`${co} 1s linear infinite`,width:"max-content",height:"max-content"},(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),lo=(e,t,n=!0)=>{const[r,o]=v(!1);return{focused:r,handleFocus:t=>{n&&o(!0),e&&e(t)},handleBlur:e=>{o(!1),t&&t(e)}}},fo=e=>!!e||null!=e&&""!==e,po=Oe.div((({theme:{input:e},backgroundColor:t,borderRadius:n,borderless:r,borderColor:o,textOnly:i,focused:a,invalid:s,disabled:c,hasLabel:u,pointer:l})=>({display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",minHeight:u?48:40,height:u?48:40,padding:"5px 16px",boxSizing:"border-box",color:c?e.labelColor.disabled:e.labelColor.default,backgroundColor:e.background.default,borderBottom:r?void 0:"1px solid",borderColor:o||e.borderColor.default,borderRadius:null!=n?n:4,borderBottomLeftRadius:0,borderBottomRightRadius:0,cursor:l?"pointer":void 0,"&:hover":{backgroundColor:c||i||t?void 0:e.background.hover,borderColor:a||c||r||s?void 0:e.borderColor.hover,Label:{color:a||c?void 0:e.labelColor.hover}}})),(({theme:{input:e},focused:t})=>({backgroundColor:t?e.background.focused:void 0,borderColor:t?e.borderColor.focused:void 0})),(({theme:{input:e},invalid:t})=>({borderColor:t?e.borderColor.error:void 0})),(({theme:{input:e},disabled:t,readOnly:n})=>({backgroundColor:t?e.background.disabled:void 0,borderColor:t?e.borderColor.disabled:void 0,pointerEvents:t||n?"none":void 0})),(({borderless:e})=>({border:e?"none":void 0})),(({theme:e,textOnly:t,disabled:n})=>({padding:t?0:void 0,backgroundColor:t?"transparent":void 0,width:t?"max-content":void 0,height:t?"max-content":void 0,minHeight:t?"max-content":void 0,color:t&&n?e.scale4:void 0})),(({backgroundColor:e})=>({backgroundColor:e})),(({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a})=>({width:e,height:t,margin:n,marginLeft:r,marginRight:o,marginTop:i,marginBottom:a}))),ho=Oe.div((({readOnly:e})=>({display:"flex",flexDirection:"column",boxSizing:"border-box",width:"100%",position:"relative","& > label, & > input":{pointerEvents:e?"none":void 0,caretColor:e?"transparent":void 0}}))),go=Oe.label((({theme:{font:e,input:t},filled:n,focused:r})=>({fontSize:n||r?e.size.sm:e.size.lg,color:n?t.labelColor.filled:t.labelColor.default,position:"relative",top:n||r?void 0:1})),(({theme:{input:e},disabled:t})=>({color:t?e.labelColor.disabled:void 0})),(({theme:{input:e},focused:t})=>({color:t?e.labelColor.focused:void 0})));var yo={Container:po,Wrapper:ho,Label:go,useInputFocus:lo,isInputFilled:fo};const vo=(t,n)=>{const r=e=>h(e,n);return"string"==typeof t?e(Rn,Object.assign({name:t,inheritColor:!0},n)):"object"==typeof t&&"props"in t&&"trigger"in t.props?h(t,{trigger:r(t.props.trigger)}):"object"==typeof t&&"props"in t?r(t):e(Rn,Object.assign({},t,n))},mo=f(((n,r)=>{var{id:o,label:i,placeholder:a,placeholderColor:s,description:c,isLoading:u,search:l,phone:f,textOnly:p,iconLeft:d,iconRight:h,invalid:b,borderless:x,borderRadius:_,borderColor:C,backgroundColor:O,fontSize:S,width:k,height:A,margin:T,marginLeft:j,marginRight:M,marginTop:D,marginBottom:R,containerRef:I,value:N,disabled:L,readOnly:B,preventFocus:F,pointer:z,onChange:V,onClick:H,onClear:U,onFocus:K,onBlur:W}=n,$=P(n,["id","label","placeholder","placeholderColor","description","isLoading","search","phone","textOnly","iconLeft","iconRight","invalid","borderless","borderRadius","borderColor","backgroundColor","fontSize","width","height","margin","marginLeft","marginRight","marginTop","marginBottom","containerRef","value","disabled","readOnly","preventFocus","pointer","onChange","onClick","onClear","onFocus","onBlur"]);const{focused:q,handleFocus:G,handleBlur:Z}=lo(K,W,!F&&!B),Y=g(null),{color:X}=E(),[J,Q]=v(p?50:void 0),ee=g(null);m((()=>{if(p&&ee){const{current:e}=ee,t=null==e?void 0:e.offsetWidth;"number"==typeof t&&Q(t+3)}}),[p,N,a,ee]);const te=p?N||a:N,ne=N&&U&&!u,re=()=>{q||G()},oe=()=>{q&&Z()};w(r,(()=>({focus:re,blur:oe,hasFocus:q}))),y((()=>{var e;q&&(null===(e=Y.current)||void 0===e||e.focus())}),[q]);return t(po,Object.assign({ref:I,invalid:b,textOnly:p,borderless:x||p,borderRadius:_,borderColor:C,backgroundColor:O,width:k,height:A,margin:T,marginLeft:j,marginRight:M,marginTop:D,marginBottom:R,focused:q,disabled:L,hasLabel:!!i,onClick:e=>{F||B||re(),H&&H(e)},pointer:z,readOnly:B},{children:[l&&e(Rn,{name:"search",marginRight:8,inheritColor:!0}),d&&vo(d,{marginRight:8}),t(ho,Object.assign({readOnly:B||F},{children:[p&&e(_o,Object.assign({ref:ee,fontSize:S},{children:te})),i&&!p&&e(go,Object.assign({htmlFor:o||i,filled:fo(N),focused:q,disabled:L},{children:i})),e(bo,Object.assign({id:o||i,ref:Y,value:N,placeholder:a,placeholderColor:s,onChange:e=>{if(f){const{value:t}=e.target,n=ao.normalize(t);if(n.length>10)return;const r=ao.format(n);V&&V(e,r,n)}else V&&V(e)},onFocus:G,onBlur:Z,disabled:L,hide:!(fo(N)||!i||q||p),width:J,fontSize:S},$))]})),h&&vo(h),u&&e(so,{}),ne&&e(wo,Object.assign({onClick:U},{children:e(Rn,{name:"close-circle-outline",color:X.brand})})),c&&e(xo,Object.assign({invalid:b},{children:c}))]}))})),bo=Oe.input((({theme:{font:e,input:t,size:n,accent:r},fontSize:o,hide:i,disabled:a,width:s,placeholderColor:c})=>({outline:"none",border:"none",color:a?t.color.disabled:t.color.default,caretColor:r,backgroundColor:"transparent",paddingLeft:0,fontSize:o||e.size.lg,fontFamily:e.family.default,width:s||"100%",height:"100%",marginRight:n.sm,boxSizing:"border-box",opacity:i?0:1,position:i?"absolute":void 0,"&:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active":{transition:"background-color 0s 50000s",WebkitTextFillColor:t.color.default},"&::placeholder":{color:c||t.color.placeholder,opacity:1}}))),wo=Oe.div({height:"100%",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",marginLeft:4}),xo=Oe.div((({theme:{font:e,input:t},invalid:n})=>({color:n?t.color.descriptionError:t.color.description,fontSize:e.size.sm,position:"absolute",left:0,top:"calc(100% + 4px)"}))),_o=Oe.div((({theme:{font:e},fontSize:t})=>({position:"absolute",width:"max-content",opacity:0,fontSize:t||e.size.lg,zIndex:-1}))),Co=({id:t,children:n,containerRef:r,parentSelector:o,width:i,maxHeight:a=200,offsetY:s,offsetX:c,centerY:u,centerX:l,direction:f})=>{const[p,d]=v(),h=g(null);m((()=>{const{current:e}=r||h;if(e&&f){const{scrollWidth:t,scrollHeight:n}=e,r="left"===f||"right"===f;d((r?t:n<a?n:a)+((r?c:s)||4))}}),[r,f]);const y=e(Oo,Object.assign({id:t,ref:r||h,offsetX:c,offsetY:s,width:i,maxHeight:a,centerY:u,centerX:l,optionsPosition:{direction:f,amount:p}},{children:n}));if(o){const e=document.querySelector(o);return e?T.createPortal(y,e):y}return y};Co.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:u}=t,l=P(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e(So,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:u,tabIndex:a?-1:0},l,{children:n}))};const Oo=Oe.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),So=Oe.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),ko=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Eo=(n,r,o,i,a)=>{const{selected:s}=a,c=((n,r,o,i)=>{if(n&&n.length>0)return ko(n,i).map((n=>{const i=n.onClick?e=>{n.onClick&&n.onClick(e),o()}:e=>r(n,e);return t(Co.Item,Object.assign({id:n.id,onClick:i},{children:[n.leftElement||null,n.header&&n.body?t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e(Ao,{children:n.header}),e(To,{children:n.body})]})):n.label,n.rightElement&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:n.rightElement}))]}),n.id)}));return[]})(n,o,i,P(a,["selected"])),u=((e,t,n)=>e?io(e).map((e=>e?h(e,{setValue:t,close:n}):null)):[])(r,o,i),l=[...c,...u];return io(l).map(((e,t)=>e?h(e,{selected:s===t}):null))},Ao=Oe.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),To=Oe.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),jo=e=>p.toArray(e).filter((e=>"string"==typeof e)).join("").trim(),Mo=n=>{var{onChange:r,onTextChange:o,afterShow:i,afterHide:a,onFocus:s,onBlur:c,onError:u,placeholder:l,placeholderColor:f,value:p,options:d,children:h,borderless:m,borderColor:b,backgroundColor:w,hideIcon:x,clearOnSelect:_,textOnly:C,width:O,height:S,isLoading:k,margin:A,marginTop:T,marginBottom:j,marginRight:M,marginLeft:D,label:R,id:I,name:N,trigger:L,centerY:B,centerX:F,offsetY:z,offsetX:V,direction:H,fontSize:U,description:K,disabled:W,invalid:$,search:q,filter:G,restrictInput:Z,inputRef:Y,optionsParent:X}=n,J=P(n,["onChange","onTextChange","afterShow","afterHide","onFocus","onBlur","onError","placeholder","placeholderColor","value","options","children","borderless","borderColor","backgroundColor","hideIcon","clearOnSelect","textOnly","width","height","isLoading","margin","marginTop","marginBottom","marginRight","marginLeft","label","id","name","trigger","centerY","centerX","offsetY","offsetX","direction","fontSize","description","disabled","invalid","search","filter","restrictInput","inputRef","optionsParent"]);const[Q,ee]=v(""),[te,ne]=v(""),[re,oe]=v(!1),[ie,ae]=v(!1),[se,ce]=v(!1),ue=g(null),{input:le}=E(),fe={margin:A,marginTop:T,marginBottom:j,marginRight:M,marginLeft:D},pe=e=>{e&&e.stopPropagation(),!re&&i&&i(),re&&a&&a(),oe((e=>!e))};y((()=>{var e;if(re&&q){null===(e=(Y||ue).current)||void 0===e||e.focus()}}),[re,q]),y((()=>{u&&u(se)}),[se]),y((()=>{o&&o(te)}),[te]);const de=Dt(pe,re,X?[X,`${X} *`]:void 0),he=(e,t)=>{if(void 0===e)return!1;return e.toString().toLowerCase()===t.toLowerCase()},ge=e=>{const t=be().find((t=>{let n=he(t.label,e);return!n&&"id"in t&&(n=he(t.id,e)),n||!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value||(n=he(t.value,e)),n}));return t},ye=e=>"function"==typeof Z?!Z(e):Z,ve=e=>me(null,e),me=(e,t)=>{let n,o=!1;if("string"==typeof e){n=(e=>{if(ye(e))return ge(e)||null;return{id:Gr(),label:e,value:e}})(e);const t=ye(e);null===n&&t&&(o=!0)}else n=e;re&&pe(t),ee((null==n?void 0:n.label)||""),r&&void 0!==n&&r(n),o?ce(!0):(se&&ce(!1),_&&ee(""),ne(""))};y((()=>{""===p&&ve()}),[p]);const be=()=>{const e=io(h).map((e=>{const t=e;let n=t.props.displayText||"";return!R&&t.props.children&&(n=jo(t.props.children)),{id:t.props.id,label:n,onClick:t.props.onClick}}));return[...ko(d||[],{search:q,filter:G,inputText:te}),...e]},we={options:be(),select:me,open:pe,close:pe,searchText:q?te:void 0,isOpen:re,isFocused:ie},[xe,_e]=Bt(we),Ce=Eo(d||[],h,me,pe,{selected:xe,search:q,filter:G,inputText:te}),Oe=re?"caret-up":"caret-down",Se=C&&!W?f||le.color.default:void 0,ke=P(J,["onClear","phone"]);return e(Po,Object.assign({textOnly:C,altTrigger:!!L,width:O,height:S,focused:ie,search:q},fe,{children:t(Do,Object.assign({ref:de},{children:[L?e(Ro,Object.assign({id:I,onClick:pe,tabIndex:0,onFocus:()=>ae(!0),onBlur:()=>ae(!1)},{children:L})):e(No,Object.assign({shake:se},{children:e(mo,Object.assign({},ke,{ref:Y||ue,id:I,name:N,label:R,fontSize:U,pointer:!0,preventFocus:!q,value:te||p||Q,placeholder:l||"Select",placeholderColor:Se,iconRight:x||k?void 0:Oe,borderless:m,borderColor:b,backgroundColor:w,isLoading:k,textOnly:C,description:K,disabled:W,invalid:se||$,onClick:pe,onChange:e=>{var t;const{value:n}=e.target,r=null===(t=(Y||ue).current)||void 0===t?void 0:t.hasFocus;q?(ne(n),!re&&r&&oe(!0),se&&ce(!1)):n||ve(e);const o=ge(n),i=ye(n),a=""===n||i&&!r;o&&!(q&&(!i||r))?me(o,e):q&&!a||ve(e)},onFocus:e=>{ae(!0),s&&s(e)},onBlur:e=>{var t;if(ae(!1),c&&c(e),q&&te&&e){const{relatedTarget:n}=e;(null===(t=null==_e?void 0:_e.current)||void 0===t?void 0:t.contains(n))||me(te,e)}}}))})),re&&Ce.length>0&&e(Co,Object.assign({containerRef:_e,parentSelector:X,width:!L&&!C||X?"100%":void 0,centerY:B,centerX:F,offsetY:z,offsetX:V,direction:H},{children:Ce}))]}))}))};Mo.Item=({value:t,displayText:n,setValue:r,close:o,children:i,contentPosition:a,color:s,accented:c,onClick:u,id:l})=>{const f=u?e=>{u&&u(e),o&&o()}:e=>{const o={id:l,label:n||jo(i)||"",value:t};r&&r(o,e)};return e(Co.Item,Object.assign({id:l,contentPosition:a,color:s,onClick:f,accented:c},{children:i}))};const Po=Oe.div({display:"flex",boxSizing:"border-box"},(({theme:{accent:e},focused:t,search:n,altTrigger:r,textOnly:o})=>({width:r||o?"max-content":"100%",flexDirection:"column",outline:!t||n||r?void 0:`${e} solid 1px`})),(({width:e,height:t})=>({width:e,height:t})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Do=Oe.div({position:"relative",width:"100%",height:"inherit"}),Ro=Oe.div((({theme:{accent:e}})=>({display:"flex",height:"inherit","&:focus-visible":{outline:`${e} solid 1px`}}))),Io=k({"10%":{transform:"translate3d(-1px, 0, 0)"},"30%":{transform:"translate3d(2px, 0, 0)"},"50%":{transform:"translate3d(-2px, 0, 0)"},"70%":{transform:"translate3d(2px, 0, 0)"},"90%":{transform:"translate3d(-1px, 0, 0)"}}),No=Oe.div((({shake:e})=>({"& input":{animation:e?`${Io} .5s linear`:void 0}}))),Lo=t=>{var{children:n,disabled:r,outline:o,size:i,small:a,large:s,secondary:c,negative:u,positive:l,caution:f,collapse:d}=t,g=P(t,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(n){const t=p.count(n);return e(Bo,Object.assign({},g,{children:p.map(n,((e,n)=>{let p;if(t>1&&(p=0===n?"right":n===t-1?"left":"middle"),e){let t=e;"trigger"in e.props&&(t=e.props.trigger);const n=t,g=a||n.props.small,y=s||n.props.large,v=i||n.props.size,m=r||n.props.disabled,b=o||n.props.outline,w=c||n.props.secondary,x=u||n.props.negative,_=l||n.props.positive,C=f||n.props.caution,O=d||n.props.collapse,S=h(t,{joined:p,size:v,small:g,large:y,disabled:m,outline:b,secondary:w,negative:x,positive:_,caution:C,collapse:O});return"trigger"in e.props?h(e,{trigger:S}):S}return null}))}))}return null},Bo=Oe.div((({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i})=>({display:"inline-flex",margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o,width:i}))),Fo=({size:t})=>e(zo,Object.assign({className:"button-loader"},{children:e(so,{size:t})})),zo=Oe.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),Vo=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=P(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e(Uo,Object.assign({options:i},a,{children:s})):e(Ho,Object.assign({},a,{children:s}))};Vo.Group=Lo;const Ho=n=>{var{children:r,onClick:o,icon:i,iconPosition:a,iconColor:s,joined:c,size:u,small:l,large:f,isLoading:p,collapse:d,backgroundColor:h,color:g,type:y,animation:v}=n,m=P(n,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation"]);const{button:b}=E(),w=i&&(!r||d),x="right"===a;let _=u||"medium";l?_="small":f&&(_="large");const C=b[_],{iconSize:O}=C,S=d&&i;return t(Ko,Object.assign({},m,{type:y||"button",size:_,iconOnly:w,iconRight:x,joined:c,onClick:o,isLoading:p,color:g,backgroundColor:h,animation:v},{children:[i?e(Rn,{size:O,name:i,marginRight:w||x?0:4,marginLeft:!w&&x?4:0,color:s,inheritColor:!s}):null,!S&&e("span",{children:r}),p&&e(Fo,{size:O})]}))},Uo=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:c,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:m,isLoading:b,direction:w,collapse:x,width:_}=n,C=P(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width"]);const[O,S]=v(!1),k={secondary:c,negative:l,positive:f,caution:p,outline:d,size:h,small:g,large:y,disabled:m},E=u((()=>`button-dropdown-${Gr()}`),[]);return e(Wo,Object.assign({id:E},{children:t(Lo,Object.assign({width:x?void 0:_},{children:[e(Ho,Object.assign({},k,C,{width:_&&!x?"100%":void 0,collapse:x,isLoading:b,onClick:e=>{i&&i(e)}},{children:e($o,{children:r})})),e(Mo,{options:o,direction:w,optionsParent:`#${E}`,afterShow:()=>{a&&a(),S(!0)},afterHide:()=>{s&&s(),S(!1)},trigger:e(Ho,Object.assign({},k,{icon:O?"caret-up":"caret-down",preventPointerEvents:b,tabIndex:-1}))})]}))}))},Ko=Oe.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:u,animation:l})=>{const f=i||a&&!o,p=n[r],d=c||"max-content",{height:h,font:g,padding:y,iconOnlyPadding:v}=p,m=u||h,b=a||f?v:y;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:d,height:m,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:f?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${b}px`,position:"relative",animation:l,"&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:u,link:l})=>{const{button:f,size:p}=e;let d=f.primary;u?d=f.subtle:l?d=f.link:c?d=f.disabled:o?d=f.negative:i?d=f.positive:a?d=f.caution:s&&(d=f.secondary);const h=r?d.outlineBackground:d.background;let g=r?d.outlineColor:d.color;if(l||u){let e=f.subtle;l&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const y="left"===t||"middle"===t,v="right"===t||"middle"===t,m=n?p.xs:p.sm;return{backgroundColor:h.default,color:g.default,border:r&&!l?"1px solid":"none",borderColor:d.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?d.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?d.border.active:void 0},"&:disabled":{backgroundColor:u?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:y?0:void 0,borderBottomLeftRadius:y?0:void 0,borderTopRightRadius:v?0:void 0,borderBottomRightRadius:v?0:void 0,paddingLeft:y?m:void 0,paddingRight:v?m:void 0,borderRight:v?`1px solid ${r?d.border.default:d.divider}`:void 0,borderLeft:y?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?Er:Tr,i="dark"===e?Tr:Er;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),(({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o})=>({margin:e,marginTop:t,marginRight:n,marginBottom:r,marginLeft:o}))),Wo=Oe.div({display:"inline-flex",flexDirection:"column",position:"relative"}),$o=Oe.div({marginRight:8}),qo=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:c}=t,u=P(t,["value","max","step","width","height","disabled","onChange"]);return e(Zo,Object.assign({},u,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;c&&c(+t)},step:o,width:i,height:a,disabled:s,readOnly:!c}))},Go=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),Zo=Oe.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i,margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l})=>{const f=o?e.scale0:e.scale1,p=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${p} 0%, ${p} ${t}%, ${f} ${t}%, ${f} 100%)`,"&::-webkit-slider-thumb":Go(e,o||i),"&::-moz-range-thumb":Go(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`},margin:a,marginTop:s,marginBottom:c,marginRight:u,marginLeft:l}})),Yo=f(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:c,small:u,collapsed:l,hideSliderOnStop:f,hideTimeOnStop:p,fontSizeTitle:d,fontSizeTime:h,onPlay:m,onPause:b,onStop:x}=n,_=P(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[C,O]=v(!1),[S,k]=v(!0),[E,A]=v(0),[T,j]=v(0),[M,D]=v(""),[R,I]=v(""),N=g(null),L=()=>{const{current:e}=N;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},B=()=>{const{current:e}=N;e&&e.pause()},F=()=>{const{current:e}=N;e&&e.load()};w(r,(()=>({play:L,pause:B,stop:F})),[N,C]);const z=e=>{O(!1),k(!0),x&&x(e)};y((()=>{(()=>{const{current:e}=N;!!e&&e.paused})()}),[C]);const V=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},H=S&&f,U=S&&p;return t(Xo,Object.assign({width:a},_,{children:[e(Vo,{outline:!0,small:u,icon:C?"pause":"play",onClick:()=>{C?B():L()},marginRight:8}),!l&&t(Jo,Object.assign({alignDataTop:"top"===s},{children:[!H&&e(qo,{value:E,max:T,step:.1,onChange:e=>{(null==N?void 0:N.current)&&(N.current.currentTime=e)}}),t(Qo,Object.assign({alignTop:"top"===s,noSlider:H,relative:c||H},{children:[i?e(ei,Object.assign({fontSize:d},{children:i})):e("div",{}),!U&&t(ei,Object.assign({secondary:!0,fontSize:h},{children:[M&&!S?`${M} / `:"",R]}))]}))]})),t("audio",Object.assign({ref:N,onPlay:e=>{O(!0),k(!1),m&&m(e)},onPause:e=>{O(!1),b&&b(e)},onEmptied:z,onEnded:z,onTimeUpdate:()=>{const{current:e}=N;if(e){const{currentTime:t}=e,n=V(t);A(t),D(n)}},onDurationChange:()=>{const{current:e}=N;if(e){const{duration:t}=e,n=V(t);j(t),I(n)}}},{children:[e("track",{kind:"captions"}),e("source",{src:o})]}))]}))})),Xo=Oe.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),(({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o})=>({margin:e,marginTop:t,marginBottom:n,marginRight:r,marginLeft:o}))),Jo=Oe.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),Qo=Oe.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),ei=Oe.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var ti={};
|
|
25
25
|
/*!
|
|
26
26
|
Copyright (c) 2018 Jed Watson.
|
|
27
27
|
Licensed under the MIT License (MIT), see
|
|
@@ -19,11 +19,11 @@ type AccordionProps = {
|
|
|
19
19
|
/** The background color of Item drawers */
|
|
20
20
|
innerBackground?: string;
|
|
21
21
|
/** The width of the Accordion */
|
|
22
|
-
width?: number;
|
|
22
|
+
width?: number | string;
|
|
23
23
|
/** The maxHeight of the Accordion. Drawers will scroll to accommodate */
|
|
24
|
-
maxHeight?: number;
|
|
24
|
+
maxHeight?: number | string;
|
|
25
25
|
/** The height of the Accordion. Drawers will scroll to accommodate */
|
|
26
|
-
height?: number;
|
|
26
|
+
height?: number | string;
|
|
27
27
|
} & Margin;
|
|
28
28
|
declare const Accordion: {
|
|
29
29
|
({ children, defaultItem, preventCollapse, triggers, spaced, background, innerBackground, width, maxHeight, height, ...rest }: AccordionProps): JSX.Element;
|
|
@@ -17,6 +17,8 @@ type ButtonBaseProps = {
|
|
|
17
17
|
icon?: IconNames;
|
|
18
18
|
/** Positions the icon to the left or right of the button text */
|
|
19
19
|
iconPosition?: 'left' | 'right';
|
|
20
|
+
/** Sets the icon's color independently of the button's color */
|
|
21
|
+
iconColor?: string;
|
|
20
22
|
/** Defines the size of the button */
|
|
21
23
|
size?: 'small' | 'medium' | 'large';
|
|
22
24
|
/** Reduces the size of the button */
|
|
@@ -27,6 +29,8 @@ type ButtonBaseProps = {
|
|
|
27
29
|
isLoading?: boolean;
|
|
28
30
|
/** Removes the text on a button if the button has an icon */
|
|
29
31
|
collapse?: boolean;
|
|
32
|
+
/** CSS Animation shorthand property */
|
|
33
|
+
animation?: string;
|
|
30
34
|
/** The function to be called when the button is clicked */
|
|
31
35
|
onClick?: (event: MouseEvent) => void;
|
|
32
36
|
/** Sets the text backgroundColor of the button */
|
package/build/index.d.ts
CHANGED
|
@@ -574,11 +574,11 @@ type AccordionProps = {
|
|
|
574
574
|
/** The background color of Item drawers */
|
|
575
575
|
innerBackground?: string;
|
|
576
576
|
/** The width of the Accordion */
|
|
577
|
-
width?: number;
|
|
577
|
+
width?: number | string;
|
|
578
578
|
/** The maxHeight of the Accordion. Drawers will scroll to accommodate */
|
|
579
|
-
maxHeight?: number;
|
|
579
|
+
maxHeight?: number | string;
|
|
580
580
|
/** The height of the Accordion. Drawers will scroll to accommodate */
|
|
581
|
-
height?: number;
|
|
581
|
+
height?: number | string;
|
|
582
582
|
} & Margin;
|
|
583
583
|
declare const Accordion: {
|
|
584
584
|
({ children, defaultItem, preventCollapse, triggers, spaced, background, innerBackground, width, maxHeight, height, ...rest }: AccordionProps): JSX.Element;
|
|
@@ -996,6 +996,8 @@ type ButtonBaseProps = {
|
|
|
996
996
|
icon?: IconNames;
|
|
997
997
|
/** Positions the icon to the left or right of the button text */
|
|
998
998
|
iconPosition?: 'left' | 'right';
|
|
999
|
+
/** Sets the icon's color independently of the button's color */
|
|
1000
|
+
iconColor?: string;
|
|
999
1001
|
/** Defines the size of the button */
|
|
1000
1002
|
size?: 'small' | 'medium' | 'large';
|
|
1001
1003
|
/** Reduces the size of the button */
|
|
@@ -1006,6 +1008,8 @@ type ButtonBaseProps = {
|
|
|
1006
1008
|
isLoading?: boolean;
|
|
1007
1009
|
/** Removes the text on a button if the button has an icon */
|
|
1008
1010
|
collapse?: boolean;
|
|
1011
|
+
/** CSS Animation shorthand property */
|
|
1012
|
+
animation?: string;
|
|
1009
1013
|
/** The function to be called when the button is clicked */
|
|
1010
1014
|
onClick?: (event: MouseEvent$1) => void;
|
|
1011
1015
|
/** Sets the text backgroundColor of the button */
|