@brycks/core-front 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/InfoItem/InfoItem.d.ts +44 -0
- package/dist/components/data/InfoItem/InfoItem.d.ts.map +1 -0
- package/dist/components/data/InfoItem/index.d.ts +2 -0
- package/dist/components/data/InfoItem/index.d.ts.map +1 -0
- package/dist/components/data/index.d.ts +1 -0
- package/dist/components/data/index.d.ts.map +1 -1
- package/dist/components/form/Form/Form.d.ts +16 -0
- package/dist/components/form/Form/Form.d.ts.map +1 -0
- package/dist/components/form/Form/index.d.ts +2 -0
- package/dist/components/form/Form/index.d.ts.map +1 -0
- package/dist/components/form/FormGroup/FormGroup.d.ts +31 -0
- package/dist/components/form/FormGroup/FormGroup.d.ts.map +1 -0
- package/dist/components/form/FormGroup/index.d.ts +2 -0
- package/dist/components/form/FormGroup/index.d.ts.map +1 -0
- package/dist/components/form/FormLabel/FormLabel.d.ts +20 -0
- package/dist/components/form/FormLabel/FormLabel.d.ts.map +1 -0
- package/dist/components/form/FormLabel/index.d.ts +2 -0
- package/dist/components/form/FormLabel/index.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/typography/Text/Text.d.ts +13 -11
- package/dist/components/typography/Text/Text.d.ts.map +1 -1
- package/dist/components/utility/Avatar/Avatar.d.ts +23 -0
- package/dist/components/utility/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/utility/Avatar/index.d.ts +3 -0
- package/dist/components/utility/Avatar/index.d.ts.map +1 -0
- package/dist/components/utility/Logo/Logo.d.ts +15 -0
- package/dist/components/utility/Logo/Logo.d.ts.map +1 -0
- package/dist/components/utility/Logo/index.d.ts +3 -0
- package/dist/components/utility/Logo/index.d.ts.map +1 -0
- package/dist/components/utility/ScreenReaderOnly/ScreenReaderOnly.d.ts +17 -0
- package/dist/components/utility/ScreenReaderOnly/ScreenReaderOnly.d.ts.map +1 -0
- package/dist/components/utility/ScreenReaderOnly/index.d.ts +2 -0
- package/dist/components/utility/ScreenReaderOnly/index.d.ts.map +1 -0
- package/dist/components/utility/index.d.ts +3 -0
- package/dist/components/utility/index.d.ts.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1725 -1359
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./colors-Bp6ROxvx.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./colors-Bp6ROxvx.cjs"),f=require("./tokens.cjs"),ue=require("./cssVariables-BguyVeCi.cjs"),i=require("react"),e=require("react/jsx-runtime"),ae=require("react-dom"),J={xs:f.spacing[6],sm:f.spacing[8],md:f.spacing[10],lg:f.spacing[12],xl:f.spacing[14]},de={xs:f.spacing[3],sm:f.spacing[4],md:f.spacing[5],lg:f.spacing[6],xl:f.spacing[8]},ee={xs:f.spacing[2],sm:f.spacing[3],md:f.spacing[4],lg:f.spacing[5],xl:f.spacing[6]},wr={xs:f.spacing[1],sm:f.spacing[1.5],md:f.spacing[2],lg:f.spacing[2.5],xl:f.spacing[3]},Q={xs:f.spacing[1],sm:f.spacing[1.5],md:f.spacing[2],lg:f.spacing[2.5],xl:f.spacing[3]},jr={sm:400,md:500,lg:640,xl:800,full:"calc(100vw - 48px)"},Cr={tooltipMaxWidth:300,popoverMaxWidth:400,arrowSize:f.spacing[2],offset:f.spacing[2]},Re={sm:{box:16,icon:10},md:{box:18,icon:12},lg:{box:22,icon:14}},Le={sm:{width:36,height:20,thumb:16},md:{width:44,height:24,thumb:20},lg:{width:52,height:28,thumb:24}},te={default:"0 0 0 3px var(--brycks-focus-ring-color, rgba(85, 120, 244, 0.35))",error:"0 0 0 3px var(--brycks-focus-ring-error, rgba(239, 68, 68, 0.35))",success:"0 0 0 3px var(--brycks-focus-ring-success, rgba(16, 185, 129, 0.35))",subtle:"0 0 0 2px var(--brycks-focus-ring-color, rgba(85, 120, 244, 0.25))",none:"none"},zr={default:"0 0 0 2px var(--brycks-background-app), 0 0 0 4px var(--brycks-primary-default)",error:"0 0 0 2px var(--brycks-background-app), 0 0 0 4px var(--brycks-error-default)"},Mr={outline:{outline:"2px solid var(--brycks-border-focus)",outlineOffset:"2px"},ring:{outline:"none",boxShadow:te.default},ringError:{outline:"none",boxShadow:te.error},none:{outline:"none",boxShadow:"none"}},oe={none:"none",instant:`all ${f.durations.faster}ms ${f.easings.easeOut}`,fast:`all ${f.durations.fast}ms ${f.easings.easeOut}`,quick:`all ${f.durations.quick}ms ${f.easings.easeOut}`,default:`all ${f.durations.normal}ms ${f.easings.easeOut}`,smooth:`all ${f.durations.relaxed}ms ${f.easings.smooth}`,slow:`all ${f.durations.slow}ms ${f.easings.easeOut}`,spring:`all ${f.durations.relaxed}ms ${f.easings.softSpring}`,colors:`color ${f.durations.fast}ms ${f.easings.easeOut}, background-color ${f.durations.fast}ms ${f.easings.easeOut}, border-color ${f.durations.fast}ms ${f.easings.easeOut}`,transform:`transform ${f.durations.normal}ms ${f.easings.easeOut}`,opacity:`opacity ${f.durations.normal}ms ${f.easings.easeOut}`,shadow:`box-shadow ${f.durations.normal}ms ${f.easings.easeOut}`},Ir={all:"all",colors:"color, background-color, border-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform",dimensions:"width, height, padding, margin"},Tr={instant:f.durations.faster,fast:f.durations.fast,quick:f.durations.quick,default:f.durations.normal,smooth:f.durations.relaxed,slow:f.durations.slow,slower:f.durations.slower},Rr={linear:f.easings.linear,ease:f.easings.ease,easeIn:f.easings.easeIn,easeOut:f.easings.easeOut,easeInOut:f.easings.easeInOut,spring:f.easings.spring,softSpring:f.easings.softSpring,smooth:f.easings.smooth,snappy:f.easings.snappy},Lr={fadeIn:`
|
|
2
2
|
@keyframes brycks-fade-in {
|
|
3
3
|
from { opacity: 0; }
|
|
4
4
|
to { opacity: 1; }
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
|
|
49
49
|
40% { transform: scale(1); opacity: 1; }
|
|
50
50
|
}
|
|
51
|
-
`},V={xs:g.fontSizes.xs,sm:g.fontSizes.sm,md:g.fontSizes.base,lg:15,xl:g.fontSizes.md},K={regular:g.fontWeights.regular,medium:g.fontWeights.medium,semibold:g.fontWeights.semibold,bold:g.fontWeights.bold},O={none:g.lineHeights.none,tight:g.lineHeights.snug,snug:1.4,normal:g.lineHeights.normal,relaxed:1.6},Cr={label:{fontFamily:g.fontFamilies.sans,fontSize:V.sm,fontWeight:K.medium,lineHeight:O.normal},helperText:{fontFamily:g.fontFamilies.sans,fontSize:V.xs,fontWeight:K.regular,lineHeight:O.relaxed},errorText:{fontFamily:g.fontFamilies.sans,fontSize:V.xs,fontWeight:K.regular,lineHeight:O.relaxed},buttonSm:{fontFamily:g.fontFamilies.sans,fontSize:V.sm,fontWeight:K.medium,lineHeight:O.none},buttonMd:{fontFamily:g.fontFamilies.sans,fontSize:V.md,fontWeight:K.medium,lineHeight:O.none},buttonLg:{fontFamily:g.fontFamilies.sans,fontSize:V.lg,fontWeight:K.medium,lineHeight:O.none},badge:{fontFamily:g.fontFamilies.sans,fontSize:V.xs,fontWeight:K.medium,lineHeight:O.none},tooltip:{fontFamily:g.fontFamilies.sans,fontSize:V.xs,fontWeight:K.medium,lineHeight:O.snug},alertTitle:{fontFamily:g.fontFamilies.sans,fontSize:V.md,fontWeight:K.semibold,lineHeight:O.tight},alertDescription:{fontFamily:g.fontFamilies.sans,fontSize:V.md,fontWeight:K.regular,lineHeight:O.normal},modalTitle:{fontFamily:g.fontFamilies.sans,fontSize:g.fontSizes.lg,fontWeight:K.semibold,lineHeight:O.tight},modalDescription:{fontFamily:g.fontFamilies.sans,fontSize:V.md,fontWeight:K.regular,lineHeight:O.normal},emptyStateTitle:{fontFamily:g.fontFamilies.sans,fontSize:g.fontSizes.lg,fontWeight:K.semibold,lineHeight:O.tight},emptyStateDescription:{fontFamily:g.fontFamilies.sans,fontSize:V.md,fontWeight:K.regular,lineHeight:O.normal},dividerLabel:{fontFamily:g.fontFamilies.sans,fontSize:V.xs,fontWeight:K.medium,lineHeight:O.normal}},Z={transparent:0,5:.05,10:.1,15:.15,20:.2,25:.25,30:.3,40:.4,50:.5,60:.6,70:.7,75:.75,80:.8,90:.9,95:.95,opaque:1},ye={disabled:Z[50],placeholder:Z[50],hoverOverlay:Z[5],activeOverlay:Z[10],backdrop:Z[40],loading:Z[70],muted:Z[60],subtle:Z[30]},re={pressed:.98,pressedStrong:.95,controlPressed:.92,hidden:.95,normal:1,hover:1.02,emphasized:1.05},zr={collapsed:72,expanded:240,logoSize:g.spacing[8],navIconSize:g.spacing[5]},Mr={height:g.spacing[16],compact:g.spacing[12]},Tr={xs:g.spacing[6],sm:g.spacing[8],md:36,lg:g.spacing[10],xl:g.spacing[12],"2xl":g.spacing[16]},Ir={xs:28,sm:g.spacing[8],md:36,lg:g.spacing[10],xl:g.spacing[12]},Rr={iconContainer:g.spacing[12],padding:g.spacing[4]},Lr={mobile:g.spacing[4],tablet:g.spacing[5],desktop:g.spacing[6],wide:g.spacing[8]},Nr={marginBottom:g.spacing[6]},$r={minWidth:240,iconLeft:g.spacing[3],paddingLeft:36},Hr={iconContainer:g.spacing[12]};function z(...o){return o.filter(Boolean).join(" ")}function Dr(o){return g.spacing[o]}function P(o){if(o===void 0)return;const t=g.spacing[o];return t===0?"0":`${t}px`}function be(o){const t={};return o.m!==void 0&&(t.margin=P(o.m)),o.mx!==void 0&&(t.marginLeft=P(o.mx),t.marginRight=P(o.mx)),o.my!==void 0&&(t.marginTop=P(o.my),t.marginBottom=P(o.my)),o.mt!==void 0&&(t.marginTop=P(o.mt)),o.mr!==void 0&&(t.marginRight=P(o.mr)),o.mb!==void 0&&(t.marginBottom=P(o.mb)),o.ml!==void 0&&(t.marginLeft=P(o.ml)),o.p!==void 0&&(t.padding=P(o.p)),o.px!==void 0&&(t.paddingLeft=P(o.px),t.paddingRight=P(o.px)),o.py!==void 0&&(t.paddingTop=P(o.py),t.paddingBottom=P(o.py)),o.pt!==void 0&&(t.paddingTop=P(o.pt)),o.pr!==void 0&&(t.paddingRight=P(o.pr)),o.pb!==void 0&&(t.paddingBottom=P(o.pb)),o.pl!==void 0&&(t.paddingLeft=P(o.pl)),t}let Wr=0;function Er(o="brycks"){return`${o}-${++Wr}`}function Br(o,t){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);if(!r)return o;const s=parseInt(r[1],16),n=parseInt(r[2],16),a=parseInt(r[3],16);return`rgba(${s}, ${n}, ${a}, ${t})`}const Fr={none:"0",xs:"var(--brycks-radius-xs)",sm:"var(--brycks-radius-sm)",md:"var(--brycks-radius-md)",lg:"var(--brycks-radius-lg)",xl:"var(--brycks-radius-xl)","2xl":"var(--brycks-radius-2xl)","3xl":"var(--brycks-radius-3xl)",full:"var(--brycks-radius-full)"},Ar={none:"none",xs:"var(--brycks-shadow-xs)",sm:"var(--brycks-shadow-sm)",md:"var(--brycks-shadow-md)",lg:"var(--brycks-shadow-lg)",xl:"var(--brycks-shadow-xl)","2xl":"var(--brycks-shadow-2xl)"};function Pr(o){const r={...be(o)};return o.display&&(r.display=o.display),o.position&&(r.position=o.position),o.width&&(r.width=o.width),o.height&&(r.height=o.height),o.minWidth&&(r.minWidth=o.minWidth),o.maxWidth&&(r.maxWidth=o.maxWidth),o.minHeight&&(r.minHeight=o.minHeight),o.maxHeight&&(r.maxHeight=o.maxHeight),o.overflow&&(r.overflow=o.overflow),o.bg&&(r.backgroundColor=o.bg),o.radius&&(r.borderRadius=Fr[o.radius]),o.shadow&&(r.boxShadow=Ar[o.shadow]),r}const Vr=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","display","position","width","height","minWidth","maxWidth","minHeight","maxHeight","overflow","bg","radius","shadow","testId"];function Or(o){const t={...o};for(const r of Vr)delete t[r];return t}const Xr=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=Pr(a),d=Or(a);return e.jsx(l,{ref:c,className:z("brycks-box",t),style:{...u,...r},"data-testid":n,...d,children:s})},Le=i.forwardRef(Xr);Le.displayName="Box";const Yr=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","direction","gap","gapX","gapY","align","justify","wrap","inline","testId"];function Gr(o){const t={...o};for(const r of Yr)delete t[r];return t}function qr(o){const r={...be(o),display:o.inline?"inline-flex":"flex",flexDirection:o.direction??"column"};return o.gap!==void 0?r.gap=P(o.gap):(o.gapX!==void 0&&(r.columnGap=P(o.gapX)),o.gapY!==void 0&&(r.rowGap=P(o.gapY))),o.align&&(r.alignItems=o.align),o.justify&&(r.justifyContent=o.justify),o.wrap&&(r.flexWrap=o.wrap),r}const Kr=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=qr(a),d=Gr(a);return e.jsx(l,{ref:c,className:z("brycks-stack",t),style:{...u,...r},"data-testid":n,...d,children:s})},me=i.forwardRef(Kr);me.displayName="Stack";const _r=(o,t)=>e.jsx(me,{ref:t,direction:"row",align:"center",...o}),Ne=i.forwardRef(_r);Ne.displayName="HStack";const Ur=(o,t)=>e.jsx(me,{ref:t,direction:"column",...o}),$e=i.forwardRef(Ur);$e.displayName="VStack";const Qr=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","columns","rows","gap","gapX","gapY","align","justify","templateColumns","templateRows","flow","inline","testId"];function Zr(o){const t={...o};for(const r of Qr)delete t[r];return t}function Jr(o){const r={...be(o),display:o.inline?"inline-grid":"grid"};return o.columns!==void 0&&(r.gridTemplateColumns=typeof o.columns=="number"?`repeat(${o.columns}, 1fr)`:o.columns),o.rows!==void 0&&(r.gridTemplateRows=typeof o.rows=="number"?`repeat(${o.rows}, 1fr)`:o.rows),o.templateColumns&&(r.gridTemplateColumns=o.templateColumns),o.templateRows&&(r.gridTemplateRows=o.templateRows),o.gap!==void 0?r.gap=P(o.gap):(o.gapX!==void 0&&(r.columnGap=P(o.gapX)),o.gapY!==void 0&&(r.rowGap=P(o.gapY))),o.align&&(r.alignItems=o.align),o.justify&&(r.justifyItems=o.justify),o.flow&&(r.gridAutoFlow=o.flow),r}const eo=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=Jr(a),d=Zr(a);return e.jsx(l,{ref:c,className:z("brycks-grid",t),style:{...u,...r},"data-testid":n,...d,children:s})},He=i.forwardRef(eo);He.displayName="Grid";const to=({as:o,className:t,style:r,children:s,testId:n,colSpan:a,rowSpan:c,colStart:l,colEnd:u,rowStart:d,rowEnd:f,...p},k)=>{const y=o||"div",b={};return a!==void 0&&(b.gridColumn=a==="full"?"1 / -1":`span ${a}`),c!==void 0&&(b.gridRow=`span ${c}`),l!==void 0&&(b.gridColumnStart=l),u!==void 0&&(b.gridColumnEnd=u),d!==void 0&&(b.gridRowStart=d),f!==void 0&&(b.gridRowEnd=f),e.jsx(y,{ref:k,className:z("brycks-grid-item",t),style:{...b,...r},"data-testid":n,...p,children:s})},De=i.forwardRef(to);De.displayName="GridItem";const ro=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","size","centered","padded","testId"];function oo(o){const t={...o};for(const r of ro)delete t[r];return t}function so(o){const t=be(o),r=o.size??"xl",s=g.containers[r],n={...t,width:"100%",maxWidth:typeof s=="number"?`${s}px`:s};return o.centered!==!1&&(n.marginLeft="auto",n.marginRight="auto"),o.padded!==!1&&(n.paddingLeft="var(--brycks-space-4)",n.paddingRight="var(--brycks-space-4)"),n}const no=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=so(a),d=oo(a);return e.jsx(l,{ref:c,className:z("brycks-container",t),style:{...u,...r},"data-testid":n,...d,children:s})},We=i.forwardRef(no);We.displayName="Container";const ao={none:0,sm:12,md:16,lg:24,xl:32},Ee=i.forwardRef(function({variant:t="elevated",padding:r="md",interactive:s=!1,selected:n=!1,className:a,style:c,children:l,testId:u,...d},f){const k={...(()=>{const y={borderRadius:"var(--brycks-radius-lg)",transition:"transform 150ms ease-out, box-shadow 150ms ease-out, border-color 150ms ease-out"};switch(t){case"elevated":return{...y,backgroundColor:"var(--brycks-background-elevated)",boxShadow:n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-md)":"var(--brycks-shadow-md)",border:"1px solid var(--brycks-border-subtle)"};case"outline":return{...y,backgroundColor:"var(--brycks-background-default)",border:n?"2px solid var(--brycks-primary-default)":"1px solid var(--brycks-border-default)"};case"filled":return{...y,backgroundColor:"var(--brycks-background-muted)",border:n?"2px solid var(--brycks-primary-default)":"1px solid transparent"};case"ghost":return{...y,backgroundColor:"transparent",border:n?"2px solid var(--brycks-primary-default)":"1px solid transparent"}}})(),padding:ao[r],display:"flex",flexDirection:"column",cursor:s?"pointer":void 0,...c};return e.jsx("div",{ref:f,className:z("brycks-card",`brycks-card--${t}`,s&&"brycks-card--interactive",n&&"brycks-card--selected",a),style:k,"data-testid":u,onMouseEnter:s?y=>{const b=y.currentTarget;t==="elevated"?(b.style.boxShadow=n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-lg)":"var(--brycks-shadow-lg)",b.style.transform="translateY(-2px)"):t!=="ghost"&&(b.style.borderColor="var(--brycks-border-strong)")}:void 0,onMouseLeave:s?y=>{const b=y.currentTarget;t==="elevated"?(b.style.boxShadow=n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-md)":"var(--brycks-shadow-md)",b.style.transform="translateY(0)"):t!=="ghost"&&(b.style.borderColor=n?"var(--brycks-primary-default)":"var(--brycks-border-default)")}:void 0,...d,children:l})});Ee.displayName="Card";const Be=i.forwardRef(function({divider:t=!1,className:r,style:s,children:n,...a},c){const l={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,paddingBottom:t?16:0,marginBottom:t?16:12,borderBottom:t?"1px solid var(--brycks-border-muted)":void 0,...s};return e.jsx("div",{ref:c,className:z("brycks-card-header",r),style:l,...a,children:n})});Be.displayName="CardHeader";const Fe=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={flex:1,...r};return e.jsx("div",{ref:a,className:z("brycks-card-body",t),style:c,...n,children:s})});Fe.displayName="CardBody";const Ae=i.forwardRef(function({divider:t=!1,align:r="right",className:s,style:n,children:a,...c},l){const d={display:"flex",alignItems:"center",justifyContent:{left:"flex-start",center:"center",right:"flex-end",between:"space-between"}[r],gap:12,paddingTop:t?16:0,marginTop:t?16:12,borderTop:t?"1px solid var(--brycks-border-muted)":void 0,...n};return e.jsx("div",{ref:l,className:z("brycks-card-footer",s),style:d,...c,children:a})});Ae.displayName="CardFooter";const Te={none:0,sm:16,md:24,lg:32,xl:48},Pe=i.forwardRef(function({title:t,description:r,titleLevel:s="h2",spacing:n="md",divider:a=!1,actions:c,className:l,style:u,children:d,testId:f,...p},k){const y=s,b={display:"flex",flexDirection:"column",gap:16,paddingTop:a?Te[n]:0,marginTop:Te[n],borderTop:a?"1px solid var(--brycks-border-muted)":void 0,...u},h={display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},m={display:"flex",flexDirection:"column",gap:4},x={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},w={fontSize:14,color:"var(--brycks-foreground-muted)",margin:0,lineHeight:1.5},S={display:"flex",alignItems:"center",gap:8,flexShrink:0},C={display:"flex",flexDirection:"column"},R=t||r||c;return e.jsxs("section",{ref:k,className:z("brycks-section",l),style:b,"data-testid":f,...p,children:[R&&e.jsxs("div",{className:"brycks-section-header",style:h,children:[e.jsxs("div",{style:m,children:[t&&e.jsx(y,{style:x,children:t}),r&&e.jsx("p",{style:w,children:r})]}),c&&e.jsx("div",{style:S,children:c})]}),e.jsx("div",{className:"brycks-section-content",style:C,children:d})]})});Pe.displayName="Section";const Ve=i.forwardRef(function({size:t,customSize:r,flex:s=!1,direction:n="vertical",className:a,style:c,...l},u){const d=r??(t?g.spacing[t]:void 0),f={flex:s?1:void 0,width:n==="horizontal"?d??(s?void 0:0):void 0,height:n==="vertical"?d??(s?void 0:0):void 0,minWidth:n==="horizontal"&&d?d:void 0,minHeight:n==="vertical"&&d?d:void 0,flexShrink:0,...c};return e.jsx("div",{ref:u,className:z("brycks-spacer",a),style:f,"aria-hidden":"true",...l})});Ve.displayName="Spacer";const io={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly"},Oe={start:"flex-start",end:"flex-end",center:"center",baseline:"baseline",stretch:"stretch"},Xe=i.forwardRef(function({direction:t="row",wrap:r="nowrap",justify:s="start",align:n="stretch",gap:a,rowGap:c,columnGap:l,inline:u=!1,grow:d,shrink:f,basis:p,children:k,className:y,style:b,testId:h,...m},x){const w={display:u?"inline-flex":"flex",flexDirection:t,flexWrap:r,justifyContent:io[s],alignItems:Oe[n],gap:a?g.spacing[a]:void 0,rowGap:c?g.spacing[c]:void 0,columnGap:l?g.spacing[l]:void 0,flexGrow:d,flexShrink:f,flexBasis:p,...b};return e.jsx("div",{ref:x,className:z("brycks-flex",y),style:w,"data-testid":h,...m,children:k})});Xe.displayName="Flex";const Ye=i.forwardRef(function({grow:t,shrink:r,basis:s,alignSelf:n,order:a,children:c,className:l,style:u,testId:d,...f},p){const k={flexGrow:t,flexShrink:r,flexBasis:s,alignSelf:n?Oe[n]:void 0,order:a,...u};return e.jsx("div",{ref:p,className:z("brycks-flex-item",l),style:k,"data-testid":d,...f,children:c})});Ye.displayName="FlexItem";const Ge={body:{element:"p",styles:g.textStyles.bodyDefault},bodyLarge:{element:"p",styles:g.textStyles.bodyLarge},bodySmall:{element:"p",styles:g.textStyles.bodySmall},label:{element:"span",styles:g.textStyles.label},caption:{element:"span",styles:g.textStyles.caption},overline:{element:"span",styles:g.textStyles.overline},code:{element:"code",styles:g.textStyles.code}};function lo(o){const t=o.variant??"body",r=Ge[t].styles,s={fontFamily:r.fontFamily,fontSize:o.size?g.fontSizes[o.size]:r.fontSize,fontWeight:o.weight?g.fontWeights[o.weight]:r.fontWeight,lineHeight:o.leading?g.lineHeights[o.leading]:r.lineHeight,letterSpacing:r.letterSpacing};return"textTransform"in r&&(s.textTransform=r.textTransform),o.align&&(s.textAlign=o.align),o.color&&(s.color=o.color),o.truncate&&(s.overflow="hidden",s.textOverflow="ellipsis",s.whiteSpace="nowrap"),o.lineClamp&&(s.display="-webkit-box",s.WebkitLineClamp=o.lineClamp,s.WebkitBoxOrient="vertical",s.overflow="hidden"),s}const co=({as:o,variant:t="body",className:r,style:s,children:n,testId:a,...c},l)=>{const u=o||Ge[t].element,d=lo({variant:t,...c}),{size:f,weight:p,leading:k,align:y,color:b,truncate:h,lineClamp:m,...x}=c;return e.jsx(u,{ref:l,className:z("brycks-text",`brycks-text--${t}`,r),style:{...d,...s},"data-testid":a,...x,children:n})},pe=i.forwardRef(co);pe.displayName="Text";const uo=(o,t)=>e.jsx(pe,{...o,ref:t,variant:"code",style:{backgroundColor:"var(--brycks-background-muted)",padding:`${g.spacing[.5]}px ${g.spacing[1.5]}px`,borderRadius:"var(--brycks-radius-sm)",...o.style}}),qe=i.forwardRef(uo);qe.displayName="Code";const fo={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6",display:"displayMedium",displayLarge:"displayLarge",displaySmall:"displaySmall"};function yo(o){const t=o.level??2,r=o.size??t,s=fo[r],n=g.textStyles[s],a={fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:o.weight?g.fontWeights[o.weight]:n.fontWeight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,margin:0};return o.align&&(a.textAlign=o.align),o.color&&(a.color=o.color),o.truncate&&(a.overflow="hidden",a.textOverflow="ellipsis",a.whiteSpace="nowrap"),a}const bo=({as:o,level:t=2,className:r,style:s,children:n,testId:a,...c},l)=>{const u=o||`h${t}`,d=yo({level:t,...c}),{size:f,weight:p,align:k,color:y,truncate:b,...h}=c;return e.jsx(u,{ref:l,className:z("brycks-heading",`brycks-heading--${t}`,r),style:{...d,...s},"data-testid":a,...h,children:n})},he=i.forwardRef(bo);he.displayName="Heading";const go=({size:o="display",...t},r)=>e.jsx(he,{ref:r,level:1,size:o,...t}),Ke=i.forwardRef(go);Ke.displayName="Display";const _e={xs:{height:J.xs,paddingX:ee.xs,fontSize:V.xs,iconSize:de.xs,gap:Q.xs,radius:"var(--brycks-radius-md)"},sm:{height:J.sm,paddingX:ee.sm,fontSize:V.sm,iconSize:de.sm,gap:Q.sm,radius:"var(--brycks-radius-md)"},md:{height:J.md,paddingX:ee.md,fontSize:V.md,iconSize:de.md,gap:Q.md,radius:"var(--brycks-radius-default)"},lg:{height:J.lg,paddingX:ee.lg,fontSize:V.lg,iconSize:de.lg,gap:Q.md,radius:"var(--brycks-radius-lg)"},xl:{height:J.xl,paddingX:ee.xl,fontSize:V.xl,iconSize:de.xl,gap:Q.lg,radius:"var(--brycks-radius-xl)"}},mo={primary:{solid:{bg:"var(--brycks-primary-default)",hoverBg:"var(--brycks-primary-hover)",activeBg:"var(--brycks-primary-active)",text:"var(--brycks-primary-foreground)"},outline:{border:"var(--brycks-primary-default)",hoverBg:"var(--brycks-primary-muted)",text:"var(--brycks-primary-default)"},ghost:{hoverBg:"var(--brycks-primary-muted)",text:"var(--brycks-primary-default)"},soft:{bg:"var(--brycks-primary-muted)",hoverBg:"var(--brycks-primary-soft-hover)",text:"var(--brycks-primary-default)"},link:{text:"var(--brycks-primary-default)",hoverText:"var(--brycks-primary-hover)"}},accent:{solid:{bg:"var(--brycks-accent-default)",hoverBg:"var(--brycks-accent-hover)",activeBg:"var(--brycks-accent-active)",text:"var(--brycks-accent-foreground)"},outline:{border:"var(--brycks-accent-default)",hoverBg:"var(--brycks-accent-muted)",text:"var(--brycks-accent-default)"},ghost:{hoverBg:"var(--brycks-accent-muted)",text:"var(--brycks-accent-default)"},soft:{bg:"var(--brycks-accent-muted)",hoverBg:"var(--brycks-accent-soft-hover)",text:"var(--brycks-accent-default)"},link:{text:"var(--brycks-accent-default)",hoverText:"var(--brycks-accent-hover)"}},neutral:{solid:{bg:"var(--brycks-foreground-default)",hoverBg:"var(--brycks-foreground-muted)",activeBg:"var(--brycks-foreground-subtle)",text:"var(--brycks-background-app)"},outline:{border:"var(--brycks-border-strong)",hoverBg:"var(--brycks-background-muted)",text:"var(--brycks-foreground-default)"},ghost:{hoverBg:"var(--brycks-background-muted)",text:"var(--brycks-foreground-default)"},soft:{bg:"var(--brycks-background-muted)",hoverBg:"var(--brycks-background-subtle)",text:"var(--brycks-foreground-default)"},link:{text:"var(--brycks-foreground-default)",hoverText:"var(--brycks-foreground-muted)"}},success:{solid:{bg:"var(--brycks-success-default)",hoverBg:"var(--brycks-success-hover)",activeBg:"var(--brycks-success-hover)",text:"var(--brycks-success-foreground)"},outline:{border:"var(--brycks-success-default)",hoverBg:"var(--brycks-success-muted)",text:"var(--brycks-success-default)"},ghost:{hoverBg:"var(--brycks-success-muted)",text:"var(--brycks-success-default)"},soft:{bg:"var(--brycks-success-muted)",hoverBg:"var(--brycks-success-soft-hover)",text:"var(--brycks-success-default)"},link:{text:"var(--brycks-success-default)",hoverText:"var(--brycks-success-hover)"}},warning:{solid:{bg:"var(--brycks-warning-default)",hoverBg:"var(--brycks-warning-hover)",activeBg:"var(--brycks-warning-hover)",text:"var(--brycks-warning-foreground)"},outline:{border:"var(--brycks-warning-default)",hoverBg:"var(--brycks-warning-muted)",text:"var(--brycks-warning-default)"},ghost:{hoverBg:"var(--brycks-warning-muted)",text:"var(--brycks-warning-default)"},soft:{bg:"var(--brycks-warning-muted)",hoverBg:"var(--brycks-warning-soft-hover)",text:"var(--brycks-warning-default)"},link:{text:"var(--brycks-warning-default)",hoverText:"var(--brycks-warning-hover)"}},error:{solid:{bg:"var(--brycks-error-default)",hoverBg:"var(--brycks-error-hover)",activeBg:"var(--brycks-error-hover)",text:"var(--brycks-error-foreground)"},outline:{border:"var(--brycks-error-default)",hoverBg:"var(--brycks-error-muted)",text:"var(--brycks-error-default)"},ghost:{hoverBg:"var(--brycks-error-muted)",text:"var(--brycks-error-default)"},soft:{bg:"var(--brycks-error-muted)",hoverBg:"var(--brycks-error-soft-hover)",text:"var(--brycks-error-default)"},link:{text:"var(--brycks-error-default)",hoverText:"var(--brycks-error-hover)"}}};function po(o){const{variant:t,intent:r,size:s,fullWidth:n,isIconOnly:a}=o,c=_e[s],l=mo[r][t],u={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:c.gap,height:c.height,minWidth:a?c.height:void 0,width:n?"100%":void 0,padding:a?0:`0 ${c.paddingX}px`,fontSize:c.fontSize,fontWeight:K.medium,fontFamily:"var(--brycks-font-sans)",lineHeight:O.none,borderRadius:c.radius,border:"none",outline:"none",cursor:"pointer",userSelect:"none",textDecoration:"none",transition:oe.quick,WebkitTapHighlightColor:"transparent"};switch(t){case"solid":{const y=l;Object.assign(u,{backgroundColor:y.bg,color:y.text,boxShadow:"var(--brycks-shadow-xs)"});break}case"outline":{const y=l;Object.assign(u,{backgroundColor:"transparent",color:y.text,border:`1px solid ${y.border}`});break}case"ghost":{Object.assign(u,{backgroundColor:"transparent",color:l.text});break}case"soft":{const y=l;Object.assign(u,{backgroundColor:y.bg,color:y.text});break}case"link":{Object.assign(u,{backgroundColor:"transparent",color:l.text,height:"auto",padding:0,borderRadius:0});break}}const d={};switch(t){case"solid":{const y=l;d.backgroundColor=y.hoverBg,d.boxShadow="var(--brycks-shadow-sm)";break}case"outline":{const y=l;d.backgroundColor=y.hoverBg;break}case"ghost":{const y=l;d.backgroundColor=y.hoverBg;break}case"soft":{const y=l;d.backgroundColor=y.hoverBg;break}case"link":{const y=l;d.color=y.hoverText,d.textDecoration="underline";break}}const f={transform:t!=="link"?`scale(${re.pressed})`:void 0};if(t==="solid"){const y=l;f.backgroundColor=y.activeBg,f.boxShadow="var(--brycks-shadow-xs)"}const p={opacity:ye.disabled,cursor:"not-allowed",pointerEvents:"none"};return{base:u,hover:d,active:f,disabled:p,loading:{cursor:"wait",pointerEvents:"none"}}}function ho({size:o}){return e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"brycks-spin 1s linear infinite"},children:[e.jsx("style",{children:`
|
|
51
|
+
`},O={xs:f.fontSizes.xs,sm:f.fontSizes.sm,md:f.fontSizes.base,lg:15,xl:f.fontSizes.md},q={regular:f.fontWeights.regular,medium:f.fontWeights.medium,semibold:f.fontWeights.semibold,bold:f.fontWeights.bold},V={none:f.lineHeights.none,tight:f.lineHeights.snug,snug:1.4,normal:f.lineHeights.normal,relaxed:1.6},Nr={label:{fontFamily:f.fontFamilies.sans,fontSize:O.sm,fontWeight:q.medium,lineHeight:V.normal},helperText:{fontFamily:f.fontFamilies.sans,fontSize:O.xs,fontWeight:q.regular,lineHeight:V.relaxed},errorText:{fontFamily:f.fontFamilies.sans,fontSize:O.xs,fontWeight:q.regular,lineHeight:V.relaxed},buttonSm:{fontFamily:f.fontFamilies.sans,fontSize:O.sm,fontWeight:q.medium,lineHeight:V.none},buttonMd:{fontFamily:f.fontFamilies.sans,fontSize:O.md,fontWeight:q.medium,lineHeight:V.none},buttonLg:{fontFamily:f.fontFamilies.sans,fontSize:O.lg,fontWeight:q.medium,lineHeight:V.none},badge:{fontFamily:f.fontFamilies.sans,fontSize:O.xs,fontWeight:q.medium,lineHeight:V.none},tooltip:{fontFamily:f.fontFamilies.sans,fontSize:O.xs,fontWeight:q.medium,lineHeight:V.snug},alertTitle:{fontFamily:f.fontFamilies.sans,fontSize:O.md,fontWeight:q.semibold,lineHeight:V.tight},alertDescription:{fontFamily:f.fontFamilies.sans,fontSize:O.md,fontWeight:q.regular,lineHeight:V.normal},modalTitle:{fontFamily:f.fontFamilies.sans,fontSize:f.fontSizes.lg,fontWeight:q.semibold,lineHeight:V.tight},modalDescription:{fontFamily:f.fontFamilies.sans,fontSize:O.md,fontWeight:q.regular,lineHeight:V.normal},emptyStateTitle:{fontFamily:f.fontFamilies.sans,fontSize:f.fontSizes.lg,fontWeight:q.semibold,lineHeight:V.tight},emptyStateDescription:{fontFamily:f.fontFamilies.sans,fontSize:O.md,fontWeight:q.regular,lineHeight:V.normal},dividerLabel:{fontFamily:f.fontFamilies.sans,fontSize:O.xs,fontWeight:q.medium,lineHeight:V.normal}},Z={transparent:0,5:.05,10:.1,15:.15,20:.2,25:.25,30:.3,40:.4,50:.5,60:.6,70:.7,75:.75,80:.8,90:.9,95:.95,opaque:1},ye={disabled:Z[50],placeholder:Z[50],hoverOverlay:Z[5],activeOverlay:Z[10],backdrop:Z[40],loading:Z[70],muted:Z[60],subtle:Z[30]},re={pressed:.98,pressedStrong:.95,controlPressed:.92,hidden:.95,normal:1,hover:1.02,emphasized:1.05},$r={collapsed:72,expanded:240,logoSize:f.spacing[8],navIconSize:f.spacing[5]},Hr={height:f.spacing[16],compact:f.spacing[12]},Wr={xs:f.spacing[6],sm:f.spacing[8],md:36,lg:f.spacing[10],xl:f.spacing[12],"2xl":f.spacing[16]},Dr={xs:28,sm:f.spacing[8],md:36,lg:f.spacing[10],xl:f.spacing[12]},Fr={iconContainer:f.spacing[12],padding:f.spacing[4]},Er={mobile:f.spacing[4],tablet:f.spacing[5],desktop:f.spacing[6],wide:f.spacing[8]},Br={marginBottom:f.spacing[6]},Ar={minWidth:240,iconLeft:f.spacing[3],paddingLeft:36},Pr={iconContainer:f.spacing[12]};function z(...o){return o.filter(Boolean).join(" ")}function Or(o){return f.spacing[o]}function P(o){if(o===void 0)return;const t=f.spacing[o];return t===0?"0":`${t}px`}function be(o){const t={};return o.m!==void 0&&(t.margin=P(o.m)),o.mx!==void 0&&(t.marginLeft=P(o.mx),t.marginRight=P(o.mx)),o.my!==void 0&&(t.marginTop=P(o.my),t.marginBottom=P(o.my)),o.mt!==void 0&&(t.marginTop=P(o.mt)),o.mr!==void 0&&(t.marginRight=P(o.mr)),o.mb!==void 0&&(t.marginBottom=P(o.mb)),o.ml!==void 0&&(t.marginLeft=P(o.ml)),o.p!==void 0&&(t.padding=P(o.p)),o.px!==void 0&&(t.paddingLeft=P(o.px),t.paddingRight=P(o.px)),o.py!==void 0&&(t.paddingTop=P(o.py),t.paddingBottom=P(o.py)),o.pt!==void 0&&(t.paddingTop=P(o.pt)),o.pr!==void 0&&(t.paddingRight=P(o.pr)),o.pb!==void 0&&(t.paddingBottom=P(o.pb)),o.pl!==void 0&&(t.paddingLeft=P(o.pl)),t}let Vr=0;function Xr(o="brycks"){return`${o}-${++Vr}`}function Gr(o,t){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);if(!r)return o;const s=parseInt(r[1],16),n=parseInt(r[2],16),a=parseInt(r[3],16);return`rgba(${s}, ${n}, ${a}, ${t})`}const Yr={none:"0",xs:"var(--brycks-radius-xs)",sm:"var(--brycks-radius-sm)",md:"var(--brycks-radius-md)",lg:"var(--brycks-radius-lg)",xl:"var(--brycks-radius-xl)","2xl":"var(--brycks-radius-2xl)","3xl":"var(--brycks-radius-3xl)",full:"var(--brycks-radius-full)"},_r={none:"none",xs:"var(--brycks-shadow-xs)",sm:"var(--brycks-shadow-sm)",md:"var(--brycks-shadow-md)",lg:"var(--brycks-shadow-lg)",xl:"var(--brycks-shadow-xl)","2xl":"var(--brycks-shadow-2xl)"};function qr(o){const r={...be(o)};return o.display&&(r.display=o.display),o.position&&(r.position=o.position),o.width&&(r.width=o.width),o.height&&(r.height=o.height),o.minWidth&&(r.minWidth=o.minWidth),o.maxWidth&&(r.maxWidth=o.maxWidth),o.minHeight&&(r.minHeight=o.minHeight),o.maxHeight&&(r.maxHeight=o.maxHeight),o.overflow&&(r.overflow=o.overflow),o.bg&&(r.backgroundColor=o.bg),o.radius&&(r.borderRadius=Yr[o.radius]),o.shadow&&(r.boxShadow=_r[o.shadow]),r}const Kr=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","display","position","width","height","minWidth","maxWidth","minHeight","maxHeight","overflow","bg","radius","shadow","testId"];function Ur(o){const t={...o};for(const r of Kr)delete t[r];return t}const Qr=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=qr(a),d=Ur(a);return e.jsx(l,{ref:c,className:z("brycks-box",t),style:{...u,...r},"data-testid":n,...d,children:s})},Ne=i.forwardRef(Qr);Ne.displayName="Box";const Zr=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","direction","gap","gapX","gapY","align","justify","wrap","inline","testId"];function Jr(o){const t={...o};for(const r of Zr)delete t[r];return t}function eo(o){const r={...be(o),display:o.inline?"inline-flex":"flex",flexDirection:o.direction??"column"};return o.gap!==void 0?r.gap=P(o.gap):(o.gapX!==void 0&&(r.columnGap=P(o.gapX)),o.gapY!==void 0&&(r.rowGap=P(o.gapY))),o.align&&(r.alignItems=o.align),o.justify&&(r.justifyContent=o.justify),o.wrap&&(r.flexWrap=o.wrap),r}const to=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=eo(a),d=Jr(a);return e.jsx(l,{ref:c,className:z("brycks-stack",t),style:{...u,...r},"data-testid":n,...d,children:s})},me=i.forwardRef(to);me.displayName="Stack";const ro=(o,t)=>e.jsx(me,{ref:t,direction:"row",align:"center",...o}),$e=i.forwardRef(ro);$e.displayName="HStack";const oo=(o,t)=>e.jsx(me,{ref:t,direction:"column",...o}),He=i.forwardRef(oo);He.displayName="VStack";const so=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","columns","rows","gap","gapX","gapY","align","justify","templateColumns","templateRows","flow","inline","testId"];function no(o){const t={...o};for(const r of so)delete t[r];return t}function ao(o){const r={...be(o),display:o.inline?"inline-grid":"grid"};return o.columns!==void 0&&(r.gridTemplateColumns=typeof o.columns=="number"?`repeat(${o.columns}, 1fr)`:o.columns),o.rows!==void 0&&(r.gridTemplateRows=typeof o.rows=="number"?`repeat(${o.rows}, 1fr)`:o.rows),o.templateColumns&&(r.gridTemplateColumns=o.templateColumns),o.templateRows&&(r.gridTemplateRows=o.templateRows),o.gap!==void 0?r.gap=P(o.gap):(o.gapX!==void 0&&(r.columnGap=P(o.gapX)),o.gapY!==void 0&&(r.rowGap=P(o.gapY))),o.align&&(r.alignItems=o.align),o.justify&&(r.justifyItems=o.justify),o.flow&&(r.gridAutoFlow=o.flow),r}const io=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=ao(a),d=no(a);return e.jsx(l,{ref:c,className:z("brycks-grid",t),style:{...u,...r},"data-testid":n,...d,children:s})},We=i.forwardRef(io);We.displayName="Grid";const lo=({as:o,className:t,style:r,children:s,testId:n,colSpan:a,rowSpan:c,colStart:l,colEnd:u,rowStart:d,rowEnd:y,...p},h)=>{const b=o||"div",g={};return a!==void 0&&(g.gridColumn=a==="full"?"1 / -1":`span ${a}`),c!==void 0&&(g.gridRow=`span ${c}`),l!==void 0&&(g.gridColumnStart=l),u!==void 0&&(g.gridColumnEnd=u),d!==void 0&&(g.gridRowStart=d),y!==void 0&&(g.gridRowEnd=y),e.jsx(b,{ref:h,className:z("brycks-grid-item",t),style:{...g,...r},"data-testid":n,...p,children:s})},De=i.forwardRef(lo);De.displayName="GridItem";const co=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","size","centered","padded","testId"];function uo(o){const t={...o};for(const r of co)delete t[r];return t}function fo(o){const t=be(o),r=o.size??"xl",s=f.containers[r],n={...t,width:"100%",maxWidth:typeof s=="number"?`${s}px`:s};return o.centered!==!1&&(n.marginLeft="auto",n.marginRight="auto"),o.padded!==!1&&(n.paddingLeft="var(--brycks-space-4)",n.paddingRight="var(--brycks-space-4)"),n}const yo=({as:o,className:t,style:r,children:s,testId:n,...a},c)=>{const l=o||"div",u=fo(a),d=uo(a);return e.jsx(l,{ref:c,className:z("brycks-container",t),style:{...u,...r},"data-testid":n,...d,children:s})},Fe=i.forwardRef(yo);Fe.displayName="Container";const bo={none:0,sm:12,md:16,lg:24,xl:32},Ee=i.forwardRef(function({variant:t="elevated",padding:r="md",interactive:s=!1,selected:n=!1,className:a,style:c,children:l,testId:u,...d},y){const h={...(()=>{const b={borderRadius:"var(--brycks-radius-lg)",transition:"transform 150ms ease-out, box-shadow 150ms ease-out, border-color 150ms ease-out"};switch(t){case"elevated":return{...b,backgroundColor:"var(--brycks-background-elevated)",boxShadow:n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-md)":"var(--brycks-shadow-md)",border:"1px solid var(--brycks-border-subtle)"};case"outline":return{...b,backgroundColor:"var(--brycks-background-default)",border:n?"2px solid var(--brycks-primary-default)":"1px solid var(--brycks-border-default)"};case"filled":return{...b,backgroundColor:"var(--brycks-background-muted)",border:n?"2px solid var(--brycks-primary-default)":"1px solid transparent"};case"ghost":return{...b,backgroundColor:"transparent",border:n?"2px solid var(--brycks-primary-default)":"1px solid transparent"}}})(),padding:bo[r],display:"flex",flexDirection:"column",cursor:s?"pointer":void 0,...c};return e.jsx("div",{ref:y,className:z("brycks-card",`brycks-card--${t}`,s&&"brycks-card--interactive",n&&"brycks-card--selected",a),style:h,"data-testid":u,onMouseEnter:s?b=>{const g=b.currentTarget;t==="elevated"?(g.style.boxShadow=n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-lg)":"var(--brycks-shadow-lg)",g.style.transform="translateY(-2px)"):t!=="ghost"&&(g.style.borderColor="var(--brycks-border-strong)")}:void 0,onMouseLeave:s?b=>{const g=b.currentTarget;t==="elevated"?(g.style.boxShadow=n?"0 0 0 2px var(--brycks-primary-default), var(--brycks-shadow-md)":"var(--brycks-shadow-md)",g.style.transform="translateY(0)"):t!=="ghost"&&(g.style.borderColor=n?"var(--brycks-primary-default)":"var(--brycks-border-default)")}:void 0,...d,children:l})});Ee.displayName="Card";const Be=i.forwardRef(function({divider:t=!1,className:r,style:s,children:n,...a},c){const l={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,paddingBottom:t?16:0,marginBottom:t?16:12,borderBottom:t?"1px solid var(--brycks-border-muted)":void 0,...s};return e.jsx("div",{ref:c,className:z("brycks-card-header",r),style:l,...a,children:n})});Be.displayName="CardHeader";const Ae=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={flex:1,...r};return e.jsx("div",{ref:a,className:z("brycks-card-body",t),style:c,...n,children:s})});Ae.displayName="CardBody";const Pe=i.forwardRef(function({divider:t=!1,align:r="right",className:s,style:n,children:a,...c},l){const d={display:"flex",alignItems:"center",justifyContent:{left:"flex-start",center:"center",right:"flex-end",between:"space-between"}[r],gap:12,paddingTop:t?16:0,marginTop:t?16:12,borderTop:t?"1px solid var(--brycks-border-muted)":void 0,...n};return e.jsx("div",{ref:l,className:z("brycks-card-footer",s),style:d,...c,children:a})});Pe.displayName="CardFooter";const Te={none:0,sm:16,md:24,lg:32,xl:48},Oe=i.forwardRef(function({title:t,description:r,titleLevel:s="h2",spacing:n="md",divider:a=!1,actions:c,className:l,style:u,children:d,testId:y,...p},h){const b=s,g={display:"flex",flexDirection:"column",gap:16,paddingTop:a?Te[n]:0,marginTop:Te[n],borderTop:a?"1px solid var(--brycks-border-muted)":void 0,...u},k={display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},m={display:"flex",flexDirection:"column",gap:4},x={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},w={fontSize:14,color:"var(--brycks-foreground-muted)",margin:0,lineHeight:1.5},S={display:"flex",alignItems:"center",gap:8,flexShrink:0},j={display:"flex",flexDirection:"column"},I=t||r||c;return e.jsxs("section",{ref:h,className:z("brycks-section",l),style:g,"data-testid":y,...p,children:[I&&e.jsxs("div",{className:"brycks-section-header",style:k,children:[e.jsxs("div",{style:m,children:[t&&e.jsx(b,{style:x,children:t}),r&&e.jsx("p",{style:w,children:r})]}),c&&e.jsx("div",{style:S,children:c})]}),e.jsx("div",{className:"brycks-section-content",style:j,children:d})]})});Oe.displayName="Section";const Ve=i.forwardRef(function({size:t,customSize:r,flex:s=!1,direction:n="vertical",className:a,style:c,...l},u){const d=r??(t?f.spacing[t]:void 0),y={flex:s?1:void 0,width:n==="horizontal"?d??(s?void 0:0):void 0,height:n==="vertical"?d??(s?void 0:0):void 0,minWidth:n==="horizontal"&&d?d:void 0,minHeight:n==="vertical"&&d?d:void 0,flexShrink:0,...c};return e.jsx("div",{ref:u,className:z("brycks-spacer",a),style:y,"aria-hidden":"true",...l})});Ve.displayName="Spacer";const go={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly"},Xe={start:"flex-start",end:"flex-end",center:"center",baseline:"baseline",stretch:"stretch"},Ge=i.forwardRef(function({direction:t="row",wrap:r="nowrap",justify:s="start",align:n="stretch",gap:a,rowGap:c,columnGap:l,inline:u=!1,grow:d,shrink:y,basis:p,children:h,className:b,style:g,testId:k,...m},x){const w={display:u?"inline-flex":"flex",flexDirection:t,flexWrap:r,justifyContent:go[s],alignItems:Xe[n],gap:a?f.spacing[a]:void 0,rowGap:c?f.spacing[c]:void 0,columnGap:l?f.spacing[l]:void 0,flexGrow:d,flexShrink:y,flexBasis:p,...g};return e.jsx("div",{ref:x,className:z("brycks-flex",b),style:w,"data-testid":k,...m,children:h})});Ge.displayName="Flex";const Ye=i.forwardRef(function({grow:t,shrink:r,basis:s,alignSelf:n,order:a,children:c,className:l,style:u,testId:d,...y},p){const h={flexGrow:t,flexShrink:r,flexBasis:s,alignSelf:n?Xe[n]:void 0,order:a,...u};return e.jsx("div",{ref:p,className:z("brycks-flex-item",l),style:h,"data-testid":d,...y,children:c})});Ye.displayName="FlexItem";const _e={body:{element:"p",styles:f.textStyles.bodyDefault},bodyLarge:{element:"p",styles:f.textStyles.bodyLarge},bodySmall:{element:"p",styles:f.textStyles.bodySmall},label:{element:"span",styles:f.textStyles.label},caption:{element:"span",styles:f.textStyles.caption},overline:{element:"span",styles:f.textStyles.overline},code:{element:"code",styles:f.textStyles.code}};function mo(o){const t=o.variant??"body",r=_e[t].styles,s={fontFamily:r.fontFamily,fontSize:o.size?f.fontSizes[o.size]:r.fontSize,fontWeight:o.weight?f.fontWeights[o.weight]:r.fontWeight,lineHeight:o.leading?f.lineHeights[o.leading]:r.lineHeight,letterSpacing:r.letterSpacing};return"textTransform"in r&&(s.textTransform=r.textTransform),o.align&&(s.textAlign=o.align),o.color&&(s.color=o.color),o.truncate&&(s.overflow="hidden",s.textOverflow="ellipsis",s.whiteSpace="nowrap"),o.lineClamp&&(s.display="-webkit-box",s.WebkitLineClamp=o.lineClamp,s.WebkitBoxOrient="vertical",s.overflow="hidden"),s}const po=({as:o,variant:t="body",className:r,style:s,children:n,testId:a,...c},l)=>{const u=o||_e[t].element,d=mo({variant:t,...c}),{size:y,weight:p,leading:h,align:b,color:g,truncate:k,lineClamp:m,...x}=c;return e.jsx(u,{ref:l,className:z("brycks-text",`brycks-text--${t}`,r),style:{...d,...s},"data-testid":a,...x,children:n})},ho=i.forwardRef(po),qe=Object.assign(ho,{displayName:"Text"}),ko=(o,t)=>e.jsx(qe,{...o,ref:t,variant:"code",style:{backgroundColor:"var(--brycks-background-muted)",padding:`${f.spacing[.5]}px ${f.spacing[1.5]}px`,borderRadius:"var(--brycks-radius-sm)",...o.style}}),vo=i.forwardRef(ko),xo=Object.assign(vo,{displayName:"Code"}),So={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6",display:"displayMedium",displayLarge:"displayLarge",displaySmall:"displaySmall"};function wo(o){const t=o.level??2,r=o.size??t,s=So[r],n=f.textStyles[s],a={fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:o.weight?f.fontWeights[o.weight]:n.fontWeight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,margin:0};return o.align&&(a.textAlign=o.align),o.color&&(a.color=o.color),o.truncate&&(a.overflow="hidden",a.textOverflow="ellipsis",a.whiteSpace="nowrap"),a}const jo=({as:o,level:t=2,className:r,style:s,children:n,testId:a,...c},l)=>{const u=o||`h${t}`,d=wo({level:t,...c}),{size:y,weight:p,align:h,color:b,truncate:g,...k}=c;return e.jsx(u,{ref:l,className:z("brycks-heading",`brycks-heading--${t}`,r),style:{...d,...s},"data-testid":a,...k,children:n})},pe=i.forwardRef(jo);pe.displayName="Heading";const Co=({size:o="display",...t},r)=>e.jsx(pe,{ref:r,level:1,size:o,...t}),Ke=i.forwardRef(Co);Ke.displayName="Display";const Ue={xs:{height:J.xs,paddingX:ee.xs,fontSize:O.xs,iconSize:de.xs,gap:Q.xs,radius:"var(--brycks-radius-md)"},sm:{height:J.sm,paddingX:ee.sm,fontSize:O.sm,iconSize:de.sm,gap:Q.sm,radius:"var(--brycks-radius-md)"},md:{height:J.md,paddingX:ee.md,fontSize:O.md,iconSize:de.md,gap:Q.md,radius:"var(--brycks-radius-default)"},lg:{height:J.lg,paddingX:ee.lg,fontSize:O.lg,iconSize:de.lg,gap:Q.md,radius:"var(--brycks-radius-lg)"},xl:{height:J.xl,paddingX:ee.xl,fontSize:O.xl,iconSize:de.xl,gap:Q.lg,radius:"var(--brycks-radius-xl)"}},zo={primary:{solid:{bg:"var(--brycks-primary-default)",hoverBg:"var(--brycks-primary-hover)",activeBg:"var(--brycks-primary-active)",text:"var(--brycks-primary-foreground)"},outline:{border:"var(--brycks-primary-default)",hoverBg:"var(--brycks-primary-muted)",text:"var(--brycks-primary-default)"},ghost:{hoverBg:"var(--brycks-primary-muted)",text:"var(--brycks-primary-default)"},soft:{bg:"var(--brycks-primary-muted)",hoverBg:"var(--brycks-primary-soft-hover)",text:"var(--brycks-primary-default)"},link:{text:"var(--brycks-primary-default)",hoverText:"var(--brycks-primary-hover)"}},accent:{solid:{bg:"var(--brycks-accent-default)",hoverBg:"var(--brycks-accent-hover)",activeBg:"var(--brycks-accent-active)",text:"var(--brycks-accent-foreground)"},outline:{border:"var(--brycks-accent-default)",hoverBg:"var(--brycks-accent-muted)",text:"var(--brycks-accent-default)"},ghost:{hoverBg:"var(--brycks-accent-muted)",text:"var(--brycks-accent-default)"},soft:{bg:"var(--brycks-accent-muted)",hoverBg:"var(--brycks-accent-soft-hover)",text:"var(--brycks-accent-default)"},link:{text:"var(--brycks-accent-default)",hoverText:"var(--brycks-accent-hover)"}},neutral:{solid:{bg:"var(--brycks-foreground-default)",hoverBg:"var(--brycks-foreground-muted)",activeBg:"var(--brycks-foreground-subtle)",text:"var(--brycks-background-app)"},outline:{border:"var(--brycks-border-strong)",hoverBg:"var(--brycks-background-muted)",text:"var(--brycks-foreground-default)"},ghost:{hoverBg:"var(--brycks-background-muted)",text:"var(--brycks-foreground-default)"},soft:{bg:"var(--brycks-background-muted)",hoverBg:"var(--brycks-background-subtle)",text:"var(--brycks-foreground-default)"},link:{text:"var(--brycks-foreground-default)",hoverText:"var(--brycks-foreground-muted)"}},success:{solid:{bg:"var(--brycks-success-default)",hoverBg:"var(--brycks-success-hover)",activeBg:"var(--brycks-success-hover)",text:"var(--brycks-success-foreground)"},outline:{border:"var(--brycks-success-default)",hoverBg:"var(--brycks-success-muted)",text:"var(--brycks-success-default)"},ghost:{hoverBg:"var(--brycks-success-muted)",text:"var(--brycks-success-default)"},soft:{bg:"var(--brycks-success-muted)",hoverBg:"var(--brycks-success-soft-hover)",text:"var(--brycks-success-default)"},link:{text:"var(--brycks-success-default)",hoverText:"var(--brycks-success-hover)"}},warning:{solid:{bg:"var(--brycks-warning-default)",hoverBg:"var(--brycks-warning-hover)",activeBg:"var(--brycks-warning-hover)",text:"var(--brycks-warning-foreground)"},outline:{border:"var(--brycks-warning-default)",hoverBg:"var(--brycks-warning-muted)",text:"var(--brycks-warning-default)"},ghost:{hoverBg:"var(--brycks-warning-muted)",text:"var(--brycks-warning-default)"},soft:{bg:"var(--brycks-warning-muted)",hoverBg:"var(--brycks-warning-soft-hover)",text:"var(--brycks-warning-default)"},link:{text:"var(--brycks-warning-default)",hoverText:"var(--brycks-warning-hover)"}},error:{solid:{bg:"var(--brycks-error-default)",hoverBg:"var(--brycks-error-hover)",activeBg:"var(--brycks-error-hover)",text:"var(--brycks-error-foreground)"},outline:{border:"var(--brycks-error-default)",hoverBg:"var(--brycks-error-muted)",text:"var(--brycks-error-default)"},ghost:{hoverBg:"var(--brycks-error-muted)",text:"var(--brycks-error-default)"},soft:{bg:"var(--brycks-error-muted)",hoverBg:"var(--brycks-error-soft-hover)",text:"var(--brycks-error-default)"},link:{text:"var(--brycks-error-default)",hoverText:"var(--brycks-error-hover)"}}};function Mo(o){const{variant:t,intent:r,size:s,fullWidth:n,isIconOnly:a}=o,c=Ue[s],l=zo[r][t],u={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:c.gap,height:c.height,minWidth:a?c.height:void 0,width:n?"100%":void 0,padding:a?0:`0 ${c.paddingX}px`,fontSize:c.fontSize,fontWeight:q.medium,fontFamily:"var(--brycks-font-sans)",lineHeight:V.none,borderRadius:c.radius,border:"none",outline:"none",cursor:"pointer",userSelect:"none",textDecoration:"none",transition:oe.quick,WebkitTapHighlightColor:"transparent"};switch(t){case"solid":{const b=l;Object.assign(u,{backgroundColor:b.bg,color:b.text,boxShadow:"var(--brycks-shadow-xs)"});break}case"outline":{const b=l;Object.assign(u,{backgroundColor:"transparent",color:b.text,border:`1px solid ${b.border}`});break}case"ghost":{Object.assign(u,{backgroundColor:"transparent",color:l.text});break}case"soft":{const b=l;Object.assign(u,{backgroundColor:b.bg,color:b.text});break}case"link":{Object.assign(u,{backgroundColor:"transparent",color:l.text,height:"auto",padding:0,borderRadius:0});break}}const d={};switch(t){case"solid":{const b=l;d.backgroundColor=b.hoverBg,d.boxShadow="var(--brycks-shadow-sm)";break}case"outline":{const b=l;d.backgroundColor=b.hoverBg;break}case"ghost":{const b=l;d.backgroundColor=b.hoverBg;break}case"soft":{const b=l;d.backgroundColor=b.hoverBg;break}case"link":{const b=l;d.color=b.hoverText,d.textDecoration="underline";break}}const y={transform:t!=="link"?`scale(${re.pressed})`:void 0};if(t==="solid"){const b=l;y.backgroundColor=b.activeBg,y.boxShadow="var(--brycks-shadow-xs)"}const p={opacity:ye.disabled,cursor:"not-allowed",pointerEvents:"none"};return{base:u,hover:d,active:y,disabled:p,loading:{cursor:"wait",pointerEvents:"none"}}}function Io({size:o}){return e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"brycks-spin 1s linear infinite"},children:[e.jsx("style",{children:`
|
|
52
52
|
@keyframes brycks-spin {
|
|
53
53
|
from { transform: rotate(0deg); }
|
|
54
54
|
to { transform: rotate(360deg); }
|
|
55
55
|
}
|
|
56
|
-
`}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.4 31.4",opacity:"0.25"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.4 31.4",strokeDashoffset:"62.8",style:{transform:"rotate(-90deg)",transformOrigin:"center"}})]})}const ko=({as:o,variant:t="solid",intent:r="primary",size:s="md",fullWidth:n,isLoading:a,isDisabled:c,leftIcon:l,rightIcon:u,isIconOnly:d,className:f,style:p,children:k,testId:y,onMouseEnter:b,onMouseLeave:h,onMouseDown:m,onMouseUp:x,...w},S)=>{const C=o||"button",[R,v]=i.useState(!1),[M,j]=i.useState(!1),T=c||a,L=po({variant:t,intent:r,size:s,fullWidth:n,isIconOnly:d}),I={...L.base,...R&&!T?L.hover:{},...M&&!T?L.active:{},...T?L.disabled:{},...a?L.loading:{},...p},H=_e[s],$=Y=>{v(!0),b==null||b(Y)},X=Y=>{v(!1),j(!1),h==null||h(Y)},A=Y=>{j(!0),m==null||m(Y)},N=Y=>{j(!1),x==null||x(Y)},D=z("brycks-button",`brycks-button--${t}`,`brycks-button--${r}`,`brycks-button--${s}`,n&&"brycks-button--full-width",d&&"brycks-button--icon-only",a&&"brycks-button--loading",T&&"brycks-button--disabled",f),G=C==="button"||o===void 0?{type:w.type??"button",disabled:T}:{"aria-disabled":T||void 0,role:"button",tabIndex:T?-1:0};return e.jsxs(C,{ref:S,className:D,style:I,"data-testid":y,onMouseEnter:$,onMouseLeave:X,onMouseDown:A,onMouseUp:N,...G,...w,children:[a&&e.jsx("span",{style:{display:"inline-flex",position:d?"absolute":"relative"},children:e.jsx(ho,{size:H.iconSize})}),!a&&l&&e.jsx("span",{style:{display:"inline-flex",width:H.iconSize,height:H.iconSize},children:l}),!d&&e.jsx("span",{style:{opacity:a&&!d?.5:1},children:k}),!a&&u&&e.jsx("span",{style:{display:"inline-flex",width:H.iconSize,height:H.iconSize},children:u}),d&&!a&&k]})},ke=i.forwardRef(ko);ke.displayName="Button";const vo=(o,t)=>e.jsx(ke,{ref:t,isIconOnly:!0,...o}),Ue=i.forwardRef(vo);Ue.displayName="IconButton";const xo={xs:12,sm:14,md:16,lg:20,xl:24,"2xl":32},Qe=i.forwardRef(function({size:t="md",customSize:r,color:s,path:n,paths:a,viewBox:c="0 0 24 24",fillRule:l="nonzero",className:u,style:d,testId:f,label:p,children:k,...y},b){const h=r??xo[t],m={width:h,height:h,minWidth:h,minHeight:h,color:s??"currentColor",display:"inline-block",verticalAlign:"middle",flexShrink:0,...d},x=()=>k||(a&&a.length>0?a.map((w,S)=>e.jsx("path",{d:w,fill:"currentColor",fillRule:l},S)):n?e.jsx("path",{d:n,fill:"currentColor",fillRule:l}):null);return e.jsx("svg",{ref:b,xmlns:"http://www.w3.org/2000/svg",viewBox:c,className:z("brycks-icon",`brycks-icon--${t}`,u),style:m,"aria-hidden":!p,"aria-label":p,role:p?"img":void 0,"data-testid":f,...y,children:x()})});Qe.displayName="Icon";const So={close:"M18 6L6 18M6 6l12 12",check:"M20 6L9 17l-5-5",chevronDown:"M6 9l6 6 6-6",chevronUp:"M18 15l-6-6-6 6",chevronLeft:"M15 18l-6-6 6-6",chevronRight:"M9 18l6-6-6-6",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",menu:"M4 6h16M4 12h16M4 18h16",info:"M12 16v-4m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",eye:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",eyeOff:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",upload:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",edit:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",externalLink:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",logout:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1",arrowLeft:"M10 19l-7-7m0 0l7-7m-7 7h18",arrowRight:"M14 5l7 7m0 0l-7 7m7-7H3",arrowUp:"M5 10l7-7m0 0l7 7m-7-7v18",arrowDown:"M19 14l-7 7m0 0l-7-7m7 7V3",refresh:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",sort:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",file:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",lock:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",unlock:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",share:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",code:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",terminal:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",database:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",cloud:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z",sun:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",moon:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",grip:"M4 6a2 2 0 114 0 2 2 0 01-4 0zM10 6a2 2 0 114 0 2 2 0 01-4 0zM16 6a2 2 0 114 0 2 2 0 01-4 0zM4 12a2 2 0 114 0 2 2 0 01-4 0zM10 12a2 2 0 114 0 2 2 0 01-4 0zM16 12a2 2 0 114 0 2 2 0 01-4 0zM4 18a2 2 0 114 0 2 2 0 01-4 0zM10 18a2 2 0 114 0 2 2 0 01-4 0zM16 18a2 2 0 114 0 2 2 0 01-4 0z",moreHorizontal:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z",moreVertical:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z",layout:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z",car:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9L18 10l-1.6-3.2c-.4-.8-1.2-1.3-2.1-1.3H9.7c-.9 0-1.7.5-2.1 1.3L6 10l-2.5 1.1C2.7 11.3 2 12.1 2 13v3c0 .6.4 1 1 1h2M7 17h10M7 17a2 2 0 11-4 0 2 2 0 014 0zm12 0a2 2 0 11-4 0 2 2 0 014 0z",page:"M4 4a2 2 0 012-2h8l6 6v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm10 0v6h6",gridVertical:"M9 4a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2z"},wo={sm:{height:J.sm,fontSize:V.sm,paddingX:ee.sm,radius:"var(--brycks-radius-md)"},md:{height:J.md,fontSize:V.md,paddingX:ee.md,radius:"var(--brycks-radius-default)"},lg:{height:J.lg,fontSize:V.lg,paddingX:ee.lg,radius:"var(--brycks-radius-lg)"}},ve=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,leftElement:n,rightElement:a,className:c,style:l,testId:u,disabled:d,onFocus:f,onBlur:p,...k},y){const[b,h]=i.useState(!1),m=wo[t],x=()=>{const v={display:"flex",alignItems:"center",width:"100%",position:"relative",height:m.height,borderRadius:m.radius,transition:oe.default};switch(r){case"outline":Object.assign(v,{backgroundColor:"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":b?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,boxShadow:b?s?te.error:te.default:te.none});break;case"filled":Object.assign(v,{backgroundColor:"var(--brycks-background-muted)",border:"1px solid transparent",borderColor:s?"var(--brycks-error-default)":b?"var(--brycks-border-focus)":"transparent"});break;case"flushed":Object.assign(v,{backgroundColor:"transparent",borderRadius:0,borderBottom:`2px solid ${s?"var(--brycks-error-default)":b?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`});break}return d&&Object.assign(v,{opacity:ye.disabled,cursor:"not-allowed"}),v},w={width:"100%",height:m.height,fontFamily:"var(--brycks-font-sans)",fontSize:m.fontSize,color:"var(--brycks-foreground-default)",backgroundColor:"transparent",border:"none",outline:"none",borderRadius:m.radius,paddingLeft:n?Q.md:m.paddingX,paddingRight:a?Q.md:m.paddingX,cursor:d?"not-allowed":"text",transition:oe.default},S=v=>{h(!0),f==null||f(v)},C=v=>{h(!1),p==null||p(v)},R={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--brycks-foreground-muted)",flexShrink:0};return e.jsxs("div",{className:z("brycks-input-wrapper",`brycks-input-wrapper--${r}`,`brycks-input-wrapper--${t}`,s&&"brycks-input-wrapper--invalid",d&&"brycks-input-wrapper--disabled",c),style:{...x(),...l},children:[n&&e.jsx("span",{className:"brycks-input-left-element",style:{...R,paddingLeft:m.paddingX},children:n}),e.jsx("input",{ref:y,className:"brycks-input",style:w,disabled:d,"aria-invalid":s,"data-testid":u,onFocus:S,onBlur:C,...k}),a&&e.jsx("span",{className:"brycks-input-right-element",style:{...R,paddingRight:m.paddingX},children:a})]})});ve.displayName="Input";const Ze=i.forwardRef(function({label:t,helperText:r,errorMessage:s,isRequired:n,hideLabel:a,isInvalid:c,id:l,className:u,testId:d,...f},p){const k=i.useId(),y=l??k,b=`${y}-helper`,h=`${y}-error`,m=!!s||c,x=[m&&h,r&&b].filter(Boolean).join(" "),w={display:"block",marginBottom:6,fontSize:13,fontWeight:500,color:"var(--brycks-foreground-default)",...a&&{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},S={display:"block",marginTop:6,fontSize:12,lineHeight:1.5,color:"var(--brycks-foreground-muted)"},C={...S,color:"var(--brycks-error-default)"};return e.jsxs("div",{className:z("brycks-text-field",m&&"brycks-text-field--error",u),"data-testid":d,children:[t&&e.jsxs("label",{htmlFor:y,style:w,children:[t,n&&e.jsx("span",{"aria-hidden":"true",style:{color:"var(--brycks-error-default)",marginLeft:2},children:"*"})]}),e.jsx(ve,{ref:p,id:y,isInvalid:m,"aria-describedby":x||void 0,"aria-required":n,...f}),m&&s&&e.jsx("span",{id:h,role:"alert",style:C,children:s}),!m&&r&&e.jsx("span",{id:b,style:S,children:r})]})});Ze.displayName="TextField";const jo={sm:{height:32,fontSize:13,padding:10},md:{height:40,fontSize:14,padding:12},lg:{height:48,fontSize:15,padding:14}};function Co(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Je=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,placeholder:n,className:a,style:c,testId:l,disabled:u,children:d,onFocus:f,onBlur:p,value:k,...y},b){const[h,m]=i.useState(!1),x=jo[t],w=k!==void 0&&k!=="",S={position:"relative",display:"inline-flex",width:"100%"},C=()=>{const j={width:"100%",height:x.height,paddingLeft:x.padding,paddingRight:x.padding+24,fontSize:x.fontSize,fontFamily:"var(--brycks-font-sans)",color:w||!n?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":h?"var(--brycks-border-focus)":r==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",cursor:u?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",transition:"all 200ms ease-out",boxShadow:h?s?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return u&&(j.opacity=.5),j},R={position:"absolute",right:x.padding,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"var(--brycks-foreground-muted)",transition:"transform 200ms ease-out"},v=j=>{m(!0),f==null||f(j)},M=j=>{m(!1),p==null||p(j)};return e.jsxs("div",{className:z("brycks-select-wrapper",`brycks-select-wrapper--${r}`,`brycks-select-wrapper--${t}`,s&&"brycks-select-wrapper--invalid",u&&"brycks-select-wrapper--disabled",a),style:{...S,...c},children:[e.jsxs("select",{ref:b,className:"brycks-select",style:C(),disabled:u,"aria-invalid":s,"data-testid":l,value:k,onFocus:v,onBlur:M,...y,children:[n&&e.jsx("option",{value:"",disabled:!0,children:n}),d]}),e.jsx("span",{style:R,children:e.jsx(Co,{})})]})});Je.displayName="Select";function zo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 6H9.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const et=i.forwardRef(function({size:t="md",label:r,description:s,isInvalid:n,isIndeterminate:a,className:c,style:l,testId:u,disabled:d,checked:f,onChange:p,...k},y){const[b,h]=i.useState(!1),[m,x]=i.useState(!1),[w,S]=i.useState(!1),C=Ie[t],R=V[t],v=f||a,M={display:"inline-flex",alignItems:"flex-start",gap:Q.lg,cursor:d?"not-allowed":"pointer",opacity:d?ye.disabled:1},j={position:"relative",width:C.box,height:C.box,borderRadius:"var(--brycks-radius-sm)",border:`1.5px solid ${n?"var(--brycks-error-default)":v?"var(--brycks-primary-default)":b?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,backgroundColor:v?"var(--brycks-primary-default)":m?"var(--brycks-background-subtle)":"var(--brycks-background-app)",transition:oe.quick,transform:w?`scale(${re.controlPressed})`:`scale(${re.normal})`,boxShadow:b?te.default:te.none,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},T={color:"var(--brycks-primary-foreground)",opacity:v?1:0,transform:v?`scale(${re.normal})`:`scale(${re.hidden})`,transition:oe.quick},L={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:d?"not-allowed":"pointer",margin:0},I={display:"flex",flexDirection:"column",gap:Q.xs,paddingTop:(C.box-R)/2},H={fontSize:R,lineHeight:O.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},$={fontSize:R-1,lineHeight:O.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return e.jsxs("label",{className:z("brycks-checkbox",`brycks-checkbox--${t}`,v&&"brycks-checkbox--checked",n&&"brycks-checkbox--invalid",d&&"brycks-checkbox--disabled",c),style:{...M,...l},"data-testid":u,onMouseEnter:()=>x(!0),onMouseLeave:()=>{x(!1),S(!1)},onMouseDown:()=>S(!0),onMouseUp:()=>S(!1),children:[e.jsxs("span",{style:j,children:[e.jsx("input",{ref:y,type:"checkbox",style:L,checked:f,disabled:d,"aria-invalid":n,onChange:p,onFocus:()=>h(!0),onBlur:()=>h(!1),...k}),e.jsx("span",{style:T,children:a?e.jsx(Mo,{size:C.icon}):e.jsx(zo,{size:C.icon})})]}),(r||s)&&e.jsxs("span",{style:I,children:[r&&e.jsx("span",{style:H,children:r}),s&&e.jsx("span",{style:$,children:s})]})]})});et.displayName="Checkbox";const tt=i.forwardRef(function({size:t="md",label:r,description:s,className:n,style:a,testId:c,disabled:l,checked:u,onChange:d,...f},p){const[k,y]=i.useState(!1),[b,h]=i.useState(!1),m=Re[t],x=V[t],w=(m.height-m.thumb)/2,S=m.width-m.thumb-w*2,C={display:"inline-flex",alignItems:"flex-start",gap:Q.xl,cursor:l?"not-allowed":"pointer",opacity:l?ye.disabled:1},R={position:"relative",width:m.width,height:m.height,borderRadius:m.height/2,backgroundColor:u?"var(--brycks-primary-default)":"var(--brycks-background-muted)",border:`1px solid ${u?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,transition:oe.spring,boxShadow:k?te.default:"inset 0 1px 2px rgba(0,0,0,0.05)",flexShrink:0},v={position:"absolute",top:w,left:u?w+S:w,width:b?m.thumb+4:m.thumb,height:m.thumb,borderRadius:m.thumb/2,backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-sm)",transition:oe.spring,transform:b?`scale(${re.pressedStrong})`:`scale(${re.normal})`},M={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:l?"not-allowed":"pointer",margin:0},j={display:"flex",flexDirection:"column",gap:Q.xs,paddingTop:(m.height-x*O.snug)/2},T={fontSize:x,lineHeight:O.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},L={fontSize:x-1,lineHeight:O.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return e.jsxs("label",{className:z("brycks-switch",`brycks-switch--${t}`,u&&"brycks-switch--checked",l&&"brycks-switch--disabled",n),style:{...C,...a},"data-testid":c,onMouseDown:()=>h(!0),onMouseUp:()=>h(!1),onMouseLeave:()=>h(!1),children:[e.jsxs("span",{style:R,children:[e.jsx("input",{ref:p,type:"checkbox",role:"switch",style:M,checked:u,disabled:l,"aria-checked":u,onChange:d,onFocus:()=>y(!0),onBlur:()=>y(!1),...f}),e.jsx("span",{style:v})]}),(r||s)&&e.jsxs("span",{style:j,children:[r&&e.jsx("span",{style:T,children:r}),s&&e.jsx("span",{style:L,children:s})]})]})});tt.displayName="Switch";const To={sm:{fontSize:13,padding:10,lineHeight:1.5},md:{fontSize:14,padding:12,lineHeight:1.5},lg:{fontSize:15,padding:14,lineHeight:1.5}},rt=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,autoResize:n,minRows:a=3,maxRows:c=10,showCount:l,maxLength:u,className:d,style:f,testId:p,disabled:k,value:y,defaultValue:b,onChange:h,onFocus:m,onBlur:x,...w},S){const[C,R]=i.useState(!1),[v,M]=i.useState(0),j=i.useRef(null),T=S||j,L=To[t],I=L.fontSize*L.lineHeight,H=I*a+L.padding*2,$=I*c+L.padding*2,X=i.useCallback(()=>{const W=T.current;if(!W||!n)return;W.style.height="auto";const B=W.scrollHeight,q=Math.min(Math.max(B,H),$);W.style.height=`${q}px`},[n,H,$,T]);i.useEffect(()=>{X()},[y,X]),i.useEffect(()=>{const W=String(y??b??"");M(W.length)},[y,b]);const A=()=>{const W={width:"100%",minHeight:H,maxHeight:n?$:void 0,padding:L.padding,fontSize:L.fontSize,lineHeight:L.lineHeight,fontFamily:"var(--brycks-font-sans)",color:"var(--brycks-foreground-default)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":C?"var(--brycks-border-focus)":r==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",resize:n?"none":"vertical",transition:"all 200ms ease-out",boxShadow:C?s?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return k&&(W.opacity=.5,W.cursor="not-allowed",W.resize="none"),W},N={position:"relative",width:"100%"},D={position:"absolute",bottom:8,right:12,fontSize:11,color:v>=(u??1/0)?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",pointerEvents:"none",transition:"color 150ms ease-out"},E=W=>{M(W.target.value.length),h==null||h(W)},G=W=>{R(!0),m==null||m(W)},Y=W=>{R(!1),x==null||x(W)};return e.jsxs("div",{className:z("brycks-textarea-wrapper",`brycks-textarea-wrapper--${r}`,`brycks-textarea-wrapper--${t}`,s&&"brycks-textarea-wrapper--invalid",k&&"brycks-textarea-wrapper--disabled",d),style:{...N,...f},children:[e.jsx("textarea",{ref:T,className:"brycks-textarea",style:A(),disabled:k,"aria-invalid":s,"data-testid":p,value:y,defaultValue:b,maxLength:u,onChange:E,onFocus:G,onBlur:Y,...w}),l&&e.jsxs("span",{style:D,children:[v,u?`/${u}`:""]})]})});rt.displayName="Textarea";const Io={sm:{radio:16,dot:6,fontSize:13,gap:8},md:{radio:20,dot:8,fontSize:14,gap:10},lg:{radio:24,dot:10,fontSize:16,gap:12}},ot=i.forwardRef(function({size:t="md",label:r,description:s,isInvalid:n=!1,disabled:a=!1,className:c,style:l,testId:u,checked:d,...f},p){const[k,y]=i.useState(!1),[b,h]=i.useState(!1),m=Io[t],x={display:"inline-flex",alignItems:"flex-start",gap:m.gap,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,...l},w={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:m.radio,height:m.radio,flexShrink:0},S={width:m.radio,height:m.radio,borderRadius:"50%",border:`2px solid ${n?"var(--brycks-error-default)":d?"var(--brycks-primary-default)":k?"var(--brycks-border-strong)":"var(--brycks-border-default)"}`,backgroundColor:d?"var(--brycks-primary-default)":"var(--brycks-background-input)",transition:"all 150ms ease-out",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:b?"0 0 0 3px var(--brycks-primary-100)":void 0},C={width:m.dot,height:m.dot,borderRadius:"50%",backgroundColor:"white",transform:d?"scale(1)":"scale(0)",transition:"transform 150ms ease-out"},R={position:"absolute",width:m.radio,height:m.radio,opacity:0,margin:0,cursor:a?"not-allowed":"pointer"},v={display:"flex",flexDirection:"column",gap:2},M={fontSize:m.fontSize,fontWeight:500,color:a?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},j={fontSize:m.fontSize-1,color:"var(--brycks-foreground-muted)",lineHeight:1.4};return e.jsxs("label",{className:z("brycks-radio",`brycks-radio--${t}`,c),style:x,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[e.jsxs("span",{style:w,children:[e.jsx("span",{style:S,children:e.jsx("span",{style:C})}),e.jsx("input",{ref:p,type:"radio",disabled:a,checked:d,style:R,onFocus:()=>h(!0),onBlur:()=>h(!1),"data-testid":u,...f})]}),(r||s)&&e.jsxs("span",{style:v,children:[r&&e.jsx("span",{style:M,children:r}),s&&e.jsx("span",{style:j,children:s})]})]})});ot.displayName="Radio";function st({name:o,value:t,defaultValue:r,onChange:s,disabled:n=!1,size:a="md",orientation:c="vertical",gap:l=12,children:u,className:d,style:f}){const[p,k]=i.useState(r??""),y=t??p,b=x=>{t===void 0&&k(x),s==null||s(x)},h={display:"flex",flexDirection:c==="vertical"?"column":"row",flexWrap:c==="horizontal"?"wrap":void 0,gap:l,...f},m=Array.isArray(u)?u.map((x,w)=>{if(x&&typeof x=="object"&&"props"in x){const S=x.props.value;return{...x,key:x.key??w,props:{...x.props,name:o,size:a,disabled:n||x.props.disabled,checked:S===y,onChange:()=>b(S)}}}return x}):u;return e.jsx("div",{role:"radiogroup",className:z("brycks-radio-group",d),style:h,children:m})}st.displayName="RadioGroup";const Ro={sm:{track:4,thumb:14,fontSize:12},md:{track:6,thumb:18,fontSize:14},lg:{track:8,thumb:22,fontSize:16}},nt=i.forwardRef(function({size:t="md",min:r=0,max:s=100,step:n=1,value:a,defaultValue:c=r,onChange:l,showValue:u=!1,formatValue:d=x=>String(x),label:f,disabled:p=!1,className:k,style:y,testId:b,...h},m){const[x,w]=i.useState(c),[S,C]=i.useState(!1),[R,v]=i.useState(!1),M=i.useRef(null),j=a??x,T=Ro[t],L=(j-r)/(s-r)*100,I=i.useCallback(W=>{const B=Math.max(r,Math.min(s,W));a===void 0&&w(B),l==null||l(B)},[a,r,s,l]);i.useEffect(()=>{const W=M.current;if(!W)return;const B=q=>{const ie=q.target;I(parseFloat(ie.value))};return W.addEventListener("input",B),()=>W.removeEventListener("input",B)},[I]);const H={display:"flex",flexDirection:"column",gap:8,opacity:p?.5:1,...y},$={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},X={fontSize:T.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},A={fontSize:T.fontSize,fontWeight:500,color:"var(--brycks-foreground-muted)",fontVariantNumeric:"tabular-nums"},N={position:"relative",display:"flex",alignItems:"center",height:T.thumb,cursor:p?"not-allowed":"pointer"},D={position:"absolute",width:"100%",height:T.track,borderRadius:T.track/2,backgroundColor:"var(--brycks-background-muted)"},E={position:"absolute",left:0,height:T.track,width:`${L}%`,borderRadius:T.track/2,backgroundColor:p?"var(--brycks-foreground-muted)":"var(--brycks-primary-default)",transition:S?"none":"width 100ms ease-out"},G={position:"absolute",left:`calc(${L}% - ${T.thumb/2}px)`,width:T.thumb,height:T.thumb,borderRadius:"50%",backgroundColor:"white",border:`2px solid ${p?"var(--brycks-foreground-muted)":"var(--brycks-primary-default)"}`,boxShadow:S||R?"var(--brycks-shadow-md)":"var(--brycks-shadow-sm)",transform:S?"scale(1.1)":"scale(1)",transition:S?"transform 100ms ease-out, box-shadow 100ms ease-out":"all 100ms ease-out",pointerEvents:"none"},Y={position:"absolute",width:"100%",height:T.thumb,margin:0,padding:0,opacity:0,cursor:p?"not-allowed":"pointer"};return e.jsxs("div",{className:z("brycks-slider",`brycks-slider--${t}`,k),style:H,children:[(f||u)&&e.jsxs("div",{style:$,children:[f&&e.jsx("span",{style:X,children:f}),u&&e.jsx("span",{style:A,children:d(j)})]}),e.jsxs("div",{style:N,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[e.jsx("div",{style:D}),e.jsx("div",{style:E}),e.jsx("div",{style:G}),e.jsx("input",{ref:W=>{M.current=W,typeof m=="function"?m(W):m&&(m.current=W)},type:"range",min:r,max:s,step:n,value:j,disabled:p,style:Y,onMouseDown:()=>C(!0),onMouseUp:()=>C(!1),onTouchStart:()=>C(!0),onTouchEnd:()=>C(!1),"data-testid":b,...h})]})]})});nt.displayName="Slider";const Lo={sm:{height:32,fontSize:13,padding:10,iconSize:14},md:{height:40,fontSize:14,padding:12,iconSize:16},lg:{height:48,fontSize:16,padding:14,iconSize:18}},at=i.forwardRef(function({size:t="md",variant:r="outline",type:s="date",label:n,helperText:a,error:c,isInvalid:l=!1,leftIcon:u,disabled:d=!1,className:f,style:p,testId:k,...y},b){const[h,m]=i.useState(!1),[x,w]=i.useState(!1),S=Lo[t],C=l||!!c,R={display:"flex",flexDirection:"column",gap:6,...p},v={fontSize:S.fontSize-1,fontWeight:500,color:"var(--brycks-foreground-default)"},M={position:"relative",display:"flex",alignItems:"center"},j=()=>{const I={width:"100%",height:S.height,fontSize:S.fontSize,fontFamily:"inherit",color:"var(--brycks-foreground-default)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-input)",paddingLeft:u?S.padding+S.iconSize+8:S.padding,paddingRight:S.padding,transition:"all 150ms ease-out",outline:"none",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"};return r==="flushed"?{...I,border:"none",borderBottom:`2px solid ${C?"var(--brycks-error-default)":h?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,borderRadius:0,paddingLeft:u?S.iconSize+8:0,paddingRight:0,backgroundColor:"transparent"}:{...I,border:`1px solid ${C?"var(--brycks-error-default)":h?"var(--brycks-primary-default)":x?"var(--brycks-border-strong)":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-md)",boxShadow:h&&!C?"0 0 0 3px var(--brycks-primary-100)":h&&C?"0 0 0 3px var(--brycks-error-100)":void 0}},T={position:"absolute",left:r==="flushed"?0:S.padding,color:"var(--brycks-foreground-muted)",display:"flex",alignItems:"center",justifyContent:"center",width:S.iconSize,height:S.iconSize,pointerEvents:"none"},L={fontSize:S.fontSize-2,color:C?"var(--brycks-error-default)":"var(--brycks-foreground-muted)"};return e.jsxs("div",{className:z("brycks-date-input",`brycks-date-input--${t}`,`brycks-date-input--${r}`,f),style:R,children:[n&&e.jsx("label",{style:v,children:n}),e.jsxs("div",{style:M,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[u&&e.jsx("span",{style:T,children:u}),e.jsx("input",{ref:b,type:s,disabled:d,style:j(),onFocus:()=>m(!0),onBlur:()=>m(!1),"data-testid":k,...y})]}),(a||c)&&e.jsx("span",{style:L,children:c||a})]})});at.displayName="DateInput";const No={sm:{height:80,fontSize:12,padding:16,iconSize:24},md:{height:120,fontSize:14,padding:24,iconSize:32},lg:{height:160,fontSize:16,padding:32,iconSize:40}};function $o({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}const it=i.forwardRef(function({size:t="md",variant:r="dropzone",accept:s,multiple:n=!1,maxSize:a,label:c,description:l,error:u,isInvalid:d=!1,onChange:f,icon:p,disabled:k=!1,className:y,style:b,testId:h,...m},x){const[w,S]=i.useState(!1),[C,R]=i.useState(!1),v=i.useRef(null),M=No[t],j=d||!!u,T=i.useCallback(F=>{if(!F||F.length===0)return;let _=Array.from(F);a&&(_=_.filter(ne=>ne.size<=a)),!n&&_.length>1&&(_=[_[0]]),f==null||f(_)},[a,n,f]),L=i.useCallback(F=>{F.preventDefault(),F.stopPropagation(),k||S(!0)},[k]),I=i.useCallback(F=>{F.preventDefault(),F.stopPropagation(),S(!1)},[]),H=i.useCallback(F=>{F.preventDefault(),F.stopPropagation(),S(!1),k||T(F.dataTransfer.files)},[k,T]),$=i.useCallback(F=>{T(F.target.files),v.current&&(v.current.value="")},[T]),X=i.useCallback(()=>{var F;k||(F=v.current)==null||F.click()},[k]),A=i.useCallback(F=>{var _;(F.key==="Enter"||F.key===" ")&&!k&&(F.preventDefault(),(_=v.current)==null||_.click())},[k]),N={display:"flex",flexDirection:"column",gap:6,...b},D={fontSize:M.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},E={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,minHeight:M.height,padding:M.padding,border:`2px dashed ${j?"var(--brycks-error-default)":w||C?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-lg)",backgroundColor:w?"var(--brycks-primary-50)":"var(--brycks-background-muted)",cursor:k?"not-allowed":"pointer",opacity:k?.5:1,transition:"all 150ms ease-out",outline:"none"},G={color:w?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",transition:"color 150ms ease-out"},Y={display:"flex",flexDirection:"column",alignItems:"center",gap:4,textAlign:"center"},W={fontSize:M.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},B={fontSize:M.fontSize-2,color:"var(--brycks-foreground-muted)"},q={color:"var(--brycks-primary-default)",fontWeight:500},ie={fontSize:M.fontSize-2,color:"var(--brycks-error-default)"},U=n?"Drag files here or click to browse":"Drag a file here or click to browse";return e.jsxs("div",{className:z("brycks-file-input",`brycks-file-input--${t}`,`brycks-file-input--${r}`,y),style:N,children:[c&&e.jsx("label",{style:D,children:c}),e.jsxs("div",{style:E,onDragOver:L,onDragLeave:I,onDrop:H,onClick:X,onKeyDown:A,onFocus:()=>R(!0),onBlur:()=>R(!1),tabIndex:k?-1:0,role:"button","aria-label":String(l)||U,children:[e.jsx("div",{style:G,children:p||e.jsx($o,{size:M.iconSize})}),e.jsxs("div",{style:Y,children:[e.jsx("span",{style:W,children:w?"Drop files here":e.jsxs(e.Fragment,{children:[e.jsx("span",{style:q,children:"Click to browse"})," or drag files here"]})}),l&&e.jsx("span",{style:B,children:l})]})]}),u&&e.jsx("span",{style:ie,children:u}),e.jsx("input",{ref:F=>{v.current=F,typeof x=="function"?x(F):x&&(x.current=F)},type:"file",accept:s,multiple:n,disabled:k,onChange:$,style:{display:"none"},"data-testid":h,...m})]})});it.displayName="FileInput";let Ho=0;function ge(o){return`${o}-${++Ho}`}function lt(o="brycks"){const[t,r]=i.useState("");return i.useEffect(()=>{r(ge(o))},[o]),t||ge(o)}function Do(o,t="brycks"){const[r,s]=i.useState([]);return i.useEffect(()=>{s(Array.from({length:o},()=>ge(t)))},[o,t]),r.length?r:Array.from({length:o},()=>ge(t))}const Wo={sm:{labelSize:12,helperSize:11,gap:4},md:{labelSize:14,helperSize:12,gap:6},lg:{labelSize:16,helperSize:14,gap:8}},ct=i.forwardRef(function({size:t="md",label:r,required:s=!1,helperText:n,error:a,isInvalid:c=!1,disabled:l=!1,fieldId:u,orientation:d="vertical",labelWidth:f=120,className:p,style:k,children:y,testId:b,...h},m){const x=lt("field"),w=u||x,S=`${w}-helper`,C=`${w}-error`,R=Wo[t],v=c||!!a,M={display:"flex",flexDirection:d==="horizontal"?"row":"column",gap:d==="horizontal"?16:R.gap,alignItems:d==="horizontal"?"flex-start":"stretch",opacity:l?.6:1,...k},j={display:"flex",alignItems:"baseline",gap:4,...d==="horizontal"&&{width:f,flexShrink:0,paddingTop:t==="lg"?14:t==="md"?10:8}},T={fontSize:R.labelSize,fontWeight:500,color:l?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},L={color:"var(--brycks-error-default)",marginLeft:2},I={display:"flex",flexDirection:"column",gap:R.gap,flex:1},H={fontSize:R.helperSize,color:v?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",lineHeight:1.4},$={id:w,"aria-describedby":n||a?a?C:S:void 0,"aria-invalid":v?!0:void 0};return e.jsxs("div",{ref:m,className:z("brycks-form-field",`brycks-form-field--${t}`,`brycks-form-field--${d}`,p),style:M,"data-testid":b,...h,children:[r&&e.jsx("div",{style:j,children:e.jsxs("label",{htmlFor:w,style:T,children:[r,s&&e.jsx("span",{style:L,"aria-hidden":"true",children:"*"})]})}),e.jsxs("div",{style:I,children:[typeof y=="function"?y($):y,(n||a)&&e.jsx("span",{id:a?C:S,style:H,role:a?"alert":void 0,children:a||n})]})]})});ct.displayName="FormField";const Eo={sm:{fontSize:11,iconSize:12,gap:4},md:{fontSize:12,iconSize:14,gap:6},lg:{fontSize:14,iconSize:16,gap:8}};function Bo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M8 5v3m0 2.5h.007M14 8A6 6 0 112 8a6 6 0 0112 0z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const dt=i.forwardRef(function({size:t="md",children:r,showIcon:s=!0,icon:n,className:a,style:c,testId:l,...u},d){const f=Eo[t],p={display:"inline-flex",alignItems:"center",gap:f.gap,fontSize:f.fontSize,fontWeight:500,color:"var(--brycks-error-default)",lineHeight:1.4,...c},k={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return r?e.jsxs("span",{ref:d,className:z("brycks-field-error",`brycks-field-error--${t}`,a),style:p,role:"alert","aria-live":"polite","data-testid":l,...u,children:[s&&e.jsx("span",{style:k,children:n||e.jsx(Bo,{size:f.iconSize})}),r]}):null});dt.displayName="FieldError";const Fo={sm:"400px",md:"500px",lg:"640px",xl:"800px",full:"calc(100vw - 48px)"};function Ao(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const ut=i.forwardRef(function({isOpen:t,onClose:r,size:s="md",title:n,description:a,closeOnOverlayClick:c=!0,closeOnEscape:l=!0,showCloseButton:u=!0,className:d,style:f,testId:p,children:k,...y},b){const h=i.useRef(null),m=i.useRef(null);i.useEffect(()=>{if(!t)return;m.current=document.activeElement;const I=h.current;I&&I.focus();const H=$=>{if($.key==="Escape"&&l){r();return}if($.key==="Tab"&&I){const X=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),A=X[0],N=X[X.length-1];$.shiftKey&&document.activeElement===A?($.preventDefault(),N==null||N.focus()):!$.shiftKey&&document.activeElement===N&&($.preventDefault(),A==null||A.focus())}};return document.addEventListener("keydown",H),document.body.style.overflow="hidden",()=>{var $;document.removeEventListener("keydown",H),document.body.style.overflow="",($=m.current)==null||$.focus()}},[t,l,r]);const x=i.useCallback(I=>{I.target===I.currentTarget&&c&&r()},[c,r]);if(!t)return null;const w={position:"fixed",inset:0,zIndex:"var(--brycks-z-modal)",display:"flex",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"var(--brycks-background-overlay)",backdropFilter:"blur(4px)",animation:"brycks-fade-in 200ms ease-out"},S={position:"relative",width:"100%",maxWidth:Fo[s],maxHeight:s==="full"?"calc(100vh - 48px)":"85vh",backgroundColor:"var(--brycks-background-elevated)",borderRadius:"var(--brycks-radius-xl)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"brycks-scale-in 200ms cubic-bezier(0.34, 1.56, 0.64, 1)",outline:"none",...f},C={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid var(--brycks-border-muted)"},R={display:"flex",flexDirection:"column",gap:4},v={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},M={fontSize:14,color:"var(--brycks-foreground-muted)",margin:0},j={display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out",marginLeft:12,flexShrink:0},T={flex:1,overflow:"auto",padding:24},L=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
56
|
+
`}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.4 31.4",opacity:"0.25"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.4 31.4",strokeDashoffset:"62.8",style:{transform:"rotate(-90deg)",transformOrigin:"center"}})]})}const To=({as:o,variant:t="solid",intent:r="primary",size:s="md",fullWidth:n,isLoading:a,isDisabled:c,leftIcon:l,rightIcon:u,isIconOnly:d,className:y,style:p,children:h,testId:b,onMouseEnter:g,onMouseLeave:k,onMouseDown:m,onMouseUp:x,...w},S)=>{const j=o||"button",[I,v]=i.useState(!1),[M,C]=i.useState(!1),T=c||a,L=Mo({variant:t,intent:r,size:s,fullWidth:n,isIconOnly:d}),R={...L.base,...I&&!T?L.hover:{},...M&&!T?L.active:{},...T?L.disabled:{},...a?L.loading:{},...p},H=Ue[s],$=G=>{v(!0),g==null||g(G)},X=G=>{v(!1),C(!1),k==null||k(G)},A=G=>{C(!0),m==null||m(G)},N=G=>{C(!1),x==null||x(G)},W=z("brycks-button",`brycks-button--${t}`,`brycks-button--${r}`,`brycks-button--${s}`,n&&"brycks-button--full-width",d&&"brycks-button--icon-only",a&&"brycks-button--loading",T&&"brycks-button--disabled",y),Y=j==="button"||o===void 0?{type:w.type??"button",disabled:T}:{"aria-disabled":T||void 0,role:"button",tabIndex:T?-1:0};return e.jsxs(j,{ref:S,className:W,style:R,"data-testid":b,onMouseEnter:$,onMouseLeave:X,onMouseDown:A,onMouseUp:N,...Y,...w,children:[a&&e.jsx("span",{style:{display:"inline-flex",position:d?"absolute":"relative"},children:e.jsx(Io,{size:H.iconSize})}),!a&&l&&e.jsx("span",{style:{display:"inline-flex",width:H.iconSize,height:H.iconSize},children:l}),!d&&e.jsx("span",{style:{opacity:a&&!d?.5:1},children:h}),!a&&u&&e.jsx("span",{style:{display:"inline-flex",width:H.iconSize,height:H.iconSize},children:u}),d&&!a&&h]})},he=i.forwardRef(To);he.displayName="Button";const Ro=(o,t)=>e.jsx(he,{ref:t,isIconOnly:!0,...o}),Qe=i.forwardRef(Ro);Qe.displayName="IconButton";const Lo={xs:12,sm:14,md:16,lg:20,xl:24,"2xl":32},Ze=i.forwardRef(function({size:t="md",customSize:r,color:s,path:n,paths:a,viewBox:c="0 0 24 24",fillRule:l="nonzero",className:u,style:d,testId:y,label:p,children:h,...b},g){const k=r??Lo[t],m={width:k,height:k,minWidth:k,minHeight:k,color:s??"currentColor",display:"inline-block",verticalAlign:"middle",flexShrink:0,...d},x=()=>h||(a&&a.length>0?a.map((w,S)=>e.jsx("path",{d:w,fill:"currentColor",fillRule:l},S)):n?e.jsx("path",{d:n,fill:"currentColor",fillRule:l}):null);return e.jsx("svg",{ref:g,xmlns:"http://www.w3.org/2000/svg",viewBox:c,className:z("brycks-icon",`brycks-icon--${t}`,u),style:m,"aria-hidden":!p,"aria-label":p,role:p?"img":void 0,"data-testid":y,...b,children:x()})});Ze.displayName="Icon";const No={close:"M18 6L6 18M6 6l12 12",check:"M20 6L9 17l-5-5",chevronDown:"M6 9l6 6 6-6",chevronUp:"M18 15l-6-6-6 6",chevronLeft:"M15 18l-6-6 6-6",chevronRight:"M9 18l6-6-6-6",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",menu:"M4 6h16M4 12h16M4 18h16",info:"M12 16v-4m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",eye:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",eyeOff:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",upload:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",edit:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",externalLink:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",logout:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1",arrowLeft:"M10 19l-7-7m0 0l7-7m-7 7h18",arrowRight:"M14 5l7 7m0 0l-7 7m7-7H3",arrowUp:"M5 10l7-7m0 0l7 7m-7-7v18",arrowDown:"M19 14l-7 7m0 0l-7-7m7 7V3",refresh:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",sort:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",file:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",lock:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",unlock:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",share:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",code:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",terminal:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",database:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",cloud:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z",sun:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",moon:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",grip:"M4 6a2 2 0 114 0 2 2 0 01-4 0zM10 6a2 2 0 114 0 2 2 0 01-4 0zM16 6a2 2 0 114 0 2 2 0 01-4 0zM4 12a2 2 0 114 0 2 2 0 01-4 0zM10 12a2 2 0 114 0 2 2 0 01-4 0zM16 12a2 2 0 114 0 2 2 0 01-4 0zM4 18a2 2 0 114 0 2 2 0 01-4 0zM10 18a2 2 0 114 0 2 2 0 01-4 0zM16 18a2 2 0 114 0 2 2 0 01-4 0z",moreHorizontal:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z",moreVertical:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z",layout:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z",car:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9L18 10l-1.6-3.2c-.4-.8-1.2-1.3-2.1-1.3H9.7c-.9 0-1.7.5-2.1 1.3L6 10l-2.5 1.1C2.7 11.3 2 12.1 2 13v3c0 .6.4 1 1 1h2M7 17h10M7 17a2 2 0 11-4 0 2 2 0 014 0zm12 0a2 2 0 11-4 0 2 2 0 014 0z",page:"M4 4a2 2 0 012-2h8l6 6v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm10 0v6h6",gridVertical:"M9 4a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2zm-6 5a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2z"},$o={sm:{height:J.sm,fontSize:O.sm,paddingX:ee.sm,radius:"var(--brycks-radius-md)"},md:{height:J.md,fontSize:O.md,paddingX:ee.md,radius:"var(--brycks-radius-default)"},lg:{height:J.lg,fontSize:O.lg,paddingX:ee.lg,radius:"var(--brycks-radius-lg)"}},ke=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,leftElement:n,rightElement:a,className:c,style:l,testId:u,disabled:d,onFocus:y,onBlur:p,...h},b){const[g,k]=i.useState(!1),m=$o[t],x=()=>{const v={display:"flex",alignItems:"center",width:"100%",position:"relative",height:m.height,borderRadius:m.radius,transition:oe.default};switch(r){case"outline":Object.assign(v,{backgroundColor:"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,boxShadow:g?s?te.error:te.default:te.none});break;case"filled":Object.assign(v,{backgroundColor:"var(--brycks-background-muted)",border:"1px solid transparent",borderColor:s?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"transparent"});break;case"flushed":Object.assign(v,{backgroundColor:"transparent",borderRadius:0,borderBottom:`2px solid ${s?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`});break}return d&&Object.assign(v,{opacity:ye.disabled,cursor:"not-allowed"}),v},w={width:"100%",height:m.height,fontFamily:"var(--brycks-font-sans)",fontSize:m.fontSize,color:"var(--brycks-foreground-default)",backgroundColor:"transparent",border:"none",outline:"none",borderRadius:m.radius,paddingLeft:n?Q.md:m.paddingX,paddingRight:a?Q.md:m.paddingX,cursor:d?"not-allowed":"text",transition:oe.default},S=v=>{k(!0),y==null||y(v)},j=v=>{k(!1),p==null||p(v)},I={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--brycks-foreground-muted)",flexShrink:0};return e.jsxs("div",{className:z("brycks-input-wrapper",`brycks-input-wrapper--${r}`,`brycks-input-wrapper--${t}`,s&&"brycks-input-wrapper--invalid",d&&"brycks-input-wrapper--disabled",c),style:{...x(),...l},children:[n&&e.jsx("span",{className:"brycks-input-left-element",style:{...I,paddingLeft:m.paddingX},children:n}),e.jsx("input",{ref:b,className:"brycks-input",style:w,disabled:d,"aria-invalid":s,"data-testid":u,onFocus:S,onBlur:j,...h}),a&&e.jsx("span",{className:"brycks-input-right-element",style:{...I,paddingRight:m.paddingX},children:a})]})});ke.displayName="Input";const Je=i.forwardRef(function({label:t,helperText:r,errorMessage:s,isRequired:n,hideLabel:a,isInvalid:c,id:l,className:u,testId:d,...y},p){const h=i.useId(),b=l??h,g=`${b}-helper`,k=`${b}-error`,m=!!s||c,x=[m&&k,r&&g].filter(Boolean).join(" "),w={display:"block",marginBottom:6,fontSize:13,fontWeight:500,color:"var(--brycks-foreground-default)",...a&&{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},S={display:"block",marginTop:6,fontSize:12,lineHeight:1.5,color:"var(--brycks-foreground-muted)"},j={...S,color:"var(--brycks-error-default)"};return e.jsxs("div",{className:z("brycks-text-field",m&&"brycks-text-field--error",u),"data-testid":d,children:[t&&e.jsxs("label",{htmlFor:b,style:w,children:[t,n&&e.jsx("span",{"aria-hidden":"true",style:{color:"var(--brycks-error-default)",marginLeft:2},children:"*"})]}),e.jsx(ke,{ref:p,id:b,isInvalid:m,"aria-describedby":x||void 0,"aria-required":n,...y}),m&&s&&e.jsx("span",{id:k,role:"alert",style:j,children:s}),!m&&r&&e.jsx("span",{id:g,style:S,children:r})]})});Je.displayName="TextField";const Ho={sm:{height:32,fontSize:13,padding:10},md:{height:40,fontSize:14,padding:12},lg:{height:48,fontSize:15,padding:14}};function Wo(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const et=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,placeholder:n,className:a,style:c,testId:l,disabled:u,children:d,onFocus:y,onBlur:p,value:h,...b},g){const[k,m]=i.useState(!1),x=Ho[t],w=h!==void 0&&h!=="",S={position:"relative",display:"inline-flex",width:"100%"},j=()=>{const C={width:"100%",height:x.height,paddingLeft:x.padding,paddingRight:x.padding+24,fontSize:x.fontSize,fontFamily:"var(--brycks-font-sans)",color:w||!n?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":k?"var(--brycks-border-focus)":r==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",cursor:u?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",transition:"all 200ms ease-out",boxShadow:k?s?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return u&&(C.opacity=.5),C},I={position:"absolute",right:x.padding,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"var(--brycks-foreground-muted)",transition:"transform 200ms ease-out"},v=C=>{m(!0),y==null||y(C)},M=C=>{m(!1),p==null||p(C)};return e.jsxs("div",{className:z("brycks-select-wrapper",`brycks-select-wrapper--${r}`,`brycks-select-wrapper--${t}`,s&&"brycks-select-wrapper--invalid",u&&"brycks-select-wrapper--disabled",a),style:{...S,...c},children:[e.jsxs("select",{ref:g,className:"brycks-select",style:j(),disabled:u,"aria-invalid":s,"data-testid":l,value:h,onFocus:v,onBlur:M,...b,children:[n&&e.jsx("option",{value:"",disabled:!0,children:n}),d]}),e.jsx("span",{style:I,children:e.jsx(Wo,{})})]})});et.displayName="Select";function Do({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Fo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2.5 6H9.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const tt=i.forwardRef(function({size:t="md",label:r,description:s,isInvalid:n,isIndeterminate:a,className:c,style:l,testId:u,disabled:d,checked:y,onChange:p,...h},b){const[g,k]=i.useState(!1),[m,x]=i.useState(!1),[w,S]=i.useState(!1),j=Re[t],I=O[t],v=y||a,M={display:"inline-flex",alignItems:"flex-start",gap:Q.lg,cursor:d?"not-allowed":"pointer",opacity:d?ye.disabled:1},C={position:"relative",width:j.box,height:j.box,borderRadius:"var(--brycks-radius-sm)",border:`1.5px solid ${n?"var(--brycks-error-default)":v?"var(--brycks-primary-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,backgroundColor:v?"var(--brycks-primary-default)":m?"var(--brycks-background-subtle)":"var(--brycks-background-app)",transition:oe.quick,transform:w?`scale(${re.controlPressed})`:`scale(${re.normal})`,boxShadow:g?te.default:te.none,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},T={color:"var(--brycks-primary-foreground)",opacity:v?1:0,transform:v?`scale(${re.normal})`:`scale(${re.hidden})`,transition:oe.quick},L={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:d?"not-allowed":"pointer",margin:0},R={display:"flex",flexDirection:"column",gap:Q.xs,paddingTop:(j.box-I)/2},H={fontSize:I,lineHeight:V.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},$={fontSize:I-1,lineHeight:V.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return e.jsxs("label",{className:z("brycks-checkbox",`brycks-checkbox--${t}`,v&&"brycks-checkbox--checked",n&&"brycks-checkbox--invalid",d&&"brycks-checkbox--disabled",c),style:{...M,...l},"data-testid":u,onMouseEnter:()=>x(!0),onMouseLeave:()=>{x(!1),S(!1)},onMouseDown:()=>S(!0),onMouseUp:()=>S(!1),children:[e.jsxs("span",{style:C,children:[e.jsx("input",{ref:b,type:"checkbox",style:L,checked:y,disabled:d,"aria-invalid":n,onChange:p,onFocus:()=>k(!0),onBlur:()=>k(!1),...h}),e.jsx("span",{style:T,children:a?e.jsx(Fo,{size:j.icon}):e.jsx(Do,{size:j.icon})})]}),(r||s)&&e.jsxs("span",{style:R,children:[r&&e.jsx("span",{style:H,children:r}),s&&e.jsx("span",{style:$,children:s})]})]})});tt.displayName="Checkbox";const rt=i.forwardRef(function({size:t="md",label:r,description:s,className:n,style:a,testId:c,disabled:l,checked:u,onChange:d,...y},p){const[h,b]=i.useState(!1),[g,k]=i.useState(!1),m=Le[t],x=O[t],w=(m.height-m.thumb)/2,S=m.width-m.thumb-w*2,j={display:"inline-flex",alignItems:"flex-start",gap:Q.xl,cursor:l?"not-allowed":"pointer",opacity:l?ye.disabled:1},I={position:"relative",width:m.width,height:m.height,borderRadius:m.height/2,backgroundColor:u?"var(--brycks-primary-default)":"var(--brycks-background-muted)",border:`1px solid ${u?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,transition:oe.spring,boxShadow:h?te.default:"inset 0 1px 2px rgba(0,0,0,0.05)",flexShrink:0},v={position:"absolute",top:w,left:u?w+S:w,width:g?m.thumb+4:m.thumb,height:m.thumb,borderRadius:m.thumb/2,backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-sm)",transition:oe.spring,transform:g?`scale(${re.pressedStrong})`:`scale(${re.normal})`},M={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:l?"not-allowed":"pointer",margin:0},C={display:"flex",flexDirection:"column",gap:Q.xs,paddingTop:(m.height-x*V.snug)/2},T={fontSize:x,lineHeight:V.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},L={fontSize:x-1,lineHeight:V.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return e.jsxs("label",{className:z("brycks-switch",`brycks-switch--${t}`,u&&"brycks-switch--checked",l&&"brycks-switch--disabled",n),style:{...j,...a},"data-testid":c,onMouseDown:()=>k(!0),onMouseUp:()=>k(!1),onMouseLeave:()=>k(!1),children:[e.jsxs("span",{style:I,children:[e.jsx("input",{ref:p,type:"checkbox",role:"switch",style:M,checked:u,disabled:l,"aria-checked":u,onChange:d,onFocus:()=>b(!0),onBlur:()=>b(!1),...y}),e.jsx("span",{style:v})]}),(r||s)&&e.jsxs("span",{style:C,children:[r&&e.jsx("span",{style:T,children:r}),s&&e.jsx("span",{style:L,children:s})]})]})});rt.displayName="Switch";const Eo={sm:{fontSize:13,padding:10,lineHeight:1.5},md:{fontSize:14,padding:12,lineHeight:1.5},lg:{fontSize:15,padding:14,lineHeight:1.5}},ot=i.forwardRef(function({size:t="md",variant:r="outline",isInvalid:s,autoResize:n,minRows:a=3,maxRows:c=10,showCount:l,maxLength:u,className:d,style:y,testId:p,disabled:h,value:b,defaultValue:g,onChange:k,onFocus:m,onBlur:x,...w},S){const[j,I]=i.useState(!1),[v,M]=i.useState(0),C=i.useRef(null),T=S||C,L=Eo[t],R=L.fontSize*L.lineHeight,H=R*a+L.padding*2,$=R*c+L.padding*2,X=i.useCallback(()=>{const D=T.current;if(!D||!n)return;D.style.height="auto";const E=D.scrollHeight,_=Math.min(Math.max(E,H),$);D.style.height=`${_}px`},[n,H,$,T]);i.useEffect(()=>{X()},[b,X]),i.useEffect(()=>{const D=String(b??g??"");M(D.length)},[b,g]);const A=()=>{const D={width:"100%",minHeight:H,maxHeight:n?$:void 0,padding:L.padding,fontSize:L.fontSize,lineHeight:L.lineHeight,fontFamily:"var(--brycks-font-sans)",color:"var(--brycks-foreground-default)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${s?"var(--brycks-error-default)":j?"var(--brycks-border-focus)":r==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",resize:n?"none":"vertical",transition:"all 200ms ease-out",boxShadow:j?s?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return h&&(D.opacity=.5,D.cursor="not-allowed",D.resize="none"),D},N={position:"relative",width:"100%"},W={position:"absolute",bottom:8,right:12,fontSize:11,color:v>=(u??1/0)?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",pointerEvents:"none",transition:"color 150ms ease-out"},F=D=>{M(D.target.value.length),k==null||k(D)},Y=D=>{I(!0),m==null||m(D)},G=D=>{I(!1),x==null||x(D)};return e.jsxs("div",{className:z("brycks-textarea-wrapper",`brycks-textarea-wrapper--${r}`,`brycks-textarea-wrapper--${t}`,s&&"brycks-textarea-wrapper--invalid",h&&"brycks-textarea-wrapper--disabled",d),style:{...N,...y},children:[e.jsx("textarea",{ref:T,className:"brycks-textarea",style:A(),disabled:h,"aria-invalid":s,"data-testid":p,value:b,defaultValue:g,maxLength:u,onChange:F,onFocus:Y,onBlur:G,...w}),l&&e.jsxs("span",{style:W,children:[v,u?`/${u}`:""]})]})});ot.displayName="Textarea";const Bo={sm:{radio:16,dot:6,fontSize:13,gap:8},md:{radio:20,dot:8,fontSize:14,gap:10},lg:{radio:24,dot:10,fontSize:16,gap:12}},st=i.forwardRef(function({size:t="md",label:r,description:s,isInvalid:n=!1,disabled:a=!1,className:c,style:l,testId:u,checked:d,...y},p){const[h,b]=i.useState(!1),[g,k]=i.useState(!1),m=Bo[t],x={display:"inline-flex",alignItems:"flex-start",gap:m.gap,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,...l},w={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:m.radio,height:m.radio,flexShrink:0},S={width:m.radio,height:m.radio,borderRadius:"50%",border:`2px solid ${n?"var(--brycks-error-default)":d?"var(--brycks-primary-default)":h?"var(--brycks-border-strong)":"var(--brycks-border-default)"}`,backgroundColor:d?"var(--brycks-primary-default)":"var(--brycks-background-input)",transition:"all 150ms ease-out",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:g?"0 0 0 3px var(--brycks-primary-100)":void 0},j={width:m.dot,height:m.dot,borderRadius:"50%",backgroundColor:"white",transform:d?"scale(1)":"scale(0)",transition:"transform 150ms ease-out"},I={position:"absolute",width:m.radio,height:m.radio,opacity:0,margin:0,cursor:a?"not-allowed":"pointer"},v={display:"flex",flexDirection:"column",gap:2},M={fontSize:m.fontSize,fontWeight:500,color:a?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},C={fontSize:m.fontSize-1,color:"var(--brycks-foreground-muted)",lineHeight:1.4};return e.jsxs("label",{className:z("brycks-radio",`brycks-radio--${t}`,c),style:x,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[e.jsxs("span",{style:w,children:[e.jsx("span",{style:S,children:e.jsx("span",{style:j})}),e.jsx("input",{ref:p,type:"radio",disabled:a,checked:d,style:I,onFocus:()=>k(!0),onBlur:()=>k(!1),"data-testid":u,...y})]}),(r||s)&&e.jsxs("span",{style:v,children:[r&&e.jsx("span",{style:M,children:r}),s&&e.jsx("span",{style:C,children:s})]})]})});st.displayName="Radio";function nt({name:o,value:t,defaultValue:r,onChange:s,disabled:n=!1,size:a="md",orientation:c="vertical",gap:l=12,children:u,className:d,style:y}){const[p,h]=i.useState(r??""),b=t??p,g=x=>{t===void 0&&h(x),s==null||s(x)},k={display:"flex",flexDirection:c==="vertical"?"column":"row",flexWrap:c==="horizontal"?"wrap":void 0,gap:l,...y},m=Array.isArray(u)?u.map((x,w)=>{if(x&&typeof x=="object"&&"props"in x){const S=x.props.value;return{...x,key:x.key??w,props:{...x.props,name:o,size:a,disabled:n||x.props.disabled,checked:S===b,onChange:()=>g(S)}}}return x}):u;return e.jsx("div",{role:"radiogroup",className:z("brycks-radio-group",d),style:k,children:m})}nt.displayName="RadioGroup";const Ao={sm:{track:4,thumb:14,fontSize:12},md:{track:6,thumb:18,fontSize:14},lg:{track:8,thumb:22,fontSize:16}},at=i.forwardRef(function({size:t="md",min:r=0,max:s=100,step:n=1,value:a,defaultValue:c=r,onChange:l,showValue:u=!1,formatValue:d=x=>String(x),label:y,disabled:p=!1,className:h,style:b,testId:g,...k},m){const[x,w]=i.useState(c),[S,j]=i.useState(!1),[I,v]=i.useState(!1),M=i.useRef(null),C=a??x,T=Ao[t],L=(C-r)/(s-r)*100,R=i.useCallback(D=>{const E=Math.max(r,Math.min(s,D));a===void 0&&w(E),l==null||l(E)},[a,r,s,l]);i.useEffect(()=>{const D=M.current;if(!D)return;const E=_=>{const ie=_.target;R(parseFloat(ie.value))};return D.addEventListener("input",E),()=>D.removeEventListener("input",E)},[R]);const H={display:"flex",flexDirection:"column",gap:8,opacity:p?.5:1,...b},$={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},X={fontSize:T.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},A={fontSize:T.fontSize,fontWeight:500,color:"var(--brycks-foreground-muted)",fontVariantNumeric:"tabular-nums"},N={position:"relative",display:"flex",alignItems:"center",height:T.thumb,cursor:p?"not-allowed":"pointer"},W={position:"absolute",width:"100%",height:T.track,borderRadius:T.track/2,backgroundColor:"var(--brycks-background-muted)"},F={position:"absolute",left:0,height:T.track,width:`${L}%`,borderRadius:T.track/2,backgroundColor:p?"var(--brycks-foreground-muted)":"var(--brycks-primary-default)",transition:S?"none":"width 100ms ease-out"},Y={position:"absolute",left:`calc(${L}% - ${T.thumb/2}px)`,width:T.thumb,height:T.thumb,borderRadius:"50%",backgroundColor:"white",border:`2px solid ${p?"var(--brycks-foreground-muted)":"var(--brycks-primary-default)"}`,boxShadow:S||I?"var(--brycks-shadow-md)":"var(--brycks-shadow-sm)",transform:S?"scale(1.1)":"scale(1)",transition:S?"transform 100ms ease-out, box-shadow 100ms ease-out":"all 100ms ease-out",pointerEvents:"none"},G={position:"absolute",width:"100%",height:T.thumb,margin:0,padding:0,opacity:0,cursor:p?"not-allowed":"pointer"};return e.jsxs("div",{className:z("brycks-slider",`brycks-slider--${t}`,h),style:H,children:[(y||u)&&e.jsxs("div",{style:$,children:[y&&e.jsx("span",{style:X,children:y}),u&&e.jsx("span",{style:A,children:d(C)})]}),e.jsxs("div",{style:N,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[e.jsx("div",{style:W}),e.jsx("div",{style:F}),e.jsx("div",{style:Y}),e.jsx("input",{ref:D=>{M.current=D,typeof m=="function"?m(D):m&&(m.current=D)},type:"range",min:r,max:s,step:n,value:C,disabled:p,style:G,onMouseDown:()=>j(!0),onMouseUp:()=>j(!1),onTouchStart:()=>j(!0),onTouchEnd:()=>j(!1),"data-testid":g,...k})]})]})});at.displayName="Slider";const Po={sm:{height:32,fontSize:13,padding:10,iconSize:14},md:{height:40,fontSize:14,padding:12,iconSize:16},lg:{height:48,fontSize:16,padding:14,iconSize:18}},it=i.forwardRef(function({size:t="md",variant:r="outline",type:s="date",label:n,helperText:a,error:c,isInvalid:l=!1,leftIcon:u,disabled:d=!1,className:y,style:p,testId:h,...b},g){const[k,m]=i.useState(!1),[x,w]=i.useState(!1),S=Po[t],j=l||!!c,I={display:"flex",flexDirection:"column",gap:6,...p},v={fontSize:S.fontSize-1,fontWeight:500,color:"var(--brycks-foreground-default)"},M={position:"relative",display:"flex",alignItems:"center"},C=()=>{const R={width:"100%",height:S.height,fontSize:S.fontSize,fontFamily:"inherit",color:"var(--brycks-foreground-default)",backgroundColor:r==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-input)",paddingLeft:u?S.padding+S.iconSize+8:S.padding,paddingRight:S.padding,transition:"all 150ms ease-out",outline:"none",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"};return r==="flushed"?{...R,border:"none",borderBottom:`2px solid ${j?"var(--brycks-error-default)":k?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,borderRadius:0,paddingLeft:u?S.iconSize+8:0,paddingRight:0,backgroundColor:"transparent"}:{...R,border:`1px solid ${j?"var(--brycks-error-default)":k?"var(--brycks-primary-default)":x?"var(--brycks-border-strong)":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-md)",boxShadow:k&&!j?"0 0 0 3px var(--brycks-primary-100)":k&&j?"0 0 0 3px var(--brycks-error-100)":void 0}},T={position:"absolute",left:r==="flushed"?0:S.padding,color:"var(--brycks-foreground-muted)",display:"flex",alignItems:"center",justifyContent:"center",width:S.iconSize,height:S.iconSize,pointerEvents:"none"},L={fontSize:S.fontSize-2,color:j?"var(--brycks-error-default)":"var(--brycks-foreground-muted)"};return e.jsxs("div",{className:z("brycks-date-input",`brycks-date-input--${t}`,`brycks-date-input--${r}`,y),style:I,children:[n&&e.jsx("label",{style:v,children:n}),e.jsxs("div",{style:M,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[u&&e.jsx("span",{style:T,children:u}),e.jsx("input",{ref:g,type:s,disabled:d,style:C(),onFocus:()=>m(!0),onBlur:()=>m(!1),"data-testid":h,...b})]}),(a||c)&&e.jsx("span",{style:L,children:c||a})]})});it.displayName="DateInput";const Oo={sm:{height:80,fontSize:12,padding:16,iconSize:24},md:{height:120,fontSize:14,padding:24,iconSize:32},lg:{height:160,fontSize:16,padding:32,iconSize:40}};function Vo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})})}const lt=i.forwardRef(function({size:t="md",variant:r="dropzone",accept:s,multiple:n=!1,maxSize:a,label:c,description:l,error:u,isInvalid:d=!1,onChange:y,icon:p,disabled:h=!1,className:b,style:g,testId:k,...m},x){const[w,S]=i.useState(!1),[j,I]=i.useState(!1),v=i.useRef(null),M=Oo[t],C=d||!!u,T=i.useCallback(B=>{if(!B||B.length===0)return;let K=Array.from(B);a&&(K=K.filter(ne=>ne.size<=a)),!n&&K.length>1&&(K=[K[0]]),y==null||y(K)},[a,n,y]),L=i.useCallback(B=>{B.preventDefault(),B.stopPropagation(),h||S(!0)},[h]),R=i.useCallback(B=>{B.preventDefault(),B.stopPropagation(),S(!1)},[]),H=i.useCallback(B=>{B.preventDefault(),B.stopPropagation(),S(!1),h||T(B.dataTransfer.files)},[h,T]),$=i.useCallback(B=>{T(B.target.files),v.current&&(v.current.value="")},[T]),X=i.useCallback(()=>{var B;h||(B=v.current)==null||B.click()},[h]),A=i.useCallback(B=>{var K;(B.key==="Enter"||B.key===" ")&&!h&&(B.preventDefault(),(K=v.current)==null||K.click())},[h]),N={display:"flex",flexDirection:"column",gap:6,...g},W={fontSize:M.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},F={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,minHeight:M.height,padding:M.padding,border:`2px dashed ${C?"var(--brycks-error-default)":w||j?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-lg)",backgroundColor:w?"var(--brycks-primary-50)":"var(--brycks-background-muted)",cursor:h?"not-allowed":"pointer",opacity:h?.5:1,transition:"all 150ms ease-out",outline:"none"},Y={color:w?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",transition:"color 150ms ease-out"},G={display:"flex",flexDirection:"column",alignItems:"center",gap:4,textAlign:"center"},D={fontSize:M.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)"},E={fontSize:M.fontSize-2,color:"var(--brycks-foreground-muted)"},_={color:"var(--brycks-primary-default)",fontWeight:500},ie={fontSize:M.fontSize-2,color:"var(--brycks-error-default)"},U=n?"Drag files here or click to browse":"Drag a file here or click to browse";return e.jsxs("div",{className:z("brycks-file-input",`brycks-file-input--${t}`,`brycks-file-input--${r}`,b),style:N,children:[c&&e.jsx("label",{style:W,children:c}),e.jsxs("div",{style:F,onDragOver:L,onDragLeave:R,onDrop:H,onClick:X,onKeyDown:A,onFocus:()=>I(!0),onBlur:()=>I(!1),tabIndex:h?-1:0,role:"button","aria-label":String(l)||U,children:[e.jsx("div",{style:Y,children:p||e.jsx(Vo,{size:M.iconSize})}),e.jsxs("div",{style:G,children:[e.jsx("span",{style:D,children:w?"Drop files here":e.jsxs(e.Fragment,{children:[e.jsx("span",{style:_,children:"Click to browse"})," or drag files here"]})}),l&&e.jsx("span",{style:E,children:l})]})]}),u&&e.jsx("span",{style:ie,children:u}),e.jsx("input",{ref:B=>{v.current=B,typeof x=="function"?x(B):x&&(x.current=B)},type:"file",accept:s,multiple:n,disabled:h,onChange:$,style:{display:"none"},"data-testid":k,...m})]})});lt.displayName="FileInput";let Xo=0;function ge(o){return`${o}-${++Xo}`}function ct(o="brycks"){const[t,r]=i.useState("");return i.useEffect(()=>{r(ge(o))},[o]),t||ge(o)}function Go(o,t="brycks"){const[r,s]=i.useState([]);return i.useEffect(()=>{s(Array.from({length:o},()=>ge(t)))},[o,t]),r.length?r:Array.from({length:o},()=>ge(t))}const Yo={sm:{labelSize:12,helperSize:11,gap:4},md:{labelSize:14,helperSize:12,gap:6},lg:{labelSize:16,helperSize:14,gap:8}},dt=i.forwardRef(function({size:t="md",label:r,required:s=!1,helperText:n,error:a,isInvalid:c=!1,disabled:l=!1,fieldId:u,orientation:d="vertical",labelWidth:y=120,className:p,style:h,children:b,testId:g,...k},m){const x=ct("field"),w=u||x,S=`${w}-helper`,j=`${w}-error`,I=Yo[t],v=c||!!a,M={display:"flex",flexDirection:d==="horizontal"?"row":"column",gap:d==="horizontal"?16:I.gap,alignItems:d==="horizontal"?"flex-start":"stretch",opacity:l?.6:1,...h},C={display:"flex",alignItems:"baseline",gap:4,...d==="horizontal"&&{width:y,flexShrink:0,paddingTop:t==="lg"?14:t==="md"?10:8}},T={fontSize:I.labelSize,fontWeight:500,color:l?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",lineHeight:1.4},L={color:"var(--brycks-error-default)",marginLeft:2},R={display:"flex",flexDirection:"column",gap:I.gap,flex:1},H={fontSize:I.helperSize,color:v?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",lineHeight:1.4},$={id:w,"aria-describedby":n||a?a?j:S:void 0,"aria-invalid":v?!0:void 0};return e.jsxs("div",{ref:m,className:z("brycks-form-field",`brycks-form-field--${t}`,`brycks-form-field--${d}`,p),style:M,"data-testid":g,...k,children:[r&&e.jsx("div",{style:C,children:e.jsxs("label",{htmlFor:w,style:T,children:[r,s&&e.jsx("span",{style:L,"aria-hidden":"true",children:"*"})]})}),e.jsxs("div",{style:R,children:[typeof b=="function"?b($):b,(n||a)&&e.jsx("span",{id:a?j:S,style:H,role:a?"alert":void 0,children:a||n})]})]})});dt.displayName="FormField";const _o={sm:{fontSize:11,iconSize:12,gap:4},md:{fontSize:12,iconSize:14,gap:6},lg:{fontSize:14,iconSize:16,gap:8}};function qo({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M8 5v3m0 2.5h.007M14 8A6 6 0 112 8a6 6 0 0112 0z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const ut=i.forwardRef(function({size:t="md",children:r,showIcon:s=!0,icon:n,className:a,style:c,testId:l,...u},d){const y=_o[t],p={display:"inline-flex",alignItems:"center",gap:y.gap,fontSize:y.fontSize,fontWeight:500,color:"var(--brycks-error-default)",lineHeight:1.4,...c},h={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return r?e.jsxs("span",{ref:d,className:z("brycks-field-error",`brycks-field-error--${t}`,a),style:p,role:"alert","aria-live":"polite","data-testid":l,...u,children:[s&&e.jsx("span",{style:h,children:n||e.jsx(qo,{size:y.iconSize})}),r]}):null});ut.displayName="FieldError";const Ko={sm:f.spacing[3],md:f.spacing[4],lg:f.spacing[6],xl:f.spacing[8]},ft=i.forwardRef(function({gap:t="md",disabled:r,children:s,className:n,style:a,testId:c,onSubmit:l,...u},d){const y={display:"flex",flexDirection:"column",gap:Ko[t],...a},p=h=>{if(r){h.preventDefault();return}l==null||l(h)};return e.jsx("form",{ref:d,className:z("brycks-form",`brycks-form--gap-${t}`,r&&"brycks-form--disabled",n),style:y,onSubmit:p,"aria-disabled":r,"data-testid":c,...u,children:e.jsx("fieldset",{disabled:r,style:{border:"none",padding:0,margin:0,minWidth:0},children:s})})});ft.displayName="Form";const Uo={sm:{fontSize:f.fontSizes.xs},md:{fontSize:f.fontSizes.sm},lg:{fontSize:f.fontSizes.md}},ve=i.forwardRef(function({children:t,size:r="md",required:s,disabled:n,description:a,className:c,style:l,testId:u,...d},y){const p=Uo[r],h={display:"block",fontFamily:f.textStyles.label.fontFamily,fontSize:p.fontSize,fontWeight:f.fontWeights.medium,lineHeight:f.textStyles.label.lineHeight,color:n?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",cursor:n?"not-allowed":"pointer",marginBottom:f.spacing[1],...l},b={color:"var(--brycks-error-default)",marginLeft:f.spacing[.5]},g={display:"block",fontSize:f.fontSizes.xs,fontWeight:f.fontWeights.regular,color:"var(--brycks-foreground-muted)",marginTop:f.spacing[.5]};return e.jsxs("label",{ref:y,className:z("brycks-form-label",`brycks-form-label--${r}`,n&&"brycks-form-label--disabled",c),style:h,"data-testid":u,...d,children:[e.jsxs("span",{className:"brycks-form-label__text",children:[t,s&&e.jsx("span",{className:"brycks-form-label__required",style:b,"aria-hidden":"true",children:"*"})]}),a&&e.jsx("span",{className:"brycks-form-label__description",style:g,children:a})]})});ve.displayName="FormLabel";const Qo={none:0,xs:f.spacing[.5],sm:f.spacing[1],md:f.spacing[1.5]},yt=i.forwardRef(function({label:t,fieldId:r,labelSize:s="md",required:n,disabled:a,description:c,error:l,helperText:u,gap:d="sm",children:y,className:p,style:h,testId:b,...g},k){const m=i.useId(),x=r||m,w={display:"flex",flexDirection:"column",gap:Qo[d],...h},S={fontSize:"0.75rem",lineHeight:1.4,marginTop:f.spacing[.5]},j={...S,color:"var(--brycks-error-default)"},I={...S,color:"var(--brycks-foreground-muted)"};return e.jsxs("div",{ref:k,className:z("brycks-form-group",!!l&&"brycks-form-group--error",!!a&&"brycks-form-group--disabled",p),style:w,"data-testid":b,...g,children:[t&&e.jsx(ve,{htmlFor:x,size:s,required:n,disabled:a,description:c,children:t}),y,l&&e.jsx("span",{className:"brycks-form-group__error",style:j,role:"alert",children:l}),!l&&u&&e.jsx("span",{className:"brycks-form-group__helper",style:I,children:u})]})});yt.displayName="FormGroup";const Zo={sm:"400px",md:"500px",lg:"640px",xl:"800px",full:"calc(100vw - 48px)"};function Jo(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const bt=i.forwardRef(function({isOpen:t,onClose:r,size:s="md",title:n,description:a,closeOnOverlayClick:c=!0,closeOnEscape:l=!0,showCloseButton:u=!0,className:d,style:y,testId:p,children:h,...b},g){const k=i.useRef(null),m=i.useRef(null);i.useEffect(()=>{if(!t)return;m.current=document.activeElement;const R=k.current;R&&R.focus();const H=$=>{if($.key==="Escape"&&l){r();return}if($.key==="Tab"&&R){const X=R.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),A=X[0],N=X[X.length-1];$.shiftKey&&document.activeElement===A?($.preventDefault(),N==null||N.focus()):!$.shiftKey&&document.activeElement===N&&($.preventDefault(),A==null||A.focus())}};return document.addEventListener("keydown",H),document.body.style.overflow="hidden",()=>{var $;document.removeEventListener("keydown",H),document.body.style.overflow="",($=m.current)==null||$.focus()}},[t,l,r]);const x=i.useCallback(R=>{R.target===R.currentTarget&&c&&r()},[c,r]);if(!t)return null;const w={position:"fixed",inset:0,zIndex:"var(--brycks-z-modal)",display:"flex",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"var(--brycks-background-overlay)",backdropFilter:"blur(4px)",animation:"brycks-fade-in 200ms ease-out"},S={position:"relative",width:"100%",maxWidth:Zo[s],maxHeight:s==="full"?"calc(100vh - 48px)":"85vh",backgroundColor:"var(--brycks-background-elevated)",borderRadius:"var(--brycks-radius-xl)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"brycks-scale-in 200ms cubic-bezier(0.34, 1.56, 0.64, 1)",outline:"none",...y},j={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid var(--brycks-border-muted)"},I={display:"flex",flexDirection:"column",gap:4},v={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},M={fontSize:14,color:"var(--brycks-foreground-muted)",margin:0},C={display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out",marginLeft:12,flexShrink:0},T={flex:1,overflow:"auto",padding:24},L=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
57
57
|
@keyframes brycks-fade-in {
|
|
58
58
|
from { opacity: 0; }
|
|
59
59
|
to { opacity: 1; }
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
from { opacity: 0; transform: scale(0.95); }
|
|
63
63
|
to { opacity: 1; transform: scale(1); }
|
|
64
64
|
}
|
|
65
|
-
`}),e.jsx("div",{className:"brycks-modal-overlay",style:w,onClick:x,"aria-hidden":"true",children:e.jsxs("div",{ref:
|
|
65
|
+
`}),e.jsx("div",{className:"brycks-modal-overlay",style:w,onClick:x,"aria-hidden":"true",children:e.jsxs("div",{ref:R=>{k.current=R,typeof g=="function"?g(R):g&&(g.current=R)},role:"dialog","aria-modal":"true","aria-labelledby":n?"brycks-modal-title":void 0,"aria-describedby":a?"brycks-modal-description":void 0,className:z("brycks-modal",`brycks-modal--${s}`,d),style:S,tabIndex:-1,"data-testid":p,...b,children:[(n||u)&&e.jsxs("div",{className:"brycks-modal-header",style:j,children:[e.jsxs("div",{style:I,children:[n&&e.jsx("h2",{id:"brycks-modal-title",style:v,children:n}),a&&e.jsx("p",{id:"brycks-modal-description",style:M,children:a})]}),u&&e.jsx("button",{type:"button",className:"brycks-modal-close",style:C,onClick:r,"aria-label":"Close modal",onMouseEnter:R=>{R.currentTarget.style.backgroundColor="var(--brycks-background-muted)",R.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:R=>{R.currentTarget.style.backgroundColor="transparent",R.currentTarget.style.color="var(--brycks-foreground-muted)"},children:e.jsx(Jo,{})})]}),e.jsx("div",{className:"brycks-modal-content",style:T,children:h})]})})]});return ae.createPortal(L,document.body)});bt.displayName="Modal";const es={info:{icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("circle",{cx:"9",cy:"9",r:"7.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M9 8V12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("circle",{cx:"9",cy:"5.5",r:"0.75",fill:"currentColor"})]}),colors:{subtle:{backgroundColor:"var(--brycks-info-muted)",color:"var(--brycks-info-default)",borderColor:"transparent"},solid:{backgroundColor:"var(--brycks-info-default)",color:"var(--brycks-info-foreground)",borderColor:"transparent"},outline:{backgroundColor:"transparent",color:"var(--brycks-info-default)",borderColor:"var(--brycks-info-default)"}}},success:{icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("circle",{cx:"9",cy:"9",r:"7.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M6 9L8 11L12 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),colors:{subtle:{backgroundColor:"var(--brycks-success-muted)",color:"var(--brycks-success-default)",borderColor:"transparent"},solid:{backgroundColor:"var(--brycks-success-default)",color:"var(--brycks-success-foreground)",borderColor:"transparent"},outline:{backgroundColor:"transparent",color:"var(--brycks-success-default)",borderColor:"var(--brycks-success-default)"}}},warning:{icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M9 2L16.5 15H1.5L9 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 7V10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("circle",{cx:"9",cy:"12.5",r:"0.75",fill:"currentColor"})]}),colors:{subtle:{backgroundColor:"var(--brycks-warning-muted)",color:"var(--brycks-warning-default)",borderColor:"transparent"},solid:{backgroundColor:"var(--brycks-warning-default)",color:"var(--brycks-warning-foreground)",borderColor:"transparent"},outline:{backgroundColor:"transparent",color:"var(--brycks-warning-default)",borderColor:"var(--brycks-warning-default)"}}},error:{icon:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("circle",{cx:"9",cy:"9",r:"7.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M6.5 6.5L11.5 11.5M11.5 6.5L6.5 11.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),colors:{subtle:{backgroundColor:"var(--brycks-error-muted)",color:"var(--brycks-error-default)",borderColor:"transparent"},solid:{backgroundColor:"var(--brycks-error-default)",color:"var(--brycks-error-foreground)",borderColor:"transparent"},outline:{backgroundColor:"transparent",color:"var(--brycks-error-default)",borderColor:"var(--brycks-error-default)"}}}},gt=i.forwardRef(function({intent:t="info",variant:r="subtle",title:s,icon:n,showIcon:a=!0,action:c,isDismissible:l,onDismiss:u,className:d,style:y,testId:p,children:h,...b},g){const k=es[t],m=k.colors[r],x={display:"flex",alignItems:"flex-start",gap:12,padding:"12px 16px",borderRadius:"var(--brycks-radius-default)",border:`1px solid ${m.borderColor}`,backgroundColor:m.backgroundColor,color:r==="solid"?m.color:"var(--brycks-foreground-default)",...y},w={flexShrink:0,color:m.color,marginTop:1},S={flex:1,minWidth:0},j={fontSize:14,fontWeight:600,marginBottom:h?4:0,color:m.color},I={fontSize:14,lineHeight:1.5,color:r==="solid"?m.color:"var(--brycks-foreground-muted)"},v={display:"flex",alignItems:"center",gap:8,flexShrink:0},M={display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--brycks-radius-sm)",color:r==="solid"?m.color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out",opacity:.7};return e.jsxs("div",{ref:g,role:"alert",className:z("brycks-alert",`brycks-alert--${t}`,`brycks-alert--${r}`,d),style:x,"data-testid":p,...b,children:[a&&e.jsx("span",{className:"brycks-alert-icon",style:w,children:n??k.icon}),e.jsxs("div",{className:"brycks-alert-content",style:S,children:[s&&e.jsx("div",{className:"brycks-alert-title",style:j,children:s}),h&&e.jsx("div",{className:"brycks-alert-description",style:I,children:h})]}),(c||l)&&e.jsxs("div",{className:"brycks-alert-actions",style:v,children:[c,l&&e.jsx("button",{type:"button",className:"brycks-alert-dismiss",style:M,onClick:u,"aria-label":"Dismiss alert",onMouseEnter:C=>{C.currentTarget.style.opacity="1"},onMouseLeave:C=>{C.currentTarget.style.opacity="0.7"},children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})});gt.displayName="Alert";const mt=i.forwardRef(function({content:t,placement:r="top",delay:s=200,isDisabled:n,className:a,testId:c,children:l,...u},d){const[y,p]=i.useState(!1),[h,b]=i.useState({top:0,left:0}),g=i.useRef(null),k=i.useRef(null),m=i.useRef(null),x=i.useCallback(()=>{if(!g.current||!k.current)return;const M=g.current.getBoundingClientRect(),C=k.current.getBoundingClientRect(),T=8;let L=0,R=0;switch(r){case"top":L=M.top-C.height-T,R=M.left+(M.width-C.width)/2;break;case"bottom":L=M.bottom+T,R=M.left+(M.width-C.width)/2;break;case"left":L=M.top+(M.height-C.height)/2,R=M.left-C.width-T;break;case"right":L=M.top+(M.height-C.height)/2,R=M.right+T;break}const H=8;R=Math.max(H,Math.min(R,window.innerWidth-C.width-H)),L=Math.max(H,Math.min(L,window.innerHeight-C.height-H)),b({top:L,left:R})},[r]);i.useEffect(()=>(y&&(x(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),[y,x]);const w=()=>{n||(m.current=setTimeout(()=>{p(!0)},s))},S=()=>{m.current&&clearTimeout(m.current),p(!1)};i.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const j={display:"inline-flex"},I={position:"fixed",top:h.top,left:h.left,zIndex:"var(--brycks-z-tooltip)",maxWidth:300,padding:"6px 10px",fontSize:12,fontWeight:500,lineHeight:1.4,color:"var(--brycks-foreground-inverse)",backgroundColor:"var(--brycks-background-inverse)",borderRadius:"var(--brycks-radius-md)",boxShadow:"var(--brycks-shadow-lg)",pointerEvents:"none",animation:"brycks-tooltip-in 150ms ease-out"},v={position:"absolute",width:8,height:8,backgroundColor:"var(--brycks-background-inverse)",transform:"rotate(45deg)",...r==="top"&&{bottom:-4,left:"50%",marginLeft:-4},...r==="bottom"&&{top:-4,left:"50%",marginLeft:-4},...r==="left"&&{right:-4,top:"50%",marginTop:-4},...r==="right"&&{left:-4,top:"50%",marginTop:-4}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:g,style:j,onMouseEnter:w,onMouseLeave:S,onFocus:w,onBlur:S,children:l}),y&&ae.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
66
66
|
@keyframes brycks-tooltip-in {
|
|
67
67
|
from { opacity: 0; transform: scale(0.95); }
|
|
68
68
|
to { opacity: 1; transform: scale(1); }
|
|
69
69
|
}
|
|
70
|
-
`}),e.jsxs("div",{ref:M=>{
|
|
70
|
+
`}),e.jsxs("div",{ref:M=>{k.current=M,typeof d=="function"?d(M):d&&(d.current=M)},role:"tooltip",className:z("brycks-tooltip",`brycks-tooltip--${r}`,a),style:I,"data-testid":c,...u,children:[t,e.jsx("span",{style:v})]})]}),document.body)]})});mt.displayName="Tooltip";const ts={info:{bg:"var(--brycks-info-50)",border:"var(--brycks-info-200)",icon:"var(--brycks-info-default)"},success:{bg:"var(--brycks-success-50)",border:"var(--brycks-success-200)",icon:"var(--brycks-success-default)"},warning:{bg:"var(--brycks-warning-50)",border:"var(--brycks-warning-200)",icon:"var(--brycks-warning-default)"},error:{bg:"var(--brycks-error-50)",border:"var(--brycks-error-200)",icon:"var(--brycks-error-default)"}};function rs({intent:o}){const t={info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"};return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:t[o]})})}function os(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const xe=i.forwardRef(function({intent:t="info",title:r,description:s,isOpen:n=!0,duration:a=5e3,onClose:c,showCloseButton:l=!0,action:u,icon:d,className:y,style:p,testId:h,...b},g){const[k,m]=i.useState(n),[x,w]=i.useState(!1);if(i.useEffect(()=>{if(n)m(!0),w(!1);else{w(!0);const L=setTimeout(()=>m(!1),200);return()=>clearTimeout(L)}},[n]),i.useEffect(()=>{if(!n||a===0)return;const L=setTimeout(()=>{c==null||c()},a);return()=>clearTimeout(L)},[n,a,c]),!k)return null;const S=ts[t],j={display:"flex",alignItems:"flex-start",gap:12,padding:"12px 16px",backgroundColor:S.bg,border:`1px solid ${S.border}`,borderRadius:"var(--brycks-radius-lg)",boxShadow:"var(--brycks-shadow-lg)",maxWidth:400,animation:x?"brycks-toast-out 200ms ease-in forwards":"brycks-toast-in 200ms ease-out",...p},I={color:S.icon,flexShrink:0,marginTop:2},v={flex:1,display:"flex",flexDirection:"column",gap:4},M={fontSize:14,fontWeight:600,color:"var(--brycks-foreground-default)",lineHeight:1.4},C={fontSize:13,color:"var(--brycks-foreground-muted)",lineHeight:1.4},T={display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--brycks-radius-sm)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out",flexShrink:0,marginLeft:"auto"};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
71
71
|
@keyframes brycks-toast-in {
|
|
72
72
|
from { opacity: 0; transform: translateY(-8px) scale(0.95); }
|
|
73
73
|
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
77
77
|
to { opacity: 0; transform: translateY(-8px) scale(0.95); }
|
|
78
78
|
}
|
|
79
|
-
`}),e.jsxs("div",{ref:
|
|
79
|
+
`}),e.jsxs("div",{ref:g,role:"alert","aria-live":"polite",className:z("brycks-toast",`brycks-toast--${t}`,y),style:j,"data-testid":h,...b,children:[e.jsx("span",{style:I,children:d||e.jsx(rs,{intent:t})}),e.jsxs("div",{style:v,children:[r&&e.jsx("span",{style:M,children:r}),s&&e.jsx("span",{style:C,children:s}),u&&e.jsx("div",{style:{marginTop:8},children:u})]}),l&&e.jsx("button",{type:"button",style:T,onClick:c,"aria-label":"Close toast",onMouseEnter:L=>{L.currentTarget.style.backgroundColor="var(--brycks-background-muted)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor="transparent"},children:e.jsx(os,{})})]})]})});xe.displayName="Toast";const pt=i.createContext(null);function ss(){const o=i.useContext(pt);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}const ns={"top-left":{top:16,left:16},"top-center":{top:16,left:"50%",transform:"translateX(-50%)"},"top-right":{top:16,right:16},"bottom-left":{bottom:16,left:16},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:16,right:16}};let as=0;function is({children:o,position:t="top-right",maxToasts:r=5}){const[s,n]=i.useState([]),[a,c]=i.useState(!1);i.useEffect(()=>{c(!0)},[]);const l=i.useCallback(h=>{const b=`toast-${++as}`;return n(g=>{const k=[...g,{id:b,props:h}];return k.length>r?k.slice(-r):k}),b},[r]),u=i.useCallback(h=>{n(b=>b.filter(g=>g.id!==h))},[]),d=i.useCallback(()=>{n([])},[]),y={position:"fixed",zIndex:"var(--brycks-z-toast)",display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...ns[t]},p={pointerEvents:"auto"};return e.jsxs(pt.Provider,{value:{toasts:s,addToast:l,removeToast:u,removeAll:d},children:[o,a&&ae.createPortal(e.jsx("div",{className:"brycks-toast-container",style:y,children:s.map(({id:h,props:b})=>e.jsx("div",{style:p,children:e.jsx(xe,{...b,isOpen:!0,onClose:()=>u(h)})},h))}),document.body)]})}const ls={sm:"320px",md:"400px",lg:"560px",xl:"720px",full:"100%"};function cs(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const ht=i.forwardRef(function({isOpen:t,onClose:r,placement:s="right",size:n="md",title:a,closeOnOverlayClick:c=!0,closeOnEscape:l=!0,showCloseButton:u=!0,showOverlay:d=!0,className:y,style:p,children:h,testId:b,...g},k){const m=i.useRef(null),x=i.useRef(null);i.useEffect(()=>{if(!t)return;x.current=document.activeElement;const $=m.current;$&&$.focus();const X=A=>{if(A.key==="Escape"&&l){r();return}if(A.key==="Tab"&&$){const N=$.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),W=N[0],F=N[N.length-1];A.shiftKey&&document.activeElement===W?(A.preventDefault(),F==null||F.focus()):!A.shiftKey&&document.activeElement===F&&(A.preventDefault(),W==null||W.focus())}};return document.addEventListener("keydown",X),document.body.style.overflow="hidden",()=>{var A;document.removeEventListener("keydown",X),document.body.style.overflow="",(A=x.current)==null||A.focus()}},[t,l,r]);const w=i.useCallback($=>{$.target===$.currentTarget&&c&&r()},[c,r]);if(!t)return null;const S=s==="left"||s==="right",j=ls[n],I={position:"fixed",inset:0,zIndex:"var(--brycks-z-drawer)",display:"flex",backgroundColor:d?"var(--brycks-background-overlay)":"transparent",animation:"brycks-drawer-overlay-in 200ms ease-out"},M={...(()=>{const $={position:"absolute",backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-2xl)",display:"flex",flexDirection:"column",overflow:"hidden"};return S?{...$,top:0,bottom:0,[s]:0,width:j,maxWidth:"100vw"}:{...$,left:0,right:0,[s]:0,height:j,maxHeight:"100vh"}})(),animation:`brycks-drawer-${s}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,outline:"none",...p},C={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--brycks-border-muted)",flexShrink:0},T={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0},L={display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--brycks-radius-md)",color:"var(--brycks-foreground-muted)",transition:"all 150ms ease-out"},R={flex:1,overflow:"auto",padding:20},H=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
80
80
|
@keyframes brycks-drawer-overlay-in {
|
|
81
81
|
from { opacity: 0; }
|
|
82
82
|
to { opacity: 1; }
|
|
@@ -97,32 +97,32 @@
|
|
|
97
97
|
from { transform: translateY(100%); }
|
|
98
98
|
to { transform: translateY(0); }
|
|
99
99
|
}
|
|
100
|
-
`}),e.jsx("div",{className:"brycks-drawer-overlay",style:
|
|
100
|
+
`}),e.jsx("div",{className:"brycks-drawer-overlay",style:I,onClick:w,"aria-hidden":"true",children:e.jsxs("div",{ref:$=>{m.current=$,typeof k=="function"?k($):k&&(k.current=$)},role:"dialog","aria-modal":"true","aria-labelledby":a?"brycks-drawer-title":void 0,className:z("brycks-drawer",`brycks-drawer--${s}`,`brycks-drawer--${n}`,y),style:M,tabIndex:-1,"data-testid":b,...g,children:[(a||u)&&e.jsxs("div",{className:"brycks-drawer-header",style:C,children:[a&&e.jsx("h2",{id:"brycks-drawer-title",style:T,children:a}),u&&e.jsx("button",{type:"button",className:"brycks-drawer-close",style:L,onClick:r,"aria-label":"Close drawer",onMouseEnter:$=>{$.currentTarget.style.backgroundColor="var(--brycks-background-muted)",$.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:$=>{$.currentTarget.style.backgroundColor="transparent",$.currentTarget.style.color="var(--brycks-foreground-muted)"},children:e.jsx(cs,{})})]}),e.jsx("div",{className:"brycks-drawer-content",style:R,children:h})]})})]});return ae.createPortal(H,document.body)});ht.displayName="Drawer";function kt(o,t={}){const{enabled:r=!0,eventType:s="mousedown"}=t,n=i.useRef(null);return i.useEffect(()=>{if(!r)return;const a=c=>{const l=n.current;!l||l.contains(c.target)||o(c)};return document.addEventListener(s,a),document.addEventListener("touchstart",a),()=>{document.removeEventListener(s,a),document.removeEventListener("touchstart",a)}},[o,r,s]),n}const vt=i.forwardRef(function({content:t,children:r,placement:s="bottom",trigger:n="click",isOpen:a,defaultOpen:c=!1,onOpenChange:l,offset:u=8,openDelay:d=200,closeDelay:y=200,closeOnOutsideClick:p=!0,showArrow:h=!0,className:b,style:g,testId:k,...m},x){const[w,S]=i.useState(c),[j,I]=i.useState({top:0,left:0}),[v,M]=i.useState(!1),C=i.useRef(null),T=i.useRef(null),L=i.useRef(null),R=i.useRef(null),H=a??w,$=i.useCallback(E=>{a===void 0&&S(E),l==null||l(E)},[a,l]),X=kt(()=>{p&&n==="click"&&H&&$(!1)},{enabled:H&&n==="click"});i.useEffect(()=>(M(!0),()=>M(!1)),[]),i.useEffect(()=>{if(!H||!C.current||!v)return;const E=()=>{const _=C.current,ie=T.current;if(!_||!ie)return;const U=_.getBoundingClientRect(),B=ie.getBoundingClientRect(),K=window.scrollX,ne=window.scrollY;let le=0,ce=0;switch(s){case"top":case"top-start":case"top-end":le=U.top+ne-B.height-u;break;case"bottom":case"bottom-start":case"bottom-end":le=U.bottom+ne+u;break;case"left":case"left-start":case"left-end":ce=U.left+K-B.width-u;break;case"right":case"right-start":case"right-end":ce=U.right+K+u;break}switch(s){case"top":case"bottom":ce=U.left+K+(U.width-B.width)/2;break;case"top-start":case"bottom-start":ce=U.left+K;break;case"top-end":case"bottom-end":ce=U.right+K-B.width;break;case"left":case"right":le=U.top+ne+(U.height-B.height)/2;break;case"left-start":case"right-start":le=U.top+ne;break;case"left-end":case"right-end":le=U.bottom+ne-B.height;break}I({top:le,left:ce})};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[H,s,u,v]),i.useEffect(()=>()=>{L.current&&clearTimeout(L.current),R.current&&clearTimeout(R.current)},[]);const A=i.useCallback(()=>{R.current&&clearTimeout(R.current),n==="hover"?L.current=setTimeout(()=>$(!0),d):$(!0)},[n,d,$]),N=i.useCallback(()=>{L.current&&clearTimeout(L.current),n==="hover"?R.current=setTimeout(()=>$(!1),y):$(!1)},[n,y,$]),W=i.useCallback(()=>{H?N():A()},[H,A,N]),F=r.props,Y=i.cloneElement(r,{ref:C,...n==="click"&&{onClick:E=>{var _;(_=F.onClick)==null||_.call(F,E),W()}},...n==="hover"&&{onMouseEnter:E=>{var _;(_=F.onMouseEnter)==null||_.call(F,E),A()},onMouseLeave:E=>{var _;(_=F.onMouseLeave)==null||_.call(F,E),N()}}}),G={position:"absolute",top:j.top,left:j.left,zIndex:"var(--brycks-z-popover)",backgroundColor:"var(--brycks-background-elevated)",border:"1px solid var(--brycks-border-default)",borderRadius:"var(--brycks-radius-lg)",boxShadow:"var(--brycks-shadow-lg)",padding:12,minWidth:120,animation:"brycks-popover-in 150ms ease-out",...g},D=H&&v&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
101
101
|
@keyframes brycks-popover-in {
|
|
102
102
|
from { opacity: 0; transform: scale(0.95); }
|
|
103
103
|
to { opacity: 1; transform: scale(1); }
|
|
104
104
|
}
|
|
105
|
-
`}),e.jsx("div",{ref:
|
|
105
|
+
`}),e.jsx("div",{ref:E=>{T.current=E,X.current=E,typeof x=="function"?x(E):x&&(x.current=E)},className:z("brycks-popover",b),style:G,role:"dialog","data-testid":k,onMouseEnter:n==="hover"?A:void 0,onMouseLeave:n==="hover"?N:void 0,...m,children:t})]});return e.jsxs(e.Fragment,{children:[Y,v&&ae.createPortal(D,document.body)]})});vt.displayName="Popover";const ds={xs:4,sm:6,md:8,lg:12},us={xs:{size:24,strokeWidth:3},sm:{size:32,strokeWidth:3},md:{size:48,strokeWidth:4},lg:{size:64,strokeWidth:5}},fs={primary:"var(--brycks-primary-default)",success:"var(--brycks-success-default)",warning:"var(--brycks-warning-default)",error:"var(--brycks-error-default)"},xt=i.forwardRef(function({value:t=0,max:r=100,size:s="md",variant:n="linear",intent:a="primary",showValue:c=!1,indeterminate:l=!1,formatValue:u=(k,m)=>`${Math.round(k/m*100)}%`,label:d,className:y,style:p,testId:h,...b},g){const k=Math.min(100,Math.max(0,t/r*100)),m=fs[a];if(n==="circular"){const C=us[s],T=(C.size-C.strokeWidth)/2,L=2*Math.PI*T,R=L-k/100*L,H={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:8,...p},$={transform:"rotate(-90deg)",width:C.size,height:C.size},X={fill:"none",stroke:"var(--brycks-background-muted)",strokeWidth:C.strokeWidth},A={fill:"none",stroke:m,strokeWidth:C.strokeWidth,strokeLinecap:"round",strokeDasharray:L,strokeDashoffset:l?L*.75:R,transition:l?"none":"stroke-dashoffset 300ms ease-out",animation:l?"brycks-progress-circular-spin 1s linear infinite":void 0,transformOrigin:"center"},N={position:"absolute",fontSize:s==="xs"?8:s==="sm"?10:s==="md"?12:14,fontWeight:600,color:"var(--brycks-foreground-default)"},W={fontSize:s==="xs"?10:s==="sm"?11:s==="md"?12:14,color:"var(--brycks-foreground-muted)"};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
106
106
|
@keyframes brycks-progress-circular-spin {
|
|
107
107
|
from { transform: rotate(0deg); }
|
|
108
108
|
to { transform: rotate(360deg); }
|
|
109
109
|
}
|
|
110
|
-
`}),e.jsxs("div",{ref:
|
|
110
|
+
`}),e.jsxs("div",{ref:g,className:z("brycks-progress","brycks-progress--circular",`brycks-progress--${s}`,y),style:H,role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":d,"data-testid":h,...b,children:[e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{style:$,children:[e.jsx("circle",{cx:C.size/2,cy:C.size/2,r:T,style:X}),e.jsx("circle",{cx:C.size/2,cy:C.size/2,r:T,style:A})]}),c&&!l&&s!=="xs"&&e.jsx("span",{style:N,children:u(t,r)})]}),d&&e.jsx("span",{style:W,children:d})]})]})}const x=ds[s],w={display:"flex",flexDirection:"column",gap:6,width:"100%",...p},S={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},j={fontSize:s==="xs"?11:s==="sm"?12:s==="md"?13:14,fontWeight:500,color:"var(--brycks-foreground-default)"},I={fontSize:s==="xs"?11:s==="sm"?12:s==="md"?13:14,fontWeight:500,color:"var(--brycks-foreground-muted)",fontVariantNumeric:"tabular-nums"},v={width:"100%",height:x,backgroundColor:"var(--brycks-background-muted)",borderRadius:x/2,overflow:"hidden"},M={width:l?"30%":`${k}%`,height:"100%",backgroundColor:m,borderRadius:x/2,transition:l?"none":"width 300ms ease-out",animation:l?"brycks-progress-linear-indeterminate 1.5s ease-in-out infinite":void 0};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
111
111
|
@keyframes brycks-progress-linear-indeterminate {
|
|
112
112
|
0% { transform: translateX(-100%); }
|
|
113
113
|
100% { transform: translateX(400%); }
|
|
114
114
|
}
|
|
115
|
-
`}),e.jsxs("div",{ref:
|
|
115
|
+
`}),e.jsxs("div",{ref:g,className:z("brycks-progress","brycks-progress--linear",`brycks-progress--${s}`,y),style:w,role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":d,"data-testid":h,...b,children:[(d||c)&&e.jsxs("div",{style:S,children:[d&&e.jsx("span",{style:j,children:d}),c&&!l&&e.jsx("span",{style:I,children:u(t,r)})]}),e.jsx("div",{style:v,children:e.jsx("div",{style:M})})]})]})});xt.displayName="Progress";const St=i.createContext(null);function Se(){const o=i.useContext(St);if(!o)throw new Error("Tabs components must be used within a Tabs");return o}const wt=i.forwardRef(function({value:t,defaultValue:r="",onChange:s,size:n="md",variant:a="line",orientation:c="horizontal",className:l,style:u,children:d,testId:y,...p},h){const[b,g]=i.useState(r),k=t??b,m=i.useCallback(w=>{t===void 0&&g(w),s==null||s(w)},[t,s]),x={display:"flex",flexDirection:c==="vertical"?"row":"column",gap:c==="vertical"?24:0,...u};return e.jsx(St.Provider,{value:{value:k,onChange:m,size:n,variant:a,orientation:c},children:e.jsx("div",{ref:h,className:z("brycks-tabs",`brycks-tabs--${a}`,`brycks-tabs--${c}`,l),style:x,"data-testid":y,...p,children:d})})});wt.displayName="Tabs";const jt=i.forwardRef(function({className:t,style:r,children:s,...n},a){const{orientation:c,variant:l}=Se(),u={display:"flex",flexDirection:c==="vertical"?"column":"row",gap:l==="enclosed"||c==="vertical"?4:0,borderBottom:l==="line"&&c==="horizontal"?"1px solid var(--brycks-border-muted)":void 0,borderRight:l==="line"&&c==="vertical"?"1px solid var(--brycks-border-muted)":void 0,paddingRight:c==="vertical"?16:void 0,backgroundColor:l==="enclosed"?"var(--brycks-background-muted)":void 0,padding:l==="enclosed"?4:void 0,borderRadius:l==="enclosed"?"var(--brycks-radius-lg)":void 0,flexShrink:0,...r};return e.jsx("div",{ref:a,role:"tablist","aria-orientation":c,className:z("brycks-tab-list",t),style:u,...n,children:s})});jt.displayName="TabList";const ys={sm:{fontSize:13,padding:"6px 12px",height:32},md:{fontSize:14,padding:"8px 16px",height:40},lg:{fontSize:16,padding:"10px 20px",height:48}},Ct=i.forwardRef(function({value:t,disabled:r=!1,icon:s,className:n,style:a,children:c,...l},u){const{value:d,onChange:y,size:p,variant:h,orientation:b}=Se(),g=d===t,k=ys[p],m=()=>{r||y(t)},x=S=>{var M,C,T;if(r)return;const j=Array.from(((M=S.currentTarget.parentElement)==null?void 0:M.querySelectorAll('[role="tab"]:not([disabled])'))??[]),I=j.indexOf(S.currentTarget);let v=null;b==="horizontal"?(S.key==="ArrowRight"&&(v=(I+1)%j.length),S.key==="ArrowLeft"&&(v=(I-1+j.length)%j.length)):(S.key==="ArrowDown"&&(v=(I+1)%j.length),S.key==="ArrowUp"&&(v=(I-1+j.length)%j.length)),S.key==="Home"&&(v=0),S.key==="End"&&(v=j.length-1),v!==null&&(S.preventDefault(),(C=j[v])==null||C.focus(),(T=j[v])==null||T.click())},w=()=>{const S={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,fontSize:k.fontSize,fontWeight:500,padding:k.padding,minHeight:k.height,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,transition:"all 150ms ease-out",outline:"none",border:"none",backgroundColor:"transparent",whiteSpace:"nowrap"};return h==="line"?{...S,color:g?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",borderBottom:b==="horizontal"?`2px solid ${g?"var(--brycks-primary-default)":"transparent"}`:void 0,borderRight:b==="vertical"?`2px solid ${g?"var(--brycks-primary-default)":"transparent"}`:void 0,marginBottom:b==="horizontal"?-1:void 0,marginRight:b==="vertical"?-1:void 0}:h==="enclosed"?{...S,color:g?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",backgroundColor:g?"var(--brycks-background-elevated)":"transparent",borderRadius:"var(--brycks-radius-md)",boxShadow:g?"var(--brycks-shadow-sm)":void 0}:{...S,color:g?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",backgroundColor:g?"var(--brycks-primary-50)":"transparent",borderRadius:"var(--brycks-radius-md)"}};return e.jsxs("button",{ref:u,role:"tab",type:"button","aria-selected":g,"aria-disabled":r,disabled:r,tabIndex:g?0:-1,className:z("brycks-tab",g&&"brycks-tab--selected",n),style:{...w(),...a},onClick:m,onKeyDown:x,...l,children:[s&&e.jsx("span",{className:"brycks-tab-icon",children:s}),c]})});Ct.displayName="Tab";const zt=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={flex:1,...r};return e.jsx("div",{ref:a,className:z("brycks-tab-panels",t),style:c,...n,children:s})});zt.displayName="TabPanels";const Mt=i.forwardRef(function({value:t,className:r,style:s,children:n,...a},c){const{value:l}=Se();if(!(l===t))return null;const d={padding:"16px 0",animation:"brycks-tab-panel-in 200ms ease-out",...s};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
116
116
|
@keyframes brycks-tab-panel-in {
|
|
117
117
|
from { opacity: 0; }
|
|
118
118
|
to { opacity: 1; }
|
|
119
119
|
}
|
|
120
|
-
`}),e.jsx("div",{ref:c,role:"tabpanel",tabIndex:0,className:z("brycks-tab-panel",r),style:d,...a,children:n})]})});
|
|
120
|
+
`}),e.jsx("div",{ref:c,role:"tabpanel",tabIndex:0,className:z("brycks-tab-panel",r),style:d,...a,children:n})]})});Mt.displayName="TabPanel";const It=i.createContext(null);function Tt(){const o=i.useContext(It);if(!o)throw new Error("AccordionItem must be used within an Accordion");return o}const Rt=i.forwardRef(function({value:t,defaultValue:r=[],onChange:s,allowMultiple:n=!1,variant:a="default",className:c,style:l,children:u,testId:d,...y},p){const[h,b]=i.useState(r),g=t??h,k=i.useCallback(x=>{const w=g.includes(x);let S;w?S=g.filter(j=>j!==x):n?S=[...g,x]:S=[x],t===void 0&&b(S),s==null||s(S)},[g,n,t,s]),m={display:"flex",flexDirection:"column",gap:a==="separated"?8:0,...l};return e.jsx(It.Provider,{value:{expandedItems:g,toggleItem:k,allowMultiple:n,variant:a},children:e.jsx("div",{ref:p,className:z("brycks-accordion",`brycks-accordion--${a}`,c),style:m,"data-testid":d,...y,children:u})})});Rt.displayName="Accordion";const Lt=i.createContext(null);function Nt(){const o=i.useContext(Lt);if(!o)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return o}const $t=i.forwardRef(function({value:t,disabled:r=!1,className:s,style:n,children:a,...c},l){const{expandedItems:u,variant:d}=Tt(),y=u.includes(t),p={borderBottom:d==="default"?"1px solid var(--brycks-border-muted)":void 0,border:d==="bordered"||d==="separated"?"1px solid var(--brycks-border-default)":void 0,borderRadius:d==="separated"?"var(--brycks-radius-lg)":void 0,overflow:"hidden",...n};return d==="bordered"&&!y&&(p.borderBottom="1px solid var(--brycks-border-default)"),e.jsx(Lt.Provider,{value:{value:t,isExpanded:y,disabled:r},children:e.jsx("div",{ref:l,className:z("brycks-accordion-item",y&&"brycks-accordion-item--expanded",s),style:p,...c,children:a})})});$t.displayName="AccordionItem";function bs({isExpanded:o}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms ease-out"},children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ht=i.forwardRef(function({icon:t,className:r,style:s,children:n,...a},c){const{toggleItem:l}=Tt(),{value:u,isExpanded:d,disabled:y}=Nt(),p=()=>{y||l(u)},h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"16px",fontSize:15,fontWeight:500,color:y?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",backgroundColor:"transparent",border:"none",cursor:y?"not-allowed":"pointer",textAlign:"left",transition:"background-color 150ms ease-out",outline:"none",...s};return e.jsxs("button",{ref:c,type:"button","aria-expanded":d,"aria-disabled":y,disabled:y,className:z("brycks-accordion-trigger",r),style:h,onClick:p,onMouseEnter:b=>{y||(b.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:b=>{b.currentTarget.style.backgroundColor="transparent"},...a,children:[n,e.jsx("span",{style:{color:"var(--brycks-foreground-muted)",flexShrink:0,marginLeft:12},children:t??e.jsx(bs,{isExpanded:d})})]})});Ht.displayName="AccordionTrigger";const Wt=i.forwardRef(function({className:t,style:r,children:s,...n},a){const{isExpanded:c}=Nt(),l={overflow:"hidden",transition:"max-height 200ms ease-out, opacity 200ms ease-out",maxHeight:c?"1000px":"0",opacity:c?1:0},u={padding:"0 16px 16px 16px",color:"var(--brycks-foreground-muted)",fontSize:14,lineHeight:1.6,...r};return e.jsx("div",{ref:a,role:"region","aria-hidden":!c,className:z("brycks-accordion-content",t),style:l,...n,children:e.jsx("div",{style:u,children:s})})});Wt.displayName="AccordionContent";const Dt=i.createContext(null);function gs(){const o=i.useContext(Dt);if(!o)throw new Error("Dropdown components must be used within a Dropdown");return o}const Ft=i.forwardRef(function({trigger:t,isOpen:r,defaultOpen:s=!1,onOpenChange:n,placement:a="bottom-start",offset:c=4,closeOnSelect:l=!0,className:u,style:d,children:y,testId:p,...h},b){var A;const[g,k]=i.useState(s),[m,x]=i.useState({top:0,left:0}),[w,S]=i.useState(-1),[j,I]=i.useState(!1),v=i.useRef(null),M=i.useRef(null),C=r??g;i.useEffect(()=>(I(!0),()=>I(!1)),[]);const T=i.useCallback(N=>{r===void 0&&k(N),n==null||n(N),N||S(-1)},[r,n]),L=i.useCallback(()=>T(!1),[T]);i.useEffect(()=>{if(!C||!v.current||!j)return;const N=()=>{const W=v.current;if(!W)return;const F=W.getBoundingClientRect(),Y=window.scrollX,G=window.scrollY;let D=0,E=0;a.startsWith("bottom")?D=F.bottom+G+c:D=F.top+G-c,a.endsWith("start")?E=F.left+Y:E=F.right+Y,x({top:D,left:E})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[C,a,c,j]),i.useEffect(()=>{if(!C)return;const N=W=>{var F,Y;(F=v.current)!=null&&F.contains(W.target)||(Y=M.current)!=null&&Y.contains(W.target)||T(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[C,T]);const R=i.useCallback(N=>{var F,Y,G;if(!C){(N.key==="ArrowDown"||N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T(!0));return}const W=(F=M.current)==null?void 0:F.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');if(W!=null&&W.length)switch(N.key){case"ArrowDown":N.preventDefault(),S(D=>(D+1)%W.length);break;case"ArrowUp":N.preventDefault(),S(D=>(D-1+W.length)%W.length);break;case"Home":N.preventDefault(),S(0);break;case"End":N.preventDefault(),S(W.length-1);break;case"Escape":N.preventDefault(),T(!1),(Y=v.current)==null||Y.focus();break;case"Enter":case" ":N.preventDefault(),w>=0&&((G=W[w])==null||G.click());break}},[C,w,T]);i.useEffect(()=>{var W,F;if(!C||w<0)return;const N=(W=M.current)==null?void 0:W.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');(F=N==null?void 0:N[w])==null||F.focus()},[C,w]);const H=t.props,$=i.cloneElement(t,{ref:v,"aria-haspopup":"menu","aria-expanded":C,onClick:N=>{var W;(W=H.onClick)==null||W.call(H,N),T(!C)},onKeyDown:N=>{var W;(W=H.onKeyDown)==null||W.call(H,N),R(N)}}),X={position:"absolute",top:m.top,left:a.endsWith("end")?"auto":m.left,right:a.endsWith("end")?window.innerWidth-m.left:"auto",zIndex:"var(--brycks-z-dropdown)",minWidth:((A=v.current)==null?void 0:A.offsetWidth)??160,backgroundColor:"var(--brycks-background-elevated)",border:"1px solid var(--brycks-border-default)",borderRadius:"var(--brycks-radius-lg)",boxShadow:"var(--brycks-shadow-lg)",padding:4,animation:"brycks-dropdown-in 150ms ease-out",outline:"none",...d};return e.jsx(Dt.Provider,{value:{isOpen:C,close:l?L:()=>{},activeIndex:w,setActiveIndex:S},children:e.jsxs("div",{ref:b,className:z("brycks-dropdown",u),style:{display:"inline-block"},"data-testid":p,...h,children:[$,C&&j&&ae.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
121
121
|
@keyframes brycks-dropdown-in {
|
|
122
122
|
from { opacity: 0; transform: translateY(-4px); }
|
|
123
123
|
to { opacity: 1; transform: translateY(0); }
|
|
124
124
|
}
|
|
125
|
-
`}),e.jsx("div",{ref:M,role:"menu",style:X,onKeyDown:I,tabIndex:-1,children:f})]}),document.body)]})})});Ht.displayName="Dropdown";const Dt=i.forwardRef(function({disabled:t=!1,icon:r,shortcut:s,destructive:n=!1,className:a,style:c,children:l,onClick:u,...d},f){const{close:p}=rs(),k=m=>{t||(u==null||u(m),p())},y={display:"flex",alignItems:"center",gap:10,padding:"8px 12px",fontSize:14,color:t?"var(--brycks-foreground-disabled)":n?"var(--brycks-error-default)":"var(--brycks-foreground-default)",backgroundColor:"transparent",borderRadius:"var(--brycks-radius-md)",cursor:t?"not-allowed":"pointer",transition:"background-color 100ms ease-out",outline:"none",...c},b={width:16,height:16,color:t?"var(--brycks-foreground-disabled)":n?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",flexShrink:0},h={marginLeft:"auto",fontSize:12,color:"var(--brycks-foreground-muted)",fontFamily:"var(--brycks-font-mono)"};return e.jsxs("div",{ref:f,role:"menuitem","aria-disabled":t,tabIndex:t?-1:0,className:z("brycks-dropdown-item",t&&"brycks-dropdown-item--disabled",a),style:y,onClick:k,onMouseEnter:m=>{t||(m.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},onFocus:m=>{m.currentTarget.style.backgroundColor="var(--brycks-background-muted)"},onBlur:m=>{m.currentTarget.style.backgroundColor="transparent"},...d,children:[r&&e.jsx("span",{style:b,children:r}),e.jsx("span",{style:{flex:1},children:l}),s&&e.jsx("span",{style:h,children:s})]})});Dt.displayName="DropdownItem";const Wt=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"4px 0",...r};return e.jsx("div",{ref:n,role:"separator",className:z("brycks-dropdown-divider",t),style:a,...s})});Wt.displayName="DropdownDivider";const Et=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={padding:"8px 12px 4px 12px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em",...r};return e.jsx("div",{ref:a,className:z("brycks-dropdown-label",t),style:c,...n,children:s})});Et.displayName="DropdownLabel";const Bt=i.createContext(null);function Ft(){const o=i.useContext(Bt);if(!o)throw new Error("Menu components must be used within a Menu");return o}const At=i.forwardRef(function({activeItem:t,onChange:r,size:s="md",collapsed:n=!1,className:a,style:c,children:l,testId:u,...d},f){const[p,k]=i.useState(null),y=t!==void 0?t:p,b=m=>{t===void 0&&k(m),r==null||r(m)},h={display:"flex",flexDirection:"column",gap:2,padding:8,...c};return e.jsx(Bt.Provider,{value:{size:s,activeItem:y,setActiveItem:b,collapsed:n},children:e.jsx("nav",{ref:f,className:z("brycks-menu",`brycks-menu--${s}`,n&&"brycks-menu--collapsed",a),style:h,"data-testid":u,...d,children:l})})});At.displayName="Menu";const os={sm:{height:32,fontSize:13,iconSize:16,padding:10},md:{height:40,fontSize:14,iconSize:18,padding:12},lg:{height:48,fontSize:16,iconSize:20,padding:14}},Pt=i.forwardRef(function({value:t,icon:r,badge:s,disabled:n=!1,onClick:a,className:c,style:l,children:u,...d},f){const{size:p,activeItem:k,setActiveItem:y,collapsed:b}=Ft(),h=k===t,m=os[p],x=()=>{n||(y(t),a==null||a(t))},w={display:"flex",alignItems:"center",gap:10,width:"100%",minHeight:m.height,padding:b?m.padding:`0 ${m.padding}px`,fontSize:m.fontSize,fontWeight:h?600:500,color:n?"var(--brycks-foreground-disabled)":h?"var(--brycks-primary-default)":"var(--brycks-foreground-default)",backgroundColor:h?"var(--brycks-primary-50)":"transparent",border:"none",borderRadius:"var(--brycks-radius-md)",cursor:n?"not-allowed":"pointer",transition:"all 150ms ease-out",textAlign:"left",outline:"none",justifyContent:b?"center":"flex-start",...l},S={width:m.iconSize,height:m.iconSize,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},C={marginLeft:"auto"};return e.jsxs("button",{ref:f,type:"button",disabled:n,className:z("brycks-menu-item",h&&"brycks-menu-item--active",c),style:w,onClick:x,onMouseEnter:R=>{!n&&!h&&(R.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:R=>{h||(R.currentTarget.style.backgroundColor="transparent")},title:b?String(u):void 0,...d,children:[r&&e.jsx("span",{style:S,children:r}),!b&&e.jsx("span",{style:{flex:1},children:u}),!b&&s&&e.jsx("span",{style:C,children:s})]})});Pt.displayName="MenuItem";const Vt=i.forwardRef(function({label:t,className:r,style:s,children:n,...a},c){const{collapsed:l}=Ft(),u={display:"flex",flexDirection:"column",gap:2,...s},d={padding:"12px 12px 6px 12px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em"};return e.jsxs("div",{ref:c,className:z("brycks-menu-group",r),style:u,...a,children:[t&&!l&&e.jsx("div",{style:d,children:t}),n]})});Vt.displayName="MenuGroup";const Ot=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"8px 0",...r};return e.jsx("div",{ref:n,role:"separator",className:z("brycks-menu-divider",t),style:a,...s})});Ot.displayName="MenuDivider";const ss={sm:{height:28,fontSize:12,gap:4,minWidth:28},md:{height:36,fontSize:14,gap:6,minWidth:36},lg:{height:44,fontSize:16,gap:8,minWidth:44}};function ns(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function as(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function is(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M11 12l-4-4 4-4M7 12l-4-4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ls(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M5 4l4 4-4 4M9 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Xt=i.forwardRef(function({page:t,totalPages:r,onChange:s,size:n="md",variant:a="default",siblingCount:c=1,showFirstLast:l=!0,showPrevNext:u=!0,disabled:d=!1,className:f,style:p,testId:k,...y},b){const h=ss[n],m=i.useMemo(()=>{if(a==="minimal"||a==="simple")return[];const v=[],M=Math.max(t-c,1),j=Math.min(t+c,r),T=M>2,L=j<r-1;if(T)if(L){v.push(1),v.push("ellipsis");for(let I=M;I<=j;I++)v.push(I);v.push("ellipsis"),v.push(r)}else{v.push(1),v.push("ellipsis");for(let I=Math.max(r-2-c,1);I<=r;I++)v.push(I)}else{for(let I=1;I<=Math.min(3+c,r);I++)v.push(I);L&&(v.push("ellipsis"),v.push(r))}return v},[t,r,c,a]),x={display:"flex",alignItems:"center",gap:h.gap,...p},w=(v,M)=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:h.minWidth,height:h.height,padding:`0 ${h.gap+4}px`,fontSize:h.fontSize,fontWeight:v?600:500,color:M?"var(--brycks-foreground-disabled)":v?"var(--brycks-primary-default)":"var(--brycks-foreground-default)",backgroundColor:v?"var(--brycks-primary-50)":"transparent",border:"none",borderRadius:"var(--brycks-radius-md)",cursor:M?"not-allowed":"pointer",transition:"all 150ms ease-out",outline:"none"}),S={display:"flex",alignItems:"center",justifyContent:"center",minWidth:h.minWidth,height:h.height,color:"var(--brycks-foreground-muted)",fontSize:h.fontSize},C={fontSize:h.fontSize,color:"var(--brycks-foreground-muted)",padding:`0 ${h.gap}px`},R=v=>{v>=1&&v<=r&&v!==t&&!d&&s(v)};return e.jsxs("nav",{ref:b,role:"navigation","aria-label":"Pagination",className:z("brycks-pagination",`brycks-pagination--${n}`,`brycks-pagination--${a}`,f),style:x,"data-testid":k,...y,children:[l&&a!=="minimal"&&e.jsx("button",{type:"button","aria-label":"First page",disabled:t===1||d,style:w(!1,t===1||d),onClick:()=>R(1),onMouseEnter:v=>{t!==1&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(is,{})}),u&&e.jsx("button",{type:"button","aria-label":"Previous page",disabled:t===1||d,style:w(!1,t===1||d),onClick:()=>R(t-1),onMouseEnter:v=>{t!==1&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(ns,{})}),a==="simple"||a==="minimal"?e.jsx("span",{style:C,children:a==="minimal"?`${t} / ${r}`:`Page ${t} of ${r}`}):m.map((v,M)=>v==="ellipsis"?e.jsx("span",{style:S,children:"..."},`ellipsis-${M}`):e.jsx("button",{type:"button","aria-label":`Page ${v}`,"aria-current":v===t?"page":void 0,disabled:d,style:w(v===t,d),onClick:()=>R(v),onMouseEnter:j=>{v!==t&&!d&&(j.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:j=>{v!==t&&(j.currentTarget.style.backgroundColor="transparent")},children:v},v)),u&&e.jsx("button",{type:"button","aria-label":"Next page",disabled:t===r||d,style:w(!1,t===r||d),onClick:()=>R(t+1),onMouseEnter:v=>{t!==r&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(as,{})}),l&&a!=="minimal"&&e.jsx("button",{type:"button","aria-label":"Last page",disabled:t===r||d,style:w(!1,t===r||d),onClick:()=>R(r),onMouseEnter:v=>{t!==r&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(ls,{})})]})});Xt.displayName="Pagination";const Yt={sm:{fontSize:12,gap:6,iconSize:12},md:{fontSize:14,gap:8,iconSize:14},lg:{fontSize:16,gap:10,iconSize:16}};function cs({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Gt=i.forwardRef(function({separator:t,size:r="md",maxItems:s,className:n,style:a,children:c,testId:l,...u},d){const f=Yt[r],p=i.Children.toArray(c).filter(i.isValidElement);let k=p,y=!1;if(s&&p.length>s){const S=Math.floor((s-1)/2);k=[...p.slice(0,S),...p.slice(p.length-(s-S-1))],y=!0}const b={display:"flex",alignItems:"center",...a},h={display:"flex",alignItems:"center",gap:f.gap,listStyle:"none",margin:0,padding:0},m={display:"flex",alignItems:"center",color:"var(--brycks-foreground-muted)"},x={display:"flex",alignItems:"center",color:"var(--brycks-foreground-muted)",fontSize:f.fontSize},w=()=>e.jsx("span",{style:m,"aria-hidden":"true",children:t??e.jsx(cs,{size:f.iconSize})});return e.jsx("nav",{ref:d,"aria-label":"Breadcrumb",className:z("brycks-breadcrumb",`brycks-breadcrumb--${r}`,n),style:b,"data-testid":l,...u,children:e.jsx("ol",{style:h,children:k.map((S,C)=>{const R=C===k.length-1,v=!R,M=y&&C===Math.floor((s-1)/2)-1;return e.jsxs("li",{style:{display:"flex",alignItems:"center",gap:f.gap},children:[i.cloneElement(S,{isCurrentPage:R,size:r}),M&&e.jsxs(e.Fragment,{children:[w(),e.jsx("span",{style:x,children:"..."})]}),v&&w()]},C)})})})});Gt.displayName="Breadcrumb";const qt=i.forwardRef(function({as:t="a",href:r,icon:s,isCurrentPage:n=!1,size:a="md",className:c,style:l,children:u,...d},f){const p=Yt[a],k={display:"inline-flex",alignItems:"center",gap:6,fontSize:p.fontSize,fontWeight:n?500:400,color:n?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",textDecoration:"none",transition:"color 150ms ease-out",cursor:n?"default":"pointer",...l},y={width:p.iconSize,height:p.iconSize,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},b={ref:f,className:z("brycks-breadcrumb-item",n&&"brycks-breadcrumb-item--current",c),style:k,"aria-current":n?"page":void 0,...d};return t==="a"&&r&&!n&&(b.href=r),n&&t==="a"&&(b.tabIndex=-1),e.jsxs(t,{...b,onMouseEnter:h=>{n||(h.currentTarget.style.color="var(--brycks-foreground-default)")},onMouseLeave:h=>{n||(h.currentTarget.style.color="var(--brycks-foreground-muted)")},children:[s&&e.jsx("span",{style:y,children:s}),u]})});qt.displayName="BreadcrumbItem";const Kt=i.createContext({size:"md",variant:"default"});function we(){return i.useContext(Kt)}const je={sm:{fontSize:13,padding:"8px 12px",headerPadding:"8px 12px"},md:{fontSize:14,padding:"12px 16px",headerPadding:"12px 16px"},lg:{fontSize:15,padding:"16px 20px",headerPadding:"14px 20px"}},_t=i.forwardRef(function({size:t="md",variant:r="default",stickyHeader:s=!1,loading:n=!1,className:a,style:c,children:l,testId:u,...d},f){const p={position:"relative",width:"100%",overflow:"auto",...c},k={width:"100%",borderCollapse:r==="bordered"?"separate":"collapse",borderSpacing:0,fontSize:je[t].fontSize,opacity:n?.6:1,transition:"opacity 150ms ease-out"};return e.jsx(Kt.Provider,{value:{size:t,variant:r},children:e.jsx("div",{className:"brycks-table-container",style:p,children:e.jsx("table",{ref:f,className:z("brycks-table",`brycks-table--${t}`,`brycks-table--${r}`,a),style:k,"data-testid":u,...d,children:l})})})});_t.displayName="Table";const Ut=i.forwardRef(function({sticky:t=!1,className:r,style:s,children:n,...a},c){const l={backgroundColor:"var(--brycks-background-muted)",position:t?"sticky":void 0,top:t?0:void 0,zIndex:t?1:void 0,...s};return e.jsx("thead",{ref:c,className:z("brycks-table-head",t&&"brycks-table-head--sticky",r),style:l,...a,children:n})});Ut.displayName="TableHead";const Qt=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={...r};return e.jsx("tbody",{ref:a,className:z("brycks-table-body",t),style:c,...n,children:s})});Qt.displayName="TableBody";const Zt=i.forwardRef(function({selected:t=!1,clickable:r=!1,className:s,style:n,children:a,...c},l){const{variant:u}=we(),d={backgroundColor:t?"var(--brycks-primary-50)":"transparent",borderBottom:u!=="bordered"?"1px solid var(--brycks-border-muted)":void 0,cursor:r?"pointer":void 0,transition:"background-color 150ms ease-out",...n};return e.jsx("tr",{ref:l,className:z("brycks-table-row",t&&"brycks-table-row--selected",r&&"brycks-table-row--clickable",s),style:d,onMouseEnter:f=>{r&&!t&&(f.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:f=>{t||(f.currentTarget.style.backgroundColor="transparent")},...c,children:a})});Zt.displayName="TableRow";function ds({direction:o}){return o?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:o==="asc"?e.jsx("path",{d:"M7 3L10 6H4L7 3Z",fill:"currentColor"}):e.jsx("path",{d:"M7 11L4 8H10L7 11Z",fill:"currentColor"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{opacity:.4},children:[e.jsx("path",{d:"M7 3L10 6H4L7 3Z",fill:"currentColor"}),e.jsx("path",{d:"M7 11L4 8H10L7 11Z",fill:"currentColor"})]})}const Jt=i.forwardRef(function({sortable:t=!1,sortDirection:r=null,onSort:s,align:n="left",className:a,style:c,children:l,...u},d){const{size:f}=we(),k={padding:je[f].headerPadding,fontWeight:600,color:"var(--brycks-foreground-muted)",textAlign:n,whiteSpace:"nowrap",cursor:t?"pointer":void 0,userSelect:t?"none":void 0,transition:"color 150ms ease-out",...c},y={display:"flex",alignItems:"center",gap:6,justifyContent:n==="right"?"flex-end":n==="center"?"center":"flex-start"},b=()=>{t&&s&&s()};return e.jsx("th",{ref:d,className:z("brycks-table-header",t&&"brycks-table-header--sortable",a),style:k,onClick:b,onMouseEnter:h=>{t&&(h.currentTarget.style.color="var(--brycks-foreground-default)")},onMouseLeave:h=>{h.currentTarget.style.color="var(--brycks-foreground-muted)"},...u,children:e.jsxs("span",{style:y,children:[l,t&&e.jsx(ds,{direction:r})]})})});Jt.displayName="TableHeader";const er=i.forwardRef(function({align:t="left",truncate:r=!1,className:s,style:n,children:a,...c},l){const{size:u,variant:d}=we(),p={padding:je[u].padding,color:"var(--brycks-foreground-default)",textAlign:t,verticalAlign:"middle",border:d==="bordered"?"1px solid var(--brycks-border-muted)":void 0,maxWidth:r?200:void 0,overflow:r?"hidden":void 0,textOverflow:r?"ellipsis":void 0,whiteSpace:r?"nowrap":void 0,...n};return e.jsx("td",{ref:l,className:z("brycks-table-cell",r&&"brycks-table-cell--truncate",s),style:p,title:r&&typeof a=="string"?a:void 0,...c,children:a})});er.displayName="TableCell";const tr=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={backgroundColor:"var(--brycks-background-muted)",fontWeight:500,...r};return e.jsx("tfoot",{ref:a,className:z("brycks-table-foot",t),style:c,...n,children:s})});tr.displayName="TableFoot";const rr=i.forwardRef(function({placement:t="bottom",className:r,style:s,children:n,...a},c){const l={captionSide:t,padding:"12px 16px",fontSize:13,color:"var(--brycks-foreground-muted)",textAlign:"left",...s};return e.jsx("caption",{ref:c,className:z("brycks-table-caption",r),style:l,...a,children:n})});rr.displayName="TableCaption";const or=i.createContext({size:"md",variant:"default"});function us(){return i.useContext(or)}const sr=i.forwardRef(function({size:t="md",variant:r="default",interactive:s=!1,className:n,style:a,children:c,testId:l,...u},d){const f={listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:r==="separated"?8:0,border:r==="bordered"?"1px solid var(--brycks-border-default)":void 0,borderRadius:r==="bordered"?"var(--brycks-radius-lg)":void 0,overflow:r==="bordered"?"hidden":void 0,...a};return e.jsx(or.Provider,{value:{size:t,variant:r},children:e.jsx("ul",{ref:d,className:z("brycks-list",`brycks-list--${t}`,`brycks-list--${r}`,s&&"brycks-list--interactive",n),style:f,"data-testid":l,...u,children:c})})});sr.displayName="List";const fs={sm:{padding:"8px 12px",fontSize:13,secondarySize:12,gap:10,minHeight:40},md:{padding:"12px 16px",fontSize:14,secondarySize:13,gap:12,minHeight:52},lg:{padding:"16px 20px",fontSize:16,secondarySize:14,gap:14,minHeight:64}},nr=i.forwardRef(function({leftElement:t,rightElement:r,secondary:s,selected:n=!1,disabled:a=!1,clickable:c=!1,className:l,style:u,children:d,...f},p){const{size:k,variant:y}=us(),b=fs[k],h={display:"flex",alignItems:"center",gap:b.gap,padding:b.padding,minHeight:b.minHeight,backgroundColor:n?"var(--brycks-primary-50)":"transparent",borderBottom:y==="default"||y==="bordered"?"1px solid var(--brycks-border-muted)":void 0,border:y==="separated"?"1px solid var(--brycks-border-default)":void 0,borderRadius:y==="separated"?"var(--brycks-radius-lg)":void 0,cursor:a?"not-allowed":c?"pointer":void 0,opacity:a?.5:1,transition:"background-color 150ms ease-out",...u},m={flex:1,display:"flex",flexDirection:"column",gap:2,minWidth:0},x={fontSize:b.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)",lineHeight:1.4},w={fontSize:b.secondarySize,color:"var(--brycks-foreground-muted)",lineHeight:1.4},S={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return e.jsxs("li",{ref:p,className:z("brycks-list-item",n&&"brycks-list-item--selected",c&&"brycks-list-item--clickable",a&&"brycks-list-item--disabled",l),style:h,onMouseEnter:C=>{c&&!a&&!n&&(C.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:C=>{n||(C.currentTarget.style.backgroundColor="transparent")},...f,children:[t&&e.jsx("span",{style:S,children:t}),e.jsxs("div",{style:m,children:[e.jsx("span",{style:x,children:d}),s&&e.jsx("span",{style:w,children:s})]}),r&&e.jsx("span",{style:S,children:r})]})});nr.displayName="ListItem";const ar=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"8px 0",...r};return e.jsx("li",{ref:n,role:"separator",className:z("brycks-list-divider",t),style:a,...s})});ar.displayName="ListDivider";const ir=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={padding:"12px 16px 8px 16px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em",...r};return e.jsx("li",{ref:a,className:z("brycks-list-header",t),style:c,...n,children:s})});ir.displayName="ListHeader";const ys={sm:{fontSize:10,padding:"2px 6px",height:18},md:{fontSize:11,padding:"3px 8px",height:22},lg:{fontSize:12,padding:"4px 10px",height:26}},bs={neutral:{solid:{backgroundColor:"var(--brycks-foreground-default)",color:"var(--brycks-background-app)"},subtle:{backgroundColor:"var(--brycks-background-muted)",color:"var(--brycks-foreground-default)"},outline:{backgroundColor:"transparent",color:"var(--brycks-foreground-default)",borderColor:"var(--brycks-border-default)"}},primary:{solid:{backgroundColor:"var(--brycks-primary-default)",color:"var(--brycks-primary-foreground)"},subtle:{backgroundColor:"var(--brycks-primary-muted)",color:"var(--brycks-primary-hover)"},outline:{backgroundColor:"transparent",color:"var(--brycks-primary-default)",borderColor:"var(--brycks-primary-default)"}},accent:{solid:{backgroundColor:"var(--brycks-accent-default)",color:"var(--brycks-accent-foreground)"},subtle:{backgroundColor:"var(--brycks-accent-muted)",color:"var(--brycks-accent-hover)"},outline:{backgroundColor:"transparent",color:"var(--brycks-accent-default)",borderColor:"var(--brycks-accent-default)"}},success:{solid:{backgroundColor:"var(--brycks-success-default)",color:"var(--brycks-success-foreground)"},subtle:{backgroundColor:"var(--brycks-success-muted)",color:"var(--brycks-success-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-success-default)",borderColor:"var(--brycks-success-default)"}},warning:{solid:{backgroundColor:"var(--brycks-warning-default)",color:"var(--brycks-warning-foreground)"},subtle:{backgroundColor:"var(--brycks-warning-muted)",color:"var(--brycks-warning-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-warning-default)",borderColor:"var(--brycks-warning-default)"}},error:{solid:{backgroundColor:"var(--brycks-error-default)",color:"var(--brycks-error-foreground)"},subtle:{backgroundColor:"var(--brycks-error-muted)",color:"var(--brycks-error-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-error-default)",borderColor:"var(--brycks-error-default)"}},info:{solid:{backgroundColor:"var(--brycks-info-default)",color:"var(--brycks-info-foreground)"},subtle:{backgroundColor:"var(--brycks-info-muted)",color:"var(--brycks-info-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-info-default)",borderColor:"var(--brycks-info-default)"}}},lr=i.forwardRef(function({variant:t="subtle",intent:r="neutral",size:s="md",className:n,style:a,testId:c,children:l,...u},d){const f=ys[s],p=bs[r][t],k={display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontFamily:"var(--brycks-font-sans)",lineHeight:1,borderRadius:"var(--brycks-radius-full)",whiteSpace:"nowrap",border:t==="outline"?"1px solid":"none",...f,...p,...a};return e.jsx("span",{ref:d,className:z("brycks-badge",`brycks-badge--${t}`,`brycks-badge--${r}`,`brycks-badge--${s}`,n),style:k,"data-testid":c,...u,children:l})});lr.displayName="Badge";const gs={xs:14,sm:18,md:24,lg:32,xl:48};function ms({size:o,color:t}){return e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"brycks-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.2"}),e.jsx("path",{d:"M12 2C6.47715 2 2 6.47715 2 12",stroke:t,strokeWidth:"2.5",strokeLinecap:"round"})]})}function ps({size:o,color:t}){const r=o/4,s=o/6;return e.jsx("div",{style:{display:"flex",alignItems:"center",gap:s,height:o},children:[0,1,2].map(n=>e.jsx("span",{style:{width:r,height:r,borderRadius:"50%",backgroundColor:t,animation:"brycks-bounce 1.4s ease-in-out infinite",animationDelay:`${n*.16}s`}},n))})}function hs({size:o,color:t}){return e.jsx("span",{style:{display:"block",width:o,height:o,borderRadius:"50%",backgroundColor:t,animation:"brycks-pulse 1.5s ease-in-out infinite"}})}const Ce=i.forwardRef(function({size:t="md",variant:r="spinner",color:s="var(--brycks-primary-default)",label:n="Loading",className:a,style:c,testId:l,...u},d){const f=gs[t],p={display:"inline-flex",alignItems:"center",justifyContent:"center",...c},k=()=>{switch(r){case"dots":return e.jsx(ps,{size:f,color:s});case"pulse":return e.jsx(hs,{size:f,color:s});default:return e.jsx(ms,{size:f,color:s})}};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
125
|
+
`}),e.jsx("div",{ref:M,role:"menu",style:X,onKeyDown:R,tabIndex:-1,children:y})]}),document.body)]})})});Ft.displayName="Dropdown";const Et=i.forwardRef(function({disabled:t=!1,icon:r,shortcut:s,destructive:n=!1,className:a,style:c,children:l,onClick:u,...d},y){const{close:p}=gs(),h=m=>{t||(u==null||u(m),p())},b={display:"flex",alignItems:"center",gap:10,padding:"8px 12px",fontSize:14,color:t?"var(--brycks-foreground-disabled)":n?"var(--brycks-error-default)":"var(--brycks-foreground-default)",backgroundColor:"transparent",borderRadius:"var(--brycks-radius-md)",cursor:t?"not-allowed":"pointer",transition:"background-color 100ms ease-out",outline:"none",...c},g={width:16,height:16,color:t?"var(--brycks-foreground-disabled)":n?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",flexShrink:0},k={marginLeft:"auto",fontSize:12,color:"var(--brycks-foreground-muted)",fontFamily:"var(--brycks-font-mono)"};return e.jsxs("div",{ref:y,role:"menuitem","aria-disabled":t,tabIndex:t?-1:0,className:z("brycks-dropdown-item",t&&"brycks-dropdown-item--disabled",a),style:b,onClick:h,onMouseEnter:m=>{t||(m.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},onFocus:m=>{m.currentTarget.style.backgroundColor="var(--brycks-background-muted)"},onBlur:m=>{m.currentTarget.style.backgroundColor="transparent"},...d,children:[r&&e.jsx("span",{style:g,children:r}),e.jsx("span",{style:{flex:1},children:l}),s&&e.jsx("span",{style:k,children:s})]})});Et.displayName="DropdownItem";const Bt=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"4px 0",...r};return e.jsx("div",{ref:n,role:"separator",className:z("brycks-dropdown-divider",t),style:a,...s})});Bt.displayName="DropdownDivider";const At=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={padding:"8px 12px 4px 12px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em",...r};return e.jsx("div",{ref:a,className:z("brycks-dropdown-label",t),style:c,...n,children:s})});At.displayName="DropdownLabel";const Pt=i.createContext(null);function Ot(){const o=i.useContext(Pt);if(!o)throw new Error("Menu components must be used within a Menu");return o}const Vt=i.forwardRef(function({activeItem:t,onChange:r,size:s="md",collapsed:n=!1,className:a,style:c,children:l,testId:u,...d},y){const[p,h]=i.useState(null),b=t!==void 0?t:p,g=m=>{t===void 0&&h(m),r==null||r(m)},k={display:"flex",flexDirection:"column",gap:2,padding:8,...c};return e.jsx(Pt.Provider,{value:{size:s,activeItem:b,setActiveItem:g,collapsed:n},children:e.jsx("nav",{ref:y,className:z("brycks-menu",`brycks-menu--${s}`,n&&"brycks-menu--collapsed",a),style:k,"data-testid":u,...d,children:l})})});Vt.displayName="Menu";const ms={sm:{height:32,fontSize:13,iconSize:16,padding:10},md:{height:40,fontSize:14,iconSize:18,padding:12},lg:{height:48,fontSize:16,iconSize:20,padding:14}},Xt=i.forwardRef(function({value:t,icon:r,badge:s,disabled:n=!1,onClick:a,className:c,style:l,children:u,...d},y){const{size:p,activeItem:h,setActiveItem:b,collapsed:g}=Ot(),k=h===t,m=ms[p],x=()=>{n||(b(t),a==null||a(t))},w={display:"flex",alignItems:"center",gap:10,width:"100%",minHeight:m.height,padding:g?m.padding:`0 ${m.padding}px`,fontSize:m.fontSize,fontWeight:k?600:500,color:n?"var(--brycks-foreground-disabled)":k?"var(--brycks-primary-default)":"var(--brycks-foreground-default)",backgroundColor:k?"var(--brycks-primary-50)":"transparent",border:"none",borderRadius:"var(--brycks-radius-md)",cursor:n?"not-allowed":"pointer",transition:"all 150ms ease-out",textAlign:"left",outline:"none",justifyContent:g?"center":"flex-start",...l},S={width:m.iconSize,height:m.iconSize,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},j={marginLeft:"auto"};return e.jsxs("button",{ref:y,type:"button",disabled:n,className:z("brycks-menu-item",k&&"brycks-menu-item--active",c),style:w,onClick:x,onMouseEnter:I=>{!n&&!k&&(I.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:I=>{k||(I.currentTarget.style.backgroundColor="transparent")},title:g?String(u):void 0,...d,children:[r&&e.jsx("span",{style:S,children:r}),!g&&e.jsx("span",{style:{flex:1},children:u}),!g&&s&&e.jsx("span",{style:j,children:s})]})});Xt.displayName="MenuItem";const Gt=i.forwardRef(function({label:t,className:r,style:s,children:n,...a},c){const{collapsed:l}=Ot(),u={display:"flex",flexDirection:"column",gap:2,...s},d={padding:"12px 12px 6px 12px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em"};return e.jsxs("div",{ref:c,className:z("brycks-menu-group",r),style:u,...a,children:[t&&!l&&e.jsx("div",{style:d,children:t}),n]})});Gt.displayName="MenuGroup";const Yt=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"8px 0",...r};return e.jsx("div",{ref:n,role:"separator",className:z("brycks-menu-divider",t),style:a,...s})});Yt.displayName="MenuDivider";const ps={sm:{height:28,fontSize:12,gap:4,minWidth:28},md:{height:36,fontSize:14,gap:6,minWidth:36},lg:{height:44,fontSize:16,gap:8,minWidth:44}};function hs(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ks(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function vs(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M11 12l-4-4 4-4M7 12l-4-4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xs(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M5 4l4 4-4 4M9 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const _t=i.forwardRef(function({page:t,totalPages:r,onChange:s,size:n="md",variant:a="default",siblingCount:c=1,showFirstLast:l=!0,showPrevNext:u=!0,disabled:d=!1,className:y,style:p,testId:h,...b},g){const k=ps[n],m=i.useMemo(()=>{if(a==="minimal"||a==="simple")return[];const v=[],M=Math.max(t-c,1),C=Math.min(t+c,r),T=M>2,L=C<r-1;if(T)if(L){v.push(1),v.push("ellipsis");for(let R=M;R<=C;R++)v.push(R);v.push("ellipsis"),v.push(r)}else{v.push(1),v.push("ellipsis");for(let R=Math.max(r-2-c,1);R<=r;R++)v.push(R)}else{for(let R=1;R<=Math.min(3+c,r);R++)v.push(R);L&&(v.push("ellipsis"),v.push(r))}return v},[t,r,c,a]),x={display:"flex",alignItems:"center",gap:k.gap,...p},w=(v,M)=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:k.minWidth,height:k.height,padding:`0 ${k.gap+4}px`,fontSize:k.fontSize,fontWeight:v?600:500,color:M?"var(--brycks-foreground-disabled)":v?"var(--brycks-primary-default)":"var(--brycks-foreground-default)",backgroundColor:v?"var(--brycks-primary-50)":"transparent",border:"none",borderRadius:"var(--brycks-radius-md)",cursor:M?"not-allowed":"pointer",transition:"all 150ms ease-out",outline:"none"}),S={display:"flex",alignItems:"center",justifyContent:"center",minWidth:k.minWidth,height:k.height,color:"var(--brycks-foreground-muted)",fontSize:k.fontSize},j={fontSize:k.fontSize,color:"var(--brycks-foreground-muted)",padding:`0 ${k.gap}px`},I=v=>{v>=1&&v<=r&&v!==t&&!d&&s(v)};return e.jsxs("nav",{ref:g,role:"navigation","aria-label":"Pagination",className:z("brycks-pagination",`brycks-pagination--${n}`,`brycks-pagination--${a}`,y),style:x,"data-testid":h,...b,children:[l&&a!=="minimal"&&e.jsx("button",{type:"button","aria-label":"First page",disabled:t===1||d,style:w(!1,t===1||d),onClick:()=>I(1),onMouseEnter:v=>{t!==1&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(vs,{})}),u&&e.jsx("button",{type:"button","aria-label":"Previous page",disabled:t===1||d,style:w(!1,t===1||d),onClick:()=>I(t-1),onMouseEnter:v=>{t!==1&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(hs,{})}),a==="simple"||a==="minimal"?e.jsx("span",{style:j,children:a==="minimal"?`${t} / ${r}`:`Page ${t} of ${r}`}):m.map((v,M)=>v==="ellipsis"?e.jsx("span",{style:S,children:"..."},`ellipsis-${M}`):e.jsx("button",{type:"button","aria-label":`Page ${v}`,"aria-current":v===t?"page":void 0,disabled:d,style:w(v===t,d),onClick:()=>I(v),onMouseEnter:C=>{v!==t&&!d&&(C.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:C=>{v!==t&&(C.currentTarget.style.backgroundColor="transparent")},children:v},v)),u&&e.jsx("button",{type:"button","aria-label":"Next page",disabled:t===r||d,style:w(!1,t===r||d),onClick:()=>I(t+1),onMouseEnter:v=>{t!==r&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(ks,{})}),l&&a!=="minimal"&&e.jsx("button",{type:"button","aria-label":"Last page",disabled:t===r||d,style:w(!1,t===r||d),onClick:()=>I(r),onMouseEnter:v=>{t!==r&&!d&&(v.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent"},children:e.jsx(xs,{})})]})});_t.displayName="Pagination";const qt={sm:{fontSize:12,gap:6,iconSize:12},md:{fontSize:14,gap:8,iconSize:14},lg:{fontSize:16,gap:10,iconSize:16}};function Ss({size:o}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Kt=i.forwardRef(function({separator:t,size:r="md",maxItems:s,className:n,style:a,children:c,testId:l,...u},d){const y=qt[r],p=i.Children.toArray(c).filter(i.isValidElement);let h=p,b=!1;if(s&&p.length>s){const S=Math.floor((s-1)/2);h=[...p.slice(0,S),...p.slice(p.length-(s-S-1))],b=!0}const g={display:"flex",alignItems:"center",...a},k={display:"flex",alignItems:"center",gap:y.gap,listStyle:"none",margin:0,padding:0},m={display:"flex",alignItems:"center",color:"var(--brycks-foreground-muted)"},x={display:"flex",alignItems:"center",color:"var(--brycks-foreground-muted)",fontSize:y.fontSize},w=()=>e.jsx("span",{style:m,"aria-hidden":"true",children:t??e.jsx(Ss,{size:y.iconSize})});return e.jsx("nav",{ref:d,"aria-label":"Breadcrumb",className:z("brycks-breadcrumb",`brycks-breadcrumb--${r}`,n),style:g,"data-testid":l,...u,children:e.jsx("ol",{style:k,children:h.map((S,j)=>{const I=j===h.length-1,v=!I,M=b&&j===Math.floor((s-1)/2)-1;return e.jsxs("li",{style:{display:"flex",alignItems:"center",gap:y.gap},children:[i.cloneElement(S,{isCurrentPage:I,size:r}),M&&e.jsxs(e.Fragment,{children:[w(),e.jsx("span",{style:x,children:"..."})]}),v&&w()]},j)})})})});Kt.displayName="Breadcrumb";const Ut=i.forwardRef(function({as:t="a",href:r,icon:s,isCurrentPage:n=!1,size:a="md",className:c,style:l,children:u,...d},y){const p=qt[a],h={display:"inline-flex",alignItems:"center",gap:6,fontSize:p.fontSize,fontWeight:n?500:400,color:n?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",textDecoration:"none",transition:"color 150ms ease-out",cursor:n?"default":"pointer",...l},b={width:p.iconSize,height:p.iconSize,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},g={ref:y,className:z("brycks-breadcrumb-item",n&&"brycks-breadcrumb-item--current",c),style:h,"aria-current":n?"page":void 0,...d};return t==="a"&&r&&!n&&(g.href=r),n&&t==="a"&&(g.tabIndex=-1),e.jsxs(t,{...g,onMouseEnter:k=>{n||(k.currentTarget.style.color="var(--brycks-foreground-default)")},onMouseLeave:k=>{n||(k.currentTarget.style.color="var(--brycks-foreground-muted)")},children:[s&&e.jsx("span",{style:b,children:s}),u]})});Ut.displayName="BreadcrumbItem";const Qt=i.createContext({size:"md",variant:"default"});function we(){return i.useContext(Qt)}const je={sm:{fontSize:13,padding:"8px 12px",headerPadding:"8px 12px"},md:{fontSize:14,padding:"12px 16px",headerPadding:"12px 16px"},lg:{fontSize:15,padding:"16px 20px",headerPadding:"14px 20px"}},Zt=i.forwardRef(function({size:t="md",variant:r="default",stickyHeader:s=!1,loading:n=!1,className:a,style:c,children:l,testId:u,...d},y){const p={position:"relative",width:"100%",overflow:"auto",...c},h={width:"100%",borderCollapse:r==="bordered"?"separate":"collapse",borderSpacing:0,fontSize:je[t].fontSize,opacity:n?.6:1,transition:"opacity 150ms ease-out"};return e.jsx(Qt.Provider,{value:{size:t,variant:r},children:e.jsx("div",{className:"brycks-table-container",style:p,children:e.jsx("table",{ref:y,className:z("brycks-table",`brycks-table--${t}`,`brycks-table--${r}`,a),style:h,"data-testid":u,...d,children:l})})})});Zt.displayName="Table";const Jt=i.forwardRef(function({sticky:t=!1,className:r,style:s,children:n,...a},c){const l={backgroundColor:"var(--brycks-background-muted)",position:t?"sticky":void 0,top:t?0:void 0,zIndex:t?1:void 0,...s};return e.jsx("thead",{ref:c,className:z("brycks-table-head",t&&"brycks-table-head--sticky",r),style:l,...a,children:n})});Jt.displayName="TableHead";const er=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={...r};return e.jsx("tbody",{ref:a,className:z("brycks-table-body",t),style:c,...n,children:s})});er.displayName="TableBody";const tr=i.forwardRef(function({selected:t=!1,clickable:r=!1,className:s,style:n,children:a,...c},l){const{variant:u}=we(),d={backgroundColor:t?"var(--brycks-primary-50)":"transparent",borderBottom:u!=="bordered"?"1px solid var(--brycks-border-muted)":void 0,cursor:r?"pointer":void 0,transition:"background-color 150ms ease-out",...n};return e.jsx("tr",{ref:l,className:z("brycks-table-row",t&&"brycks-table-row--selected",r&&"brycks-table-row--clickable",s),style:d,onMouseEnter:y=>{r&&!t&&(y.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:y=>{t||(y.currentTarget.style.backgroundColor="transparent")},...c,children:a})});tr.displayName="TableRow";function ws({direction:o}){return o?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:o==="asc"?e.jsx("path",{d:"M7 3L10 6H4L7 3Z",fill:"currentColor"}):e.jsx("path",{d:"M7 11L4 8H10L7 11Z",fill:"currentColor"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{opacity:.4},children:[e.jsx("path",{d:"M7 3L10 6H4L7 3Z",fill:"currentColor"}),e.jsx("path",{d:"M7 11L4 8H10L7 11Z",fill:"currentColor"})]})}const rr=i.forwardRef(function({sortable:t=!1,sortDirection:r=null,onSort:s,align:n="left",className:a,style:c,children:l,...u},d){const{size:y}=we(),h={padding:je[y].headerPadding,fontWeight:600,color:"var(--brycks-foreground-muted)",textAlign:n,whiteSpace:"nowrap",cursor:t?"pointer":void 0,userSelect:t?"none":void 0,transition:"color 150ms ease-out",...c},b={display:"flex",alignItems:"center",gap:6,justifyContent:n==="right"?"flex-end":n==="center"?"center":"flex-start"},g=()=>{t&&s&&s()};return e.jsx("th",{ref:d,className:z("brycks-table-header",t&&"brycks-table-header--sortable",a),style:h,onClick:g,onMouseEnter:k=>{t&&(k.currentTarget.style.color="var(--brycks-foreground-default)")},onMouseLeave:k=>{k.currentTarget.style.color="var(--brycks-foreground-muted)"},...u,children:e.jsxs("span",{style:b,children:[l,t&&e.jsx(ws,{direction:r})]})})});rr.displayName="TableHeader";const or=i.forwardRef(function({align:t="left",truncate:r=!1,className:s,style:n,children:a,...c},l){const{size:u,variant:d}=we(),p={padding:je[u].padding,color:"var(--brycks-foreground-default)",textAlign:t,verticalAlign:"middle",border:d==="bordered"?"1px solid var(--brycks-border-muted)":void 0,maxWidth:r?200:void 0,overflow:r?"hidden":void 0,textOverflow:r?"ellipsis":void 0,whiteSpace:r?"nowrap":void 0,...n};return e.jsx("td",{ref:l,className:z("brycks-table-cell",r&&"brycks-table-cell--truncate",s),style:p,title:r&&typeof a=="string"?a:void 0,...c,children:a})});or.displayName="TableCell";const sr=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={backgroundColor:"var(--brycks-background-muted)",fontWeight:500,...r};return e.jsx("tfoot",{ref:a,className:z("brycks-table-foot",t),style:c,...n,children:s})});sr.displayName="TableFoot";const nr=i.forwardRef(function({placement:t="bottom",className:r,style:s,children:n,...a},c){const l={captionSide:t,padding:"12px 16px",fontSize:13,color:"var(--brycks-foreground-muted)",textAlign:"left",...s};return e.jsx("caption",{ref:c,className:z("brycks-table-caption",r),style:l,...a,children:n})});nr.displayName="TableCaption";const ar=i.createContext({size:"md",variant:"default"});function js(){return i.useContext(ar)}const ir=i.forwardRef(function({size:t="md",variant:r="default",interactive:s=!1,className:n,style:a,children:c,testId:l,...u},d){const y={listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:r==="separated"?8:0,border:r==="bordered"?"1px solid var(--brycks-border-default)":void 0,borderRadius:r==="bordered"?"var(--brycks-radius-lg)":void 0,overflow:r==="bordered"?"hidden":void 0,...a};return e.jsx(ar.Provider,{value:{size:t,variant:r},children:e.jsx("ul",{ref:d,className:z("brycks-list",`brycks-list--${t}`,`brycks-list--${r}`,s&&"brycks-list--interactive",n),style:y,"data-testid":l,...u,children:c})})});ir.displayName="List";const Cs={sm:{padding:"8px 12px",fontSize:13,secondarySize:12,gap:10,minHeight:40},md:{padding:"12px 16px",fontSize:14,secondarySize:13,gap:12,minHeight:52},lg:{padding:"16px 20px",fontSize:16,secondarySize:14,gap:14,minHeight:64}},lr=i.forwardRef(function({leftElement:t,rightElement:r,secondary:s,selected:n=!1,disabled:a=!1,clickable:c=!1,className:l,style:u,children:d,...y},p){const{size:h,variant:b}=js(),g=Cs[h],k={display:"flex",alignItems:"center",gap:g.gap,padding:g.padding,minHeight:g.minHeight,backgroundColor:n?"var(--brycks-primary-50)":"transparent",borderBottom:b==="default"||b==="bordered"?"1px solid var(--brycks-border-muted)":void 0,border:b==="separated"?"1px solid var(--brycks-border-default)":void 0,borderRadius:b==="separated"?"var(--brycks-radius-lg)":void 0,cursor:a?"not-allowed":c?"pointer":void 0,opacity:a?.5:1,transition:"background-color 150ms ease-out",...u},m={flex:1,display:"flex",flexDirection:"column",gap:2,minWidth:0},x={fontSize:g.fontSize,fontWeight:500,color:"var(--brycks-foreground-default)",lineHeight:1.4},w={fontSize:g.secondarySize,color:"var(--brycks-foreground-muted)",lineHeight:1.4},S={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return e.jsxs("li",{ref:p,className:z("brycks-list-item",n&&"brycks-list-item--selected",c&&"brycks-list-item--clickable",a&&"brycks-list-item--disabled",l),style:k,onMouseEnter:j=>{c&&!a&&!n&&(j.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:j=>{n||(j.currentTarget.style.backgroundColor="transparent")},...y,children:[t&&e.jsx("span",{style:S,children:t}),e.jsxs("div",{style:m,children:[e.jsx("span",{style:x,children:d}),s&&e.jsx("span",{style:w,children:s})]}),r&&e.jsx("span",{style:S,children:r})]})});lr.displayName="ListItem";const cr=i.forwardRef(function({className:t,style:r,...s},n){const a={height:1,backgroundColor:"var(--brycks-border-muted)",margin:"8px 0",...r};return e.jsx("li",{ref:n,role:"separator",className:z("brycks-list-divider",t),style:a,...s})});cr.displayName="ListDivider";const dr=i.forwardRef(function({className:t,style:r,children:s,...n},a){const c={padding:"12px 16px 8px 16px",fontSize:11,fontWeight:600,color:"var(--brycks-foreground-muted)",textTransform:"uppercase",letterSpacing:"0.05em",...r};return e.jsx("li",{ref:a,className:z("brycks-list-header",t),style:c,...n,children:s})});dr.displayName="ListHeader";const zs={sm:{labelSize:f.fontSizes.xs,valueSize:f.fontSizes.sm,gap:f.spacing[.5]},md:{labelSize:f.fontSizes.sm,valueSize:f.fontSizes.md,gap:f.spacing[1]},lg:{labelSize:f.fontSizes.md,valueSize:f.fontSizes.lg,gap:f.spacing[1.5]}},ur=i.forwardRef(function({label:t,value:r,children:s,layout:n="vertical",size:a="md",hideEmpty:c=!1,labelWidth:l,className:u,style:d,testId:y,...p},h){const b=r??s,g=zs[a];if(c&&(b==null||b===""))return null;const k=()=>{const w={display:"flex",gap:g.gap};switch(n){case"vertical":return{...w,flexDirection:"column"};case"horizontal":return{...w,flexDirection:"row",alignItems:"flex-start"};case"inline":return{...w,flexDirection:"row",alignItems:"center"};default:return w}},m={fontSize:g.labelSize,fontWeight:f.fontWeights.medium,color:"var(--brycks-foreground-muted)",lineHeight:1.4,...n==="horizontal"&&l?{width:l,flexShrink:0}:{}},x={fontSize:g.valueSize,fontWeight:f.fontWeights.regular,color:"var(--brycks-foreground-default)",lineHeight:1.5,...n==="horizontal"?{flex:1}:{}};return e.jsxs("div",{ref:h,className:z("brycks-info-item",`brycks-info-item--${n}`,`brycks-info-item--${a}`,u),style:{...k(),...d},"data-testid":y,...p,children:[e.jsx("dt",{className:"brycks-info-item__label",style:m,children:t}),e.jsx("dd",{className:"brycks-info-item__value",style:{...x,margin:0},children:b??e.jsx("span",{style:{color:"var(--brycks-foreground-muted)"},children:"-"})})]})});ur.displayName="InfoItem";const Ms={sm:f.spacing[2],md:f.spacing[4],lg:f.spacing[6]},fr=i.forwardRef(function({gap:t="md",columns:r=1,children:s,className:n,style:a,testId:c,...l},u){const d={display:"grid",gridTemplateColumns:`repeat(${r}, 1fr)`,gap:Ms[t],margin:0,padding:0,...a};return e.jsx("dl",{ref:u,className:z("brycks-info-list",`brycks-info-list--cols-${r}`,n),style:d,"data-testid":c,...l,children:s})});fr.displayName="InfoList";const Is={sm:{fontSize:10,padding:"2px 6px",height:18},md:{fontSize:11,padding:"3px 8px",height:22},lg:{fontSize:12,padding:"4px 10px",height:26}},Ts={neutral:{solid:{backgroundColor:"var(--brycks-foreground-default)",color:"var(--brycks-background-app)"},subtle:{backgroundColor:"var(--brycks-background-muted)",color:"var(--brycks-foreground-default)"},outline:{backgroundColor:"transparent",color:"var(--brycks-foreground-default)",borderColor:"var(--brycks-border-default)"}},primary:{solid:{backgroundColor:"var(--brycks-primary-default)",color:"var(--brycks-primary-foreground)"},subtle:{backgroundColor:"var(--brycks-primary-muted)",color:"var(--brycks-primary-hover)"},outline:{backgroundColor:"transparent",color:"var(--brycks-primary-default)",borderColor:"var(--brycks-primary-default)"}},accent:{solid:{backgroundColor:"var(--brycks-accent-default)",color:"var(--brycks-accent-foreground)"},subtle:{backgroundColor:"var(--brycks-accent-muted)",color:"var(--brycks-accent-hover)"},outline:{backgroundColor:"transparent",color:"var(--brycks-accent-default)",borderColor:"var(--brycks-accent-default)"}},success:{solid:{backgroundColor:"var(--brycks-success-default)",color:"var(--brycks-success-foreground)"},subtle:{backgroundColor:"var(--brycks-success-muted)",color:"var(--brycks-success-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-success-default)",borderColor:"var(--brycks-success-default)"}},warning:{solid:{backgroundColor:"var(--brycks-warning-default)",color:"var(--brycks-warning-foreground)"},subtle:{backgroundColor:"var(--brycks-warning-muted)",color:"var(--brycks-warning-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-warning-default)",borderColor:"var(--brycks-warning-default)"}},error:{solid:{backgroundColor:"var(--brycks-error-default)",color:"var(--brycks-error-foreground)"},subtle:{backgroundColor:"var(--brycks-error-muted)",color:"var(--brycks-error-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-error-default)",borderColor:"var(--brycks-error-default)"}},info:{solid:{backgroundColor:"var(--brycks-info-default)",color:"var(--brycks-info-foreground)"},subtle:{backgroundColor:"var(--brycks-info-muted)",color:"var(--brycks-info-on-muted)"},outline:{backgroundColor:"transparent",color:"var(--brycks-info-default)",borderColor:"var(--brycks-info-default)"}}},yr=i.forwardRef(function({variant:t="subtle",intent:r="neutral",size:s="md",className:n,style:a,testId:c,children:l,...u},d){const y=Is[s],p=Ts[r][t],h={display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontFamily:"var(--brycks-font-sans)",lineHeight:1,borderRadius:"var(--brycks-radius-full)",whiteSpace:"nowrap",border:t==="outline"?"1px solid":"none",...y,...p,...a};return e.jsx("span",{ref:d,className:z("brycks-badge",`brycks-badge--${t}`,`brycks-badge--${r}`,`brycks-badge--${s}`,n),style:h,"data-testid":c,...u,children:l})});yr.displayName="Badge";const Rs={xs:14,sm:18,md:24,lg:32,xl:48};function Ls({size:o,color:t}){return e.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"brycks-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.2"}),e.jsx("path",{d:"M12 2C6.47715 2 2 6.47715 2 12",stroke:t,strokeWidth:"2.5",strokeLinecap:"round"})]})}function Ns({size:o,color:t}){const r=o/4,s=o/6;return e.jsx("div",{style:{display:"flex",alignItems:"center",gap:s,height:o},children:[0,1,2].map(n=>e.jsx("span",{style:{width:r,height:r,borderRadius:"50%",backgroundColor:t,animation:"brycks-bounce 1.4s ease-in-out infinite",animationDelay:`${n*.16}s`}},n))})}function $s({size:o,color:t}){return e.jsx("span",{style:{display:"block",width:o,height:o,borderRadius:"50%",backgroundColor:t,animation:"brycks-pulse 1.5s ease-in-out infinite"}})}const Ce=i.forwardRef(function({size:t="md",variant:r="spinner",color:s="var(--brycks-primary-default)",label:n="Loading",className:a,style:c,testId:l,...u},d){const y=Rs[t],p={display:"inline-flex",alignItems:"center",justifyContent:"center",...c},h=()=>{switch(r){case"dots":return e.jsx(Ns,{size:y,color:s});case"pulse":return e.jsx($s,{size:y,color:s});default:return e.jsx(Ls,{size:y,color:s})}};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
126
126
|
@keyframes brycks-spin {
|
|
127
127
|
from { transform: rotate(0deg); }
|
|
128
128
|
to { transform: rotate(360deg); }
|
|
@@ -135,15 +135,15 @@
|
|
|
135
135
|
0%, 100% { transform: scale(0.8); opacity: 0.5; }
|
|
136
136
|
50% { transform: scale(1); opacity: 1; }
|
|
137
137
|
}
|
|
138
|
-
`}),e.jsxs("div",{ref:d,role:"status","aria-label":n,className:z("brycks-loader",`brycks-loader--${r}`,`brycks-loader--${t}`,a),style:p,"data-testid":l,...u,children:[
|
|
138
|
+
`}),e.jsxs("div",{ref:d,role:"status","aria-label":n,className:z("brycks-loader",`brycks-loader--${r}`,`brycks-loader--${t}`,a),style:p,"data-testid":l,...u,children:[h(),e.jsx("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},children:n})]})]})});Ce.displayName="Loader";const Hs=Ce,ze=i.forwardRef(function({variant:t="rectangular",width:r,height:s,radius:n,animate:a=!0,className:c,style:l,testId:u,...d},y){const h={...(()=>{const g={backgroundColor:"var(--brycks-background-muted)",position:"relative",overflow:"hidden"};switch(t){case"text":g.width=r??"100%",g.height=s??"1em",g.borderRadius="var(--brycks-radius-sm)";break;case"circular":g.width=r??40,g.height=s??r??40,g.borderRadius="50%";break;case"rectangular":g.width=r??"100%",g.height=s??40,g.borderRadius=n??"var(--brycks-radius-default)";break}return g})(),...l},b={position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%)",animation:a?"brycks-shimmer 1.5s infinite":"none"};return e.jsxs(e.Fragment,{children:[a&&e.jsx("style",{children:`
|
|
139
139
|
@keyframes brycks-shimmer {
|
|
140
140
|
0% { transform: translateX(-100%); }
|
|
141
141
|
100% { transform: translateX(100%); }
|
|
142
142
|
}
|
|
143
|
-
`}),e.jsx("div",{ref:
|
|
143
|
+
`}),e.jsx("div",{ref:y,className:z("brycks-skeleton",`brycks-skeleton--${t}`,a&&"brycks-skeleton--animated",c),style:h,"data-testid":u,"aria-hidden":"true",...d,children:a&&e.jsx("div",{style:b})})]})});ze.displayName="Skeleton";function br({lines:o=3,gap:t=8,lastLineWidth:r="80%",className:s}){return e.jsx("div",{className:z("brycks-skeleton-text",s),style:{display:"flex",flexDirection:"column",gap:t},children:Array.from({length:o}).map((n,a)=>e.jsx(ze,{variant:"text",width:a===o-1?r:"100%"},a))})}br.displayName="SkeletonText";const gr=i.forwardRef(function({orientation:t="horizontal",variant:r="solid",label:s,labelPosition:n="center",className:a,style:c,testId:l,...u},d){const y=t==="horizontal",p={display:"flex",alignItems:"center",width:y?"100%":void 0,height:y?void 0:"100%",flexDirection:y?"row":"column",...c},h={flex:1,backgroundColor:r==="solid"?"var(--brycks-border-muted)":"transparent",borderStyle:r,borderColor:"var(--brycks-border-muted)",...y?{height:1,borderWidth:r==="solid"?0:"1px 0 0 0"}:{width:1,borderWidth:r==="solid"?0:"0 0 0 1px"}},b={padding:y?"0 12px":"12px 0",fontSize:12,fontWeight:500,color:"var(--brycks-foreground-muted)",whiteSpace:"nowrap"};if(!s)return e.jsx("div",{ref:d,role:"separator","aria-orientation":t,className:z("brycks-divider",`brycks-divider--${t}`,`brycks-divider--${r}`,a),style:{...h,...c},"data-testid":l,...u});const g=n==="center"||n==="end",k=n==="center"||n==="start";return e.jsxs("div",{ref:d,role:"separator","aria-orientation":t,className:z("brycks-divider",`brycks-divider--${t}`,`brycks-divider--${r}`,"brycks-divider--with-label",a),style:p,"data-testid":l,...u,children:[g&&e.jsx("span",{style:h}),e.jsx("span",{style:b,children:s}),k&&e.jsx("span",{style:h})]})});gr.displayName="Divider";const mr=i.forwardRef(function({icon:t,title:r,description:s,action:n,secondaryAction:a,className:c,style:l,testId:u,children:d,...y},p){const h={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",...l},b={marginBottom:16,color:"var(--brycks-foreground-subtle)"},g={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",marginBottom:s?8:0,maxWidth:400},k={fontSize:14,color:"var(--brycks-foreground-muted)",lineHeight:1.5,maxWidth:400},m={display:"flex",alignItems:"center",gap:12,marginTop:24};return e.jsxs("div",{ref:p,className:z("brycks-empty-state",c),style:h,"data-testid":u,...y,children:[t&&e.jsx("div",{style:b,children:t}),r&&e.jsx("h3",{style:g,children:r}),s&&e.jsx("p",{style:k,children:s}),d,(n||a)&&e.jsxs("div",{style:m,children:[n,a]})]})});mr.displayName="EmptyState";function pr({size:o=64}){return e.jsxs("svg",{width:o,height:o,viewBox:"0 0 64 64",fill:"none",style:{opacity:.5},children:[e.jsx("rect",{x:"8",y:"12",width:"48",height:"40",rx:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M8 24h48",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"currentColor"}),e.jsx("circle",{cx:"24",cy:"18",r:"2",fill:"currentColor"}),e.jsx("circle",{cx:"32",cy:"18",r:"2",fill:"currentColor"}),e.jsx("rect",{x:"16",y:"32",width:"32",height:"4",rx:"2",fill:"currentColor",opacity:"0.3"}),e.jsx("rect",{x:"16",y:"40",width:"20",height:"4",rx:"2",fill:"currentColor",opacity:"0.3"})]})}pr.displayName="EmptyStateIcon";function Me({children:o,container:t,disabled:r=!1}){const[s,n]=i.useState(!1),[a,c]=i.useState(null);return i.useEffect(()=>{if(n(!0),typeof t=="string"){const l=document.querySelector(t);c(l)}else c(t||document.body);return()=>n(!1)},[t]),r?e.jsx(e.Fragment,{children:o}):!s||!a?null:ae.createPortal(o,a)}Me.displayName="Portal";const Ws=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function hr(o={}){const{enabled:t=!0,autoFocus:r=!0,restoreFocus:s=!0,initialFocus:n}=o,a=i.useRef(null),c=i.useRef(null),l=i.useCallback(()=>a.current?Array.from(a.current.querySelectorAll(Ws)):[],[]),u=i.useCallback(()=>{var p;(p=l()[0])==null||p.focus()},[l]),d=i.useCallback(()=>{var p;const y=l();(p=y[y.length-1])==null||p.focus()},[l]);return i.useEffect(()=>{if(t){if(c.current=document.activeElement,r){const y=a.current;if(!y)return;if(n){const p=typeof n=="string"?y.querySelector(n):n;p?p.focus():u()}else u()}return()=>{s&&c.current&&c.current.focus()}}},[t,r,s,n,u]),i.useEffect(()=>{if(!t)return;const y=p=>{if(p.key!=="Tab"||!a.current)return;const b=l();if(b.length===0)return;const g=b[0],k=b[b.length-1];p.shiftKey?document.activeElement===g&&(p.preventDefault(),k.focus()):document.activeElement===k&&(p.preventDefault(),g.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[t,l]),{ref:a,focusFirst:u,focusLast:d}}const kr=i.forwardRef(function({children:t,enabled:r=!0,autoFocus:s=!0,restoreFocus:n=!0,initialFocus:a,className:c,style:l},u){const{ref:d}=hr({enabled:r,autoFocus:s,restoreFocus:n,initialFocus:a});return e.jsx("div",{ref:y=>{d.current=y,typeof u=="function"?u(y):u&&(u.current=y)},className:c,style:l,children:t})});kr.displayName="FocusTrap";const vr=i.forwardRef(function({isOpen:t,onClose:r,closeOnClick:s=!0,blur:n=!0,blurAmount:a=4,opacity:c=.5,usePortal:l=!0,zIndex:u,className:d,style:y,testId:p,children:h,...b},g){if(!t)return null;const k=w=>{s&&w.target===w.currentTarget&&(r==null||r())},m={position:"fixed",inset:0,zIndex:u??"var(--brycks-z-overlay)",backgroundColor:`rgba(0, 0, 0, ${c})`,backdropFilter:n?`blur(${a}px)`:void 0,WebkitBackdropFilter:n?`blur(${a}px)`:void 0,animation:"brycks-overlay-fade-in 200ms ease-out",...y},x=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
144
144
|
@keyframes brycks-overlay-fade-in {
|
|
145
145
|
from { opacity: 0; }
|
|
146
146
|
to { opacity: 1; }
|
|
147
147
|
}
|
|
148
|
-
`}),e.jsx("div",{ref:
|
|
148
|
+
`}),e.jsx("div",{ref:g,className:z("brycks-overlay",d),style:m,onClick:k,"aria-hidden":"true","data-testid":p,...b,children:h})]});return l?e.jsx(Me,{children:x}):x});vr.displayName="Overlay";const xr={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},Ds={...xr},Ie=i.forwardRef(function({children:t,focusable:r=!1,className:s,style:n,testId:a,...c},l){return e.jsx("span",{ref:l,className:z("brycks-sr-only",r&&"brycks-sr-only--focusable",s),style:{...r?Ds:xr,...n},tabIndex:r?0:void 0,"data-testid":a,...c,children:t})});Ie.displayName="ScreenReaderOnly";const Sr=Ie;Sr.displayName="SrOnly";function fe(o){const[t,r]=i.useState(()=>typeof window>"u"?!1:window.matchMedia(o).matches);return i.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(o),n=a=>r(a.matches);return r(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[o]),t}function Fs(){return fe("(max-width: 639px)")}function Es(){return fe("(min-width: 640px) and (max-width: 1023px)")}function Bs(){return fe("(min-width: 1024px)")}function As(){return fe("(prefers-reduced-motion: reduce)")}function Ps(){return fe("(prefers-color-scheme: dark)")}function Os(o={}){const{defaultIsOpen:t=!1,onOpen:r,onClose:s}=o,[n,a]=i.useState(t),c=i.useCallback(()=>{a(!0),r==null||r()},[r]),l=i.useCallback(()=>{a(!1),s==null||s()},[s]),u=i.useCallback(()=>{const d=!n;a(d),d?r==null||r():s==null||s()},[n,r,s]);return{isOpen:n,onOpen:c,onClose:l,onToggle:u,setIsOpen:a}}function Vs(o){const{itemCount:t,initialIndex:r=0,loop:s=!0,orientation:n="vertical",onIndexChange:a,onSelect:c}=o,[l,u]=i.useState(r),d=i.useCallback(b=>{u(b),a==null||a(b)},[a]),y=i.useCallback(b=>{let g;switch(b){case"first":g=0;break;case"last":g=t-1;break;case"next":l>=t-1?g=s?0:l:g=l+1;break;case"prev":l<=0?g=s?t-1:l:g=l-1;break}d(g)},[l,t,s,d]),p=i.useCallback(b=>{const{key:g}=b,k=n==="vertical"||n==="both",m=n==="horizontal"||n==="both";switch(g){case"ArrowDown":k&&(b.preventDefault(),y("next"));break;case"ArrowUp":k&&(b.preventDefault(),y("prev"));break;case"ArrowRight":m&&(b.preventDefault(),y("next"));break;case"ArrowLeft":m&&(b.preventDefault(),y("prev"));break;case"Home":b.preventDefault(),y("first");break;case"End":b.preventDefault(),y("last");break;case"Enter":case" ":b.preventDefault(),c==null||c(l);break}},[n,y,c,l]),h=i.useCallback(b=>({tabIndex:b===l?0:-1,"data-focused":b===l,onFocus:()=>d(b)}),[l,d]);return{focusedIndex:l,setFocusedIndex:d,handleKeyDown:p,getItemProps:h}}function Xs(o){const{value:t,defaultValue:r,onChange:s}=o,n=t!==void 0,a=i.useRef(n);i.useEffect(()=>{a.current!==n&&console.warn("Component is switching between controlled and uncontrolled modes. This is not recommended and may cause unexpected behavior."),a.current=n},[n]);const[c,l]=i.useState(r),u=n?t:c,d=i.useCallback(y=>{const p=typeof y=="function"?y(u):y;n||l(p),s==null||s(p)},[n,s,u]);return{value:u,setValue:d,isControlled:n}}exports.accent=se.accent;exports.colors=se.colors;exports.error=se.error;exports.info=se.info;exports.neutrals=se.neutrals;exports.primary=se.primary;exports.success=se.success;exports.warning=se.warning;exports.animations=f.animations;exports.borderStyles=f.borderStyles;exports.borderWidths=f.borderWidths;exports.breakpoints=f.breakpoints;exports.containers=f.containers;exports.durations=f.durations;exports.easings=f.easings;exports.focusRings=f.focusRings;exports.fontFamilies=f.fontFamilies;exports.fontSizes=f.fontSizes;exports.fontWeights=f.fontWeights;exports.glows=f.glows;exports.letterSpacings=f.letterSpacings;exports.lineHeights=f.lineHeights;exports.mediaQueries=f.mediaQueries;exports.radii=f.radii;exports.semanticSpacing=f.semanticSpacing;exports.shadows=f.shadows;exports.spacing=f.spacing;exports.textStyles=f.textStyles;exports.transitions=f.transitions;exports.zIndex=f.zIndex;exports.ThemeProvider=ue.ThemeProvider;exports.cssVar=ue.cssVar;exports.darkTheme=ue.darkTheme;exports.lightTheme=ue.lightTheme;exports.useTheme=ue.useTheme;exports.useThemeColors=ue.useThemeColors;exports.Accordion=Rt;exports.AccordionContent=Wt;exports.AccordionItem=$t;exports.AccordionTrigger=Ht;exports.Alert=gt;exports.Badge=yr;exports.Box=Ne;exports.Breadcrumb=Kt;exports.BreadcrumbItem=Ut;exports.Button=he;exports.Card=Ee;exports.CardBody=Ae;exports.CardFooter=Pe;exports.CardHeader=Be;exports.Checkbox=tt;exports.Code=xo;exports.Container=Fe;exports.DateInput=it;exports.Display=Ke;exports.Divider=gr;exports.Drawer=ht;exports.Dropdown=Ft;exports.DropdownDivider=Bt;exports.DropdownItem=Et;exports.DropdownLabel=At;exports.EmptyState=mr;exports.EmptyStateIcon=pr;exports.FieldError=ut;exports.FileInput=lt;exports.Flex=Ge;exports.FlexItem=Ye;exports.FocusTrap=kr;exports.Form=ft;exports.FormField=dt;exports.FormGroup=yt;exports.FormLabel=ve;exports.Grid=We;exports.GridItem=De;exports.HStack=$e;exports.Heading=pe;exports.Icon=Ze;exports.IconButton=Qe;exports.InfoItem=ur;exports.InfoList=fr;exports.Input=ke;exports.List=ir;exports.ListDivider=cr;exports.ListHeader=dr;exports.ListItem=lr;exports.Loader=Ce;exports.Menu=Vt;exports.MenuDivider=Yt;exports.MenuGroup=Gt;exports.MenuItem=Xt;exports.Modal=bt;exports.Overlay=vr;exports.Pagination=_t;exports.Popover=vt;exports.Portal=Me;exports.Progress=xt;exports.Radio=st;exports.RadioGroup=nt;exports.ScreenReaderOnly=Ie;exports.Section=Oe;exports.Select=et;exports.Skeleton=ze;exports.SkeletonText=br;exports.Slider=at;exports.Spacer=Ve;exports.Spinner=Hs;exports.SrOnly=Sr;exports.Stack=me;exports.Switch=rt;exports.Tab=Ct;exports.TabList=jt;exports.TabPanel=Mt;exports.TabPanels=zt;exports.Table=Zt;exports.TableBody=er;exports.TableCaption=nr;exports.TableCell=or;exports.TableFoot=sr;exports.TableHead=Jt;exports.TableHeader=rr;exports.TableRow=tr;exports.Tabs=wt;exports.Text=qe;exports.TextField=Je;exports.Textarea=ot;exports.Toast=xe;exports.ToastProvider=is;exports.Tooltip=mt;exports.VStack=He;exports.avatarSizes=Wr;exports.buildSpacingStyles=be;exports.componentFontSize=O;exports.componentFontWeight=q;exports.componentGap=Q;exports.componentHeights=J;exports.componentLineHeight=V;exports.componentPaddingX=ee;exports.componentPaddingY=wr;exports.componentTypography=Nr;exports.contentPadding=Er;exports.controlSizes=Re;exports.cx=z;exports.duration=Tr;exports.easing=Rr;exports.focusRing=te;exports.focusRingOffset=zr;exports.focusStyles=Mr;exports.generateId=Xr;exports.getSpacingValue=Or;exports.headerSizes=Hr;exports.hexToRgba=Gr;exports.iconButtonSizes=Dr;exports.iconPaths=No;exports.iconSizes=de;exports.keyframes=Lr;exports.modalWidths=jr;exports.opacity=Z;exports.pageHeaderSpacing=Br;exports.popoverSizing=Cr;exports.quickActionSizes=Fr;exports.scale=re;exports.searchInputSizes=Ar;exports.sidebarSizes=$r;exports.spacingToCss=P;exports.statCardSizes=Pr;exports.stateOpacity=ye;exports.switchSizes=Le;exports.transition=oe;exports.transitionProperties=Ir;exports.useClickOutside=kt;exports.useControllable=Xs;exports.useDisclosure=Os;exports.useFocusTrap=hr;exports.useId=ct;exports.useIds=Go;exports.useIsDesktop=Bs;exports.useIsMobile=Fs;exports.useIsTablet=Es;exports.useKeyboardNavigation=Vs;exports.useMediaQuery=fe;exports.usePrefersDarkMode=Ps;exports.usePrefersReducedMotion=As;exports.useToast=ss;
|
|
149
149
|
//# sourceMappingURL=index.cjs.map
|