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

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/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ > [!NOTE]
2
+ > Figma Kit is currently in beta. There may be breaking changes before the final release.
3
+
1
4
  <div align="center">
2
5
  <a href="https://storybook.figma-kit.dev" target="_blank">
3
6
  <picture>
@@ -9,12 +12,9 @@
9
12
  <h3>A set of React components for building Figma plugins.</h3>
10
13
  </div>
11
14
 
12
- > [!NOTE]
13
- > Figma Kit is currently in beta. There may be breaking changes before the final release.
14
-
15
15
  ### Overview
16
16
 
17
- Figma Kit is an extensive set of React components that attempts to replicate Figma's user interface look & feel with near-100% feature parity.
17
+ Figma Kit is an extensive collection of React components that attempts to replicate Figma's user interface look & feel with near-100% feature parity.
18
18
 
19
19
  #### Features
20
20
 
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),ro=require("@radix-ui/react-tabs"),p=require("class-variance-authority"),no=require("@radix-ui/react-toggle-group"),De=require("@radix-ui/react-slot"),ao=require("@radix-ui/react-radio-group"),so=require("@radix-ui/react-select"),lo=require("@radix-ui/react-dropdown-menu"),co=require("@radix-ui/react-context-menu"),io=require("@radix-ui/react-popover"),po=require("@radix-ui/react-tooltip"),uo=require("@radix-ui/react-dialog"),fo=require("@radix-ui/react-alert-dialog"),h=require("remeda"),mo=require("@emmetio/math-expression"),ke=require("merge-props"),go=require("@radix-ui/react-slider"),xo=require("@radix-ui/react-collapsible"),ho=require("react-textarea-autosize"),bo=require("@radix-ui/react-switch");function v(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const k=v(l),oe=v(ro),ze=v(no),Ae=v(ao),R=v(so),C=v(lo),N=v(co),F=v(io),B=v(po),V=v(uo),I=v(fo),de=v(go),xe=v(xo),Ie=v(bo);/**
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);/**
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 Co(t,o){typeof t=="function"?t(o):t!=null&&(t.current=o)}function Ee(...t){return o=>t.forEach(e=>Co(e,o))}function re(...t){return k.useCallback(Ee(...t),t)}const Le=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(oe.Root,{ref:o,className:p.cx(e,"fp-TabsRoot"),...r})}),Oe=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(oe.List,{ref:o,className:p.cx(e,"fp-TabsList"),...r})}),Ve=l.forwardRef((t,o)=>{const{className:e,...r}=t,n=No(),s=Ee(o,n);return a.jsx(oe.Trigger,{ref:s,className:p.cx(e,"fp-TabsTrigger"),...r})});function No(){return l.useCallback(t=>{t!==null&&(t.style.width=t.getBoundingClientRect().width+"px")},[])}const Be=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(oe.Content,{ref:o,className:p.cx(e,"fp-TabsContent"),...r})});Le.displayName="Tabs.Root";Oe.displayName="Tabs.List";Ve.displayName="Tabs.Trigger";Be.displayName="Tabs.Content";const Ro=Object.freeze(Object.defineProperty({__proto__:null,Content:Be,List:Oe,Root:Le,Trigger:Ve},Symbol.toStringTag,{value:"Module"})),ne=p.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((t,o)=>{const{asChild:e,className:r,size:n,weight:s,align:c,block:i,...u}=t,d=e?De.Slot:"span";return a.jsx(d,{ref:o,className:ne({className:r,size:n,weight:s,align:c,block:i}),...u})});E.displayName="Text";const ae=l.forwardRef((t,o)=>{const{className:e,size:r,weight:n,align:s,block:c,...i}=t;return a.jsx("label",{ref:o,className:ne({className:e,size:r,weight:n,align:s,block:c}),...i})});ae.displayName="Label";const Fe=l.forwardRef((t,o)=>{const{className:e,size:r,weight:n,align:s,block:c,...i}=t;return a.jsx("p",{ref:o,className:ne({className:e,size:r,weight:n,align:s,block:c}),...i})});Fe.displayName="Paragraph";const Ge=l.forwardRef((t,o)=>{const{asChild:e,className:r,size:n,weight:s,align:c,block:i,...u}=t,d=e?De.Slot:"a";return a.jsx(d,{ref:o,className:p.cx(ne({className:r,size:n,weight:s,align:c,block:i}),"fp-Link"),...u})});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 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";/**
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 He(t){const o=k.useRef(t);return k.useEffect(()=>{o.current=t}),k.useMemo(()=>(...e)=>{var r;return(r=o.current)==null?void 0:r.call(o,...e)},[])}function me({prop:t,defaultProp:o,onChange:e=()=>{}}){const[r,n]=yo({defaultProp:o,onChange:e}),s=t!==void 0,c=s?t:r,i=He(e),u=k.useCallback(d=>{if(s){const g=typeof d=="function"?d(t):d;g!==t&&i(g)}else n(d)},[s,t,n,i]);return[c,u]}function yo({defaultProp:t,onChange:o}){const e=k.useState(t),[r]=e,n=k.useRef(r),s=He(o);return k.useEffect(()=>{n.current!==r&&(s(r),n.current=r)},[r,n,s]),e}const Ue=l.forwardRef((t,o)=>{const{className:e,fullWidth:r,value:n,defaultValue:s,onValueChange:c,...i}=t,[u,d]=me({prop:n,defaultProp:s,onChange:c});return a.jsx(ze.Root,{ref:o,className:p.cx(e,"fp-SegmentedControlRoot",{"fp-full-width":r}),...i,type:"single",value:u,onValueChange:f=>{f&&d(f)}})}),qe=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(ze.Item,{ref:o,className:p.cx(e,"fp-SegmentedControlItem"),...r})}),We=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(E,{ref:o,className:p.cx(e,"fp-SegmentedControlText"),...r})});Ue.displayName="SegmentedControl.Root";qe.displayName="SegmentedControl.Item";We.displayName="SegmentedControl.Text";const jo=Object.freeze(Object.defineProperty({__proto__:null,Item:qe,Root:Ue,Text:We},Symbol.toStringTag,{value:"Module"}));function se(t,o){const e=l.createContext(o);function r(s){const{children:c,...i}=s,u=l.useMemo(()=>i,Object.values(i));return a.jsx(e.Provider,{value:u,children:c})}function n(s){const c=l.useContext(e);if(c)return c;if(o!==void 0)return o;throw new Error(`\`${s}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,n]}const[wo,vo]=se("RadioGroup"),Xe=l.forwardRef((t,o)=>{const{orientation:e="horizontal",disabled:r,className:n,...s}=t;return a.jsx(wo,{orientation:e,disabled:r,children:a.jsx(Ae.Root,{ref:o,orientation:e,disabled:r,className:p.cx(n,"fp-RadioGroupRoot"),...s})})}),Ke=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(Ae.Item,{ref:o,className:p.cx(e,"fp-RadioGroupItem"),...r})}),Ye=l.forwardRef((t,o)=>{const{orientation:e,disabled:r}=vo("Label"),{className:n,...s}=t;return a.jsx(ae,{ref:o,className:p.cx(n,"fp-RadioGroupLabel"),"data-orientation":e,"data-disabled":r?"":void 0,...s})});Xe.displayName="RadioGroup.Root";Ke.displayName="RadioGroup.Item";Ye.displayName="RadioGroup.Label";const Po=Object.freeze(Object.defineProperty({__proto__:null,Item:Ke,Label:Ye,Root:Xe},Symbol.toStringTag,{value:"Module"})),So="6",To="0 0 24 24",Mo=p.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:So}});function L(t){const{path:o,viewBox:e=To,displayName:r}=t,n=l.forwardRef((s,c)=>{const{size:i,className:u,...d}=s;return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",ref:c,viewBox:e,className:Mo({className:u,size:i}),fill:"none",...d,children:o})});return n.displayName=r||"Icon",n}const Ze=L({displayName:"Close",path:a.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",strokeLinejoin:"round",d:"M17 7 7 17M7 7l10 10"})}),he=L({displayName:"ChevronRight",path:a.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M11.121 14.121L13.243 12L11.12 9.879"})}),Io=L({displayName:"ChevronUp",path:a.jsx("path",{stroke:"var(--color-icon)",strokeLinecap:"round",d:"M14.121 12.879L12 10.757L9.87903 12.88"})}),Je=L({displayName:"ChevronDown",path:a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.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:a.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:a.jsx("circle",{fill:"var(--color-icon)",cx:"8",cy:"8",r:"3"})}),$o=L({displayName:"CheckmarkIndeterminate",viewBox:"0 0 16 16",path:a.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"})}),[_o,be]=se("Checkbox"),et=l.forwardRef((t,o)=>{const{className:e,id:r,...n}=t,s=l.useId(),c=r??s;return a.jsx(_o,{id:c,children:a.jsx("div",{ref:o,className:p.cx(e,"fp-CheckboxRoot"),...n})})}),tt=l.forwardRef((t,o)=>{const{className:e,indeterminate:r,...n}=t,{id:s}=be("Input"),c=Do(r),i=re(o,c);return a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:i,className:p.cx(e,"fp-CheckboxInput"),id:s,"aria-labelledby":`checkbox-label-${s}`,"aria-describedby":`checkbox-description-${s}`,...n,type:"checkbox"}),a.jsx(ot,{})]})}),ot=()=>a.jsxs("span",{className:"fp-CheckboxIndicator","aria-hidden":"true",children:[a.jsx(le,{className:"fp-CheckboxCheckmark",size:"4"}),a.jsx($o,{className:"fp-CheckboxIndeterminate",size:"4"})]}),rt=l.forwardRef((t,o)=>{const{className:e,...r}=t,{id:n}=be("Input");return a.jsx(ae,{"aria-hidden":"true",ref:o,className:p.cx(e,"fp-CheckboxLabel"),htmlFor:n,id:`checkbox-label-${n}`,...r})}),nt=l.forwardRef((t,o)=>{const{className:e,...r}=t,{id:n}=be("Description");return a.jsx(E,{"aria-hidden":"true",ref:o,className:p.cx(e,"fp-CheckboxDescription"),id:`checkbox-description-${n}`,...r})});function Do(t){return l.useCallback(o=>{o&&(o.indeterminate=!!t)},[t])}et.displayName="Checkbox.Root";tt.displayName="Checkbox.Input";ot.displayName="Checkbox.Indicator";rt.displayName="Checkbox.Label";nt.displayName="Checkbox.Description";const ko=Object.freeze(Object.defineProperty({__proto__:null,Description:nt,Input:tt,Label:rt,Root:et},Symbol.toStringTag,{value:"Module"})),at=R.Root,zo=R.Arrow,Ce=l.forwardRef((t,o)=>{const{placeholder:e,className:r,...n}=t;return a.jsxs(R.Trigger,{ref:o,...n,className:p.cx(r,"fp-SelectTrigger"),children:[a.jsx(R.Value,{placeholder:e}),a.jsx(R.Icon,{className:"fp-SelectTriggerIcon",children:a.jsx(Je,{})})]})}),Ne=l.forwardRef((t,o)=>{const{children:e,portal:r=!1,className:n,...s}=t,c=r?R.Portal:l.Fragment;return a.jsx(c,{children:a.jsxs(R.Content,{ref:o,...s,className:p.cx(n,"fp-MenuContent"),children:[a.jsx(R.ScrollUpButton,{className:"fp-SelectScrollUpButton",children:a.jsx(Io,{})}),a.jsx(R.Viewport,{children:e}),a.jsx(R.ScrollDownButton,{className:"fp-SelectScrollDownButton",children:a.jsx(Je,{})})]})})}),Re=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(R.Item,{ref:o,...n,className:p.cx(r,"fp-MenuItem fp-MenuCheckboxItem"),children:[a.jsx(R.ItemIndicator,{className:"fp-MenuItemIndicator",children:a.jsx(le,{size:"4"})}),a.jsx(R.ItemText,{children:e})]})}),st=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(R.Separator,{ref:o,className:p.cx(e,"fp-MenuSeparator"),...r})}),lt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(R.Label,{ref:o,className:p.cx(e,"fp-MenuLabel"),...r})}),ct=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(R.Group,{ref:o,className:p.cx(e,"fp-MenuGroup"),...r})});Ce.displayName="Select.Trigger";Ne.displayName="Select.Content";Re.displayName="Select.Item";st.displayName="Select.Separator";ct.displayName="Select.Group";lt.displayName="Select.Label";const Ao=Object.freeze(Object.defineProperty({__proto__:null,Arrow:zo,Content:Ne,Group:ct,Item:Re,Label:lt,Root:at,Separator:st,Trigger:Ce},Symbol.toStringTag,{value:"Module"})),Eo=C.Root,Lo=C.Trigger,Oo=C.Sub,Vo=C.RadioGroup,it=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx(C.Portal,{children:a.jsx(C.Content,{ref:o,sideOffset:6,...n,className:p.cx(r,"fp-MenuContent"),children:e})})}),pt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(C.Item,{ref:o,...r,className:p.cx(e,"fp-MenuItem")})}),ut=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(C.Separator,{ref:o,className:p.cx(e,"fp-MenuSeparator"),...r})}),dt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(C.Label,{ref:o,className:p.cx(e,"fp-MenuLabel"),...r})}),ft=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(C.Group,{ref:o,className:p.cx(e,"fp-MenuGroup"),...r})}),mt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(C.SubTrigger,{ref:o,...n,className:p.cx(r,"fp-MenuItem"),children:[e,a.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),gt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(C.Portal,{children:a.jsx(C.SubContent,{ref:o,...r,className:p.cx(e,"fp-MenuContent"),sideOffset:12})})}),xt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(C.CheckboxItem,{ref:o,...n,className:p.cx(r,"fp-MenuItem fp-MenuCheckboxItem"),children:[a.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:a.jsx(le,{size:"4"})}),e]})}),ht=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(C.RadioItem,{ref:o,...n,className:p.cx(r,"fp-MenuItem fp-MenuRadioItem"),children:[a.jsx(C.ItemIndicator,{className:"fp-MenuItemIndicator",children:a.jsx(Qe,{size:"4"})}),e]})});it.displayName="DropdownMenu.Content";pt.displayName="DropdownMenu.Item";ut.displayName="DropdownMenu.Separator";ft.displayName="DropdownMenu.Group";dt.displayName="DropdownMenu.Label";mt.displayName="DropdownMenu.SubTrigger";gt.displayName="DropdownMenu.SubContent";xt.displayName="DropdownMenu.CheckboxItem";ht.displayName="DropdownMenu.RadioItem";const Bo=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:xt,Content:it,Group:ft,Item:pt,Label:dt,RadioGroup:Vo,RadioItem:ht,Root:Eo,Separator:ut,Sub:Oo,SubContent:gt,SubTrigger:mt,Trigger:Lo},Symbol.toStringTag,{value:"Module"})),Fo=N.Root,Go=N.Trigger,Ho=N.Sub,Uo=N.RadioGroup,bt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx(N.Portal,{children:a.jsx(N.Content,{ref:o,...n,className:p.cx(r,"fp-MenuContent"),children:e})})}),Ct=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(N.Item,{ref:o,...r,className:p.cx(e,"fp-MenuItem")})}),Nt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(N.Separator,{ref:o,className:p.cx(e,"fp-MenuSeparator"),...r})}),Rt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(N.Label,{ref:o,className:p.cx(e,"fp-MenuLabel"),...r})}),yt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(N.Group,{ref:o,className:p.cx(e,"fp-MenuGroup"),...r})}),jt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(N.SubTrigger,{ref:o,...n,className:p.cx(r,"fp-MenuItem"),children:[e,a.jsx(he,{className:"fp-MenuSubtriggerCaret"})]})}),wt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(N.Portal,{children:a.jsx(N.SubContent,{ref:o,...r,className:p.cx(e,"fp-MenuContent"),sideOffset:12})})}),vt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(N.CheckboxItem,{ref:o,...n,className:p.cx(r,"fp-MenuItem fp-MenuCheckboxItem"),children:[a.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:a.jsx(le,{size:"4"})}),e]})}),Pt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsxs(N.RadioItem,{ref:o,...n,className:p.cx(r,"fp-MenuItem fp-MenuRadioItem"),children:[a.jsx(N.ItemIndicator,{className:"fp-MenuItemIndicator",children:a.jsx(Qe,{size:"4"})}),e]})});bt.displayName="ContextMenu.Content";Ct.displayName="ContextMenu.Item";Nt.displayName="ContextMenu.Separator";Rt.displayName="ContextMenu.Label";yt.displayName="ContextMenu.Group";jt.displayName="ContextMenu.SubTrigger";wt.displayName="ContextMenu.SubContent";vt.displayName="ContextMenu.CheckboxItem";Pt.displayName="ContextMenu.RadioItem";const qo=Object.freeze(Object.defineProperty({__proto__:null,CheckboxItem:vt,Content:bt,Group:yt,Item:Ct,Label:Rt,RadioGroup:Uo,RadioItem:Pt,Root:Fo,Separator:Nt,Sub:Ho,SubContent:wt,SubTrigger:jt,Trigger:Go},Symbol.toStringTag,{value:"Module"})),{TooltipProvider:Wo}=B,Xo=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(B.Content,{ref:o,className:p.cx(e,"fp-tooltip"),...r})}),Ko=t=>{const{className:o,...e}=t;return a.jsx(B.Arrow,{className:p.cx(o,"fp-tooltip-arrow"),...e})},ye=l.forwardRef((t,o)=>{const{defaultOpen:e,open:r,onOpenChange:n,delayDuration:s,disableHoverableContent:c,container:i,forceMount:u,children:d,content:f,...g}=t,j={open:r,defaultOpen:e,onOpenChange:n,delayDuration:s,disableHoverableContent:c};return a.jsxs(B.Root,{...j,children:[a.jsx(B.Trigger,{asChild:!0,children:d}),a.jsx(B.Portal,{forceMount:u,container:i,children:a.jsxs(Xo,{ref:o,arrowPadding:10,...g,children:[f,a.jsx(Ko,{})]})})]})});ye.displayName="Tooltip";const Yo=p.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((t,o)=>{const{className:e,size:r,activeAppearance:n,"aria-label":s,tooltipContent:c,disableTooltip:i,...u}=t,d=a.jsx("button",{ref:o,className:Yo({className:e,size:r,activeAppearance:n}),"aria-label":s,...u});return i?d:a.jsx(ye,{content:c??s,children:d})});ce.displayName="IconButton";const je=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx("header",{ref:o,className:p.cx(r,"fp-DialogBaseHeader"),...n,children:e})}),we=l.forwardRef((t,o)=>{const{className:e,size:r,...n}=t;return a.jsx("div",{ref:o,className:Zo({className:e,size:r}),...n})}),ve=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx("div",{ref:o,className:p.cx(e,"fp-DialogBaseControls"),...r})}),Zo=p.cva("fp-DialogBaseSection",{variants:{size:{base:"fp-DialogBaseSection-base",small:"fp-DialogBaseSection-small"}},defaultVariants:{size:"base"}});je.displayName="Dialog.Header";we.displayName="Dialog.Section";ve.displayName="Dialog.Controls";const Jo=F.Root,Qo=F.Anchor,er=F.Portal,St=l.forwardRef((t,o)=>a.jsx(F.Trigger,{ref:o,...t,asChild:!0})),Tt=l.forwardRef((t,o)=>{const{className:e,style:r,width:n,height:s,maxWidth:c,maxHeight:i,...u}=t;return a.jsx(F.Content,{ref:o,className:p.cx(e,"fp-DialogBaseContent"),style:{...r,width:n,height:s,maxWidth:c,maxHeight:i},...u})}),Mt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(E,{ref:o,className:p.cx(e,"fp-DialogBaseTitle"),weight:"strong",...r})}),It=l.forwardRef((t,o)=>{const{children:e,...r}=t;return a.jsx(F.Close,{ref:o,asChild:!0,...r,children:e||a.jsx(ce,{"aria-label":"Close",disableTooltip:!0,children:a.jsx(Ze,{})})})});St.displayName="Popover.Trigger";Tt.displayName="Popover.Content";Mt.displayName="Popover.Title";It.displayName="Popover.Close";const tr=Object.freeze(Object.defineProperty({__proto__:null,Anchor:Qo,Close:It,Content:Tt,Controls:ve,Header:je,Portal:er,Root:Jo,Section:we,Title:Mt,Trigger:St},Symbol.toStringTag,{value:"Module"})),or=V.Root,rr=V.Portal,$t=l.forwardRef((t,o)=>a.jsx(V.Trigger,{ref:o,...t,asChild:!0})),nr=p.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"}}),_t=l.forwardRef((t,o)=>{const{children:e,className:r,size:n,placement:s,style:c,width:i,height:u,maxWidth:d,maxHeight:f,...g}=t;return a.jsx(V.Content,{ref:o,className:nr({className:r,size:n,placement:s}),"aria-describedby":void 0,style:{...c,width:i,height:u,maxWidth:d,maxHeight:f},...g,children:e})}),Dt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(V.Overlay,{ref:o,className:p.cx(e,"fp-DialogBaseOverlay"),...r})}),kt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx(V.Title,{ref:o,className:p.cx(r,"fp-DialogBaseTitle"),...n,asChild:!0,children:a.jsx(E,{weight:"strong",children:e})})}),zt=l.forwardRef((t,o)=>{const{children:e,...r}=t;return a.jsx(V.Close,{ref:o,asChild:!0,...r,children:e||a.jsx(ce,{"aria-label":"Close",disableTooltip:!0,children:a.jsx(Ze,{})})})});$t.displayName="Dialog.Trigger";_t.displayName="Dialog.Content";Dt.displayName="Dialog.Overlay";kt.displayName="Dialog.Title";zt.displayName="Dialog.Close";const ar=Object.freeze(Object.defineProperty({__proto__:null,Close:zt,Content:_t,Controls:ve,Header:je,Overlay:Dt,Portal:rr,Root:or,Section:we,Title:kt,Trigger:$t},Symbol.toStringTag,{value:"Module"})),sr=I.Root,lr=I.Portal,At=l.forwardRef((t,o)=>a.jsx(I.Trigger,{ref:o,...t,asChild:!0})),cr=p.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"}}),Et=l.forwardRef((t,o)=>{const{className:e,size:r,placement:n,style:s,width:c,height:i,maxWidth:u,maxHeight:d,...f}=t;return a.jsx(I.Content,{ref:o,className:cr({className:e,size:r,placement:n}),style:{...s,width:c,height:i,maxWidth:u,maxHeight:d},...f})}),Lt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(I.Overlay,{ref:o,className:p.cx(e,"fp-DialogBaseOverlay"),...r})}),Ot=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx(I.Title,{ref:o,className:p.cx(r,"fp-AlertDialogTitle"),...n,asChild:!0,children:a.jsx(E,{weight:"strong",children:e})})}),Vt=l.forwardRef((t,o)=>{const{children:e,className:r,...n}=t;return a.jsx(I.Description,{ref:o,className:p.cx(r,"fp-AlertDialogDescription"),...n,asChild:!0,children:a.jsx(E,{children:e})})}),Bt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx("div",{ref:o,className:p.cx(e,"fp-AlertDialogActions"),...r})}),Ft=l.forwardRef((t,o)=>a.jsx(I.Cancel,{ref:o,asChild:!0,...t})),Gt=l.forwardRef((t,o)=>a.jsx(I.Action,{ref:o,asChild:!0,...t}));At.displayName="AlertDialog.Trigger";Et.displayName="AlertDialog.Content";Lt.displayName="AlertDialog.Overlay";Ot.displayName="AlertDialog.Title";Vt.displayName="AlertDialog.Description";Bt.displayName="AlertDialog.Actions";Ft.displayName="AlertDialog.Cancel";Gt.displayName="AlertDialog.Action";const ir=Object.freeze(Object.defineProperty({__proto__:null,Action:Gt,Actions:Bt,Cancel:Ft,Content:Et,Description:Vt,Overlay:Lt,Portal:lr,Root:sr,Title:Ot,Trigger:At},Symbol.toStringTag,{value:"Module"})),[Ht,Pe]=se("ValueFieldProvider",null),y=l.forwardRef((t,o)=>{const{className:e,disabled:r,...n}=t,s=Pe("Root");return a.jsx(Ht,{disabled:r,children:a.jsx("label",{ref:o,className:p.cx(e,"fp-ValueFieldRoot"),"data-disabled":r||s!=null&&s.disabled?"":void 0,...n})})}),G=l.forwardRef((t,o)=>{const{className:e,disabled:r,...n}=t;return a.jsx(Ht,{disabled:r,children:a.jsx("div",{ref:o,className:p.cx(e,"fp-ValueFieldMulti"),"data-disabled":r?"":void 0,...n})})}),H=l.forwardRef((t,o)=>{const{className:e,...r}=t,n=Pe("Root");return a.jsx("span",{ref:o,className:p.cx(e,"fp-ValueFieldLabel"),"data-disabled":n!=null&&n.disabled?"":void 0,...r})});y.displayName="ValueField.Root";H.displayName="ValueField.Label";G.displayName="ValueField.Multi";function z(t,o){const[e,r]=t,[n,s]=o;return function(c){return e===r||n===s?n:(c-e)/(r-e)*(s-n)+n}}function pr(){const[t,o]=l.useState(!0),e=l.useCallback(()=>{o(!0)},[]),r=l.useCallback(()=>{o(!1)},[]),n=l.useCallback(s=>{t&&s.currentTarget.selectionStart===s.currentTarget.selectionEnd&&(s.currentTarget.select(),o(!1))},[t]);return{onMouseLeave:r,onMouseUp:n,onFocus:e}}const Se=l.forwardRef((t,o)=>{const{type:e="text",className:r,selectOnClick:n=!1,...s}=t,c=l.useRef(null),i=re(c,o),{onMouseLeave:u,onMouseUp:d,onFocus:f}=pr(),g=n?ke({onMouseLeave:u,onMouseUp:d,onFocus:f},s):s;return a.jsx("input",{ref:i,type:e,className:p.cx(r,"fp-Input"),...g})});Se.displayName="Input";const ur=1,dr=10,Te=t=>{const{className:o,inputRef:e,value:r,onChange:n,smallNudge:s=ur,bigNudge:c=dr,formatter:i,disabled:u,...d}=t,f=l.useRef(null),g=re(e,f),[j,S]=l.useState(null),x=j??i.format(r),b=Pe("ValueField"),T=m=>{const P=i.parse(m,r);if(m.length===0||!P.valid||P.value===r)return M();S(null),n(P.value)},M=()=>{S(null)},U=m=>{S(m.currentTarget.value)},q=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,r),pe=Y.valid?Y.value:r,Z=m.shiftKey?c:s,_=m.key==="ArrowUp"?Z:-Z,D=i.getIncrementTargets?i.getIncrementTargets(P):null,ue=i.incrementBy(pe,_,D);T(i.format(ue)),requestAnimationFrame(()=>{if(D&&i.getIncrementSelection){const[to,oo]=i.getIncrementSelection(D);P.setSelectionRange(to,oo)}else P.select()})}},O=m=>{T(m.currentTarget.value)};return a.jsx(Se,{ref:g,dir:"auto",autoComplete:"off",spellCheck:"false",selectOnClick:!0,className:p.cx(o,"fp-ValueFieldBase"),value:x,onChange:U,disabled:u||(b==null?void 0:b.disabled),...ke(d,{onBlur:O,onKeyDown:q})})};Te.displayName="ValueField.Base";const fr=15,w=l.forwardRef((t,o)=>{const{value:e,onChange:r,min:n,max:s,targetRange:c,precision:i,suffix:u,allowedUnits:d,...f}=t,g=l.useMemo(()=>mr({min:n,max:s,precision:i,targetRange:c,suffix:u,allowedUnits:d}),[n,s,i,c,u,d]);return a.jsx(Te,{inputRef:o,value:e,onChange:r,formatter:g,...f})});function mr(t={}){const{min:o,max:e,targetRange:r,precision:n=fr,suffix:s,allowedUnits:c=[]}=t,{toDisplayValue:i,fromDisplayValue:u}=gr({min:o,max:e,targetRange:r});return{parse:(d,f)=>{try{return{valid:!0,value:h.pipe(d,g=>hr({expression:g,displayValue:i(f),suffix:s,allowedUnits:c}),h.round(n),u,h.clamp({min:o,max:e}))}}catch{return{valid:!1}}},format:d=>h.pipe(d,h.clamp({min:o,max:e}),i,h.round(n),f=>xr(f,s)),incrementBy(d,f){return d+u(f)}}}function gr(t){const{min:o,max:e,targetRange:r}=t;if(!r)return{toDisplayValue:n=>n,fromDisplayValue:n=>n};if(typeof o!="number"||typeof e!="number")throw Error("'targetRange' requires specifying 'min' and 'max'.");if(o===e)throw Error("'min' and 'max' cannot be equal.");return{toDisplayValue:z([o,e],r),fromDisplayValue:z(r,[o,e])}}function xr(t,o){return Number.isNaN(t)?"":o?`${t}${o}`:`${t}`}function hr(t){const{displayValue:o,expression:e,suffix:r="",allowedUnits:n=[]}=t,s="(\\d*\\.?\\d+)",c=`(?:${[...n,r].join("|")})*`,i=e.replace(new RegExp(`${s}${c}`,"gi"),(d,f)=>f).replace(new RegExp(`${c}${s}`,"gi"),(d,f)=>f).replace(new RegExp(`${s}%`,"gi"),(d,f)=>`(${o}*${f}/100)`).replace(new RegExp(`%${s}`,"gi"),(d,f)=>`(${o}*${f}/100)`).replace(new RegExp(`${s}x`,"gi"),(d,f)=>`(${o}*${f})`).replace(new RegExp(`x${s}`,"gi"),(d,f)=>`(${o}*${f})`).replace(new RegExp("(?<!\\d)x(?!\\d)","gi"),`${o}`).trim(),u=mo(i);if(u===null)throw new Error("Invalid expression.");return u}const Ut=l.forwardRef((t,o)=>{const{value:e,onChange:r,ignoreAlpha:n=!1,...s}=t,c=l.useMemo(()=>br({ignoreAlpha:n}),[n]);return a.jsx(Te,{inputRef:o,value:e,onChange:r,formatter:c,...s})});function br(t){const{ignoreAlpha:o}=t;return{parse(e,r){try{return{value:h.pipe(e,Cr,n=>Nr(n,r),Rr,n=>o?{...n,a:1}:n),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,r,n){return n??(n={r:!0,g:!0,b:!0}),{r:n.r?h.clamp(Math.round(e.r*255)+r,{min:0,max:255})/255:e.r,g:n.g?h.clamp(Math.round(e.g*255)+r,{min:0,max:255})/255:e.g,b:n.b?h.clamp(Math.round(e.b*255)+r,{min:0,max:255})/255:e.b,a:e.a}},getIncrementTargets(e){const r=e.selectionStart,n=e.selectionEnd;return r===null||n===null?null:{r:r<2||r===2&&n===2,g:r<4&&n>=3||r===4&&n===4,b:n>=5}},getIncrementSelection(e){let r,n;return e?(e.r?r=0:e.g?r=2:r=4,e.b?n=6:e.g?n=4:n=2,[r,n]):[0,6]}}}function Cr(t){var e;const o=/[0-9a-f]+/gi;return((e=t.match(o))==null?void 0:e[0])??""}function Nr(t,o){if(!/^[0-9a-f]{1,8}$/i.test(t))throw new Error("Invalid hex substring");switch(t.length){case 1:return t.repeat(6)+J(o.a);case 2:return t.repeat(3)+J(o.a);case 3:return t.split("").map(e=>e.repeat(2)).join("")+J(o.a);case 4:return t.slice(0,3).split("").map(e=>e.repeat(2)).join("")+t[3].repeat(2);case 5:return t.slice(0,3).split("").map(e=>e.repeat(2)).join("")+t.slice(-2);case 6:return t+J(o.a);case 7:return t.slice(0,6)+t[6].repeat(2);case 8:return t;default:throw new Error("Invalid hex substring")}}function Rr(t){return{r:parseInt(t.substring(0,2),16)/255,g:parseInt(t.substring(2,4),16)/255,b:parseInt(t.substring(4,6),16)/255,a:parseInt(t.substring(6,8),16)/255}}function J(t){return Math.round(t*255).toString(16)}const yr=Object.freeze(Object.defineProperty({__proto__:null,Hex:Ut,Label:H,Multi:G,Numeric:w,Root:y},Symbol.toStringTag,{value:"Module"}));function Q(t){const o=h.round(t*255,0).toString(16);return o.length<2?"0"+o:o}function te({r:t,g:o,b:e,a:r}){const n=r<1?Q(r):"";return"#"+Q(t)+Q(o)+Q(e)+n}function jr(t){return te(ge(t))}function wr(t){return te(A(t))}function K({r:t,g:o,b:e,a:r}){const n=Math.max(t,o,e),s=n-Math.min(t,o,e),c=s?n===t?(o-e)/s:n===o?2+(e-t)/s:4+(t-o)/s:0;return{h:60*(c<0?c+6:c),s:n?s/n*100:0,v:n*100,a:r}}function A({h:t,s:o,v:e,a:r}){t=t/360*6,o=o/100,e=e/100;const n=Math.floor(t),s=e*(1-o),c=e*(1-(t-n)*o),i=e*(1-(1-t+n)*o),u=n%6;return{r:[e,c,s,s,i,e][u],g:[i,e,e,c,s,s][u],b:[s,s,i,e,e,c][u],a:r}}function qt({h:t,s:o,l:e,a:r}){return o*=(e<50?e:100-e)/100,{h:t,s:o>0?2*o/(e+o)*100:0,v:e+o,a:r}}function Wt({h:t,s:o,v:e,a:r}){const n=(200-o)*e/100;return{h:t,s:n>0&&n<200?o*e/100/(n<=100?n:200-n)*100:0,l:n/2,a:r}}function ge(t){return A(qt(t))}function $e(t){return Wt(K(t))}function W(t){const o=h.round(t.r,4),e=h.round(t.g,4),r=h.round(t.b,4),n=h.round(t.a,2);return n<1?`color(display-p3 ${o} ${e} ${r} / ${n})`:`color(display-p3 ${o} ${e} ${r})`}function X(t){const o=Math.round(t.r*255),e=Math.round(t.g*255),r=Math.round(t.b*255),n=t.a;return n<1?`rgb(${o} ${e} ${r} / ${n})`:`rgb(${o} ${e} ${r})`}function _e(t){const{r:o,g:e,b:r,a:n}=t;return{r:o+(1-o)*(1-n),g:e+(1-e)*(1-n),b:r+(1-r)*(1-n),a:1}}const vr={r:0,g:0,b:0,a:1},Pr=["hex","rgb","hsl","hsv"],[Sr,$]=se("ColorPicker"),Tr=t=>{const{colorSpace:o,models:e=Pr,defaultActiveModel:r,activeModel:n,onActiveModelChange:s,defaultColor:c,color:i,onColorChange:u,children:d}=t;Mr(n,r,e);const[f=vr,g]=me({prop:i,defaultProp:c,onChange:u}),[j=e[0],S]=me({prop:n,defaultProp:r,onChange:s}),[x,b]=l.useState({}),T={hsv:x.hsv??K(f),hsl:x.hsl??$e(f),rgb:x.rgb??f,hex:x.hex??te(f)},M=T.hsv.h,U=q=>{const{mode:O,value:m}=q;O==="rgb"?(b({rgb:m,hsv:K(m),hsl:$e(m),hex:te(m)}),g(m)):O==="hsv"?(b({hsv:m,hsl:Wt(m),rgb:A(m),hex:wr(m)}),g(A(m))):O==="hsl"&&(b({hsv:qt(m),hsl:m,rgb:ge(m),hex:jr(m)}),g(ge(m)))};return a.jsx(Sr,{colorSpace:o,models:e,activeModel:j,onActiveModelChange:S,color:f,onColorChange:U,hue:M,colorsByModel:T,children:d})};function Mr(t,o,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(t&&!e.includes(t))throw new Error(`Invalid 'activeModel': '${t}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`);if(o&&!e.includes(o))throw new Error(`Invalid 'defaultActiveModel': '${o}' is not present in the 'models' array. Make sure 'activeModel' matches a model name in 'models'.`)}const Ir=2,$r=0,_r=100,Dr="horizontal",kr="ltr",ie=l.forwardRef((t,o)=>{const{className:e,min:r=$r,max:n=_r,defaultValue:s=[r],value:c,onValueChange:i,orientation:u=Dr,dir:d=kr,inverted:f,disabled:g,range:j=!0,rangeAnchor:S,baseValue:x,hints:b,...T}=t,M=l.useRef(null),U=re(M,o),{onPointerDown:q,focusVisible:O}=Lr(M),[m,P]=l.useState(c??s),Y=l.useRef(c),pe=l.useRef(s);l.useEffect(()=>{h.isDeepEqual(c,Y.current)&&h.isDeepEqual(s,pe.current)||P(c??s)},[c,s]),l.useEffect(()=>{M.current&&M.current.style.setProperty("--radix-slider-thumb-transform",Er(u,d,f))},[M,u,d,f]);const Z=_=>{const D=_.map(ue=>Or(ue,b,r,n));i==null||i(D),P(D)};return a.jsxs(de.Root,{tabIndex:-1,ref:U,className:p.cx(e,"fp-SliderRoot"),value:m,onValueChange:Z,onPointerDown:q,min:r,max:n,orientation:u,dir:d,inverted:f,disabled:g,...T,children:[a.jsx(de.Track,{className:"fp-SliderTrack"}),j&&a.jsx(Ar,{dir:d,value:m,min:r,max:n,orientation:u,inverted:f,rangeAnchor:S,disabled:g}),b&&b.map(_=>a.jsx(zr,{hint:_,baseValue:x,min:r,max:n,orientation:u,dir:d,inverted:f},_)),m.map((_,D)=>a.jsx(de.Thumb,{className:p.cx("fp-SliderThumb",{"fp-SliderThumb-focusVisible":O,"fp-SliderThumb-baseValue":_===x})},D))]})});ie.displayName="Slider";const zr=t=>{const{baseValue:o,dir:e,inverted:r,max:n,min:s,orientation:c,hint:i}=t,{startEdge:u}=Xt(c,e,r),d=z([s,n],[0,100])(i),f=4;return a.jsx(a.Fragment,{children:a.jsx("span",{className:p.cx("fp-SliderHint",{"fp-SliderHint-baseValue":i===o}),"data-orientation":c,style:{[u]:`calc(${d}% - ${f/2}px)`}})})},Ar=t=>{const{min:o,max:e,value:r,rangeAnchor:n=o,orientation:s,dir:c,inverted:i,disabled:u}=t,d=r.length>1?Math.min(...r):Math.min(n,...r),f=r.length>1?Math.max(...r):Math.max(n,...r),g=z([o,e],[0,100])(d),j=100-z([o,e],[0,100])(f),S=Xt(s,c,i);return a.jsx("span",{className:"fp-SliderRange","data-orientation":s,"data-disabled":u?"":void 0,style:{[S.startEdge]:`${g}%`,[S.endEdge]:`${j}%`}})};function Xt(t,o,e){const r=e?"inverted":"normal";return{vertical:{normal:{startEdge:"bottom",endEdge:"top"},inverted:{startEdge:"top",endEdge:"bottom"}},horizontal:{normal:{startEdge:o==="ltr"?"left":"right",endEdge:o==="ltr"?"right":"left"},inverted:{startEdge:o==="ltr"?"right":"left",endEdge:o==="ltr"?"left":"right"}}}[t][r]}function Er(t,o,e){const r=e?"inverted":"normal";return{vertical:{normal:"translateY(50%)",inverted:"translateY(-50%)"},horizontal:{normal:o==="ltr"?"translateX(-50%)":"translateX(50%)",inverted:o==="ltr"?"translateX(50%)":"translateX(-50%)"}}[t][r]}function Lr(t){const[o,e]=l.useState(!1),r=()=>{var s;e(!1),window.removeEventListener("pointerup",r),(s=t.current)==null||s.focus()};return{onPointerDown:()=>{e(!0),window.addEventListener("pointerup",r)},focusVisible:!o}}function Or(t,o,e,r){const n=z([0,100],[0,r-e])(Ir),s=o==null?void 0:o.find(c=>Math.abs(c-t)<=n);return typeof s=="number"?s:t}const Vr=t=>{const{className:o,style:e}=t,{activeModel:r,colorSpace:n,hue:s,color:c,onColorChange:i}=$("Hue"),u=Br[r],d=g=>{const j=u.setHue(c,g[0]);i({mode:"rgb",value:j})},f=u.getThumbColor(s,n);return a.jsx(ie,{"aria-label":"hue",range:!1,min:0,max:359,value:[s],onValueChange:d,className:`fp-ColorPickerHueSlider fp-color-model-${r} fp-color-space-${n} ${o}`,style:{"--slider-thumb-bg":f,...e}})},ee={getHue:t=>Math.round(K(t).h),setHue:(t,o)=>{const{s:e,v:r}=K(t);return A({h:o,s:e,v:r,a:t.a})},getThumbColor:(t,o)=>{const{r:e,g:r,b:n}=A({h:t,s:100,v:100,a:1});return o==="display-p3"?`color(display-p3 ${+e.toFixed(4)} ${+r.toFixed(4)} ${+n.toFixed(4)})`:`rgb(${Math.round(e*255)} ${Math.round(r*255)} ${Math.round(n*255)})`}},Br={rgb:ee,hsl:ee,hsv:ee,hex:ee},Fr=t=>{const{className:o,style:e}=t,{colorSpace:r,color:n,onColorChange:s}=$("Hue"),c={srgb:{transparent:X({...n,a:0}),opaque:X({...n,a:1})},p3:{transparent:W({...n,a:0}),opaque:W({...n,a:1})}},i={srgb:X(_e(n)),p3:W(_e(n))},u=d=>{s({mode:"rgb",value:{...n,a:h.round(d[0]/100,2)}})};return a.jsx(ie,{"aria-label":"alpha",min:0,max:100,range:!1,value:[n.a*100],onValueChange:u,className:`fp-ColorPickerAlphaSlider fp-color-space-${r} ${o}`,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}})},Gr=8,Hr=t=>{const{onColorChange:o,colorsByModel:e,hue:r,colorSpace:n,activeModel:s}=$("ColorPicker.Area"),c={srgb:X(A({h:r,s:100,v:100,a:1})),p3:W(A({h:r,s:100,v:100,a:1}))},i={srgb:X(e.rgb),p3:W(e.rgb)},u=Ur(e,s),d=l.useRef(null),{size:f}=qr(d),g=x=>{o(s==="hsl"?{mode:"hsl",value:{h:r,s:x.x,l:100-x.y,a:e.rgb.a}}:{mode:"hsv",value:{h:r,s:x.x,v:100-x.y,a:e.rgb.a}})},j=x=>{if(x.type==="pointerdown"&&x.currentTarget.setPointerCapture(x.pointerId),x.type==="pointermove"&&!x.currentTarget.hasPointerCapture(x.pointerId))return;const b=x.currentTarget.getBoundingClientRect();g({x:h.pipe(x.clientX-b.x,z([0,f],[0,100]),h.clamp({min:0,max:100})),y:h.pipe(x.clientY-b.y-Gr,z([0,f],[0,100]),h.clamp({min:0,max:100}))})},S=x=>{const b=x.shiftKey?10:1,T={ArrowRight:{x:1,y:0},ArrowLeft:{x:-1,y:0},ArrowDown:{x:0,y:1},ArrowUp:{x:0,y:-1}}[x.key];T&&g({x:h.clamp(u.x+T.x*b,{min:0,max:100}),y:h.clamp(u.y+T.y*b,{min:0,max:100})})};return a.jsxs("div",{ref:d,className:"fp-ColorPickerArea",onPointerDown:j,onPointerMove:j,style:{"--base-color-srgb":c.srgb,"--base-color-p3":c.p3},children:[a.jsx("div",{className:`fp-ColorPickerAreaCanvas fp-color-space-${n} fp-color-model-${s}`}),a.jsx("div",{tabIndex:0,onKeyDown:S,className:`fp-ColorPickerThumb fp-color-space-${n}`,style:{"--thumb-bg-srgb":i.srgb,"--thumb-bg-p3":i.p3,left:`${u.x}%`,top:`${u.y}%`}})]})};function Ur(t,o){if(o==="hsl"){const e=t.hsl;return{x:e.s,y:100-e.l}}else{const e=t.hsv;return{x:e.s,y:100-e.v}}}function qr(t){const[o,e]=l.useState(0);return l.useLayoutEffect(()=>{const r=t.current;if(!r)return;e(r.getBoundingClientRect().width);const n=new ResizeObserver(s=>{for(const c of s)e(c.contentRect.width)});return n.observe(r),()=>{n.unobserve(r)}},[t]),{size:o}}const fe={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"},Wr=p.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:fe,columnGap:fe,rowGap:fe},defaultVariants:{direction:"row"}}),Me=l.forwardRef((t,o)=>{const{className:e,direction:r,align:n,justify:s,wrap:c,gap:i,columnGap:u,rowGap:d,...f}=t;return a.jsx("div",{ref:o,className:Wr({className:e,direction:r,align:n,justify:s,wrap:c,gap:i,columnGap:u,rowGap:d}),...f})});Me.displayName="Flex";const Xr=t=>{const{models:o,activeModel:e,onActiveModelChange:r}=$("ColorPicker.Input"),n=h.pick({hex:Kr,hsv:Zr,hsl:Jr,rgb:Yr},o)[e];return a.jsxs(Me,{gap:"2.5",className:t.className,style:t.style,children:[o.length>1&&a.jsxs(at,{value:e,onValueChange:r,children:[a.jsx(Ce,{style:{width:56}}),a.jsx(Ne,{children:o.map(s=>a.jsx(Re,{value:s,children:s.toUpperCase()},s))})]}),a.jsx(n,{})]})},Kr=()=>{const{colorsByModel:t,onColorChange:o}=$("ColorPicker.HEX"),e=t.rgb,r=s=>{o({mode:"rgb",value:s})},n=s=>{o({mode:"rgb",value:{...e,a:s}})};return a.jsxs(G,{children:[a.jsx(y,{children:a.jsx(Ut,{onChange:r,value:e})}),a.jsxs(y,{style:{flex:"0 0 52px"},children:[a.jsx(w,{onChange:n,value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),a.jsx(H,{children:"%"})]})]})},Yr=()=>{const{colorsByModel:t,onColorChange:o}=$("ColorPicker.RGBA"),e=t.rgb,r=n=>s=>{o({mode:"rgb",value:{...e,[n]:s}})};return a.jsxs(G,{children:[a.jsx(y,{children:a.jsx(w,{onChange:r("r"),value:e.r,min:0,max:1,targetRange:[0,255],precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("g"),value:e.g,min:0,max:1,targetRange:[0,255],precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("b"),value:e.b,min:0,max:1,targetRange:[0,255],precision:0})}),a.jsxs(y,{style:{flex:"0 0 52px"},children:[a.jsx(w,{onChange:r("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),a.jsx(H,{children:"%"})]})]})},Zr=()=>{const{colorsByModel:t,onColorChange:o}=$("ColorPicker.HSVA"),e=t.hsv,r=n=>s=>{o({mode:"hsv",value:{...e,[n]:s}})};return a.jsxs(G,{children:[a.jsx(y,{children:a.jsx(w,{onChange:r("h"),value:e.h,min:0,max:360,precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("s"),value:e.s,min:0,max:100,precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("v"),value:e.v,min:0,max:100,precision:0})}),a.jsxs(y,{style:{flex:"0 0 52px"},children:[a.jsx(w,{onChange:r("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),a.jsx(H,{children:"%"})]})]})},Jr=()=>{const{colorsByModel:t,onColorChange:o}=$("ColorPicker.HSLA"),e=t.hsl,r=n=>s=>{o({mode:"hsl",value:{...e,[n]:s}})};return a.jsxs(G,{children:[a.jsx(y,{children:a.jsx(w,{onChange:r("h"),value:e.h,min:0,max:360,precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("s"),value:e.s,min:0,max:100,precision:0})}),a.jsx(y,{children:a.jsx(w,{onChange:r("l"),value:e.l,min:0,max:100,precision:0})}),a.jsxs(y,{style:{flex:"0 0 52px"},children:[a.jsx(w,{onChange:r("a"),value:e.a,min:0,max:1,targetRange:[0,100],precision:2,allowedUnits:["%"]}),a.jsx(H,{children:"%"})]})]})},Qr=Object.freeze(Object.defineProperty({__proto__:null,Alpha:Fr,Area:Hr,Hue:Vr,Input:Xr,Root:Tr,useColorPickerContext:$},Symbol.toStringTag,{value:"Module"})),Kt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(xe.Root,{ref:o,className:p.cx(e,"fp-CollapsibleRoot"),...r})}),Yt=l.forwardRef((t,o)=>{const{className:e,children:r,...n}=t;return a.jsxs(xe.Trigger,{ref:o,className:p.cx(e,"fp-CollapsibleTrigger"),...n,children:[a.jsx(he,{viewBox:"4 4 16 16",size:"4",className:"fp-CollapsibleIndicator"}),r]})}),Zt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(xe.Content,{ref:o,className:p.cx(e,"fp-CollapsibleContent"),...r})});Kt.displayName="Collapsible.Root";Yt.displayName="Collapsible.Trigger";Zt.displayName="Collapsible.Content";const en=Object.freeze(Object.defineProperty({__proto__:null,Content:Zt,Root:Kt,Trigger:Yt},Symbol.toStringTag,{value:"Module"})),tn=p.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"}}),Jt=l.forwardRef((t,o)=>{const{className:e,variant:r,size:n,fullWidth:s,...c}=t;return a.jsx("button",{ref:o,className:tn({className:e,variant:r,size:n,fullWidth:s}),...c})});Jt.displayName="Button";const Qt=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(ho,{className:p.cx(e,"fp-textarea"),ref:o,...r})});Qt.displayName="Textarea";const eo=l.forwardRef((t,o)=>{const{className:e,...r}=t;return a.jsx(Ie.Root,{ref:o,className:p.cx(e,"fp-switchRoot"),...r,children:a.jsx(Ie.Thumb,{ref:o,className:p.cx(e,"fp-switchThumb")})})});eo.displayName="Switch";exports.AlertDialog=ir;exports.Button=Jt;exports.Checkbox=ko;exports.Collapsible=en;exports.ColorPicker=Qr;exports.ContextMenu=qo;exports.Dialog=ar;exports.DropdownMenu=Bo;exports.Flex=Me;exports.IconButton=ce;exports.Input=Se;exports.Label=ae;exports.Link=Ge;exports.Paragraph=Fe;exports.Popover=tr;exports.RadioGroup=Po;exports.SegmentedControl=jo;exports.Select=Ao;exports.Slider=ie;exports.Switch=eo;exports.Tabs=Ro;exports.Text=E;exports.Textarea=Qt;exports.Tooltip=ye;exports.TooltipProvider=Wo;exports.ValueField=yr;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 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;
package/dist/index.d.ts CHANGED
@@ -405,20 +405,22 @@ declare type HexProps = Omit<InputProps, 'value' | 'onChange'> & {
405
405
  ignoreAlpha?: boolean;
406
406
  };
407
407
 
408
- declare type HSLA = {
408
+ declare type HSL = {
409
409
  h: number;
410
410
  s: number;
411
411
  l: number;
412
- a: number;
413
412
  };
414
413
 
415
- declare type HSVA = {
414
+ declare type HSLA = WithAlpha<HSL>;
415
+
416
+ declare type HSV = {
416
417
  h: number;
417
418
  s: number;
418
419
  v: number;
419
- a: number;
420
420
  };
421
421
 
422
+ declare type HSVA = WithAlpha<HSV>;
423
+
422
424
  declare const Hue: (props: HueProps) => JSX_2.Element;
423
425
 
424
426
  declare type HueProps = React.ComponentPropsWithoutRef<'div'>;
@@ -669,13 +671,14 @@ declare type RadioItemProps = RadixMenu.DropdownMenuRadioItemProps;
669
671
 
670
672
  declare type RadioItemProps_2 = RadixMenu_2.ContextMenuRadioItemProps;
671
673
 
672
- declare type RGBA = {
674
+ declare type RGB = {
673
675
  r: number;
674
676
  g: number;
675
677
  b: number;
676
- a: number;
677
678
  };
678
679
 
680
+ declare type RGBA = WithAlpha<RGB>;
681
+
679
682
  declare const Root: default_2.ForwardRefExoticComponent<RadixTabs.TabsProps & default_2.RefAttributes<HTMLDivElement>>;
680
683
 
681
684
  declare const Root_10: default_2.FC<RadixAlertDialog.AlertDialogProps>;
@@ -994,4 +997,8 @@ declare namespace ValueField {
994
997
  }
995
998
  export { ValueField }
996
999
 
1000
+ declare type WithAlpha<T> = T & {
1001
+ a: number;
1002
+ };
1003
+
997
1004
  export { }