@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 26.4 kB
JavaScript
var i=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?i(...t):typeof t=="object"?Object.keys(t).map((o,a)=>t[a]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var S=(e,t)=>i({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.themeColor}`]:t.themeColor},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full","k-rounded-none":t.rounded==="none"}),z=(e,t)=>{let{valid:o,invalid:a,hover:n,focus:l,checked:p,active:c,selected:u,disabled:f,indeterminate:b,loading:v,empty:I,readonly:P,highlighted:B,...M}=t;return i({"k-valid":o,"k-invalid":a,"k-hover":n,"k-focus":l,"k-checked":p,"k-active":c,"k-selected":u,"k-disabled":f,"k-indeterminate":b&&!p,"k-loading":v,"k-empty":I,"k-readonly":P,"k-highlighted":B},Object.keys(M).reduce((g,O)=>(O.startsWith("k-")?g[O]=M[O]:g[`k-${O}`]=M[O],g),{}))};function mt(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(a=>[`k-${a}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},m={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},h={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},L={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},d={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},s={open:"open",hover:"hover",focus:"focus",active:"active",selected:"selected",disabled:"disabled",valid:"valid",invalid:"invalid",loading:"loading",required:"required",empty:"empty",indeterminate:"indeterminate",checked:"checked",readonly:"readonly",highlighted:"highlighted",generating:"generating",expanded:"expanded"};var we="popup",ut=we;import{jsx as ft}from"react/jsx-runtime";var xt="k-animation-container",Zt=[],jt={},Ke={positionMode:"absolute",shown:!0},D=e=>{let{positionMode:t=Ke.positionMode,shown:o=Ke.shown,animationStyle:a,offset:n,...l}=e;return ft("div",{...l,style:{...n,...e.style},className:i(e.className,xt,{"k-animation-container-shown":o,"k-animation-container-fixed":t==="fixed"}),children:ft("div",{className:"k-child-animation-container",style:a,children:e.children})})};D.states=Zt;D.options=jt;D.className=xt;D.defaultOptions=Ke;D.moduleName=we;D.folderName=ut;var Pe="action-buttons",ht=Pe;import{jsx as oo}from"react/jsx-runtime";var he="k-actions",eo=[],to={},Be={alignment:"start",orientation:"horizontal"},F=e=>{let{alignment:t=Be.alignment,orientation:o=Be.orientation,...a}=e;return oo("div",{...a,className:i(he,{[`${he}-${t}`]:t,[`${he}-${o}`]:o},e.className),children:e.children})};F.states=eo;F.options=to;F.className=he;F.defaultOptions=Be;F.moduleName=Pe;F.folderName=ht;import{jsx as ao}from"react/jsx-runtime";var no="k-actionsheet-footer",bt={alignment:"stretched",orientation:"horizontal"},Y=e=>{let{alignment:t=bt.alignment,orientation:o=bt.orientation,template:a,as:n=a?"div":F,...l}=e;return ao(n,{...l,...!a&&{alignment:t,orientation:o},className:i(e.className,no),children:e.children})};var ie="input",be=ie;import{jsx as lo}from"react/jsx-runtime";var Ne="k-input",io=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],so={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[h.undefined,h.solid,h.flat,h.outline]},ro={},T=e=>{let{hover:t,focus:o,disabled:a,invalid:n,valid:l,loading:p,readonly:c,size:u,rounded:f,fillMode:b,...v}=e;return lo("span",{...v,className:i(e.className,Ne,S(Ne,{size:u,rounded:f,fillMode:b}),z(Ne,{hover:t,focus:o,disabled:a,invalid:n,valid:l,loading:p,readonly:c}))})};T.states=io;T.options=so;T.className=Ne;T.defaultOptions=ro;T.moduleName=ie;T.folderName=be;import{jsx as uo}from"react/jsx-runtime";var ve="k-picker",co=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],po={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[h.undefined,h.solid,h.flat,h.outline]},mo={},W=e=>{let{hover:t,focus:o,disabled:a,invalid:n,valid:l,loading:p,readonly:c,size:u,rounded:f,fillMode:b,...v}=e;return uo("span",{...v,className:i(e.className,ve,S(ve,{size:u,rounded:f,fillMode:b}),z(ve,{hover:t,focus:o,disabled:a,invalid:n,valid:l,loading:p,readonly:c})),children:e.children})};W.states=co;W.options=po;W.className=ve;W.defaultOptions=mo;W.moduleName=ie;W.folderName=be;import{Fragment as bo,jsx as Nt}from"react/jsx-runtime";var ze="k-font-icon",fo=[],xo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info]},ho={},se=e=>{let{size:t,themeColor:o,icon:a,rotate:n,flip:l,...p}=e;return a?Nt("span",{...p,className:i(e.className,ze,S(ze,{size:t}),{[`k-i-${a}`]:a,[`k-color-${o}`]:o,[`k-rotate-${n}`]:n,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),"aria-hidden":"true"}):Nt(bo,{})};se.states=fo;se.options=xo;se.className=ze;se.defaultOptions=ho;var vt=se;import{Fragment as So,jsx as Se}from"react/jsx-runtime";var De="k-svg-icon",No=[],vo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info],variant:[L.outline,L.solid,L.duotone]},Fe={viewBox:"0 0 24 24",variant:L.outline},re=e=>{let{size:t,themeColor:o,rotate:a,flip:n,viewBox:l=Fe.viewBox,variant:p=Fe.variant,icon:c,...u}=e;if(!c)return Se(So,{});if(c==="none")return Se("span",{...u,className:i(e.className,De,S("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let f=typeof c=="object"&&c.name&&c.name,b=typeof c=="object"?p&&c.variants?.[p]||c.variants?.outline||c.content:void 0;return Se("span",{...u,className:i(e.className,De,S("k-icon",{size:t}),{[`k-svg-i-${f}`]:f,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":n==="h"||n==="both","k-flip-v":n==="v"||n==="both"}),"aria-hidden":"true",children:Se("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:l,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:c?void 0:e.children})})};re.states=No;re.options=vo;re.className=De;re.defaultOptions=Fe;var Ve=re;import*as Ue from"@progress/kendo-svg-icons";var St="icon",At="icons";import{useContext as Io}from"react";import{createContext as Ao}from"react";var It=Ao({iconsType:"svg"});import{Fragment as gt,jsx as le}from"react/jsx-runtime";var Ae="k-icon",go=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),To=[],yo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info],variant:[L.outline,L.solid,L.duotone]},Ie={viewBox:"0 0 24 24",type:"svg",variant:L.outline},N=e=>{let{iconsType:t}=Io(It),{size:o,themeColor:a,icon:n,type:l=t||Ie.type,rotate:p,flip:c,viewBox:u=Ie.viewBox,variant:f=Ie.variant,...b}=e;if(!n)return le(gt,{});if((t||l)==="svg"){if(n==="none")return le(Ve,{...b,className:i(e.className,Ae),icon:n,size:o,variant:f});let I=Ue[n]?n:go(`${n}-icon`);return Ue[I]?le(Ve,{...b,className:i(e.className,Ae),icon:Ue[I],size:o,themeColor:a,rotate:p,flip:c,viewBox:u,variant:f}):le(gt,{})}return le(vt,{...b,className:i(e.className,Ae),icon:n,size:o,themeColor:a,rotate:p,flip:c})};N.states=To;N.options=yo;N.defaultOptions=Ie;N.className=Ae;N.moduleName=St;N.folderName=At;N.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};import{Fragment as Oo,jsx as $e}from"react/jsx-runtime";var Tt="k-clear-value",Eo=[s.disabled,s.loading,s.readonly],Mo={},H=e=>{let{disabled:t,loading:o,readonly:a,value:n}=e;return t||a||o||!n?$e(Oo,{}):$e("span",{className:i(e.className,Tt),children:$e(N,{icon:"x"})})};H.states=Eo;H.options=Mo;H.className=Tt;import{jsx as Lo}from"react/jsx-runtime";var Xe="k-input-inner",ko=[],Co={},ge={type:"text",autocomplete:"off",value:"",placeholder:""},w=e=>{let{value:t=ge.value,type:o=ge.type,placeholder:a=ge.placeholder,autocomplete:n=ge.autocomplete,disabled:l,readOnly:p,...c}=e;return Lo("input",{...c,type:o,className:i(e.className,Xe,S(Xe,e)),placeholder:a,autoComplete:n,defaultValue:t,disabled:l||void 0,readOnly:p||void 0})};w.states=ko;w.options=Co;w.className=Xe;import{jsx as yt,jsxs as Ho}from"react/jsx-runtime";var qe="k-input-inner",_o=[],Ro={},Je=e=>{let{value:t,placeholder:o,showValue:a,valueIcon:n,valueIconName:l,...p}=e;return Ho("span",{...p,className:i(e.className,qe,S(qe,e)),children:[n,!n&&l&&yt(N,{className:"k-input-value-icon",icon:l}),a&&!t&&o,a&&t&&yt("span",{className:"k-input-value-text",children:t})]})};Je.states=_o;Je.options=Ro;Je.className=qe;import{jsx as Po}from"react/jsx-runtime";var Ge="k-input-inner",wo=[],Ko={},Et={value:"",placeholder:""},Ye=e=>{let{value:t=Et.value,placeholder:o=Et.placeholder,rows:a,disabled:n,...l}=e;return Po("textarea",{...l,className:i(e.className,Ge,S(Ge,e)),placeholder:o,rows:a,defaultValue:t,disabled:n||void 0})};Ye.states=wo;Ye.options=Ko;Ye.className=Ge;import{Fragment as zo,jsx as Mt}from"react/jsx-runtime";var Ot="k-input-loading-icon",Bo=[s.disabled,s.loading],V=e=>{let{disabled:t,loading:o}=e;return t||!o?Mt(zo,{}):Mt("span",{className:i(e.className,Ot,"k-icon k-i-loading")})};V.states=Bo;V.className=Ot;import{Fragment as Vo,jsx as kt}from"react/jsx-runtime";var Ct="k-input-validation-icon",Do=[s.valid,s.invalid,s.disabled,s.loading],Fo={},K=e=>{let{valid:t,invalid:o,disabled:a,loading:n}=e,l=o?"warning-circle":"check-circle";return a||n||!!!(t||o)?kt(Vo,{}):kt(N,{className:i(Ct),icon:l})};K.states=Do;K.options=Fo;K.className=Ct;import{Fragment as Xo,jsx as Lt}from"react/jsx-runtime";var Uo="k-input-prefix",$o={direction:"horizontal"},Te=e=>{let{direction:t=$o.direction,...o}=e;return e.children?Lt("span",{...o,className:i(Uo,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):Lt(Xo,{})};import{Fragment as Go,jsx as _t}from"react/jsx-runtime";var qo="k-input-suffix",Jo={direction:"horizontal"},ye=e=>{let{direction:t=Jo.direction,...o}=e;return e.children?_t("span",{...o,className:i(qo,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):_t(Go,{})};import{jsx as ki}from"react/jsx-runtime";import{jsx as Ri}from"react/jsx-runtime";import{jsx as Wo}from"react/jsx-runtime";var Rt="k-input-separator",Yo={direction:"vertical"},Q=e=>{let{direction:t=Yo.direction,...o}=e;return Wo("span",{...o,className:i(Rt,e.className,{[`${Rt}-${t}`]:t})})};var We="button",Ht=We;import{Fragment as wt,jsx as Z,jsxs as Kt}from"react/jsx-runtime";var ce="k-button",Qo=["icon-button"],Zo=[s.hover,s.focus,s.active,s.selected,s.disabled,s.generating],jo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[h.undefined,h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info,d.inverse]},Qe={showArrow:!1,arrowIconName:"chevron-down"},x=e=>{let{as:t="button",size:o,rounded:a,fillMode:n,themeColor:l,showArrow:p=Qe.showArrow,arrowIconName:c=Qe.arrowIconName,variant:u,hover:f,focus:b,active:v,selected:I,disabled:P,togglable:B,ariaDisabled:M,icon:g,iconSize:O,text:C,iconClassName:xe,className:Le,..._e}=e,Re=g!=null,He=e.children!==void 0;return Kt(t,{className:i(Le,ce,mt(ce,u),S(ce,{size:o,rounded:a,fillMode:n,themeColor:l}),z(ce,{hover:f,focus:b,active:v,disabled:P||M,selected:I}),{"k-icon-button":!C&&!He&&Re}),"aria-pressed":B?I?"true":"false":void 0,..._e,"aria-disabled":M?"true":void 0,disabled:P||void 0,children:[typeof g=="string"&&g&&Z(N,{className:i(xe,"k-button-icon"),icon:g,size:O}),g&&typeof g!="string"&&Z(wt,{children:g}),C?Kt(wt,{children:[C&&Z("span",{className:"k-button-text",children:C}),e.children]}):e.children&&Z("span",{className:"k-button-text",children:e.children}),p&&Z("span",{className:"k-menu-button-arrow k-button-arrow",children:Z(N,{icon:c})})]})};x.states=Zo;x.options=jo;x.variants=Qo;x.className=ce;x.defaultOptions=Qe;x.moduleName=We;x.folderName=Ht;x.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};import{jsx as en}from"react/jsx-runtime";var J=e=>en(x,{children:"Button",...e});import{Fragment as Pt,jsx as _,jsxs as Ze}from"react/jsx-runtime";var tn=T.states,on=T.defaultOptions,nn=T.options,an=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"},{name:"validation-icon",title:"Validation Icon"},{name:"separators",title:"Separators"}],sn=[],j=e=>{let{modifiers:t,valid:o,invalid:a,loading:n,disabled:l,readonly:p,...c}=e,u=t?.prefix,f=t?.suffix,b=t?.["clear-button"],v=t?.["validation-icon"],I=t?.separators;return Ze(T,{...c,valid:o,invalid:a,loading:n,disabled:l,readonly:p,style:{width:300},children:[u&&Ze(Pt,{children:[_(Te,{children:_(N,{icon:"lock"})}),I&&_(Q,{})]}),_(w,{placeholder:"Placeholder",value:"Value"}),v&&_(K,{valid:o,invalid:a,loading:n,disabled:l}),_(V,{loading:n,disabled:l}),b&&_(H,{loading:n,disabled:l,readonly:p,value:"Value"}),f&&Ze(Pt,{children:[I&&_(Q,{}),_(ye,{children:_(J,{size:c.size,fillMode:"clear",children:"Send"})})]})]})};j.options=nn;j.states=tn;j.variants=sn;j.defaultOptions=on;j.modifiers=an;j.className=T.className;var je="searchbox",Bt=je;import{jsx as de,jsxs as cn}from"react/jsx-runtime";var zt="k-searchbox",rn=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading],ln={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[h.undefined,h.solid,h.flat,h.outline]},et={showIcon:!0,icon:"search"},U=e=>{let{value:t,placeholder:o,size:a,rounded:n,fillMode:l,hover:p,focus:c,valid:u,invalid:f,required:b,loading:v,disabled:I,showIcon:P=et.showIcon,icon:B=et.icon,"aria-label":M,...g}=e;return cn(T,{...g,size:a,rounded:n,fillMode:l,hover:p,focus:c,valid:u,invalid:f,required:b,loading:v,disabled:I,className:i(e.className,zt),children:[P&&de(N,{className:"k-input-icon",icon:B}),de(w,{placeholder:o,value:t,"aria-label":M}),de(V,{...e}),de(K,{...e}),de(H,{...e})]})};U.states=rn;U.options=ln;U.className=zt;U.defaultOptions=et;U.moduleName=je;U.folderName=Bt;import{jsx as _s}from"react/jsx-runtime";var tt="textbox",Dt=tt;import{Fragment as Ft,jsx as $,jsxs as ot}from"react/jsx-runtime";var Vt="k-textbox",dn=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],pn={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[h.undefined,h.solid,h.flat,h.outline]},Ee={showClearButton:!0,showValidationIcon:!0,separators:!0},E=e=>{let{size:t,rounded:o,fillMode:a,separators:n=Ee.separators,showClearButton:l=Ee.showClearButton,showValidationIcon:p=Ee.showValidationIcon,prefix:c,suffix:u,type:f,value:b,placeholder:v,hover:I,focus:P,valid:B,invalid:M,required:g,loading:O,disabled:C,readonly:xe,id:Le,"aria-label":_e,"aria-describedby":Re,...He}=e;return ot(T,{...He,size:t,rounded:o,fillMode:a,hover:I,focus:P,valid:B,invalid:M,required:g,loading:O,disabled:C,readonly:xe,className:i(e.className,Vt),children:[c&&ot(Ft,{children:[$(Te,{children:c}),n&&$(Q,{})]}),$(w,{id:Le,placeholder:v,value:b,type:f,disabled:C,"aria-label":_e,"aria-describedby":Re,"aria-invalid":M?"true":void 0}),p&&$(K,{valid:B,invalid:M,loading:O,disabled:C}),$(V,{loading:O,disabled:C}),l&&$(H,{loading:O,disabled:C,readonly:xe,value:b}),u&&ot(Ft,{children:[n&&$(Q,{}),$(ye,{children:u})]})]})};E.states=dn;E.options=pn;E.className=Vt;E.defaultOptions=Ee;E.moduleName=tt;E.folderName=Dt;E.ariaSpec={selector:".k-textbox",rules:[{selector:".k-textbox > .k-input-inner",attribute:"role=textbox or nodeName=input",usage:"Describes the role of the component."},{selector:".k-textbox > .k-input-inner",attribute:"label for or aria-label or aria-labelledby (when has accessible name)",usage:"The input requires an accessible name (provided by consuming app)."},{selector:".k-textbox > .k-input-inner",attribute:"aria-invalid=true (when invalid)",usage:"Rendered when the TextBox is in an invalid state."},{selector:".k-textbox > .k-input-inner",attribute:"aria-describedby (when has hint or error)",usage:"Points to the hint or error message for the input."},{selector:".k-textbox.k-disabled > .k-input-inner",attribute:"disabled=disabled or aria-disabled=true",usage:"Rendered when the TextBox is disabled."}]};var pe=E;import{jsx as mn}from"react/jsx-runtime";var Ut=e=>mn(pe,{...e});import{Fragment as Ws,jsx as Ys}from"react/jsx-runtime";import{jsx as un}from"react/jsx-runtime";var $t=e=>un(x,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});import{jsx as fn}from"react/jsx-runtime";var Xt=e=>fn(x,{icon:"folder",children:"Button",...e});import{jsx as nt}from"react/jsx-runtime";var xn=x.options,hn=x.states,bn={...x.defaultOptions,variant:"text"},Nn=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],vn=[],ee=e=>{let{variant:t,...o}=e;switch(t){case"icon-only":return nt($t,{...o,icon:"star"});case"icon-and-text":return nt(Xt,{...o,icon:"star",children:"Button"});default:return nt(J,{...o,children:"Button"})}};ee.options=xn;ee.states=hn;ee.variants=Nn;ee.defaultOptions=bn;ee.modifiers=vn;ee.className=x.className;import{Fragment as Ar,jsx as Sr}from"react/jsx-runtime";import{jsx as yr}from"react/jsx-runtime";import{jsx as at}from"react/jsx-runtime";var Sn=E.states,An=E.defaultOptions,In=E.options,gn=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"}],Tn=[],te=e=>{let{modifiers:t,...o}=e,a={};return Object.keys(t||{}).forEach(n=>{switch(n){case"prefix":a.prefix=t?.[n]?at(N,{icon:"lock"}):void 0;break;case"suffix":a.suffix=t?.[n]?at(J,{size:o.size,fillMode:"clear",children:"Send"}):void 0;break;case"clear-button":a.showClearButton=t?.[n];break;default:break}}),at(Ut,{value:"Value",style:{width:300},...o,...a})};te.options=In;te.states=Sn;te.variants=Tn;te.defaultOptions=An;te.modifiers=gn;te.className=E.className;import{jsx as X,jsxs as it}from"react/jsx-runtime";var qt="k-actionsheet-titlebar",yn={},R=e=>{let{title:t,subtitle:o,actionsStart:a,actionsEnd:n,filter:l,input:p,inputValue:c,inputPlaceholder:u,adaptive:f,titleId:b,children:v,...I}=e;return it("div",{...I,className:i(e.className,qt),children:[it("div",{className:"k-actionsheet-titlebar-group",children:[a&&X("div",{className:"k-actionsheet-actions",children:a}),!v&&it("div",{className:"k-actionsheet-title",id:b,children:[t&&X("div",{className:"k-text-center",children:t}),o&&X("div",{className:"k-actionsheet-subtitle k-text-center",children:o})]}),v&&X("div",{className:"k-actionsheet-title",id:b,children:v}),n&&X("div",{className:"k-actionsheet-actions",children:n})]}),(p||l)&&X("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter",children:p?X(E,{value:c,placeholder:u,size:f?"large":"medium","aria-label":t||u||"Input"}):X(U,{placeholder:"Filter",size:f?"large":"medium","aria-label":"Filter options"})})]})};R.className=qt;R.defaultOptions=yn;import{jsx as st,jsxs as kn}from"react/jsx-runtime";var rt="k-actionsheet-view",En=[],Mn={},On={},oe=e=>{let{adaptive:t,animated:o,children:a,header:n,footer:l,titleId:p,...c}=e,u=n?.type===R&&st(R,{adaptive:t,titleId:p,...n?.props}),f=l?.type===Y&&st(Y,{...l?.props});return kn("div",{...c,className:i(e.className,rt,{[`${rt}-animated`]:o}),children:[u,st("div",{className:"k-actionsheet-content",children:a}),f]})};oe.states=En;oe.options=Mn;oe.className=rt;oe.defaultOptions=On;var me="action-sheet",Me=me;var lt="overlay",Jt=lt;import{jsx as Rn}from"react/jsx-runtime";var Gt="k-overlay",Cn=[],Ln={},_n={},q=e=>{let{...t}=e;return Rn("div",{...t,className:i(e.className,Gt),children:e.children})};q.states=Cn;q.options=Ln;q.className=Gt;q.defaultOptions=_n;q.moduleName=lt;q.folderName=Jt;import{jsx as Oe,jsxs as Kn}from"react/jsx-runtime";var Yt="k-actionsheet",Hn=[],wn={},ue={side:"bottom",fullscreen:!1,adaptive:!1,overlay:!0},y=e=>{let{side:t=ue.side,fullscreen:o=ue.fullscreen,adaptive:a=ue.adaptive,overlay:n=ue.overlay,template:l,children:p,header:c,footer:u,id:f,...b}=e,v=f&&!l&&c?`${f}-title`:void 0;return Kn("div",{className:"k-actionsheet-container",children:[n&&Oe(q,{}),Oe(D,{animationStyle:{[`${o===!0?"top":t}`]:0,[`${o===!0?"width":null}`]:"100%",[`${o===!0?"height":null}`]:"100%",[`${t==="top"||t==="bottom"?"width":null}`]:"100%",[`${t==="left"||t==="right"?"height":null}`]:"100%"},children:Oe("div",{...b,id:f,role:"dialog","aria-modal":n?"true":void 0,"aria-labelledby":v,className:i(e.className,Yt,{[`k-actionsheet-${t}`]:o===!1,"k-actionsheet-fullscreen":o===!0,"k-adaptive-actionsheet":a}),children:l||Oe(oe,{header:c,footer:u,adaptive:a,titleId:v,...e,children:p})})})]})};y.states=Hn;y.options=wn;y.className=Yt;y.defaultOptions=ue;y.moduleName=me;y.folderName=Me;y.ariaSpec={selector:".k-actionsheet",rules:[{selector:".k-actionsheet",attribute:"role=dialog",usage:"Announces the dialog role of the component."},{selector:".k-actionsheet",attribute:"aria-labelledby (when has title)",usage:"Associates the title of the action sheet."},{selector:".k-actionsheet",attribute:"aria-hidden=true/false (when hidden)",usage:"Announces the hidden state of the ActionSheet container."},{selector:".k-actionsheet",attribute:"aria-modal=true (when modal)",usage:"Announces that the action sheet is modal."},{selector:".k-actionsheet .k-actionsheet-title",attribute:"id",usage:"Used to associate the title with the action sheet wrapper element."}]};import{jsx as Dn}from"react/jsx-runtime";var Wt="k-actionsheet-container",Pn=[],Bn={},zn={},ne=e=>{let{children:t,...o}=e;return Dn("div",{...o,className:Wt,children:t})};ne.states=Pn;ne.options=Bn;ne.className=Wt;ne.defaultOptions=zn;ne.moduleName=me;ne.folderName=Me;import{jsx as Fn}from"react/jsx-runtime";var ke=e=>{let{...t}=e;return Fn("div",{...t,className:i(e.className,"k-list-ul"),children:e.children})};import{Fragment as Un,jsx as fe,jsxs as ct}from"react/jsx-runtime";var dt="k-actionsheet-item",Vn=[s.hover,s.focus,s.selected,s.disabled],k=e=>{let{iconName:t,text:o,description:a,hover:n,focus:l,selected:p,disabled:c,...u}=e;return ct("span",{...u,className:i(e.className,dt,z(dt,{hover:n,focus:l,selected:p,disabled:c})),children:[!e.children&&fe(Un,{children:ct("span",{className:"k-actionsheet-action",children:[t&&fe("span",{className:"k-icon-wrap",children:fe(N,{className:"k-actionsheet-item-icon",icon:t})}),ct("span",{className:"k-actionsheet-item-text",children:[o&&fe("span",{className:"k-actionsheet-item-title",children:o}),a&&fe("span",{className:"k-actionsheet-item-description",children:a})]})]})}),e.children]})};k.states=Vn;k.className=dt;import{jsx as Tl}from"react/jsx-runtime";import{jsx as Ol}from"react/jsx-runtime";import{jsx as A,jsxs as pt}from"react/jsx-runtime";var $n=y.options,Xn=y.states,Qt={...y.defaultOptions,variant:"normal"},qn=[{name:"normal",title:"Normal"},{name:"adaptive",title:"Adaptive"},{name:"fullScreen",title:"Full Screen"}],Jn=[{name:"actions",title:"Titlebar Actions",type:"boolean"},{name:"subtitle",title:"Subtitle",type:"boolean"},{name:"footer",title:"Footer",type:"boolean"}],ae=e=>{let{variant:t,modifiers:o,...a}={...Qt,...e},n={},l=pt(ke,{children:[A(k,{text:"Edit Item",description:"Click to edit",iconName:"edit-tools"}),A(k,{text:"Add to Favorites",iconName:"heart"}),A(k,{text:"Upload New",iconName:"upload",disabled:!0}),A("hr",{className:"k-hr"}),A(k,{text:"Cancel",iconName:"cancel"})]}),p="Choose from the items below",c="Select Item";return t==="fullScreen"&&(n.fullScreen=!0),Object.keys(o||{}).forEach(u=>{switch(u){case"actions":n.actionsStart=!!o?.[u],n.actionsEnd=!!o?.[u];break;case"subtitle":n.subtitle=o?.[u]?p:void 0;break;case"footer":n.footer=!!o?.[u];break;default:break}}),t==="adaptive"?A(y,{...a,adaptive:!0,fullscreen:n.fullScreen,header:A(R,{actionsStart:n.actionsStart?A(x,{icon:"chevron-left",size:"large",fillMode:"flat"}):void 0,actionsEnd:n.actionsEnd?A(x,{icon:"x",size:"large",fillMode:"flat"}):void 0,title:c,subtitle:n.subtitle}),footer:n.footer?pt(Y,{alignment:"stretched",children:[A(x,{text:"Cancel",size:"large",themeColor:"base"}),A(x,{text:"Apply",size:"large",themeColor:"primary"})]}):void 0,children:l}):A(y,{...a,fullscreen:n.fullScreen,header:A(R,{actionsStart:n.actionsStart?A(x,{icon:"chevron-left",fillMode:"flat"}):void 0,actionsEnd:n.actionsEnd?A(x,{icon:"x",fillMode:"flat"}):void 0,title:"Select Item",subtitle:n.subtitle}),footer:n.footer?pt(Y,{alignment:"stretched",children:[A(x,{text:"Apply",themeColor:"primary"}),A(x,{text:"Cancel",themeColor:"base"})]}):void 0,children:l})};ae.options=$n;ae.states=Xn;ae.variants=qn;ae.defaultOptions=Qt;ae.modifiers=Jn;ae.className=y.className;import{jsx as G,jsxs as Gn}from"react/jsx-runtime";var Ce=({title:e="Select item",id:t="actionsheet-1",...o})=>G(y,{id:t,header:G(R,{title:e}),children:[Gn(ke,{children:[G(k,{text:"Edit Item",description:"Click to edit",iconName:"edit-tools"}),G(k,{text:"Add to Favorites",iconName:"heart"}),G(k,{text:"Upload New",iconName:"upload"}),G("hr",{className:"k-hr"}),G(k,{text:"Action",iconName:"cancel"})]},"action-sheet-items")],...o});import{jsx as Yn}from"react/jsx-runtime";var oc=e=>Yn(Ce,{side:"top",...e});export{oc as ActionSheetTop};