@graphty/compact-mantine 0.0.1 → 0.3.0
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 +0 -44
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +930 -0
- package/dist/index.js +1749 -0
- package/package.json +87 -7
package/README.md
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
# @graphty/compact-mantine
|
|
2
1
|
|
|
3
|
-
## ⚠️ IMPORTANT NOTICE ⚠️
|
|
4
|
-
|
|
5
|
-
**This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@graphty/compact-mantine`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),r=require("react/jsx-runtime"),G=require("@mantine/hooks"),R=require("lucide-react"),i=require("react"),ye=require("react-dom"),ue=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],pe={dark:ue},_e={Button:o.Button.extend({vars:(t,e)=>e.size==="compact"?{root:{"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"}}:{root:{}}}),ActionIcon:o.ActionIcon.extend({vars:(t,e)=>e.size==="compact"?{root:{"--ai-size":"24px"}}:{root:{}}}),CloseButton:o.CloseButton.extend({defaultProps:{size:"compact"},vars:(t,e)=>e.size==="compact"?{root:{"--cb-size":"16px","--cb-icon-size":"12px"}}:{root:{}}})},je={SegmentedControl:o.SegmentedControl.extend({vars:(t,e)=>e.size==="compact"?{root:{"--sc-font-size":"10px","--sc-padding":"4px 8px"}}:{root:{}}}),Checkbox:o.Checkbox.extend({vars:(t,e)=>e.size==="compact"?{root:{"--checkbox-size":"16px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{label:{fontSize:11}}:{}}),Switch:o.Switch.extend({vars:(t,e)=>e.size==="compact"?{root:{"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{label:{fontSize:11}}:{}}),Slider:o.Slider.extend({vars:(t,e)=>e.size==="compact"?{root:{"--slider-size":"4px","--slider-thumb-size":"12px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{markLabel:{fontSize:10,marginTop:2}}:{}}),Radio:o.Radio.extend({vars:(t,e)=>e.size==="compact"?{root:{"--radio-size":"16px","--radio-icon-size":"6px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{label:{fontSize:11}}:{}}),RangeSlider:o.RangeSlider.extend({vars:(t,e)=>e.size==="compact"?{root:{"--slider-size":"4px","--slider-thumb-size":"12px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{markLabel:{fontSize:10,marginTop:2}}:{}})},Ie={Text:o.Text.extend({vars:(t,e)=>e.size==="compact"?{root:{"--text-fz":"11px","--text-lh":"1.2"}}:{root:{}}}),Badge:o.Badge.extend({vars:(t,e)=>e.size==="compact"?{root:{"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"}}:{root:{}}}),Pill:o.Pill.extend({vars:(t,e)=>e.size==="compact"?{root:{"--pill-height":"16px","--pill-fz":"10px"}}:{root:{}}}),Avatar:o.Avatar.extend({vars:(t,e)=>e.size==="compact"?{root:{"--avatar-size":"24px"}}:{root:{}}}),ThemeIcon:o.ThemeIcon.extend({vars:(t,e)=>e.size==="compact"?{root:{"--ti-size":"24px"}}:{root:{}}}),Indicator:o.Indicator.extend({vars:(t,e)=>e.size==="compact"?{root:{"--indicator-size":"8px"}}:{root:{}}}),Kbd:o.Kbd.extend({vars:(t,e)=>e.size==="compact"?{root:{"--kbd-fz":"10px","--kbd-padding":"2px 4px"}}:{root:{}}})},ke={Loader:o.Loader.extend({vars:(t,e)=>e.size==="compact"?{root:{"--loader-size":"18px"}}:{root:{}}}),Progress:o.Progress.extend({vars:(t,e)=>e.size==="compact"?{root:{"--progress-size":"4px"}}:{root:{}},styles:(t,e)=>e.size==="compact"?{label:{fontSize:9}}:{}}),RingProgress:o.RingProgress.extend({vars:()=>({root:{}})})},K=1e3,L=1100,de=8,Be=4,X={root:{},wrapper:{"--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}},k={label:{fontSize:11,color:"var(--mantine-color-dimmed)",marginBottom:1,lineHeight:1.2},input:{paddingLeft:8,paddingRight:8,border:"none"}},W={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},Ae={TextInput:o.TextInput.extend({vars:(t,e)=>e.size==="compact"?X:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?k:{}}),NumberInput:o.NumberInput.extend({vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none","--input-right-section-width":"24px"},controls:{"--ni-chevron-size":"10px"}}:{root:{},wrapper:{},controls:{}},styles:(t,e)=>e.size==="compact"?{...k,control:{borderColor:"transparent"}}:{}}),Select:o.Select.extend({defaultProps:{comboboxProps:{zIndex:L}},vars:(t,e)=>e.size==="compact"?X:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,...W}:{}}),Textarea:o.Textarea.extend({vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}}:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?k:{}}),PasswordInput:o.PasswordInput.extend({vars:(t,e)=>e.size==="compact"?X:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,innerInput:{paddingLeft:8,paddingRight:8}}:{}}),Autocomplete:o.Autocomplete.extend({defaultProps:{comboboxProps:{zIndex:L}},vars:(t,e)=>e.size==="compact"?X:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,...W}:{}}),ColorInput:o.ColorInput.extend({defaultProps:{popoverProps:{zIndex:L}},styles:(t,e)=>e.size==="compact"?{...k,wrapper:{"--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}}:{}}),MultiSelect:o.MultiSelect.extend({defaultProps:{comboboxProps:{zIndex:L}},vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none","--input-size":"24px","--combobox-chevron-size":"12px"}}:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,...W,input:{...k.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},inputField:{minWidth:60,flexBasis:60},pillsList:{columnGap:4,rowGap:2},pill:{margin:0,paddingTop:2,paddingBottom:2}}:{}}),TagsInput:o.TagsInput.extend({defaultProps:{comboboxProps:{zIndex:L}},vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}}:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,...W,input:{...k.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},inputField:{minWidth:30,flexBasis:30},pillsList:{columnGap:4,rowGap:2},pill:{margin:0,paddingTop:2,paddingBottom:2}}:{}}),PillsInput:o.PillsInput.extend({vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}}:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?{...k,input:{...k.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},inputField:{minWidth:30,flexBasis:30},pillsList:{columnGap:4,rowGap:2},pill:{margin:0,paddingTop:2,paddingBottom:2}}:{}}),FileInput:o.FileInput.extend({vars:(t,e)=>e.size==="compact"?X:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?k:{}}),JsonInput:o.JsonInput.extend({vars:(t,e)=>e.size==="compact"?{root:{},wrapper:{"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"none"}}:{root:{},wrapper:{}},styles:(t,e)=>e.size==="compact"?k:{}}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"compact"},vars:(t,e)=>e.size==="compact"?{root:{"--cb-size":"16px","--cb-icon-size":"12px"}}:{root:{}}})},Ee={Anchor:o.Anchor.extend({styles:(t,e)=>e.size==="compact"?{root:{fontSize:11}}:{}}),Burger:o.Burger.extend({vars:(t,e)=>e.size==="compact"?{root:{"--burger-size":"18px","--burger-line-size":"2px"}}:{root:{}}}),NavLink:o.NavLink.extend({styles:(t,e)=>e.variant==="compact"?{root:{fontSize:11,minHeight:28},label:{fontSize:11}}:{}}),Pagination:o.Pagination.extend({vars:(t,e)=>e.size==="compact"?{root:{"--pagination-control-size":"24px","--pagination-control-fz":"11px"}}:{root:{}}}),Stepper:o.Stepper.extend({vars:(t,e)=>e.size==="compact"?{root:{"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"}}:{root:{}}}),Tabs:o.Tabs.extend({styles:(t,e)=>e.variant==="compact"?{tab:{fontSize:11,padding:"6px 10px"}}:{}})},Re={Menu:o.Menu.extend({defaultProps:{zIndex:L}}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:L}}),Popover:o.Popover.extend({defaultProps:{zIndex:L}}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:L}})},Oe=o.createTheme({colors:pe,components:{...Ae,..._e,...je,...Ie,...ke,...Ee,...Re}}),De=["#5B8FF9","#FF6B6B","#61D095","#F7B731","#9B59B6"],fe=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],xe="#888888",J=255,Q=100;function ee(t){return Math.round(parseInt(t,16)/J*Q)}function te(t){return Math.round(t/Q*J).toString(16).padStart(2,"0")}function Fe(t){let e=t.replace("#","");e.length===3?e=`${e.split("").map(n=>n+n).join("")}ff`:e.length===4?e=e.split("").map(n=>n+n).join(""):e.length===6&&(e=`${e}ff`);const s=`#${e.slice(0,6)}`,a=e.slice(6,8),c=ee(a);return{hex:s,opacity:c}}function Le(t,e){const s=t.replace("#",""),a=te(e);return`#${s}${a}`}function Ge(t){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(t)}function He({color:t,defaultColor:e,opacity:s,defaultOpacity:a=100,onColorChange:c,onOpacityChange:n,label:l,showOpacity:p=!0}){const[g,z]=G.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:c}),[C,b]=G.useUncontrolled({value:s,defaultValue:void 0,finalValue:void 0,onChange:n}),d=g===void 0,m=C===void 0,B=d&&(!p||m),u=g??e,v=C??a,[S,_]=i.useState(!1),[E,j]=i.useState(u.replace("#","").toUpperCase()),[O,H]=i.useState(v);i.useEffect(()=>{j(u.replace("#","").toUpperCase())},[u]),i.useEffect(()=>{H(v)},[v]);const $=x=>{if(x.length===9){const A=x.slice(0,7).toUpperCase(),I=x.slice(7,9),w=ee(I);z(A),p&&b(w)}else z(x.toUpperCase())},f=()=>{const x=te(v);return`${u}${x}`.toUpperCase()},h=x=>{j(x.currentTarget.value.toUpperCase())},P=()=>{let x=E.toUpperCase();x&&!x.startsWith("#")&&(x=`#${x}`),/^#[0-9A-F]{6}$/i.test(x)&&x!==u?z(x):j(u.replace("#","").toUpperCase())},T=x=>{H(x)},D=()=>{const x=typeof O=="string"?parseFloat(O):O;if(isNaN(x))H(v);else{const A=Math.min(100,Math.max(0,x));A!==v&&b(A)}},M=()=>{z(void 0),p&&b(void 0)},F=r.jsxs(o.Group,{gap:4,wrap:"nowrap",children:[r.jsxs(o.Group,{gap:0,children:[r.jsxs(o.Popover,{opened:S,onChange:_,position:"bottom-start",shadow:"md",children:[r.jsx(o.Popover.Target,{children:r.jsx(o.ActionIcon,{variant:"filled",size:24,radius:0,style:{backgroundColor:"var(--mantine-color-default)",borderRadius:"4px 0 0 4px"},onClick:()=>{_(x=>!x)},"aria-label":"Color swatch",children:r.jsx(o.ColorSwatch,{color:u,size:14,radius:2,style:{border:"1px solid var(--mantine-color-default-border)"}})})}),r.jsx(o.Popover.Dropdown,{p:"xs",children:r.jsx(o.ColorPicker,{format:"hexa",value:f(),onChange:$,swatches:[...fe]})})]}),r.jsx(o.TextInput,{size:"compact",value:E,onChange:h,onBlur:P,"aria-label":"Color hex value","data-is-default":d?"true":"false",w:72,styles:{input:{borderRadius:p?0:"0 4px 4px 0",fontFamily:"monospace",textTransform:"uppercase",...d?{fontStyle:"italic",color:"var(--mantine-color-dimmed)"}:{}}}}),p&&r.jsxs(r.Fragment,{children:[r.jsx(o.Box,{style:{width:1,height:24,backgroundColor:"var(--mantine-color-default-border)"}}),r.jsx(o.NumberInput,{size:"compact",value:O,onChange:T,onBlur:D,min:0,max:100,hideControls:!0,suffix:"%","aria-label":"Opacity","data-is-default":m?"true":"false",w:54,styles:{input:{borderRadius:"0 4px 4px 0",textAlign:"right",...m?{fontStyle:"italic",color:"var(--mantine-color-dimmed)"}:{}}}})]})]}),!B&&r.jsx(o.ActionIcon,{variant:"subtle",size:"xs",c:"dimmed","aria-label":`Reset ${l??"color"} to default`,onClick:M,children:r.jsx(R.X,{size:12})})]});return l?r.jsxs(o.Stack,{gap:0,children:[r.jsx(o.Text,{size:"xs",c:"dimmed",mb:1,lh:1.2,children:l}),F]}):F}function Ne({label:t,actions:e,children:s}){return r.jsxs(o.Box,{children:[r.jsx(o.Divider,{color:"gray.7",mt:8,mb:0}),r.jsxs(o.Group,{justify:"space-between",py:8,children:[r.jsx(o.Text,{size:"xs",fw:500,lh:1.2,children:t}),e&&r.jsx(o.Group,{gap:4,children:e})]}),r.jsx(o.Stack,{gap:0,children:s})]})}function Me({label:t,defaultOpen:e=!0,children:s,hasConfiguredValues:a=!1}){const[c,{toggle:n}]=G.useDisclosure(e);return r.jsxs(o.Box,{children:[r.jsx(o.Divider,{color:"gray.7",mt:8,mb:0}),r.jsx(o.Group,{justify:"space-between",py:8,style:{cursor:"pointer"},onClick:n,children:r.jsxs(o.Group,{gap:4,children:[r.jsx(o.ActionIcon,{variant:"subtle",size:"xs",c:"dimmed","aria-label":c?`Collapse ${t}`:`Expand ${t}`,children:c?r.jsx(R.ChevronDown,{size:12}):r.jsx(R.ChevronRight,{size:12})}),r.jsx(o.Text,{size:"xs",fw:500,lh:1.2,children:t}),a&&r.jsx(o.Box,{"aria-label":`${t} has configured values`,style:{width:6,height:6,borderRadius:"50%",backgroundColor:"var(--mantine-color-blue-5)",marginLeft:4}})]})}),r.jsx(o.Collapse,{in:c,children:r.jsx(o.Stack,{gap:0,children:s})})]})}function Ue({label:t,defaultOpen:e=!1,children:s}){const[a,{toggle:c}]=G.useDisclosure(e);return r.jsxs(o.Box,{children:[r.jsxs(o.Group,{gap:4,py:4,style:{cursor:"pointer"},onClick:c,children:[r.jsx(o.ActionIcon,{variant:"subtle",size:"xs",c:"dimmed","aria-label":a?`Collapse ${t}`:`Expand ${t}`,children:a?r.jsx(R.ChevronDown,{size:10}):r.jsx(R.ChevronRight,{size:10})}),r.jsx(o.Text,{size:"xs",c:"dimmed",lh:1.2,children:t})]}),a&&r.jsx(o.Box,{pl:"md",children:r.jsx(o.Stack,{gap:4,children:s})})]})}function $e({label:t,checked:e,defaultChecked:s,onChange:a,children:c}){const[n,l]=G.useUncontrolled({value:e,defaultValue:s,finalValue:!1,onChange:a});return r.jsxs(o.Stack,{gap:4,children:[r.jsx(o.Checkbox,{size:"compact",label:t,checked:n,onChange:p=>{l(p.currentTarget.checked)}}),n&&r.jsx(o.Box,{"data-testid":"effect-toggle-children",pl:"md",children:r.jsx(o.Stack,{gap:4,children:c})})]})}function Ve(){return crypto.randomUUID().slice(0,8)}function Z(t,e){return{id:Ve(),offset:t,color:e}}function me(){return[Z(0,"#6366F1"),Z(1,"#06B6D4")]}function Xe({stops:t,defaultStops:e,direction:s,defaultDirection:a=0,showDirection:c=!0,onChange:n}){const[l,p]=G.useUncontrolled({value:t,defaultValue:e,finalValue:me(),onChange:u=>n==null?void 0:n(u,g)}),[g,z]=G.useUncontrolled({value:s,defaultValue:a,finalValue:0,onChange:u=>n==null?void 0:n(l,u)}),C=(u,v)=>{const S=[...l];S[u]={...S[u],color:v},p(S),n==null||n(S,g)},b=(u,v)=>{const S=[...l];S[u]={...S[u],offset:v/100},p(S),n==null||n(S,g)},d=u=>{z(u),n==null||n(l,u)},m=()=>{if(l.length>=5)return;const u=l.length>0?(l[l.length-1].offset+1)/2:.5,v=[...l,Z(u,xe)];v.sort((S,_)=>S.offset-_.offset),p(v),n==null||n(v,g)},B=u=>{if(l.length<=2)return;const v=l.filter((S,_)=>_!==u);p(v),n==null||n(v,g)};return r.jsxs(o.Stack,{gap:"xs",children:[r.jsxs(o.Group,{justify:"space-between",align:"center",children:[r.jsx(o.Text,{size:"xs",c:"dimmed",children:"Color Stops"}),r.jsx(o.ActionIcon,{size:"compact",variant:"subtle",color:"gray",onClick:m,disabled:l.length>=5,"aria-label":"Add color stop",children:r.jsx(R.Plus,{size:12})})]}),l.map((u,v)=>r.jsxs(o.Group,{gap:"xs",align:"flex-end",children:[r.jsx(o.Box,{style:{flex:1},children:r.jsx(o.ColorInput,{size:"compact",value:u.color,onChange:S=>{C(v,S)},"aria-label":`Color stop ${v+1}`})}),r.jsx(o.Box,{style:{width:"80px"},children:r.jsx(o.Slider,{size:"compact",min:0,max:100,value:u.offset*100,onChange:S=>{b(v,S)},label:S=>`${Math.round(S)}%`,"aria-label":`Stop ${v+1} position`})}),r.jsx(o.ActionIcon,{size:"compact",variant:"subtle",color:"gray",onClick:()=>{B(v)},disabled:l.length<=2,"aria-label":`Remove color stop ${v+1}`,children:r.jsx(R.Minus,{size:12})})]},u.id)),c&&r.jsxs(o.Box,{children:[r.jsx(o.Text,{size:"xs",c:"dimmed",mb:4,children:"Direction"}),r.jsx(o.Slider,{size:"compact",min:0,max:360,value:g,onChange:d,label:u=>`${u}°`,"aria-label":"Gradient direction",marks:[{value:0,label:"0°"},{value:90,label:"90°"},{value:180,label:"180°"},{value:270,label:"270°"},{value:360,label:"360°"}]})]})]})}function qe({children:t}){return r.jsx(o.Box,{p:"sm",children:t})}const We=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Ze(t,e=!0){i.useEffect(()=>{if(!e)return;const s=a=>{const c=a.target;c.closest('[role="dialog"]')||c.closest("[data-popout-trigger]")||c.closest("[data-popout-portal-container]")||c.closest(We)||t()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[t,e])}function Ye(t,e=!0){i.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&(a.preventDefault(),t())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[t,e])}const oe=i.createContext(null),he=i.createContext(null);function ge(){const t=i.useContext(oe);if(!t)throw new Error("usePopoutContext must be used within a Popout component");return t}function Ke(){return i.useContext(oe)}function Je(){const t=i.useContext(he);if(!t)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return t}function Qe({children:t,parentId:e=null}){const s=i.useId(),[a,c]=i.useState(!1),n=i.useRef(null),l=i.useMemo(()=>({id:s,isOpen:a,open:()=>{c(!0)},close:()=>{c(!1)},toggle:()=>{c(p=>!p)},triggerRef:n,parentId:e}),[s,a,e]);return r.jsx(oe.Provider,{value:l,children:t})}function et({children:t}){const[e,s]=i.useState(null),a=i.useRef([]),c=i.useRef(new Map),n=i.useRef(new Map),[l,p]=i.useState(0),g=i.useCallback((f,h,P)=>{var T,D;if(!a.current.includes(f)){const M=a.current,F=[];for(const x of M)n.current.get(x)===(P??null)&&F.push(x);for(const x of F.reverse()){const A=[];for(const I of M){let w=I;for(;w;){const U=n.current.get(w);if(U===x){A.push(I);break}w=U??null}}for(const I of A.reverse())(T=c.current.get(I))==null||T();(D=c.current.get(x))==null||D()}a.current=[...a.current.filter(x=>!F.includes(x)&&!F.some(A=>{let I=x;for(;I;){const w=n.current.get(I);if(w===A)return!0;I=w??null}return!1})),f],c.current.set(f,h),n.current.set(f,P??null),p(x=>x+1)}},[]),z=i.useCallback(f=>{a.current=a.current.filter(h=>h!==f),c.current.delete(f),n.current.delete(f),p(h=>h+1)},[]),C=i.useCallback(f=>{const h=a.current.indexOf(f);return h>=0?K+h:K},[]),b=i.useCallback(f=>{const h=a.current,P=h.indexOf(f);P===-1||P===h.length-1||(a.current=[...h.filter(T=>T!==f),f],p(T=>T+1))},[]),d=i.useCallback(f=>n.current.get(f)??null,[]),m=i.useCallback((f,h)=>{let P=h;for(;P;){const T=n.current.get(P);if(T===f)return!0;P=T??null}return!1},[]),B=i.useCallback(f=>{const h=[],P=a.current;for(const T of P)m(f,T)&&h.push(T);return h},[m]),u=i.useCallback(f=>{const h=B(f);for(const P of[...h].reverse()){const T=c.current.get(P);T==null||T()}},[B]),v=i.useCallback(f=>{u(f);const h=c.current.get(f);h==null||h()},[u]),S=i.useCallback((f,h)=>{const P=a.current;for(const T of P){if(T===f)continue;n.current.get(T)===h&&v(T)}},[v]),_=i.useCallback(()=>{const f=a.current;if(f.length===0)return;const h=f[f.length-1],P=c.current.get(h);P==null||P()},[]),E=i.useCallback(()=>{const f=[...a.current];for(const h of f){const P=c.current.get(h);P==null||P()}},[]),j=i.useCallback(()=>a.current.length>0,[]),[O,H]=i.useState(!1);i.useEffect(()=>{H(a.current.length>0)},[l]),Ye(_,O),Ze(E,O);const $=i.useMemo(()=>({register:g,unregister:z,getZIndex:C,bringToFront:b,portalContainer:e,zIndexVersion:l,closeFocused:_,closeAll:E,hasOpenPopouts:j,closeWithDescendants:v,closeDescendants:u,closeSiblings:S,getParentId:d,isAncestor:m}),[g,z,C,b,e,l,_,E,j,v,u,S,d,m]);return r.jsxs(he.Provider,{value:$,children:[t,r.jsx("div",{ref:s,"data-popout-portal-container":!0})]})}function tt(t){const{isOpen:e,onDragStart:s}=t,[a,c]=i.useState({left:0,top:0}),n=i.useRef(!1),l=i.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),p=i.useCallback(()=>{c({left:0,top:0})},[]),g=i.useCallback(b=>{const d=b.target;d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.tagName==="BUTTON"||d.tagName==="SELECT"||d.closest("button")||d.closest("input")||d.closest("textarea")||d.closest("select")||(n.current=!0,l.current={x:b.clientX,y:b.clientY,offsetLeft:a.left,offsetTop:a.top},s==null||s(),b.target.setPointerCapture(b.pointerId))},[a.left,a.top,s]),z=i.useCallback(b=>{if(!n.current)return;const d=b.clientX-l.current.x,m=b.clientY-l.current.y;c({left:l.current.offsetLeft+d,top:l.current.offsetTop+m})},[]),C=i.useCallback(b=>{n.current&&(n.current=!1,b.target.releasePointerCapture(b.pointerId))},[]);return e?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:g,onPointerMove:z,onPointerUp:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:a,resetDragOffset:p}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:p}}function ot({id:t,label:e,isActive:s,onClick:a}){return r.jsx(o.UnstyledButton,{role:"tab",id:`tab-${t}`,"aria-selected":s,"aria-controls":`tabpanel-${t}`,onClick:a,px:"xs",py:3,style:{fontSize:"11px",fontWeight:s?500:400,color:s?"var(--mantine-color-text)":"var(--mantine-color-dimmed)",borderBottom:s?"2px solid var(--mantine-color-blue-filled)":"2px solid transparent",cursor:"pointer"},children:e})}function rt({config:t,onClose:e,dragTriggerProps:s={},actions:a=[],activeTab:c,onTabChange:n,titleId:l}){var d;const{style:p,...g}=s,C=t.variant==="tabs"?t:null,b=m=>{n&&n(m)};return r.jsxs(o.Group,{justify:"space-between",px:"sm",py:"xs",...g,style:{...p},children:[t.variant==="title"?r.jsx(o.Text,{id:l,size:"compact",fw:500,children:t.title}):r.jsxs(o.Group,{gap:0,role:"tablist","aria-label":"Panel tabs",children:[r.jsx("span",{id:l,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0, 0, 0, 0)"},children:((d=C==null?void 0:C.tabs[0])==null?void 0:d.label)??"Settings"}),C==null?void 0:C.tabs.map(m=>r.jsx(ot,{id:m.id,label:m.label,isActive:c===m.id,onClick:()=>{b(m.id)}},m.id))]}),r.jsxs(o.Group,{gap:4,children:[a.map(m=>r.jsx(o.ActionIcon,{variant:"subtle",size:"compact",onClick:m.onClick,"aria-label":m.label,children:m.icon},m.id)),r.jsx(o.ActionIcon,{variant:"subtle",size:"compact",onClick:e,"aria-label":"Close panel",children:r.jsx(R.X,{size:14})})]})]})}function nt(t,e,s=de,a={}){const{placement:c="left",alignment:n="start",panelHeight:l=0}=a;let p,g;switch(c){case"left":p=t.left-e-s,g=ce(t,n,l);break;case"right":p=t.right+s,g=ce(t,n,l);break;case"top":p=le(t,n,e),g=t.top-l-s;break;case"bottom":p=le(t,n,e),g=t.bottom+s;break;default:{const z=c;throw new Error(`Unknown placement: ${String(z)}`)}}return{left:p,top:g}}function ce(t,e,s){switch(e){case"start":return t.top;case"center":return t.top+t.height/2-s/2;case"end":return t.bottom-s;default:{const a=e;throw new Error(`Unknown alignment: ${String(a)}`)}}}function le(t,e,s){switch(e){case"start":return t.left;case"center":return t.left+t.width/2-s/2;case"end":return t.right-s;default:{const a=e;throw new Error(`Unknown alignment: ${String(a)}`)}}}function st({width:t,height:e,header:s,children:a,anchorRef:c,placement:n="left",alignment:l="start",gap:p=0,actions:g}){var ae,ie;const{isOpen:z,close:C,triggerRef:b,id:d,parentId:m}=ge(),{getZIndex:B,portalContainer:u,register:v,unregister:S,bringToFront:_,zIndexVersion:E,closeWithDescendants:j,closeDescendants:O}=Je(),H=i.useId(),$=`popout-panel-${d}`,f=`popout-title-${H}`,[h,P]=i.useState(null),T=i.useRef(!1),D=i.useRef(null),M=i.useCallback(()=>{_(d)},[_,d]),{dragTriggerProps:F,dragOffset:x,resetDragOffset:A}=tt({isOpen:z,onDragStart:M}),I=s.variant==="tabs",w=I?s:null,U=(w==null?void 0:w.defaultTab)??((ae=w==null?void 0:w.tabs[0])==null?void 0:ae.id),[re,ne]=i.useState(U),be=i.useCallback(y=>{var N;ne(y),(N=w==null?void 0:w.onTabChange)==null||N.call(w,y)},[w]),ve=i.useCallback(y=>{y.stopPropagation(),O(d),_(d)},[O,_,d]),ze=i.useCallback(()=>{j(d)},[j,d]);if(i.useEffect(()=>(z?v(d,C,m):S(d),()=>{S(d)}),[z,d,v,S,C,m]),i.useEffect(()=>{if(z){let y=(c==null?void 0:c.current)??null;if(!y&&m&&(y=document.querySelector(`[data-popout-id="${m}"]`)),y||(y=b.current),y){const N=y.getBoundingClientRect(),we=nt(N,t,p,{placement:n,alignment:l,panelHeight:e});P(we),T.current||(A(),I&&ne(U))}}T.current=z},[z,t,e,p,b,c,n,l,A,I,U,m]),i.useEffect(()=>{if(z&&D.current){const y=setTimeout(()=>{var N;(N=D.current)==null||N.focus()},0);return()=>{clearTimeout(y)}}else!z&&b.current&&b.current.focus()},[z,b]),!z||!u||!h)return null;const Ce=B(d),se={left:h.left+x.left,top:h.top+x.top},V="1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",q="none",Y=c!==void 0||m!==void 0,Se=()=>Y?{borderTop:n==="bottom"?q:V,borderRight:n==="left"?q:V,borderBottom:n==="top"?q:V,borderLeft:n==="right"?q:V}:{border:V},Pe=()=>{if(!Y)return{};const y=8;switch(n){case"left":return{borderTopLeftRadius:y,borderBottomLeftRadius:y,borderTopRightRadius:0,borderBottomRightRadius:0};case"right":return{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderTopRightRadius:y,borderBottomRightRadius:y};case"top":return{borderTopLeftRadius:y,borderTopRightRadius:y,borderBottomLeftRadius:0,borderBottomRightRadius:0};case"bottom":return{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:y,borderBottomRightRadius:y};default:return{}}},Te=r.jsxs(o.Paper,{ref:D,id:$,role:"dialog","aria-modal":"false","aria-labelledby":f,tabIndex:-1,radius:Y?0:8,onClick:ve,"data-popout-id":d,...m&&{"data-parent-id":m},style:{position:"fixed",left:se.left,top:se.top,width:t,...e!==void 0&&{height:e},zIndex:Ce,backgroundColor:"var(--mantine-color-body)",...Se(),...Pe(),boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", "),outline:"none"},children:[r.jsx(rt,{config:s,onClose:ze,dragTriggerProps:F,activeTab:re,onTabChange:be,actions:g,titleId:f}),r.jsx(o.Box,{children:I?(ie=w==null?void 0:w.tabs.find(y=>y.id===re))==null?void 0:ie.content:a})]});return ye.createPortal(Te,u)}function at({children:t}){const{toggle:e,triggerRef:s,isOpen:a,id:c}=ge(),n=i.useCallback(g=>{g.stopPropagation(),e()},[e]);if(!i.isValidElement(t))throw new Error("PopoutTrigger requires a single valid React element as its child");const l=`popout-panel-${c}`,p=t;return i.cloneElement(p,{onClick:g=>{var z,C;(C=(z=p.props).onClick)==null||C.call(z,g),n(g)},ref:s,"data-popout-trigger":!0,"aria-expanded":a,"aria-controls":l,"aria-haspopup":"dialog"})}function it({children:t}){const e=Ke(),s=(e==null?void 0:e.id)??null;return r.jsx(Qe,{parentId:s,children:t})}const ct=Object.assign(it,{Trigger:at,Panel:st,Content:qe});function lt({children:t}){return r.jsx(et,{children:t})}function ut({label:t,value:e}){return r.jsxs(o.Group,{justify:"space-between",py:4,children:[r.jsx(o.Text,{size:"compact",c:"dimmed",children:t}),r.jsx(o.Text,{size:"compact",c:"var(--mantine-color-text)",fw:500,children:String(e)})]})}function pt({label:t,value:e,defaultValue:s,onChange:a,min:c,max:n,step:l,decimalScale:p,suffix:g,hideControls:z=!0}){const[C,b]=G.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:a}),d=C===void 0,m=C??s,[B,u]=i.useState(m);i.useEffect(()=>{u(C??s)},[C,s]);const v=E=>{u(E)},S=()=>{const E=typeof B=="string"?parseFloat(B):B;if(isNaN(E))u(C??s);else{let j=E;c!==void 0&&j<c&&(j=c),n!==void 0&&j>n&&(j=n),j!==C&&b(j),u(j)}},_=()=>{b(void 0)};return r.jsxs(o.Group,{gap:4,wrap:"nowrap",align:"flex-end",children:[r.jsx(o.NumberInput,{label:t,"aria-label":t,value:B,onChange:v,onBlur:S,min:c,max:n,step:l,decimalScale:p,suffix:g,hideControls:z,size:"compact","data-is-default":d?"true":"false",styles:{input:d?{fontStyle:"italic",color:"var(--mantine-color-dimmed)"}:void 0},style:{flex:1}}),!d&&r.jsx(o.ActionIcon,{variant:"subtle",size:"xs",c:"dimmed","aria-label":`Reset ${t} to default`,onClick:_,style:{marginBottom:2},children:r.jsx(R.X,{size:12})})]})}function dt({label:t,value:e,defaultValue:s,options:a,onChange:c}){const[n,l]=G.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:c}),p=n===void 0,g=n??s,z=b=>{b!==null&&l(b)},C=()=>{l(void 0)};return r.jsxs(o.Group,{gap:4,wrap:"nowrap",align:"flex-end",children:[r.jsx(o.Select,{label:t,"aria-label":t,value:g,onChange:z,data:a,size:"compact",rightSection:r.jsx(R.ChevronDown,{size:14}),rightSectionPointerEvents:"none","data-is-default":p?"true":"false",allowDeselect:!1,styles:{input:p?{fontStyle:"italic",color:"var(--mantine-color-dimmed)"}:void 0},style:{flex:1}}),!p&&r.jsx(o.ActionIcon,{variant:"subtle",size:"xs",c:"dimmed","aria-label":`Reset ${t} to default`,onClick:C,style:{marginBottom:2},children:r.jsx(R.X,{size:12})})]})}function ft(){return o.useComputedColorScheme("dark")}const xt={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},mt="0.1.0";exports.CompactColorInput=He;exports.ControlGroup=Ne;exports.ControlSection=Me;exports.ControlSubGroup=Ue;exports.DEFAULT_GRADIENT_STOP_COLOR=xe;exports.EffectToggle=$e;exports.GradientEditor=Xe;exports.MANTINE_SPACING=xt;exports.MAX_ALPHA_HEX=J;exports.MAX_OPACITY_PERCENT=Q;exports.POPOUT_GAP=de;exports.POPOUT_NESTED_GAP=Be;exports.POPOUT_Z_INDEX_BASE=K;exports.Popout=ct;exports.PopoutManager=lt;exports.SWATCH_COLORS=De;exports.SWATCH_COLORS_HEXA=fe;exports.StatRow=ut;exports.StyleNumberInput=pt;exports.StyleSelect=dt;exports.VERSION=mt;exports.compactColors=pe;exports.compactDarkColors=ue;exports.compactTheme=Oe;exports.createColorStop=Z;exports.createDefaultGradientStops=me;exports.isValidHex=Ge;exports.opacityToAlphaHex=te;exports.parseAlphaFromHexa=ee;exports.parseHexaColor=Fe;exports.toHexaColor=Le;exports.useActualColorScheme=ft;
|