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

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
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),l=require("react"),at=require("@radix-ui/react-tabs"),u=require("class-variance-authority"),nt=require("@radix-ui/react-toggle-group"),_e=require("@radix-ui/react-slot"),st=require("@radix-ui/react-radio-group"),lt=require("@radix-ui/react-select"),ct=require("@radix-ui/react-dropdown-menu"),it=require("@radix-ui/react-context-menu"),ut=require("@radix-ui/react-popover"),dt=require("@radix-ui/react-tooltip"),pt=require("@radix-ui/react-dialog"),gt=require("@radix-ui/react-alert-dialog"),h=require("remeda"),mt=require("@emmetio/math-expression"),De=require("merge-props"),ft=require("@radix-ui/react-slider"),bt=require("@radix-ui/react-collapsible"),ht=require("react-textarea-autosize"),xt=require("@radix-ui/react-switch");function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const D=j(l),te=j(at),ze=j(nt),Ae=j(st),y=j(lt),C=j(ct),N=j(it),F=j(ut),B=j(dt),V=j(pt),I=j(gt),pe=j(ft),be=j(bt),Ie=j(xt);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),l=require("react"),at=require("@radix-ui/react-tabs"),u=require("class-variance-authority"),nt=require("@radix-ui/react-toggle-group"),_e=require("@radix-ui/react-slot"),st=require("@radix-ui/react-radio-group"),lt=require("@radix-ui/react-select"),ct=require("@radix-ui/react-dropdown-menu"),it=require("@radix-ui/react-context-menu"),ut=require("@radix-ui/react-popover"),dt=require("@radix-ui/react-tooltip"),pt=require("@radix-ui/react-dialog"),gt=require("@radix-ui/react-alert-dialog"),h=require("remeda"),mt=require("@emmetio/math-expression"),De=require("merge-props"),ft=require("@radix-ui/react-slider"),bt=require("@radix-ui/react-collapsible"),ht=require("react-textarea-autosize"),xt=require("@radix-ui/react-switch");function j(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const D=j(l),oe=j(at),ze=j(nt),Ae=j(st),y=j(lt),C=j(ct),N=j(it),F=j(ut),B=j(dt),V=j(pt),I=j(gt),pe=j(ft),be=j(bt),Ie=j(xt);/**
2
2
  * @license
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 oe(...r){return D.useCallback(Ee(...r),r)}const Le=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(te.Root,{ref:t,className:u.cx(e,"fp-TabsRoot"),...o})}),Oe=l.forwardRef((r,t)=>{const{className:e,...o}=r;return n.jsx(te.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(te.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(te.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"})),ae=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:ae({className:o,size:a,weight:s,align:c,block:i}),...d})});E.displayName="Text";const ne=l.forwardRef((r,t)=>{const{className:e,size:o,weight:a,align:s,block:c,...i}=r;return n.jsx("label",{ref:t,className:ae({className:e,size:o,weight:a,align:s,block:c}),...i})});ne.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:ae({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(ae({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 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";/**
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 se(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]=se("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(ne,{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"})})}),le=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]=se("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=oe(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(le,{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(ne,{"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(le,{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(le,{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(le,{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"}}),ce=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})});ce.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(ce,{"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(ce,{"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]=se("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=oe(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=oe(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 Y=i.parse(P.value,o),ue=Y.valid?Y.value:o,Z=m.shiftKey?c:s,k=m.key==="ArrowUp"?Z:-Z,_=i.getIncrementTargets?i.getIncrementTargets(P):null,de=i.incrementBy(ue,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)+J(t.a);case 2:return r.repeat(3)+J(t.a);case 3:return r.split("").map(e=>e.repeat(2)).join("")+J(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+J(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 J(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 Q(r){const t=h.round(r*255,0).toString(16);return t.length<2?"0"+t:t}function re({r,g:t,b:e,a:o}){const a=o<1?Q(o):"";return"#"+Q(r)+Q(t)+Q(e)+a}function jo(r){return re(fe(r))}function Po(r){return re(A(r))}function K({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(K(r))}function W(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 X(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,$]=se("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??K(g),hsl:b.hsl??$e(g),rgb:b.rgb??g,hex:b.hex??re(g)},M=T.hsv.h,H=U=>{const{mode:O,value:m}=U;O==="rgb"?(x({rgb:m,hsv:K(m),hsl:$e(m),hex:re(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",ie=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=oe(M,t),{onPointerDown:U,focusVisible:O}=Vo(M),[m,P]=l.useState(c??s),Y=l.useRef(c),ue=l.useRef(s);l.useEffect(()=>{h.isDeepEqual(c,Y.current)&&h.isDeepEqual(s,ue.current)||P(c??s)},[c,s]),l.useEffect(()=>{M.current&&M.current.style.setProperty("--radix-slider-thumb-transform",Oo(d,p,g))},[M,d,p,g]);const Z=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:Z,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})},_))]})});ie.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(ie,{"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}})},ee={getHue:r=>Math.round(K(r).h),setHue:(r,t)=>{const{s:e,v:o}=K(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:ee,hsl:ee,hsv:ee,hex:ee},qo=r=>{const{className:t,style:e}=r,{colorSpace:o,color:a,onColorChange:s}=$("Hue"),c={srgb:{transparent:X({...a,a:0}),opaque:X({...a,a:1})},p3:{transparent:W({...a,a:0}),opaque:W({...a,a:1})}},i={srgb:X(ke(a)),p3:W(ke(a))},d=p=>{s({mode:"rgb",value:{...a,a:h.round(p[0]/100,2)}})};return n.jsx(ie,{"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:X(A({h:o,s:100,v:100,a:1})),p3:W(A({h:o,s:100,v:100,a:1}))},i={srgb:X(e.rgb),p3:W(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=ce;exports.Input=Se;exports.Label=ne;exports.Link=Ge;exports.Paragraph=Fe;exports.Popover=ro;exports.RadioGroup=Pt;exports.SegmentedControl=wt;exports.Select=At;exports.Slider=ie;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 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;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, jsxs as h, Fragment as Ve } from "react/jsx-runtime";
2
2
  import * as A from "react";
3
- import i, { useCallback as K, useId as ct, useState as ee, useRef as G, useMemo as Oe, useEffect as _e } from "react";
4
- import * as ie from "@radix-ui/react-tabs";
3
+ import i, { useCallback as Y, useId as ct, useState as re, useRef as G, useMemo as Oe, useEffect as _e } from "react";
4
+ import * as ce from "@radix-ui/react-tabs";
5
5
  import { cx as p, cva as V } from "class-variance-authority";
6
6
  import * as Be from "@radix-ui/react-toggle-group";
7
7
  import { Slot as Fe } from "@radix-ui/react-slot";
@@ -13,7 +13,7 @@ import * as U from "@radix-ui/react-popover";
13
13
  import * as H from "@radix-ui/react-tooltip";
14
14
  import * as B from "@radix-ui/react-dialog";
15
15
  import * as $ from "@radix-ui/react-alert-dialog";
16
- import { pipe as J, round as z, clamp as I, isDeepEqual as ze, pick as pt } from "remeda";
16
+ import { pipe as Q, round as z, clamp as I, isDeepEqual as ze, pick as pt } from "remeda";
17
17
  import dt from "@emmetio/math-expression";
18
18
  import Ge from "merge-props";
19
19
  import * as fe from "@radix-ui/react-slider";
@@ -32,27 +32,27 @@ function gt(r, t) {
32
32
  function He(...r) {
33
33
  return (t) => r.forEach((e) => gt(e, t));
34
34
  }
35
- function ce(...r) {
35
+ function pe(...r) {
36
36
  return A.useCallback(He(...r), r);
37
37
  }
38
38
  const Ue = i.forwardRef((r, t) => {
39
39
  const { className: e, ...o } = r;
40
- return /* @__PURE__ */ n(ie.Root, { ref: t, className: p(e, "fp-TabsRoot"), ...o });
40
+ return /* @__PURE__ */ n(ce.Root, { ref: t, className: p(e, "fp-TabsRoot"), ...o });
41
41
  }), qe = i.forwardRef((r, t) => {
42
42
  const { className: e, ...o } = r;
43
- return /* @__PURE__ */ n(ie.List, { ref: t, className: p(e, "fp-TabsList"), ...o });
43
+ return /* @__PURE__ */ n(ce.List, { ref: t, className: p(e, "fp-TabsList"), ...o });
44
44
  }), We = i.forwardRef((r, t) => {
45
45
  const { className: e, ...o } = r, a = mt(), s = He(t, a);
46
- return /* @__PURE__ */ n(ie.Trigger, { ref: s, className: p(e, "fp-TabsTrigger"), ...o });
46
+ return /* @__PURE__ */ n(ce.Trigger, { ref: s, className: p(e, "fp-TabsTrigger"), ...o });
47
47
  });
48
48
  function mt() {
49
- return K((r) => {
49
+ return Y((r) => {
50
50
  r !== null && (r.style.width = r.getBoundingClientRect().width + "px");
51
51
  }, []);
52
52
  }
53
53
  const Xe = i.forwardRef((r, t) => {
54
54
  const { className: e, ...o } = r;
55
- return /* @__PURE__ */ n(ie.Content, { ref: t, className: p(e, "fp-TabsContent"), ...o });
55
+ return /* @__PURE__ */ n(ce.Content, { ref: t, className: p(e, "fp-TabsContent"), ...o });
56
56
  });
57
57
  Ue.displayName = "Tabs.Root";
58
58
  qe.displayName = "Tabs.List";
@@ -64,7 +64,7 @@ const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
64
64
  List: qe,
65
65
  Root: Ue,
66
66
  Trigger: We
67
- }, Symbol.toStringTag, { value: "Module" })), pe = V("fp-Text", {
67
+ }, Symbol.toStringTag, { value: "Module" })), de = V("fp-Text", {
68
68
  variants: {
69
69
  size: {
70
70
  small: "fp-size-small",
@@ -90,7 +90,7 @@ const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
90
90
  e ? Fe : "span",
91
91
  {
92
92
  ref: t,
93
- className: pe({
93
+ className: de({
94
94
  className: o,
95
95
  size: a,
96
96
  weight: s,
@@ -108,7 +108,7 @@ const ye = i.forwardRef((r, t) => {
108
108
  "label",
109
109
  {
110
110
  ref: t,
111
- className: pe({
111
+ className: de({
112
112
  className: e,
113
113
  size: o,
114
114
  weight: a,
@@ -126,7 +126,7 @@ const ft = i.forwardRef((r, t) => {
126
126
  "p",
127
127
  {
128
128
  ref: t,
129
- className: pe({
129
+ className: de({
130
130
  className: e,
131
131
  size: o,
132
132
  weight: a,
@@ -145,7 +145,7 @@ const bt = i.forwardRef((r, t) => {
145
145
  {
146
146
  ref: t,
147
147
  className: p(
148
- pe({
148
+ de({
149
149
  className: o,
150
150
  size: a,
151
151
  weight: s,
@@ -229,7 +229,7 @@ const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
229
229
  Root: Ye,
230
230
  Text: Je
231
231
  }, Symbol.toStringTag, { value: "Module" }));
232
- function de(r, t) {
232
+ function ue(r, t) {
233
233
  const e = i.createContext(t);
234
234
  function o(s) {
235
235
  const { children: l, ...c } = s, d = i.useMemo(() => c, Object.values(c));
@@ -245,7 +245,7 @@ function de(r, t) {
245
245
  }
246
246
  return o.displayName = r + "Provider", [o, a];
247
247
  }
248
- const [Ct, Nt] = de("RadioGroup"), Qe = i.forwardRef((r, t) => {
248
+ const [Ct, Nt] = ue("RadioGroup"), Qe = i.forwardRef((r, t) => {
249
249
  const { orientation: e = "horizontal", disabled: o, className: a, ...s } = r;
250
250
  return /* @__PURE__ */ n(Ct, { orientation: e, disabled: o, children: /* @__PURE__ */ n(
251
251
  je.Root,
@@ -332,7 +332,7 @@ const tr = j({
332
332
  }), or = j({
333
333
  displayName: "ChevronDown",
334
334
  path: /* @__PURE__ */ n("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ n("path", { stroke: "var(--color-icon)", strokeLinecap: "round", d: "M9.87897 11.121L12 13.243L14.121 11.12" }) })
335
- }), ue = j({
335
+ }), ge = j({
336
336
  displayName: "Checkmark",
337
337
  viewBox: "0 0 16 16",
338
338
  path: /* @__PURE__ */ n(
@@ -352,11 +352,11 @@ const tr = j({
352
352
  displayName: "CheckmarkIndeterminate",
353
353
  viewBox: "0 0 16 16",
354
354
  path: /* @__PURE__ */ n("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" })
355
- }), [Pt, Re] = de("Checkbox"), nr = i.forwardRef((r, t) => {
355
+ }), [Pt, Re] = ue("Checkbox"), nr = i.forwardRef((r, t) => {
356
356
  const { className: e, id: o, ...a } = r, s = ct();
357
357
  return /* @__PURE__ */ n(Pt, { id: o ?? s, children: /* @__PURE__ */ n("div", { ref: t, className: p(e, "fp-CheckboxRoot"), ...a }) });
358
358
  }), sr = i.forwardRef((r, t) => {
359
- const { className: e, indeterminate: o, ...a } = r, { id: s } = Re("Input"), l = Tt(o), c = ce(t, l);
359
+ const { className: e, indeterminate: o, ...a } = r, { id: s } = Re("Input"), l = Tt(o), c = pe(t, l);
360
360
  return /* @__PURE__ */ h(Ve, { children: [
361
361
  /* @__PURE__ */ n(
362
362
  "input",
@@ -373,7 +373,7 @@ const tr = j({
373
373
  /* @__PURE__ */ n(lr, {})
374
374
  ] });
375
375
  }), lr = () => /* @__PURE__ */ h("span", { className: "fp-CheckboxIndicator", "aria-hidden": "true", children: [
376
- /* @__PURE__ */ n(ue, { className: "fp-CheckboxCheckmark", size: "4" }),
376
+ /* @__PURE__ */ n(ge, { className: "fp-CheckboxCheckmark", size: "4" }),
377
377
  /* @__PURE__ */ n(xt, { className: "fp-CheckboxIndeterminate", size: "4" })
378
378
  ] }), ir = i.forwardRef((r, t) => {
379
379
  const { className: e, ...o } = r, { id: a } = Re("Input");
@@ -402,7 +402,7 @@ const tr = j({
402
402
  );
403
403
  });
404
404
  function Tt(r) {
405
- return K(
405
+ return Y(
406
406
  (t) => {
407
407
  t && (t.indeterminate = !!r);
408
408
  },
@@ -436,7 +436,7 @@ const ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
436
436
  }), Pe = i.forwardRef((r, t) => {
437
437
  const { children: e, className: o, ...a } = r;
438
438
  return /* @__PURE__ */ h(w.Item, { ref: t, ...a, className: p(o, "fp-MenuItem fp-MenuCheckboxItem"), children: [
439
- /* @__PURE__ */ n(w.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ue, { size: "4" }) }),
439
+ /* @__PURE__ */ n(w.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ge, { size: "4" }) }),
440
440
  /* @__PURE__ */ n(w.ItemText, { children: e })
441
441
  ] });
442
442
  }), dr = i.forwardRef((r, t) => {
@@ -500,7 +500,7 @@ const ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
500
500
  }), wr = i.forwardRef((r, t) => {
501
501
  const { children: e, className: o, ...a } = r;
502
502
  return /* @__PURE__ */ h(N.CheckboxItem, { ref: t, ...a, className: p(o, "fp-MenuItem fp-MenuCheckboxItem"), children: [
503
- /* @__PURE__ */ n(N.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ue, { size: "4" }) }),
503
+ /* @__PURE__ */ n(N.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ge, { size: "4" }) }),
504
504
  e
505
505
  ] });
506
506
  }), Rr = i.forwardRef((r, t) => {
@@ -569,7 +569,7 @@ const ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
569
569
  }), $r = i.forwardRef((r, t) => {
570
570
  const { children: e, className: o, ...a } = r;
571
571
  return /* @__PURE__ */ h(y.CheckboxItem, { ref: t, ...a, className: p(o, "fp-MenuItem fp-MenuCheckboxItem"), children: [
572
- /* @__PURE__ */ n(y.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ue, { size: "4" }) }),
572
+ /* @__PURE__ */ n(y.ItemIndicator, { className: "fp-MenuItemIndicator", children: /* @__PURE__ */ n(ge, { size: "4" }) }),
573
573
  e
574
574
  ] });
575
575
  }), kr = i.forwardRef((r, t) => {
@@ -850,7 +850,7 @@ const la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
850
850
  Root: qt,
851
851
  Title: Ur,
852
852
  Trigger: jr
853
- }, Symbol.toStringTag, { value: "Module" })), [Yr, $e] = de(
853
+ }, Symbol.toStringTag, { value: "Module" })), [Yr, $e] = ue(
854
854
  "ValueFieldProvider",
855
855
  null
856
856
  ), R = i.forwardRef((r, t) => {
@@ -897,11 +897,11 @@ function E(r, t) {
897
897
  };
898
898
  }
899
899
  function Kt() {
900
- const [r, t] = ee(!0), e = K(() => {
900
+ const [r, t] = re(!0), e = Y(() => {
901
901
  t(!0);
902
- }, []), o = K(() => {
902
+ }, []), o = Y(() => {
903
903
  t(!1);
904
- }, []), a = K(
904
+ }, []), a = Y(
905
905
  (s) => {
906
906
  r && s.currentTarget.selectionStart === s.currentTarget.selectionEnd && (s.currentTarget.select(), t(!1));
907
907
  },
@@ -914,7 +914,7 @@ function Kt() {
914
914
  };
915
915
  }
916
916
  const Zr = i.forwardRef((r, t) => {
917
- const { type: e = "text", className: o, selectOnClick: a = !1, ...s } = r, l = G(null), c = ce(l, t), { onMouseLeave: d, onMouseUp: u, onFocus: g } = Kt(), f = a ? Ge({ onMouseLeave: d, onMouseUp: u, onFocus: g }, s) : s;
917
+ const { type: e = "text", className: o, selectOnClick: a = !1, ...s } = r, l = G(null), c = pe(l, t), { onMouseLeave: d, onMouseUp: u, onFocus: g } = Kt(), f = a ? Ge({ onMouseLeave: d, onMouseUp: u, onFocus: g }, s) : s;
918
918
  return /* @__PURE__ */ n("input", { ref: c, type: e, className: p(o, "fp-Input"), ...f });
919
919
  });
920
920
  Zr.displayName = "Input";
@@ -929,14 +929,14 @@ const Yt = 1, Zt = 10, ke = (r) => {
929
929
  formatter: c,
930
930
  disabled: d,
931
931
  ...u
932
- } = r, g = G(null), f = ce(e, g), [v, T] = ee(null), b = v ?? c.format(o), C = $e("ValueField"), S = (m) => {
932
+ } = r, g = G(null), f = pe(e, g), [v, T] = re(null), b = v ?? c.format(o), C = $e("ValueField"), S = (m) => {
933
933
  const P = c.parse(m, o);
934
934
  if (m.length === 0 || !P.valid || P.value === o)
935
935
  return M();
936
936
  T(null), a(P.value);
937
937
  }, M = () => {
938
938
  T(null);
939
- }, re = (m) => {
939
+ }, te = (m) => {
940
940
  T(m.currentTarget.value);
941
941
  }, X = (m) => {
942
942
  const P = m.currentTarget;
@@ -946,7 +946,7 @@ const Yt = 1, Zt = 10, ke = (r) => {
946
946
  if (!c.incrementBy)
947
947
  return;
948
948
  m.preventDefault();
949
- const te = c.parse(P.value, o), ge = te.valid ? te.value : o, oe = m.shiftKey ? l : s, D = m.key === "ArrowUp" ? oe : -oe, _ = c.getIncrementTargets ? c.getIncrementTargets(P) : null, me = c.incrementBy(ge, D, _);
949
+ const K = c.parse(P.value, o), oe = K.valid ? K.value : o, ae = m.shiftKey ? l : s, D = m.key === "ArrowUp" ? ae : -ae, _ = c.getIncrementTargets ? c.getIncrementTargets(P) : null, me = c.incrementBy(oe, D, _);
950
950
  S(c.format(me)), requestAnimationFrame(() => {
951
951
  if (_ && c.getIncrementSelection) {
952
952
  const [lt, it] = c.getIncrementSelection(_);
@@ -968,7 +968,7 @@ const Yt = 1, Zt = 10, ke = (r) => {
968
968
  selectOnClick: !0,
969
969
  className: p(t, "fp-ValueFieldBase"),
970
970
  value: b,
971
- onChange: re,
971
+ onChange: te,
972
972
  disabled: d || (C == null ? void 0 : C.disabled),
973
973
  ...Ge(u, { onBlur: O, onKeyDown: X })
974
974
  }
@@ -989,7 +989,7 @@ function Qt(r = {}) {
989
989
  try {
990
990
  return {
991
991
  valid: !0,
992
- value: J(
992
+ value: Q(
993
993
  u,
994
994
  (f) => to({
995
995
  expression: f,
@@ -1006,7 +1006,7 @@ function Qt(r = {}) {
1006
1006
  return { valid: !1 };
1007
1007
  }
1008
1008
  },
1009
- format: (u) => J(
1009
+ format: (u) => Q(
1010
1010
  u,
1011
1011
  I({ min: t, max: e }),
1012
1012
  c,
@@ -1208,7 +1208,7 @@ function oo(r) {
1208
1208
  }
1209
1209
  try {
1210
1210
  return {
1211
- value: J(
1211
+ value: Q(
1212
1212
  e,
1213
1213
  no,
1214
1214
  (a) => so(a, o),
@@ -1259,17 +1259,17 @@ function so(r, t) {
1259
1259
  throw new Error("Invalid hex substring");
1260
1260
  switch (r.length) {
1261
1261
  case 1:
1262
- return r.repeat(6) + ae(t.a);
1262
+ return r.repeat(6) + ne(t.a);
1263
1263
  case 2:
1264
- return r.repeat(3) + ae(t.a);
1264
+ return r.repeat(3) + ne(t.a);
1265
1265
  case 3:
1266
- return r.split("").map((e) => e.repeat(2)).join("") + ae(t.a);
1266
+ return r.split("").map((e) => e.repeat(2)).join("") + ne(t.a);
1267
1267
  case 4:
1268
1268
  return r.slice(0, 3).split("").map((e) => e.repeat(2)).join("") + r[3].repeat(2);
1269
1269
  case 5:
1270
1270
  return r.slice(0, 3).split("").map((e) => e.repeat(2)).join("") + r.slice(-2);
1271
1271
  case 6:
1272
- return r + ae(t.a);
1272
+ return r + ne(t.a);
1273
1273
  case 7:
1274
1274
  return r.slice(0, 6) + r[6].repeat(2);
1275
1275
  case 8:
@@ -1286,7 +1286,7 @@ function lo(r) {
1286
1286
  a: parseInt(r.substring(6, 8), 16) / 255
1287
1287
  };
1288
1288
  }
1289
- function ae(r) {
1289
+ function ne(r) {
1290
1290
  return Math.round(r * 255).toString(16);
1291
1291
  }
1292
1292
  const ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -1297,21 +1297,21 @@ const ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1297
1297
  Numeric: x,
1298
1298
  Root: R
1299
1299
  }, Symbol.toStringTag, { value: "Module" }));
1300
- function ne(r) {
1300
+ function se(r) {
1301
1301
  const t = z(r * 255, 0).toString(16);
1302
1302
  return t.length < 2 ? "0" + t : t;
1303
1303
  }
1304
- function le({ r, g: t, b: e, a: o }) {
1305
- const a = o < 1 ? ne(o) : "";
1306
- return "#" + ne(r) + ne(t) + ne(e) + a;
1304
+ function ie({ r, g: t, b: e, a: o }) {
1305
+ const a = o < 1 ? se(o) : "";
1306
+ return "#" + se(r) + se(t) + se(e) + a;
1307
1307
  }
1308
1308
  function io(r) {
1309
- return le(Ce(r));
1309
+ return ie(Ce(r));
1310
1310
  }
1311
1311
  function co(r) {
1312
- return le(L(r));
1312
+ return ie(L(r));
1313
1313
  }
1314
- function Q({ r, g: t, b: e, a: o }) {
1314
+ function ee({ r, g: t, b: e, a: o }) {
1315
1315
  const a = Math.max(r, t, e), s = a - Math.min(r, t, e), l = s ? a === r ? (t - e) / s : a === t ? 2 + (e - r) / s : 4 + (r - t) / s : 0;
1316
1316
  return {
1317
1317
  h: 60 * (l < 0 ? l + 6 : l),
@@ -1351,13 +1351,13 @@ function Ce(r) {
1351
1351
  return L(et(r));
1352
1352
  }
1353
1353
  function Ee(r) {
1354
- return rt(Q(r));
1354
+ return rt(ee(r));
1355
1355
  }
1356
- function Y(r) {
1356
+ function Z(r) {
1357
1357
  const t = z(r.r, 4), e = z(r.g, 4), o = z(r.b, 4), a = z(r.a, 2);
1358
1358
  return a < 1 ? `color(display-p3 ${t} ${e} ${o} / ${a})` : `color(display-p3 ${t} ${e} ${o})`;
1359
1359
  }
1360
- function Z(r) {
1360
+ function J(r) {
1361
1361
  const t = Math.round(r.r * 255), e = Math.round(r.g * 255), o = Math.round(r.b * 255), a = r.a;
1362
1362
  return a < 1 ? `rgb(${t} ${e} ${o} / ${a})` : `rgb(${t} ${e} ${o})`;
1363
1363
  }
@@ -1370,7 +1370,7 @@ function Le(r) {
1370
1370
  a: 1
1371
1371
  };
1372
1372
  }
1373
- const po = { r: 0, g: 0, b: 0, a: 1 }, uo = ["hex", "rgb", "hsl", "hsv"], [go, k] = de("ColorPicker"), mo = (r) => {
1373
+ const po = { r: 0, g: 0, b: 0, a: 1 }, uo = ["hex", "rgb", "hsl", "hsv"], [go, k] = ue("ColorPicker"), mo = (r) => {
1374
1374
  const {
1375
1375
  colorSpace: t,
1376
1376
  models: e = uo,
@@ -1391,11 +1391,11 @@ const po = { r: 0, g: 0, b: 0, a: 1 }, uo = ["hex", "rgb", "hsl", "hsv"], [go, k
1391
1391
  prop: a,
1392
1392
  defaultProp: o,
1393
1393
  onChange: s
1394
- }), [b, C] = ee({}), S = {
1395
- hsv: b.hsv ?? Q(g),
1394
+ }), [b, C] = re({}), S = {
1395
+ hsv: b.hsv ?? ee(g),
1396
1396
  hsl: b.hsl ?? Ee(g),
1397
1397
  rgb: b.rgb ?? g,
1398
- hex: b.hex ?? le(g)
1398
+ hex: b.hex ?? ie(g)
1399
1399
  }, M = S.hsv.h;
1400
1400
  return /* @__PURE__ */ n(
1401
1401
  go,
@@ -1409,9 +1409,9 @@ const po = { r: 0, g: 0, b: 0, a: 1 }, uo = ["hex", "rgb", "hsl", "hsv"], [go, k
1409
1409
  const { mode: O, value: m } = X;
1410
1410
  O === "rgb" ? (C({
1411
1411
  rgb: m,
1412
- hsv: Q(m),
1412
+ hsv: ee(m),
1413
1413
  hsl: Ee(m),
1414
- hex: le(m)
1414
+ hex: ie(m)
1415
1415
  }), f(m)) : O === "hsv" ? (C({
1416
1416
  hsv: m,
1417
1417
  hsl: rt(m),
@@ -1461,16 +1461,16 @@ const bo = 2, ho = 0, Co = 100, No = "horizontal", yo = "ltr", De = i.forwardRef
1461
1461
  baseValue: b,
1462
1462
  hints: C,
1463
1463
  ...S
1464
- } = r, M = G(null), re = ce(M, t), { onPointerDown: X, focusVisible: O } = xo(M), [m, P] = ee(l ?? s), te = G(l), ge = G(s);
1464
+ } = r, M = G(null), te = pe(M, t), { onPointerDown: X, focusVisible: O } = xo(M), [m, P] = re(l ?? s), K = G(l), oe = G(s);
1465
1465
  _e(() => {
1466
- ze(l, te.current) && ze(s, ge.current) || P(l ?? s);
1466
+ ze(l, K.current) && ze(s, oe.current) || (P(l ?? s), K.current = l, oe.current = s);
1467
1467
  }, [l, s]), _e(() => {
1468
1468
  M.current && M.current.style.setProperty(
1469
1469
  "--radix-slider-thumb-transform",
1470
1470
  vo(d, u, g)
1471
1471
  );
1472
1472
  }, [M, d, u, g]);
1473
- const oe = (D) => {
1473
+ const ae = (D) => {
1474
1474
  const _ = D.map((me) => Po(me, C, o, a));
1475
1475
  c == null || c(_), P(_);
1476
1476
  };
@@ -1478,10 +1478,10 @@ const bo = 2, ho = 0, Co = 100, No = "horizontal", yo = "ltr", De = i.forwardRef
1478
1478
  fe.Root,
1479
1479
  {
1480
1480
  tabIndex: -1,
1481
- ref: re,
1481
+ ref: te,
1482
1482
  className: p(e, "fp-SliderRoot"),
1483
1483
  value: m,
1484
- onValueChange: oe,
1484
+ onValueChange: ae,
1485
1485
  onPointerDown: X,
1486
1486
  min: o,
1487
1487
  max: a,
@@ -1597,7 +1597,7 @@ function vo(r, t, e) {
1597
1597
  }[r][o];
1598
1598
  }
1599
1599
  function xo(r) {
1600
- const [t, e] = ee(!1), o = () => {
1600
+ const [t, e] = re(!1), o = () => {
1601
1601
  var s;
1602
1602
  e(!1), window.removeEventListener("pointerup", o), (s = r.current) == null || s.focus();
1603
1603
  };
@@ -1627,10 +1627,10 @@ const To = (r) => {
1627
1627
  style: { "--slider-thumb-bg": g, ...e }
1628
1628
  }
1629
1629
  );
1630
- }, se = {
1631
- getHue: (r) => Math.round(Q(r).h),
1630
+ }, le = {
1631
+ getHue: (r) => Math.round(ee(r).h),
1632
1632
  setHue: (r, t) => {
1633
- const { s: e, v: o } = Q(r);
1633
+ const { s: e, v: o } = ee(r);
1634
1634
  return L({ h: t, s: e, v: o, a: r.a });
1635
1635
  },
1636
1636
  getThumbColor: (r, t) => {
@@ -1638,23 +1638,23 @@ const To = (r) => {
1638
1638
  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)})`;
1639
1639
  }
1640
1640
  }, So = {
1641
- rgb: se,
1642
- hsl: se,
1643
- hsv: se,
1644
- hex: se
1641
+ rgb: le,
1642
+ hsl: le,
1643
+ hsv: le,
1644
+ hex: le
1645
1645
  }, Mo = (r) => {
1646
1646
  const { className: t, style: e } = r, { colorSpace: o, color: a, onColorChange: s } = k("Hue"), l = {
1647
1647
  srgb: {
1648
- transparent: Z({ ...a, a: 0 }),
1649
- opaque: Z({ ...a, a: 1 })
1648
+ transparent: J({ ...a, a: 0 }),
1649
+ opaque: J({ ...a, a: 1 })
1650
1650
  },
1651
1651
  p3: {
1652
- transparent: Y({ ...a, a: 0 }),
1653
- opaque: Y({ ...a, a: 1 })
1652
+ transparent: Z({ ...a, a: 0 }),
1653
+ opaque: Z({ ...a, a: 1 })
1654
1654
  }
1655
1655
  }, c = {
1656
- srgb: Z(Le(a)),
1657
- p3: Y(Le(a))
1656
+ srgb: J(Le(a)),
1657
+ p3: Z(Le(a))
1658
1658
  }, d = (u) => {
1659
1659
  s({ mode: "rgb", value: { ...a, a: z(u[0] / 100, 2) } });
1660
1660
  };
@@ -1681,11 +1681,11 @@ const To = (r) => {
1681
1681
  );
1682
1682
  }, Io = 8, $o = (r) => {
1683
1683
  const { onColorChange: t, colorsByModel: e, hue: o, colorSpace: a, activeModel: s } = k("ColorPicker.Area"), l = {
1684
- srgb: Z(L({ h: o, s: 100, v: 100, a: 1 })),
1685
- p3: Y(L({ h: o, s: 100, v: 100, a: 1 }))
1684
+ srgb: J(L({ h: o, s: 100, v: 100, a: 1 })),
1685
+ p3: Z(L({ h: o, s: 100, v: 100, a: 1 }))
1686
1686
  }, c = {
1687
- srgb: Z(e.rgb),
1688
- p3: Y(e.rgb)
1687
+ srgb: J(e.rgb),
1688
+ p3: Z(e.rgb)
1689
1689
  }, d = ko(e, s), u = G(null), { size: g } = Do(u), f = (b) => {
1690
1690
  t(s === "hsl" ? {
1691
1691
  mode: "hsl",
@@ -1699,8 +1699,8 @@ const To = (r) => {
1699
1699
  return;
1700
1700
  const C = b.currentTarget.getBoundingClientRect();
1701
1701
  f({
1702
- x: J(b.clientX - C.x, E([0, g], [0, 100]), I({ min: 0, max: 100 })),
1703
- y: J(
1702
+ x: Q(b.clientX - C.x, E([0, g], [0, 100]), I({ min: 0, max: 100 })),
1703
+ y: Q(
1704
1704
  b.clientY - C.y - Io,
1705
1705
  E([0, g], [0, 100]),
1706
1706
  I({ min: 0, max: 100 })
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.18",
5
+ "version": "1.0.0-beta.19",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",