miniflare
Version:
Fun, full-featured, fully-local simulator for Cloudflare Workers
1 lines • 5.75 kB
JavaScript
import{t as e}from"./label-latndvb1ngem7we8-CO7sxSXt.js";import{En as t,Gn as n,Ht as r,In as i,Jn as a,Kn as o,Ln as s,Nt as c,Tt as l,Ut as u,Wt as d}from"./index-BPLH0X4i.js";var f=a(n(),1),p=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M160,48V208L80,128Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z`}))]]),m=f.forwardRef((e,t)=>f.createElement(i,{ref:t,...e,weights:p}));m.displayName=`CaretLeftIcon`;var h=o();function g({controlFirst:e=!1}={}){return s(`grid gap-2`,`has-[input[type=checkbox]]:grid-cols-[auto_1fr] has-[input[type=checkbox]]:items-center`,`has-[[role=switch]]:grid-cols-[auto_1fr] has-[[role=switch]]:items-center`,e&&[`has-[input[type=checkbox]]:flex has-[input[type=checkbox]]:flex-row-reverse has-[input[type=checkbox]]:flex-wrap has-[input[type=checkbox]]:items-center`,`has-[[role=switch]]:flex has-[[role=switch]]:flex-row-reverse has-[[role=switch]]:flex-wrap has-[[role=switch]]:items-center`,`[&>label]:flex-1`])}function _({children:n,label:r,required:i,labelTooltip:a,error:o,description:l,controlFirst:f=!1}){let p=i===!1;return(0,h.jsxs)(u,{className:g({controlFirst:f}),children:[(0,h.jsx)(d,{className:`m-0 text-base font-medium text-kumo-default`,children:(0,h.jsx)(e,{showOptional:p,tooltip:a,asContent:!0,children:r})}),n,o?(0,h.jsx)(c,{className:s(`text-sm leading-snug text-kumo-danger`,`col-span-full`),match:o.match,children:o.message}):l&&(0,h.jsx)(t,{className:s(`text-sm leading-snug text-kumo-subtle`,`col-span-full`),children:l})]})}var v={size:{xs:{classes:`h-5 gap-1 rounded-sm px-1.5 text-xs`,description:`Extra small input for compact UIs`},sm:{classes:`h-6.5 gap-1 rounded-md px-2 text-xs`,description:`Small input for secondary fields`},base:{classes:`h-9 gap-1.5 rounded-lg px-3 text-base`,description:`Default input size`},lg:{classes:`h-10 gap-2 rounded-lg px-4 text-base`,description:`Large input for prominent fields`}},variant:{default:{classes:`focus:ring-kumo-hairline`,description:`Default input appearance`},error:{classes:`!ring-kumo-danger focus:ring-kumo-danger`,description:`Error state for validation failures`}}},y={size:`base`,variant:`default`};function b({variant:e=y.variant,size:t=y.size,parentFocusIndicator:n=!1,focusIndicator:r=!1}={}){return s(`border-0 bg-kumo-control text-kumo-default ring ring-kumo-line`,`kumo-input-placeholder disabled:text-kumo-subtle`,v.size[t].classes,v.variant[e].classes,n&&`focus-within:ring-kumo-hairline`,r&&`focus:ring-kumo-hairline`)}var x=(0,f.forwardRef)((e,t)=>{let{className:n,size:i=`base`,variant:a,label:o,labelTooltip:c,description:l,error:u,...d}=e,f=a??(u?`error`:`default`),{required:p}=d,m=(0,h.jsx)(r,{ref:t,className:s(b({size:i,variant:f,focusIndicator:!0}),n),...d});return o?(0,h.jsx)(_,{label:o,required:p,labelTooltip:c,description:l,error:u?typeof u==`string`?{message:u,match:!0}:u:void 0,children:m}):m});x.displayName=`Input`;var S={focusMode:`container`},C=f.createContext(null);function w({size:e,children:t,className:n,focusMode:r=S.focusMode}){let i=f.useId(),a=f.useId(),o=f.useMemo(()=>({size:e,inputId:i,descriptionId:a,focusMode:r}),[e,i,a,r]),c=r===`individual`;return(0,h.jsx)(C.Provider,{value:o,children:(0,h.jsx)(`div`,{className:s(b({size:e,parentFocusIndicator:!c}),`flex w-full gap-0 border-0 px-0`,c?`isolate overflow-visible`:`overflow-hidden shadow-xs ring ring-kumo-line focus-within:ring-kumo-hairline`,n),children:t})})}function T({children:e}){let t=(0,f.useContext)(C),n=t?.focusMode===`individual`;return(0,h.jsx)(`label`,{htmlFor:t?.inputId,className:s(`flex h-full items-center p-0 px-2 text-kumo-subtle`,n&&`first:rounded-l-[inherit] last:rounded-r-[inherit]`),children:e})}function E(e){let t=(0,f.useContext)(C),n=t?.focusMode===`individual`;return(0,h.jsx)(x,{id:t?.inputId,"aria-describedby":t?.descriptionId,size:t?.size,...e,className:s(`flex h-full items-center rounded-none border-0 bg-kumo-base font-sans`,`grow px-2`,n?`relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-1 focus:outline`:`focus:border-kumo-fill`,e.className)})}function D({children:e}){let t=(0,f.useContext)(C),n=t?.focusMode===`individual`;return(0,h.jsx)(`span`,{id:t?.descriptionId,className:s(`flex h-full items-center p-0 px-2 text-kumo-subtle`,n&&`first:rounded-l-[inherit] last:rounded-r-[inherit]`),children:e})}function O({children:e,className:t,...n}){let r=(0,f.useContext)(C),i=r?.focusMode===`individual`;return(0,h.jsx)(l,{...n,size:r?.size,className:s(`h-full! rounded-none disabled:bg-kumo-overlay disabled:text-kumo-inactive!`,i&&`relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-1 focus:outline`,t),children:e})}var k=Object.assign(w,{Label:T,Input:E,Button:O,Description:D});export{_ as n,m as r,k as t};