@wavv/ui 1.8.14 → 1.8.15-beta.2
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/index.js.map +1 -1
- package/build/cjs/types/components/Button/ButtonTypes.d.ts +24 -2
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/types/components/Button/ButtonTypes.d.ts +24 -2
- package/build/index.d.ts +20 -0
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ type ButtonAttributes = Omit<HTMLProps<HTMLButtonElement>, 'as' | 'type' | 'size
|
|
|
8
8
|
type ButtonBaseProps = {
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
joined?: 'left' | 'right' | 'middle';
|
|
11
|
+
hideJoinedBorder?: boolean;
|
|
12
|
+
joinedPadding?: number;
|
|
11
13
|
preventPointerEvents?: boolean;
|
|
12
14
|
/** Gives the button a semi-transparent background with a solid border */
|
|
13
15
|
outline?: boolean;
|
|
@@ -98,6 +100,12 @@ export type DropdownProps = {
|
|
|
98
100
|
direction?: never;
|
|
99
101
|
afterShow?: never;
|
|
100
102
|
afterHide?: never;
|
|
103
|
+
zIndex?: never;
|
|
104
|
+
disableScrollLock?: never;
|
|
105
|
+
hideDivider?: never;
|
|
106
|
+
gap?: never;
|
|
107
|
+
buttonDisabled?: never;
|
|
108
|
+
optionsDisabled?: never;
|
|
101
109
|
} | {
|
|
102
110
|
/** Adds a dropdown button to the main button, allowing for multiple button options */
|
|
103
111
|
dropdown: true;
|
|
@@ -109,16 +117,30 @@ export type DropdownProps = {
|
|
|
109
117
|
afterShow?: () => void;
|
|
110
118
|
/** The function to be called when the options are closed */
|
|
111
119
|
afterHide?: () => void;
|
|
120
|
+
/** zIndex of the menu's portal container */
|
|
121
|
+
zIndex?: number;
|
|
122
|
+
/** Enables the page to scroll when the menu is open */
|
|
123
|
+
disableScrollLock?: boolean;
|
|
124
|
+
/** Hides the dividing border between the main button and the dropdown trigger button */
|
|
125
|
+
hideDivider?: boolean;
|
|
126
|
+
/** The padding on each side of the divider between the main button and the dropdown trigger button */
|
|
127
|
+
gap?: number;
|
|
128
|
+
/** Disable only the button side of the button dropdown */
|
|
129
|
+
buttonDisabled?: boolean;
|
|
130
|
+
/** Disable only the options side of the button dropdown */
|
|
131
|
+
optionsDisabled?: boolean;
|
|
112
132
|
};
|
|
113
133
|
export type ButtonDropdownProps = {
|
|
114
134
|
options: OptionItem[];
|
|
115
135
|
direction?: 'top' | 'bottom';
|
|
116
136
|
afterShow?: () => void;
|
|
117
137
|
afterHide?: () => void;
|
|
118
|
-
/** zIndex of the menu's portal container */
|
|
119
138
|
zIndex?: number;
|
|
120
|
-
/** Enables the page to scroll when the menu is open */
|
|
121
139
|
disableScrollLock?: boolean;
|
|
140
|
+
hideDivider?: boolean;
|
|
141
|
+
gap?: number;
|
|
142
|
+
buttonDisabled?: boolean;
|
|
143
|
+
optionsDisabled?: boolean;
|
|
122
144
|
} & BasicButtonProps;
|
|
123
145
|
export type ButtonComponentProps = {
|
|
124
146
|
/** Sets the text of the button */
|
package/build/esm/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/"production"===process.env.NODE_ENV?ic.exports=function(){if(oc)return ac;oc=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case r:case i:case o:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case l:case p:case d:case a:return e;default:return h}}case n:return h}}}return e=Symbol.for("react.module.reference"),ac.ContextConsumer=s,ac.ContextProvider=a,ac.Element=t,ac.ForwardRef=l,ac.Fragment=r,ac.Lazy=p,ac.Memo=d,ac.Portal=n,ac.Profiler=i,ac.StrictMode=o,ac.Suspense=u,ac.SuspenseList=f,ac.isAsyncMode=function(){return!1},ac.isConcurrentMode=function(){return!1},ac.isContextConsumer=function(e){return g(e)===s},ac.isContextProvider=function(e){return g(e)===a},ac.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ac.isForwardRef=function(e){return g(e)===l},ac.isFragment=function(e){return g(e)===r},ac.isLazy=function(e){return g(e)===p},ac.isMemo=function(e){return g(e)===d},ac.isPortal=function(e){return g(e)===n},ac.isProfiler=function(e){return g(e)===i},ac.isStrictMode=function(e){return g(e)===o},ac.isSuspense=function(e){return g(e)===u},ac.isSuspenseList=function(e){return g(e)===f},ac.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},ac.typeOf=g,ac}():ic.exports=(sc||(sc=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var g=e.type;switch(g){case r:case i:case o:case u:case f:return g;default:var v=g&&g.$$typeof;switch(v){case c:case s:case l:case p:case d:case a:return v;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var v=s,y=a,m=t,b=l,w=r,x=p,C=d,_=n,S=i,k=o,O=u,E=f,A=!1,T=!1;cc.ContextConsumer=v,cc.ContextProvider=y,cc.Element=m,cc.ForwardRef=b,cc.Fragment=w,cc.Lazy=x,cc.Memo=C,cc.Portal=_,cc.Profiler=S,cc.StrictMode=k,cc.Suspense=O,cc.SuspenseList=E,cc.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},cc.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},cc.isContextConsumer=function(e){return g(e)===s},cc.isContextProvider=function(e){return g(e)===a},cc.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},cc.isForwardRef=function(e){return g(e)===l},cc.isFragment=function(e){return g(e)===r},cc.isLazy=function(e){return g(e)===p},cc.isMemo=function(e){return g(e)===d},cc.isPortal=function(e){return g(e)===n},cc.isProfiler=function(e){return g(e)===i},cc.isStrictMode=function(e){return g(e)===o},cc.isSuspense=function(e){return g(e)===u},cc.isSuspenseList=function(e){return g(e)===f},cc.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},cc.typeOf=g}()),cc);var lc=ic.exports;function uc(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=[]),d.toArray(e).reduce((function(e,r,o){return lc.isFragment(r)?e.push.apply(e,uc(r.props.children,t+1,n.concat(r.key||o))):p(r)?e.push(h(r,{key:n.concat(String(r.key)).join(".")})):"string"!=typeof r&&"number"!=typeof r||e.push(r),e}),[])}const fc=({id:t,children:n,containerRef:r,parentSelector:o,width:i,maxHeight:a=200,offsetY:s,offsetX:c,centerY:l,centerX:u,direction:f})=>{const[d,p]=y(),h=g(null);m((()=>{const{current:e}=r||h;if(e&&f){const{scrollWidth:t,scrollHeight:n}=e,r="left"===f||"right"===f;p((r?t:n<a?n:a)+((r?c:s)||4))}}),[r,f]);const v=e(dc,{id:t,ref:r||h,offsetX:c,offsetY:s,width:i,maxHeight:a,centerY:l,centerX:u,optionsPosition:{direction:f,amount:d},children:n});if(o){const e=document.querySelector(o);return e?M.createPortal(v,e):v}return v};fc.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:l}=t,u=L(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e(pc,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:l,tabIndex:a?-1:0},u,{children:n}))};const dc=me.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}:{}})),pc=me.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}))),hc=(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},gc=n=>t(u,{children:[n.leftElement||null,n.header&&n.body?t("div",{style:{display:"flex",flexDirection:"column"},children:[e(yc,{children:n.header}),e(mc,{children:n.body})]}):n.label,n.rightElement&&e("div",{style:{marginLeft:"auto"},children:n.rightElement})]}),vc=(t,n,r,o,i)=>{const{selected:a}=i,s=((t,n,r,o)=>{if(t&&t.length>0)return hc(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e(fc.Item,{id:t.id,onClick:o,children:gc(t)},t.id)}));return[]})(t,r,o,L(i,["selected"])),c=((e,t,n)=>e?uc(e).map((e=>e?h(e,{setValue:t,close:n}):null)):[])(n,r,o);return uc([...s,...c]).map(((e,t)=>e?h(e,{selected:a===t}):null))},yc=me.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),mc=me.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),bc=e=>{let t="top",n="center";if(!e)return{side:t,align:n};const[r,o]=e.split(" ");return"left"===r&&(t="left"),"right"===r&&(t="right"),"bottom"===r&&(t="bottom"),"left"!==o&&"top"!==o||(n="start"),"right"!==o&&"bottom"!==o||(n="end"),{side:t,align:n}},wc=(e,t)=>!t.includes(e),xc=n=>{var{children:r,options:o,id:i,position:a="bottom",trigger:s,open:c,offset:l=4,arrow:u,width:f,maxHeight:d=200,container:p,zIndex:h,disableScrollLock:g,onChange:v,afterShow:y,afterHide:m}=n,b=L(n,["children","options","id","position","trigger","open","offset","arrow","width","maxHeight","container","zIndex","disableScrollLock","onChange","afterShow","afterHide"]);return t(Zs,{onOpenChange:e=>{y&&e&&y(),m&&!e&&m()},open:c,modal:!g,children:[e(Gs,{asChild:!0,children:e(Pc,Object.assign({},b,{children:s}))}),e(Ys,{container:p,children:t(kc,{id:i,maxHeight:d,width:f,zIndex:h,side:bc(a).side,align:bc(a).align,sideOffset:l,children:[o&&(null==o?void 0:o.length)>0&&o.map((t=>e(Cc,{id:t.id,onClick:t.onClick||(e=>{((e,t)=>{v&&v(e,t)})(t,e)}),children:gc(t)},t.id))),r,u&&e(ec,{className:"menu-arrow"})]})})]})},Cc=t=>{var{children:n,id:r,disabled:o,onClick:i}=t,a=L(t,["children","id","disabled","onClick"]);return e(Tc,Object.assign({id:null==r?void 0:r.toString(),disabled:o,onSelect:i},a,{children:n}))};xc.Item=Cc,xc.Sub=n=>{var{children:r,id:o,label:i,zIndex:a,disabled:s,container:c}=n,l=L(n,["children","id","label","zIndex","disabled","container"]);return t(tc,{children:[t(Mc,{disabled:s,children:[i,e(Dc,{children:e(Lc,{children:e(Hn,{name:"chevron-right",size:"small",inheritColor:s})})})]}),e(Ys,{container:c,children:e(Oc,Object.assign({sideOffset:2,alignOffset:-5,zIndex:a,id:o},l,{children:r}))})]})},xc.Separator=()=>e(jc,{});const _c=({theme:e,width:t,maxHeight:n,zIndex:r})=>({fontFamily:null==e?void 0:e.font.family.default,fontSize:null==e?void 0:e.font.size.md,width:t||"max-content",maxHeight:n,backgroundColor:null==e?void 0:e.options.background,borderRadius:4,boxShadow:null==e?void 0:e.elevation3,zIndex:r,boxSizing:"border-box",overflowY:"auto"}),Sc={shouldForwardProp:e=>wc(e,["maxHeight","zIndex"])},kc=me(Xs,Sc)(_c,(({theme:{options:e}})=>({"& > span > .menu-arrow":{fill:e.background,filter:"drop-shadow(0px 4px 2px rgba(0, 0, 0, 0.1))"},'&[data-side="bottom"] > span > .menu-arrow':{filter:"drop-shadow(0px -2px 2px rgba(0, 0, 0, 0.1))"}}))),Oc=me(rc,Sc)(_c),Ec=({theme:e,color:t,accented:n,disabled:r,contentPosition:o})=>{const i="start"===o||"end"===o?`flex-${o}`:o,a=n?null==e?void 0:e.optionItem.color.accent:null==e?void 0:e.optionItem.color.inactive;return{border:"none",padding:"4px 16px",display:"flex",alignItems:"center",userSelect:"none",position:"relative",justifyContent:i,color:t||a,cursor:r?"inherit":"pointer",backgroundColor:null==e?void 0:e.optionItem.background.inactive,"&[data-highlighted]":{backgroundColor:null==e?void 0:e.optionItem.background.active},"&[data-disabled]":{color:null==e?void 0:e.scale4},"&:focus":{outline:"none",backgroundColor:null==e?void 0:e.optionItem.background.active}}},Ac={shouldForwardProp:e=>wc(e,["selected","noSelect","contentPosition","color","accented"])},Tc=me(Js,Ac)(Ec),Mc=me(nc,Ac)(Ec),jc=me(Qs)((({theme:e})=>({height:1,backgroundColor:e.scale2,margin:"4px 8px"}))),Pc=me.div({display:"inline-flex"}),Dc=me.div({marginLeft:"auto",width:16,height:16}),Lc=me.div({position:"absolute",right:8}),Ic=t=>{var{size:n,color:r,center:o,background:i,zIndex:a,margin:s,marginTop:c,marginBottom:l,marginRight:u,marginLeft:f,position:d,top:p,bottom:h,right:g,left:v}=t,y=L(t,["size","color","center","background","zIndex","margin","marginTop","marginBottom","marginRight","marginLeft","position","top","bottom","right","left"]);const m={margin:s,marginTop:c,marginBottom:l,marginRight:u,marginLeft:f,position:d,top:p,bottom:h,right:g,left:v};return e(Rc,Object.assign({},m,{center:o,background:i,zIndex:a,children:e(Bc,{children:e(Hn,Object.assign({},y,{size:n,name:"loading",color:r,inheritColor:!r}))})}))},Rc=me.div({width:"max-content",height:"max-content"},(({center:e,zIndex:t})=>e&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:null!=t?t:1}),(({center:e,background:t})=>{if(!e||!t)return null;return{background:"string"==typeof t?t:"rgba(0, 0, 0, 0.5)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}),Bn,Fn),Nc=O({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Bc=me.div({animation:`${Nc} 1s linear infinite`,width:"max-content",height:"max-content"}),Fc=({size:t})=>e(zc,{className:"button-loader",children:e(Ic,{size:t})}),zc=me.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),Hc=t=>{var{children:n,disabled:r,outline:o,size:i,small:a,large:s,secondary:c,negative:l,positive:u,caution:f,collapse:p}=t,g=L(t,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(n){const t=d.count(n);return e(Vc,Object.assign({},g,{children:d.map(n,((e,n)=>{let d;if(t>1&&(d=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,v=s||n.props.large,y=i||n.props.size,m=r||n.props.disabled,b=o||n.props.outline,w=c||n.props.secondary,x=l||n.props.negative,C=u||n.props.positive,_=f||n.props.caution,S=p||n.props.collapse,k=h(t,{joined:d,size:y,small:g,large:v,disabled:m,outline:b,secondary:w,negative:x,positive:C,caution:_,collapse:S});return"trigger"in e.props?h(e,{trigger:k}):k}return null}))}))}return null},Vc=me.div((({width:e})=>({display:"inline-flex",width:e})),Bn),Kc=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=L(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e($c,Object.assign({options:i},a,{children:s})):e(Uc,Object.assign({},a,{children:s}))};Kc.Group=Hc;const Uc=n=>{var{children:r,onClick:o,icon:i,iconPosition:a,iconColor:s,joined:c,size:l,small:u,large:f,isLoading:d,collapse:p,backgroundColor:h,color:g,type:v,animation:y,iconAnimation:m}=n,b=L(n,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation","iconAnimation"]);const{button:w}=E(),x=i&&(!r||p),C="right"===a;let _=l||"medium";u?_="small":f&&(_="large");const S=w[_],{iconSize:k}=S,O=p&&i;return t(Wc,Object.assign({},b,{type:v||"button",size:_,iconOnly:x,iconRight:C,joined:c,onClick:o,isLoading:d,color:g,backgroundColor:h,animation:y,children:[i?e(Hn,{size:k,name:i,marginRight:x||C?0:4,marginLeft:!x&&C?4:0,color:s,inheritColor:!s,animation:m}):null,!O&&e("span",{children:r}),d&&e(Fc,{size:k})]}))},$c=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:c,negative:l,positive:u,caution:f,outline:d,size:p,small:h,large:g,disabled:v,isLoading:m,direction:b,collapse:w,width:x,zIndex:C,disableScrollLock:_}=n,S=L(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width","zIndex","disableScrollLock"]);const[k,O]=y(!1),E={secondary:c,negative:l,positive:u,caution:f,outline:d,size:p,small:h,large:g,disabled:v};return e(qc,{children:t(Hc,{width:w?void 0:x,children:[e(Uc,Object.assign({},E,S,{width:x&&!w?"100%":void 0,collapse:w,isLoading:m,onClick:e=>{i&&i(e)},children:e(Zc,{children:r})})),e(xc,{position:`${b||"bottom"} right`,afterShow:()=>{a&&a(),O(!0)},afterHide:()=>{s&&s(),O(!1)},options:o,trigger:e(Uc,Object.assign({},E,{icon:k?"caret-up":"caret-down",preventPointerEvents:m,tabIndex:-1})),zIndex:C,disableScrollLock:_})]})})},Wc=me.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:l,animation:u})=>{const f=i||a&&!o,d=n[r],p=c||"max-content",{height:h,font:g,padding:v,iconOnlyPadding:y}=d,m=l||h,b=a||f?y:v;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:p,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:u,"&: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:l,link:u})=>{const{button:f,size:d}=e;let p=f.primary;l?p=f.subtle:u?p=f.link:c?p=f.disabled:o?p=f.negative:i?p=f.positive:a?p=f.caution:s&&(p=f.secondary);const h=r?p.outlineBackground:p.background;let g=r?p.outlineColor:p.color;if(u||l){let e=f.subtle;u&&(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 v="left"===t||"middle"===t,y="right"===t||"middle"===t,m=n?d.xs:d.sm;return{backgroundColor:h.default,color:g.default,border:r&&!u?"1px solid":"none",borderColor:p.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?p.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?p.border.active:void 0},"&:disabled":{backgroundColor:l?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:v?0:void 0,borderBottomLeftRadius:v?0:void 0,borderTopRightRadius:y?0:void 0,borderBottomRightRadius:y?0:void 0,paddingLeft:v?m:void 0,paddingRight:y?m:void 0,borderRight:y?`1px solid ${r?p.border.default:p.divider}`:void 0,borderLeft:v?"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?Rr:Br,i="dark"===e?Br:Rr;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}}}),Bn),qc=me.div({display:"inline-flex",flexDirection:"column",position:"relative"}),Zc=me.div({marginRight:8}),Gc=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:c}=t,l=L(t,["value","max","step","width","height","disabled","onChange"]);return e(Xc,Object.assign({},l,{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}))},Yc=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),Xc=me.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i})=>{const a=o?e.scale0:e.scale1,s=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, ${s} 0%, ${s} ${t}%, ${a} ${t}%, ${a} 100%)`,"&::-webkit-slider-thumb":Yc(e,o||i),"&::-moz-range-thumb":Yc(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`}}}),Bn),Jc=f(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:c,small:l,collapsed:u,hideSliderOnStop:f,hideTimeOnStop:d,fontSizeTitle:p,fontSizeTime:h,onPlay:m,onPause:b,onStop:x}=n,C=L(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[_,S]=y(!1),[k,O]=y(!0),[E,A]=y(0),[T,M]=y(0),[j,P]=y(""),[D,I]=y(""),R=g(null),N=()=>{const{current:e}=R;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},B=()=>{const{current:e}=R;e&&e.pause()},F=()=>{const{current:e}=R;e&&e.load()};w(r,(()=>({play:N,pause:B,stop:F})),[R,_]);const z=e=>{S(!1),O(!0),x&&x(e)};v((()=>{(()=>{const{current:e}=R;!!e&&e.paused})()}),[_]);const H=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},V=k&&f,K=k&&d;return t(Qc,Object.assign({width:a},C,{children:[e(Kc,{outline:!0,small:l,icon:_?"pause":"play",onClick:()=>{_?B():N()},marginRight:8}),!u&&t(el,{alignDataTop:"top"===s,children:[!V&&e(Gc,{value:E,max:T,step:.1,onChange:e=>{(null==R?void 0:R.current)&&(R.current.currentTime=e)}}),t(tl,{alignTop:"top"===s,noSlider:V,relative:c||V,children:[i?e(nl,{fontSize:p,children:i}):e("div",{}),!K&&t(nl,{secondary:!0,fontSize:h,children:[j&&!k?`${j} / `:"",D]})]})]}),t("audio",{ref:R,onPlay:e=>{S(!0),O(!1),m&&m(e)},onPause:e=>{S(!1),b&&b(e)},onEmptied:z,onEnded:z,onTimeUpdate:()=>{const{current:e}=R;if(e){const{currentTime:t}=e,n=H(t);A(t),P(n)}},onDurationChange:()=>{const{current:e}=R;if(e){const{duration:t}=e,n=H(t);M(t),I(n)}},children:[e("track",{kind:"captions"}),e("source",{src:o})]})]}))})),Qc=me.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),Bn),el=me.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),tl=me.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%"}))),nl=me.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var rl={},ol={};Object.defineProperty(ol,"__esModule",{value:!0}),ol.defaultOptions=void 0,ol.defaultOptions={lowercase:!1,precision:1,space:!1,units:["","K","M","B","T","P","E"]};var il={};Object.defineProperty(il,"__esModule",{value:!0}),il.getLocales=il.getFractionDigits=il.roundTo=il.parseValue=void 0,il.parseValue=function(e){const t=parseFloat(null==e?void 0:e.toString());if(isNaN(t))throw new Error("Input value is not a number");if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw new RangeError("Input value is outside of safe integer range");return t},il.roundTo=function(e,t){if(!Number.isFinite(e))throw new Error("Input value is not a finite number");if(!Number.isInteger(t)||t<0)throw new Error("Precision is not a positive integer");return Number.isInteger(e)?e:parseFloat(e.toFixed(t))},il.getFractionDigits=function(e){var t;if(Number.isInteger(e))return 0;const n=e.toString().split(".")[1];return null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0},il.getLocales=function(){var e;return"undefined"==typeof navigator?[]:Array.from(null!==(e=navigator.languages)&&void 0!==e?e:[])},Object.defineProperty(rl,"__esModule",{value:!0}),rl.millify=void 0;const al=ol,sl=il,cl=1e3;function*ll(e){let t=cl;for(;;){const n=e/t;if(n<1)return;yield n,t*=cl}}function ul(e,t){var n,r;const o=t?{...al.defaultOptions,...t}:al.defaultOptions;if(!Array.isArray(o.units)||!o.units.length)throw new Error("Option `units` must be a non-empty array");let i;try{i=sl.parseValue(e)}catch(t){return t instanceof Error&&console.warn(`WARN: ${t.message} (millify)`),String(e)}const a=i<0?"-":"";i=Math.abs(i);let s=0;for(const e of ll(i))i=e,s+=1;if(s>=o.units.length)return e.toString();let c=sl.roundTo(i,o.precision);for(const e of ll(c))c=e,s+=1;const l=null!==(n=o.units[s])&&void 0!==n?n:"",u=o.lowercase?l.toLowerCase():l,f=o.space?" ":"";return`${a}${c.toLocaleString(null!==(r=o.locales)&&void 0!==r?r:sl.getLocales(),{minimumFractionDigits:sl.getFractionDigits(c)})}${f}${u}`}rl.millify=ul;var fl=rl.default=ul,dl={exports:{}};
|
|
18
|
+
*/"production"===process.env.NODE_ENV?ic.exports=function(){if(oc)return ac;oc=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case r:case i:case o:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case l:case p:case d:case a:return e;default:return h}}case n:return h}}}return e=Symbol.for("react.module.reference"),ac.ContextConsumer=s,ac.ContextProvider=a,ac.Element=t,ac.ForwardRef=l,ac.Fragment=r,ac.Lazy=p,ac.Memo=d,ac.Portal=n,ac.Profiler=i,ac.StrictMode=o,ac.Suspense=u,ac.SuspenseList=f,ac.isAsyncMode=function(){return!1},ac.isConcurrentMode=function(){return!1},ac.isContextConsumer=function(e){return g(e)===s},ac.isContextProvider=function(e){return g(e)===a},ac.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ac.isForwardRef=function(e){return g(e)===l},ac.isFragment=function(e){return g(e)===r},ac.isLazy=function(e){return g(e)===p},ac.isMemo=function(e){return g(e)===d},ac.isPortal=function(e){return g(e)===n},ac.isProfiler=function(e){return g(e)===i},ac.isStrictMode=function(e){return g(e)===o},ac.isSuspense=function(e){return g(e)===u},ac.isSuspenseList=function(e){return g(e)===f},ac.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},ac.typeOf=g,ac}():ic.exports=(sc||(sc=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var g=e.type;switch(g){case r:case i:case o:case u:case f:return g;default:var v=g&&g.$$typeof;switch(v){case c:case s:case l:case p:case d:case a:return v;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var v=s,y=a,m=t,b=l,w=r,x=p,C=d,_=n,S=i,k=o,O=u,E=f,A=!1,T=!1;cc.ContextConsumer=v,cc.ContextProvider=y,cc.Element=m,cc.ForwardRef=b,cc.Fragment=w,cc.Lazy=x,cc.Memo=C,cc.Portal=_,cc.Profiler=S,cc.StrictMode=k,cc.Suspense=O,cc.SuspenseList=E,cc.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},cc.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},cc.isContextConsumer=function(e){return g(e)===s},cc.isContextProvider=function(e){return g(e)===a},cc.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},cc.isForwardRef=function(e){return g(e)===l},cc.isFragment=function(e){return g(e)===r},cc.isLazy=function(e){return g(e)===p},cc.isMemo=function(e){return g(e)===d},cc.isPortal=function(e){return g(e)===n},cc.isProfiler=function(e){return g(e)===i},cc.isStrictMode=function(e){return g(e)===o},cc.isSuspense=function(e){return g(e)===u},cc.isSuspenseList=function(e){return g(e)===f},cc.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},cc.typeOf=g}()),cc);var lc=ic.exports;function uc(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=[]),d.toArray(e).reduce((function(e,r,o){return lc.isFragment(r)?e.push.apply(e,uc(r.props.children,t+1,n.concat(r.key||o))):p(r)?e.push(h(r,{key:n.concat(String(r.key)).join(".")})):"string"!=typeof r&&"number"!=typeof r||e.push(r),e}),[])}const fc=({id:t,children:n,containerRef:r,parentSelector:o,width:i,maxHeight:a=200,offsetY:s,offsetX:c,centerY:l,centerX:u,direction:f})=>{const[d,p]=y(),h=g(null);m((()=>{const{current:e}=r||h;if(e&&f){const{scrollWidth:t,scrollHeight:n}=e,r="left"===f||"right"===f;p((r?t:n<a?n:a)+((r?c:s)||4))}}),[r,f]);const v=e(dc,{id:t,ref:r||h,offsetX:c,offsetY:s,width:i,maxHeight:a,centerY:l,centerX:u,optionsPosition:{direction:f,amount:d},children:n});if(o){const e=document.querySelector(o);return e?M.createPortal(v,e):v}return v};fc.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:l}=t,u=L(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e(pc,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:c,accented:l,tabIndex:a?-1:0},u,{children:n}))};const dc=me.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}:{}})),pc=me.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}))),hc=(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},gc=n=>t(u,{children:[n.leftElement||null,n.header&&n.body?t("div",{style:{display:"flex",flexDirection:"column"},children:[e(yc,{children:n.header}),e(mc,{children:n.body})]}):n.label,n.rightElement&&e("div",{style:{marginLeft:"auto"},children:n.rightElement})]}),vc=(t,n,r,o,i)=>{const{selected:a}=i,s=((t,n,r,o)=>{if(t&&t.length>0)return hc(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e(fc.Item,{id:t.id,onClick:o,children:gc(t)},t.id)}));return[]})(t,r,o,L(i,["selected"])),c=((e,t,n)=>e?uc(e).map((e=>e?h(e,{setValue:t,close:n}):null)):[])(n,r,o);return uc([...s,...c]).map(((e,t)=>e?h(e,{selected:a===t}):null))},yc=me.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),mc=me.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),bc=e=>{let t="top",n="center";if(!e)return{side:t,align:n};const[r,o]=e.split(" ");return"left"===r&&(t="left"),"right"===r&&(t="right"),"bottom"===r&&(t="bottom"),"left"!==o&&"top"!==o||(n="start"),"right"!==o&&"bottom"!==o||(n="end"),{side:t,align:n}},wc=(e,t)=>!t.includes(e),xc=n=>{var{children:r,options:o,id:i,position:a="bottom",trigger:s,open:c,offset:l=4,arrow:u,width:f,maxHeight:d=200,container:p,zIndex:h,disableScrollLock:g,onChange:v,afterShow:y,afterHide:m}=n,b=L(n,["children","options","id","position","trigger","open","offset","arrow","width","maxHeight","container","zIndex","disableScrollLock","onChange","afterShow","afterHide"]);return t(Zs,{onOpenChange:e=>{y&&e&&y(),m&&!e&&m()},open:c,modal:!g,children:[e(Gs,{asChild:!0,children:e(Pc,Object.assign({},b,{children:s}))}),e(Ys,{container:p,children:t(kc,{id:i,maxHeight:d,width:f,zIndex:h,side:bc(a).side,align:bc(a).align,sideOffset:l,children:[o&&(null==o?void 0:o.length)>0&&o.map((t=>e(Cc,{id:t.id,onClick:t.onClick||(e=>{((e,t)=>{v&&v(e,t)})(t,e)}),children:gc(t)},t.id))),r,u&&e(ec,{className:"menu-arrow"})]})})]})},Cc=t=>{var{children:n,id:r,disabled:o,onClick:i}=t,a=L(t,["children","id","disabled","onClick"]);return e(Tc,Object.assign({id:null==r?void 0:r.toString(),disabled:o,onSelect:i},a,{children:n}))};xc.Item=Cc,xc.Sub=n=>{var{children:r,id:o,label:i,zIndex:a,disabled:s,container:c}=n,l=L(n,["children","id","label","zIndex","disabled","container"]);return t(tc,{children:[t(Mc,{disabled:s,children:[i,e(Dc,{children:e(Lc,{children:e(Hn,{name:"chevron-right",size:"small",inheritColor:s})})})]}),e(Ys,{container:c,children:e(Oc,Object.assign({sideOffset:2,alignOffset:-5,zIndex:a,id:o},l,{children:r}))})]})},xc.Separator=()=>e(jc,{});const _c=({theme:e,width:t,maxHeight:n,zIndex:r})=>({fontFamily:null==e?void 0:e.font.family.default,fontSize:null==e?void 0:e.font.size.md,width:t||"max-content",maxHeight:n,backgroundColor:null==e?void 0:e.options.background,borderRadius:4,boxShadow:null==e?void 0:e.elevation3,zIndex:r,boxSizing:"border-box",overflowY:"auto"}),Sc={shouldForwardProp:e=>wc(e,["maxHeight","zIndex"])},kc=me(Xs,Sc)(_c,(({theme:{options:e}})=>({"& > span > .menu-arrow":{fill:e.background,filter:"drop-shadow(0px 4px 2px rgba(0, 0, 0, 0.1))"},'&[data-side="bottom"] > span > .menu-arrow':{filter:"drop-shadow(0px -2px 2px rgba(0, 0, 0, 0.1))"}}))),Oc=me(rc,Sc)(_c),Ec=({theme:e,color:t,accented:n,disabled:r,contentPosition:o})=>{const i="start"===o||"end"===o?`flex-${o}`:o,a=n?null==e?void 0:e.optionItem.color.accent:null==e?void 0:e.optionItem.color.inactive;return{border:"none",padding:"4px 16px",display:"flex",alignItems:"center",userSelect:"none",position:"relative",justifyContent:i,color:t||a,cursor:r?"inherit":"pointer",backgroundColor:null==e?void 0:e.optionItem.background.inactive,"&[data-highlighted]":{backgroundColor:null==e?void 0:e.optionItem.background.active},"&[data-disabled]":{color:null==e?void 0:e.scale4},"&:focus":{outline:"none",backgroundColor:null==e?void 0:e.optionItem.background.active}}},Ac={shouldForwardProp:e=>wc(e,["selected","noSelect","contentPosition","color","accented"])},Tc=me(Js,Ac)(Ec),Mc=me(nc,Ac)(Ec),jc=me(Qs)((({theme:e})=>({height:1,backgroundColor:e.scale2,margin:"4px 8px"}))),Pc=me.div({display:"inline-flex"}),Dc=me.div({marginLeft:"auto",width:16,height:16}),Lc=me.div({position:"absolute",right:8}),Ic=t=>{var{size:n,color:r,center:o,background:i,zIndex:a,margin:s,marginTop:c,marginBottom:l,marginRight:u,marginLeft:f,position:d,top:p,bottom:h,right:g,left:v}=t,y=L(t,["size","color","center","background","zIndex","margin","marginTop","marginBottom","marginRight","marginLeft","position","top","bottom","right","left"]);const m={margin:s,marginTop:c,marginBottom:l,marginRight:u,marginLeft:f,position:d,top:p,bottom:h,right:g,left:v};return e(Rc,Object.assign({},m,{center:o,background:i,zIndex:a,children:e(Bc,{children:e(Hn,Object.assign({},y,{size:n,name:"loading",color:r,inheritColor:!r}))})}))},Rc=me.div({width:"max-content",height:"max-content"},(({center:e,zIndex:t})=>e&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:null!=t?t:1}),(({center:e,background:t})=>{if(!e||!t)return null;return{background:"string"==typeof t?t:"rgba(0, 0, 0, 0.5)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}),Bn,Fn),Nc=O({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Bc=me.div({animation:`${Nc} 1s linear infinite`,width:"max-content",height:"max-content"}),Fc=({size:t})=>e(zc,{className:"button-loader",children:e(Ic,{size:t})}),zc=me.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),Hc=t=>{var{children:n,disabled:r,outline:o,size:i,small:a,large:s,secondary:c,negative:l,positive:u,caution:f,collapse:p}=t,g=L(t,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(n){const t=d.count(n);return e(Vc,Object.assign({},g,{children:d.map(n,((e,n)=>{let d;if(t>1&&(d=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,v=s||n.props.large,y=i||n.props.size,m=r||n.props.disabled,b=o||n.props.outline,w=c||n.props.secondary,x=l||n.props.negative,C=u||n.props.positive,_=f||n.props.caution,S=p||n.props.collapse,k=h(t,{joined:d,size:y,small:g,large:v,disabled:m,outline:b,secondary:w,negative:x,positive:C,caution:_,collapse:S});return"trigger"in e.props?h(e,{trigger:k}):k}return null}))}))}return null},Vc=me.div((({width:e})=>({display:"inline-flex",width:e})),Bn),Kc=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=L(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e($c,Object.assign({options:i},a,{children:s})):e(Uc,Object.assign({},a,{children:s}))};Kc.Group=Hc;const Uc=n=>{var{children:r,onClick:o,icon:i,iconPosition:a,iconColor:s,joined:c,size:l,small:u,large:f,isLoading:d,collapse:p,backgroundColor:h,color:g,type:v,animation:y,iconAnimation:m}=n,b=L(n,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation","iconAnimation"]);const{button:w}=E(),x=i&&(!r||p),C="right"===a;let _=l||"medium";u?_="small":f&&(_="large");const S=w[_],{iconSize:k}=S,O=p&&i;return t(Wc,Object.assign({},b,{type:v||"button",size:_,iconOnly:x,iconRight:C,joined:c,onClick:o,isLoading:d,color:g,backgroundColor:h,animation:y,children:[i?e(Hn,{size:k,name:i,marginRight:x||C?0:4,marginLeft:!x&&C?4:0,color:s,inheritColor:!s,animation:m}):null,!O&&e("span",{children:r}),d&&e(Fc,{size:k})]}))},$c=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:c,negative:l,positive:u,caution:f,outline:d,subtle:p,link:h,size:g,small:v,large:m,disabled:b,buttonDisabled:w,optionsDisabled:x,isLoading:C,direction:_,collapse:S,width:k,zIndex:O,disableScrollLock:E,hideDivider:A,gap:T}=n,M=L(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","subtle","link","size","small","large","disabled","buttonDisabled","optionsDisabled","isLoading","direction","collapse","width","zIndex","disableScrollLock","hideDivider","gap"]);const[j,P]=y(!1),D={secondary:c,negative:l,positive:u,caution:f,outline:d,subtle:p,link:h,size:g,small:v,large:m};return e(qc,{children:t(Hc,{width:S?void 0:k,children:[e(Uc,Object.assign({},D,M,{disabled:b||w,width:k&&!S?"100%":void 0,collapse:S,isLoading:C,onClick:e=>{i&&i(e)},hideJoinedBorder:A,joinedPadding:T,children:r&&e(Zc,{children:r})})),e(xc,{position:`${_||"bottom"} right`,afterShow:()=>{a&&a(),P(!0)},afterHide:()=>{s&&s(),P(!1)},options:o,trigger:e(Uc,Object.assign({},D,{icon:j?"caret-up":"caret-down",preventPointerEvents:C,tabIndex:-1,joinedPadding:T,disabled:b||x})),zIndex:O,disableScrollLock:E})]})})},Wc=me.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:l,animation:u})=>{const f=i||a&&!o,d=n[r],p=c||"max-content",{height:h,font:g,padding:v,iconOnlyPadding:y}=d,m=l||h,b=a||f?y:v;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:p,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:u,"&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,hideJoinedBorder:n,joinedPadding:r,iconOnly:o,outline:i,negative:a,positive:s,caution:c,secondary:l,disabled:u,subtle:f,link:d})=>{const{button:p,size:h}=e;let g=p.primary;f?g=p.subtle:d?g=p.link:u?g=p.disabled:a?g=p.negative:s?g=p.positive:c?g=p.caution:l&&(g=p.secondary);const v=i?g.outlineBackground:g.background;let y=i?g.outlineColor:g.color;if(d||f){let e=p.subtle;d&&(e=p.link),u?y=p.disabled.color:a?y=e.negativeColor:s?y=e.positiveColor:c?y=e.cautionColor:l&&(y=e.secondaryColor)}const m="left"===t||"middle"===t,b="right"===t||"middle"===t,w=o?h.xs:h.sm,x=r||w;return{backgroundColor:v.default,color:y.default,border:i&&!d?"1px solid":"none",borderColor:g.border.default,"&:hover":{backgroundColor:v.hover,color:y.hover,borderColor:i&&!u?g.border.hover:void 0},"&:active":{backgroundColor:v.active,color:y.active,borderColor:i&&!u?g.border.active:void 0},"&:disabled":{backgroundColor:f?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:m?0:void 0,borderBottomLeftRadius:m?0:void 0,borderTopRightRadius:b?0:void 0,borderBottomRightRadius:b?0:void 0,paddingLeft:m?x:void 0,paddingRight:b?x:void 0,borderRight:b&&!n?`1px solid ${i?g.border.default:g.divider}`:void 0,borderLeft:m&&!n?"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?Rr:Br,i="dark"===e?Br:Rr;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}}}),Bn),qc=me.div({display:"inline-flex",flexDirection:"column",position:"relative"}),Zc=me.div({marginRight:8}),Gc=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:c}=t,l=L(t,["value","max","step","width","height","disabled","onChange"]);return e(Xc,Object.assign({},l,{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}))},Yc=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),Xc=me.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i})=>{const a=o?e.scale0:e.scale1,s=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, ${s} 0%, ${s} ${t}%, ${a} ${t}%, ${a} 100%)`,"&::-webkit-slider-thumb":Yc(e,o||i),"&::-moz-range-thumb":Yc(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`}}}),Bn),Jc=f(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:c,small:l,collapsed:u,hideSliderOnStop:f,hideTimeOnStop:d,fontSizeTitle:p,fontSizeTime:h,onPlay:m,onPause:b,onStop:x}=n,C=L(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[_,S]=y(!1),[k,O]=y(!0),[E,A]=y(0),[T,M]=y(0),[j,P]=y(""),[D,I]=y(""),R=g(null),N=()=>{const{current:e}=R;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},B=()=>{const{current:e}=R;e&&e.pause()},F=()=>{const{current:e}=R;e&&e.load()};w(r,(()=>({play:N,pause:B,stop:F})),[R,_]);const z=e=>{S(!1),O(!0),x&&x(e)};v((()=>{(()=>{const{current:e}=R;!!e&&e.paused})()}),[_]);const H=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},V=k&&f,K=k&&d;return t(Qc,Object.assign({width:a},C,{children:[e(Kc,{outline:!0,small:l,icon:_?"pause":"play",onClick:()=>{_?B():N()},marginRight:8}),!u&&t(el,{alignDataTop:"top"===s,children:[!V&&e(Gc,{value:E,max:T,step:.1,onChange:e=>{(null==R?void 0:R.current)&&(R.current.currentTime=e)}}),t(tl,{alignTop:"top"===s,noSlider:V,relative:c||V,children:[i?e(nl,{fontSize:p,children:i}):e("div",{}),!K&&t(nl,{secondary:!0,fontSize:h,children:[j&&!k?`${j} / `:"",D]})]})]}),t("audio",{ref:R,onPlay:e=>{S(!0),O(!1),m&&m(e)},onPause:e=>{S(!1),b&&b(e)},onEmptied:z,onEnded:z,onTimeUpdate:()=>{const{current:e}=R;if(e){const{currentTime:t}=e,n=H(t);A(t),P(n)}},onDurationChange:()=>{const{current:e}=R;if(e){const{duration:t}=e,n=H(t);M(t),I(n)}},children:[e("track",{kind:"captions"}),e("source",{src:o})]})]}))})),Qc=me.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),Bn),el=me.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),tl=me.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%"}))),nl=me.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var rl={},ol={};Object.defineProperty(ol,"__esModule",{value:!0}),ol.defaultOptions=void 0,ol.defaultOptions={lowercase:!1,precision:1,space:!1,units:["","K","M","B","T","P","E"]};var il={};Object.defineProperty(il,"__esModule",{value:!0}),il.getLocales=il.getFractionDigits=il.roundTo=il.parseValue=void 0,il.parseValue=function(e){const t=parseFloat(null==e?void 0:e.toString());if(isNaN(t))throw new Error("Input value is not a number");if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw new RangeError("Input value is outside of safe integer range");return t},il.roundTo=function(e,t){if(!Number.isFinite(e))throw new Error("Input value is not a finite number");if(!Number.isInteger(t)||t<0)throw new Error("Precision is not a positive integer");return Number.isInteger(e)?e:parseFloat(e.toFixed(t))},il.getFractionDigits=function(e){var t;if(Number.isInteger(e))return 0;const n=e.toString().split(".")[1];return null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0},il.getLocales=function(){var e;return"undefined"==typeof navigator?[]:Array.from(null!==(e=navigator.languages)&&void 0!==e?e:[])},Object.defineProperty(rl,"__esModule",{value:!0}),rl.millify=void 0;const al=ol,sl=il,cl=1e3;function*ll(e){let t=cl;for(;;){const n=e/t;if(n<1)return;yield n,t*=cl}}function ul(e,t){var n,r;const o=t?{...al.defaultOptions,...t}:al.defaultOptions;if(!Array.isArray(o.units)||!o.units.length)throw new Error("Option `units` must be a non-empty array");let i;try{i=sl.parseValue(e)}catch(t){return t instanceof Error&&console.warn(`WARN: ${t.message} (millify)`),String(e)}const a=i<0?"-":"";i=Math.abs(i);let s=0;for(const e of ll(i))i=e,s+=1;if(s>=o.units.length)return e.toString();let c=sl.roundTo(i,o.precision);for(const e of ll(c))c=e,s+=1;const l=null!==(n=o.units[s])&&void 0!==n?n:"",u=o.lowercase?l.toLowerCase():l,f=o.space?" ":"";return`${a}${c.toLocaleString(null!==(r=o.locales)&&void 0!==r?r:sl.getLocales(),{minimumFractionDigits:sl.getFractionDigits(c)})}${f}${u}`}rl.millify=ul;var fl=rl.default=ul,dl={exports:{}};
|
|
19
19
|
/*!
|
|
20
20
|
Copyright (c) 2018 Jed Watson.
|
|
21
21
|
Licensed under the MIT License (MIT), see
|