figma-kit 1.0.0-beta.19 → 1.0.0-beta.22

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/dist/index.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
  * MIT License
4
4
  * Copyright (c) 2022 WorkOS
5
5
  * https://github.com/radix-ui/primitives/blob/main/LICENSE
6
- * */function Ct(r,t){typeof r=="function"?r(t):r!=null&&(r.current=t)}function Ee(...r){return t=>r.forEach(e=>Ct(e,t))}function ae(...r){return D.useCallback(Ee(...r),r)}const Le=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.Root,{ref:t,className:u.cx(e,"fp-TabsRoot"),...o})}),Oe=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.List,{ref:t,className:u.cx(e,"fp-TabsList"),...o})}),Ve=l.forwardRef((r,t)=>{const{className:e,...o}=r,a=Nt(),s=Ee(t,a);return n.jsx(oe.Trigger,{ref:s,className:u.cx(e,"fp-TabsTrigger"),...o})});function Nt(){return l.useCallback(r=>{r!==null&&(r.style.width=r.getBoundingClientRect().width+"px")},[])}const Be=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.Content,{ref:t,className:u.cx(e,"fp-TabsContent"),...o})});Le.displayName="Tabs.Root";Oe.displayName="Tabs.List";Ve.displayName="Tabs.Trigger";Be.displayName="Tabs.Content";const yt=Object.freeze(Object.defineProperty({__proto__:null,Content:Be,List:Oe,Root:Le,Trigger:Ve},Symbol.toStringTag,{value:"Module"})),ne=u.cva("fp-Text",{variants:{size:{small:"fp-size-small",medium:"fp-size-medium",large:"fp-size-large"},weight:{default:"fp-weight-default",strong:"fp-weight-strong"},align:{start:"fp-align-start",center:"fp-align-center",end:"fp-align-end"},block:{true:"fp-block"}}}),E=l.forwardRef((r,t)=>{const{asChild:e,className:o,size:a,weight:s,align:c,block:i,...d}=r,p=e?_e.Slot:"span";return n.jsx(p,{ref:t,className:ne({className:o,size:a,weight:s,align:c,block:i}),...d})});E.displayName="Text";const se=l.forwardRef((r,t)=>{const{className:e,size:o,weight:a,align:s,block:c,...i}=r;return n.jsx("label",{ref:t,className:ne({className:e,size:o,weight:a,align:s,block:c}),...i})});se.displayName="Label";const Fe=l.forwardRef((r,t)=>{const{className:e,size:o,weight:a,align:s,block:c,...i}=r;return n.jsx("p",{ref:t,className:ne({className:e,size:o,weight:a,align:s,block:c}),...i})});Fe.displayName="Paragraph";const Ge=l.forwardRef((r,t)=>{const{asChild:e,className:o,size:a,weight:s,align:c,block:i,...d}=r,p=e?_e.Slot:"a";return n.jsx(p,{ref:t,className:u.cx(ne({className:o,size:a,weight:s,align:c,block:i}),"fp-Link"),...d})});Ge.displayName="Link";/**
6
+ * */function Ct(r,t){typeof r=="function"?r(t):r!=null&&(r.current=t)}function Ee(...r){return t=>r.forEach(e=>Ct(e,t))}function ae(...r){return D.useCallback(Ee(...r),r)}const Oe=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.Root,{ref:t,className:u.cx(e,"fp-TabsRoot"),...o})}),Le=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.List,{ref:t,className:u.cx(e,"fp-TabsList"),...o})}),Ve=l.forwardRef((r,t)=>{const{className:e,...o}=r,a=Nt(),s=Ee(t,a);return n.jsx(oe.Trigger,{ref:s,className:u.cx(e,"fp-TabsTrigger"),...o})});function Nt(){return l.useCallback(r=>{r!==null&&(r.style.width=r.getBoundingClientRect().width+"px")},[])}const Be=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(oe.Content,{ref:t,className:u.cx(e,"fp-TabsContent"),...o})});Oe.displayName="Tabs.Root";Le.displayName="Tabs.List";Ve.displayName="Tabs.Trigger";Be.displayName="Tabs.Content";const yt=Object.freeze(Object.defineProperty({__proto__:null,Content:Be,List:Le,Root:Oe,Trigger:Ve},Symbol.toStringTag,{value:"Module"})),ne=u.cva("fp-Text",{variants:{size:{small:"fp-size-small",medium:"fp-size-medium",large:"fp-size-large"},weight:{default:"fp-weight-default",strong:"fp-weight-strong"},align:{start:"fp-align-start",center:"fp-align-center",end:"fp-align-end"},block:{true:"fp-block"}}}),E=l.forwardRef((r,t)=>{const{asChild:e,className:o,size:a,weight:s,align:c,block:i,...d}=r,p=e?_e.Slot:"span";return n.jsx(p,{ref:t,className:ne({className:o,size:a,weight:s,align:c,block:i}),...d})});E.displayName="Text";const se=l.forwardRef((r,t)=>{const{className:e,size:o,weight:a,align:s,block:c,...i}=r;return n.jsx("label",{ref:t,className:ne({className:e,size:o,weight:a,align:s,block:c}),...i})});se.displayName="Label";const Fe=l.forwardRef((r,t)=>{const{className:e,size:o,weight:a,align:s,block:c,...i}=r;return n.jsx("p",{ref:t,className:ne({className:e,size:o,weight:a,align:s,block:c}),...i})});Fe.displayName="Paragraph";const Ge=l.forwardRef((r,t)=>{const{asChild:e,className:o,size:a,weight:s,align:c,block:i,...d}=r,p=e?_e.Slot:"a";return n.jsx(p,{ref:t,className:u.cx(ne({className:o,size:a,weight:s,align:c,block:i}),"fp-Link"),...d})});Ge.displayName="Link";/**
7
7
  * @license
8
8
  * MIT License
9
9
  * Copyright (c) 2022 WorkOS
10
10
  * https://github.com/radix-ui/primitives/blob/main/LICENSE
11
- * */function qe(r){const t=D.useRef(r);return D.useEffect(()=>{t.current=r}),D.useMemo(()=>(...e)=>{var o;return(o=t.current)==null?void 0:o.call(t,...e)},[])}function me({prop:r,defaultProp:t,onChange:e=()=>{}}){const[o,a]=Rt({defaultProp:t,onChange:e}),s=r!==void 0,c=s?r:o,i=qe(e),d=D.useCallback(p=>{if(s){const f=typeof p=="function"?p(r):p;f!==r&&i(f)}else a(p)},[s,r,a,i]);return[c,d]}function Rt({defaultProp:r,onChange:t}){const e=D.useState(r),[o]=e,a=D.useRef(o),s=qe(t);return D.useEffect(()=>{a.current!==o&&(s(o),a.current=o)},[o,a,s]),e}const He=l.forwardRef((r,t)=>{const{className:e,fullWidth:o,value:a,defaultValue:s,onValueChange:c,...i}=r,[d,p]=me({prop:a,defaultProp:s,onChange:c});return n.jsx(ze.Root,{ref:t,className:u.cx(e,"fp-SegmentedControlRoot",{"fp-full-width":o}),...i,type:"single",value:d,onValueChange:g=>{g&&p(g)}})}),Ue=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(ze.Item,{ref:t,className:u.cx(e,"fp-SegmentedControlItem"),...o})}),We=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(E,{ref:t,className:u.cx(e,"fp-SegmentedControlText"),...o})});He.displayName="SegmentedControl.Root";Ue.displayName="SegmentedControl.Item";We.displayName="SegmentedControl.Text";const wt=Object.freeze(Object.defineProperty({__proto__:null,Item:Ue,Root:He,Text:We},Symbol.toStringTag,{value:"Module"}));function le(r,t){const e=l.createContext(t);function o(s){const{children:c,...i}=s,d=l.useMemo(()=>i,Object.values(i));return n.jsx(e.Provider,{value:d,children:c})}function a(s){const c=l.useContext(e);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${r}\``)}return o.displayName=r+"Provider",[o,a]}const[vt,jt]=le("RadioGroup"),Xe=l.forwardRef((r,t)=>{const{orientation:e="horizontal",disabled:o,className:a,...s}=r;return n.jsx(vt,{orientation:e,disabled:o,children:n.jsx(Ae.Root,{ref:t,orientation:e,disabled:o,className:u.cx(a,"fp-RadioGroupRoot"),...s})})}),Ke=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(Ae.Item,{ref:t,className:u.cx(e,"fp-RadioGroupItem"),...o})}),Ye=l.forwardRef((r,t)=>{const{orientation:e,disabled:o}=jt("Label"),{className:a,...s}=r;return n.jsx(se,{ref:t,className:u.cx(a,"fp-RadioGroupLabel"),"data-orientation":e,"data-disabled":o?"":void 0,...s})});Xe.displayName="RadioGroup.Root";Ke.displayName="RadioGroup.Item";Ye.displayName="RadioGroup.Label";const Pt=Object.freeze(Object.defineProperty({__proto__:null,Item:Ke,Label:Ye,Root:Xe},Symbol.toStringTag,{value:"Module"})),St="6",Tt="0 0 24 24",Mt=u.cva("fp-Icon",{variants:{size:{1:"fp-size-1",2:"fp-size-2","2_5":"fp-size-2_5",3:"fp-size-3","3_5":"fp-size-3_5",4:"fp-size-4",5:"fp-size-5",6:"fp-size-6",7:"fp-size-7",8:"fp-size-8",9:"fp-size-9",10:"fp-size-10"}},defaultVariants:{size:St}});function L(r){const{path:t,viewBox:e=Tt,displayName:o}=r,a=l.forwardRef((s,c)=>{const{size:i,className:d,...p}=s;return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",ref:c,viewBox:e,className:Mt({className:d,size:i}),fill:"none",...p,children:t})});return a.displayName=o||"Icon",a}const Ze=L({displayName:"Close",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",strokeLinejoin:"round",d:"M17 7 7 17M7 7l10 10"})}),he=L({displayName:"ChevronRight",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M11.121 14.121L13.243 12L11.12 9.879"})}),It=L({displayName:"ChevronUp",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M14.121 12.879L12 10.757L9.87903 12.88"})}),Je=L({displayName:"ChevronDown",path:n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M9.87897 11.121L12 13.243L14.121 11.12"})})}),ce=L({displayName:"Checkmark",viewBox:"0 0 16 16",path:n.jsx("path",{fill:"var(--color-icon)",fillRule:"evenodd",clipRule:"evenodd",d:"M11.777 4.08399C11.8873 4.1575 11.9639 4.27178 11.99 4.40172C12.016 4.53167 11.9894 4.66665 11.916 4.77699L7.91602 10.777C7.87506 10.8387 7.82091 10.8905 7.75748 10.9287C7.69405 10.9669 7.62294 10.9905 7.54926 10.9979C7.47559 11.0053 7.40119 10.9962 7.33146 10.9713C7.26172 10.9464 7.19839 10.9063 7.14602 10.854L4.14602 7.85399C4.09953 7.80751 4.06266 7.75232 4.0375 7.69158C4.01234 7.63084 3.99939 7.56574 3.99939 7.49999C3.99939 7.43425 4.01234 7.36915 4.0375 7.30841C4.06266 7.24767 4.09953 7.19248 4.14602 7.14599C4.19251 7.09951 4.2477 7.06263 4.30844 7.03747C4.36918 7.01231 4.43428 6.99936 4.50002 6.99936C4.56577 6.99936 4.63087 7.01231 4.6916 7.03747C4.75234 7.06263 4.80753 7.09951 4.85402 7.14599L7.42202 9.71599L11.084 4.22299C11.1575 4.11271 11.2718 4.03612 11.4018 4.01006C11.5317 3.98399 11.6667 4.01059 11.777 4.08399Z"})}),Qe=L({displayName:"Circle",viewBox:"0 0 16 16",path:n.jsx("circle",{fill:"var(--color-icon)",cx:"8",cy:"8",r:"3"})}),$t=L({displayName:"CheckmarkIndeterminate",viewBox:"0 0 16 16",path:n.jsx("path",{fill:"var(--color-icon)",d:"M4 8a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z"})}),[kt,xe]=le("Checkbox"),er=l.forwardRef((r,t)=>{const{className:e,id:o,...a}=r,s=l.useId(),c=o??s;return n.jsx(kt,{id:c,children:n.jsx("div",{ref:t,className:u.cx(e,"fp-CheckboxRoot"),...a})})}),rr=l.forwardRef((r,t)=>{const{className:e,indeterminate:o,...a}=r,{id:s}=xe("Input"),c=_t(o),i=ae(t,c);return n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:i,className:u.cx(e,"fp-CheckboxInput"),id:s,"aria-labelledby":`checkbox-label-${s}`,"aria-describedby":`checkbox-description-${s}`,...a,type:"checkbox"}),n.jsx(tr,{})]})}),tr=()=>n.jsxs("span",{className:"fp-CheckboxIndicator","aria-hidden":"true",children:[n.jsx(ce,{className:"fp-CheckboxCheckmark",size:"4"}),n.jsx($t,{className:"fp-CheckboxIndeterminate",size:"4"})]}),or=l.forwardRef((r,t)=>{const{className:e,...o}=r,{id:a}=xe("Input");return n.jsx(se,{"aria-hidden":"true",ref:t,className:u.cx(e,"fp-CheckboxLabel"),htmlFor:a,id:`checkbox-label-${a}`,...o})}),ar=l.forwardRef((r,t)=>{const{className:e,...o}=r,{id:a}=xe("Description");return n.jsx(E,{"aria-hidden":"true",ref:t,className:u.cx(e,"fp-CheckboxDescription"),id:`checkbox-description-${a}`,...o})});function _t(r){return l.useCallback(t=>{t&&(t.indeterminate=!!r)},[r])}er.displayName="Checkbox.Root";rr.displayName="Checkbox.Input";tr.displayName="Checkbox.Indicator";or.displayName="Checkbox.Label";ar.displayName="Checkbox.Description";const Dt=Object.freeze(Object.defineProperty({__proto__:null,Description:ar,Input:rr,Label:or,Root:er},Symbol.toStringTag,{value:"Module"})),nr=y.Root,zt=y.Arrow,Ce=l.forwardRef((r,t)=>{const{placeholder:e,className:o,...a}=r;return n.jsxs(y.Trigger,{ref:t,...a,className:u.cx(o,"fp-SelectTrigger"),children:[n.jsx(y.Value,{placeholder:e}),n.jsx(y.Icon,{className:"fp-SelectTriggerIcon",children:n.jsx(Je,{})})]})}),Ne=l.forwardRef((r,t)=>{const{children:e,portal:o=!1,className:a,...s}=r,c=o?y.Portal:l.Fragment;return n.jsx(c,{children:n.jsxs(y.Content,{ref:t,...s,className:u.cx(a,"fp-MenuContent"),children:[n.jsx(y.ScrollUpButton,{className:"fp-SelectScrollUpButton",children:n.jsx(It,{})}),n.jsx(y.Viewport,{children:e}),n.jsx(y.ScrollDownButton,{className:"fp-SelectScrollDownButton",children:n.jsx(Je,{})})]})})}),ye=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(y.Item,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(y.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),n.jsx(y.ItemText,{children:e})]})}),sr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),lr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),cr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})});Ce.displayName="Select.Trigger";Ne.displayName="Select.Content";ye.displayName="Select.Item";sr.displayName="Select.Separator";cr.displayName="Select.Group";lr.displayName="Select.Label";const At=Object.freeze(Object.defineProperty({__proto__:null,Arrow:zt,Content:Ne,Group:cr,Item:ye,Label:lr,Root:nr,Separator:sr,Trigger:Ce},Symbol.toStringTag,{value:"Module"})),Et=C.Root,Lt=C.Trigger,Ot=C.Sub,Vt=C.RadioGroup,ir=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(C.Portal,{children:n.jsx(C.Content,{ref:t,sideOffset:6,...a,className:u.cx(o,"fp-MenuContent"),children:e})})}),ur=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Item,{ref:t,...o,className:u.cx(e,"fp-MenuItem")})}),dr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),pr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),gr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})}),mr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.SubTrigger,{ref:t,...a,className:u.cx(o,"fp-MenuItem"),children:[e,n.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),fr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Portal,{children:n.jsx(C.SubContent,{ref:t,...o,className:u.cx(e,"fp-MenuContent"),sideOffset:12})})}),br=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.CheckboxItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),e]})}),hr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.RadioItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuRadioItem"),children:[n.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(Qe,{size:"4"})}),e]})});ir.displayName="DropdownMenu.Content";ur.displayName="DropdownMenu.Item";dr.displayName="DropdownMenu.Separator";gr.displayName="DropdownMenu.Group";pr.displayName="DropdownMenu.Label";mr.displayName="DropdownMenu.SubTrigger";fr.displayName="DropdownMenu.SubContent";br.displayName="DropdownMenu.CheckboxItem";hr.displayName="DropdownMenu.RadioItem";const Bt=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:br,Content:ir,Group:gr,Item:ur,Label:pr,RadioGroup:Vt,RadioItem:hr,Root:Et,Separator:dr,Sub:Ot,SubContent:fr,SubTrigger:mr,Trigger:Lt},Symbol.toStringTag,{value:"Module"})),Ft=N.Root,Gt=N.Trigger,qt=N.Sub,Ht=N.RadioGroup,xr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(N.Portal,{children:n.jsx(N.Content,{ref:t,...a,className:u.cx(o,"fp-MenuContent"),children:e})})}),Cr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Item,{ref:t,...o,className:u.cx(e,"fp-MenuItem")})}),Nr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),yr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),Rr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})}),wr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.SubTrigger,{ref:t,...a,className:u.cx(o,"fp-MenuItem"),children:[e,n.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),vr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Portal,{children:n.jsx(N.SubContent,{ref:t,...o,className:u.cx(e,"fp-MenuContent"),sideOffset:12})})}),jr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.CheckboxItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),e]})}),Pr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.RadioItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuRadioItem"),children:[n.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(Qe,{size:"4"})}),e]})});xr.displayName="ContextMenu.Content";Cr.displayName="ContextMenu.Item";Nr.displayName="ContextMenu.Separator";yr.displayName="ContextMenu.Label";Rr.displayName="ContextMenu.Group";wr.displayName="ContextMenu.SubTrigger";vr.displayName="ContextMenu.SubContent";jr.displayName="ContextMenu.CheckboxItem";Pr.displayName="ContextMenu.RadioItem";const Ut=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:jr,Content:xr,Group:Rr,Item:Cr,Label:yr,RadioGroup:Ht,RadioItem:Pr,Root:Ft,Separator:Nr,Sub:qt,SubContent:vr,SubTrigger:wr,Trigger:Gt},Symbol.toStringTag,{value:"Module"})),{TooltipProvider:Wt}=B,Xt=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(B.Content,{ref:t,className:u.cx(e,"fp-tooltip"),...o})}),Kt=r=>{const{className:t,...e}=r;return n.jsx(B.Arrow,{className:u.cx(t,"fp-tooltip-arrow"),...e})},Re=l.forwardRef((r,t)=>{const{defaultOpen:e,open:o,onOpenChange:a,delayDuration:s,disableHoverableContent:c,container:i,forceMount:d,children:p,content:g,...f}=r,w={open:o,defaultOpen:e,onOpenChange:a,delayDuration:s,disableHoverableContent:c};return n.jsxs(B.Root,{...w,children:[n.jsx(B.Trigger,{asChild:!0,children:p}),n.jsx(B.Portal,{forceMount:d,container:i,children:n.jsxs(Xt,{ref:t,arrowPadding:10,...f,children:[g,n.jsx(Kt,{})]})})]})});Re.displayName="Tooltip";const Yt=u.cva("fp-IconButton",{variants:{size:{small:"fp-size-small",medium:"fp-size-medium"},activeAppearance:{subtle:"fp-active-appearance-subtle",solid:"fp-active-appearance-solid"}},defaultVariants:{size:"small",activeAppearance:"subtle"}}),ie=l.forwardRef((r,t)=>{const{className:e,size:o,activeAppearance:a,"aria-label":s,tooltipContent:c,disableTooltip:i,...d}=r,p=n.jsx("button",{ref:t,className:Yt({className:e,size:o,activeAppearance:a}),"aria-label":s,...d});return i?p:n.jsx(Re,{content:c??s,children:p})});ie.displayName="IconButton";const we=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx("header",{ref:t,className:u.cx(o,"fp-DialogBaseHeader"),...a,children:e})}),ve=l.forwardRef((r,t)=>{const{className:e,size:o,...a}=r;return n.jsx("div",{ref:t,className:Zt({className:e,size:o}),...a})}),je=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx("div",{ref:t,className:u.cx(e,"fp-DialogBaseControls"),...o})}),Zt=u.cva("fp-DialogBaseSection",{variants:{size:{base:"fp-DialogBaseSection-base",small:"fp-DialogBaseSection-small"}},defaultVariants:{size:"base"}});we.displayName="Dialog.Header";ve.displayName="Dialog.Section";je.displayName="Dialog.Controls";const Jt=F.Root,Qt=F.Anchor,eo=F.Portal,Sr=l.forwardRef((r,t)=>n.jsx(F.Trigger,{ref:t,...r,asChild:!0})),Tr=l.forwardRef((r,t)=>{const{className:e,style:o,width:a,height:s,maxWidth:c,maxHeight:i,...d}=r;return n.jsx(F.Content,{ref:t,className:u.cx(e,"fp-DialogBaseContent"),style:{...o,width:a,height:s,maxWidth:c,maxHeight:i},...d})}),Mr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(E,{ref:t,className:u.cx(e,"fp-DialogBaseTitle"),weight:"strong",...o})}),Ir=l.forwardRef((r,t)=>{const{children:e,...o}=r;return n.jsx(F.Close,{ref:t,asChild:!0,...o,children:e||n.jsx(ie,{"aria-label":"Close",disableTooltip:!0,children:n.jsx(Ze,{})})})});Sr.displayName="Popover.Trigger";Tr.displayName="Popover.Content";Mr.displayName="Popover.Title";Ir.displayName="Popover.Close";const ro=Object.freeze(Object.defineProperty({__proto__:null,Anchor:Qt,Close:Ir,Content:Tr,Controls:je,Header:we,Portal:eo,Root:Jt,Section:ve,Title:Mr,Trigger:Sr},Symbol.toStringTag,{value:"Module"})),to=V.Root,oo=V.Portal,$r=l.forwardRef((r,t)=>n.jsx(V.Trigger,{ref:t,...r,asChild:!0})),ao=u.cva(["fp-DialogBaseContent","fp-DialogContent"],{variants:{size:{1:"fp-size-1",2:"fp-size-2",3:"fp-size-3",fullscreen:"fp-size-fullscreen"},placement:{center:"fp-placement-center",top:"fp-placement-top"}},defaultVariants:{size:"2",placement:"top"}}),kr=l.forwardRef((r,t)=>{const{children:e,className:o,size:a,placement:s,style:c,width:i,height:d,maxWidth:p,maxHeight:g,...f}=r;return n.jsx(V.Content,{ref:t,className:ao({className:o,size:a,placement:s}),"aria-describedby":void 0,style:{...c,width:i,height:d,maxWidth:p,maxHeight:g},...f,children:e})}),_r=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(V.Overlay,{ref:t,className:u.cx(e,"fp-DialogBaseOverlay"),...o})}),Dr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(V.Title,{ref:t,className:u.cx(o,"fp-DialogBaseTitle"),...a,asChild:!0,children:n.jsx(E,{weight:"strong",children:e})})}),zr=l.forwardRef((r,t)=>{const{children:e,...o}=r;return n.jsx(V.Close,{ref:t,asChild:!0,...o,children:e||n.jsx(ie,{"aria-label":"Close",disableTooltip:!0,children:n.jsx(Ze,{})})})});$r.displayName="Dialog.Trigger";kr.displayName="Dialog.Content";_r.displayName="Dialog.Overlay";Dr.displayName="Dialog.Title";zr.displayName="Dialog.Close";const no=Object.freeze(Object.defineProperty({__proto__:null,Close:zr,Content:kr,Controls:je,Header:we,Overlay:_r,Portal:oo,Root:to,Section:ve,Title:Dr,Trigger:$r},Symbol.toStringTag,{value:"Module"})),so=I.Root,lo=I.Portal,Ar=l.forwardRef((r,t)=>n.jsx(I.Trigger,{ref:t,...r,asChild:!0})),co=u.cva(["fp-DialogBaseContent","fp-AlertDialogContent"],{variants:{size:{1:"fp-size-1",2:"fp-size-2",3:"fp-size-3"},placement:{center:"fp-placement-center",top:"fp-placement-top"}},defaultVariants:{size:"2",placement:"top"}}),Er=l.forwardRef((r,t)=>{const{className:e,size:o,placement:a,style:s,width:c,height:i,maxWidth:d,maxHeight:p,...g}=r;return n.jsx(I.Content,{ref:t,className:co({className:e,size:o,placement:a}),style:{...s,width:c,height:i,maxWidth:d,maxHeight:p},...g})}),Lr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(I.Overlay,{ref:t,className:u.cx(e,"fp-DialogBaseOverlay"),...o})}),Or=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(I.Title,{ref:t,className:u.cx(o,"fp-AlertDialogTitle"),...a,asChild:!0,children:n.jsx(E,{weight:"strong",children:e})})}),Vr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(I.Description,{ref:t,className:u.cx(o,"fp-AlertDialogDescription"),...a,asChild:!0,children:n.jsx(E,{children:e})})}),Br=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx("div",{ref:t,className:u.cx(e,"fp-AlertDialogActions"),...o})}),Fr=l.forwardRef((r,t)=>n.jsx(I.Cancel,{ref:t,asChild:!0,...r})),Gr=l.forwardRef((r,t)=>n.jsx(I.Action,{ref:t,asChild:!0,...r}));Ar.displayName="AlertDialog.Trigger";Er.displayName="AlertDialog.Content";Lr.displayName="AlertDialog.Overlay";Or.displayName="AlertDialog.Title";Vr.displayName="AlertDialog.Description";Br.displayName="AlertDialog.Actions";Fr.displayName="AlertDialog.Cancel";Gr.displayName="AlertDialog.Action";const io=Object.freeze(Object.defineProperty({__proto__:null,Action:Gr,Actions:Br,Cancel:Fr,Content:Er,Description:Vr,Overlay:Lr,Portal:lo,Root:so,Title:Or,Trigger:Ar},Symbol.toStringTag,{value:"Module"})),[qr,Pe]=le("ValueFieldProvider",null),R=l.forwardRef((r,t)=>{const{className:e,disabled:o,...a}=r,s=Pe("Root");return n.jsx(qr,{disabled:o,children:n.jsx("label",{ref:t,className:u.cx(e,"fp-ValueFieldRoot"),"data-disabled":o||s!=null&&s.disabled?"":void 0,...a})})}),G=l.forwardRef((r,t)=>{const{className:e,disabled:o,...a}=r;return n.jsx(qr,{disabled:o,children:n.jsx("div",{ref:t,className:u.cx(e,"fp-ValueFieldMulti"),"data-disabled":o?"":void 0,...a})})}),q=l.forwardRef((r,t)=>{const{className:e,...o}=r,a=Pe("Root");return n.jsx("span",{ref:t,className:u.cx(e,"fp-ValueFieldLabel"),"data-disabled":a!=null&&a.disabled?"":void 0,...o})});R.displayName="ValueField.Root";q.displayName="ValueField.Label";G.displayName="ValueField.Multi";function z(r,t){const[e,o]=r,[a,s]=t;return function(c){return e===o||a===s?a:(c-e)/(o-e)*(s-a)+a}}function uo(){const[r,t]=l.useState(!0),e=l.useCallback(()=>{t(!0)},[]),o=l.useCallback(()=>{t(!1)},[]),a=l.useCallback(s=>{r&&s.currentTarget.selectionStart===s.currentTarget.selectionEnd&&(s.currentTarget.select(),t(!1))},[r]);return{onMouseLeave:o,onMouseUp:a,onFocus:e}}const Se=l.forwardRef((r,t)=>{const{type:e="text",className:o,selectOnClick:a=!1,...s}=r,c=l.useRef(null),i=ae(c,t),{onMouseLeave:d,onMouseUp:p,onFocus:g}=uo(),f=a?De({onMouseLeave:d,onMouseUp:p,onFocus:g},s):s;return n.jsx("input",{ref:i,type:e,className:u.cx(o,"fp-Input"),...f})});Se.displayName="Input";const po=1,go=10,Te=r=>{const{className:t,inputRef:e,value:o,onChange:a,smallNudge:s=po,bigNudge:c=go,formatter:i,disabled:d,...p}=r,g=l.useRef(null),f=ae(e,g),[w,S]=l.useState(null),b=w??i.format(o),x=Pe("ValueField"),T=m=>{const P=i.parse(m,o);if(m.length===0||!P.valid||P.value===o)return M();S(null),a(P.value)},M=()=>{S(null)},H=m=>{S(m.currentTarget.value)},U=m=>{const P=m.currentTarget;if(m.key==="Enter"&&(m.preventDefault(),P.blur()),m.key==="Escape"&&(m.preventDefault(),M(),requestAnimationFrame(()=>{P.blur()})),m.key==="ArrowUp"||m.key==="ArrowDown"){if(!i.incrementBy)return;m.preventDefault();const W=i.parse(P.value,o),Z=W.valid?W.value:o,J=m.shiftKey?c:s,k=m.key==="ArrowUp"?J:-J,_=i.getIncrementTargets?i.getIncrementTargets(P):null,de=i.incrementBy(Z,k,_);T(i.format(de)),requestAnimationFrame(()=>{if(_&&i.getIncrementSelection){const[tt,ot]=i.getIncrementSelection(_);P.setSelectionRange(tt,ot)}else P.select()})}},O=m=>{T(m.currentTarget.value)};return n.jsx(Se,{ref:f,dir:"auto",autoComplete:"off",spellCheck:"false",selectOnClick:!0,className:u.cx(t,"fp-ValueFieldBase"),value:b,onChange:H,disabled:d||(x==null?void 0:x.disabled),...De(p,{onBlur:O,onKeyDown:U})})};Te.displayName="ValueField.Base";const mo=15,v=l.forwardRef((r,t)=>{const{value:e,onChange:o,min:a,max:s,targetRange:c,precision:i,suffix:d,allowedUnits:p,...g}=r,f=l.useMemo(()=>fo({min:a,max:s,precision:i,targetRange:c,suffix:d,allowedUnits:p}),[a,s,i,c,d,p]);return n.jsx(Te,{inputRef:t,value:e,onChange:o,formatter:f,...g})});function fo(r={}){const{min:t,max:e,targetRange:o,precision:a=mo,suffix:s,allowedUnits:c=[]}=r,{toDisplayValue:i,fromDisplayValue:d}=bo({min:t,max:e,targetRange:o});return{parse:(p,g)=>{try{return{valid:!0,value:h.pipe(p,f=>xo({expression:f,displayValue:i(g),suffix:s,allowedUnits:c}),h.round(a),d,h.clamp({min:t,max:e}))}}catch{return{valid:!1}}},format:p=>h.pipe(p,h.clamp({min:t,max:e}),i,h.round(a),g=>ho(g,s)),incrementBy(p,g){return p+d(g)}}}function bo(r){const{min:t,max:e,targetRange:o}=r;if(!o)return{toDisplayValue:a=>a,fromDisplayValue:a=>a};if(typeof t!="number"||typeof e!="number")throw Error("'targetRange' requires specifying 'min' and 'max'.");if(t===e)throw Error("'min' and 'max' cannot be equal.");return{toDisplayValue:z([t,e],o),fromDisplayValue:z(o,[t,e])}}function ho(r,t){return Number.isNaN(r)?"":t?`${r}${t}`:`${r}`}function xo(r){const{displayValue:t,expression:e,suffix:o="",allowedUnits:a=[]}=r,s="(\\d*\\.?\\d+)",c=`(?:${[...a,o].join("|")})*`,i=e.replace(new RegExp(`${s}${c}`,"gi"),(p,g)=>g).replace(new RegExp(`${c}${s}`,"gi"),(p,g)=>g).replace(new RegExp(`${s}%`,"gi"),(p,g)=>`(${t}*${g}/100)`).replace(new RegExp(`%${s}`,"gi"),(p,g)=>`(${t}*${g}/100)`).replace(new RegExp(`${s}x`,"gi"),(p,g)=>`(${t}*${g})`).replace(new RegExp(`x${s}`,"gi"),(p,g)=>`(${t}*${g})`).replace(new RegExp("(?<!\\d)x(?!\\d)","gi"),`${t}`).trim(),d=mt(i);if(d===null)throw new Error("Invalid expression.");return d}const Hr={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Ur=l.forwardRef((r,t)=>{const{value:e,onChange:o,ignoreAlpha:a=!1,...s}=r,c=l.useMemo(()=>Co({ignoreAlpha:a}),[a]);return n.jsx(Te,{inputRef:t,value:e,onChange:o,formatter:c,...s})});function Co(r){const{ignoreAlpha:t}=r;return{parse(e,o){if(No(e)){const{r:a,g:s,b:c}=Hr[e];return{valid:!0,value:{r:a/255,g:s/255,b:c/255,a:o.a}}}try{return{value:h.pipe(e,yo,a=>Ro(a,o),wo,a=>t?{...a,a:1}:a),valid:!0}}catch{return{valid:!1}}},format(e){return(Math.round(e.r*255).toString(16).padStart(2,"0")+Math.round(e.g*255).toString(16).padStart(2,"0")+Math.round(e.b*255).toString(16).padStart(2,"0")).toUpperCase()},incrementBy(e,o,a){return a??(a={r:!0,g:!0,b:!0}),{r:a.r?h.clamp(Math.round(e.r*255)+o,{min:0,max:255})/255:e.r,g:a.g?h.clamp(Math.round(e.g*255)+o,{min:0,max:255})/255:e.g,b:a.b?h.clamp(Math.round(e.b*255)+o,{min:0,max:255})/255:e.b,a:e.a}},getIncrementTargets(e){const o=e.selectionStart,a=e.selectionEnd;return o===null||a===null?null:{r:o<2||o===2&&a===2,g:o<4&&a>=3||o===4&&a===4,b:a>=5}},getIncrementSelection(e){let o,a;return e?(e.r?o=0:e.g?o=2:o=4,e.b?a=6:e.g?a=4:a=2,[o,a]):[0,6]}}}function No(r){return Object.keys(Hr).includes(r)}function yo(r){var e;const t=/[0-9a-f]+/gi;return((e=r.match(t))==null?void 0:e[0])??""}function Ro(r,t){if(!/^[0-9a-f]{1,8}$/i.test(r))throw new Error("Invalid hex substring");switch(r.length){case 1:return r.repeat(6)+Q(t.a);case 2:return r.repeat(3)+Q(t.a);case 3:return r.split("").map(e=>e.repeat(2)).join("")+Q(t.a);case 4:return r.slice(0,3).split("").map(e=>e.repeat(2)).join("")+r[3].repeat(2);case 5:return r.slice(0,3).split("").map(e=>e.repeat(2)).join("")+r.slice(-2);case 6:return r+Q(t.a);case 7:return r.slice(0,6)+r[6].repeat(2);case 8:return r;default:throw new Error("Invalid hex substring")}}function wo(r){return{r:parseInt(r.substring(0,2),16)/255,g:parseInt(r.substring(2,4),16)/255,b:parseInt(r.substring(4,6),16)/255,a:parseInt(r.substring(6,8),16)/255}}function Q(r){return Math.round(r*255).toString(16)}const vo=Object.freeze(Object.defineProperty({__proto__:null,Hex:Ur,Label:q,Multi:G,Numeric:v,Root:R},Symbol.toStringTag,{value:"Module"}));function ee(r){const t=h.round(r*255,0).toString(16);return t.length<2?"0"+t:t}function te({r,g:t,b:e,a:o}){const a=o<1?ee(o):"";return"#"+ee(r)+ee(t)+ee(e)+a}function jo(r){return te(fe(r))}function Po(r){return te(A(r))}function Y({r,g:t,b:e,a:o}){const a=Math.max(r,t,e),s=a-Math.min(r,t,e),c=s?a===r?(t-e)/s:a===t?2+(e-r)/s:4+(r-t)/s:0;return{h:60*(c<0?c+6:c),s:a?s/a*100:0,v:a*100,a:o}}function A({h:r,s:t,v:e,a:o}){r=r/360*6,t=t/100,e=e/100;const a=Math.floor(r),s=e*(1-t),c=e*(1-(r-a)*t),i=e*(1-(1-r+a)*t),d=a%6;return{r:[e,c,s,s,i,e][d],g:[i,e,e,c,s,s][d],b:[s,s,i,e,e,c][d],a:o}}function Wr({h:r,s:t,l:e,a:o}){return t*=(e<50?e:100-e)/100,{h:r,s:t>0?2*t/(e+t)*100:0,v:e+t,a:o}}function Xr({h:r,s:t,v:e,a:o}){const a=(200-t)*e/100;return{h:r,s:a>0&&a<200?t*e/100/(a<=100?a:200-a)*100:0,l:a/2,a:o}}function fe(r){return A(Wr(r))}function $e(r){return Xr(Y(r))}function X(r){const t=h.round(r.r,4),e=h.round(r.g,4),o=h.round(r.b,4),a=h.round(r.a,2);return a<1?`color(display-p3 ${t} ${e} ${o} / ${a})`:`color(display-p3 ${t} ${e} ${o})`}function K(r){const t=Math.round(r.r*255),e=Math.round(r.g*255),o=Math.round(r.b*255),a=r.a;return a<1?`rgb(${t} ${e} ${o} / ${a})`:`rgb(${t} ${e} ${o})`}function ke(r){const{r:t,g:e,b:o,a}=r;return{r:t+(1-t)*(1-a),g:e+(1-e)*(1-a),b:o+(1-o)*(1-a),a:1}}const So={r:0,g:0,b:0,a:1},To=["hex","rgb","hsl","hsv"],[Mo,$]=le("ColorPicker"),Io=r=>{const{colorSpace:t,models:e=To,defaultActiveModel:o,activeModel:a,onActiveModelChange:s,defaultColor:c,color:i,onColorChange:d,children:p}=r;$o(a,o,e);const[g=So,f]=me({prop:i,defaultProp:c,onChange:d}),[w=e[0],S]=me({prop:a,defaultProp:o,onChange:s}),[b,x]=l.useState({}),T={hsv:b.hsv??Y(g),hsl:b.hsl??$e(g),rgb:b.rgb??g,hex:b.hex??te(g)},M=T.hsv.h,H=U=>{const{mode:O,value:m}=U;O==="rgb"?(x({rgb:m,hsv:Y(m),hsl:$e(m),hex:te(m)}),f(m)):O==="hsv"?(x({hsv:m,hsl:Xr(m),rgb:A(m),hex:Po(m)}),f(A(m))):O==="hsl"&&(x({hsv:Wr(m),hsl:m,rgb:fe(m),hex:jo(m)}),f(fe(m)))};return n.jsx(Mo,{colorSpace:t,models:e,activeModel:w,onActiveModelChange:S,color:g,onColorChange:H,hue:M,colorsByModel:T,children:p})};function $o(r,t,e){if(e.length===0)throw new Error("The 'models' prop must contain at least one color model. Omit the 'models' prop entirely to use default models.");if(r&&!e.includes(r))throw new Error(`Invalid 'activeModel': '${r}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`);if(t&&!e.includes(t))throw new Error(`Invalid 'defaultActiveModel': '${t}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`)}const ko=2,_o=0,Do=100,zo="horizontal",Ao="ltr",ue=l.forwardRef((r,t)=>{const{className:e,min:o=_o,max:a=Do,defaultValue:s=[o],value:c,onValueChange:i,orientation:d=zo,dir:p=Ao,inverted:g,disabled:f,range:w=!0,rangeAnchor:S,baseValue:b,hints:x,...T}=r,M=l.useRef(null),H=ae(M,t),{onPointerDown:U,focusVisible:O}=Vo(M),[m,P]=l.useState(c??s),W=l.useRef(c),Z=l.useRef(s);l.useEffect(()=>{h.isDeepEqual(c,W.current)&&h.isDeepEqual(s,Z.current)||(P(c??s),W.current=c,Z.current=s)},[c,s]),l.useEffect(()=>{M.current&&M.current.style.setProperty("--radix-slider-thumb-transform",Oo(d,p,g))},[M,d,p,g]);const J=k=>{const _=k.map(de=>Bo(de,x,o,a));i==null||i(_),P(_)};return n.jsxs(pe.Root,{tabIndex:-1,ref:H,className:u.cx(e,"fp-SliderRoot"),value:m,onValueChange:J,onPointerDown:U,min:o,max:a,orientation:d,dir:p,inverted:g,disabled:f,...T,children:[n.jsx(pe.Track,{className:"fp-SliderTrack"}),w&&n.jsx(Lo,{dir:p,value:m,min:o,max:a,orientation:d,inverted:g,rangeAnchor:S,disabled:f}),x&&x.map(k=>n.jsx(Eo,{hint:k,baseValue:b,min:o,max:a,orientation:d,dir:p,inverted:g},k)),m.map((k,_)=>n.jsx(pe.Thumb,{className:u.cx("fp-SliderThumb",{"fp-SliderThumb-focusVisible":O,"fp-SliderThumb-baseValue":k===b})},_))]})});ue.displayName="Slider";const Eo=r=>{const{baseValue:t,dir:e,inverted:o,max:a,min:s,orientation:c,hint:i}=r,{startEdge:d}=Kr(c,e,o),p=z([s,a],[0,100])(i),g=4;return n.jsx(n.Fragment,{children:n.jsx("span",{className:u.cx("fp-SliderHint",{"fp-SliderHint-baseValue":i===t}),"data-orientation":c,style:{[d]:`calc(${p}% - ${g/2}px)`}})})},Lo=r=>{const{min:t,max:e,value:o,rangeAnchor:a=t,orientation:s,dir:c,inverted:i,disabled:d}=r,p=o.length>1?Math.min(...o):Math.min(a,...o),g=o.length>1?Math.max(...o):Math.max(a,...o),f=z([t,e],[0,100])(p),w=100-z([t,e],[0,100])(g),S=Kr(s,c,i);return n.jsx("span",{className:"fp-SliderRange","data-orientation":s,"data-disabled":d?"":void 0,style:{[S.startEdge]:`${f}%`,[S.endEdge]:`${w}%`}})};function Kr(r,t,e){const o=e?"inverted":"normal";return{vertical:{normal:{startEdge:"bottom",endEdge:"top"},inverted:{startEdge:"top",endEdge:"bottom"}},horizontal:{normal:{startEdge:t==="ltr"?"left":"right",endEdge:t==="ltr"?"right":"left"},inverted:{startEdge:t==="ltr"?"right":"left",endEdge:t==="ltr"?"left":"right"}}}[r][o]}function Oo(r,t,e){const o=e?"inverted":"normal";return{vertical:{normal:"translateY(50%)",inverted:"translateY(-50%)"},horizontal:{normal:t==="ltr"?"translateX(-50%)":"translateX(50%)",inverted:t==="ltr"?"translateX(50%)":"translateX(-50%)"}}[r][o]}function Vo(r){const[t,e]=l.useState(!1),o=()=>{var s;e(!1),window.removeEventListener("pointerup",o),(s=r.current)==null||s.focus()};return{onPointerDown:()=>{e(!0),window.addEventListener("pointerup",o)},focusVisible:!t}}function Bo(r,t,e,o){const a=z([0,100],[0,o-e])(ko),s=t==null?void 0:t.find(c=>Math.abs(c-r)<=a);return typeof s=="number"?s:r}const Fo=r=>{const{className:t,style:e}=r,{activeModel:o,colorSpace:a,hue:s,color:c,onColorChange:i}=$("Hue"),d=Go[o],p=f=>{const w=d.setHue(c,f[0]);i({mode:"rgb",value:w})},g=d.getThumbColor(s,a);return n.jsx(ue,{"aria-label":"hue",range:!1,min:0,max:359,value:[s],onValueChange:p,className:`fp-ColorPickerHueSlider fp-color-model-${o} fp-color-space-${a} ${t}`,style:{"--slider-thumb-bg":g,...e}})},re={getHue:r=>Math.round(Y(r).h),setHue:(r,t)=>{const{s:e,v:o}=Y(r);return A({h:t,s:e,v:o,a:r.a})},getThumbColor:(r,t)=>{const{r:e,g:o,b:a}=A({h:r,s:100,v:100,a:1});return t==="display-p3"?`color(display-p3 ${+e.toFixed(4)} ${+o.toFixed(4)} ${+a.toFixed(4)})`:`rgb(${Math.round(e*255)} ${Math.round(o*255)} ${Math.round(a*255)})`}},Go={rgb:re,hsl:re,hsv:re,hex:re},qo=r=>{const{className:t,style:e}=r,{colorSpace:o,color:a,onColorChange:s}=$("Hue"),c={srgb:{transparent:K({...a,a:0}),opaque:K({...a,a:1})},p3:{transparent:X({...a,a:0}),opaque:X({...a,a:1})}},i={srgb:K(ke(a)),p3:X(ke(a))},d=p=>{s({mode:"rgb",value:{...a,a:h.round(p[0]/100,2)}})};return n.jsx(ue,{"aria-label":"alpha",min:0,max:100,range:!1,value:[a.a*100],onValueChange:d,className:`fp-ColorPickerAlphaSlider fp-color-space-${o} ${t}`,style:{"--track-bg-transparent-srgb":c.srgb.transparent,"--track-bg-opaque-srgb":c.srgb.opaque,"--track-bg-transparent-p3":c.p3.transparent,"--track-bg-opaque-p3":c.p3.opaque,"--thumb-bg-srgb":i.srgb,"--thumb-bg-p3":i.p3,...e}})},Ho=8,Uo=r=>{const{onColorChange:t,colorsByModel:e,hue:o,colorSpace:a,activeModel:s}=$("ColorPicker.Area"),c={srgb:K(A({h:o,s:100,v:100,a:1})),p3:X(A({h:o,s:100,v:100,a:1}))},i={srgb:K(e.rgb),p3:X(e.rgb)},d=Wo(e,s),p=l.useRef(null),{size:g}=Xo(p),f=b=>{t(s==="hsl"?{mode:"hsl",value:{h:o,s:b.x,l:100-b.y,a:e.rgb.a}}:{mode:"hsv",value:{h:o,s:b.x,v:100-b.y,a:e.rgb.a}})},w=b=>{if(b.type==="pointerdown"&&b.currentTarget.setPointerCapture(b.pointerId),b.type==="pointermove"&&!b.currentTarget.hasPointerCapture(b.pointerId))return;const x=b.currentTarget.getBoundingClientRect();f({x:h.pipe(b.clientX-x.x,z([0,g],[0,100]),h.clamp({min:0,max:100})),y:h.pipe(b.clientY-x.y-Ho,z([0,g],[0,100]),h.clamp({min:0,max:100}))})},S=b=>{const x=b.shiftKey?10:1,T={ArrowRight:{x:1,y:0},ArrowLeft:{x:-1,y:0},ArrowDown:{x:0,y:1},ArrowUp:{x:0,y:-1}}[b.key];T&&f({x:h.clamp(d.x+T.x*x,{min:0,max:100}),y:h.clamp(d.y+T.y*x,{min:0,max:100})})};return n.jsxs("div",{ref:p,className:"fp-ColorPickerArea",onPointerDown:w,onPointerMove:w,style:{"--base-color-srgb":c.srgb,"--base-color-p3":c.p3},children:[n.jsx("div",{className:`fp-ColorPickerAreaCanvas fp-color-space-${a} fp-color-model-${s}`}),n.jsx("div",{tabIndex:0,onKeyDown:S,className:`fp-ColorPickerThumb fp-color-space-${a}`,style:{"--thumb-bg-srgb":i.srgb,"--thumb-bg-p3":i.p3,left:`${d.x}%`,top:`${d.y}%`}})]})};function Wo(r,t){if(t==="hsl"){const e=r.hsl;return{x:e.s,y:100-e.l}}else{const e=r.hsv;return{x:e.s,y:100-e.v}}}function Xo(r){const[t,e]=l.useState(0);return l.useLayoutEffect(()=>{const o=r.current;if(!o)return;e(o.getBoundingClientRect().width);const a=new ResizeObserver(s=>{for(const c of s)e(c.contentRect.width)});return a.observe(o),()=>{a.unobserve(o)}},[r]),{size:t}}const ge={0:"fp-gap-0",px:"fp-gap-px","0.5":"fp-gap-0_5",1:"fp-gap-1","1.5":"fp-gap-1_5",2:"fp-gap-2","2.5":"fp-gap-2_5",3:"fp-gap-3","3.5":"fp-gap-3_5",4:"fp-gap-4",5:"fp-gap-5",6:"fp-gap-6",7:"fp-gap-7",8:"fp-gap-8",9:"fp-gap-9",10:"fp-gap-10",11:"fp-gap-11",12:"fp-gap-12",13:"fp-gap-13",14:"fp-gap-14",15:"fp-gap-15",16:"fp-gap-16"},Ko=u.cva("fp-Flex",{variants:{direction:{row:"fp-direction-row",column:"fp-direction-column",rowReverse:"fp-direction-row-reverse",columnReverse:"fp-direction-column-reverse"},align:{start:"fp-align-start",center:"fp-align-center",end:"fp-align-end",baseline:"fp-align-baseline",stretch:"fp-align-stretch"},justify:{start:"fp-justify-start",center:"fp-justify-center",end:"fp-justify-end",between:"fp-justify-between"},wrap:{nowrap:"fp-wrap-nowrap",wrap:"fp-wrap-wrap",wrapReverse:"fp-wrap-wrap-reverse"},gap:ge,columnGap:ge,rowGap:ge},defaultVariants:{direction:"row"}}),Me=l.forwardRef((r,t)=>{const{className:e,direction:o,align:a,justify:s,wrap:c,gap:i,columnGap:d,rowGap:p,...g}=r;return n.jsx("div",{ref:t,className:Ko({className:e,direction:o,align:a,justify:s,wrap:c,gap:i,columnGap:d,rowGap:p}),...g})});Me.displayName="Flex";const Yo=r=>{const{models:t,activeModel:e,onActiveModelChange:o}=$("ColorPicker.Input"),a=h.pick({hex:Zo,hsv:Qo,hsl:ea,rgb:Jo},t)[e];return n.jsxs(Me,{gap:"2.5",className:r.className,style:r.style,children:[t.length>1&&n.jsxs(nr,{value:e,onValueChange:o,children:[n.jsx(Ce,{style:{width:56}}),n.jsx(Ne,{children:t.map(s=>n.jsx(ye,{value:s,children:s.toUpperCase()},s))})]}),n.jsx(a,{})]})},Zo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HEX"),e=r.rgb,o=s=>{t({mode:"rgb",value:s})},a=s=>{t({mode:"rgb",value:{...e,a:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(Ur,{onChange:o,value:e})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:a,value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},Jo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.RGBA"),e=r.rgb,o=a=>s=>{t({mode:"rgb",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("r"),value:e.r,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("g"),value:e.g,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("b"),value:e.b,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},Qo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HSVA"),e=r.hsv,o=a=>s=>{t({mode:"hsv",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("h"),value:e.h,min:0,max:360,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("s"),value:e.s,min:0,max:100,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("v"),value:e.v,min:0,max:100,precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},ea=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HSLA"),e=r.hsl,o=a=>s=>{t({mode:"hsl",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("h"),value:e.h,min:0,max:360,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("s"),value:e.s,min:0,max:100,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("l"),value:e.l,min:0,max:100,precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},ra=Object.freeze(Object.defineProperty({__proto__:null,Alpha:qo,Area:Uo,Hue:Fo,Input:Yo,Root:Io,useColorPickerContext:$},Symbol.toStringTag,{value:"Module"})),Yr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(be.Root,{ref:t,className:u.cx(e,"fp-CollapsibleRoot"),...o})}),Zr=l.forwardRef((r,t)=>{const{className:e,children:o,...a}=r;return n.jsxs(be.Trigger,{ref:t,className:u.cx(e,"fp-CollapsibleTrigger"),...a,children:[n.jsx(he,{viewBox:"4 4 16 16",size:"4",className:"fp-CollapsibleIndicator"}),o]})}),Jr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(be.Content,{ref:t,className:u.cx(e,"fp-CollapsibleContent"),...o})});Yr.displayName="Collapsible.Root";Zr.displayName="Collapsible.Trigger";Jr.displayName="Collapsible.Content";const ta=Object.freeze(Object.defineProperty({__proto__:null,Content:Jr,Root:Yr,Trigger:Zr},Symbol.toStringTag,{value:"Module"})),oa=u.cva("fp-Button",{variants:{variant:{primary:"fp-variant-primary",secondary:"fp-variant-secondary",inverse:"fp-variant-inverse",destructive:"fp-variant-destructive",success:"fp-variant-success",text:"fp-variant-text"},size:{small:"fp-size-small",medium:"fp-size-medium"},fullWidth:{true:"fp-full-width"}},defaultVariants:{variant:"secondary",size:"small"}}),Qr=l.forwardRef((r,t)=>{const{className:e,variant:o,size:a,fullWidth:s,...c}=r;return n.jsx("button",{ref:t,className:oa({className:e,variant:o,size:a,fullWidth:s}),...c})});Qr.displayName="Button";const et=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(ht,{className:u.cx(e,"fp-textarea"),ref:t,...o})});et.displayName="Textarea";const rt=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(Ie.Root,{ref:t,className:u.cx(e,"fp-switchRoot"),...o,children:n.jsx(Ie.Thumb,{ref:t,className:u.cx(e,"fp-switchThumb")})})});rt.displayName="Switch";exports.AlertDialog=io;exports.Button=Qr;exports.Checkbox=Dt;exports.Collapsible=ta;exports.ColorPicker=ra;exports.ContextMenu=Ut;exports.Dialog=no;exports.DropdownMenu=Bt;exports.Flex=Me;exports.IconButton=ie;exports.Input=Se;exports.Label=se;exports.Link=Ge;exports.Paragraph=Fe;exports.Popover=ro;exports.RadioGroup=Pt;exports.SegmentedControl=wt;exports.Select=At;exports.Slider=ue;exports.Switch=rt;exports.Tabs=yt;exports.Text=E;exports.Textarea=et;exports.Tooltip=Re;exports.TooltipProvider=Wt;exports.ValueField=vo;exports.createIcon=L;
11
+ * */function qe(r){const t=D.useRef(r);return D.useEffect(()=>{t.current=r}),D.useMemo(()=>(...e)=>{var o;return(o=t.current)==null?void 0:o.call(t,...e)},[])}function me({prop:r,defaultProp:t,onChange:e=()=>{}}){const[o,a]=Rt({defaultProp:t,onChange:e}),s=r!==void 0,c=s?r:o,i=qe(e),d=D.useCallback(p=>{if(s){const f=typeof p=="function"?p(r):p;f!==r&&i(f)}else a(p)},[s,r,a,i]);return[c,d]}function Rt({defaultProp:r,onChange:t}){const e=D.useState(r),[o]=e,a=D.useRef(o),s=qe(t);return D.useEffect(()=>{a.current!==o&&(s(o),a.current=o)},[o,a,s]),e}const He=l.forwardRef((r,t)=>{const{className:e,fullWidth:o,value:a,defaultValue:s,onValueChange:c,...i}=r,[d,p]=me({prop:a,defaultProp:s,onChange:c});return n.jsx(ze.Root,{ref:t,className:u.cx(e,"fp-SegmentedControlRoot",{"fp-full-width":o}),...i,type:"single",value:d,onValueChange:g=>{g&&p(g)}})}),Ue=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(ze.Item,{ref:t,className:u.cx(e,"fp-SegmentedControlItem"),...o})}),We=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(E,{ref:t,className:u.cx(e,"fp-SegmentedControlText"),...o})});He.displayName="SegmentedControl.Root";Ue.displayName="SegmentedControl.Item";We.displayName="SegmentedControl.Text";const wt=Object.freeze(Object.defineProperty({__proto__:null,Item:Ue,Root:He,Text:We},Symbol.toStringTag,{value:"Module"}));function le(r,t){const e=l.createContext(t);function o(s){const{children:c,...i}=s,d=l.useMemo(()=>i,Object.values(i));return n.jsx(e.Provider,{value:d,children:c})}function a(s){const c=l.useContext(e);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${r}\``)}return o.displayName=r+"Provider",[o,a]}const[vt,jt]=le("RadioGroup"),Xe=l.forwardRef((r,t)=>{const{orientation:e="horizontal",disabled:o,className:a,...s}=r;return n.jsx(vt,{orientation:e,disabled:o,children:n.jsx(Ae.Root,{ref:t,orientation:e,disabled:o,className:u.cx(a,"fp-RadioGroupRoot"),...s})})}),Ke=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(Ae.Item,{ref:t,className:u.cx(e,"fp-RadioGroupItem"),...o})}),Ye=l.forwardRef((r,t)=>{const{orientation:e,disabled:o}=jt("Label"),{className:a,...s}=r;return n.jsx(se,{ref:t,className:u.cx(a,"fp-RadioGroupLabel"),"data-orientation":e,"data-disabled":o?"":void 0,...s})});Xe.displayName="RadioGroup.Root";Ke.displayName="RadioGroup.Item";Ye.displayName="RadioGroup.Label";const Pt=Object.freeze(Object.defineProperty({__proto__:null,Item:Ke,Label:Ye,Root:Xe},Symbol.toStringTag,{value:"Module"})),St="6",Tt="0 0 24 24",Mt=u.cva("fp-Icon",{variants:{size:{1:"fp-size-1",2:"fp-size-2","2_5":"fp-size-2_5",3:"fp-size-3","3_5":"fp-size-3_5",4:"fp-size-4",5:"fp-size-5",6:"fp-size-6",7:"fp-size-7",8:"fp-size-8",9:"fp-size-9",10:"fp-size-10"}},defaultVariants:{size:St}});function O(r){const{path:t,viewBox:e=Tt,displayName:o}=r,a=l.forwardRef((s,c)=>{const{size:i,className:d,...p}=s;return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",ref:c,viewBox:e,className:Mt({className:d,size:i}),fill:"none",...p,children:t})});return a.displayName=o||"Icon",a}const Ze=O({displayName:"Close",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",strokeLinejoin:"round",d:"M17 7 7 17M7 7l10 10"})}),he=O({displayName:"ChevronRight",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M11.121 14.121L13.243 12L11.12 9.879"})}),It=O({displayName:"ChevronUp",path:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M14.121 12.879L12 10.757L9.87903 12.88"})}),Je=O({displayName:"ChevronDown",path:n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M9.87897 11.121L12 13.243L14.121 11.12"})})}),ce=O({displayName:"Checkmark",viewBox:"0 0 16 16",path:n.jsx("path",{fill:"var(--color-icon)",fillRule:"evenodd",clipRule:"evenodd",d:"M11.777 4.08399C11.8873 4.1575 11.9639 4.27178 11.99 4.40172C12.016 4.53167 11.9894 4.66665 11.916 4.77699L7.91602 10.777C7.87506 10.8387 7.82091 10.8905 7.75748 10.9287C7.69405 10.9669 7.62294 10.9905 7.54926 10.9979C7.47559 11.0053 7.40119 10.9962 7.33146 10.9713C7.26172 10.9464 7.19839 10.9063 7.14602 10.854L4.14602 7.85399C4.09953 7.80751 4.06266 7.75232 4.0375 7.69158C4.01234 7.63084 3.99939 7.56574 3.99939 7.49999C3.99939 7.43425 4.01234 7.36915 4.0375 7.30841C4.06266 7.24767 4.09953 7.19248 4.14602 7.14599C4.19251 7.09951 4.2477 7.06263 4.30844 7.03747C4.36918 7.01231 4.43428 6.99936 4.50002 6.99936C4.56577 6.99936 4.63087 7.01231 4.6916 7.03747C4.75234 7.06263 4.80753 7.09951 4.85402 7.14599L7.42202 9.71599L11.084 4.22299C11.1575 4.11271 11.2718 4.03612 11.4018 4.01006C11.5317 3.98399 11.6667 4.01059 11.777 4.08399Z"})}),Qe=O({displayName:"Circle",viewBox:"0 0 16 16",path:n.jsx("circle",{fill:"var(--color-icon)",cx:"8",cy:"8",r:"3"})}),$t=O({displayName:"CheckmarkIndeterminate",viewBox:"0 0 16 16",path:n.jsx("path",{fill:"var(--color-icon)",d:"M4 8a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z"})}),[kt,xe]=le("Checkbox"),er=l.forwardRef((r,t)=>{const{className:e,id:o,...a}=r,s=l.useId(),c=o??s;return n.jsx(kt,{id:c,children:n.jsx("div",{ref:t,className:u.cx(e,"fp-CheckboxRoot"),...a})})}),rr=l.forwardRef((r,t)=>{const{className:e,indeterminate:o,...a}=r,{id:s}=xe("Input"),c=_t(o),i=ae(t,c);return n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:i,className:u.cx(e,"fp-CheckboxInput"),id:s,"aria-labelledby":`checkbox-label-${s}`,"aria-describedby":`checkbox-description-${s}`,...a,type:"checkbox"}),n.jsx(tr,{})]})}),tr=()=>n.jsxs("span",{className:"fp-CheckboxIndicator","aria-hidden":"true",children:[n.jsx(ce,{className:"fp-CheckboxCheckmark",size:"4"}),n.jsx($t,{className:"fp-CheckboxIndeterminate",size:"4"})]}),or=l.forwardRef((r,t)=>{const{className:e,...o}=r,{id:a}=xe("Input");return n.jsx(se,{"aria-hidden":"true",ref:t,className:u.cx(e,"fp-CheckboxLabel"),htmlFor:a,id:`checkbox-label-${a}`,...o})}),ar=l.forwardRef((r,t)=>{const{className:e,...o}=r,{id:a}=xe("Description");return n.jsx(E,{"aria-hidden":"true",ref:t,className:u.cx(e,"fp-CheckboxDescription"),id:`checkbox-description-${a}`,...o})});function _t(r){return l.useCallback(t=>{t&&(t.indeterminate=!!r)},[r])}er.displayName="Checkbox.Root";rr.displayName="Checkbox.Input";tr.displayName="Checkbox.Indicator";or.displayName="Checkbox.Label";ar.displayName="Checkbox.Description";const Dt=Object.freeze(Object.defineProperty({__proto__:null,Description:ar,Input:rr,Label:or,Root:er},Symbol.toStringTag,{value:"Module"})),nr=y.Root,zt=y.Arrow,Ce=l.forwardRef((r,t)=>{const{placeholder:e,className:o,...a}=r;return n.jsxs(y.Trigger,{ref:t,...a,className:u.cx(o,"fp-SelectTrigger"),children:[n.jsx(y.Value,{placeholder:e}),n.jsx(y.Icon,{className:"fp-SelectTriggerIcon",children:n.jsx(Je,{})})]})}),Ne=l.forwardRef((r,t)=>{const{children:e,portal:o=!1,className:a,...s}=r,c=o?y.Portal:l.Fragment;return n.jsx(c,{children:n.jsxs(y.Content,{ref:t,...s,className:u.cx(a,"fp-MenuContent"),children:[n.jsx(y.ScrollUpButton,{className:"fp-SelectScrollUpButton",children:n.jsx(It,{})}),n.jsx(y.Viewport,{children:e}),n.jsx(y.ScrollDownButton,{className:"fp-SelectScrollDownButton",children:n.jsx(Je,{})})]})})}),ye=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(y.Item,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(y.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),n.jsx(y.ItemText,{children:e})]})}),sr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),lr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),cr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(y.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})});Ce.displayName="Select.Trigger";Ne.displayName="Select.Content";ye.displayName="Select.Item";sr.displayName="Select.Separator";cr.displayName="Select.Group";lr.displayName="Select.Label";const At=Object.freeze(Object.defineProperty({__proto__:null,Arrow:zt,Content:Ne,Group:cr,Item:ye,Label:lr,Root:nr,Separator:sr,Trigger:Ce},Symbol.toStringTag,{value:"Module"})),Et=C.Root,Ot=C.Trigger,Lt=C.Sub,Vt=C.RadioGroup,ir=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(C.Portal,{children:n.jsx(C.Content,{ref:t,sideOffset:6,...a,className:u.cx(o,"fp-MenuContent"),children:e})})}),ur=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Item,{ref:t,...o,className:u.cx(e,"fp-MenuItem")})}),dr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),pr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),gr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})}),mr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.SubTrigger,{ref:t,...a,className:u.cx(o,"fp-MenuItem"),children:[e,n.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),fr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(C.Portal,{children:n.jsx(C.SubContent,{ref:t,...o,className:u.cx(e,"fp-MenuContent"),sideOffset:12,alignOffset:-8})})}),br=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.CheckboxItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),e]})}),hr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(C.RadioItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuRadioItem"),children:[n.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(Qe,{size:"4"})}),e]})});ir.displayName="DropdownMenu.Content";ur.displayName="DropdownMenu.Item";dr.displayName="DropdownMenu.Separator";gr.displayName="DropdownMenu.Group";pr.displayName="DropdownMenu.Label";mr.displayName="DropdownMenu.SubTrigger";fr.displayName="DropdownMenu.SubContent";br.displayName="DropdownMenu.CheckboxItem";hr.displayName="DropdownMenu.RadioItem";const Bt=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:br,Content:ir,Group:gr,Item:ur,Label:pr,RadioGroup:Vt,RadioItem:hr,Root:Et,Separator:dr,Sub:Lt,SubContent:fr,SubTrigger:mr,Trigger:Ot},Symbol.toStringTag,{value:"Module"})),Ft=N.Root,Gt=N.Trigger,qt=N.Sub,Ht=N.RadioGroup,xr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(N.Portal,{children:n.jsx(N.Content,{ref:t,...a,className:u.cx(o,"fp-MenuContent"),children:e})})}),Cr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Item,{ref:t,...o,className:u.cx(e,"fp-MenuItem")})}),Nr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Separator,{ref:t,className:u.cx(e,"fp-MenuSeparator"),...o})}),yr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Label,{ref:t,className:u.cx(e,"fp-MenuLabel"),...o})}),Rr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Group,{ref:t,className:u.cx(e,"fp-MenuGroup"),...o})}),wr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.SubTrigger,{ref:t,...a,className:u.cx(o,"fp-MenuItem"),children:[e,n.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),vr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(N.Portal,{children:n.jsx(N.SubContent,{ref:t,...o,className:u.cx(e,"fp-MenuContent"),sideOffset:12})})}),jr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.CheckboxItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuCheckboxItem"),children:[n.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(ce,{size:"4"})}),e]})}),Pr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsxs(N.RadioItem,{ref:t,...a,className:u.cx(o,"fp-MenuItem fp-MenuRadioItem"),children:[n.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:n.jsx(Qe,{size:"4"})}),e]})});xr.displayName="ContextMenu.Content";Cr.displayName="ContextMenu.Item";Nr.displayName="ContextMenu.Separator";yr.displayName="ContextMenu.Label";Rr.displayName="ContextMenu.Group";wr.displayName="ContextMenu.SubTrigger";vr.displayName="ContextMenu.SubContent";jr.displayName="ContextMenu.CheckboxItem";Pr.displayName="ContextMenu.RadioItem";const Ut=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:jr,Content:xr,Group:Rr,Item:Cr,Label:yr,RadioGroup:Ht,RadioItem:Pr,Root:Ft,Separator:Nr,Sub:qt,SubContent:vr,SubTrigger:wr,Trigger:Gt},Symbol.toStringTag,{value:"Module"})),{TooltipProvider:Wt}=B,Xt=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(B.Content,{ref:t,className:u.cx(e,"fp-tooltip"),...o})}),Kt=r=>{const{className:t,...e}=r;return n.jsx(B.Arrow,{className:u.cx(t,"fp-tooltip-arrow"),...e})},Re=l.forwardRef((r,t)=>{const{defaultOpen:e,open:o,onOpenChange:a,delayDuration:s,disableHoverableContent:c,container:i,forceMount:d,children:p,content:g,...f}=r,w={open:o,defaultOpen:e,onOpenChange:a,delayDuration:s,disableHoverableContent:c};return n.jsxs(B.Root,{...w,children:[n.jsx(B.Trigger,{asChild:!0,children:p}),n.jsx(B.Portal,{forceMount:d,container:i,children:n.jsxs(Xt,{ref:t,arrowPadding:8,...f,children:[g,n.jsx(Kt,{})]})})]})});Re.displayName="Tooltip";const Yt=u.cva("fp-IconButton",{variants:{size:{small:"fp-size-small",medium:"fp-size-medium"},activeAppearance:{subtle:"fp-active-appearance-subtle",solid:"fp-active-appearance-solid"}},defaultVariants:{size:"small",activeAppearance:"subtle"}}),ie=l.forwardRef((r,t)=>{const{className:e,size:o,activeAppearance:a,"aria-label":s,tooltipContent:c,disableTooltip:i,...d}=r,p=n.jsx("button",{ref:t,className:Yt({className:e,size:o,activeAppearance:a}),"aria-label":s,...d});return i?p:n.jsx(Re,{content:c??s,children:p})});ie.displayName="IconButton";const we=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx("header",{ref:t,className:u.cx(o,"fp-DialogBaseHeader"),...a,children:e})}),ve=l.forwardRef((r,t)=>{const{className:e,size:o,...a}=r;return n.jsx("div",{ref:t,className:Zt({className:e,size:o}),...a})}),je=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx("div",{ref:t,className:u.cx(e,"fp-DialogBaseControls"),...o})}),Zt=u.cva("fp-DialogBaseSection",{variants:{size:{base:"fp-DialogBaseSection-base",small:"fp-DialogBaseSection-small"}},defaultVariants:{size:"base"}});we.displayName="Dialog.Header";ve.displayName="Dialog.Section";je.displayName="Dialog.Controls";const Jt=F.Root,Qt=F.Anchor,eo=F.Portal,Sr=l.forwardRef((r,t)=>n.jsx(F.Trigger,{ref:t,...r,asChild:!0})),Tr=l.forwardRef((r,t)=>{const{className:e,style:o,width:a,height:s,maxWidth:c,maxHeight:i,...d}=r;return n.jsx(F.Content,{ref:t,className:u.cx(e,"fp-DialogBaseContent"),style:{...o,width:a,height:s,maxWidth:c,maxHeight:i},...d})}),Mr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(E,{ref:t,className:u.cx(e,"fp-DialogBaseTitle"),weight:"strong",...o})}),Ir=l.forwardRef((r,t)=>{const{children:e,...o}=r;return n.jsx(F.Close,{ref:t,asChild:!0,...o,children:e||n.jsx(ie,{"aria-label":"Close",disableTooltip:!0,children:n.jsx(Ze,{})})})});Sr.displayName="Popover.Trigger";Tr.displayName="Popover.Content";Mr.displayName="Popover.Title";Ir.displayName="Popover.Close";const ro=Object.freeze(Object.defineProperty({__proto__:null,Anchor:Qt,Close:Ir,Content:Tr,Controls:je,Header:we,Portal:eo,Root:Jt,Section:ve,Title:Mr,Trigger:Sr},Symbol.toStringTag,{value:"Module"})),to=V.Root,oo=V.Portal,$r=l.forwardRef((r,t)=>n.jsx(V.Trigger,{ref:t,...r,asChild:!0})),ao=u.cva(["fp-DialogBaseContent","fp-DialogContent"],{variants:{size:{1:"fp-size-1",2:"fp-size-2",3:"fp-size-3",fullscreen:"fp-size-fullscreen"},placement:{center:"fp-placement-center",top:"fp-placement-top"}},defaultVariants:{size:"2",placement:"top"}}),kr=l.forwardRef((r,t)=>{const{children:e,className:o,size:a,placement:s,style:c,width:i,height:d,maxWidth:p,maxHeight:g,...f}=r;return n.jsx(V.Content,{ref:t,className:ao({className:o,size:a,placement:s}),"aria-describedby":void 0,style:{...c,width:i,height:d,maxWidth:p,maxHeight:g},...f,children:e})}),_r=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(V.Overlay,{ref:t,className:u.cx(e,"fp-DialogBaseOverlay"),...o})}),Dr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(V.Title,{ref:t,className:u.cx(o,"fp-DialogBaseTitle"),...a,asChild:!0,children:n.jsx(E,{weight:"strong",children:e})})}),zr=l.forwardRef((r,t)=>{const{children:e,...o}=r;return n.jsx(V.Close,{ref:t,asChild:!0,...o,children:e||n.jsx(ie,{"aria-label":"Close",disableTooltip:!0,children:n.jsx(Ze,{})})})});$r.displayName="Dialog.Trigger";kr.displayName="Dialog.Content";_r.displayName="Dialog.Overlay";Dr.displayName="Dialog.Title";zr.displayName="Dialog.Close";const no=Object.freeze(Object.defineProperty({__proto__:null,Close:zr,Content:kr,Controls:je,Header:we,Overlay:_r,Portal:oo,Root:to,Section:ve,Title:Dr,Trigger:$r},Symbol.toStringTag,{value:"Module"})),so=I.Root,lo=I.Portal,Ar=l.forwardRef((r,t)=>n.jsx(I.Trigger,{ref:t,...r,asChild:!0})),co=u.cva(["fp-DialogBaseContent","fp-AlertDialogContent"],{variants:{size:{1:"fp-size-1",2:"fp-size-2",3:"fp-size-3"},placement:{center:"fp-placement-center",top:"fp-placement-top"}},defaultVariants:{size:"2",placement:"top"}}),Er=l.forwardRef((r,t)=>{const{className:e,size:o,placement:a,style:s,width:c,height:i,maxWidth:d,maxHeight:p,...g}=r;return n.jsx(I.Content,{ref:t,className:co({className:e,size:o,placement:a}),style:{...s,width:c,height:i,maxWidth:d,maxHeight:p},...g})}),Or=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(I.Overlay,{ref:t,className:u.cx(e,"fp-DialogBaseOverlay"),...o})}),Lr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(I.Title,{ref:t,className:u.cx(o,"fp-AlertDialogTitle"),...a,asChild:!0,children:n.jsx(E,{weight:"strong",children:e})})}),Vr=l.forwardRef((r,t)=>{const{children:e,className:o,...a}=r;return n.jsx(I.Description,{ref:t,className:u.cx(o,"fp-AlertDialogDescription"),...a,asChild:!0,children:n.jsx(E,{children:e})})}),Br=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx("div",{ref:t,className:u.cx(e,"fp-AlertDialogActions"),...o})}),Fr=l.forwardRef((r,t)=>n.jsx(I.Cancel,{ref:t,asChild:!0,...r})),Gr=l.forwardRef((r,t)=>n.jsx(I.Action,{ref:t,asChild:!0,...r}));Ar.displayName="AlertDialog.Trigger";Er.displayName="AlertDialog.Content";Or.displayName="AlertDialog.Overlay";Lr.displayName="AlertDialog.Title";Vr.displayName="AlertDialog.Description";Br.displayName="AlertDialog.Actions";Fr.displayName="AlertDialog.Cancel";Gr.displayName="AlertDialog.Action";const io=Object.freeze(Object.defineProperty({__proto__:null,Action:Gr,Actions:Br,Cancel:Fr,Content:Er,Description:Vr,Overlay:Or,Portal:lo,Root:so,Title:Lr,Trigger:Ar},Symbol.toStringTag,{value:"Module"})),[qr,Pe]=le("ValueFieldProvider",null),R=l.forwardRef((r,t)=>{const{className:e,disabled:o,...a}=r,s=Pe("Root");return n.jsx(qr,{disabled:o,children:n.jsx("label",{ref:t,className:u.cx(e,"fp-ValueFieldRoot"),"data-disabled":o||s!=null&&s.disabled?"":void 0,...a})})}),G=l.forwardRef((r,t)=>{const{className:e,disabled:o,...a}=r;return n.jsx(qr,{disabled:o,children:n.jsx("div",{ref:t,className:u.cx(e,"fp-ValueFieldMulti"),"data-disabled":o?"":void 0,...a})})}),q=l.forwardRef((r,t)=>{const{className:e,...o}=r,a=Pe("Root");return n.jsx("span",{ref:t,className:u.cx(e,"fp-ValueFieldLabel"),"data-disabled":a!=null&&a.disabled?"":void 0,...o})});R.displayName="ValueField.Root";q.displayName="ValueField.Label";G.displayName="ValueField.Multi";function z(r,t){const[e,o]=r,[a,s]=t;return function(c){return e===o||a===s?a:(c-e)/(o-e)*(s-a)+a}}function uo(){const[r,t]=l.useState(!0),e=l.useCallback(()=>{t(!0)},[]),o=l.useCallback(()=>{t(!1)},[]),a=l.useCallback(s=>{r&&s.currentTarget.selectionStart===s.currentTarget.selectionEnd&&(s.currentTarget.select(),t(!1))},[r]);return{onMouseLeave:o,onMouseUp:a,onFocus:e}}const Se=l.forwardRef((r,t)=>{const{type:e="text",className:o,selectOnClick:a=!1,...s}=r,c=l.useRef(null),i=ae(c,t),{onMouseLeave:d,onMouseUp:p,onFocus:g}=uo(),f=a?De({onMouseLeave:d,onMouseUp:p,onFocus:g},s):s;return n.jsx("input",{ref:i,type:e,className:u.cx(o,"fp-Input"),...f})});Se.displayName="Input";const po=1,go=10,Te=r=>{const{className:t,inputRef:e,value:o,onChange:a,smallNudge:s=po,bigNudge:c=go,formatter:i,disabled:d,...p}=r,g=l.useRef(null),f=ae(e,g),[w,S]=l.useState(null),b=w??i.format(o),x=Pe("ValueField"),T=m=>{const P=i.parse(m,o);if(m.length===0||!P.valid||P.value===o)return M();S(null),a(P.value)},M=()=>{S(null)},H=m=>{S(m.currentTarget.value)},U=m=>{const P=m.currentTarget;if(m.key==="Enter"&&(m.preventDefault(),P.blur()),m.key==="Escape"&&(m.preventDefault(),M(),requestAnimationFrame(()=>{P.blur()})),m.key==="ArrowUp"||m.key==="ArrowDown"){if(!i.incrementBy)return;m.preventDefault();const W=i.parse(P.value,o),Z=W.valid?W.value:o,J=m.shiftKey?c:s,k=m.key==="ArrowUp"?J:-J,_=i.getIncrementTargets?i.getIncrementTargets(P):null,de=i.incrementBy(Z,k,_);T(i.format(de)),requestAnimationFrame(()=>{if(_&&i.getIncrementSelection){const[tt,ot]=i.getIncrementSelection(_);P.setSelectionRange(tt,ot)}else P.select()})}},L=m=>{T(m.currentTarget.value)};return n.jsx(Se,{ref:f,dir:"auto",autoComplete:"off",spellCheck:"false",selectOnClick:!0,className:u.cx(t,"fp-ValueFieldBase"),value:b,onChange:H,disabled:d||(x==null?void 0:x.disabled),...De(p,{onBlur:L,onKeyDown:U})})};Te.displayName="ValueField.Base";const mo=15,v=l.forwardRef((r,t)=>{const{value:e,onChange:o,min:a,max:s,targetRange:c,precision:i,suffix:d,allowedUnits:p,...g}=r,f=l.useMemo(()=>fo({min:a,max:s,precision:i,targetRange:c,suffix:d,allowedUnits:p}),[a,s,i,c,d,p]);return n.jsx(Te,{inputRef:t,value:e,onChange:o,formatter:f,...g})});function fo(r={}){const{min:t,max:e,targetRange:o,precision:a=mo,suffix:s,allowedUnits:c=[]}=r,{toDisplayValue:i,fromDisplayValue:d}=bo({min:t,max:e,targetRange:o});return{parse:(p,g)=>{try{return{valid:!0,value:h.pipe(p,f=>xo({expression:f,displayValue:i(g),suffix:s,allowedUnits:c}),h.round(a),d,h.clamp({min:t,max:e}))}}catch{return{valid:!1}}},format:p=>h.pipe(p,h.clamp({min:t,max:e}),i,h.round(a),g=>ho(g,s)),incrementBy(p,g){return p+d(g)}}}function bo(r){const{min:t,max:e,targetRange:o}=r;if(!o)return{toDisplayValue:a=>a,fromDisplayValue:a=>a};if(typeof t!="number"||typeof e!="number")throw Error("'targetRange' requires specifying 'min' and 'max'.");if(t===e)throw Error("'min' and 'max' cannot be equal.");return{toDisplayValue:z([t,e],o),fromDisplayValue:z(o,[t,e])}}function ho(r,t){return Number.isNaN(r)?"":t?`${r}${t}`:`${r}`}function xo(r){const{displayValue:t,expression:e,suffix:o="",allowedUnits:a=[]}=r,s="(\\d*\\.?\\d+)",c=`(?:${[...a,o].join("|")})*`,i=e.replace(new RegExp(`${s}${c}`,"gi"),(p,g)=>g).replace(new RegExp(`${c}${s}`,"gi"),(p,g)=>g).replace(new RegExp(`${s}%`,"gi"),(p,g)=>`(${t}*${g}/100)`).replace(new RegExp(`%${s}`,"gi"),(p,g)=>`(${t}*${g}/100)`).replace(new RegExp(`${s}x`,"gi"),(p,g)=>`(${t}*${g})`).replace(new RegExp(`x${s}`,"gi"),(p,g)=>`(${t}*${g})`).replace(new RegExp("(?<!\\d)x(?!\\d)","gi"),`${t}`).trim(),d=mt(i);if(d===null)throw new Error("Invalid expression.");return d}const Hr={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Ur=l.forwardRef((r,t)=>{const{value:e,onChange:o,ignoreAlpha:a=!1,...s}=r,c=l.useMemo(()=>Co({ignoreAlpha:a}),[a]);return n.jsx(Te,{inputRef:t,value:e,onChange:o,formatter:c,...s})});function Co(r){const{ignoreAlpha:t}=r;return{parse(e,o){if(No(e)){const{r:a,g:s,b:c}=Hr[e];return{valid:!0,value:{r:a/255,g:s/255,b:c/255,a:o.a}}}try{return{value:h.pipe(e,yo,a=>Ro(a,o),wo,a=>t?{...a,a:1}:a),valid:!0}}catch{return{valid:!1}}},format(e){return(Math.round(e.r*255).toString(16).padStart(2,"0")+Math.round(e.g*255).toString(16).padStart(2,"0")+Math.round(e.b*255).toString(16).padStart(2,"0")).toUpperCase()},incrementBy(e,o,a){return a??(a={r:!0,g:!0,b:!0}),{r:a.r?h.clamp(Math.round(e.r*255)+o,{min:0,max:255})/255:e.r,g:a.g?h.clamp(Math.round(e.g*255)+o,{min:0,max:255})/255:e.g,b:a.b?h.clamp(Math.round(e.b*255)+o,{min:0,max:255})/255:e.b,a:e.a}},getIncrementTargets(e){const o=e.selectionStart,a=e.selectionEnd;return o===null||a===null?null:{r:o<2||o===2&&a===2,g:o<4&&a>=3||o===4&&a===4,b:a>=5}},getIncrementSelection(e){let o,a;return e?(e.r?o=0:e.g?o=2:o=4,e.b?a=6:e.g?a=4:a=2,[o,a]):[0,6]}}}function No(r){return Object.keys(Hr).includes(r)}function yo(r){var e;const t=/[0-9a-f]+/gi;return((e=r.match(t))==null?void 0:e[0])??""}function Ro(r,t){if(!/^[0-9a-f]{1,8}$/i.test(r))throw new Error("Invalid hex substring");switch(r.length){case 1:return r.repeat(6)+Q(t.a);case 2:return r.repeat(3)+Q(t.a);case 3:return r.split("").map(e=>e.repeat(2)).join("")+Q(t.a);case 4:return r.slice(0,3).split("").map(e=>e.repeat(2)).join("")+r[3].repeat(2);case 5:return r.slice(0,3).split("").map(e=>e.repeat(2)).join("")+r.slice(-2);case 6:return r+Q(t.a);case 7:return r.slice(0,6)+r[6].repeat(2);case 8:return r;default:throw new Error("Invalid hex substring")}}function wo(r){return{r:parseInt(r.substring(0,2),16)/255,g:parseInt(r.substring(2,4),16)/255,b:parseInt(r.substring(4,6),16)/255,a:parseInt(r.substring(6,8),16)/255}}function Q(r){return Math.round(r*255).toString(16)}const vo=Object.freeze(Object.defineProperty({__proto__:null,Hex:Ur,Label:q,Multi:G,Numeric:v,Root:R},Symbol.toStringTag,{value:"Module"}));function ee(r){const t=h.round(r*255,0).toString(16);return t.length<2?"0"+t:t}function te({r,g:t,b:e,a:o}){const a=o<1?ee(o):"";return"#"+ee(r)+ee(t)+ee(e)+a}function jo(r){return te(fe(r))}function Po(r){return te(A(r))}function Y({r,g:t,b:e,a:o}){const a=Math.max(r,t,e),s=a-Math.min(r,t,e),c=s?a===r?(t-e)/s:a===t?2+(e-r)/s:4+(r-t)/s:0;return{h:60*(c<0?c+6:c),s:a?s/a*100:0,v:a*100,a:o}}function A({h:r,s:t,v:e,a:o}){r=r/360*6,t=t/100,e=e/100;const a=Math.floor(r),s=e*(1-t),c=e*(1-(r-a)*t),i=e*(1-(1-r+a)*t),d=a%6;return{r:[e,c,s,s,i,e][d],g:[i,e,e,c,s,s][d],b:[s,s,i,e,e,c][d],a:o}}function Wr({h:r,s:t,l:e,a:o}){return t*=(e<50?e:100-e)/100,{h:r,s:t>0?2*t/(e+t)*100:0,v:e+t,a:o}}function Xr({h:r,s:t,v:e,a:o}){const a=(200-t)*e/100;return{h:r,s:a>0&&a<200?t*e/100/(a<=100?a:200-a)*100:0,l:a/2,a:o}}function fe(r){return A(Wr(r))}function $e(r){return Xr(Y(r))}function X(r){const t=h.round(r.r,4),e=h.round(r.g,4),o=h.round(r.b,4),a=h.round(r.a,2);return a<1?`color(display-p3 ${t} ${e} ${o} / ${a})`:`color(display-p3 ${t} ${e} ${o})`}function K(r){const t=Math.round(r.r*255),e=Math.round(r.g*255),o=Math.round(r.b*255),a=r.a;return a<1?`rgb(${t} ${e} ${o} / ${a})`:`rgb(${t} ${e} ${o})`}function ke(r){const{r:t,g:e,b:o,a}=r;return{r:t+(1-t)*(1-a),g:e+(1-e)*(1-a),b:o+(1-o)*(1-a),a:1}}const So={r:0,g:0,b:0,a:1},To=["hex","rgb","hsl","hsv"],[Mo,$]=le("ColorPicker"),Io=r=>{const{colorSpace:t,models:e=To,defaultActiveModel:o,activeModel:a,onActiveModelChange:s,defaultColor:c,color:i,onColorChange:d,children:p}=r;$o(a,o,e);const[g=So,f]=me({prop:i,defaultProp:c,onChange:d}),[w=e[0],S]=me({prop:a,defaultProp:o,onChange:s}),[b,x]=l.useState({}),T={hsv:b.hsv??Y(g),hsl:b.hsl??$e(g),rgb:b.rgb??g,hex:b.hex??te(g)},M=T.hsv.h,H=U=>{const{mode:L,value:m}=U;L==="rgb"?(x({rgb:m,hsv:Y(m),hsl:$e(m),hex:te(m)}),f(m)):L==="hsv"?(x({hsv:m,hsl:Xr(m),rgb:A(m),hex:Po(m)}),f(A(m))):L==="hsl"&&(x({hsv:Wr(m),hsl:m,rgb:fe(m),hex:jo(m)}),f(fe(m)))};return n.jsx(Mo,{colorSpace:t,models:e,activeModel:w,onActiveModelChange:S,color:g,onColorChange:H,hue:M,colorsByModel:T,children:p})};function $o(r,t,e){if(e.length===0)throw new Error("The 'models' prop must contain at least one color model. Omit the 'models' prop entirely to use default models.");if(r&&!e.includes(r))throw new Error(`Invalid 'activeModel': '${r}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`);if(t&&!e.includes(t))throw new Error(`Invalid 'defaultActiveModel': '${t}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`)}const ko=2,_o=0,Do=100,zo="horizontal",Ao="ltr",ue=l.forwardRef((r,t)=>{const{className:e,min:o=_o,max:a=Do,defaultValue:s=[o],value:c,onValueChange:i,orientation:d=zo,dir:p=Ao,inverted:g,disabled:f,range:w=!0,rangeAnchor:S,baseValue:b,hints:x,...T}=r,M=l.useRef(null),H=ae(M,t),{onPointerDown:U,focusVisible:L}=Vo(M),[m,P]=l.useState(c??s),W=l.useRef(c),Z=l.useRef(s);l.useEffect(()=>{h.isDeepEqual(c,W.current)&&h.isDeepEqual(s,Z.current)||(P(c??s),W.current=c,Z.current=s)},[c,s]),l.useEffect(()=>{M.current&&M.current.style.setProperty("--radix-slider-thumb-transform",Lo(d,p,g))},[M,d,p,g]);const J=k=>{const _=k.map(de=>Bo(de,x,o,a));i==null||i(_),P(_)};return n.jsxs(pe.Root,{tabIndex:-1,ref:H,className:u.cx(e,"fp-SliderRoot"),value:m,onValueChange:J,onPointerDown:U,min:o,max:a,orientation:d,dir:p,inverted:g,disabled:f,...T,children:[n.jsx(pe.Track,{className:"fp-SliderTrack"}),w&&n.jsx(Oo,{dir:p,value:m,min:o,max:a,orientation:d,inverted:g,rangeAnchor:S,disabled:f}),x&&x.map(k=>n.jsx(Eo,{hint:k,baseValue:b,min:o,max:a,orientation:d,dir:p,inverted:g},k)),m.map((k,_)=>n.jsx(pe.Thumb,{className:u.cx("fp-SliderThumb",{"fp-SliderThumb-focusVisible":L,"fp-SliderThumb-baseValue":k===b})},_))]})});ue.displayName="Slider";const Eo=r=>{const{baseValue:t,dir:e,inverted:o,max:a,min:s,orientation:c,hint:i}=r,{startEdge:d}=Kr(c,e,o),p=z([s,a],[0,100])(i),g=4;return n.jsx(n.Fragment,{children:n.jsx("span",{className:u.cx("fp-SliderHint",{"fp-SliderHint-baseValue":i===t}),"data-orientation":c,style:{[d]:`calc(${p}% - ${g/2}px)`}})})},Oo=r=>{const{min:t,max:e,value:o,rangeAnchor:a=t,orientation:s,dir:c,inverted:i,disabled:d}=r,p=o.length>1?Math.min(...o):Math.min(a,...o),g=o.length>1?Math.max(...o):Math.max(a,...o),f=z([t,e],[0,100])(p),w=100-z([t,e],[0,100])(g),S=Kr(s,c,i);return n.jsx("span",{className:"fp-SliderRange","data-orientation":s,"data-disabled":d?"":void 0,style:{[S.startEdge]:`${f}%`,[S.endEdge]:`${w}%`}})};function Kr(r,t,e){const o=e?"inverted":"normal";return{vertical:{normal:{startEdge:"bottom",endEdge:"top"},inverted:{startEdge:"top",endEdge:"bottom"}},horizontal:{normal:{startEdge:t==="ltr"?"left":"right",endEdge:t==="ltr"?"right":"left"},inverted:{startEdge:t==="ltr"?"right":"left",endEdge:t==="ltr"?"left":"right"}}}[r][o]}function Lo(r,t,e){const o=e?"inverted":"normal";return{vertical:{normal:"translateY(50%)",inverted:"translateY(-50%)"},horizontal:{normal:t==="ltr"?"translateX(-50%)":"translateX(50%)",inverted:t==="ltr"?"translateX(50%)":"translateX(-50%)"}}[r][o]}function Vo(r){const[t,e]=l.useState(!1),o=()=>{var s;e(!1),window.removeEventListener("pointerup",o),(s=r.current)==null||s.focus()};return{onPointerDown:()=>{e(!0),window.addEventListener("pointerup",o)},focusVisible:!t}}function Bo(r,t,e,o){const a=z([0,100],[0,o-e])(ko),s=t==null?void 0:t.find(c=>Math.abs(c-r)<=a);return typeof s=="number"?s:r}const Fo=r=>{const{className:t,style:e}=r,{activeModel:o,colorSpace:a,hue:s,color:c,onColorChange:i}=$("Hue"),d=Go[o],p=f=>{const w=d.setHue(c,f[0]);i({mode:"rgb",value:w})},g=d.getThumbColor(s,a);return n.jsx(ue,{"aria-label":"hue",range:!1,min:0,max:359,value:[s],onValueChange:p,className:`fp-ColorPickerHueSlider fp-color-model-${o} fp-color-space-${a} ${t}`,style:{"--slider-thumb-bg":g,...e}})},re={getHue:r=>Math.round(Y(r).h),setHue:(r,t)=>{const{s:e,v:o}=Y(r);return A({h:t,s:e,v:o,a:r.a})},getThumbColor:(r,t)=>{const{r:e,g:o,b:a}=A({h:r,s:100,v:100,a:1});return t==="display-p3"?`color(display-p3 ${+e.toFixed(4)} ${+o.toFixed(4)} ${+a.toFixed(4)})`:`rgb(${Math.round(e*255)} ${Math.round(o*255)} ${Math.round(a*255)})`}},Go={rgb:re,hsl:re,hsv:re,hex:re},qo=r=>{const{className:t,style:e}=r,{colorSpace:o,color:a,onColorChange:s}=$("Hue"),c={srgb:{transparent:K({...a,a:0}),opaque:K({...a,a:1})},p3:{transparent:X({...a,a:0}),opaque:X({...a,a:1})}},i={srgb:K(ke(a)),p3:X(ke(a))},d=p=>{s({mode:"rgb",value:{...a,a:h.round(p[0]/100,2)}})};return n.jsx(ue,{"aria-label":"alpha",min:0,max:100,range:!1,value:[a.a*100],onValueChange:d,className:`fp-ColorPickerAlphaSlider fp-color-space-${o} ${t}`,style:{"--track-bg-transparent-srgb":c.srgb.transparent,"--track-bg-opaque-srgb":c.srgb.opaque,"--track-bg-transparent-p3":c.p3.transparent,"--track-bg-opaque-p3":c.p3.opaque,"--thumb-bg-srgb":i.srgb,"--thumb-bg-p3":i.p3,...e}})},Ho=8,Uo=r=>{const{onColorChange:t,colorsByModel:e,hue:o,colorSpace:a,activeModel:s}=$("ColorPicker.Area"),c={srgb:K(A({h:o,s:100,v:100,a:1})),p3:X(A({h:o,s:100,v:100,a:1}))},i={srgb:K(e.rgb),p3:X(e.rgb)},d=Wo(e,s),p=l.useRef(null),{size:g}=Xo(p),f=b=>{t(s==="hsl"?{mode:"hsl",value:{h:o,s:b.x,l:100-b.y,a:e.rgb.a}}:{mode:"hsv",value:{h:o,s:b.x,v:100-b.y,a:e.rgb.a}})},w=b=>{if(b.type==="pointerdown"&&b.currentTarget.setPointerCapture(b.pointerId),b.type==="pointermove"&&!b.currentTarget.hasPointerCapture(b.pointerId))return;const x=b.currentTarget.getBoundingClientRect();f({x:h.pipe(b.clientX-x.x,z([0,g],[0,100]),h.clamp({min:0,max:100})),y:h.pipe(b.clientY-x.y-Ho,z([0,g],[0,100]),h.clamp({min:0,max:100}))})},S=b=>{const x=b.shiftKey?10:1,T={ArrowRight:{x:1,y:0},ArrowLeft:{x:-1,y:0},ArrowDown:{x:0,y:1},ArrowUp:{x:0,y:-1}}[b.key];T&&f({x:h.clamp(d.x+T.x*x,{min:0,max:100}),y:h.clamp(d.y+T.y*x,{min:0,max:100})})};return n.jsxs("div",{ref:p,className:"fp-ColorPickerArea",onPointerDown:w,onPointerMove:w,style:{"--base-color-srgb":c.srgb,"--base-color-p3":c.p3},children:[n.jsx("div",{className:`fp-ColorPickerAreaCanvas fp-color-space-${a} fp-color-model-${s}`}),n.jsx("div",{tabIndex:0,onKeyDown:S,className:`fp-ColorPickerThumb fp-color-space-${a}`,style:{"--thumb-bg-srgb":i.srgb,"--thumb-bg-p3":i.p3,left:`${d.x}%`,top:`${d.y}%`}})]})};function Wo(r,t){if(t==="hsl"){const e=r.hsl;return{x:e.s,y:100-e.l}}else{const e=r.hsv;return{x:e.s,y:100-e.v}}}function Xo(r){const[t,e]=l.useState(0);return l.useLayoutEffect(()=>{const o=r.current;if(!o)return;e(o.getBoundingClientRect().width);const a=new ResizeObserver(s=>{for(const c of s)e(c.contentRect.width)});return a.observe(o),()=>{a.unobserve(o)}},[r]),{size:t}}const ge={0:"fp-gap-0",px:"fp-gap-px","0.5":"fp-gap-0_5",1:"fp-gap-1","1.5":"fp-gap-1_5",2:"fp-gap-2","2.5":"fp-gap-2_5",3:"fp-gap-3","3.5":"fp-gap-3_5",4:"fp-gap-4",5:"fp-gap-5",6:"fp-gap-6",7:"fp-gap-7",8:"fp-gap-8",9:"fp-gap-9",10:"fp-gap-10",11:"fp-gap-11",12:"fp-gap-12",13:"fp-gap-13",14:"fp-gap-14",15:"fp-gap-15",16:"fp-gap-16"},Ko=u.cva("fp-Flex",{variants:{direction:{row:"fp-direction-row",column:"fp-direction-column",rowReverse:"fp-direction-row-reverse",columnReverse:"fp-direction-column-reverse"},align:{start:"fp-align-start",center:"fp-align-center",end:"fp-align-end",baseline:"fp-align-baseline",stretch:"fp-align-stretch"},justify:{start:"fp-justify-start",center:"fp-justify-center",end:"fp-justify-end",between:"fp-justify-between"},wrap:{nowrap:"fp-wrap-nowrap",wrap:"fp-wrap-wrap",wrapReverse:"fp-wrap-wrap-reverse"},gap:ge,columnGap:ge,rowGap:ge},defaultVariants:{direction:"row"}}),Me=l.forwardRef((r,t)=>{const{className:e,direction:o,align:a,justify:s,wrap:c,gap:i,columnGap:d,rowGap:p,...g}=r;return n.jsx("div",{ref:t,className:Ko({className:e,direction:o,align:a,justify:s,wrap:c,gap:i,columnGap:d,rowGap:p}),...g})});Me.displayName="Flex";const Yo=r=>{const{models:t,activeModel:e,onActiveModelChange:o}=$("ColorPicker.Input"),a=h.pick({hex:Zo,hsv:Qo,hsl:ea,rgb:Jo},t)[e];return n.jsxs(Me,{gap:"2.5",className:r.className,style:r.style,children:[t.length>1&&n.jsxs(nr,{value:e,onValueChange:o,children:[n.jsx(Ce,{style:{width:56}}),n.jsx(Ne,{children:t.map(s=>n.jsx(ye,{value:s,children:s.toUpperCase()},s))})]}),n.jsx(a,{})]})},Zo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HEX"),e=r.rgb,o=s=>{t({mode:"rgb",value:s})},a=s=>{t({mode:"rgb",value:{...e,a:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(Ur,{onChange:o,value:e})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:a,value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},Jo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.RGBA"),e=r.rgb,o=a=>s=>{t({mode:"rgb",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("r"),value:e.r,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("g"),value:e.g,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("b"),value:e.b,min:0,max:1,targetRange:[0,255],precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},Qo=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HSVA"),e=r.hsv,o=a=>s=>{t({mode:"hsv",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("h"),value:e.h,min:0,max:360,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("s"),value:e.s,min:0,max:100,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("v"),value:e.v,min:0,max:100,precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},ea=()=>{const{colorsByModel:r,onColorChange:t}=$("ColorPicker.HSLA"),e=r.hsl,o=a=>s=>{t({mode:"hsl",value:{...e,[a]:s}})};return n.jsxs(G,{children:[n.jsx(R,{children:n.jsx(v,{onChange:o("h"),value:e.h,min:0,max:360,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("s"),value:e.s,min:0,max:100,precision:0})}),n.jsx(R,{children:n.jsx(v,{onChange:o("l"),value:e.l,min:0,max:100,precision:0})}),n.jsxs(R,{style:{flex:"0 0 52px"},children:[n.jsx(v,{onChange:o("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),n.jsx(q,{children:"%"})]})]})},ra=Object.freeze(Object.defineProperty({__proto__:null,Alpha:qo,Area:Uo,Hue:Fo,Input:Yo,Root:Io,useColorPickerContext:$},Symbol.toStringTag,{value:"Module"})),Yr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(be.Root,{ref:t,className:u.cx(e,"fp-CollapsibleRoot"),...o})}),Zr=l.forwardRef((r,t)=>{const{className:e,children:o,...a}=r;return n.jsxs(be.Trigger,{ref:t,className:u.cx(e,"fp-CollapsibleTrigger"),...a,children:[n.jsx(he,{viewBox:"4 4 16 16",size:"4",className:"fp-CollapsibleIndicator"}),o]})}),Jr=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(be.Content,{ref:t,className:u.cx(e,"fp-CollapsibleContent"),...o})});Yr.displayName="Collapsible.Root";Zr.displayName="Collapsible.Trigger";Jr.displayName="Collapsible.Content";const ta=Object.freeze(Object.defineProperty({__proto__:null,Content:Jr,Root:Yr,Trigger:Zr},Symbol.toStringTag,{value:"Module"})),oa=u.cva("fp-Button",{variants:{variant:{primary:"fp-variant-primary",secondary:"fp-variant-secondary",inverse:"fp-variant-inverse",destructive:"fp-variant-destructive",success:"fp-variant-success",text:"fp-variant-text"},size:{small:"fp-size-small",medium:"fp-size-medium"},fullWidth:{true:"fp-full-width"}},defaultVariants:{variant:"secondary",size:"small"}}),Qr=l.forwardRef((r,t)=>{const{className:e,variant:o,size:a,fullWidth:s,...c}=r;return n.jsx("button",{ref:t,className:oa({className:e,variant:o,size:a,fullWidth:s}),...c})});Qr.displayName="Button";const et=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(ht,{className:u.cx(e,"fp-textarea"),ref:t,...o})});et.displayName="Textarea";const rt=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(Ie.Root,{ref:t,className:u.cx(e,"fp-switchRoot"),...o,children:n.jsx(Ie.Thumb,{ref:t,className:u.cx(e,"fp-switchThumb")})})});rt.displayName="Switch";exports.AlertDialog=io;exports.Button=Qr;exports.Checkbox=Dt;exports.Collapsible=ta;exports.ColorPicker=ra;exports.ContextMenu=Ut;exports.Dialog=no;exports.DropdownMenu=Bt;exports.Flex=Me;exports.IconButton=ie;exports.Input=Se;exports.Label=se;exports.Link=Ge;exports.Paragraph=Fe;exports.Popover=ro;exports.RadioGroup=Pt;exports.SegmentedControl=wt;exports.Select=At;exports.Slider=ue;exports.Switch=rt;exports.Tabs=yt;exports.Text=E;exports.Textarea=et;exports.Tooltip=Re;exports.TooltipProvider=Wt;exports.ValueField=vo;exports.createIcon=O;
package/dist/index.mjs CHANGED
@@ -494,7 +494,8 @@ const ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
494
494
  ref: t,
495
495
  ...o,
496
496
  className: p(e, "fp-MenuContent"),
497
- sideOffset: 12
497
+ sideOffset: 12,
498
+ alignOffset: -8
498
499
  }
499
500
  ) });
500
501
  }), wr = i.forwardRef((r, t) => {
@@ -624,7 +625,7 @@ const oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
624
625
  } = r, v = { open: o, defaultOpen: e, onOpenChange: a, delayDuration: s, disableHoverableContent: l };
625
626
  return /* @__PURE__ */ h(H.Root, { ...v, children: [
626
627
  /* @__PURE__ */ n(H.Trigger, { asChild: !0, children: u }),
627
- /* @__PURE__ */ n(H.Portal, { forceMount: d, container: c, children: /* @__PURE__ */ h(Et, { ref: t, arrowPadding: 10, ...f, children: [
628
+ /* @__PURE__ */ n(H.Portal, { forceMount: d, container: c, children: /* @__PURE__ */ h(Et, { ref: t, arrowPadding: 8, ...f, children: [
628
629
  g,
629
630
  /* @__PURE__ */ n(Lt, {})
630
631
  ] }) })
package/dist/styles.css CHANGED
@@ -399,7 +399,7 @@
399
399
  .fp-Text:where(.fp-size-medium) {
400
400
  --font-size: var(--font-size-3);
401
401
  --line-height: var(--line-height-3);
402
- --letter-spacing: --letter-spacing-3;
402
+ --letter-spacing: var(--letter-spacing-3);
403
403
  }
404
404
  .fp-Text:where(.fp-size-large) {
405
405
  --font-size: var(--font-size-5);
@@ -429,7 +429,7 @@
429
429
  }
430
430
  .fp-Text code {
431
431
  font-family: var(--font-family-monospace);
432
- font-size: var(var(--font-size-2));
432
+ font-size: var(--font-size-2);
433
433
  background-color: var(--figma-color-bg-brand-tertiary);
434
434
  padding: 0.05rem 0.15rem;
435
435
  border-radius: var(--radius-extra-small);
@@ -636,7 +636,7 @@
636
636
  .fp-tooltip-arrow {
637
637
  fill: var(--color-bg-tooltip);
638
638
  width: var(--space-3_5);
639
- height: var(--space-1_5);
639
+ height: 7px;
640
640
  position: relative;
641
641
  bottom: 1px;
642
642
  }
@@ -977,51 +977,65 @@
977
977
  box-sizing: border-box;
978
978
  position: relative;
979
979
  display: block;
980
- width: var(--space-6);
981
- height: var(--space-3);
980
+ width: var(--space-8);
981
+ height: var(--space-4);
982
982
  padding: 0;
983
- background: linear-gradient(90deg, var(--figma-color-bg-brand) 0px 24px, var(--figma-color-icon-tertiary) 24px 48px);
984
- background-repeat: no-repeat;
985
- background-size: 200% 100%;
983
+ background: none;
986
984
  background-clip: padding-box;
987
985
  border-radius: var(--radius-full);
988
986
  border: 0;
989
- transition: background-position 0.1s ease-out;
987
+ transition: background-position 0.08s ease-out;
988
+
989
+ /* Using ::before to render the background to create the real gap between the
990
+ outline and the background in the focused mode as it is in Figma. */
990
991
  }
991
- .fp-switchRoot:focus-visible {
992
- outline-offset: 2px;
993
- outline: 2px solid var(--figma-color-border-selected);
992
+ .fp-switchRoot::before {
993
+ position: absolute;
994
+ inset: 0;
995
+ border-radius: var(--radius-full);
996
+ background: none;
997
+ content: '';
994
998
  }
995
- .fp-switchRoot[data-disabled] {
996
- background: var(--figma-color-icon-disabled);
997
- border-color: var(--figma-color-icon-disabled);
999
+ .fp-switchRoot[data-state='unchecked']::before {
1000
+ background: var(--figma-color-bg-tertiary);
998
1001
  }
999
- .fp-switchRoot[data-state='unchecked'] {
1000
- background-position: -24px;
1002
+ .fp-switchRoot[data-state='checked']::before {
1003
+ background: var(--figma-color-bg-brand);
1001
1004
  }
1002
- .fp-switchRoot[data-state='checked'] {
1003
- background-position: 0;
1005
+ .fp-switchRoot:focus-visible {
1006
+ outline-offset: -1px;
1007
+ outline: 1px solid var(--figma-color-border-selected-strong);
1004
1008
  }
1009
+ .fp-switchRoot:focus-visible::before {
1010
+ inset: 2px;
1011
+ }
1012
+ .fp-switchRoot[data-disabled][data-state='unchecked']::before {
1013
+ /* This gives it more contrast than the disabled checked state but this is
1014
+ how it is in Figma. ¯\_(ツ)_/¯ */
1015
+ background: var(--figma-color-bg-disabled);
1016
+ }
1017
+ .fp-switchRoot[data-disabled][data-state='checked']::before {
1018
+ background: var(--figma-color-bg-tertiary);
1019
+ }
1005
1020
  .fp-switchThumb {
1006
1021
  box-sizing: border-box;
1007
1022
  position: absolute;
1008
1023
  top: 1px;
1009
1024
  left: 1px;
1010
- height: var(--space-2_5);
1011
- width: var(--space-2_5);
1025
+ height: var(--space-3_5);
1026
+ width: var(--space-3_5);
1012
1027
  border-radius: var(--radius-full);
1013
1028
  background: var(--figma-color-icon-onbrand);
1014
- transition: all 0.1s ease-out;
1029
+ transition: all 0.08s ease-out;
1015
1030
  }
1016
1031
  .fp-switchThumb[data-disabled] {
1017
- background-color: var(--figma-color-bg);
1018
- border-color: var(--figma-color-bg);
1032
+ background-color: var(--figma-color-icon-ondisabled);
1019
1033
  }
1020
1034
  .fp-switchThumb[data-state='unchecked'] {
1021
1035
  left: 1px;
1022
1036
  }
1023
1037
  .fp-switchThumb[data-state='checked'] {
1024
- left: calc(100% - var(--space-2_5) - 1px);
1038
+ left: calc(100% - var(--space-3_5) - 1px);
1025
1039
  }
1026
1040
  :root,
1027
1041
  .light,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "figma-kit",
3
3
  "description": "A set of React components for building Figma plugins.",
4
4
  "homepage": "https://figma-kit.dev",
5
- "version": "1.0.0-beta.19",
5
+ "version": "1.0.0-beta.22",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",