@brycks/core-front 0.1.1 → 0.2.1
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/List/List.d.ts +44 -0
- package/dist/components/data/List/List.d.ts.map +1 -0
- package/dist/components/data/List/index.d.ts +3 -0
- package/dist/components/data/List/index.d.ts.map +1 -0
- package/dist/components/data/Table/Table.d.ts +74 -0
- package/dist/components/data/Table/Table.d.ts.map +1 -0
- package/dist/components/data/Table/index.d.ts +3 -0
- package/dist/components/data/Table/index.d.ts.map +1 -0
- package/dist/components/data/index.d.ts +6 -0
- package/dist/components/data/index.d.ts.map +1 -0
- package/dist/components/feedback/Alert/Alert.d.ts +2 -2
- package/dist/components/feedback/Alert/Alert.d.ts.map +1 -1
- package/dist/components/feedback/Drawer/Drawer.d.ts +29 -0
- package/dist/components/feedback/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/feedback/Drawer/index.d.ts +3 -0
- package/dist/components/feedback/Drawer/index.d.ts.map +1 -0
- package/dist/components/feedback/Popover/Popover.d.ts +35 -0
- package/dist/components/feedback/Popover/Popover.d.ts.map +1 -0
- package/dist/components/feedback/Popover/index.d.ts +3 -0
- package/dist/components/feedback/Popover/index.d.ts.map +1 -0
- package/dist/components/feedback/Progress/Progress.d.ts +30 -0
- package/dist/components/feedback/Progress/Progress.d.ts.map +1 -0
- package/dist/components/feedback/Progress/index.d.ts +3 -0
- package/dist/components/feedback/Progress/index.d.ts.map +1 -0
- package/dist/components/feedback/Toast/Toast.d.ts +47 -0
- package/dist/components/feedback/Toast/Toast.d.ts.map +1 -0
- package/dist/components/feedback/Toast/index.d.ts +3 -0
- package/dist/components/feedback/Toast/index.d.ts.map +1 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.d.ts.map +1 -1
- package/dist/components/form/DateInput/DateInput.d.ts +28 -0
- package/dist/components/form/DateInput/DateInput.d.ts.map +1 -0
- package/dist/components/form/DateInput/index.d.ts +3 -0
- package/dist/components/form/DateInput/index.d.ts.map +1 -0
- package/dist/components/form/FieldError/FieldError.d.ts +18 -0
- package/dist/components/form/FieldError/FieldError.d.ts.map +1 -0
- package/dist/components/form/FieldError/index.d.ts +3 -0
- package/dist/components/form/FieldError/index.d.ts.map +1 -0
- package/dist/components/form/FileInput/FileInput.d.ts +33 -0
- package/dist/components/form/FileInput/FileInput.d.ts.map +1 -0
- package/dist/components/form/FileInput/index.d.ts +3 -0
- package/dist/components/form/FileInput/index.d.ts.map +1 -0
- package/dist/components/form/FormField/FormField.d.ts +36 -0
- package/dist/components/form/FormField/FormField.d.ts.map +1 -0
- package/dist/components/form/FormField/index.d.ts +3 -0
- package/dist/components/form/FormField/index.d.ts.map +1 -0
- package/dist/components/form/Radio/Radio.d.ts +46 -0
- package/dist/components/form/Radio/Radio.d.ts.map +1 -0
- package/dist/components/form/Radio/index.d.ts +3 -0
- package/dist/components/form/Radio/index.d.ts.map +1 -0
- package/dist/components/form/Slider/Slider.d.ts +32 -0
- package/dist/components/form/Slider/Slider.d.ts.map +1 -0
- package/dist/components/form/Slider/index.d.ts +3 -0
- package/dist/components/form/Slider/index.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +6 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/layout/Box/Box.d.ts +2 -2
- package/dist/components/layout/Box/Box.d.ts.map +1 -1
- package/dist/components/layout/Card/Card.d.ts +40 -0
- package/dist/components/layout/Card/Card.d.ts.map +1 -0
- package/dist/components/layout/Card/index.d.ts +3 -0
- package/dist/components/layout/Card/index.d.ts.map +1 -0
- package/dist/components/layout/Container/Container.d.ts +2 -2
- package/dist/components/layout/Container/Container.d.ts.map +1 -1
- package/dist/components/layout/Flex/Flex.d.ts +63 -0
- package/dist/components/layout/Flex/Flex.d.ts.map +1 -0
- package/dist/components/layout/Flex/index.d.ts +3 -0
- package/dist/components/layout/Flex/index.d.ts.map +1 -0
- package/dist/components/layout/Grid/Grid.d.ts +3 -3
- package/dist/components/layout/Grid/Grid.d.ts.map +1 -1
- package/dist/components/layout/Section/Section.d.ts +22 -0
- package/dist/components/layout/Section/Section.d.ts.map +1 -0
- package/dist/components/layout/Section/index.d.ts +3 -0
- package/dist/components/layout/Section/index.d.ts.map +1 -0
- package/dist/components/layout/Spacer/Spacer.d.ts +18 -0
- package/dist/components/layout/Spacer/Spacer.d.ts.map +1 -0
- package/dist/components/layout/Spacer/index.d.ts +3 -0
- package/dist/components/layout/Spacer/index.d.ts.map +1 -0
- package/dist/components/layout/Stack/Stack.d.ts +2 -2
- package/dist/components/layout/Stack/Stack.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/navigation/Accordion/Accordion.d.ts +41 -0
- package/dist/components/navigation/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/navigation/Accordion/index.d.ts +3 -0
- package/dist/components/navigation/Accordion/index.d.ts.map +1 -0
- package/dist/components/navigation/Breadcrumb/Breadcrumb.d.ts +31 -0
- package/dist/components/navigation/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/navigation/Breadcrumb/index.d.ts +3 -0
- package/dist/components/navigation/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +47 -0
- package/dist/components/navigation/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/navigation/Dropdown/index.d.ts +3 -0
- package/dist/components/navigation/Dropdown/index.d.ts.map +1 -0
- package/dist/components/navigation/Menu/Menu.d.ts +45 -0
- package/dist/components/navigation/Menu/Menu.d.ts.map +1 -0
- package/dist/components/navigation/Menu/index.d.ts +3 -0
- package/dist/components/navigation/Menu/index.d.ts.map +1 -0
- package/dist/components/navigation/Pagination/Pagination.d.ts +29 -0
- package/dist/components/navigation/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/navigation/Pagination/index.d.ts +3 -0
- package/dist/components/navigation/Pagination/index.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts +52 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/index.d.ts +3 -0
- package/dist/components/navigation/Tabs/index.d.ts.map +1 -0
- package/dist/components/navigation/index.d.ts +10 -0
- package/dist/components/navigation/index.d.ts.map +1 -0
- package/dist/components/primitives/Button/Button.d.ts +2 -2
- package/dist/components/primitives/Button/Button.d.ts.map +1 -1
- package/dist/components/primitives/Icon/Icon.d.ts +88 -0
- package/dist/components/primitives/Icon/Icon.d.ts.map +1 -0
- package/dist/components/primitives/Icon/index.d.ts +3 -0
- package/dist/components/primitives/Icon/index.d.ts.map +1 -0
- package/dist/components/primitives/index.d.ts +1 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/typography/Heading/Heading.d.ts +2 -2
- package/dist/components/typography/Heading/Heading.d.ts.map +1 -1
- package/dist/components/typography/Text/Text.d.ts +2 -2
- package/dist/components/typography/Text/Text.d.ts.map +1 -1
- package/dist/components/utility/FocusTrap/FocusTrap.d.ts +19 -0
- package/dist/components/utility/FocusTrap/FocusTrap.d.ts.map +1 -0
- package/dist/components/utility/FocusTrap/index.d.ts +3 -0
- package/dist/components/utility/FocusTrap/index.d.ts.map +1 -0
- package/dist/components/utility/Overlay/Overlay.d.ts +25 -0
- package/dist/components/utility/Overlay/Overlay.d.ts.map +1 -0
- package/dist/components/utility/Overlay/index.d.ts +3 -0
- package/dist/components/utility/Overlay/index.d.ts.map +1 -0
- package/dist/components/utility/Portal/Portal.d.ts +14 -0
- package/dist/components/utility/Portal/Portal.d.ts.map +1 -0
- package/dist/components/utility/Portal/index.d.ts +3 -0
- package/dist/components/utility/Portal/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/design-system/primitives/index.d.ts +1 -0
- package/dist/design-system/primitives/index.d.ts.map +1 -1
- package/dist/design-system/primitives/layout.d.ts +114 -0
- package/dist/design-system/primitives/layout.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useClickOutside.d.ts +9 -0
- package/dist/hooks/useClickOutside.d.ts.map +1 -0
- package/dist/hooks/useControllable.d.ts +24 -0
- package/dist/hooks/useControllable.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.d.ts +21 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useId.d.ts +9 -0
- package/dist/hooks/useId.d.ts.map +1 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +35 -0
- package/dist/hooks/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/index.cjs +67 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +63 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5399 -1634
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./colors-Bp6ROxvx.cjs"),g=require("./tokens.cjs"),ue=require("./cssVariables-BguyVeCi.cjs"),i=require("react"),e=require("react/jsx-runtime"),ae=require("react-dom"),J={xs:g.spacing[6],sm:g.spacing[8],md:g.spacing[10],lg:g.spacing[12],xl:g.spacing[14]},de={xs:g.spacing[3],sm:g.spacing[4],md:g.spacing[5],lg:g.spacing[6],xl:g.spacing[8]},ee={xs:g.spacing[2],sm:g.spacing[3],md:g.spacing[4],lg:g.spacing[5],xl:g.spacing[6]},mr={xs:g.spacing[1],sm:g.spacing[1.5],md:g.spacing[2],lg:g.spacing[2.5],xl:g.spacing[3]},Q={xs:g.spacing[1],sm:g.spacing[1.5],md:g.spacing[2],lg:g.spacing[2.5],xl:g.spacing[3]},pr={sm:400,md:500,lg:640,xl:800,full:"calc(100vw - 48px)"},hr={tooltipMaxWidth:300,popoverMaxWidth:400,arrowSize:g.spacing[2],offset:g.spacing[2]},Ie={sm:{box:16,icon:10},md:{box:18,icon:12},lg:{box:22,icon:14}},Re={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"},kr={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)"},vr={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 ${g.durations.faster}ms ${g.easings.easeOut}`,fast:`all ${g.durations.fast}ms ${g.easings.easeOut}`,quick:`all ${g.durations.quick}ms ${g.easings.easeOut}`,default:`all ${g.durations.normal}ms ${g.easings.easeOut}`,smooth:`all ${g.durations.relaxed}ms ${g.easings.smooth}`,slow:`all ${g.durations.slow}ms ${g.easings.easeOut}`,spring:`all ${g.durations.relaxed}ms ${g.easings.softSpring}`,colors:`color ${g.durations.fast}ms ${g.easings.easeOut}, background-color ${g.durations.fast}ms ${g.easings.easeOut}, border-color ${g.durations.fast}ms ${g.easings.easeOut}`,transform:`transform ${g.durations.normal}ms ${g.easings.easeOut}`,opacity:`opacity ${g.durations.normal}ms ${g.easings.easeOut}`,shadow:`box-shadow ${g.durations.normal}ms ${g.easings.easeOut}`},xr={all:"all",colors:"color, background-color, border-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform",dimensions:"width, height, padding, margin"},Sr={instant:g.durations.faster,fast:g.durations.fast,quick:g.durations.quick,default:g.durations.normal,smooth:g.durations.relaxed,slow:g.durations.slow,slower:g.durations.slower},wr={linear:g.easings.linear,ease:g.easings.ease,easeIn:g.easings.easeIn,easeOut:g.easings.easeOut,easeInOut:g.easings.easeInOut,spring:g.easings.spring,softSpring:g.easings.softSpring,smooth:g.easings.smooth,snappy:g.easings.snappy},jr={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
|
-
`},T={xs:s.fontSizes.xs,sm:s.fontSizes.sm,md:s.fontSizes.base,lg:15,xl:s.fontSizes.md},D={regular:s.fontWeights.regular,medium:s.fontWeights.medium,semibold:s.fontWeights.semibold,bold:s.fontWeights.bold},I={none:s.lineHeights.none,tight:s.lineHeights.snug,snug:1.4,normal:s.lineHeights.normal,relaxed:1.6},Qe={label:{fontFamily:s.fontFamilies.sans,fontSize:T.sm,fontWeight:D.medium,lineHeight:I.normal},helperText:{fontFamily:s.fontFamilies.sans,fontSize:T.xs,fontWeight:D.regular,lineHeight:I.relaxed},errorText:{fontFamily:s.fontFamilies.sans,fontSize:T.xs,fontWeight:D.regular,lineHeight:I.relaxed},buttonSm:{fontFamily:s.fontFamilies.sans,fontSize:T.sm,fontWeight:D.medium,lineHeight:I.none},buttonMd:{fontFamily:s.fontFamilies.sans,fontSize:T.md,fontWeight:D.medium,lineHeight:I.none},buttonLg:{fontFamily:s.fontFamilies.sans,fontSize:T.lg,fontWeight:D.medium,lineHeight:I.none},badge:{fontFamily:s.fontFamilies.sans,fontSize:T.xs,fontWeight:D.medium,lineHeight:I.none},tooltip:{fontFamily:s.fontFamilies.sans,fontSize:T.xs,fontWeight:D.medium,lineHeight:I.snug},alertTitle:{fontFamily:s.fontFamilies.sans,fontSize:T.md,fontWeight:D.semibold,lineHeight:I.tight},alertDescription:{fontFamily:s.fontFamilies.sans,fontSize:T.md,fontWeight:D.regular,lineHeight:I.normal},modalTitle:{fontFamily:s.fontFamilies.sans,fontSize:s.fontSizes.lg,fontWeight:D.semibold,lineHeight:I.tight},modalDescription:{fontFamily:s.fontFamilies.sans,fontSize:T.md,fontWeight:D.regular,lineHeight:I.normal},emptyStateTitle:{fontFamily:s.fontFamilies.sans,fontSize:s.fontSizes.lg,fontWeight:D.semibold,lineHeight:I.tight},emptyStateDescription:{fontFamily:s.fontFamilies.sans,fontSize:T.md,fontWeight:D.regular,lineHeight:I.normal},dividerLabel:{fontFamily:s.fontFamilies.sans,fontSize:T.xs,fontWeight:D.medium,lineHeight:I.normal}},E={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},ee={disabled:E[50],placeholder:E[50],hoverOverlay:E[5],activeOverlay:E[10],backdrop:E[40],loading:E[70],muted:E[60],subtle:E[30]},A={pressed:.98,pressedStrong:.95,controlPressed:.92,hidden:.95,normal:1,hover:1.02,emphasized:1.05};function R(...e){return e.filter(Boolean).join(" ")}function Ue(e){return s.spacing[e]}function $(e){if(e===void 0)return;const o=s.spacing[e];return o===0?"0":`${o}px`}function te(e){const o={};return e.m!==void 0&&(o.margin=$(e.m)),e.mx!==void 0&&(o.marginLeft=$(e.mx),o.marginRight=$(e.mx)),e.my!==void 0&&(o.marginTop=$(e.my),o.marginBottom=$(e.my)),e.mt!==void 0&&(o.marginTop=$(e.mt)),e.mr!==void 0&&(o.marginRight=$(e.mr)),e.mb!==void 0&&(o.marginBottom=$(e.mb)),e.ml!==void 0&&(o.marginLeft=$(e.ml)),e.p!==void 0&&(o.padding=$(e.p)),e.px!==void 0&&(o.paddingLeft=$(e.px),o.paddingRight=$(e.px)),e.py!==void 0&&(o.paddingTop=$(e.py),o.paddingBottom=$(e.py)),e.pt!==void 0&&(o.paddingTop=$(e.pt)),e.pr!==void 0&&(o.paddingRight=$(e.pr)),e.pb!==void 0&&(o.paddingBottom=$(e.pb)),e.pl!==void 0&&(o.paddingLeft=$(e.pl)),o}let Ze=0;function Je(e="brycks"){return`${e}-${++Ze}`}function et(e,o){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return e;const n=parseInt(t[1],16),a=parseInt(t[2],16),i=parseInt(t[3],16);return`rgba(${n}, ${a}, ${i}, ${o})`}const tt={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)"},rt={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 ot(e){const t={...te(e)};return e.display&&(t.display=e.display),e.position&&(t.position=e.position),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.minWidth&&(t.minWidth=e.minWidth),e.maxWidth&&(t.maxWidth=e.maxWidth),e.minHeight&&(t.minHeight=e.minHeight),e.maxHeight&&(t.maxHeight=e.maxHeight),e.overflow&&(t.overflow=e.overflow),e.bg&&(t.backgroundColor=e.bg),e.radius&&(t.borderRadius=tt[e.radius]),e.shadow&&(t.boxShadow=rt[e.shadow]),t}const st=["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 nt(e){const o={...e};for(const t of st)delete o[t];return o}const at=({as:e,className:o,style:t,children:n,testId:a,...i},b)=>{const d=e||"div",l=ot(i),c=nt(i);return r.jsx(d,{ref:b,className:R("brycks-box",o),style:{...l,...t},"data-testid":a,...c,children:n})},be=f.forwardRef(at);be.displayName="Box";const it=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","direction","gap","gapX","gapY","align","justify","wrap","inline","testId"];function ct(e){const o={...e};for(const t of it)delete o[t];return o}function lt(e){const t={...te(e),display:e.inline?"inline-flex":"flex",flexDirection:e.direction??"column"};return e.gap!==void 0?t.gap=$(e.gap):(e.gapX!==void 0&&(t.columnGap=$(e.gapX)),e.gapY!==void 0&&(t.rowGap=$(e.gapY))),e.align&&(t.alignItems=e.align),e.justify&&(t.justifyContent=e.justify),e.wrap&&(t.flexWrap=e.wrap),t}const dt=({as:e,className:o,style:t,children:n,testId:a,...i},b)=>{const d=e||"div",l=lt(i),c=ct(i);return r.jsx(d,{ref:b,className:R("brycks-stack",o),style:{...l,...t},"data-testid":a,...c,children:n})},re=f.forwardRef(dt);re.displayName="Stack";const ut=(e,o)=>r.jsx(re,{ref:o,direction:"row",align:"center",...e}),me=f.forwardRef(ut);me.displayName="HStack";const ft=(e,o)=>r.jsx(re,{ref:o,direction:"column",...e}),he=f.forwardRef(ft);he.displayName="VStack";const yt=["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 gt(e){const o={...e};for(const t of yt)delete o[t];return o}function bt(e){const t={...te(e),display:e.inline?"inline-grid":"grid"};return e.columns!==void 0&&(t.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows!==void 0&&(t.gridTemplateRows=typeof e.rows=="number"?`repeat(${e.rows}, 1fr)`:e.rows),e.templateColumns&&(t.gridTemplateColumns=e.templateColumns),e.templateRows&&(t.gridTemplateRows=e.templateRows),e.gap!==void 0?t.gap=$(e.gap):(e.gapX!==void 0&&(t.columnGap=$(e.gapX)),e.gapY!==void 0&&(t.rowGap=$(e.gapY))),e.align&&(t.alignItems=e.align),e.justify&&(t.justifyItems=e.justify),e.flow&&(t.gridAutoFlow=e.flow),t}const mt=({as:e,className:o,style:t,children:n,testId:a,...i},b)=>{const d=e||"div",l=bt(i),c=gt(i);return r.jsx(d,{ref:b,className:R("brycks-grid",o),style:{...l,...t},"data-testid":a,...c,children:n})},ke=f.forwardRef(mt);ke.displayName="Grid";const ht=({as:e,className:o,style:t,children:n,testId:a,colSpan:i,rowSpan:b,colStart:d,colEnd:l,rowStart:c,rowEnd:m,...p},h)=>{const y=e||"div",g={};return i!==void 0&&(g.gridColumn=i==="full"?"1 / -1":`span ${i}`),b!==void 0&&(g.gridRow=`span ${b}`),d!==void 0&&(g.gridColumnStart=d),l!==void 0&&(g.gridColumnEnd=l),c!==void 0&&(g.gridRowStart=c),m!==void 0&&(g.gridRowEnd=m),r.jsx(y,{ref:h,className:R("brycks-grid-item",o),style:{...g,...t},"data-testid":a,...p,children:n})},pe=f.forwardRef(ht);pe.displayName="GridItem";const kt=["m","mx","my","mt","mr","mb","ml","p","px","py","pt","pr","pb","pl","size","centered","padded","testId"];function pt(e){const o={...e};for(const t of kt)delete o[t];return o}function xt(e){const o=te(e),t=e.size??"xl",n=s.containers[t],a={...o,width:"100%",maxWidth:typeof n=="number"?`${n}px`:n};return e.centered!==!1&&(a.marginLeft="auto",a.marginRight="auto"),e.padded!==!1&&(a.paddingLeft="var(--brycks-space-4)",a.paddingRight="var(--brycks-space-4)"),a}const vt=({as:e,className:o,style:t,children:n,testId:a,...i},b)=>{const d=e||"div",l=xt(i),c=pt(i);return r.jsx(d,{ref:b,className:R("brycks-container",o),style:{...l,...t},"data-testid":a,...c,children:n})},xe=f.forwardRef(vt);xe.displayName="Container";const ve={body:{element:"p",styles:s.textStyles.bodyDefault},bodyLarge:{element:"p",styles:s.textStyles.bodyLarge},bodySmall:{element:"p",styles:s.textStyles.bodySmall},label:{element:"span",styles:s.textStyles.label},caption:{element:"span",styles:s.textStyles.caption},overline:{element:"span",styles:s.textStyles.overline},code:{element:"code",styles:s.textStyles.code}};function wt(e){const o=e.variant??"body",t=ve[o].styles,n={fontFamily:t.fontFamily,fontSize:e.size?s.fontSizes[e.size]:t.fontSize,fontWeight:e.weight?s.fontWeights[e.weight]:t.fontWeight,lineHeight:e.leading?s.lineHeights[e.leading]:t.lineHeight,letterSpacing:t.letterSpacing};return"textTransform"in t&&(n.textTransform=t.textTransform),e.align&&(n.textAlign=e.align),e.color&&(n.color=e.color),e.truncate&&(n.overflow="hidden",n.textOverflow="ellipsis",n.whiteSpace="nowrap"),e.lineClamp&&(n.display="-webkit-box",n.WebkitLineClamp=e.lineClamp,n.WebkitBoxOrient="vertical",n.overflow="hidden"),n}const St=({as:e,variant:o="body",className:t,style:n,children:a,testId:i,...b},d)=>{const l=e||ve[o].element,c=wt({variant:o,...b}),{size:m,weight:p,leading:h,align:y,color:g,truncate:k,lineClamp:u,...x}=b;return r.jsx(l,{ref:d,className:R("brycks-text",`brycks-text--${o}`,t),style:{...c,...n},"data-testid":i,...x,children:a})},ne=f.forwardRef(St);ne.displayName="Text";const Ct=(e,o)=>r.jsx(ne,{...e,ref:o,variant:"code",style:{backgroundColor:"var(--brycks-background-muted)",padding:`${s.spacing[.5]}px ${s.spacing[1.5]}px`,borderRadius:"var(--brycks-radius-sm)",...e.style}}),we=f.forwardRef(Ct);we.displayName="Code";const jt={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6",display:"displayMedium",displayLarge:"displayLarge",displaySmall:"displaySmall"};function zt(e){const o=e.level??2,t=e.size??o,n=jt[t],a=s.textStyles[n],i={fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:e.weight?s.fontWeights[e.weight]:a.fontWeight,lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,margin:0};return e.align&&(i.textAlign=e.align),e.color&&(i.color=e.color),e.truncate&&(i.overflow="hidden",i.textOverflow="ellipsis",i.whiteSpace="nowrap"),i}const $t=({as:e,level:o=2,className:t,style:n,children:a,testId:i,...b},d)=>{const l=e||`h${o}`,c=zt({level:o,...b}),{size:m,weight:p,align:h,color:y,truncate:g,...k}=b;return r.jsx(l,{ref:d,className:R("brycks-heading",`brycks-heading--${o}`,t),style:{...c,...n},"data-testid":i,...k,children:a})},ae=f.forwardRef($t);ae.displayName="Heading";const Rt=({size:e="display",...o},t)=>r.jsx(ae,{ref:t,level:1,size:e,...o}),Se=f.forwardRef(Rt);Se.displayName="Display";const Ce={xs:{height:X.xs,paddingX:V.xs,fontSize:T.xs,iconSize:U.xs,gap:O.xs,radius:"var(--brycks-radius-md)"},sm:{height:X.sm,paddingX:V.sm,fontSize:T.sm,iconSize:U.sm,gap:O.sm,radius:"var(--brycks-radius-md)"},md:{height:X.md,paddingX:V.md,fontSize:T.md,iconSize:U.md,gap:O.md,radius:"var(--brycks-radius-default)"},lg:{height:X.lg,paddingX:V.lg,fontSize:T.lg,iconSize:U.lg,gap:O.md,radius:"var(--brycks-radius-lg)"},xl:{height:X.xl,paddingX:V.xl,fontSize:T.xl,iconSize:U.xl,gap:O.lg,radius:"var(--brycks-radius-xl)"}},Wt={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 Tt(e){const{variant:o,intent:t,size:n,fullWidth:a,isIconOnly:i}=e,b=Ce[n],d=Wt[t][o],l={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:b.gap,height:b.height,minWidth:i?b.height:void 0,width:a?"100%":void 0,padding:i?0:`0 ${b.paddingX}px`,fontSize:b.fontSize,fontWeight:D.medium,fontFamily:"var(--brycks-font-sans)",lineHeight:I.none,borderRadius:b.radius,border:"none",outline:"none",cursor:"pointer",userSelect:"none",textDecoration:"none",transition:K.quick,WebkitTapHighlightColor:"transparent"};switch(o){case"solid":{const y=d;Object.assign(l,{backgroundColor:y.bg,color:y.text,boxShadow:"var(--brycks-shadow-xs)"});break}case"outline":{const y=d;Object.assign(l,{backgroundColor:"transparent",color:y.text,border:`1px solid ${y.border}`});break}case"ghost":{Object.assign(l,{backgroundColor:"transparent",color:d.text});break}case"soft":{const y=d;Object.assign(l,{backgroundColor:y.bg,color:y.text});break}case"link":{Object.assign(l,{backgroundColor:"transparent",color:d.text,height:"auto",padding:0,borderRadius:0});break}}const c={};switch(o){case"solid":{const y=d;c.backgroundColor=y.hoverBg,c.boxShadow="var(--brycks-shadow-sm)";break}case"outline":{const y=d;c.backgroundColor=y.hoverBg;break}case"ghost":{const y=d;c.backgroundColor=y.hoverBg;break}case"soft":{const y=d;c.backgroundColor=y.hoverBg;break}case"link":{const y=d;c.color=y.hoverText,c.textDecoration="underline";break}}const m={transform:o!=="link"?`scale(${A.pressed})`:void 0};if(o==="solid"){const y=d;m.backgroundColor=y.activeBg,m.boxShadow="var(--brycks-shadow-xs)"}const p={opacity:ee.disabled,cursor:"not-allowed",pointerEvents:"none"};return{base:l,hover:c,active:m,disabled:p,loading:{cursor:"wait",pointerEvents:"none"}}}function Bt({size:e}){return r.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:{animation:"brycks-spin 1s linear infinite"},children:[r.jsx("style",{children:`
|
|
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:`
|
|
52
52
|
@keyframes brycks-spin {
|
|
53
53
|
from { transform: rotate(0deg); }
|
|
54
54
|
to { transform: rotate(360deg); }
|
|
55
55
|
}
|
|
56
|
-
`}),r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.4 31.4",opacity:"0.25"}),r.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 Ht=({as:e,variant:o="solid",intent:t="primary",size:n="md",fullWidth:a,isLoading:i,isDisabled:b,leftIcon:d,rightIcon:l,isIconOnly:c,className:m,style:p,children:h,testId:y,onMouseEnter:g,onMouseLeave:k,onMouseDown:u,onMouseUp:x,...W},B)=>{const z=e||"button",[N,w]=f.useState(!1),[S,C]=f.useState(!1),H=b||i,j=Tt({variant:o,intent:t,size:n,fullWidth:a,isIconOnly:c}),v={...j.base,...N&&!H?j.hover:{},...S&&!H?j.active:{},...H?j.disabled:{},...i?j.loading:{},...p},F=Ce[n],M=P=>{w(!0),g==null||g(P)},q=P=>{w(!1),C(!1),k==null||k(P)},Y=P=>{C(!0),u==null||u(P)},_=P=>{C(!1),x==null||x(P)},oe=R("brycks-button",`brycks-button--${o}`,`brycks-button--${t}`,`brycks-button--${n}`,a&&"brycks-button--full-width",c&&"brycks-button--icon-only",i&&"brycks-button--loading",H&&"brycks-button--disabled",m),se=z==="button"||e===void 0?{type:W.type??"button",disabled:H}:{"aria-disabled":H||void 0,role:"button",tabIndex:H?-1:0};return r.jsxs(z,{ref:B,className:oe,style:v,"data-testid":y,onMouseEnter:M,onMouseLeave:q,onMouseDown:Y,onMouseUp:_,...se,...W,children:[i&&r.jsx("span",{style:{display:"inline-flex",position:c?"absolute":"relative"},children:r.jsx(Bt,{size:F.iconSize})}),!i&&d&&r.jsx("span",{style:{display:"inline-flex",width:F.iconSize,height:F.iconSize},children:d}),!c&&r.jsx("span",{style:{opacity:i&&!c?.5:1},children:h}),!i&&l&&r.jsx("span",{style:{display:"inline-flex",width:F.iconSize,height:F.iconSize},children:l}),c&&!i&&h]})},ie=f.forwardRef(Ht);ie.displayName="Button";const It=(e,o)=>r.jsx(ie,{ref:o,isIconOnly:!0,...e}),je=f.forwardRef(It);je.displayName="IconButton";const Nt={sm:{height:X.sm,fontSize:T.sm,paddingX:V.sm,radius:"var(--brycks-radius-md)"},md:{height:X.md,fontSize:T.md,paddingX:V.md,radius:"var(--brycks-radius-default)"},lg:{height:X.lg,fontSize:T.lg,paddingX:V.lg,radius:"var(--brycks-radius-lg)"}},ce=f.forwardRef(function({size:o="md",variant:t="outline",isInvalid:n,leftElement:a,rightElement:i,className:b,style:d,testId:l,disabled:c,onFocus:m,onBlur:p,...h},y){const[g,k]=f.useState(!1),u=Nt[o],x=()=>{const w={display:"flex",alignItems:"center",width:"100%",position:"relative",height:u.height,borderRadius:u.radius,transition:K.default};switch(t){case"outline":Object.assign(w,{backgroundColor:"var(--brycks-background-app)",border:`1px solid ${n?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,boxShadow:g?n?G.error:G.default:G.none});break;case"filled":Object.assign(w,{backgroundColor:"var(--brycks-background-muted)",border:"1px solid transparent",borderColor:n?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"transparent"});break;case"flushed":Object.assign(w,{backgroundColor:"transparent",borderRadius:0,borderBottom:`2px solid ${n?"var(--brycks-error-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`});break}return c&&Object.assign(w,{opacity:ee.disabled,cursor:"not-allowed"}),w},W={width:"100%",height:u.height,fontFamily:"var(--brycks-font-sans)",fontSize:u.fontSize,color:"var(--brycks-foreground-default)",backgroundColor:"transparent",border:"none",outline:"none",borderRadius:u.radius,paddingLeft:a?O.md:u.paddingX,paddingRight:i?O.md:u.paddingX,cursor:c?"not-allowed":"text",transition:K.default},B=w=>{k(!0),m==null||m(w)},z=w=>{k(!1),p==null||p(w)},N={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--brycks-foreground-muted)",flexShrink:0};return r.jsxs("div",{className:R("brycks-input-wrapper",`brycks-input-wrapper--${t}`,`brycks-input-wrapper--${o}`,n&&"brycks-input-wrapper--invalid",c&&"brycks-input-wrapper--disabled",b),style:{...x(),...d},children:[a&&r.jsx("span",{className:"brycks-input-left-element",style:{...N,paddingLeft:u.paddingX},children:a}),r.jsx("input",{ref:y,className:"brycks-input",style:W,disabled:c,"aria-invalid":n,"data-testid":l,onFocus:B,onBlur:z,...h}),i&&r.jsx("span",{className:"brycks-input-right-element",style:{...N,paddingRight:u.paddingX},children:i})]})});ce.displayName="Input";const ze=f.forwardRef(function({label:o,helperText:t,errorMessage:n,isRequired:a,hideLabel:i,isInvalid:b,id:d,className:l,testId:c,...m},p){const h=f.useId(),y=d??h,g=`${y}-helper`,k=`${y}-error`,u=!!n||b,x=[u&&k,t&&g].filter(Boolean).join(" "),W={display:"block",marginBottom:6,fontSize:13,fontWeight:500,color:"var(--brycks-foreground-default)",...i&&{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},B={display:"block",marginTop:6,fontSize:12,lineHeight:1.5,color:"var(--brycks-foreground-muted)"},z={...B,color:"var(--brycks-error-default)"};return r.jsxs("div",{className:R("brycks-text-field",u&&"brycks-text-field--error",l),"data-testid":c,children:[o&&r.jsxs("label",{htmlFor:y,style:W,children:[o,a&&r.jsx("span",{"aria-hidden":"true",style:{color:"var(--brycks-error-default)",marginLeft:2},children:"*"})]}),r.jsx(ce,{ref:p,id:y,isInvalid:u,"aria-describedby":x||void 0,"aria-required":a,...m}),u&&n&&r.jsx("span",{id:k,role:"alert",style:z,children:n}),!u&&t&&r.jsx("span",{id:g,style:B,children:t})]})});ze.displayName="TextField";const Ft={sm:{height:32,fontSize:13,padding:10},md:{height:40,fontSize:14,padding:12},lg:{height:48,fontSize:15,padding:14}};function Lt(){return r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:r.jsx("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const $e=f.forwardRef(function({size:o="md",variant:t="outline",isInvalid:n,placeholder:a,className:i,style:b,testId:d,disabled:l,children:c,onFocus:m,onBlur:p,value:h,...y},g){const[k,u]=f.useState(!1),x=Ft[o],W=h!==void 0&&h!=="",B={position:"relative",display:"inline-flex",width:"100%"},z=()=>{const C={width:"100%",height:x.height,paddingLeft:x.padding,paddingRight:x.padding+24,fontSize:x.fontSize,fontFamily:"var(--brycks-font-sans)",color:W||!a?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",backgroundColor:t==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${n?"var(--brycks-error-default)":k?"var(--brycks-border-focus)":t==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",cursor:l?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",transition:"all 200ms ease-out",boxShadow:k?n?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return l&&(C.opacity=.5),C},N={position:"absolute",right:x.padding,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"var(--brycks-foreground-muted)",transition:"transform 200ms ease-out"},w=C=>{u(!0),m==null||m(C)},S=C=>{u(!1),p==null||p(C)};return r.jsxs("div",{className:R("brycks-select-wrapper",`brycks-select-wrapper--${t}`,`brycks-select-wrapper--${o}`,n&&"brycks-select-wrapper--invalid",l&&"brycks-select-wrapper--disabled",i),style:{...B,...b},children:[r.jsxs("select",{ref:g,className:"brycks-select",style:z(),disabled:l,"aria-invalid":n,"data-testid":d,value:h,onFocus:w,onBlur:S,...y,children:[a&&r.jsx("option",{value:"",disabled:!0,children:a}),c]}),r.jsx("span",{style:N,children:r.jsx(Lt,{})})]})});$e.displayName="Select";function Mt({size:e}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",children:r.jsx("path",{d:"M2.5 6L5 8.5L9.5 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dt({size:e}){return r.jsx("svg",{width:e,height:e,viewBox:"0 0 12 12",fill:"none",children:r.jsx("path",{d:"M2.5 6H9.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Re=f.forwardRef(function({size:o="md",label:t,description:n,isInvalid:a,isIndeterminate:i,className:b,style:d,testId:l,disabled:c,checked:m,onChange:p,...h},y){const[g,k]=f.useState(!1),[u,x]=f.useState(!1),[W,B]=f.useState(!1),z=ye[o],N=T[o],w=m||i,S={display:"inline-flex",alignItems:"flex-start",gap:O.lg,cursor:c?"not-allowed":"pointer",opacity:c?ee.disabled:1},C={position:"relative",width:z.box,height:z.box,borderRadius:"var(--brycks-radius-sm)",border:`1.5px solid ${a?"var(--brycks-error-default)":w?"var(--brycks-primary-default)":g?"var(--brycks-border-focus)":"var(--brycks-border-default)"}`,backgroundColor:w?"var(--brycks-primary-default)":u?"var(--brycks-background-subtle)":"var(--brycks-background-app)",transition:K.quick,transform:W?`scale(${A.controlPressed})`:`scale(${A.normal})`,boxShadow:g?G.default:G.none,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},H={color:"var(--brycks-primary-foreground)",opacity:w?1:0,transform:w?`scale(${A.normal})`:`scale(${A.hidden})`,transition:K.quick},j={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:c?"not-allowed":"pointer",margin:0},v={display:"flex",flexDirection:"column",gap:O.xs,paddingTop:(z.box-N)/2},F={fontSize:N,lineHeight:I.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},M={fontSize:N-1,lineHeight:I.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return r.jsxs("label",{className:R("brycks-checkbox",`brycks-checkbox--${o}`,w&&"brycks-checkbox--checked",a&&"brycks-checkbox--invalid",c&&"brycks-checkbox--disabled",b),style:{...S,...d},"data-testid":l,onMouseEnter:()=>x(!0),onMouseLeave:()=>{x(!1),B(!1)},onMouseDown:()=>B(!0),onMouseUp:()=>B(!1),children:[r.jsxs("span",{style:C,children:[r.jsx("input",{ref:y,type:"checkbox",style:j,checked:m,disabled:c,"aria-invalid":a,onChange:p,onFocus:()=>k(!0),onBlur:()=>k(!1),...h}),r.jsx("span",{style:H,children:i?r.jsx(Dt,{size:z.icon}):r.jsx(Mt,{size:z.icon})})]}),(t||n)&&r.jsxs("span",{style:v,children:[t&&r.jsx("span",{style:F,children:t}),n&&r.jsx("span",{style:M,children:n})]})]})});Re.displayName="Checkbox";const We=f.forwardRef(function({size:o="md",label:t,description:n,className:a,style:i,testId:b,disabled:d,checked:l,onChange:c,...m},p){const[h,y]=f.useState(!1),[g,k]=f.useState(!1),u=ge[o],x=T[o],W=(u.height-u.thumb)/2,B=u.width-u.thumb-W*2,z={display:"inline-flex",alignItems:"flex-start",gap:O.xl,cursor:d?"not-allowed":"pointer",opacity:d?ee.disabled:1},N={position:"relative",width:u.width,height:u.height,borderRadius:u.height/2,backgroundColor:l?"var(--brycks-primary-default)":"var(--brycks-background-muted)",border:`1px solid ${l?"var(--brycks-primary-default)":"var(--brycks-border-default)"}`,transition:K.spring,boxShadow:h?G.default:"inset 0 1px 2px rgba(0,0,0,0.05)",flexShrink:0},w={position:"absolute",top:W,left:l?W+B:W,width:g?u.thumb+4:u.thumb,height:u.thumb,borderRadius:u.thumb/2,backgroundColor:"var(--brycks-background-elevated)",boxShadow:"var(--brycks-shadow-sm)",transition:K.spring,transform:g?`scale(${A.pressedStrong})`:`scale(${A.normal})`},S={position:"absolute",width:"100%",height:"100%",opacity:0,cursor:d?"not-allowed":"pointer",margin:0},C={display:"flex",flexDirection:"column",gap:O.xs,paddingTop:(u.height-x*I.snug)/2},H={fontSize:x,lineHeight:I.snug,color:"var(--brycks-foreground-default)",userSelect:"none"},j={fontSize:x-1,lineHeight:I.snug,color:"var(--brycks-foreground-muted)",userSelect:"none"};return r.jsxs("label",{className:R("brycks-switch",`brycks-switch--${o}`,l&&"brycks-switch--checked",d&&"brycks-switch--disabled",a),style:{...z,...i},"data-testid":b,onMouseDown:()=>k(!0),onMouseUp:()=>k(!1),onMouseLeave:()=>k(!1),children:[r.jsxs("span",{style:N,children:[r.jsx("input",{ref:p,type:"checkbox",role:"switch",style:S,checked:l,disabled:d,"aria-checked":l,onChange:c,onFocus:()=>y(!0),onBlur:()=>y(!1),...m}),r.jsx("span",{style:w})]}),(t||n)&&r.jsxs("span",{style:C,children:[t&&r.jsx("span",{style:H,children:t}),n&&r.jsx("span",{style:j,children:n})]})]})});We.displayName="Switch";const Ot={sm:{fontSize:13,padding:10,lineHeight:1.5},md:{fontSize:14,padding:12,lineHeight:1.5},lg:{fontSize:15,padding:14,lineHeight:1.5}},Te=f.forwardRef(function({size:o="md",variant:t="outline",isInvalid:n,autoResize:a,minRows:i=3,maxRows:b=10,showCount:d,maxLength:l,className:c,style:m,testId:p,disabled:h,value:y,defaultValue:g,onChange:k,onFocus:u,onBlur:x,...W},B){const[z,N]=f.useState(!1),[w,S]=f.useState(0),C=f.useRef(null),H=B||C,j=Ot[o],v=j.fontSize*j.lineHeight,F=v*i+j.padding*2,M=v*b+j.padding*2,q=f.useCallback(()=>{const L=H.current;if(!L||!a)return;L.style.height="auto";const Oe=L.scrollHeight,Pe=Math.min(Math.max(Oe,F),M);L.style.height=`${Pe}px`},[a,F,M,H]);f.useEffect(()=>{q()},[y,q]),f.useEffect(()=>{const L=String(y??g??"");S(L.length)},[y,g]);const Y=()=>{const L={width:"100%",minHeight:F,maxHeight:a?M:void 0,padding:j.padding,fontSize:j.fontSize,lineHeight:j.lineHeight,fontFamily:"var(--brycks-font-sans)",color:"var(--brycks-foreground-default)",backgroundColor:t==="filled"?"var(--brycks-background-muted)":"var(--brycks-background-app)",border:`1px solid ${n?"var(--brycks-error-default)":z?"var(--brycks-border-focus)":t==="filled"?"transparent":"var(--brycks-border-default)"}`,borderRadius:"var(--brycks-radius-default)",outline:"none",resize:a?"none":"vertical",transition:"all 200ms ease-out",boxShadow:z?n?"0 0 0 3px rgba(239, 68, 68, 0.15)":"0 0 0 3px rgba(85, 120, 244, 0.15)":"none"};return h&&(L.opacity=.5,L.cursor="not-allowed",L.resize="none"),L},_={position:"relative",width:"100%"},oe={position:"absolute",bottom:8,right:12,fontSize:11,color:w>=(l??1/0)?"var(--brycks-error-default)":"var(--brycks-foreground-muted)",pointerEvents:"none",transition:"color 150ms ease-out"},ue=L=>{S(L.target.value.length),k==null||k(L)},se=L=>{N(!0),u==null||u(L)},P=L=>{N(!1),x==null||x(L)};return r.jsxs("div",{className:R("brycks-textarea-wrapper",`brycks-textarea-wrapper--${t}`,`brycks-textarea-wrapper--${o}`,n&&"brycks-textarea-wrapper--invalid",h&&"brycks-textarea-wrapper--disabled",c),style:{..._,...m},children:[r.jsx("textarea",{ref:H,className:"brycks-textarea",style:Y(),disabled:h,"aria-invalid":n,"data-testid":p,value:y,defaultValue:g,maxLength:l,onChange:ue,onFocus:se,onBlur:P,...W}),d&&r.jsxs("span",{style:oe,children:[w,l?`/${l}`:""]})]})});Te.displayName="Textarea";const Pt={sm:"400px",md:"500px",lg:"640px",xl:"800px",full:"calc(100vw - 48px)"};function Et(){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:r.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Be=f.forwardRef(function({isOpen:o,onClose:t,size:n="md",title:a,description:i,closeOnOverlayClick:b=!0,closeOnEscape:d=!0,showCloseButton:l=!0,className:c,style:m,testId:p,children:h,...y},g){const k=f.useRef(null),u=f.useRef(null);f.useEffect(()=>{if(!o)return;u.current=document.activeElement;const v=k.current;v&&v.focus();const F=M=>{if(M.key==="Escape"&&d){t();return}if(M.key==="Tab"&&v){const q=v.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),Y=q[0],_=q[q.length-1];M.shiftKey&&document.activeElement===Y?(M.preventDefault(),_==null||_.focus()):!M.shiftKey&&document.activeElement===_&&(M.preventDefault(),Y==null||Y.focus())}};return document.addEventListener("keydown",F),document.body.style.overflow="hidden",()=>{var M;document.removeEventListener("keydown",F),document.body.style.overflow="",(M=u.current)==null||M.focus()}},[o,d,t]);const x=f.useCallback(v=>{v.target===v.currentTarget&&b&&t()},[b,t]);if(!o)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"},B={position:"relative",width:"100%",maxWidth:Pt[n],maxHeight:n==="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",...m},z={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid var(--brycks-border-muted)"},N={display:"flex",flexDirection:"column",gap:4},w={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",margin:0,lineHeight:1.3},S={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},H={flex:1,overflow:"auto",padding:24},j=r.jsxs(r.Fragment,{children:[r.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 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:`
|
|
57
57
|
@keyframes brycks-fade-in {
|
|
58
58
|
from { opacity: 0; }
|
|
59
59
|
to { opacity: 1; }
|
|
@@ -62,12 +62,67 @@
|
|
|
62
62
|
from { opacity: 0; transform: scale(0.95); }
|
|
63
63
|
to { opacity: 1; transform: scale(1); }
|
|
64
64
|
}
|
|
65
|
-
`}),
|
|
65
|
+
`}),e.jsx("div",{className:"brycks-modal-overlay",style:w,onClick:x,"aria-hidden":"true",children:e.jsxs("div",{ref:I=>{h.current=I,typeof b=="function"?b(I):b&&(b.current=I)},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,...y,children:[(n||u)&&e.jsxs("div",{className:"brycks-modal-header",style:C,children:[e.jsxs("div",{style:R,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:j,onClick:r,"aria-label":"Close modal",onMouseEnter:I=>{I.currentTarget.style.backgroundColor="var(--brycks-background-muted)",I.currentTarget.style.color="var(--brycks-foreground-default)"},onMouseLeave:I=>{I.currentTarget.style.backgroundColor="transparent",I.currentTarget.style.color="var(--brycks-foreground-muted)"},children:e.jsx(Ao,{})})]}),e.jsx("div",{className:"brycks-modal-content",style:T,children:k})]})})]});return ae.createPortal(L,document.body)});ut.displayName="Modal";const Po={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)"}}}},ft=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:f,testId:p,children:k,...y},b){const h=Po[t],m=h.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)",...f},w={flexShrink:0,color:m.color,marginTop:1},S={flex:1,minWidth:0},C={fontSize:14,fontWeight:600,marginBottom:k?4:0,color:m.color},R={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:b,role:"alert",className:z("brycks-alert",`brycks-alert--${t}`,`brycks-alert--${r}`,d),style:x,"data-testid":p,...y,children:[a&&e.jsx("span",{className:"brycks-alert-icon",style:w,children:n??h.icon}),e.jsxs("div",{className:"brycks-alert-content",style:S,children:[s&&e.jsx("div",{className:"brycks-alert-title",style:C,children:s}),k&&e.jsx("div",{className:"brycks-alert-description",style:R,children:k})]}),(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:j=>{j.currentTarget.style.opacity="1"},onMouseLeave:j=>{j.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"})})})]})]})});ft.displayName="Alert";const yt=i.forwardRef(function({content:t,placement:r="top",delay:s=200,isDisabled:n,className:a,testId:c,children:l,...u},d){const[f,p]=i.useState(!1),[k,y]=i.useState({top:0,left:0}),b=i.useRef(null),h=i.useRef(null),m=i.useRef(null),x=i.useCallback(()=>{if(!b.current||!h.current)return;const M=b.current.getBoundingClientRect(),j=h.current.getBoundingClientRect(),T=8;let L=0,I=0;switch(r){case"top":L=M.top-j.height-T,I=M.left+(M.width-j.width)/2;break;case"bottom":L=M.bottom+T,I=M.left+(M.width-j.width)/2;break;case"left":L=M.top+(M.height-j.height)/2,I=M.left-j.width-T;break;case"right":L=M.top+(M.height-j.height)/2,I=M.right+T;break}const H=8;I=Math.max(H,Math.min(I,window.innerWidth-j.width-H)),L=Math.max(H,Math.min(L,window.innerHeight-j.height-H)),y({top:L,left:I})},[r]);i.useEffect(()=>(f&&(x(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),[f,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 C={display:"inline-flex"},R={position:"fixed",top:k.top,left:k.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:b,style:C,onMouseEnter:w,onMouseLeave:S,onFocus:w,onBlur:S,children:l}),f&&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
|
-
`}),
|
|
70
|
+
`}),e.jsxs("div",{ref:M=>{h.current=M,typeof d=="function"?d(M):d&&(d.current=M)},role:"tooltip",className:z("brycks-tooltip",`brycks-tooltip--${r}`,a),style:R,"data-testid":c,...u,children:[t,e.jsx("span",{style:v})]})]}),document.body)]})});yt.displayName="Tooltip";const Vo={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 Oo({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 Xo(){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:f,style:p,testId:k,...y},b){const[h,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]),!h)return null;const S=Vo[t],C={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},R={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},j={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
|
+
@keyframes brycks-toast-in {
|
|
72
|
+
from { opacity: 0; transform: translateY(-8px) scale(0.95); }
|
|
73
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
74
|
+
}
|
|
75
|
+
@keyframes brycks-toast-out {
|
|
76
|
+
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
77
|
+
to { opacity: 0; transform: translateY(-8px) scale(0.95); }
|
|
78
|
+
}
|
|
79
|
+
`}),e.jsxs("div",{ref:b,role:"alert","aria-live":"polite",className:z("brycks-toast",`brycks-toast--${t}`,f),style:C,"data-testid":k,...y,children:[e.jsx("span",{style:R,children:d||e.jsx(Oo,{intent:t})}),e.jsxs("div",{style:v,children:[r&&e.jsx("span",{style:M,children:r}),s&&e.jsx("span",{style:j,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(Xo,{})})]})]})});xe.displayName="Toast";const bt=i.createContext(null);function Yo(){const o=i.useContext(bt);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}const Go={"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 qo=0;function Ko({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(k=>{const y=`toast-${++qo}`;return n(b=>{const h=[...b,{id:y,props:k}];return h.length>r?h.slice(-r):h}),y},[r]),u=i.useCallback(k=>{n(y=>y.filter(b=>b.id!==k))},[]),d=i.useCallback(()=>{n([])},[]),f={position:"fixed",zIndex:"var(--brycks-z-toast)",display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",...Go[t]},p={pointerEvents:"auto"};return e.jsxs(bt.Provider,{value:{toasts:s,addToast:l,removeToast:u,removeAll:d},children:[o,a&&ae.createPortal(e.jsx("div",{className:"brycks-toast-container",style:f,children:s.map(({id:k,props:y})=>e.jsx("div",{style:p,children:e.jsx(xe,{...y,isOpen:!0,onClose:()=>u(k)})},k))}),document.body)]})}const _o={sm:"320px",md:"400px",lg:"560px",xl:"720px",full:"100%"};function Uo(){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 gt=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:f,style:p,children:k,testId:y,...b},h){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"])'),D=N[0],E=N[N.length-1];A.shiftKey&&document.activeElement===D?(A.preventDefault(),E==null||E.focus()):!A.shiftKey&&document.activeElement===E&&(A.preventDefault(),D==null||D.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",C=_o[n],R={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:C,maxWidth:"100vw"}:{...$,left:0,right:0,[s]:0,height:C,maxHeight:"100vh"}})(),animation:`brycks-drawer-${s}-in 250ms cubic-bezier(0.32, 0.72, 0, 1)`,outline:"none",...p},j={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"},I={flex:1,overflow:"auto",padding:20},H=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
80
|
+
@keyframes brycks-drawer-overlay-in {
|
|
81
|
+
from { opacity: 0; }
|
|
82
|
+
to { opacity: 1; }
|
|
83
|
+
}
|
|
84
|
+
@keyframes brycks-drawer-left-in {
|
|
85
|
+
from { transform: translateX(-100%); }
|
|
86
|
+
to { transform: translateX(0); }
|
|
87
|
+
}
|
|
88
|
+
@keyframes brycks-drawer-right-in {
|
|
89
|
+
from { transform: translateX(100%); }
|
|
90
|
+
to { transform: translateX(0); }
|
|
91
|
+
}
|
|
92
|
+
@keyframes brycks-drawer-top-in {
|
|
93
|
+
from { transform: translateY(-100%); }
|
|
94
|
+
to { transform: translateY(0); }
|
|
95
|
+
}
|
|
96
|
+
@keyframes brycks-drawer-bottom-in {
|
|
97
|
+
from { transform: translateY(100%); }
|
|
98
|
+
to { transform: translateY(0); }
|
|
99
|
+
}
|
|
100
|
+
`}),e.jsx("div",{className:"brycks-drawer-overlay",style:R,onClick:w,"aria-hidden":"true",children:e.jsxs("div",{ref:$=>{m.current=$,typeof h=="function"?h($):h&&(h.current=$)},role:"dialog","aria-modal":"true","aria-labelledby":a?"brycks-drawer-title":void 0,className:z("brycks-drawer",`brycks-drawer--${s}`,`brycks-drawer--${n}`,f),style:M,tabIndex:-1,"data-testid":y,...b,children:[(a||u)&&e.jsxs("div",{className:"brycks-drawer-header",style:j,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(Uo,{})})]}),e.jsx("div",{className:"brycks-drawer-content",style:I,children:k})]})})]});return ae.createPortal(H,document.body)});gt.displayName="Drawer";function mt(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 pt=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:f=200,closeOnOutsideClick:p=!0,showArrow:k=!0,className:y,style:b,testId:h,...m},x){const[w,S]=i.useState(c),[C,R]=i.useState({top:0,left:0}),[v,M]=i.useState(!1),j=i.useRef(null),T=i.useRef(null),L=i.useRef(null),I=i.useRef(null),H=a??w,$=i.useCallback(B=>{a===void 0&&S(B),l==null||l(B)},[a,l]),X=mt(()=>{p&&n==="click"&&H&&$(!1)},{enabled:H&&n==="click"});i.useEffect(()=>(M(!0),()=>M(!1)),[]),i.useEffect(()=>{if(!H||!j.current||!v)return;const B=()=>{const q=j.current,ie=T.current;if(!q||!ie)return;const U=q.getBoundingClientRect(),F=ie.getBoundingClientRect(),_=window.scrollX,ne=window.scrollY;let le=0,ce=0;switch(s){case"top":case"top-start":case"top-end":le=U.top+ne-F.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+_-F.width-u;break;case"right":case"right-start":case"right-end":ce=U.right+_+u;break}switch(s){case"top":case"bottom":ce=U.left+_+(U.width-F.width)/2;break;case"top-start":case"bottom-start":ce=U.left+_;break;case"top-end":case"bottom-end":ce=U.right+_-F.width;break;case"left":case"right":le=U.top+ne+(U.height-F.height)/2;break;case"left-start":case"right-start":le=U.top+ne;break;case"left-end":case"right-end":le=U.bottom+ne-F.height;break}R({top:le,left:ce})};return B(),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0),()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0)}},[H,s,u,v]),i.useEffect(()=>()=>{L.current&&clearTimeout(L.current),I.current&&clearTimeout(I.current)},[]);const A=i.useCallback(()=>{I.current&&clearTimeout(I.current),n==="hover"?L.current=setTimeout(()=>$(!0),d):$(!0)},[n,d,$]),N=i.useCallback(()=>{L.current&&clearTimeout(L.current),n==="hover"?I.current=setTimeout(()=>$(!1),f):$(!1)},[n,f,$]),D=i.useCallback(()=>{H?N():A()},[H,A,N]),E=r.props,G=i.cloneElement(r,{ref:j,...n==="click"&&{onClick:B=>{var q;(q=E.onClick)==null||q.call(E,B),D()}},...n==="hover"&&{onMouseEnter:B=>{var q;(q=E.onMouseEnter)==null||q.call(E,B),A()},onMouseLeave:B=>{var q;(q=E.onMouseLeave)==null||q.call(E,B),N()}}}),Y={position:"absolute",top:C.top,left:C.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",...b},W=H&&v&&e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
101
|
+
@keyframes brycks-popover-in {
|
|
102
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
103
|
+
to { opacity: 1; transform: scale(1); }
|
|
104
|
+
}
|
|
105
|
+
`}),e.jsx("div",{ref:B=>{T.current=B,X.current=B,typeof x=="function"?x(B):x&&(x.current=B)},className:z("brycks-popover",y),style:Y,role:"dialog","data-testid":h,onMouseEnter:n==="hover"?A:void 0,onMouseLeave:n==="hover"?N:void 0,...m,children:t})]});return e.jsxs(e.Fragment,{children:[G,v&&ae.createPortal(W,document.body)]})});pt.displayName="Popover";const Qo={xs:4,sm:6,md:8,lg:12},Zo={xs:{size:24,strokeWidth:3},sm:{size:32,strokeWidth:3},md:{size:48,strokeWidth:4},lg:{size:64,strokeWidth:5}},Jo={primary:"var(--brycks-primary-default)",success:"var(--brycks-success-default)",warning:"var(--brycks-warning-default)",error:"var(--brycks-error-default)"},ht=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=(h,m)=>`${Math.round(h/m*100)}%`,label:d,className:f,style:p,testId:k,...y},b){const h=Math.min(100,Math.max(0,t/r*100)),m=Jo[a];if(n==="circular"){const j=Zo[s],T=(j.size-j.strokeWidth)/2,L=2*Math.PI*T,I=L-h/100*L,H={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:8,...p},$={transform:"rotate(-90deg)",width:j.size,height:j.size},X={fill:"none",stroke:"var(--brycks-background-muted)",strokeWidth:j.strokeWidth},A={fill:"none",stroke:m,strokeWidth:j.strokeWidth,strokeLinecap:"round",strokeDasharray:L,strokeDashoffset:l?L*.75:I,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)"},D={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
|
+
@keyframes brycks-progress-circular-spin {
|
|
107
|
+
from { transform: rotate(0deg); }
|
|
108
|
+
to { transform: rotate(360deg); }
|
|
109
|
+
}
|
|
110
|
+
`}),e.jsxs("div",{ref:b,className:z("brycks-progress","brycks-progress--circular",`brycks-progress--${s}`,f),style:H,role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":d,"data-testid":k,...y,children:[e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{style:$,children:[e.jsx("circle",{cx:j.size/2,cy:j.size/2,r:T,style:X}),e.jsx("circle",{cx:j.size/2,cy:j.size/2,r:T,style:A})]}),c&&!l&&s!=="xs"&&e.jsx("span",{style:N,children:u(t,r)})]}),d&&e.jsx("span",{style:D,children:d})]})]})}const x=Qo[s],w={display:"flex",flexDirection:"column",gap:6,width:"100%",...p},S={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},C={fontSize:s==="xs"?11:s==="sm"?12:s==="md"?13:14,fontWeight:500,color:"var(--brycks-foreground-default)"},R={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%":`${h}%`,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
|
+
@keyframes brycks-progress-linear-indeterminate {
|
|
112
|
+
0% { transform: translateX(-100%); }
|
|
113
|
+
100% { transform: translateX(400%); }
|
|
114
|
+
}
|
|
115
|
+
`}),e.jsxs("div",{ref:b,className:z("brycks-progress","brycks-progress--linear",`brycks-progress--${s}`,f),style:w,role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":d,"data-testid":k,...y,children:[(d||c)&&e.jsxs("div",{style:S,children:[d&&e.jsx("span",{style:C,children:d}),c&&!l&&e.jsx("span",{style:R,children:u(t,r)})]}),e.jsx("div",{style:v,children:e.jsx("div",{style:M})})]})]})});ht.displayName="Progress";const kt=i.createContext(null);function Se(){const o=i.useContext(kt);if(!o)throw new Error("Tabs components must be used within a Tabs");return o}const vt=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:f,...p},k){const[y,b]=i.useState(r),h=t??y,m=i.useCallback(w=>{t===void 0&&b(w),s==null||s(w)},[t,s]),x={display:"flex",flexDirection:c==="vertical"?"row":"column",gap:c==="vertical"?24:0,...u};return e.jsx(kt.Provider,{value:{value:h,onChange:m,size:n,variant:a,orientation:c},children:e.jsx("div",{ref:k,className:z("brycks-tabs",`brycks-tabs--${a}`,`brycks-tabs--${c}`,l),style:x,"data-testid":f,...p,children:d})})});vt.displayName="Tabs";const xt=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})});xt.displayName="TabList";const es={sm:{fontSize:13,padding:"6px 12px",height:32},md:{fontSize:14,padding:"8px 16px",height:40},lg:{fontSize:16,padding:"10px 20px",height:48}},St=i.forwardRef(function({value:t,disabled:r=!1,icon:s,className:n,style:a,children:c,...l},u){const{value:d,onChange:f,size:p,variant:k,orientation:y}=Se(),b=d===t,h=es[p],m=()=>{r||f(t)},x=S=>{var M,j,T;if(r)return;const C=Array.from(((M=S.currentTarget.parentElement)==null?void 0:M.querySelectorAll('[role="tab"]:not([disabled])'))??[]),R=C.indexOf(S.currentTarget);let v=null;y==="horizontal"?(S.key==="ArrowRight"&&(v=(R+1)%C.length),S.key==="ArrowLeft"&&(v=(R-1+C.length)%C.length)):(S.key==="ArrowDown"&&(v=(R+1)%C.length),S.key==="ArrowUp"&&(v=(R-1+C.length)%C.length)),S.key==="Home"&&(v=0),S.key==="End"&&(v=C.length-1),v!==null&&(S.preventDefault(),(j=C[v])==null||j.focus(),(T=C[v])==null||T.click())},w=()=>{const S={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,fontSize:h.fontSize,fontWeight:500,padding:h.padding,minHeight:h.height,cursor:r?"not-allowed":"pointer",opacity:r?.5:1,transition:"all 150ms ease-out",outline:"none",border:"none",backgroundColor:"transparent",whiteSpace:"nowrap"};return k==="line"?{...S,color:b?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",borderBottom:y==="horizontal"?`2px solid ${b?"var(--brycks-primary-default)":"transparent"}`:void 0,borderRight:y==="vertical"?`2px solid ${b?"var(--brycks-primary-default)":"transparent"}`:void 0,marginBottom:y==="horizontal"?-1:void 0,marginRight:y==="vertical"?-1:void 0}:k==="enclosed"?{...S,color:b?"var(--brycks-foreground-default)":"var(--brycks-foreground-muted)",backgroundColor:b?"var(--brycks-background-elevated)":"transparent",borderRadius:"var(--brycks-radius-md)",boxShadow:b?"var(--brycks-shadow-sm)":void 0}:{...S,color:b?"var(--brycks-primary-default)":"var(--brycks-foreground-muted)",backgroundColor:b?"var(--brycks-primary-50)":"transparent",borderRadius:"var(--brycks-radius-md)"}};return e.jsxs("button",{ref:u,role:"tab",type:"button","aria-selected":b,"aria-disabled":r,disabled:r,tabIndex:b?0:-1,className:z("brycks-tab",b&&"brycks-tab--selected",n),style:{...w(),...a},onClick:m,onKeyDown:x,...l,children:[s&&e.jsx("span",{className:"brycks-tab-icon",children:s}),c]})});St.displayName="Tab";const wt=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})});wt.displayName="TabPanels";const jt=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
|
+
@keyframes brycks-tab-panel-in {
|
|
117
|
+
from { opacity: 0; }
|
|
118
|
+
to { opacity: 1; }
|
|
119
|
+
}
|
|
120
|
+
`}),e.jsx("div",{ref:c,role:"tabpanel",tabIndex:0,className:z("brycks-tab-panel",r),style:d,...a,children:n})]})});jt.displayName="TabPanel";const Ct=i.createContext(null);function zt(){const o=i.useContext(Ct);if(!o)throw new Error("AccordionItem must be used within an Accordion");return o}const Mt=i.forwardRef(function({value:t,defaultValue:r=[],onChange:s,allowMultiple:n=!1,variant:a="default",className:c,style:l,children:u,testId:d,...f},p){const[k,y]=i.useState(r),b=t??k,h=i.useCallback(x=>{const w=b.includes(x);let S;w?S=b.filter(C=>C!==x):n?S=[...b,x]:S=[x],t===void 0&&y(S),s==null||s(S)},[b,n,t,s]),m={display:"flex",flexDirection:"column",gap:a==="separated"?8:0,...l};return e.jsx(Ct.Provider,{value:{expandedItems:b,toggleItem:h,allowMultiple:n,variant:a},children:e.jsx("div",{ref:p,className:z("brycks-accordion",`brycks-accordion--${a}`,c),style:m,"data-testid":d,...f,children:u})})});Mt.displayName="Accordion";const Tt=i.createContext(null);function It(){const o=i.useContext(Tt);if(!o)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return o}const Rt=i.forwardRef(function({value:t,disabled:r=!1,className:s,style:n,children:a,...c},l){const{expandedItems:u,variant:d}=zt(),f=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"&&!f&&(p.borderBottom="1px solid var(--brycks-border-default)"),e.jsx(Tt.Provider,{value:{value:t,isExpanded:f,disabled:r},children:e.jsx("div",{ref:l,className:z("brycks-accordion-item",f&&"brycks-accordion-item--expanded",s),style:p,...c,children:a})})});Rt.displayName="AccordionItem";function ts({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 Lt=i.forwardRef(function({icon:t,className:r,style:s,children:n,...a},c){const{toggleItem:l}=zt(),{value:u,isExpanded:d,disabled:f}=It(),p=()=>{f||l(u)},k={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"16px",fontSize:15,fontWeight:500,color:f?"var(--brycks-foreground-muted)":"var(--brycks-foreground-default)",backgroundColor:"transparent",border:"none",cursor:f?"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":f,disabled:f,className:z("brycks-accordion-trigger",r),style:k,onClick:p,onMouseEnter:y=>{f||(y.currentTarget.style.backgroundColor="var(--brycks-background-muted)")},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},...a,children:[n,e.jsx("span",{style:{color:"var(--brycks-foreground-muted)",flexShrink:0,marginLeft:12},children:t??e.jsx(ts,{isExpanded:d})})]})});Lt.displayName="AccordionTrigger";const Nt=i.forwardRef(function({className:t,style:r,children:s,...n},a){const{isExpanded:c}=It(),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})})});Nt.displayName="AccordionContent";const $t=i.createContext(null);function rs(){const o=i.useContext($t);if(!o)throw new Error("Dropdown components must be used within a Dropdown");return o}const Ht=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:f,testId:p,...k},y){var A;const[b,h]=i.useState(s),[m,x]=i.useState({top:0,left:0}),[w,S]=i.useState(-1),[C,R]=i.useState(!1),v=i.useRef(null),M=i.useRef(null),j=r??b;i.useEffect(()=>(R(!0),()=>R(!1)),[]);const T=i.useCallback(N=>{r===void 0&&h(N),n==null||n(N),N||S(-1)},[r,n]),L=i.useCallback(()=>T(!1),[T]);i.useEffect(()=>{if(!j||!v.current||!C)return;const N=()=>{const D=v.current;if(!D)return;const E=D.getBoundingClientRect(),G=window.scrollX,Y=window.scrollY;let W=0,B=0;a.startsWith("bottom")?W=E.bottom+Y+c:W=E.top+Y-c,a.endsWith("start")?B=E.left+G:B=E.right+G,x({top:W,left:B})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[j,a,c,C]),i.useEffect(()=>{if(!j)return;const N=D=>{var E,G;(E=v.current)!=null&&E.contains(D.target)||(G=M.current)!=null&&G.contains(D.target)||T(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[j,T]);const I=i.useCallback(N=>{var E,G,Y;if(!j){(N.key==="ArrowDown"||N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T(!0));return}const D=(E=M.current)==null?void 0:E.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');if(D!=null&&D.length)switch(N.key){case"ArrowDown":N.preventDefault(),S(W=>(W+1)%D.length);break;case"ArrowUp":N.preventDefault(),S(W=>(W-1+D.length)%D.length);break;case"Home":N.preventDefault(),S(0);break;case"End":N.preventDefault(),S(D.length-1);break;case"Escape":N.preventDefault(),T(!1),(G=v.current)==null||G.focus();break;case"Enter":case" ":N.preventDefault(),w>=0&&((Y=D[w])==null||Y.click());break}},[j,w,T]);i.useEffect(()=>{var D,E;if(!j||w<0)return;const N=(D=M.current)==null?void 0:D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');(E=N==null?void 0:N[w])==null||E.focus()},[j,w]);const H=t.props,$=i.cloneElement(t,{ref:v,"aria-haspopup":"menu","aria-expanded":j,onClick:N=>{var D;(D=H.onClick)==null||D.call(H,N),T(!j)},onKeyDown:N=>{var D;(D=H.onKeyDown)==null||D.call(H,N),I(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($t.Provider,{value:{isOpen:j,close:l?L:()=>{},activeIndex:w,setActiveIndex:S},children:e.jsxs("div",{ref:y,className:z("brycks-dropdown",u),style:{display:"inline-block"},"data-testid":p,...k,children:[$,j&&C&&ae.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
121
|
+
@keyframes brycks-dropdown-in {
|
|
122
|
+
from { opacity: 0; transform: translateY(-4px); }
|
|
123
|
+
to { opacity: 1; transform: translateY(0); }
|
|
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:`
|
|
71
126
|
@keyframes brycks-spin {
|
|
72
127
|
from { transform: rotate(0deg); }
|
|
73
128
|
to { transform: rotate(360deg); }
|
|
@@ -80,10 +135,15 @@
|
|
|
80
135
|
0%, 100% { transform: scale(0.8); opacity: 0.5; }
|
|
81
136
|
50% { transform: scale(1); opacity: 1; }
|
|
82
137
|
}
|
|
83
|
-
`}),
|
|
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:[k(),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 ks=Ce,ze=i.forwardRef(function({variant:t="rectangular",width:r,height:s,radius:n,animate:a=!0,className:c,style:l,testId:u,...d},f){const k={...(()=>{const b={backgroundColor:"var(--brycks-background-muted)",position:"relative",overflow:"hidden"};switch(t){case"text":b.width=r??"100%",b.height=s??"1em",b.borderRadius="var(--brycks-radius-sm)";break;case"circular":b.width=r??40,b.height=s??r??40,b.borderRadius="50%";break;case"rectangular":b.width=r??"100%",b.height=s??40,b.borderRadius=n??"var(--brycks-radius-default)";break}return b})(),...l},y={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:`
|
|
84
139
|
@keyframes brycks-shimmer {
|
|
85
140
|
0% { transform: translateX(-100%); }
|
|
86
141
|
100% { transform: translateX(100%); }
|
|
87
142
|
}
|
|
88
|
-
`}),
|
|
143
|
+
`}),e.jsx("div",{ref:f,className:z("brycks-skeleton",`brycks-skeleton--${t}`,a&&"brycks-skeleton--animated",c),style:k,"data-testid":u,"aria-hidden":"true",...d,children:a&&e.jsx("div",{style:y})})]})});ze.displayName="Skeleton";function cr({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))})}cr.displayName="SkeletonText";const dr=i.forwardRef(function({orientation:t="horizontal",variant:r="solid",label:s,labelPosition:n="center",className:a,style:c,testId:l,...u},d){const f=t==="horizontal",p={display:"flex",alignItems:"center",width:f?"100%":void 0,height:f?void 0:"100%",flexDirection:f?"row":"column",...c},k={flex:1,backgroundColor:r==="solid"?"var(--brycks-border-muted)":"transparent",borderStyle:r,borderColor:"var(--brycks-border-muted)",...f?{height:1,borderWidth:r==="solid"?0:"1px 0 0 0"}:{width:1,borderWidth:r==="solid"?0:"0 0 0 1px"}},y={padding:f?"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:{...k,...c},"data-testid":l,...u});const b=n==="center"||n==="end",h=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:[b&&e.jsx("span",{style:k}),e.jsx("span",{style:y,children:s}),h&&e.jsx("span",{style:k})]})});dr.displayName="Divider";const ur=i.forwardRef(function({icon:t,title:r,description:s,action:n,secondaryAction:a,className:c,style:l,testId:u,children:d,...f},p){const k={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",...l},y={marginBottom:16,color:"var(--brycks-foreground-subtle)"},b={fontSize:18,fontWeight:600,color:"var(--brycks-foreground-default)",marginBottom:s?8:0,maxWidth:400},h={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:k,"data-testid":u,...f,children:[t&&e.jsx("div",{style:y,children:t}),r&&e.jsx("h3",{style:b,children:r}),s&&e.jsx("p",{style:h,children:s}),d,(n||a)&&e.jsxs("div",{style:m,children:[n,a]})]})});ur.displayName="EmptyState";function fr({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"})]})}fr.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 vs=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function yr(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(vs)):[],[]),u=i.useCallback(()=>{var p;(p=l()[0])==null||p.focus()},[l]),d=i.useCallback(()=>{var p;const f=l();(p=f[f.length-1])==null||p.focus()},[l]);return i.useEffect(()=>{if(t){if(c.current=document.activeElement,r){const f=a.current;if(!f)return;if(n){const p=typeof n=="string"?f.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 f=p=>{if(p.key!=="Tab"||!a.current)return;const y=l();if(y.length===0)return;const b=y[0],h=y[y.length-1];p.shiftKey?document.activeElement===b&&(p.preventDefault(),h.focus()):document.activeElement===h&&(p.preventDefault(),b.focus())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t,l]),{ref:a,focusFirst:u,focusLast:d}}const br=i.forwardRef(function({children:t,enabled:r=!0,autoFocus:s=!0,restoreFocus:n=!0,initialFocus:a,className:c,style:l},u){const{ref:d}=yr({enabled:r,autoFocus:s,restoreFocus:n,initialFocus:a});return e.jsx("div",{ref:f=>{d.current=f,typeof u=="function"?u(f):u&&(u.current=f)},className:c,style:l,children:t})});br.displayName="FocusTrap";const gr=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:f,testId:p,children:k,...y},b){if(!t)return null;const h=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",...f},x=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
|
|
144
|
+
@keyframes brycks-overlay-fade-in {
|
|
145
|
+
from { opacity: 0; }
|
|
146
|
+
to { opacity: 1; }
|
|
147
|
+
}
|
|
148
|
+
`}),e.jsx("div",{ref:b,className:z("brycks-overlay",d),style:m,onClick:h,"aria-hidden":"true","data-testid":p,...y,children:k})]});return l?e.jsx(Me,{children:x}):x});gr.displayName="Overlay";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 xs(){return fe("(max-width: 639px)")}function Ss(){return fe("(min-width: 640px) and (max-width: 1023px)")}function ws(){return fe("(min-width: 1024px)")}function js(){return fe("(prefers-reduced-motion: reduce)")}function Cs(){return fe("(prefers-color-scheme: dark)")}function zs(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 Ms(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(y=>{u(y),a==null||a(y)},[a]),f=i.useCallback(y=>{let b;switch(y){case"first":b=0;break;case"last":b=t-1;break;case"next":l>=t-1?b=s?0:l:b=l+1;break;case"prev":l<=0?b=s?t-1:l:b=l-1;break}d(b)},[l,t,s,d]),p=i.useCallback(y=>{const{key:b}=y,h=n==="vertical"||n==="both",m=n==="horizontal"||n==="both";switch(b){case"ArrowDown":h&&(y.preventDefault(),f("next"));break;case"ArrowUp":h&&(y.preventDefault(),f("prev"));break;case"ArrowRight":m&&(y.preventDefault(),f("next"));break;case"ArrowLeft":m&&(y.preventDefault(),f("prev"));break;case"Home":y.preventDefault(),f("first");break;case"End":y.preventDefault(),f("last");break;case"Enter":case" ":y.preventDefault(),c==null||c(l);break}},[n,f,c,l]),k=i.useCallback(y=>({tabIndex:y===l?0:-1,"data-focused":y===l,onFocus:()=>d(y)}),[l,d]);return{focusedIndex:l,setFocusedIndex:d,handleKeyDown:p,getItemProps:k}}function Ts(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(f=>{const p=typeof f=="function"?f(u):f;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=g.animations;exports.borderStyles=g.borderStyles;exports.borderWidths=g.borderWidths;exports.breakpoints=g.breakpoints;exports.containers=g.containers;exports.durations=g.durations;exports.easings=g.easings;exports.focusRings=g.focusRings;exports.fontFamilies=g.fontFamilies;exports.fontSizes=g.fontSizes;exports.fontWeights=g.fontWeights;exports.glows=g.glows;exports.letterSpacings=g.letterSpacings;exports.lineHeights=g.lineHeights;exports.mediaQueries=g.mediaQueries;exports.radii=g.radii;exports.semanticSpacing=g.semanticSpacing;exports.shadows=g.shadows;exports.spacing=g.spacing;exports.textStyles=g.textStyles;exports.transitions=g.transitions;exports.zIndex=g.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=Mt;exports.AccordionContent=Nt;exports.AccordionItem=Rt;exports.AccordionTrigger=Lt;exports.Alert=ft;exports.Badge=lr;exports.Box=Le;exports.Breadcrumb=Gt;exports.BreadcrumbItem=qt;exports.Button=ke;exports.Card=Ee;exports.CardBody=Fe;exports.CardFooter=Ae;exports.CardHeader=Be;exports.Checkbox=et;exports.Code=qe;exports.Container=We;exports.DateInput=at;exports.Display=Ke;exports.Divider=dr;exports.Drawer=gt;exports.Dropdown=Ht;exports.DropdownDivider=Wt;exports.DropdownItem=Dt;exports.DropdownLabel=Et;exports.EmptyState=ur;exports.EmptyStateIcon=fr;exports.FieldError=dt;exports.FileInput=it;exports.Flex=Xe;exports.FlexItem=Ye;exports.FocusTrap=br;exports.FormField=ct;exports.Grid=He;exports.GridItem=De;exports.HStack=Ne;exports.Heading=he;exports.Icon=Qe;exports.IconButton=Ue;exports.Input=ve;exports.List=sr;exports.ListDivider=ar;exports.ListHeader=ir;exports.ListItem=nr;exports.Loader=Ce;exports.Menu=At;exports.MenuDivider=Ot;exports.MenuGroup=Vt;exports.MenuItem=Pt;exports.Modal=ut;exports.Overlay=gr;exports.Pagination=Xt;exports.Popover=pt;exports.Portal=Me;exports.Progress=ht;exports.Radio=ot;exports.RadioGroup=st;exports.Section=Pe;exports.Select=Je;exports.Skeleton=ze;exports.SkeletonText=cr;exports.Slider=nt;exports.Spacer=Ve;exports.Spinner=ks;exports.Stack=me;exports.Switch=tt;exports.Tab=St;exports.TabList=xt;exports.TabPanel=jt;exports.TabPanels=wt;exports.Table=_t;exports.TableBody=Qt;exports.TableCaption=rr;exports.TableCell=er;exports.TableFoot=tr;exports.TableHead=Ut;exports.TableHeader=Jt;exports.TableRow=Zt;exports.Tabs=vt;exports.Text=pe;exports.TextField=Ze;exports.Textarea=rt;exports.Toast=xe;exports.ToastProvider=Ko;exports.Tooltip=yt;exports.VStack=$e;exports.avatarSizes=Tr;exports.buildSpacingStyles=be;exports.componentFontSize=V;exports.componentFontWeight=K;exports.componentGap=Q;exports.componentHeights=J;exports.componentLineHeight=O;exports.componentPaddingX=ee;exports.componentPaddingY=mr;exports.componentTypography=Cr;exports.contentPadding=Lr;exports.controlSizes=Ie;exports.cx=z;exports.duration=Sr;exports.easing=wr;exports.focusRing=te;exports.focusRingOffset=kr;exports.focusStyles=vr;exports.generateId=Er;exports.getSpacingValue=Dr;exports.headerSizes=Mr;exports.hexToRgba=Br;exports.iconButtonSizes=Ir;exports.iconPaths=So;exports.iconSizes=de;exports.keyframes=jr;exports.modalWidths=pr;exports.opacity=Z;exports.pageHeaderSpacing=Nr;exports.popoverSizing=hr;exports.quickActionSizes=Rr;exports.scale=re;exports.searchInputSizes=$r;exports.sidebarSizes=zr;exports.spacingToCss=P;exports.statCardSizes=Hr;exports.stateOpacity=ye;exports.switchSizes=Re;exports.transition=oe;exports.transitionProperties=xr;exports.useClickOutside=mt;exports.useControllable=Ts;exports.useDisclosure=zs;exports.useFocusTrap=yr;exports.useId=lt;exports.useIds=Do;exports.useIsDesktop=ws;exports.useIsMobile=xs;exports.useIsTablet=Ss;exports.useKeyboardNavigation=Ms;exports.useMediaQuery=fe;exports.usePrefersDarkMode=Cs;exports.usePrefersReducedMotion=js;exports.useToast=Yo;
|
|
89
149
|
//# sourceMappingURL=index.cjs.map
|