@codefast/ui 0.1.49 → 0.1.51

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.
Files changed (89) hide show
  1. package/dist/{chunk-UZ2CW6TS.js → chunk-BHLW3MWI.js} +2 -2
  2. package/dist/{chunk-UZ2CW6TS.js.map → chunk-BHLW3MWI.js.map} +1 -1
  3. package/dist/{chunk-VA36YONO.cjs → chunk-E2QRPDUI.cjs} +1 -1
  4. package/dist/{chunk-VA36YONO.cjs.map → chunk-E2QRPDUI.cjs.map} +1 -1
  5. package/dist/chunk-EEDKRHHZ.cjs +2 -0
  6. package/dist/chunk-EEDKRHHZ.cjs.map +1 -0
  7. package/dist/{chunk-A5RTV4IE.js → chunk-FSXJI6UE.js} +1 -1
  8. package/dist/{chunk-A5RTV4IE.js.map → chunk-FSXJI6UE.js.map} +1 -1
  9. package/dist/chunk-GV5FQF4J.js +2 -0
  10. package/dist/chunk-GV5FQF4J.js.map +1 -0
  11. package/dist/chunk-HO5BFEZO.cjs +4 -0
  12. package/dist/chunk-HO5BFEZO.cjs.map +1 -0
  13. package/dist/chunk-KASTA74M.cjs +2 -0
  14. package/dist/chunk-KASTA74M.cjs.map +1 -0
  15. package/dist/chunk-OUWUINGX.cjs +2 -0
  16. package/dist/chunk-OUWUINGX.cjs.map +1 -0
  17. package/dist/{chunk-3TS74A2W.cjs → chunk-PYKB3C2F.cjs} +2 -2
  18. package/dist/{chunk-3TS74A2W.cjs.map → chunk-PYKB3C2F.cjs.map} +1 -1
  19. package/dist/chunk-TTKMKXCU.js +2 -0
  20. package/dist/chunk-TTKMKXCU.js.map +1 -0
  21. package/dist/{chunk-3TOWLKUY.js → chunk-UHHMORLE.js} +2 -2
  22. package/dist/chunk-WNXJ2WHS.js +4 -0
  23. package/dist/chunk-WNXJ2WHS.js.map +1 -0
  24. package/dist/components/alert-dialog.d.cts +1 -1
  25. package/dist/components/alert-dialog.d.ts +1 -1
  26. package/dist/components/breadcrumb.d.cts +1 -1
  27. package/dist/components/breadcrumb.d.ts +1 -1
  28. package/dist/components/calendar.cjs +1 -1
  29. package/dist/components/calendar.d.cts +2 -2
  30. package/dist/components/calendar.d.ts +2 -2
  31. package/dist/components/calendar.js +1 -1
  32. package/dist/components/chart.cjs +1 -1
  33. package/dist/components/chart.d.cts +1 -1
  34. package/dist/components/chart.d.ts +1 -1
  35. package/dist/components/chart.js +1 -1
  36. package/dist/components/command.d.cts +1 -1
  37. package/dist/components/command.d.ts +1 -1
  38. package/dist/components/context-menu.d.cts +1 -1
  39. package/dist/components/context-menu.d.ts +1 -1
  40. package/dist/components/data-table.cjs +1 -1
  41. package/dist/components/data-table.js +1 -1
  42. package/dist/components/dialog.d.cts +1 -1
  43. package/dist/components/dialog.d.ts +1 -1
  44. package/dist/components/drawer.d.cts +1 -1
  45. package/dist/components/drawer.d.ts +1 -1
  46. package/dist/components/dropdown-menu.d.cts +1 -1
  47. package/dist/components/dropdown-menu.d.ts +1 -1
  48. package/dist/components/form.d.cts +2 -2
  49. package/dist/components/form.d.ts +2 -2
  50. package/dist/components/hover-card.d.cts +1 -1
  51. package/dist/components/hover-card.d.ts +1 -1
  52. package/dist/components/input-otp.cjs +1 -1
  53. package/dist/components/input-otp.js +1 -1
  54. package/dist/components/menubar.d.cts +1 -1
  55. package/dist/components/menubar.d.ts +1 -1
  56. package/dist/components/popover.d.cts +1 -1
  57. package/dist/components/popover.d.ts +1 -1
  58. package/dist/components/select.cjs +1 -1
  59. package/dist/components/select.d.cts +1 -1
  60. package/dist/components/select.d.ts +1 -1
  61. package/dist/components/select.js +1 -1
  62. package/dist/components/sheet.d.cts +1 -1
  63. package/dist/components/sheet.d.ts +1 -1
  64. package/dist/components/sidebar.cjs +1 -1
  65. package/dist/components/sidebar.js +1 -1
  66. package/dist/components/table.d.cts +1 -1
  67. package/dist/components/table.d.ts +1 -1
  68. package/dist/components/tooltip.d.cts +1 -1
  69. package/dist/components/tooltip.d.ts +1 -1
  70. package/dist/index.cjs +1 -1
  71. package/dist/index.d.cts +1 -1
  72. package/dist/index.d.ts +1 -1
  73. package/dist/index.js +1 -1
  74. package/package.json +20 -20
  75. package/dist/chunk-2XO4KTBF.js +0 -4
  76. package/dist/chunk-2XO4KTBF.js.map +0 -1
  77. package/dist/chunk-3SJHSQTX.cjs +0 -4
  78. package/dist/chunk-3SJHSQTX.cjs.map +0 -1
  79. package/dist/chunk-LOFRT7V5.js +0 -2
  80. package/dist/chunk-LOFRT7V5.js.map +0 -1
  81. package/dist/chunk-SQURQUD2.js +0 -2
  82. package/dist/chunk-SQURQUD2.js.map +0 -1
  83. package/dist/chunk-V2AN2A7C.cjs +0 -2
  84. package/dist/chunk-V2AN2A7C.cjs.map +0 -1
  85. package/dist/chunk-VFQ5AO6A.cjs +0 -2
  86. package/dist/chunk-VFQ5AO6A.cjs.map +0 -1
  87. package/dist/chunk-X2F3KWSW.cjs +0 -2
  88. package/dist/chunk-X2F3KWSW.cjs.map +0 -1
  89. /package/dist/{chunk-3TOWLKUY.js.map → chunk-UHHMORLE.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- "use client";import{a as o}from"./chunk-VPYH6JWS.js";import{DotFilledIcon as a}from"@radix-ui/react-icons";import{OTPInput as i,OTPInputContext as l,REGEXP_ONLY_CHARS as v,REGEXP_ONLY_DIGITS as b,REGEXP_ONLY_DIGITS_AND_CHARS as N}from"input-otp";import{forwardRef as r,useContext as P}from"react";import{jsx as n,jsxs as d}from"react/jsx-runtime";var m=r(({className:t,containerClassName:e,...p},s)=>n(i,{ref:s,className:o("disabled:cursor-default",t),containerClassName:o("flex items-center gap-2","has-[:disabled]:opacity-50",e),...p}));m.displayName="InputOTP";var T=r(({className:t,...e},p)=>n("div",{ref:p,className:o("flex items-center",t),...e}));T.displayName="InputOTPGroup";var I=r(({index:t,className:e,...p},s)=>{let u=P(l).slots[t];return d("div",{ref:s,className:o("border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all","first:rounded-l-md first:border-l","last:rounded-r-md",u?.isActive&&"z-10 outline outline-2",e),...p,children:[u?.char,u?.hasFakeCaret?n("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n("div",{className:"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px"})}):null]})});I.displayName="InputOTPSlot";var O=r(({...t},e)=>n("div",{ref:e,role:"separator",...t,children:n(a,{})}));O.displayName="InputOTPSeparator";export{v as a,b,N as c,m as d,T as e,I as f,O as g};
2
- //# sourceMappingURL=chunk-UZ2CW6TS.js.map
1
+ "use client";import{a as o}from"./chunk-VPYH6JWS.js";import{DotFilledIcon as a}from"@radix-ui/react-icons";import{OTPInput as i,OTPInputContext as l,REGEXP_ONLY_CHARS as v,REGEXP_ONLY_DIGITS as b,REGEXP_ONLY_DIGITS_AND_CHARS as N}from"input-otp";import{forwardRef as r,useContext as P}from"react";import{jsx as n,jsxs as d}from"react/jsx-runtime";var m=r(({className:t,containerClassName:e,...p},s)=>n(i,{ref:s,className:o("disabled:cursor-default",t),containerClassName:o("flex items-center gap-2","has-[:disabled]:opacity-50",e),...p}));m.displayName="InputOTP";var T=r(({className:t,...e},p)=>n("div",{ref:p,className:o("flex items-center",t),...e}));T.displayName="InputOTPGroup";var I=r(({index:t,className:e,...p},s)=>{let u=P(l).slots[t];return d("div",{ref:s,className:o("border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all","first:rounded-l-md first:border-l","last:rounded-r-md",u.isActive&&"z-10 outline outline-2",e),...p,children:[u.char,u.hasFakeCaret?n("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n("div",{className:"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px"})}):null]})});I.displayName="InputOTPSlot";var O=r(({...t},e)=>n("div",{ref:e,role:"separator",...t,children:n(a,{})}));O.displayName="InputOTPSeparator";export{v as a,b,N as c,m as d,T as e,I as f,O as g};
2
+ //# sourceMappingURL=chunk-BHLW3MWI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/input-otp.tsx"],"names":["DotFilledIcon","OTPInput","OTPInputContext","REGEXP_ONLY_CHARS","REGEXP_ONLY_DIGITS","REGEXP_ONLY_DIGITS_AND_CHARS","forwardRef","useContext","jsx","jsxs","InputOTP","className","containerClassName","props","forwardedRef","cn","InputOTPGroup","InputOTPSlot","index","slot","InputOTPSeparator"],"mappings":"wCAEA,OAAS,iBAAAA,MAAqB,wBAC9B,OACE,YAAAC,EACA,mBAAAC,EACA,qBAAAC,EACA,sBAAAC,EACA,gCAAAC,MACK,YACP,OAA2D,cAAAC,EAAiC,cAAAC,MAAkB,QAa1G,cAAAC,EAwCE,QAAAC,MAxCF,oBAFJ,IAAMC,EAAWJ,EACf,CAAC,CAAE,UAAAK,EAAW,mBAAAC,EAAoB,GAAGC,CAAM,EAAGC,IAC5CN,EAACP,EAAA,CACC,IAAKa,EACL,UAAWC,EAAG,0BAA2BJ,CAAS,EAClD,mBAAoBI,EAAG,0BAA2B,6BAA8BH,CAAkB,EACjG,GAAGC,EACN,CAEJ,EAEAH,EAAS,YAAc,WASvB,IAAMM,EAAgBV,EAAqD,CAAC,CAAE,UAAAK,EAAW,GAAGE,CAAM,EAAGC,IACnGN,EAAC,OAAI,IAAKM,EAAc,UAAWC,EAAG,oBAAqBJ,CAAS,EAAI,GAAGE,EAAO,CACnF,EAEDG,EAAc,YAAc,gBAY5B,IAAMC,EAAeX,EACnB,CAAC,CAAE,MAAAY,EAAO,UAAAP,EAAW,GAAGE,CAAM,EAAGC,IAAiB,CAEhD,IAAMK,EADkBZ,EAAWL,CAAe,EACrB,MAAMgB,CAAK,EAExC,OACET,EAAC,OACC,IAAKK,EACL,UAAWC,EACT,oHACA,oCACA,oBACAI,GAAM,UAAY,yBAClBR,CACF,EACC,GAAGE,EAEH,UAAAM,GAAM,KACNA,GAAM,aACLX,EAAC,OAAI,UAAU,wEACb,SAAAA,EAAC,OAAI,UAAU,mEAAmE,EACpF,EACE,MACN,CAEJ,CACF,EAEAS,EAAa,YAAc,eAS3B,IAAMG,EAAoBd,EAA6D,CAAC,CAAE,GAAGO,CAAM,EAAGC,IACpGN,EAAC,OAAI,IAAKM,EAAc,KAAK,YAAa,GAAGD,EAC3C,SAAAL,EAACR,EAAA,EAAc,EACjB,CACD,EAEDoB,EAAkB,YAAc","sourcesContent":["'use client';\n\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from 'input-otp';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPElement = ComponentRef<typeof OTPInput>;\ntype InputOTPProps = ComponentPropsWithoutRef<typeof OTPInput>;\n\nconst InputOTP = forwardRef<InputOTPElement, InputOTPProps>(\n ({ className, containerClassName, ...props }, forwardedRef) => (\n <OTPInput\n ref={forwardedRef}\n className={cn('disabled:cursor-default', className)}\n containerClassName={cn('flex items-center gap-2', 'has-[:disabled]:opacity-50', containerClassName)}\n {...props}\n />\n ),\n);\n\nInputOTP.displayName = 'InputOTP';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupElement = HTMLDivElement;\ntype InputOTPGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPGroup = forwardRef<InputOTPGroupElement, InputOTPGroupProps>(({ className, ...props }, forwardedRef) => (\n <div ref={forwardedRef} className={cn('flex items-center', className)} {...props} />\n));\n\nInputOTPGroup.displayName = 'InputOTPGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSlotElement = HTMLDivElement;\n\ninterface InputOTPSlotProps extends HTMLAttributes<HTMLDivElement> {\n index: number;\n}\n\nconst InputOTPSlot = forwardRef<InputOTPSlotElement, InputOTPSlotProps>(\n ({ index, className, ...props }, forwardedRef) => {\n const inputOTPContext = useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={forwardedRef}\n className={cn(\n 'border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all',\n 'first:rounded-l-md first:border-l',\n 'last:rounded-r-md',\n slot?.isActive && 'z-10 outline outline-2',\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nInputOTPSlot.displayName = 'InputOTPSlot';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorElement = HTMLDivElement;\ntype InputOTPSeparatorProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPSeparator = forwardRef<InputOTPSeparatorElement, InputOTPSeparatorProps>(({ ...props }, forwardedRef) => (\n <div ref={forwardedRef} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\n\nInputOTPSeparator.displayName = 'InputOTPSeparator';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n type InputOTPGroupProps,\n type InputOTPProps,\n type InputOTPSeparatorProps,\n type InputOTPSlotProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/components/input-otp.tsx"],"names":["DotFilledIcon","OTPInput","OTPInputContext","REGEXP_ONLY_CHARS","REGEXP_ONLY_DIGITS","REGEXP_ONLY_DIGITS_AND_CHARS","forwardRef","useContext","jsx","jsxs","InputOTP","className","containerClassName","props","forwardedRef","cn","InputOTPGroup","InputOTPSlot","index","slot","InputOTPSeparator"],"mappings":"wCAEA,OAAS,iBAAAA,MAAqB,wBAC9B,OACE,YAAAC,EACA,mBAAAC,EACA,qBAAAC,EACA,sBAAAC,EACA,gCAAAC,MACK,YACP,OAA2D,cAAAC,EAAiC,cAAAC,MAAkB,QAa1G,cAAAC,EAwCE,QAAAC,MAxCF,oBAFJ,IAAMC,EAAWJ,EACf,CAAC,CAAE,UAAAK,EAAW,mBAAAC,EAAoB,GAAGC,CAAM,EAAGC,IAC5CN,EAACP,EAAA,CACC,IAAKa,EACL,UAAWC,EAAG,0BAA2BJ,CAAS,EAClD,mBAAoBI,EAAG,0BAA2B,6BAA8BH,CAAkB,EACjG,GAAGC,EACN,CAEJ,EAEAH,EAAS,YAAc,WASvB,IAAMM,EAAgBV,EAAqD,CAAC,CAAE,UAAAK,EAAW,GAAGE,CAAM,EAAGC,IACnGN,EAAC,OAAI,IAAKM,EAAc,UAAWC,EAAG,oBAAqBJ,CAAS,EAAI,GAAGE,EAAO,CACnF,EAEDG,EAAc,YAAc,gBAY5B,IAAMC,EAAeX,EACnB,CAAC,CAAE,MAAAY,EAAO,UAAAP,EAAW,GAAGE,CAAM,EAAGC,IAAiB,CAEhD,IAAMK,EADkBZ,EAAWL,CAAe,EACrB,MAAMgB,CAAK,EAExC,OACET,EAAC,OACC,IAAKK,EACL,UAAWC,EACT,oHACA,oCACA,oBACAI,EAAK,UAAY,yBACjBR,CACF,EACC,GAAGE,EAEH,UAAAM,EAAK,KACLA,EAAK,aACJX,EAAC,OAAI,UAAU,wEACb,SAAAA,EAAC,OAAI,UAAU,mEAAmE,EACpF,EACE,MACN,CAEJ,CACF,EAEAS,EAAa,YAAc,eAS3B,IAAMG,EAAoBd,EAA6D,CAAC,CAAE,GAAGO,CAAM,EAAGC,IACpGN,EAAC,OAAI,IAAKM,EAAc,KAAK,YAAa,GAAGD,EAC3C,SAAAL,EAACR,EAAA,EAAc,EACjB,CACD,EAEDoB,EAAkB,YAAc","sourcesContent":["'use client';\n\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from 'input-otp';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPElement = ComponentRef<typeof OTPInput>;\ntype InputOTPProps = ComponentPropsWithoutRef<typeof OTPInput>;\n\nconst InputOTP = forwardRef<InputOTPElement, InputOTPProps>(\n ({ className, containerClassName, ...props }, forwardedRef) => (\n <OTPInput\n ref={forwardedRef}\n className={cn('disabled:cursor-default', className)}\n containerClassName={cn('flex items-center gap-2', 'has-[:disabled]:opacity-50', containerClassName)}\n {...props}\n />\n ),\n);\n\nInputOTP.displayName = 'InputOTP';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupElement = HTMLDivElement;\ntype InputOTPGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPGroup = forwardRef<InputOTPGroupElement, InputOTPGroupProps>(({ className, ...props }, forwardedRef) => (\n <div ref={forwardedRef} className={cn('flex items-center', className)} {...props} />\n));\n\nInputOTPGroup.displayName = 'InputOTPGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSlotElement = HTMLDivElement;\n\ninterface InputOTPSlotProps extends HTMLAttributes<HTMLDivElement> {\n index: number;\n}\n\nconst InputOTPSlot = forwardRef<InputOTPSlotElement, InputOTPSlotProps>(\n ({ index, className, ...props }, forwardedRef) => {\n const inputOTPContext = useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={forwardedRef}\n className={cn(\n 'border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all',\n 'first:rounded-l-md first:border-l',\n 'last:rounded-r-md',\n slot.isActive && 'z-10 outline outline-2',\n className,\n )}\n {...props}\n >\n {slot.char}\n {slot.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nInputOTPSlot.displayName = 'InputOTPSlot';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorElement = HTMLDivElement;\ntype InputOTPSeparatorProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPSeparator = forwardRef<InputOTPSeparatorElement, InputOTPSeparatorProps>(({ ...props }, forwardedRef) => (\n <div ref={forwardedRef} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\n\nInputOTPSeparator.displayName = 'InputOTPSeparator';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n type InputOTPGroupProps,\n type InputOTPProps,\n type InputOTPSeparatorProps,\n type InputOTPSlotProps,\n};\n"]}
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkQ62VKCH2cjs = require('./chunk-Q62VKCH2.cjs');var _chunkOKI5PENPcjs = require('./chunk-OKI5PENP.cjs');var _chunkD3EC6HWNcjs = require('./chunk-D3EC6HWN.cjs');var _chunkDIYHARQUcjs = require('./chunk-DIYHARQU.cjs');var _chunk5XCNTI3Xcjs = require('./chunk-5XCNTI3X.cjs');var _chunkFINPFQTZcjs = require('./chunk-FINPFQTZ.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _hooks = require('@codefast/hooks');var _reactslot = require('@radix-ui/react-slot');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _lucidereact = require('lucide-react');var _react = require('react');var _tailwindvariants = require('tailwind-variants');var _jsxruntime = require('react/jsx-runtime');var Q="sidebar:state",X=60*60*24*7,Y="16rem",J="18rem",Z="3rem",ee="b",te=768,O=_react.createContext.call(void 0, null);function M(){let t=_react.useContext.call(void 0, O);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}var ae=_react.forwardRef.call(void 0, ({defaultOpen:t=!0,open:e,onOpenChange:a,className:i,style:d,children:s,...c},S)=>{let p=_hooks.useMediaQuery.call(void 0, `(max-width: ${te-1}px)`),[m,b]=_react.useState.call(void 0, !1),[h,E]=_react.useState.call(void 0, t),g=_nullishCoalesce(e, () => (h)),x=_react.useCallback.call(void 0, l=>{let u=typeof l=="function"?l(g):l;a?a(u):E(u),document.cookie=`${Q}=${u}; path=/; max-age=${X}`},[a,g]),y=_react.useCallback.call(void 0, ()=>{p?b(l=>!l):x(l=>!l)},[p,x,b]);_react.useEffect.call(void 0, ()=>{let l=u=>{u.key===ee&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),y())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[y]);let C=g?"expanded":"collapsed",K=_react.useMemo.call(void 0, ()=>({state:C,open:g,setOpen:x,isMobile:p,openMobile:m,setOpenMobile:b,toggleSidebar:y}),[C,g,x,p,m,b,y]);return _jsxruntime.jsx.call(void 0, O.Provider,{value:K,children:_jsxruntime.jsx.call(void 0, _chunkQ62VKCH2cjs.a,{delayDuration:0,children:_jsxruntime.jsx.call(void 0, "div",{ref:S,className:_chunkDD6AVCRHcjs.a.call(void 0, "group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full",i),style:{"--sidebar-width":Y,"--sidebar-width-icon":Z,...d},...c,children:s})})})});ae.displayName="SidebarProvider";var re=_react.forwardRef.call(void 0, ({side:t="left",variant:e="sidebar",collapsible:a="offcanvas",className:i,children:d,...s},c)=>{let{isMobile:S,state:p,openMobile:m,setOpenMobile:b}=M();return a==="none"?_jsxruntime.jsx.call(void 0, "div",{ref:c,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col",i),...s,children:d}):S?_jsxruntime.jsx.call(void 0, _chunkDIYHARQUcjs.a,{open:m,onOpenChange:b,...s,children:_jsxruntime.jsxs.call(void 0, _chunkDIYHARQUcjs.c,{className:"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",side:t,style:{"--sidebar-width":J},children:[_jsxruntime.jsxs.call(void 0, _reactvisuallyhidden.VisuallyHidden,{children:[_jsxruntime.jsx.call(void 0, _chunkDIYHARQUcjs.g,{children:"Sidebar"}),_jsxruntime.jsx.call(void 0, _chunkDIYHARQUcjs.h,{children:"Press escape to close the sidebar"})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex h-full w-full flex-col",children:d})]})}):_jsxruntime.jsxs.call(void 0, "div",{ref:c,className:"text-sidebar-foreground group peer hidden md:block","data-collapsible":p==="collapsed"?a:"","data-side":t,"data-state":p,"data-variant":e,children:[_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...s,children:_jsxruntime.jsx.call(void 0, "div",{className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:d})})]})});re.displayName="Sidebar";var oe=_react.forwardRef.call(void 0, ({className:t,onClick:e,...a},i)=>{let{toggleSidebar:d}=M();return _jsxruntime.jsxs.call(void 0, _chunkFINPFQTZcjs.a,{ref:i,icon:!0,className:_chunkDD6AVCRHcjs.a.call(void 0, "",t),"data-sidebar":"trigger",size:"xxs",variant:"ghost",onClick:s=>{_optionalChain([e, 'optionalCall', _2 => _2(s)]),d()},...a,children:[_jsxruntime.jsx.call(void 0, _lucidereact.PanelLeftIcon,{}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Toggle Sidebar"})]})});oe.displayName="SidebarTrigger";var ne=_react.forwardRef.call(void 0, ({className:t,...e},a)=>{let{toggleSidebar:i}=M();return _jsxruntime.jsx.call(void 0, "button",{ref:a,"aria-label":"Toggle Sidebar",className:_chunkDD6AVCRHcjs.a.call(void 0, "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:i,...e})});ne.displayName="SidebarRail";var ie=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "main",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-background relative flex min-h-svh flex-1 flex-col","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));ie.displayName="SidebarInset";var de=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, _chunkOKI5PENPcjs.a,{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",t),"data-sidebar":"input",...e}));de.displayName="SidebarInput";var se=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-col gap-2 p-2",t),"data-sidebar":"header",...e}));se.displayName="SidebarHeader";var le=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-col gap-2 p-2",t),"data-sidebar":"footer",...e}));le.displayName="SidebarFooter";var pe=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, _chunkD3EC6HWNcjs.a,{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-sidebar-border mx-2 w-auto",t),"data-sidebar":"separator",...e}));pe.displayName="SidebarSeparator";var be=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),"data-sidebar":"content",...e}));be.displayName="SidebarContent";var ue=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "relative flex w-full min-w-0 flex-col p-2",t),"data-sidebar":"group",...e}));ue.displayName="SidebarGroup";var ce=_react.forwardRef.call(void 0, ({className:t,asChild:e=!1,...a},i)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"div",{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),"data-sidebar":"group-label",...a}));ce.displayName="SidebarGroupLabel";var me=_react.forwardRef.call(void 0, ({className:t,asChild:e=!1,...a},i)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"button",{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"group-action",...a}));me.displayName="SidebarGroupAction";var fe=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "w-full text-sm",t),"data-sidebar":"group-content",...e}));fe.displayName="SidebarGroupContent";var Se=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "ul",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex w-full min-w-0 flex-col gap-1",t),"data-sidebar":"menu",...e}));Se.displayName="SidebarMenu";var ge=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "li",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "group/menu-item relative",t),"data-sidebar":"menu-item",...e}));ge.displayName="SidebarMenuItem";var ve=_tailwindvariants.tv.call(void 0, {base:"peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),he= exports.r =_react.forwardRef.call(void 0, ({asChild:t=!1,isActive:e=!1,variant:a="default",size:i="default",tooltip:d,className:s,...c},S)=>{let p=t?_reactslot.Slot:"button",{isMobile:m,state:b}=M(),h=_jsxruntime.jsx.call(void 0, p,{ref:S,className:_chunkDD6AVCRHcjs.a.call(void 0, ve({variant:a,size:i}),s),"data-active":e,"data-sidebar":"menu-button","data-size":i,...c});return d?_jsxruntime.jsxs.call(void 0, _chunkQ62VKCH2cjs.b,{children:[_jsxruntime.jsx.call(void 0, _chunkQ62VKCH2cjs.c,{asChild:!0,children:h}),_jsxruntime.jsx.call(void 0, _chunkQ62VKCH2cjs.d,{align:"center",hidden:b!=="collapsed"||m,side:"right",...typeof d=="string"?{children:d}:d})]}):h});he.displayName="SidebarMenuButton";var xe=_react.forwardRef.call(void 0, ({className:t,asChild:e=!1,showOnHover:a=!1,...i},d)=>_jsxruntime.jsx.call(void 0, e?_reactslot.Slot:"button",{ref:d,className:_chunkDD6AVCRHcjs.a.call(void 0, "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),"data-sidebar":"menu-action",...i}));xe.displayName="SidebarMenuAction";var ye=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-badge",...e}));ye.displayName="SidebarMenuBadge";var Me=_react.forwardRef.call(void 0, ({className:t,showIcon:e=!1,...a},i)=>{let d=_react.useMemo.call(void 0, ()=>`${Math.floor(Math.random()*40)+50}%`,[]);return _jsxruntime.jsxs.call(void 0, "div",{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex h-8 items-center gap-2 rounded-md px-2",t),"data-sidebar":"menu-skeleton",...a,children:[e?_jsxruntime.jsx.call(void 0, _chunk5XCNTI3Xcjs.a,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}):null,_jsxruntime.jsx.call(void 0, _chunk5XCNTI3Xcjs.a,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":d}})]})});Me.displayName="SidebarMenuSkeleton";var Pe=_react.forwardRef.call(void 0, ({className:t,...e},a)=>_jsxruntime.jsx.call(void 0, "ul",{ref:a,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-sub",...e}));Pe.displayName="SidebarMenuSub";var Ee=_react.forwardRef.call(void 0, ({...t},e)=>_jsxruntime.jsx.call(void 0, "li",{ref:e,...t}));Ee.displayName="SidebarMenuSubItem";var Ce=_react.forwardRef.call(void 0, ({asChild:t=!1,size:e="md",isActive:a,className:i,...d},s)=>_jsxruntime.jsx.call(void 0, t?_reactslot.Slot:"a",{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),"data-active":a,"data-sidebar":"menu-sub-button","data-size":e,...d}));Ce.displayName="SidebarMenuSubButton";exports.a = M; exports.b = ae; exports.c = re; exports.d = oe; exports.e = ne; exports.f = ie; exports.g = de; exports.h = se; exports.i = le; exports.j = pe; exports.k = be; exports.l = ue; exports.m = ce; exports.n = me; exports.o = fe; exports.p = Se; exports.q = ge; exports.r = he; exports.s = xe; exports.t = ye; exports.u = Me; exports.v = Pe; exports.w = Ee; exports.x = Ce;
2
- //# sourceMappingURL=chunk-VA36YONO.cjs.map
2
+ //# sourceMappingURL=chunk-E2QRPDUI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-VA36YONO.cjs","../src/components/sidebar.tsx"],"names":["SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SidebarContext","createContext","useSidebar","SidebarProvider","defaultOpen","setOpenProp","className","children","isMobile","useMediaQuery","openMobile","useState","isOpen","setI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AAA,CAErBD,CAAAA,CAAUM,CAAS,CAAA,CAIrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,QAA+B,CAAA,MAAa,CAAA,CAAA,EAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-VA36YONO.cjs","sourcesContent":[null,"'use client';\n\nimport { useMediaQuery } from '@codefast/hooks';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { PanelLeftIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type CSSProperties,\n type ComponentRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { Button } from '@/components/button';\nimport { Separator } from '@/components/separator';\nimport { Sheet, SheetContent, SheetDescription, SheetTitle } from '@/components/sheet';\nimport { Skeleton } from '@/components/skeleton';\nimport { TextInput } from '@/components/text-input';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar:state';\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = '16rem';\nconst SIDEBAR_WIDTH_MOBILE = '18rem';\nconst SIDEBAR_WIDTH_ICON = '3rem';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\nconst SIDEBAR_MOBILE_BREAKPOINT = 768;\n\ninterface SidebarContext {\n isMobile: boolean;\n open: boolean;\n openMobile: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: 'expanded' | 'collapsed';\n toggleSidebar: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nfunction useSidebar(): SidebarContext {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarProvider\n * -------------------------------------------------------------------------- */\n\ntype SidebarProviderElement = HTMLDivElement;\ninterface SidebarProviderProps extends ComponentProps<'div'> {\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\nconst SidebarProvider = forwardRef<SidebarProviderElement, SidebarProviderProps>(\n ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${SIDEBAR_MOBILE_BREAKPOINT - 1}px)`);\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const open = openProp ?? isOpen;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setIsOpen(openState);\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n isMobile ? setOpenMobile((currentValue) => !currentValue) : setOpen((currentValue) => !currentValue);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n ref={ref}\n className={cn(\n 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full',\n className,\n )}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n },\n);\n\nSidebarProvider.displayName = 'SidebarProvider';\n\n/* -----------------------------------------------------------------------------\n * Component: Sidebar\n * -------------------------------------------------------------------------- */\n\ntype SidebarElement = HTMLDivElement;\ninterface SidebarProps extends ComponentProps<'div'> {\n collapsible?: 'offcanvas' | 'icon' | 'none';\n side?: 'left' | 'right';\n variant?: 'sidebar' | 'floating' | 'inset';\n}\n\nconst Sidebar = forwardRef<SidebarElement, SidebarProps>(\n ({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n ref={ref}\n className={cn('bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n className=\"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden\"\n data-mobile=\"true\"\n data-sidebar=\"sidebar\"\n side={side}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as CSSProperties\n }\n >\n <VisuallyHidden>\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Press escape to close the sidebar</SheetDescription>\n </VisuallyHidden>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n ref={ref}\n className=\"text-sidebar-foreground group peer hidden md:block\"\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-side={side}\n data-state={state}\n data-variant={variant}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n 'relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow\"\n data-sidebar=\"sidebar\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n },\n);\n\nSidebar.displayName = 'Sidebar';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarTrigger\n * -------------------------------------------------------------------------- */\n\ntype SidebarTriggerElement = ComponentRef<typeof Button>;\ntype SidebarTriggerProps = ComponentProps<typeof Button>;\n\nconst SidebarTrigger = forwardRef<SidebarTriggerElement, SidebarTriggerProps>(\n ({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n ref={ref}\n icon\n className={cn('', className)}\n data-sidebar=\"trigger\"\n size=\"xxs\"\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n },\n);\n\nSidebarTrigger.displayName = 'SidebarTrigger';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarRail\n * -------------------------------------------------------------------------- */\n\ntype SidebarRailElement = HTMLButtonElement;\ntype SidebarRailProps = ComponentProps<'button'>;\n\nconst SidebarRail = forwardRef<SidebarRailElement, SidebarRailProps>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n ref={ref}\n aria-label=\"Toggle Sidebar\"\n className={cn(\n 'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',\n '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className,\n )}\n data-sidebar=\"rail\"\n tabIndex={-1}\n title=\"Toggle Sidebar\"\n type=\"button\"\n onClick={toggleSidebar}\n {...props}\n />\n );\n});\n\nSidebarRail.displayName = 'SidebarRail';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInset\n * -------------------------------------------------------------------------- */\n\ntype SidebarInsetElement = HTMLDivElement;\ntype SidebarInsetProps = ComponentProps<'main'>;\n\nconst SidebarInset = forwardRef<SidebarInsetElement, SidebarInsetProps>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n 'bg-background relative flex min-h-svh flex-1 flex-col',\n 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow',\n className,\n )}\n {...props}\n />\n );\n});\n\nSidebarInset.displayName = 'SidebarInset';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInput\n * -------------------------------------------------------------------------- */\n\ntype SidebarInputElement = ComponentRef<typeof TextInput>;\ntype SidebarInputProps = ComponentProps<typeof TextInput>;\n\nconst SidebarInput = forwardRef<SidebarInputElement, SidebarInputProps>(({ className, ...props }, ref) => {\n return (\n <TextInput\n ref={ref}\n className={cn(\n 'bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2',\n className,\n )}\n data-sidebar=\"input\"\n {...props}\n />\n );\n});\n\nSidebarInput.displayName = 'SidebarInput';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarHeader\n * -------------------------------------------------------------------------- */\n\ntype SidebarHeaderElement = HTMLDivElement;\ntype SidebarHeaderProps = ComponentProps<'div'>;\n\nconst SidebarHeader = forwardRef<SidebarHeaderElement, SidebarHeaderProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"header\" {...props} />;\n});\n\nSidebarHeader.displayName = 'SidebarHeader';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarFooter\n * -------------------------------------------------------------------------- */\n\ntype SidebarFooterElement = HTMLDivElement;\ntype SidebarFooterProps = ComponentProps<'div'>;\n\nconst SidebarFooter = forwardRef<SidebarFooterElement, SidebarFooterProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"footer\" {...props} />;\n});\n\nSidebarFooter.displayName = 'SidebarFooter';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarSeparator\n * -------------------------------------------------------------------------- */\n\ntype SidebarSeparatorElement = ComponentRef<typeof Separator>;\ntype SidebarSeparatorProps = ComponentProps<typeof Separator>;\n\nconst SidebarSeparator = forwardRef<SidebarSeparatorElement, SidebarSeparatorProps>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n className={cn('bg-sidebar-border mx-2 w-auto', className)}\n data-sidebar=\"separator\"\n {...props}\n />\n );\n});\n\nSidebarSeparator.displayName = 'SidebarSeparator';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarContentElement = HTMLDivElement;\ntype SidebarContentProps = ComponentProps<'div'>;\n\nconst SidebarContent = forwardRef<SidebarContentElement, SidebarContentProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className,\n )}\n data-sidebar=\"content\"\n {...props}\n />\n );\n});\n\nSidebarContent.displayName = 'SidebarContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroup\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupElement = HTMLDivElement;\ntype SidebarGroupProps = ComponentProps<'div'>;\n\nconst SidebarGroup = forwardRef<SidebarGroupElement, SidebarGroupProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('relative flex w-full min-w-0 flex-col p-2', className)}\n data-sidebar=\"group\"\n {...props}\n />\n );\n});\n\nSidebarGroup.displayName = 'SidebarGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupLabel\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupLabelElement = HTMLDivElement;\ninterface SidebarGroupLabelProps extends ComponentProps<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = forwardRef<SidebarGroupLabelElement, SidebarGroupLabelProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',\n className,\n )}\n data-sidebar=\"group-label\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupLabel.displayName = 'SidebarGroupLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupActionElement = HTMLButtonElement;\ninterface SidebarGroupActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupAction = forwardRef<SidebarGroupActionElement, SidebarGroupActionProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"group-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupAction.displayName = 'SidebarGroupAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupContentElement = HTMLDivElement;\ntype SidebarGroupContentProps = ComponentProps<'div'>;\n\nconst SidebarGroupContent = forwardRef<SidebarGroupContentElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('w-full text-sm', className)} data-sidebar=\"group-content\" {...props} />\n ),\n);\n\nSidebarGroupContent.displayName = 'SidebarGroupContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenu\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuElement = HTMLUListElement;\ntype SidebarMenuProps = ComponentProps<'ul'>;\n\nconst SidebarMenu = forwardRef<SidebarMenuElement, SidebarMenuProps>(({ className, ...props }, ref) => (\n <ul ref={ref} className={cn('flex w-full min-w-0 flex-col gap-1', className)} data-sidebar=\"menu\" {...props} />\n));\n\nSidebarMenu.displayName = 'SidebarMenu';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuItemElement = HTMLLIElement;\ntype SidebarMenuItemProps = ComponentProps<'li'>;\n\nconst SidebarMenuItem = forwardRef<SidebarMenuItemElement, SidebarMenuItemProps>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn('group/menu-item relative', className)} data-sidebar=\"menu-item\" {...props} />\n));\n\nSidebarMenuItem.displayName = 'SidebarMenuItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuButton\n * -------------------------------------------------------------------------- */\n\nconst sidebarMenuButtonVariants = tv({\n base: 'peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',\n },\n size: {\n default: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype SidebarMenuButtonElement = HTMLButtonElement;\ninterface SidebarMenuButtonProps extends ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | ComponentProps<typeof TooltipContent>;\n}\n\nconst SidebarMenuButton = forwardRef<SidebarMenuButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n ref={ref}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n data-active={isActive}\n data-sidebar=\"menu-button\"\n data-size={size}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n const tooltipProps =\n typeof tooltip === 'string'\n ? {\n children: tooltip,\n }\n : tooltip;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent align=\"center\" hidden={state !== 'collapsed' || isMobile} side=\"right\" {...tooltipProps} />\n </Tooltip>\n );\n },\n);\n\nSidebarMenuButton.displayName = 'SidebarMenuButton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuActionElement = HTMLButtonElement;\ninterface SidebarMenuActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n showOnHover?: boolean;\n}\nconst SidebarMenuAction = forwardRef<SidebarMenuActionElement, SidebarMenuActionProps>(\n ({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n showOnHover &&\n 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',\n className,\n )}\n data-sidebar=\"menu-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarMenuAction.displayName = 'SidebarMenuAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuBadge\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuBadgeElement = HTMLDivElement;\ntype SidebarMenuBadgeProps = ComponentProps<'div'>;\nconst SidebarMenuBadge = forwardRef<SidebarMenuBadgeElement, SidebarMenuBadgeProps>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums',\n 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-badge\"\n {...props}\n />\n));\n\nSidebarMenuBadge.displayName = 'SidebarMenuBadge';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSkeleton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSkeletonElement = HTMLDivElement;\ninterface SidebarMenuSkeletonProps extends ComponentProps<'div'> {\n showIcon?: boolean;\n}\nconst SidebarMenuSkeleton = forwardRef<SidebarMenuSkeletonElement, SidebarMenuSkeletonProps>(\n ({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n ref={ref}\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n data-sidebar=\"menu-skeleton\"\n {...props}\n >\n {showIcon ? <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" /> : null}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width,\n } as CSSProperties\n }\n />\n </div>\n );\n },\n);\n\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSub\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubElement = HTMLUListElement;\ntype SidebarMenuSubProps = ComponentProps<'ul'>;\nconst SidebarMenuSub = forwardRef<SidebarMenuSubElement, SidebarMenuSubProps>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n 'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-sub\"\n {...props}\n />\n));\n\nSidebarMenuSub.displayName = 'SidebarMenuSub';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubItemElement = HTMLLIElement;\ntype SidebarMenuSubItemProps = ComponentProps<'li'>;\nconst SidebarMenuSubItem = forwardRef<SidebarMenuSubItemElement, SidebarMenuSubItemProps>(({ ...props }, ref) => (\n <li ref={ref} {...props} />\n));\n\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubButton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubButtonElement = HTMLAnchorElement;\ninterface SidebarMenuSubButtonProps extends ComponentProps<'a'> {\n asChild?: boolean;\n isActive?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst SidebarMenuSubButton = forwardRef<SidebarMenuSubButtonElement, SidebarMenuSubButtonProps>(\n ({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-active={isActive}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n {...props}\n />\n );\n },\n);\n\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n"]}
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-E2QRPDUI.cjs","../src/components/sidebar.tsx"],"names":["SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SidebarContext","createContext","useSidebar","SidebarProvider","defaultOpen","setOpenProp","className","children","isMobile","useMediaQuery","openMobile","useState","isOpen","setIsOpen","open","openProp","setOpen","useCallback","value","openState"],"mappings":"AAAA,6rBAAY,CAAC,wDAA6D,wDAAyC,wDAAyC,wDAA8D,wDAAyC,wDAAyC,wDCEnS,wCACA,iDACA,sEACA,2CAIP,8BASO,qDAqHC,+CA3GkB,IAAA,CAAA,CAAA,eACkB,CACxCA,CAAAA,CAAgB,EAAA,CAAA,EAAA,CAAA,EAChBC,CAAAA,CAAuB,CAAA,CAAA,CAAA,OACF,CAAA,CAAA,CAAA,OACO,CAAA,CAAA,CAAA,MACA,CAAA,EAY5BC,CAAiBC,GAAqC,CAAA,EAAI,CAAA,GAEhE,CAAA,CAAA,CAAA,kCAAA,IAASC,CAA6B,CACpC,SAAyC,CAAA,CAEzC,CAAA,CAAA,IACE,CAAA,CAAA,+BAAA,CAAA,CAAM,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,MAAM,IAAA,KAAA,CAAA,mDAiBpB,CAAA,CAAMC,OACD,CAAA,CAAA,IAAA,EAAA,CAAA,+BAAA,CAAAC,CAAAA,WAAoC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAcC,YAAaC,CAAAA,CAAW,CAAA,SAAO,CAAA,CAAA,CAAA,KAAAC,CAAU,CAAA,CAAA,QAAoB,CAChH,CAAA,CAAA,GAAMC,CAAWC,CAAAA,CAAc,CAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA,kCAAA,CAAA,YACzB,EAACC,EAAyB,CAAA,CAAIC,CAAAA,GAAc,CAAA,CAI5C,CAACC,CAAAA,CAAQC,CAAS,CAAA,CAAIF,CAAAA,6BAASP,CAAW,CAC1CU,CAAAA,CAAOC,CAAAA,CAAAA,CAAYH,CAAAA,CACnBI,CAAAA,6BAAUC,CACbC,CAAAA,CAAAA,CAAmD,kBAClD,CAAA,SAAA,GAAMC,CAAAA,CAAY,CAAA,gCAAA,CAAA,EAAA,CAAOD,IAAU,CAAA,CAAA,OAAA,CAAaA,EAAMJ,UAG/B,CAAA,CAErBD,CAAAA,CAAUM,CAAS,CAAA,CAIrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,QAA+B,CAAA,MAAa,CAAA,CAAA,EAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-E2QRPDUI.cjs","sourcesContent":[null,"'use client';\n\nimport { useMediaQuery } from '@codefast/hooks';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { PanelLeftIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n type ComponentRef,\n createContext,\n type CSSProperties,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { Button } from '@/components/button';\nimport { Separator } from '@/components/separator';\nimport { Sheet, SheetContent, SheetDescription, SheetTitle } from '@/components/sheet';\nimport { Skeleton } from '@/components/skeleton';\nimport { TextInput } from '@/components/text-input';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar:state';\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = '16rem';\nconst SIDEBAR_WIDTH_MOBILE = '18rem';\nconst SIDEBAR_WIDTH_ICON = '3rem';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\nconst SIDEBAR_MOBILE_BREAKPOINT = 768;\n\ninterface SidebarContext {\n isMobile: boolean;\n open: boolean;\n openMobile: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: 'expanded' | 'collapsed';\n toggleSidebar: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nfunction useSidebar(): SidebarContext {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarProvider\n * -------------------------------------------------------------------------- */\n\ntype SidebarProviderElement = HTMLDivElement;\ninterface SidebarProviderProps extends ComponentProps<'div'> {\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\nconst SidebarProvider = forwardRef<SidebarProviderElement, SidebarProviderProps>(\n ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${SIDEBAR_MOBILE_BREAKPOINT - 1}px)`);\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const open = openProp ?? isOpen;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setIsOpen(openState);\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n isMobile ? setOpenMobile((currentValue) => !currentValue) : setOpen((currentValue) => !currentValue);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n ref={ref}\n className={cn(\n 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full',\n className,\n )}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n },\n);\n\nSidebarProvider.displayName = 'SidebarProvider';\n\n/* -----------------------------------------------------------------------------\n * Component: Sidebar\n * -------------------------------------------------------------------------- */\n\ntype SidebarElement = HTMLDivElement;\ninterface SidebarProps extends ComponentProps<'div'> {\n collapsible?: 'offcanvas' | 'icon' | 'none';\n side?: 'left' | 'right';\n variant?: 'sidebar' | 'floating' | 'inset';\n}\n\nconst Sidebar = forwardRef<SidebarElement, SidebarProps>(\n ({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n ref={ref}\n className={cn('bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n className=\"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden\"\n data-mobile=\"true\"\n data-sidebar=\"sidebar\"\n side={side}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as CSSProperties\n }\n >\n <VisuallyHidden>\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Press escape to close the sidebar</SheetDescription>\n </VisuallyHidden>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n ref={ref}\n className=\"text-sidebar-foreground group peer hidden md:block\"\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-side={side}\n data-state={state}\n data-variant={variant}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n 'relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow\"\n data-sidebar=\"sidebar\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n },\n);\n\nSidebar.displayName = 'Sidebar';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarTrigger\n * -------------------------------------------------------------------------- */\n\ntype SidebarTriggerElement = ComponentRef<typeof Button>;\ntype SidebarTriggerProps = ComponentProps<typeof Button>;\n\nconst SidebarTrigger = forwardRef<SidebarTriggerElement, SidebarTriggerProps>(\n ({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n ref={ref}\n icon\n className={cn('', className)}\n data-sidebar=\"trigger\"\n size=\"xxs\"\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n },\n);\n\nSidebarTrigger.displayName = 'SidebarTrigger';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarRail\n * -------------------------------------------------------------------------- */\n\ntype SidebarRailElement = HTMLButtonElement;\ntype SidebarRailProps = ComponentProps<'button'>;\n\nconst SidebarRail = forwardRef<SidebarRailElement, SidebarRailProps>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n ref={ref}\n aria-label=\"Toggle Sidebar\"\n className={cn(\n 'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',\n '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className,\n )}\n data-sidebar=\"rail\"\n tabIndex={-1}\n title=\"Toggle Sidebar\"\n type=\"button\"\n onClick={toggleSidebar}\n {...props}\n />\n );\n});\n\nSidebarRail.displayName = 'SidebarRail';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInset\n * -------------------------------------------------------------------------- */\n\ntype SidebarInsetElement = HTMLDivElement;\ntype SidebarInsetProps = ComponentProps<'main'>;\n\nconst SidebarInset = forwardRef<SidebarInsetElement, SidebarInsetProps>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n 'bg-background relative flex min-h-svh flex-1 flex-col',\n 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow',\n className,\n )}\n {...props}\n />\n );\n});\n\nSidebarInset.displayName = 'SidebarInset';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInput\n * -------------------------------------------------------------------------- */\n\ntype SidebarInputElement = ComponentRef<typeof TextInput>;\ntype SidebarInputProps = ComponentProps<typeof TextInput>;\n\nconst SidebarInput = forwardRef<SidebarInputElement, SidebarInputProps>(({ className, ...props }, ref) => {\n return (\n <TextInput\n ref={ref}\n className={cn(\n 'bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2',\n className,\n )}\n data-sidebar=\"input\"\n {...props}\n />\n );\n});\n\nSidebarInput.displayName = 'SidebarInput';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarHeader\n * -------------------------------------------------------------------------- */\n\ntype SidebarHeaderElement = HTMLDivElement;\ntype SidebarHeaderProps = ComponentProps<'div'>;\n\nconst SidebarHeader = forwardRef<SidebarHeaderElement, SidebarHeaderProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"header\" {...props} />;\n});\n\nSidebarHeader.displayName = 'SidebarHeader';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarFooter\n * -------------------------------------------------------------------------- */\n\ntype SidebarFooterElement = HTMLDivElement;\ntype SidebarFooterProps = ComponentProps<'div'>;\n\nconst SidebarFooter = forwardRef<SidebarFooterElement, SidebarFooterProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"footer\" {...props} />;\n});\n\nSidebarFooter.displayName = 'SidebarFooter';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarSeparator\n * -------------------------------------------------------------------------- */\n\ntype SidebarSeparatorElement = ComponentRef<typeof Separator>;\ntype SidebarSeparatorProps = ComponentProps<typeof Separator>;\n\nconst SidebarSeparator = forwardRef<SidebarSeparatorElement, SidebarSeparatorProps>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n className={cn('bg-sidebar-border mx-2 w-auto', className)}\n data-sidebar=\"separator\"\n {...props}\n />\n );\n});\n\nSidebarSeparator.displayName = 'SidebarSeparator';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarContentElement = HTMLDivElement;\ntype SidebarContentProps = ComponentProps<'div'>;\n\nconst SidebarContent = forwardRef<SidebarContentElement, SidebarContentProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className,\n )}\n data-sidebar=\"content\"\n {...props}\n />\n );\n});\n\nSidebarContent.displayName = 'SidebarContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroup\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupElement = HTMLDivElement;\ntype SidebarGroupProps = ComponentProps<'div'>;\n\nconst SidebarGroup = forwardRef<SidebarGroupElement, SidebarGroupProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('relative flex w-full min-w-0 flex-col p-2', className)}\n data-sidebar=\"group\"\n {...props}\n />\n );\n});\n\nSidebarGroup.displayName = 'SidebarGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupLabel\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupLabelElement = HTMLDivElement;\ninterface SidebarGroupLabelProps extends ComponentProps<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = forwardRef<SidebarGroupLabelElement, SidebarGroupLabelProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',\n className,\n )}\n data-sidebar=\"group-label\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupLabel.displayName = 'SidebarGroupLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupActionElement = HTMLButtonElement;\ninterface SidebarGroupActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupAction = forwardRef<SidebarGroupActionElement, SidebarGroupActionProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"group-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupAction.displayName = 'SidebarGroupAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupContentElement = HTMLDivElement;\ntype SidebarGroupContentProps = ComponentProps<'div'>;\n\nconst SidebarGroupContent = forwardRef<SidebarGroupContentElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('w-full text-sm', className)} data-sidebar=\"group-content\" {...props} />\n ),\n);\n\nSidebarGroupContent.displayName = 'SidebarGroupContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenu\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuElement = HTMLUListElement;\ntype SidebarMenuProps = ComponentProps<'ul'>;\n\nconst SidebarMenu = forwardRef<SidebarMenuElement, SidebarMenuProps>(({ className, ...props }, ref) => (\n <ul ref={ref} className={cn('flex w-full min-w-0 flex-col gap-1', className)} data-sidebar=\"menu\" {...props} />\n));\n\nSidebarMenu.displayName = 'SidebarMenu';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuItemElement = HTMLLIElement;\ntype SidebarMenuItemProps = ComponentProps<'li'>;\n\nconst SidebarMenuItem = forwardRef<SidebarMenuItemElement, SidebarMenuItemProps>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn('group/menu-item relative', className)} data-sidebar=\"menu-item\" {...props} />\n));\n\nSidebarMenuItem.displayName = 'SidebarMenuItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuButton\n * -------------------------------------------------------------------------- */\n\nconst sidebarMenuButtonVariants = tv({\n base: 'peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',\n },\n size: {\n default: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype SidebarMenuButtonElement = HTMLButtonElement;\ninterface SidebarMenuButtonProps extends ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | ComponentProps<typeof TooltipContent>;\n}\n\nconst SidebarMenuButton = forwardRef<SidebarMenuButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n ref={ref}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n data-active={isActive}\n data-sidebar=\"menu-button\"\n data-size={size}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n const tooltipProps =\n typeof tooltip === 'string'\n ? {\n children: tooltip,\n }\n : tooltip;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent align=\"center\" hidden={state !== 'collapsed' || isMobile} side=\"right\" {...tooltipProps} />\n </Tooltip>\n );\n },\n);\n\nSidebarMenuButton.displayName = 'SidebarMenuButton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuActionElement = HTMLButtonElement;\ninterface SidebarMenuActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n showOnHover?: boolean;\n}\nconst SidebarMenuAction = forwardRef<SidebarMenuActionElement, SidebarMenuActionProps>(\n ({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n showOnHover &&\n 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',\n className,\n )}\n data-sidebar=\"menu-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarMenuAction.displayName = 'SidebarMenuAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuBadge\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuBadgeElement = HTMLDivElement;\ntype SidebarMenuBadgeProps = ComponentProps<'div'>;\nconst SidebarMenuBadge = forwardRef<SidebarMenuBadgeElement, SidebarMenuBadgeProps>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums',\n 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-badge\"\n {...props}\n />\n));\n\nSidebarMenuBadge.displayName = 'SidebarMenuBadge';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSkeleton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSkeletonElement = HTMLDivElement;\ninterface SidebarMenuSkeletonProps extends ComponentProps<'div'> {\n showIcon?: boolean;\n}\nconst SidebarMenuSkeleton = forwardRef<SidebarMenuSkeletonElement, SidebarMenuSkeletonProps>(\n ({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n ref={ref}\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n data-sidebar=\"menu-skeleton\"\n {...props}\n >\n {showIcon ? <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" /> : null}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width,\n } as CSSProperties\n }\n />\n </div>\n );\n },\n);\n\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSub\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubElement = HTMLUListElement;\ntype SidebarMenuSubProps = ComponentProps<'ul'>;\nconst SidebarMenuSub = forwardRef<SidebarMenuSubElement, SidebarMenuSubProps>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n 'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-sub\"\n {...props}\n />\n));\n\nSidebarMenuSub.displayName = 'SidebarMenuSub';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubItemElement = HTMLLIElement;\ntype SidebarMenuSubItemProps = ComponentProps<'li'>;\nconst SidebarMenuSubItem = forwardRef<SidebarMenuSubItemElement, SidebarMenuSubItemProps>(({ ...props }, ref) => (\n <li ref={ref} {...props} />\n));\n\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubButton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubButtonElement = HTMLAnchorElement;\ninterface SidebarMenuSubButtonProps extends ComponentProps<'a'> {\n asChild?: boolean;\n isActive?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst SidebarMenuSubButton = forwardRef<SidebarMenuSubButtonElement, SidebarMenuSubButtonProps>(\n ({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-active={isActive}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n {...props}\n />\n );\n },\n);\n\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _reactselect = require('@radix-ui/react-select'); var e = _interopRequireWildcard(_reactselect);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var x=e.Root,R= exports.b =e.Group,E= exports.c =e.Value,u= exports.d =_react.forwardRef.call(void 0, ({children:i,className:r,size:o,...p},n)=>_jsxruntime.jsxs.call(void 0, e.Trigger,{ref:n,className:_chunkKF7Y7B3Gcjs.a.call(void 0, {variant:"outline",size:o,className:["w-full justify-between px-3 font-normal [&>span]:truncate",r]}),...p,children:[i,_jsxruntime.jsx.call(void 0, e.Icon,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"size-4 shrink-0 opacity-50"})})]}));u.displayName=e.Trigger.displayName;var m=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.ScrollUpButton,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...r,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{})}));m.displayName=e.ScrollUpButton.displayName;var S=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.ScrollDownButton,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...r,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{})}));S.displayName=e.ScrollDownButton.displayName;var v=_react.forwardRef.call(void 0, ({children:i,className:r,position:o="popper",...p},n)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsxs.call(void 0, e.Content,{ref:n,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md","data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95","data-[state=open]:data-[side=bottom]:slide-in-from-top-2","data-[state=open]:data-[side=left]:slide-in-from-right-2","data-[state=open]:data-[side=right]:slide-in-from-left-2","data-[state=open]:data-[side=top]:slide-in-from-bottom-2","data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95","data-[state=closed]:data-[side=bottom]:slide-out-to-top-2","data-[state=closed]:data-[side=left]:slide-out-to-right-2","data-[state=closed]:data-[side=right]:slide-out-to-left-2","data-[state=closed]:data-[side=top]:slide-out-to-bottom-2",o==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1"],r),position:o,...p,children:[_jsxruntime.jsx.call(void 0, m,{}),_jsxruntime.jsx.call(void 0, e.Viewport,{className:_chunkDD6AVCRHcjs.a.call(void 0, "p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),_jsxruntime.jsx.call(void 0, S,{})]})}));v.displayName=e.Content.displayName;var g=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","flex items-center text-sm font-semibold",i),...r}));g.displayName=e.Label.displayName;var C=_react.forwardRef.call(void 0, ({children:i,className:r,...o},p)=>_jsxruntime.jsxs.call(void 0, e.Item,{ref:p,className:_chunkDD6AVCRHcjs.a.call(void 0, "relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r),...o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"size-4"})})}),_jsxruntime.jsx.call(void 0, e.ItemText,{children:i})]}));C.displayName=e.Item.displayName;var h=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-muted mx-2 my-1 h-px",i),...r}));h.displayName=e.Separator.displayName;exports.a = x; exports.b = R; exports.c = E; exports.d = u; exports.e = m; exports.f = S; exports.g = v; exports.h = g; exports.i = C; exports.j = h;
2
+ //# sourceMappingURL=chunk-EEDKRHHZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-EEDKRHHZ.cjs","../src/components/select.tsx"],"names":["Select","SelectGroup","SelectValue","SelectTrigger","forwardRef","children","className","size","props","forwardedRef","jsxs","buttonVariants","jsx","CaretSortIcon","SelectScrollUpButton","cn","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"],"mappings":"AAAA,mZAAwC,wDAAyC,mDCAR,oGACxC,8BACiE,+CAqC9F,IA3BEA,CAAAA,CAAyB,CAAA,CAAA,IAAA,CAOzBC,CAAAA,aAA8B,CAAA,CAAA,KAAA,CAO9BC,CAAAA,aAA8B,CAAA,CAAA,KAAA,CAW9BC,CAAAA,aAAgBC,+BAAAA,CACnB,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxCC,8BAAAA,CAAiB,CAAA,OAAA,CAAhB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,CACT,OAAA,CAAS,SAAA,CACT,IAAA,CAAAJ,CAAAA,CACA,SAAA,CAAW,CAAC,2DAAA,CAA6DD,CAAS,CACpF,CAAC,CAAA,CACA,GAAGE,CAAAA,CAEH,QAAA,CAAA,CAAAH,CAAAA,CACDO,6BAAAA,CAAiB,CAAA,IAAA,CAAhB,CAAqB,OAAA,CAAO,CAAA,CAAA,CAC3B,QAAA,CAAAA,6BAA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AAA,IAAA,CAAhB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWM,iCAAAA,+FACT,CACA,iEAAA,CACA,4DAAA,CACAT,CACF,CAAA,CACC,GAAGE,CAAAA,CAEJ,QAAA,CAAA,CAAAI,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,4DAAA,CACd,QAAA,CAAAA,6BAAAA,CAAiB,CAAA,aAAA,CAAhB,CACC,QAAA,CAAAA,6BAAAA,qBAACW,CAAA,CAAU,SAAA,CAAU,QAAA,CAAS,CAAA,CAChC,CAAA,CACF,CAAA,CACAX,6BAAAA,CAAiB,CAAA,QAAA,CAAhB,CAA0B,QAAA,CAAAP,CAAAA,CAAS,CAAA,CAAA,CACtC,CACD,CAAA,CAEDiB,CAAAA,CAAW,WAAA,CAA8B,CAAA,CAAA,IAAA,CAAK,WAAA,CAS9C,IAAME,CAAAA,CAAkBpB,+BAAAA,CACrB,CAAE,SAAA,CAAAE,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBG,6BAAAA,CAAiB,CAAA,SAAA,CAAhB,CAA0B,GAAA,CAAKH,CAAAA,CAAc,SAAA,CAAWM,iCAAAA,yBAAG,CAA2BT,CAAS,CAAA,CAAI,GAAGE,CAAAA,CAAO,CAElH,CAAA,CAEAgB,CAAAA,CAAgB,WAAA,CAA8B,CAAA,CAAA,SAAA,CAAU,WAAA,CAAA,qJAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-EEDKRHHZ.cjs","sourcesContent":[null,"import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type ComponentProps, type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = ComponentRef<typeof SelectPrimitive.Trigger>;\ninterface SelectTriggerProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n size?: ButtonVariantsProps['size'];\n}\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ children, className, size, ...props }, forwardedRef) => (\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n className={buttonVariants({\n variant: 'outline',\n size,\n className: ['w-full justify-between px-3 font-normal [&>span]:truncate', className],\n })}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 shrink-0 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n ),\n);\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = ComponentRef<typeof SelectPrimitive.ScrollUpButton>;\ntype SelectScrollUpButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;\n\nconst SelectScrollUpButton = forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollUpButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n ),\n);\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = ComponentRef<typeof SelectPrimitive.ScrollDownButton>;\ntype SelectScrollDownButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;\n\nconst SelectScrollDownButton = forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollDownButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n ),\n);\n\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = ComponentRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;\n\nconst SelectContent = forwardRef<SelectContentElement, SelectContentProps>(\n ({ children, className, position = 'popper', ...props }, forwardedRef) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n 'data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95',\n 'data-[state=open]:data-[side=bottom]:slide-in-from-top-2',\n 'data-[state=open]:data-[side=left]:slide-in-from-right-2',\n 'data-[state=open]:data-[side=right]:slide-in-from-left-2',\n 'data-[state=open]:data-[side=top]:slide-in-from-bottom-2',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:data-[side=bottom]:slide-out-to-top-2',\n 'data-[state=closed]:data-[side=left]:slide-out-to-right-2',\n 'data-[state=closed]:data-[side=right]:slide-out-to-left-2',\n 'data-[state=closed]:data-[side=top]:slide-out-to-bottom-2',\n position === 'popper' && [\n 'data-[side=bottom]:translate-y-1',\n 'data-[side=left]:-translate-x-1',\n 'data-[side=right]:translate-x-1',\n 'data-[side=top]:-translate-y-1',\n ],\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = ComponentRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\nconst SelectLabel = forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n ref={forwardedRef}\n className={cn('gap-x-2 px-3 py-1.5', 'flex items-center text-sm font-semibold', className)}\n {...props}\n />\n));\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = ComponentRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;\n\nconst SelectItem = forwardRef<SelectItemElement, SelectItemProps>(({ children, className, ...props }, forwardedRef) => (\n <SelectPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = ComponentRef<typeof SelectPrimitive.Separator>;\ntype SelectSeparatorProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;\n\nconst SelectSeparator = forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator ref={forwardedRef} className={cn('bg-muted mx-2 my-1 h-px', className)} {...props} />\n ),\n);\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n type SelectContentProps,\n type SelectGroupProps,\n type SelectItemProps,\n type SelectLabelProps,\n type SelectProps,\n type SelectScrollDownButtonProps,\n type SelectScrollUpButtonProps,\n type SelectSeparatorProps,\n type SelectTriggerProps,\n type SelectValueProps,\n};\n"]}
@@ -1,2 +1,2 @@
1
1
  "use client";import{a as _,b as k,c as A,d as D}from"./chunk-CTKVRKDK.js";import{a as H}from"./chunk-NPOAOTIH.js";import{a as N}from"./chunk-432ZMHFM.js";import{a as T,c as I,g as B,h as L}from"./chunk-MO7TQSRR.js";import{a as P}from"./chunk-NSTXYMJD.js";import{a as w}from"./chunk-24TJIVWR.js";import{a as o}from"./chunk-VPYH6JWS.js";import{useMediaQuery as V}from"@codefast/hooks";import{Slot as v}from"@radix-ui/react-slot";import{VisuallyHidden as F}from"@radix-ui/react-visually-hidden";import{PanelLeftIcon as $}from"lucide-react";import{createContext as U,forwardRef as n,useCallback as G,useContext as W,useEffect as j,useMemo as R,useState as z}from"react";import{tv as q}from"tailwind-variants";import{jsx as r,jsxs as f}from"react/jsx-runtime";var Q="sidebar:state",X=60*60*24*7,Y="16rem",J="18rem",Z="3rem",ee="b",te=768,O=U(null);function M(){let t=W(O);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}var ae=n(({defaultOpen:t=!0,open:e,onOpenChange:a,className:i,style:d,children:s,...c},S)=>{let p=V(`(max-width: ${te-1}px)`),[m,b]=z(!1),[h,E]=z(t),g=e??h,x=G(l=>{let u=typeof l=="function"?l(g):l;a?a(u):E(u),document.cookie=`${Q}=${u}; path=/; max-age=${X}`},[a,g]),y=G(()=>{p?b(l=>!l):x(l=>!l)},[p,x,b]);j(()=>{let l=u=>{u.key===ee&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),y())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[y]);let C=g?"expanded":"collapsed",K=R(()=>({state:C,open:g,setOpen:x,isMobile:p,openMobile:m,setOpenMobile:b,toggleSidebar:y}),[C,g,x,p,m,b,y]);return r(O.Provider,{value:K,children:r(_,{delayDuration:0,children:r("div",{ref:S,className:o("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full",i),style:{"--sidebar-width":Y,"--sidebar-width-icon":Z,...d},...c,children:s})})})});ae.displayName="SidebarProvider";var re=n(({side:t="left",variant:e="sidebar",collapsible:a="offcanvas",className:i,children:d,...s},c)=>{let{isMobile:S,state:p,openMobile:m,setOpenMobile:b}=M();return a==="none"?r("div",{ref:c,className:o("bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col",i),...s,children:d}):S?r(T,{open:m,onOpenChange:b,...s,children:f(I,{className:"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",side:t,style:{"--sidebar-width":J},children:[f(F,{children:[r(B,{children:"Sidebar"}),r(L,{children:"Press escape to close the sidebar"})]}),r("div",{className:"flex h-full w-full flex-col",children:d})]})}):f("div",{ref:c,className:"text-sidebar-foreground group peer hidden md:block","data-collapsible":p==="collapsed"?a:"","data-side":t,"data-state":p,"data-variant":e,children:[r("div",{className:o("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),r("div",{className:o("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...s,children:r("div",{className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:d})})]})});re.displayName="Sidebar";var oe=n(({className:t,onClick:e,...a},i)=>{let{toggleSidebar:d}=M();return f(w,{ref:i,icon:!0,className:o("",t),"data-sidebar":"trigger",size:"xxs",variant:"ghost",onClick:s=>{e?.(s),d()},...a,children:[r($,{}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]})});oe.displayName="SidebarTrigger";var ne=n(({className:t,...e},a)=>{let{toggleSidebar:i}=M();return r("button",{ref:a,"aria-label":"Toggle Sidebar",className:o("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:i,...e})});ne.displayName="SidebarRail";var ie=n(({className:t,...e},a)=>r("main",{ref:a,className:o("bg-background relative flex min-h-svh flex-1 flex-col","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));ie.displayName="SidebarInset";var de=n(({className:t,...e},a)=>r(H,{ref:a,className:o("bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",t),"data-sidebar":"input",...e}));de.displayName="SidebarInput";var se=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex flex-col gap-2 p-2",t),"data-sidebar":"header",...e}));se.displayName="SidebarHeader";var le=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex flex-col gap-2 p-2",t),"data-sidebar":"footer",...e}));le.displayName="SidebarFooter";var pe=n(({className:t,...e},a)=>r(N,{ref:a,className:o("bg-sidebar-border mx-2 w-auto",t),"data-sidebar":"separator",...e}));pe.displayName="SidebarSeparator";var be=n(({className:t,...e},a)=>r("div",{ref:a,className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),"data-sidebar":"content",...e}));be.displayName="SidebarContent";var ue=n(({className:t,...e},a)=>r("div",{ref:a,className:o("relative flex w-full min-w-0 flex-col p-2",t),"data-sidebar":"group",...e}));ue.displayName="SidebarGroup";var ce=n(({className:t,asChild:e=!1,...a},i)=>r(e?v:"div",{ref:i,className:o("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),"data-sidebar":"group-label",...a}));ce.displayName="SidebarGroupLabel";var me=n(({className:t,asChild:e=!1,...a},i)=>r(e?v:"button",{ref:i,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"group-action",...a}));me.displayName="SidebarGroupAction";var fe=n(({className:t,...e},a)=>r("div",{ref:a,className:o("w-full text-sm",t),"data-sidebar":"group-content",...e}));fe.displayName="SidebarGroupContent";var Se=n(({className:t,...e},a)=>r("ul",{ref:a,className:o("flex w-full min-w-0 flex-col gap-1",t),"data-sidebar":"menu",...e}));Se.displayName="SidebarMenu";var ge=n(({className:t,...e},a)=>r("li",{ref:a,className:o("group/menu-item relative",t),"data-sidebar":"menu-item",...e}));ge.displayName="SidebarMenuItem";var ve=q({base:"peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),he=n(({asChild:t=!1,isActive:e=!1,variant:a="default",size:i="default",tooltip:d,className:s,...c},S)=>{let p=t?v:"button",{isMobile:m,state:b}=M(),h=r(p,{ref:S,className:o(ve({variant:a,size:i}),s),"data-active":e,"data-sidebar":"menu-button","data-size":i,...c});return d?f(k,{children:[r(A,{asChild:!0,children:h}),r(D,{align:"center",hidden:b!=="collapsed"||m,side:"right",...typeof d=="string"?{children:d}:d})]}):h});he.displayName="SidebarMenuButton";var xe=n(({className:t,asChild:e=!1,showOnHover:a=!1,...i},d)=>r(e?v:"button",{ref:d,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),"data-sidebar":"menu-action",...i}));xe.displayName="SidebarMenuAction";var ye=n(({className:t,...e},a)=>r("div",{ref:a,className:o("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-badge",...e}));ye.displayName="SidebarMenuBadge";var Me=n(({className:t,showIcon:e=!1,...a},i)=>{let d=R(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return f("div",{ref:i,className:o("flex h-8 items-center gap-2 rounded-md px-2",t),"data-sidebar":"menu-skeleton",...a,children:[e?r(P,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}):null,r(P,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":d}})]})});Me.displayName="SidebarMenuSkeleton";var Pe=n(({className:t,...e},a)=>r("ul",{ref:a,className:o("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),"data-sidebar":"menu-sub",...e}));Pe.displayName="SidebarMenuSub";var Ee=n(({...t},e)=>r("li",{ref:e,...t}));Ee.displayName="SidebarMenuSubItem";var Ce=n(({asChild:t=!1,size:e="md",isActive:a,className:i,...d},s)=>r(t?v:"a",{ref:s,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),"data-active":a,"data-sidebar":"menu-sub-button","data-size":e,...d}));Ce.displayName="SidebarMenuSubButton";export{M as a,ae as b,re as c,oe as d,ne as e,ie as f,de as g,se as h,le as i,pe as j,be as k,ue as l,ce as m,me as n,fe as o,Se as p,ge as q,he as r,xe as s,ye as t,Me as u,Pe as v,Ee as w,Ce as x};
2
- //# sourceMappingURL=chunk-A5RTV4IE.js.map
2
+ //# sourceMappingURL=chunk-FSXJI6UE.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/sidebar.tsx"],"names":["useMediaQuery","Slot","VisuallyHidden","PanelLeftIcon","createContext","forwardRef","useCallback","useContext","useEffect","useMemo","useState","tv","jsx","jsxs","SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SIDEBAR_MOBILE_BREAKPOINT","SidebarContext","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","openMobile","setOpenMobile","isOpen","setIsOpen","open","setOpen","value","openState","toggleSidebar","currentValue","handleKeyDown","event","state","contextValue","TooltipProvider","cn","Sidebar","side","variant","collapsible","Sheet","SheetContent","SheetTitle","SheetDescription","SidebarTrigger","onClick","Button","SidebarRail","SidebarInset","SidebarInput","TextInput","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","SidebarGroupLabel","asChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariants","SidebarMenuButton","isActive","size","tooltip","Comp","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":"kUAEA,OAAS,iBAAAA,MAAqB,kBAC9B,OAAS,QAAAC,MAAY,uBACrB,OAAS,kBAAAC,MAAsB,kCAC/B,OAAS,iBAAAC,MAAqB,eAC9B,OAEE,iBAAAC,EAGA,cAAAC,EACA,eAAAC,EACA,cAAAC,EACA,aAAAC,EACA,WAAAC,EACA,YAAAC,MACK,QACP,OAAS,MAAAC,MAA6B,oBAqH5B,cAAAC,EAkEE,QAAAC,MAlEF,oBA3GV,IAAMC,EAAsB,gBACtBC,EAAyB,GAAK,GAAK,GAAK,EACxCC,EAAgB,QAChBC,EAAuB,QACvBC,EAAqB,OACrBC,GAA4B,IAC5BC,GAA4B,IAY5BC,EAAiBjB,EAAqC,IAAI,EAEhE,SAASkB,GAA6B,CACpC,IAAMC,EAAUhB,EAAWc,CAAc,EAEzC,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAaA,IAAMC,GAAkBnB,EACtB,CAAC,CAAE,YAAAoB,EAAc,GAAM,KAAMC,EAAU,aAAcC,EAAa,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CAChH,IAAMC,EAAWjC,EAAc,eAAeoB,GAA4B,CAAC,KAAK,EAC1E,CAACc,EAAYC,CAAa,EAAIzB,EAAS,EAAK,EAI5C,CAAC0B,EAAQC,CAAS,EAAI3B,EAASe,CAAW,EAC1Ca,EAAOZ,GAAYU,EACnBG,EAAUjC,EACbkC,GAAmD,CAClD,IAAMC,EAAY,OAAOD,GAAU,WAA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ACV,eAAa,qBACb,MACE,CACE,mBAAoBD,CACtB,EAEJ,GACF,CAEJ,CACF,EAEAF,GAAoB,YAAc,sBAQlC,IAAMI,GAAiBzF,EAAuD,CAAC,CAAE,UAAAuB,EAAW,GAAGG,CAAM,EAAGC,IACtGpB,EAAC,MACC,IAAKoB,EACL,UAAWiB,EACT,iGACA,uCACArB,CACF,EACA,eAAa,WACZ,GAAGG,EACN,CACD,EAED+D,GAAe,YAAc,iBAQ7B,IAAMC,GAAqB1F,EAA+D,CAAC,CAAE,GAAG0B,CAAM,EAAGC,IACvGpB,EAAC,MAAG,IAAKoB,EAAM,GAAGD,EAAO,CAC1B,EAEDgE,GAAmB,YAAc,qBAajC,IAAMC,GAAuB3F,EAC3B,CAAC,CAAE,QAAAmE,EAAU,GAAO,KAAAQ,EAAO,KAAM,SAAAD,EAAU,UAAAnD,EAAW,GAAGG,CAAM,EAAGC,IAI9DpB,EAHW4D,EAAUvE,EAAO,IAG3B,CACC,IAAK+B,EACL,UAAWiB,EACT,8eACA,yFACA+B,IAAS,MAAQ,UACjBA,IAAS,MAAQ,UACjB,uCACApD,CACF,EACA,cAAamD,EACb,eAAa,kBACb,YAAWC,EACV,GAAGjD,EACN,CAGN,EAEAiE,GAAqB,YAAc","sourcesContent":["'use client';\n\nimport { useMediaQuery } from '@codefast/hooks';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { PanelLeftIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type CSSProperties,\n type ComponentRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { Button } from '@/components/button';\nimport { Separator } from '@/components/separator';\nimport { Sheet, SheetContent, SheetDescription, SheetTitle } from '@/components/sheet';\nimport { Skeleton } from '@/components/skeleton';\nimport { TextInput } from '@/components/text-input';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar:state';\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = '16rem';\nconst SIDEBAR_WIDTH_MOBILE = '18rem';\nconst SIDEBAR_WIDTH_ICON = '3rem';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\nconst SIDEBAR_MOBILE_BREAKPOINT = 768;\n\ninterface SidebarContext {\n isMobile: boolean;\n open: boolean;\n openMobile: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: 'expanded' | 'collapsed';\n toggleSidebar: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nfunction useSidebar(): SidebarContext {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarProvider\n * -------------------------------------------------------------------------- */\n\ntype SidebarProviderElement = HTMLDivElement;\ninterface SidebarProviderProps extends ComponentProps<'div'> {\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\nconst SidebarProvider = forwardRef<SidebarProviderElement, SidebarProviderProps>(\n ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${SIDEBAR_MOBILE_BREAKPOINT - 1}px)`);\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const open = openProp ?? isOpen;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setIsOpen(openState);\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n isMobile ? setOpenMobile((currentValue) => !currentValue) : setOpen((currentValue) => !currentValue);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n ref={ref}\n className={cn(\n 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full',\n className,\n )}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n },\n);\n\nSidebarProvider.displayName = 'SidebarProvider';\n\n/* -----------------------------------------------------------------------------\n * Component: Sidebar\n * -------------------------------------------------------------------------- */\n\ntype SidebarElement = HTMLDivElement;\ninterface SidebarProps extends ComponentProps<'div'> {\n collapsible?: 'offcanvas' | 'icon' | 'none';\n side?: 'left' | 'right';\n variant?: 'sidebar' | 'floating' | 'inset';\n}\n\nconst Sidebar = forwardRef<SidebarElement, SidebarProps>(\n ({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n ref={ref}\n className={cn('bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n className=\"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden\"\n data-mobile=\"true\"\n data-sidebar=\"sidebar\"\n side={side}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as CSSProperties\n }\n >\n <VisuallyHidden>\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Press escape to close the sidebar</SheetDescription>\n </VisuallyHidden>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n ref={ref}\n className=\"text-sidebar-foreground group peer hidden md:block\"\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-side={side}\n data-state={state}\n data-variant={variant}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n 'relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow\"\n data-sidebar=\"sidebar\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n },\n);\n\nSidebar.displayName = 'Sidebar';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarTrigger\n * -------------------------------------------------------------------------- */\n\ntype SidebarTriggerElement = ComponentRef<typeof Button>;\ntype SidebarTriggerProps = ComponentProps<typeof Button>;\n\nconst SidebarTrigger = forwardRef<SidebarTriggerElement, SidebarTriggerProps>(\n ({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n ref={ref}\n icon\n className={cn('', className)}\n data-sidebar=\"trigger\"\n size=\"xxs\"\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n },\n);\n\nSidebarTrigger.displayName = 'SidebarTrigger';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarRail\n * -------------------------------------------------------------------------- */\n\ntype SidebarRailElement = HTMLButtonElement;\ntype SidebarRailProps = ComponentProps<'button'>;\n\nconst SidebarRail = forwardRef<SidebarRailElement, SidebarRailProps>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n ref={ref}\n aria-label=\"Toggle Sidebar\"\n className={cn(\n 'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',\n '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className,\n )}\n data-sidebar=\"rail\"\n tabIndex={-1}\n title=\"Toggle Sidebar\"\n type=\"button\"\n onClick={toggleSidebar}\n {...props}\n />\n );\n});\n\nSidebarRail.displayName = 'SidebarRail';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInset\n * -------------------------------------------------------------------------- */\n\ntype SidebarInsetElement = HTMLDivElement;\ntype SidebarInsetProps = ComponentProps<'main'>;\n\nconst SidebarInset = forwardRef<SidebarInsetElement, SidebarInsetProps>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n 'bg-background relative flex min-h-svh flex-1 flex-col',\n 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow',\n className,\n )}\n {...props}\n />\n );\n});\n\nSidebarInset.displayName = 'SidebarInset';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInput\n * -------------------------------------------------------------------------- */\n\ntype SidebarInputElement = ComponentRef<typeof TextInput>;\ntype SidebarInputProps = ComponentProps<typeof TextInput>;\n\nconst SidebarInput = forwardRef<SidebarInputElement, SidebarInputProps>(({ className, ...props }, ref) => {\n return (\n <TextInput\n ref={ref}\n className={cn(\n 'bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2',\n className,\n )}\n data-sidebar=\"input\"\n {...props}\n />\n );\n});\n\nSidebarInput.displayName = 'SidebarInput';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarHeader\n * -------------------------------------------------------------------------- */\n\ntype SidebarHeaderElement = HTMLDivElement;\ntype SidebarHeaderProps = ComponentProps<'div'>;\n\nconst SidebarHeader = forwardRef<SidebarHeaderElement, SidebarHeaderProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"header\" {...props} />;\n});\n\nSidebarHeader.displayName = 'SidebarHeader';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarFooter\n * -------------------------------------------------------------------------- */\n\ntype SidebarFooterElement = HTMLDivElement;\ntype SidebarFooterProps = ComponentProps<'div'>;\n\nconst SidebarFooter = forwardRef<SidebarFooterElement, SidebarFooterProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"footer\" {...props} />;\n});\n\nSidebarFooter.displayName = 'SidebarFooter';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarSeparator\n * -------------------------------------------------------------------------- */\n\ntype SidebarSeparatorElement = ComponentRef<typeof Separator>;\ntype SidebarSeparatorProps = ComponentProps<typeof Separator>;\n\nconst SidebarSeparator = forwardRef<SidebarSeparatorElement, SidebarSeparatorProps>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n className={cn('bg-sidebar-border mx-2 w-auto', className)}\n data-sidebar=\"separator\"\n {...props}\n />\n );\n});\n\nSidebarSeparator.displayName = 'SidebarSeparator';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarContentElement = HTMLDivElement;\ntype SidebarContentProps = ComponentProps<'div'>;\n\nconst SidebarContent = forwardRef<SidebarContentElement, SidebarContentProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className,\n )}\n data-sidebar=\"content\"\n {...props}\n />\n );\n});\n\nSidebarContent.displayName = 'SidebarContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroup\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupElement = HTMLDivElement;\ntype SidebarGroupProps = ComponentProps<'div'>;\n\nconst SidebarGroup = forwardRef<SidebarGroupElement, SidebarGroupProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('relative flex w-full min-w-0 flex-col p-2', className)}\n data-sidebar=\"group\"\n {...props}\n />\n );\n});\n\nSidebarGroup.displayName = 'SidebarGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupLabel\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupLabelElement = HTMLDivElement;\ninterface SidebarGroupLabelProps extends ComponentProps<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = forwardRef<SidebarGroupLabelElement, SidebarGroupLabelProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',\n className,\n )}\n data-sidebar=\"group-label\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupLabel.displayName = 'SidebarGroupLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupActionElement = HTMLButtonElement;\ninterface SidebarGroupActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupAction = forwardRef<SidebarGroupActionElement, SidebarGroupActionProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"group-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupAction.displayName = 'SidebarGroupAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupContentElement = HTMLDivElement;\ntype SidebarGroupContentProps = ComponentProps<'div'>;\n\nconst SidebarGroupContent = forwardRef<SidebarGroupContentElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('w-full text-sm', className)} data-sidebar=\"group-content\" {...props} />\n ),\n);\n\nSidebarGroupContent.displayName = 'SidebarGroupContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenu\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuElement = HTMLUListElement;\ntype SidebarMenuProps = ComponentProps<'ul'>;\n\nconst SidebarMenu = forwardRef<SidebarMenuElement, SidebarMenuProps>(({ className, ...props }, ref) => (\n <ul ref={ref} className={cn('flex w-full min-w-0 flex-col gap-1', className)} data-sidebar=\"menu\" {...props} />\n));\n\nSidebarMenu.displayName = 'SidebarMenu';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuItemElement = HTMLLIElement;\ntype SidebarMenuItemProps = ComponentProps<'li'>;\n\nconst SidebarMenuItem = forwardRef<SidebarMenuItemElement, SidebarMenuItemProps>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn('group/menu-item relative', className)} data-sidebar=\"menu-item\" {...props} />\n));\n\nSidebarMenuItem.displayName = 'SidebarMenuItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuButton\n * -------------------------------------------------------------------------- */\n\nconst sidebarMenuButtonVariants = tv({\n base: 'peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',\n },\n size: {\n default: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype SidebarMenuButtonElement = HTMLButtonElement;\ninterface SidebarMenuButtonProps extends ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | ComponentProps<typeof TooltipContent>;\n}\n\nconst SidebarMenuButton = forwardRef<SidebarMenuButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n ref={ref}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n data-active={isActive}\n data-sidebar=\"menu-button\"\n data-size={size}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n const tooltipProps =\n typeof tooltip === 'string'\n ? {\n children: tooltip,\n }\n : tooltip;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent align=\"center\" hidden={state !== 'collapsed' || isMobile} side=\"right\" {...tooltipProps} />\n </Tooltip>\n );\n },\n);\n\nSidebarMenuButton.displayName = 'SidebarMenuButton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuActionElement = HTMLButtonElement;\ninterface SidebarMenuActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n showOnHover?: boolean;\n}\nconst SidebarMenuAction = forwardRef<SidebarMenuActionElement, SidebarMenuActionProps>(\n ({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n showOnHover &&\n 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',\n className,\n )}\n data-sidebar=\"menu-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarMenuAction.displayName = 'SidebarMenuAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuBadge\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuBadgeElement = HTMLDivElement;\ntype SidebarMenuBadgeProps = ComponentProps<'div'>;\nconst SidebarMenuBadge = forwardRef<SidebarMenuBadgeElement, SidebarMenuBadgeProps>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums',\n 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-badge\"\n {...props}\n />\n));\n\nSidebarMenuBadge.displayName = 'SidebarMenuBadge';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSkeleton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSkeletonElement = HTMLDivElement;\ninterface SidebarMenuSkeletonProps extends ComponentProps<'div'> {\n showIcon?: boolean;\n}\nconst SidebarMenuSkeleton = forwardRef<SidebarMenuSkeletonElement, SidebarMenuSkeletonProps>(\n ({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n ref={ref}\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n data-sidebar=\"menu-skeleton\"\n {...props}\n >\n {showIcon ? <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" /> : null}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width,\n } as CSSProperties\n }\n />\n </div>\n );\n },\n);\n\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSub\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubElement = HTMLUListElement;\ntype SidebarMenuSubProps = ComponentProps<'ul'>;\nconst SidebarMenuSub = forwardRef<SidebarMenuSubElement, SidebarMenuSubProps>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n 'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-sub\"\n {...props}\n />\n));\n\nSidebarMenuSub.displayName = 'SidebarMenuSub';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubItemElement = HTMLLIElement;\ntype SidebarMenuSubItemProps = ComponentProps<'li'>;\nconst SidebarMenuSubItem = forwardRef<SidebarMenuSubItemElement, SidebarMenuSubItemProps>(({ ...props }, ref) => (\n <li ref={ref} {...props} />\n));\n\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubButton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubButtonElement = HTMLAnchorElement;\ninterface SidebarMenuSubButtonProps extends ComponentProps<'a'> {\n asChild?: boolean;\n isActive?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst SidebarMenuSubButton = forwardRef<SidebarMenuSubButtonElement, SidebarMenuSubButtonProps>(\n ({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-active={isActive}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n {...props}\n />\n );\n },\n);\n\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n"]}
1
+ {"version":3,"sources":["../src/components/sidebar.tsx"],"names":["useMediaQuery","Slot","VisuallyHidden","PanelLeftIcon","createContext","forwardRef","useCallback","useContext","useEffect","useMemo","useState","tv","jsx","jsxs","SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SIDEBAR_MOBILE_BREAKPOINT","SidebarContext","useSidebar","context","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","openMobile","setOpenMobile","isOpen","setIsOpen","open","setOpen","value","openState","toggleSidebar","currentValue","handleKeyDown","event","state","contextValue","TooltipProvider","cn","Sidebar","side","variant","collapsible","Sheet","SheetContent","SheetTitle","SheetDescription","SidebarTrigger","onClick","Button","SidebarRail","SidebarInset","SidebarInput","TextInput","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","SidebarGroupLabel","asChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariants","SidebarMenuButton","isActive","size","tooltip","Comp","button","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":"kUAEA,OAAS,iBAAAA,MAAqB,kBAC9B,OAAS,QAAAC,MAAY,uBACrB,OAAS,kBAAAC,MAAsB,kCAC/B,OAAS,iBAAAC,MAAqB,eAC9B,OAGE,iBAAAC,EAEA,cAAAC,EACA,eAAAC,EACA,cAAAC,EACA,aAAAC,EACA,WAAAC,EACA,YAAAC,MACK,QACP,OAAS,MAAAC,MAA6B,oBAqH5B,cAAAC,EAkEE,QAAAC,MAlEF,oBA3GV,IAAMC,EAAsB,gBACtBC,EAAyB,GAAK,GAAK,GAAK,EACxCC,EAAgB,QAChBC,EAAuB,QACvBC,EAAqB,OACrBC,GAA4B,IAC5BC,GAA4B,IAY5BC,EAAiBjB,EAAqC,IAAI,EAEhE,SAASkB,GAA6B,CACpC,IAAMC,EAAUhB,EAAWc,CAAc,EAEzC,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAaA,IAAMC,GAAkBnB,EACtB,CAAC,CAAE,YAAAoB,EAAc,GAAM,KAAMC,EAAU,aAAcC,EAAa,UAAAC,EAAW,MAAAC,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AQ,IACb,GAAG,KAAK,MAAM,KAAK,OAAO,EAAI,EAAE,EAAI,EAAE,IAC5C,CAAC,CAAC,EAEL,OACEI,EAAC,OACC,IAAKmB,EACL,UAAWiB,EAAG,8CAA+CrB,CAAS,EACtE,eAAa,gBACZ,GAAGG,EAEH,UAAA4D,EAAW/E,EAACiF,EAAA,CAAS,UAAU,oBAAoB,eAAa,qBAAqB,EAAK,KAC3FjF,EAACiF,EAAA,CACC,UAAU,sCACV,eAAa,qBACb,MACE,CACE,mBAAoBD,CACtB,EAEJ,GACF,CAEJ,CACF,EAEAF,GAAoB,YAAc,sBAQlC,IAAMI,GAAiBzF,EAAuD,CAAC,CAAE,UAAAuB,EAAW,GAAGG,CAAM,EAAGC,IACtGpB,EAAC,MACC,IAAKoB,EACL,UAAWiB,EACT,iGACA,uCACArB,CACF,EACA,eAAa,WACZ,GAAGG,EACN,CACD,EAED+D,GAAe,YAAc,iBAQ7B,IAAMC,GAAqB1F,EAA+D,CAAC,CAAE,GAAG0B,CAAM,EAAGC,IACvGpB,EAAC,MAAG,IAAKoB,EAAM,GAAGD,EAAO,CAC1B,EAEDgE,GAAmB,YAAc,qBAajC,IAAMC,GAAuB3F,EAC3B,CAAC,CAAE,QAAAmE,EAAU,GAAO,KAAAQ,EAAO,KAAM,SAAAD,EAAU,UAAAnD,EAAW,GAAGG,CAAM,EAAGC,IAI9DpB,EAHW4D,EAAUvE,EAAO,IAG3B,CACC,IAAK+B,EACL,UAAWiB,EACT,8eACA,yFACA+B,IAAS,MAAQ,UACjBA,IAAS,MAAQ,UACjB,uCACApD,CACF,EACA,cAAamD,EACb,eAAa,kBACb,YAAWC,EACV,GAAGjD,EACN,CAGN,EAEAiE,GAAqB,YAAc","sourcesContent":["'use client';\n\nimport { useMediaQuery } from '@codefast/hooks';\nimport { Slot } from '@radix-ui/react-slot';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { PanelLeftIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n type ComponentRef,\n createContext,\n type CSSProperties,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { tv, type VariantProps } from 'tailwind-variants';\n\nimport { Button } from '@/components/button';\nimport { Separator } from '@/components/separator';\nimport { Sheet, SheetContent, SheetDescription, SheetTitle } from '@/components/sheet';\nimport { Skeleton } from '@/components/skeleton';\nimport { TextInput } from '@/components/text-input';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/tooltip';\nimport { cn } from '@/lib/utils';\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar:state';\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = '16rem';\nconst SIDEBAR_WIDTH_MOBILE = '18rem';\nconst SIDEBAR_WIDTH_ICON = '3rem';\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b';\nconst SIDEBAR_MOBILE_BREAKPOINT = 768;\n\ninterface SidebarContext {\n isMobile: boolean;\n open: boolean;\n openMobile: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: 'expanded' | 'collapsed';\n toggleSidebar: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nfunction useSidebar(): SidebarContext {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarProvider\n * -------------------------------------------------------------------------- */\n\ntype SidebarProviderElement = HTMLDivElement;\ninterface SidebarProviderProps extends ComponentProps<'div'> {\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\nconst SidebarProvider = forwardRef<SidebarProviderElement, SidebarProviderProps>(\n ({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${SIDEBAR_MOBILE_BREAKPOINT - 1}px)`);\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const open = openProp ?? isOpen;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setIsOpen(openState);\n }\n\n // This sets the cookie to keep the sidebar state.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n isMobile ? setOpenMobile((currentValue) => !currentValue) : setOpen((currentValue) => !currentValue);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent): void => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContext>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n ref={ref}\n className={cn(\n 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full',\n className,\n )}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n },\n);\n\nSidebarProvider.displayName = 'SidebarProvider';\n\n/* -----------------------------------------------------------------------------\n * Component: Sidebar\n * -------------------------------------------------------------------------- */\n\ntype SidebarElement = HTMLDivElement;\ninterface SidebarProps extends ComponentProps<'div'> {\n collapsible?: 'offcanvas' | 'icon' | 'none';\n side?: 'left' | 'right';\n variant?: 'sidebar' | 'floating' | 'inset';\n}\n\nconst Sidebar = forwardRef<SidebarElement, SidebarProps>(\n ({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n ref={ref}\n className={cn('bg-sidebar text-sidebar-foreground flex h-full w-[--sidebar-width] flex-col', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n className=\"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden\"\n data-mobile=\"true\"\n data-sidebar=\"sidebar\"\n side={side}\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE,\n } as CSSProperties\n }\n >\n <VisuallyHidden>\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Press escape to close the sidebar</SheetDescription>\n </VisuallyHidden>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n ref={ref}\n className=\"text-sidebar-foreground group peer hidden md:block\"\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-side={side}\n data-state={state}\n data-variant={variant}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={cn(\n 'relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]',\n )}\n />\n <div\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow\"\n data-sidebar=\"sidebar\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n },\n);\n\nSidebar.displayName = 'Sidebar';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarTrigger\n * -------------------------------------------------------------------------- */\n\ntype SidebarTriggerElement = ComponentRef<typeof Button>;\ntype SidebarTriggerProps = ComponentProps<typeof Button>;\n\nconst SidebarTrigger = forwardRef<SidebarTriggerElement, SidebarTriggerProps>(\n ({ className, onClick, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n ref={ref}\n icon\n className={cn('', className)}\n data-sidebar=\"trigger\"\n size=\"xxs\"\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n },\n);\n\nSidebarTrigger.displayName = 'SidebarTrigger';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarRail\n * -------------------------------------------------------------------------- */\n\ntype SidebarRailElement = HTMLButtonElement;\ntype SidebarRailProps = ComponentProps<'button'>;\n\nconst SidebarRail = forwardRef<SidebarRailElement, SidebarRailProps>(({ className, ...props }, ref) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n ref={ref}\n aria-label=\"Toggle Sidebar\"\n className={cn(\n 'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',\n '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className,\n )}\n data-sidebar=\"rail\"\n tabIndex={-1}\n title=\"Toggle Sidebar\"\n type=\"button\"\n onClick={toggleSidebar}\n {...props}\n />\n );\n});\n\nSidebarRail.displayName = 'SidebarRail';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInset\n * -------------------------------------------------------------------------- */\n\ntype SidebarInsetElement = HTMLDivElement;\ntype SidebarInsetProps = ComponentProps<'main'>;\n\nconst SidebarInset = forwardRef<SidebarInsetElement, SidebarInsetProps>(({ className, ...props }, ref) => {\n return (\n <main\n ref={ref}\n className={cn(\n 'bg-background relative flex min-h-svh flex-1 flex-col',\n 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow',\n className,\n )}\n {...props}\n />\n );\n});\n\nSidebarInset.displayName = 'SidebarInset';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarInput\n * -------------------------------------------------------------------------- */\n\ntype SidebarInputElement = ComponentRef<typeof TextInput>;\ntype SidebarInputProps = ComponentProps<typeof TextInput>;\n\nconst SidebarInput = forwardRef<SidebarInputElement, SidebarInputProps>(({ className, ...props }, ref) => {\n return (\n <TextInput\n ref={ref}\n className={cn(\n 'bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2',\n className,\n )}\n data-sidebar=\"input\"\n {...props}\n />\n );\n});\n\nSidebarInput.displayName = 'SidebarInput';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarHeader\n * -------------------------------------------------------------------------- */\n\ntype SidebarHeaderElement = HTMLDivElement;\ntype SidebarHeaderProps = ComponentProps<'div'>;\n\nconst SidebarHeader = forwardRef<SidebarHeaderElement, SidebarHeaderProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"header\" {...props} />;\n});\n\nSidebarHeader.displayName = 'SidebarHeader';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarFooter\n * -------------------------------------------------------------------------- */\n\ntype SidebarFooterElement = HTMLDivElement;\ntype SidebarFooterProps = ComponentProps<'div'>;\n\nconst SidebarFooter = forwardRef<SidebarFooterElement, SidebarFooterProps>(({ className, ...props }, ref) => {\n return <div ref={ref} className={cn('flex flex-col gap-2 p-2', className)} data-sidebar=\"footer\" {...props} />;\n});\n\nSidebarFooter.displayName = 'SidebarFooter';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarSeparator\n * -------------------------------------------------------------------------- */\n\ntype SidebarSeparatorElement = ComponentRef<typeof Separator>;\ntype SidebarSeparatorProps = ComponentProps<typeof Separator>;\n\nconst SidebarSeparator = forwardRef<SidebarSeparatorElement, SidebarSeparatorProps>(({ className, ...props }, ref) => {\n return (\n <Separator\n ref={ref}\n className={cn('bg-sidebar-border mx-2 w-auto', className)}\n data-sidebar=\"separator\"\n {...props}\n />\n );\n});\n\nSidebarSeparator.displayName = 'SidebarSeparator';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarContentElement = HTMLDivElement;\ntype SidebarContentProps = ComponentProps<'div'>;\n\nconst SidebarContent = forwardRef<SidebarContentElement, SidebarContentProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className,\n )}\n data-sidebar=\"content\"\n {...props}\n />\n );\n});\n\nSidebarContent.displayName = 'SidebarContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroup\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupElement = HTMLDivElement;\ntype SidebarGroupProps = ComponentProps<'div'>;\n\nconst SidebarGroup = forwardRef<SidebarGroupElement, SidebarGroupProps>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('relative flex w-full min-w-0 flex-col p-2', className)}\n data-sidebar=\"group\"\n {...props}\n />\n );\n});\n\nSidebarGroup.displayName = 'SidebarGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupLabel\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupLabelElement = HTMLDivElement;\ninterface SidebarGroupLabelProps extends ComponentProps<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = forwardRef<SidebarGroupLabelElement, SidebarGroupLabelProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',\n className,\n )}\n data-sidebar=\"group-label\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupLabel.displayName = 'SidebarGroupLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupActionElement = HTMLButtonElement;\ninterface SidebarGroupActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupAction = forwardRef<SidebarGroupActionElement, SidebarGroupActionProps>(\n ({ className, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"group-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarGroupAction.displayName = 'SidebarGroupAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarGroupContent\n * -------------------------------------------------------------------------- */\n\ntype SidebarGroupContentElement = HTMLDivElement;\ntype SidebarGroupContentProps = ComponentProps<'div'>;\n\nconst SidebarGroupContent = forwardRef<SidebarGroupContentElement, SidebarGroupContentProps>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('w-full text-sm', className)} data-sidebar=\"group-content\" {...props} />\n ),\n);\n\nSidebarGroupContent.displayName = 'SidebarGroupContent';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenu\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuElement = HTMLUListElement;\ntype SidebarMenuProps = ComponentProps<'ul'>;\n\nconst SidebarMenu = forwardRef<SidebarMenuElement, SidebarMenuProps>(({ className, ...props }, ref) => (\n <ul ref={ref} className={cn('flex w-full min-w-0 flex-col gap-1', className)} data-sidebar=\"menu\" {...props} />\n));\n\nSidebarMenu.displayName = 'SidebarMenu';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuItemElement = HTMLLIElement;\ntype SidebarMenuItemProps = ComponentProps<'li'>;\n\nconst SidebarMenuItem = forwardRef<SidebarMenuItemElement, SidebarMenuItemProps>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn('group/menu-item relative', className)} data-sidebar=\"menu-item\" {...props} />\n));\n\nSidebarMenuItem.displayName = 'SidebarMenuItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuButton\n * -------------------------------------------------------------------------- */\n\nconst sidebarMenuButtonVariants = tv({\n base: 'peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none transition-[width,height,padding] focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n 'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',\n },\n size: {\n default: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n});\n\ntype SidebarMenuButtonElement = HTMLButtonElement;\ninterface SidebarMenuButtonProps extends ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | ComponentProps<typeof TooltipContent>;\n}\n\nconst SidebarMenuButton = forwardRef<SidebarMenuButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n ref={ref}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n data-active={isActive}\n data-sidebar=\"menu-button\"\n data-size={size}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n const tooltipProps =\n typeof tooltip === 'string'\n ? {\n children: tooltip,\n }\n : tooltip;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent align=\"center\" hidden={state !== 'collapsed' || isMobile} side=\"right\" {...tooltipProps} />\n </Tooltip>\n );\n },\n);\n\nSidebarMenuButton.displayName = 'SidebarMenuButton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuAction\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuActionElement = HTMLButtonElement;\ninterface SidebarMenuActionProps extends ComponentProps<'button'> {\n asChild?: boolean;\n showOnHover?: boolean;\n}\nconst SidebarMenuAction = forwardRef<SidebarMenuActionElement, SidebarMenuActionProps>(\n ({ className, asChild = false, showOnHover = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n // Increases the hit area of the button on mobile.\n 'after:absolute after:-inset-2 after:md:hidden',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n showOnHover &&\n 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',\n className,\n )}\n data-sidebar=\"menu-action\"\n {...props}\n />\n );\n },\n);\n\nSidebarMenuAction.displayName = 'SidebarMenuAction';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuBadge\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuBadgeElement = HTMLDivElement;\ntype SidebarMenuBadgeProps = ComponentProps<'div'>;\nconst SidebarMenuBadge = forwardRef<SidebarMenuBadgeElement, SidebarMenuBadgeProps>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums',\n 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',\n 'peer-data-[size=sm]/menu-button:top-1',\n 'peer-data-[size=default]/menu-button:top-1.5',\n 'peer-data-[size=lg]/menu-button:top-2.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-badge\"\n {...props}\n />\n));\n\nSidebarMenuBadge.displayName = 'SidebarMenuBadge';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSkeleton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSkeletonElement = HTMLDivElement;\ninterface SidebarMenuSkeletonProps extends ComponentProps<'div'> {\n showIcon?: boolean;\n}\nconst SidebarMenuSkeleton = forwardRef<SidebarMenuSkeletonElement, SidebarMenuSkeletonProps>(\n ({ className, showIcon = false, ...props }, ref) => {\n // Random width between 50 to 90%.\n const width = useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n ref={ref}\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n data-sidebar=\"menu-skeleton\"\n {...props}\n >\n {showIcon ? <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" /> : null}\n <Skeleton\n className=\"h-4 max-w-[--skeleton-width] flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width,\n } as CSSProperties\n }\n />\n </div>\n );\n },\n);\n\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSub\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubElement = HTMLUListElement;\ntype SidebarMenuSubProps = ComponentProps<'ul'>;\nconst SidebarMenuSub = forwardRef<SidebarMenuSubElement, SidebarMenuSubProps>(({ className, ...props }, ref) => (\n <ul\n ref={ref}\n className={cn(\n 'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-sidebar=\"menu-sub\"\n {...props}\n />\n));\n\nSidebarMenuSub.displayName = 'SidebarMenuSub';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubItem\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubItemElement = HTMLLIElement;\ntype SidebarMenuSubItemProps = ComponentProps<'li'>;\nconst SidebarMenuSubItem = forwardRef<SidebarMenuSubItemElement, SidebarMenuSubItemProps>(({ ...props }, ref) => (\n <li ref={ref} {...props} />\n));\n\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem';\n\n/* -----------------------------------------------------------------------------\n * Component: SidebarMenuSubButton\n * -------------------------------------------------------------------------- */\n\ntype SidebarMenuSubButtonElement = HTMLAnchorElement;\ninterface SidebarMenuSubButtonProps extends ComponentProps<'a'> {\n asChild?: boolean;\n isActive?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst SidebarMenuSubButton = forwardRef<SidebarMenuSubButtonElement, SidebarMenuSubButtonProps>(\n ({ asChild = false, size = 'md', isActive, className, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',\n 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',\n size === 'sm' && 'text-xs',\n size === 'md' && 'text-sm',\n 'group-data-[collapsible=icon]:hidden',\n className,\n )}\n data-active={isActive}\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n {...props}\n />\n );\n },\n);\n\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n"]}