@jarllyng/nostromo 3.14.0 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/chunk-6UIT6XQH.cjs +4 -0
  2. package/dist/chunk-6UIT6XQH.cjs.map +1 -0
  3. package/dist/{chunk-BDRP7ALG.cjs → chunk-7AKJCOPP.cjs} +2 -2
  4. package/dist/{chunk-BDRP7ALG.cjs.map → chunk-7AKJCOPP.cjs.map} +1 -1
  5. package/dist/chunk-7YBS3JIS.js +3 -0
  6. package/dist/chunk-7YBS3JIS.js.map +1 -0
  7. package/dist/{chunk-CT6LEOBW.js → chunk-BQPFZMGP.js} +2 -2
  8. package/dist/{chunk-CT6LEOBW.js.map → chunk-BQPFZMGP.js.map} +1 -1
  9. package/dist/{chunk-2JQROMCM.js → chunk-F6CQ5ODU.js} +2 -2
  10. package/dist/{chunk-2JQROMCM.js.map → chunk-F6CQ5ODU.js.map} +1 -1
  11. package/dist/{chunk-7PPAI3MM.cjs → chunk-GEMIO54B.cjs} +2 -2
  12. package/dist/{chunk-7PPAI3MM.cjs.map → chunk-GEMIO54B.cjs.map} +1 -1
  13. package/dist/chunk-O2VT23LK.js +4 -0
  14. package/dist/chunk-O2VT23LK.js.map +1 -0
  15. package/dist/chunk-RKAXTJFB.cjs +3 -0
  16. package/dist/chunk-RKAXTJFB.cjs.map +1 -0
  17. package/dist/{chunk-NM5NVIAK.js → chunk-RPY5NLM7.js} +2 -2
  18. package/dist/{chunk-NM5NVIAK.js.map → chunk-RPY5NLM7.js.map} +1 -1
  19. package/dist/{chunk-PZLBMQGI.cjs → chunk-RQIC6NLV.cjs} +2 -2
  20. package/dist/{chunk-PZLBMQGI.cjs.map → chunk-RQIC6NLV.cjs.map} +1 -1
  21. package/dist/components/core/alert-dialog.cjs +1 -1
  22. package/dist/components/core/alert-dialog.js +1 -1
  23. package/dist/components/core/button.cjs +1 -1
  24. package/dist/components/core/button.js +1 -1
  25. package/dist/components/core/calendar.cjs +1 -1
  26. package/dist/components/core/calendar.d.cts +22 -1
  27. package/dist/components/core/calendar.d.ts +22 -1
  28. package/dist/components/core/calendar.js +1 -1
  29. package/dist/components/core/carousel.cjs +1 -1
  30. package/dist/components/core/carousel.js +1 -1
  31. package/dist/components/marketing/gallery.cjs +1 -1
  32. package/dist/components/marketing/gallery.js +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-35I2BJC3.js +0 -3
  39. package/dist/chunk-35I2BJC3.js.map +0 -1
  40. package/dist/chunk-5PVFLXPO.cjs +0 -4
  41. package/dist/chunk-5PVFLXPO.cjs.map +0 -1
  42. package/dist/chunk-AVTJE2O2.js +0 -4
  43. package/dist/chunk-AVTJE2O2.js.map +0 -1
  44. package/dist/chunk-JCETHQ55.cjs +0 -3
  45. package/dist/chunk-JCETHQ55.cjs.map +0 -1
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ 'use strict';var chunk7SPPGTBT_cjs=require('./chunk-7SPPGTBT.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var A=classVarianceAuthority.cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 aria-disabled:cursor-not-allowed",{variants:{variant:{default:["bg-primary text-primary-foreground shadow-md hover:bg-primary/90 hover:shadow-lg","active:scale-[0.98] active:shadow-sm","border border-primary/20"],secondary:["bg-secondary text-secondary-foreground border border-border","hover:bg-secondary/80 hover:border-border hover:shadow-sm","active:scale-[0.98]"],outline:["border-2 border-border bg-transparent text-foreground","hover:bg-muted hover:border-primary hover:text-primary","focus-visible:ring-ring/20 focus-visible:border-primary","active:scale-[0.98]"],ghost:["text-foreground hover:bg-muted hover:text-foreground","active:bg-muted/80 active:scale-[0.98]"],destructive:["bg-destructive text-destructive-foreground shadow-md hover:bg-destructive/90 hover:shadow-lg","active:scale-[0.98] active:shadow-sm","border border-destructive/20"],subtle:["bg-muted text-muted-foreground border border-border","hover:bg-muted/80 hover:border-border","active:scale-[0.98]"],link:"text-primary underline-offset-4 hover:underline"},size:{sm:"h-8 px-3 text-xs rounded-sm",default:"h-10 px-4 text-sm rounded-md",lg:"h-11 px-6 text-base rounded-lg",xl:"h-12 px-8 text-lg rounded-lg",icon:"h-10 w-10 rounded-md"},state:{default:"",loading:"cursor-wait",success:"bg-success hover:bg-success-600 text-success-foreground",error:"bg-destructive hover:bg-destructive/90 text-destructive-foreground"}},defaultVariants:{variant:"default",size:"default",state:"default"}}),u=e__namespace.forwardRef(({className:b,variant:m,size:p,state:f="default",loading:r=false,loadingText:i,asChild:a=false,children:t,disabled:v,...g},h)=>{let x=a?reactSlot.Slot:"button",s=v||r,d=o=>{o.preventDefault(),o.stopPropagation();},y=a&&s?{onClickCapture:d,onKeyDownCapture:o=>{(o.key==="Enter"||o.key===" ")&&d(o);}}:{},w=["button","input","select","textarea","fieldset","optgroup","option"],B=e__namespace.isValidElement(t)&&typeof t.type=="string"&&w.includes(t.type),E=!a||B,C=r?"loading":f,n=r&&i?i:t,R=a&&n!==t&&e__namespace.isValidElement(t)?e__namespace.cloneElement(t,void 0,n):n;return e__namespace.createElement(x,{className:chunkITRGJNWL_cjs.a(A({variant:m,size:p,state:C,className:b})),ref:h,...E?{disabled:s}:{},"aria-disabled":s,...g,...y},r&&e__namespace.createElement("svg",{className:"mr-2 h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true"},e__namespace.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e__namespace.createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),e__namespace.createElement(reactSlot.Slottable,null,R))});u.displayName="Button";var z=chunk7SPPGTBT_cjs.a(u);
3
+ exports.a=A;exports.b=z;//# sourceMappingURL=chunk-6UIT6XQH.cjs.map
4
+ //# sourceMappingURL=chunk-6UIT6XQH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/core/button.tsx"],"names":["buttonVariants","cva","ButtonComponent","e","className","variant","size","state","loading","loadingText","asChild","children","disabled","props","ref","Component","Slot","isDisabled","blockActivation","event","disabledGuards","NATIVE_DISABLEABLE","slottedIsNativeControl","passNativeDisabled","finalState","label","slotted","cn","Slottable","Button","memo"],"mappings":"mlBAMA,IAAMA,CAAAA,CAAiBC,2BAKrB,qUAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CAEP,OAAA,CAAS,CACP,mFACA,sCAAA,CACA,0BACF,CAAA,CAEA,SAAA,CAAW,CACT,6DAAA,CACA,2DAAA,CACA,qBACF,CAAA,CAEA,QAAS,CACP,uDAAA,CACA,wDAAA,CACA,yDAAA,CACA,qBACF,CAAA,CAEA,KAAA,CAAO,CACL,uDACA,wCACF,CAAA,CAEA,WAAA,CAAa,CACX,+FACA,sCAAA,CACA,8BACF,CAAA,CAEA,MAAA,CAAQ,CACN,qDAAA,CACA,uCAAA,CACA,qBACF,CAAA,CAEA,IAAA,CAAM,iDACR,CAAA,CACA,IAAA,CAAM,CAEJ,EAA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L,CAAA,CAAE,iHAAA,CACJ,CACF,CAAA,CAKFA,YAAA,CAAA,aAAA,CAACyB,mBAAAA,CAAA,IAAA,CAAWF,CAAQ,CACtB,CAEJ,CACF,EACAxB,EAAgB,WAAA,CAAc,QAAA,CAG9B,IAAM2B,CAAAA,CAASC,oBAAK5B,CAAe","file":"chunk-6UIT6XQH.cjs","sourcesContent":["import * as React from \"react\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\nimport { memo } from \"../../lib/memo\";\n\nconst buttonVariants = cva(\n // Base styles with improved spacing and transitions\n // `aria-disabled:` alongside `disabled:` because `asChild` renders whatever the\n // caller passed - an anchor, usually - and `:disabled` matches only real form\n // controls. Without it a disabled link looked entirely enabled.\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 aria-disabled:cursor-not-allowed\",\n {\n variants: {\n variant: {\n // Enhanced default with better depth\n default: [\n \"bg-primary text-primary-foreground shadow-md hover:bg-primary/90 hover:shadow-lg\",\n \"active:scale-[0.98] active:shadow-sm\",\n \"border border-primary/20\",\n ],\n // Enhanced secondary with better contrast\n secondary: [\n \"bg-secondary text-secondary-foreground border border-border\",\n \"hover:bg-secondary/80 hover:border-border hover:shadow-sm\",\n \"active:scale-[0.98]\",\n ],\n // Enhanced outline with better focus\n outline: [\n \"border-2 border-border bg-transparent text-foreground\",\n \"hover:bg-muted hover:border-primary hover:text-primary\",\n \"focus-visible:ring-ring/20 focus-visible:border-primary\",\n \"active:scale-[0.98]\",\n ],\n // Enhanced ghost with better hover\n ghost: [\n \"text-foreground hover:bg-muted hover:text-foreground\",\n \"active:bg-muted/80 active:scale-[0.98]\",\n ],\n // Enhanced destructive with better feedback\n destructive: [\n \"bg-destructive text-destructive-foreground shadow-md hover:bg-destructive/90 hover:shadow-lg\",\n \"active:scale-[0.98] active:shadow-sm\",\n \"border border-destructive/20\",\n ],\n // Subtle variant for less prominent actions\n subtle: [\n \"bg-muted text-muted-foreground border border-border\",\n \"hover:bg-muted/80 hover:border-border\",\n \"active:scale-[0.98]\",\n ],\n // Link variant\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n // Improved spacing for consistency\n sm: \"h-8 px-3 text-xs rounded-sm\",\n default: \"h-10 px-4 text-sm rounded-md\",\n lg: \"h-11 px-6 text-base rounded-lg\",\n xl: \"h-12 px-8 text-lg rounded-lg\",\n icon: \"h-10 w-10 rounded-md\",\n },\n // State variants for better feedback\n state: {\n default: \"\",\n loading: \"cursor-wait\",\n success: \"bg-success hover:bg-success-600 text-success-foreground\",\n error:\n \"bg-destructive hover:bg-destructive/90 text-destructive-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n state: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * Whether to render the button as a separate component (e.g. for Link)\n * @default false\n */\n asChild?: boolean;\n /**\n * Whether the button is in a loading state.\n * When true, automatically sets state to \"loading\" and shows a spinner.\n * @default false\n */\n loading?: boolean;\n /**\n * The loading text to display when loading is true.\n * If not provided, the button's children will be shown.\n * @default undefined\n */\n loadingText?: string;\n /**\n * The visual state of the button.\n * Note: If `loading` is true, this prop is ignored and state becomes \"loading\".\n * Use `state=\"success\"` or `state=\"error\"` for post-action feedback.\n * @default \"default\"\n */\n state?: \"default\" | \"loading\" | \"success\" | \"error\";\n}\n\nconst ButtonComponent = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n state = \"default\",\n loading = false,\n loadingText,\n asChild = false,\n children,\n disabled,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n const isDisabled = disabled || loading;\n\n /**\n * Stops a disabled `asChild` button from doing anything.\n *\n * `disabled` is a form-control attribute. Put it on an anchor - which is what\n * `asChild` usually renders - and the browser ignores it, so\n * `<Button asChild disabled><a href=\"/checkout\">` navigated, ran the caller's\n * onClick, and ran the anchor's own onClick. `aria-disabled` announced a\n * disabled state that nothing implemented.\n *\n * The guards are *capture* handlers, and the phase is the whole point. Radix\n * Slot merges its props with the child's by calling the child's handler\n * first, with no check for `defaultPrevented` - measured, not assumed:\n *\n * child capture -> parent capture -> child onClick -> parent onClick\n *\n * So a bubble-phase handler here would run last, after both onClicks had\n * already fired. From the capture phase, `stopPropagation` reaches the bubble\n * phase before either of them does, and `preventDefault` cancels the\n * navigation.\n *\n * The one thing it cannot intercept is a capture handler on the child itself,\n * which runs before this one. That is rare enough to document rather than\n * design around.\n */\n const blockActivation = (event: React.SyntheticEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n const disabledGuards =\n asChild && isDisabled\n ? {\n onClickCapture: blockActivation,\n onKeyDownCapture: (event: React.KeyboardEvent) => {\n // The two keys that activate a link or a button.\n if (event.key === \"Enter\" || event.key === \" \") {\n blockActivation(event);\n }\n },\n }\n : {};\n\n /**\n * `disabled` goes on elements that have it.\n *\n * On an anchor React renders a literal `disabled=\"\"` that means nothing and\n * does nothing. A slotted `<button>` is a different matter, and still gets\n * the real thing.\n */\n const NATIVE_DISABLEABLE = [\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"fieldset\",\n \"optgroup\",\n \"option\",\n ];\n const slottedIsNativeControl =\n React.isValidElement(children) &&\n typeof children.type === \"string\" &&\n NATIVE_DISABLEABLE.includes(children.type);\n const passNativeDisabled = !asChild || slottedIsNativeControl;\n\n // Determine final state: loading prop takes precedence over state prop\n const finalState = loading ? \"loading\" : state;\n\n const label = loading && loadingText ? loadingText : children;\n // With `asChild` the caller's element is what actually renders, so\n // loadingText has to replace the content *inside* it - swapping the element\n // itself for a string would leave Slot with nothing to clone.\n const slotted =\n asChild && label !== children && React.isValidElement(children)\n ? React.cloneElement(children, undefined, label)\n : label;\n\n return (\n <Component\n className={cn(\n buttonVariants({ variant, size, state: finalState, className }),\n )}\n ref={ref}\n {...(passNativeDisabled ? { disabled: isDisabled } : {})}\n aria-disabled={isDisabled}\n {...props}\n // After the spread: a caller's own capture handler does not get to\n // re-enable a disabled button.\n {...disabledGuards}\n >\n {loading && (\n <svg\n className=\"mr-2 h-4 w-4 animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n )}\n {/* Slottable marks the target element for `asChild`, so the spinner can\n sit alongside it. Without it, Slot sees more than one child (the\n falsy spinner expression counts too) and throws Children.only. */}\n <Slottable>{slotted}</Slottable>\n </Component>\n );\n },\n);\nButtonComponent.displayName = \"Button\";\n\n// Memoize Button for performance optimization\nconst Button = memo(ButtonComponent) as typeof ButtonComponent;\n\nexport { Button, buttonVariants };\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- 'use strict';var chunk5PVFLXPO_cjs=require('./chunk-5PVFLXPO.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),E=require('embla-carousel-react'),phosphorReact=require('phosphor-react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var E__default=/*#__PURE__*/_interopDefault(E);var x=e__namespace.createContext(null);function m(){let t=e__namespace.useContext(x);if(!t)throw new Error("useCarousel must be used inside a <Carousel>.");return t}function L(t){if(!(t instanceof HTMLElement))return false;if(t.isContentEditable)return true;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"}var k=e__namespace.forwardRef(({orientation:t="horizontal",opts:r,setApi:a,plugins:s,className:n,children:c,...f},d)=>{let[i,o]=E__default.default({...r,axis:t==="horizontal"?"x":"y"},s),b=e__namespace.useCallback(l=>o?(o.on("select",l),o.on("reInit",l),()=>{o.off("select",l),o.off("reInit",l);}):()=>{},[o]),y=e__namespace.useSyncExternalStore(b,()=>o?.canScrollPrev()??false,()=>false),h=e__namespace.useSyncExternalStore(b,()=>o?.canScrollNext()??false,()=>false),p=e__namespace.useCallback(()=>o?.scrollPrev(),[o]),C=e__namespace.useCallback(()=>o?.scrollNext(),[o]),R=e__namespace.useCallback(l=>{if(L(l.target))return;let[N,w]=t==="horizontal"?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"];l.key===N?(l.preventDefault(),p()):l.key===w&&(l.preventDefault(),C());},[t,p,C]);e__namespace.useEffect(()=>{!o||!a||a(o);},[o,a]);let P=e__namespace.useMemo(()=>({carouselRef:i,api:o,opts:r,plugins:s,orientation:t,scrollPrev:p,scrollNext:C,canScrollPrev:y,canScrollNext:h}),[i,o,r,s,t,p,C,y,h]);return e__namespace.createElement(x.Provider,{value:P},e__namespace.createElement("div",{ref:d,onKeyDownCapture:R,className:chunkITRGJNWL_cjs.a("relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",n),role:"region","aria-roledescription":"carousel",tabIndex:0,...f},c))});k.displayName="Carousel";var M=e__namespace.forwardRef(({className:t,...r},a)=>{let{carouselRef:s,orientation:n}=m();return e__namespace.createElement("div",{ref:s,className:"overflow-hidden"},e__namespace.createElement("div",{ref:a,className:chunkITRGJNWL_cjs.a("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r}))});M.displayName="CarouselContent";var A=e__namespace.forwardRef(({className:t,...r},a)=>{let{orientation:s}=m();return e__namespace.createElement("div",{ref:a,role:"group","aria-roledescription":"slide",className:chunkITRGJNWL_cjs.a("min-w-0 shrink-0 grow-0 basis-full",s==="horizontal"?"pl-4":"pt-4",t),...r})});A.displayName="CarouselItem";var H=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Previous slide",...n},c)=>{let{orientation:f,scrollPrev:d,canScrollPrev:i}=m();return e__namespace.createElement(chunk5PVFLXPO_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretLeft,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});H.displayName="CarouselPrevious";var D=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Next slide",...n},c)=>{let{orientation:f,scrollNext:d,canScrollNext:i}=m();return e__namespace.createElement(chunk5PVFLXPO_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretRight,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});D.displayName="CarouselNext";exports.a=m;exports.b=k;exports.c=M;exports.d=A;exports.e=H;exports.f=D;//# sourceMappingURL=chunk-BDRP7ALG.cjs.map
3
- //# sourceMappingURL=chunk-BDRP7ALG.cjs.map
2
+ 'use strict';var chunk6UIT6XQH_cjs=require('./chunk-6UIT6XQH.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),E=require('embla-carousel-react'),phosphorReact=require('phosphor-react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var E__default=/*#__PURE__*/_interopDefault(E);var x=e__namespace.createContext(null);function m(){let t=e__namespace.useContext(x);if(!t)throw new Error("useCarousel must be used inside a <Carousel>.");return t}function L(t){if(!(t instanceof HTMLElement))return false;if(t.isContentEditable)return true;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"}var k=e__namespace.forwardRef(({orientation:t="horizontal",opts:r,setApi:a,plugins:s,className:n,children:c,...f},d)=>{let[i,o]=E__default.default({...r,axis:t==="horizontal"?"x":"y"},s),b=e__namespace.useCallback(l=>o?(o.on("select",l),o.on("reInit",l),()=>{o.off("select",l),o.off("reInit",l);}):()=>{},[o]),y=e__namespace.useSyncExternalStore(b,()=>o?.canScrollPrev()??false,()=>false),h=e__namespace.useSyncExternalStore(b,()=>o?.canScrollNext()??false,()=>false),p=e__namespace.useCallback(()=>o?.scrollPrev(),[o]),C=e__namespace.useCallback(()=>o?.scrollNext(),[o]),R=e__namespace.useCallback(l=>{if(L(l.target))return;let[N,w]=t==="horizontal"?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"];l.key===N?(l.preventDefault(),p()):l.key===w&&(l.preventDefault(),C());},[t,p,C]);e__namespace.useEffect(()=>{!o||!a||a(o);},[o,a]);let P=e__namespace.useMemo(()=>({carouselRef:i,api:o,opts:r,plugins:s,orientation:t,scrollPrev:p,scrollNext:C,canScrollPrev:y,canScrollNext:h}),[i,o,r,s,t,p,C,y,h]);return e__namespace.createElement(x.Provider,{value:P},e__namespace.createElement("div",{ref:d,onKeyDownCapture:R,className:chunkITRGJNWL_cjs.a("relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",n),role:"region","aria-roledescription":"carousel",tabIndex:0,...f},c))});k.displayName="Carousel";var M=e__namespace.forwardRef(({className:t,...r},a)=>{let{carouselRef:s,orientation:n}=m();return e__namespace.createElement("div",{ref:s,className:"overflow-hidden"},e__namespace.createElement("div",{ref:a,className:chunkITRGJNWL_cjs.a("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r}))});M.displayName="CarouselContent";var A=e__namespace.forwardRef(({className:t,...r},a)=>{let{orientation:s}=m();return e__namespace.createElement("div",{ref:a,role:"group","aria-roledescription":"slide",className:chunkITRGJNWL_cjs.a("min-w-0 shrink-0 grow-0 basis-full",s==="horizontal"?"pl-4":"pt-4",t),...r})});A.displayName="CarouselItem";var H=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Previous slide",...n},c)=>{let{orientation:f,scrollPrev:d,canScrollPrev:i}=m();return e__namespace.createElement(chunk6UIT6XQH_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretLeft,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});H.displayName="CarouselPrevious";var D=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Next slide",...n},c)=>{let{orientation:f,scrollNext:d,canScrollNext:i}=m();return e__namespace.createElement(chunk6UIT6XQH_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretRight,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});D.displayName="CarouselNext";exports.a=m;exports.b=k;exports.c=M;exports.d=A;exports.e=H;exports.f=D;//# sourceMappingURL=chunk-7AKJCOPP.cjs.map
3
+ //# sourceMappingURL=chunk-7AKJCOPP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/core/carousel.tsx"],"names":["CarouselContext","e","useCarousel","context","isTextEntry","target","tag","Carousel","orientation","opts","setApi","plugins","className","children","props","ref","carouselRef","api","useEmblaCarousel","subscribe","onStoreChange","canScrollPrev","canScrollNext","scrollPrev","scrollNext","handleKeyDown","event","back","forward","value","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","label","Button","CaretLeft","CarouselNext","CaretRight"],"mappings":"wqBAwDA,IAAMA,EAAwBC,YAAA,CAAA,aAAA,CAA2C,IAAI,CAAA,CAE7E,SAASC,CAAAA,EAAc,CACrB,IAAMC,CAAAA,CAAgBF,wBAAWD,CAAe,CAAA,CAChD,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,+CAA+C,CAAA,CAEjE,OAAOA,CACT,CAGA,SAASC,CAAAA,CAAYC,CAAAA,CAAqC,CACxD,GAAI,EAAEA,CAAAA,YAAkB,WAAA,CAAA,CAAc,OAAO,MAAA,CAC7C,GAAIA,CAAAA,CAAO,kBAAmB,OAAO,KAAA,CACrC,IAAMC,CAAAA,CAAMD,CAAAA,CAAO,OAAA,CACnB,OAAOC,CAAAA,GAAQ,SAAWA,CAAAA,GAAQ,UAAA,EAAcA,CAAAA,GAAQ,QAC1D,CAEA,IAAMC,CAAAA,CAAiBN,YAAA,CAAA,UAAA,CAIrB,CACE,CACE,WAAA,CAAAO,CAAAA,CAAc,YAAA,CACd,IAAA,CAAAC,CAAAA,CACA,M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AAAA,CAAA,CACC,GAAA,CAAKtB,CAAAA,CACL,OAAA,CAASmB,EACT,IAAA,CAAMC,CAAAA,CACN,SAAA,CAAWL,mBAAAA,CACT,+BAAA,CACAtB,CAAAA,GAAgB,YAAA,CACZ,oCAAA,CACA,iDACJI,CACF,CAAA,CACA,QAAA,CAAU,CAACU,CAAAA,CACX,OAAA,CAASE,CAAAA,CACR,GAAGV,GAEJb,YAAA,CAAA,aAAA,CAACuC,wBAAAA,CAAA,CAAW,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAAA,CACnDvC,2BAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAA,CAAWmC,CAAM,CACnC,CAEJ,CACF,EACAG,EAAa,WAAA,CAAc,cAAA","file":"chunk-BDRP7ALG.cjs","sourcesContent":["import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { CaretLeft, CaretRight } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\n/**\n * A horizontal or vertical strip of slides that snaps as you drag it.\n *\n * Embla does the measuring, the dragging and the snapping. This file is the\n * markup, the styling and the roles, plus the two buttons.\n *\n * ## `orientation` is the only axis control\n *\n * Embla takes `axis: \"x\" | \"y\"`, and this component derives it from\n * `orientation`, because the padding on `CarouselItem` and the placement of the\n * two buttons have to agree with it. Setting `opts={{ axis: \"y\" }}` will not\n * work: `orientation` overwrites it. One control, so the styling cannot drift\n * out of sync with the behaviour.\n *\n * ## Anything beyond next and previous goes through `setApi`\n *\n * Dots, autoplay, a progress bar, \"slide 3 of 7\" - all of that reads state\n * embla owns, and wrapping each one would mean guessing which you want. `setApi`\n * hands you the embla instance instead, and its `on(\"select\")` event is the hook\n * for the rest.\n */\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface CarouselProps {\n /** Embla options. `axis` is ignored - use `orientation`. */\n opts?: CarouselOptions;\n /** Embla plugins, for example autoplay. */\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the embla instance, for dots, autoplay or a slide counter. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: UseEmblaCarouselType[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used inside a <Carousel>.\");\n }\n return context;\n}\n\n/** Arrow keys mean \"move the caret\" inside a text field, not \"change slide\". */\nfunction isTextEntry(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n // Whether there is anywhere to scroll lives in embla, not here, so it is\n // read rather than mirrored. An effect that copied it into state would\n // render once with both buttons wrongly disabled before the effect ran, and\n // would set state synchronously inside an effect, which is a cascading\n // render. Subscribing is both correct and simpler.\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => {};\n api.on(\"select\", onStoreChange);\n api.on(\"reInit\", onStoreChange);\n return () => {\n api.off(\"select\", onStoreChange);\n api.off(\"reInit\", onStoreChange);\n };\n },\n [api],\n );\n const canScrollPrev = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollPrev() ?? false,\n () => false,\n );\n const canScrollNext = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollNext() ?? false,\n () => false,\n );\n\n const scrollPrev = React.useCallback(() => api?.scrollPrev(), [api]);\n const scrollNext = React.useCallback(() => api?.scrollNext(), [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (isTextEntry(event.target)) return;\n const [back, forward] =\n orientation === \"horizontal\"\n ? [\"ArrowLeft\", \"ArrowRight\"]\n : [\"ArrowUp\", \"ArrowDown\"];\n if (event.key === back) {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === forward) {\n event.preventDefault();\n scrollNext();\n }\n },\n [orientation, scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n const value = React.useMemo(\n () => ({\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }),\n [\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n ],\n );\n\n return (\n <CarouselContext.Provider value={value}>\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\n \"relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n role=\"region\"\n aria-roledescription=\"carousel\"\n // A tab stop, so the arrow keys below are actually reachable. Without\n // it this div can never hold focus, the handler only ever fires for\n // keys pressed on something inside it, and a keyboard user tabbing\n // through the page gets the two buttons and no way to reach the\n // slides. Pass your own tabIndex to opt out.\n tabIndex={0}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\n/**\n * The viewport and the track.\n *\n * Two elements rather than one: embla measures the outer one, which must clip,\n * and translates the inner one. The negative margin pairs with the padding on\n * `CarouselItem` so the gap between slides does not show up as an edge inset.\n */\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselButtonProps extends React.ComponentPropsWithoutRef<\n typeof Button\n> {\n /**\n * Screen-reader text for the button. The arrow is decorative, so this is the\n * button's only accessible name.\n */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n CarouselButtonProps\n>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Previous slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <CaretLeft className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselButtonProps>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Next slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <CaretRight className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n};\nexport type { CarouselApi, CarouselOptions, CarouselPlugin, CarouselProps };\n"]}
1
+ {"version":3,"sources":["../src/components/core/carousel.tsx"],"names":["CarouselContext","e","useCarousel","context","isTextEntry","target","tag","Carousel","orientation","opts","setApi","plugins","className","children","props","ref","carouselRef","api","useEmblaCarousel","subscribe","onStoreChange","canScrollPrev","canScrollNext","scrollPrev","scrollNext","handleKeyDown","event","back","forward","value","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","label","Button","CaretLeft","CarouselNext","CaretRight"],"mappings":"wqBAwDA,IAAMA,EAAwBC,YAAA,CAAA,aAAA,CAA2C,IAAI,CAAA,CAE7E,SAASC,CAAAA,EAAc,CACrB,IAAMC,CAAAA,CAAgBF,wBAAWD,CAAe,CAAA,CAChD,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,+CAA+C,CAAA,CAEjE,OAAOA,CACT,CAGA,SAASC,CAAAA,CAAYC,CAAAA,CAAqC,CACxD,GAAI,EAAEA,CAA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AAA,CACzB,CACE,CACE,SAAA,CAAAW,CAAAA,CACA,OAAA,CAAAsB,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,MAAA,CACP,KAAA,CAAAC,CAAAA,CAAQ,YAAA,CACR,GAAGtB,CACL,CAAA,CACAC,CAAAA,GACG,CACH,GAAM,CAAE,WAAA,CAAAP,CAAAA,CAAa,UAAA,CAAAgB,CAAAA,CAAY,aAAA,CAAAF,CAAc,CAAA,CAAIpB,GAAY,CAC/D,OACED,YAAA,CAAA,aAAA,CAACoC,mBAAAA,CAAA,CACC,GAAA,CAAKtB,CAAAA,CACL,OAAA,CAASmB,EACT,IAAA,CAAMC,CAAAA,CACN,SAAA,CAAWL,mBAAAA,CACT,+BAAA,CACAtB,CAAAA,GAAgB,YAAA,CACZ,oCAAA,CACA,iDACJI,CACF,CAAA,CACA,QAAA,CAAU,CAACU,CAAAA,CACX,OAAA,CAASE,CAAAA,CACR,GAAGV,GAEJb,YAAA,CAAA,aAAA,CAACuC,wBAAAA,CAAA,CAAW,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAAA,CACnDvC,2BAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAA,CAAWmC,CAAM,CACnC,CAEJ,CACF,EACAG,EAAa,WAAA,CAAc,cAAA","file":"chunk-7AKJCOPP.cjs","sourcesContent":["import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { CaretLeft, CaretRight } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\n/**\n * A horizontal or vertical strip of slides that snaps as you drag it.\n *\n * Embla does the measuring, the dragging and the snapping. This file is the\n * markup, the styling and the roles, plus the two buttons.\n *\n * ## `orientation` is the only axis control\n *\n * Embla takes `axis: \"x\" | \"y\"`, and this component derives it from\n * `orientation`, because the padding on `CarouselItem` and the placement of the\n * two buttons have to agree with it. Setting `opts={{ axis: \"y\" }}` will not\n * work: `orientation` overwrites it. One control, so the styling cannot drift\n * out of sync with the behaviour.\n *\n * ## Anything beyond next and previous goes through `setApi`\n *\n * Dots, autoplay, a progress bar, \"slide 3 of 7\" - all of that reads state\n * embla owns, and wrapping each one would mean guessing which you want. `setApi`\n * hands you the embla instance instead, and its `on(\"select\")` event is the hook\n * for the rest.\n */\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface CarouselProps {\n /** Embla options. `axis` is ignored - use `orientation`. */\n opts?: CarouselOptions;\n /** Embla plugins, for example autoplay. */\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the embla instance, for dots, autoplay or a slide counter. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: UseEmblaCarouselType[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used inside a <Carousel>.\");\n }\n return context;\n}\n\n/** Arrow keys mean \"move the caret\" inside a text field, not \"change slide\". */\nfunction isTextEntry(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n // Whether there is anywhere to scroll lives in embla, not here, so it is\n // read rather than mirrored. An effect that copied it into state would\n // render once with both buttons wrongly disabled before the effect ran, and\n // would set state synchronously inside an effect, which is a cascading\n // render. Subscribing is both correct and simpler.\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => {};\n api.on(\"select\", onStoreChange);\n api.on(\"reInit\", onStoreChange);\n return () => {\n api.off(\"select\", onStoreChange);\n api.off(\"reInit\", onStoreChange);\n };\n },\n [api],\n );\n const canScrollPrev = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollPrev() ?? false,\n () => false,\n );\n const canScrollNext = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollNext() ?? false,\n () => false,\n );\n\n const scrollPrev = React.useCallback(() => api?.scrollPrev(), [api]);\n const scrollNext = React.useCallback(() => api?.scrollNext(), [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (isTextEntry(event.target)) return;\n const [back, forward] =\n orientation === \"horizontal\"\n ? [\"ArrowLeft\", \"ArrowRight\"]\n : [\"ArrowUp\", \"ArrowDown\"];\n if (event.key === back) {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === forward) {\n event.preventDefault();\n scrollNext();\n }\n },\n [orientation, scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n const value = React.useMemo(\n () => ({\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }),\n [\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n ],\n );\n\n return (\n <CarouselContext.Provider value={value}>\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\n \"relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n role=\"region\"\n aria-roledescription=\"carousel\"\n // A tab stop, so the arrow keys below are actually reachable. Without\n // it this div can never hold focus, the handler only ever fires for\n // keys pressed on something inside it, and a keyboard user tabbing\n // through the page gets the two buttons and no way to reach the\n // slides. Pass your own tabIndex to opt out.\n tabIndex={0}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\n/**\n * The viewport and the track.\n *\n * Two elements rather than one: embla measures the outer one, which must clip,\n * and translates the inner one. The negative margin pairs with the padding on\n * `CarouselItem` so the gap between slides does not show up as an edge inset.\n */\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselButtonProps extends React.ComponentPropsWithoutRef<\n typeof Button\n> {\n /**\n * Screen-reader text for the button. The arrow is decorative, so this is the\n * button's only accessible name.\n */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n CarouselButtonProps\n>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Previous slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <CaretLeft className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselButtonProps>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Next slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <CaretRight className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n};\nexport type { CarouselApi, CarouselOptions, CarouselPlugin, CarouselProps };\n"]}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import {b}from'./chunk-O2VT23LK.js';import {a as a$1}from'./chunk-AC2JBXHQ.js';import a,{useMemo,useState,useRef,useEffect}from'react';import*as C from'@radix-ui/react-popover';import {cva}from'class-variance-authority';import {startOfDay,startOfMonth,getDaysInMonth,isBefore,isAfter,endOfDay,getDay,isSameDay,isWithinInterval}from'date-fns';var Pe=cva("inline-block rounded-lg border bg-background shadow-lg",{variants:{variant:{default:"border-border bg-card",outline:"border-2 border-border",ghost:"border-transparent bg-transparent shadow-none"},size:{sm:"p-2",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),R=cva("flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-muted text-foreground",selected:"bg-primary text-primary-foreground hover:bg-primary/90 font-semibold",range:"bg-primary/10 text-primary hover:bg-primary/20 font-medium",today:"border-2 border-primary text-foreground font-semibold",outside:"text-muted-foreground",disabled:"text-muted-foreground/50 cursor-not-allowed"},size:{sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm",lg:"h-11 w-11 text-base"}},defaultVariants:{variant:"default",size:"md"}}),ee=t=>getDaysInMonth(t),Te=(t,r)=>{let o=getDay(startOfMonth(t));return r===1?o===0?6:o-1:o},x=(t,r)=>!t||!r?false:isSameDay(t,r),Se=(t,r,o)=>!r&&!o?false:r&&o?isWithinInterval(startOfDay(t),{start:startOfDay(r),end:endOfDay(o)}):r?!isBefore(startOfDay(t),startOfDay(r)):o?!isAfter(startOfDay(t),endOfDay(o)):false,O=(t,r,o,g,m)=>!!(r&&isBefore(startOfDay(t),startOfDay(r))||o&&isAfter(startOfDay(t),endOfDay(o))||g?.some(p=>x(p,t))||m?.includes(getDay(t))),P=(t,r="en-US")=>t?new Intl.DateTimeFormat(r,{year:"numeric",month:"short",day:"numeric"}).format(t):"",Le=(t,r,o="en-US")=>!t&&!r?"":t&&r?`${P(t,o)} - ${P(r,o)}`:t?P(t,o):r?P(r,o):"",Ee=(t,r="en-US",o=g=>`${g} dates selected`)=>t.length===0?"":t.length===1?P(t[0],r):o(t.length),Ie=(t,r)=>{let o=new Intl.DateTimeFormat(t,{weekday:"short"}),g=Array.from({length:7},(m,p)=>o.format(new Date(2024,0,7+p)));return r===1?[...g.slice(1),g[0]]:g},Ye={openCalendar:"Open calendar",placeholder:"Select date...",previousMonth:"Previous month",nextMonth:"Next month",today:"Today",selectEndDate:"Select end date",multipleSelected:t=>`${t} dates selected`},te=t=>{if(t)return t instanceof Date?t:Array.isArray(t)?t[0]:t.from??t.to},F=(t,r,o,g=366)=>{let m=new Date(t);for(let p=0;p<g;p++){if(!o(m))return new Date(m);m.setDate(m.getDate()+r);}},q=(t,r)=>{let o=new Date(t.getFullYear(),t.getMonth()+r,1),g=getDaysInMonth(o);return o.setDate(Math.min(t.getDate(),g)),o},Ve=a.forwardRef(({mode:t="single",value:r,defaultValue:o,onChange:g,minDate:m,maxDate:p,disabledDates:I,disabledDays:Y,locale:v="en-US",placeholder:ie,label:U,error:H,helperText:W,className:le,inputClassName:de,calendarClassName:ue,variant:fe,size:K,showOutsideDays:T=true,firstDayOfWeek:V=1,labels:J,...ce},ge)=>{let y=useMemo(()=>({...Ye,...J}),[J]),[S,L]=useState(false),[c,$]=useState(()=>te(r??o)??new Date),[h,E]=useState(null),me=useRef(null),j=useRef(new Map),[De,pe]=useState(o),Q=r!==void 0,f=Q?r:De,M=a.useCallback(e=>O(e,m,p,I,Y),[m,p,I,Y]);a.useLayoutEffect(()=>{if(!S||h)return;let e=startOfDay(new Date),s=[te(f),e].find(d=>!!d&&!M(d));if(s){E(startOfDay(s));return}let i=startOfMonth(c),l=F(i,1,M,getDaysInMonth(c));l&&E(l);},[S,h,f,c,M]);let N=e=>{Q||pe(e),g?.(e);},_=e=>{if(!O(e,m,p,I,Y)){if(t==="single")N(e),L(false);else if(t==="range"){let n=f;if(!n?.from||n.from&&n.to)N({from:e});else {let s=n.from,i=e;i<s?N({from:i,to:s}):N({from:s,to:i}),L(false);}}else if(t==="multiple"){let n=f||[],s=n.findIndex(i=>x(i,e));s>=0?N(n.filter((i,l)=>l!==s)):N([...n,e]);}}},he=useMemo(()=>{if(!f)return "";if(t==="single")return P(f,v);if(t==="range"){let e=f;return Le(e.from,e.to,v)}else return Ee(f,v,y.multipleSelected)},[f,t,v,y.multipleSelected]),be=useMemo(()=>{let e=[],n=new Date;n.setHours(0,0,0,0);let s=Te(c,V),i=ee(c);if(s>0){let l=new Date(c.getFullYear(),c.getMonth()-1),d=ee(l);for(let D=d-s+1;D<=d;D++){let u=new Date(l.getFullYear(),l.getMonth(),D);e.push({date:u,isCurrentMonth:false,isToday:x(u,n),placeholder:!T});}}for(let l=1;l<=i;l++){let d=new Date(c.getFullYear(),c.getMonth(),l);e.push({date:d,isCurrentMonth:true,isToday:x(d,n)});}if(T){let l=42-e.length,d=new Date(c.getFullYear(),c.getMonth()+1);for(let D=1;D<=l;D++){let u=new Date(d.getFullYear(),d.getMonth(),D);e.push({date:u,isCurrentMonth:false,isToday:x(u,n)});}}return e},[c,T,V]),X=e=>{let n=new Date(c.getFullYear(),c.getMonth()+e,1);if($(n),!h)return;let s=q(h,e),i=F(s,1,M,getDaysInMonth(n))??F(s,-1,M,getDaysInMonth(n));i&&E(i);},ve=()=>X(-1),ye=()=>X(1),Me=()=>{let e=startOfDay(new Date);$(e);let n=F(e,1,M,31)??F(e,-1,M,31);n&&E(n);},we=(e,n)=>{if(e.key==="Enter"||e.key===" "){e.preventDefault(),_(n);return}let s=(l,d,D)=>{let u=F(l,d,M,D);u&&(E(u),(u.getMonth()!==c.getMonth()||u.getFullYear()!==c.getFullYear())&&$(new Date(u.getFullYear(),u.getMonth(),1)));},i=l=>{let d=new Date(n);d.setDate(d.getDate()+l),s(d,l>0?1:-1);};if(e.key==="ArrowRight"){e.preventDefault(),i(1);return}if(e.key==="ArrowLeft"){e.preventDefault(),i(-1);return}if(e.key==="ArrowDown"){e.preventDefault(),i(7);return}if(e.key==="ArrowUp"){e.preventDefault(),i(-7);return}if(e.key==="Home"){e.preventDefault(),s(new Date(n.getFullYear(),n.getMonth(),1),1,getDaysInMonth(n));return}if(e.key==="End"){e.preventDefault(),s(new Date(n.getFullYear(),n.getMonth()+1,0),-1,getDaysInMonth(n));return}if(e.key==="PageUp"){e.preventDefault(),s(q(n,-1),-1);return}if(e.key==="PageDown"){e.preventDefault(),s(q(n,1),1);return}if(e.key==="Escape"){e.preventDefault(),L(false);return}};useEffect(()=>{if(h&&S){let e=`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`,n=j.current.get(e);n&&n.focus();}},[h,S]);let xe=useMemo(()=>Ie(v,V),[v,V]),Ce=c.toLocaleDateString(v,{month:"long",year:"numeric"});return a.createElement("div",{ref:ge,className:a$1("w-full",le),...ce},a.createElement(C.Root,{open:S,onOpenChange:L},a.createElement("div",{className:"space-y-2"},U&&a.createElement("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},U),a.createElement(C.Trigger,{asChild:true},a.createElement("button",{type:"button",className:a$1("flex w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200 text-left",H?"border-error-500 shadow-sm hover:border-error-600 focus-visible:ring-error-500/20 focus-visible:border-error-500":"border-border shadow-sm hover:border-primary focus-visible:ring-ring/20 focus-visible:border-primary","h-10",de),onClick:()=>L(true),"aria-label":U||y.openCalendar,"aria-invalid":H},he||a.createElement("span",{className:"text-muted-foreground"},ie??y.placeholder))),W&&a.createElement("p",{className:a$1("text-sm text-muted-foreground",H&&"text-error-600")},W)),a.createElement(C.Portal,null,a.createElement(C.Content,{className:a$1("z-50 w-auto rounded-lg border bg-popover p-4 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),sideOffset:5,align:"start"},a.createElement("div",{ref:me,className:a$1(Pe({variant:fe,size:K}),ue),role:"application","aria-label":"Calendar"},a.createElement("div",{className:"flex items-center justify-between mb-4"},a.createElement("div",{className:"flex items-center gap-2"},a.createElement(b,{variant:"ghost",size:"sm",onClick:ve,"aria-label":y.previousMonth},a.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"}))),a.createElement("h3",{className:"text-sm font-semibold text-popover-foreground","data-testid":"calendar-month-year"},Ce),a.createElement(b,{variant:"ghost",size:"sm",onClick:ye,"aria-label":y.nextMonth},a.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})))),a.createElement(b,{variant:"ghost",size:"sm",onClick:Me,className:"text-xs"},y.today)),a.createElement("div",{className:"grid grid-cols-7 gap-1 mb-2"},xe.map(e=>a.createElement("div",{key:e,className:"text-center text-xs font-medium text-muted-foreground"},e))),a.createElement("div",{className:"grid grid-cols-7 gap-1"},be.map((e,n)=>{let s=t==="single"?x(e.date,f):t==="range"?Se(e.date,f?.from,f?.to):f?.some(u=>x(u,e.date)),i=O(e.date,m,p,I,Y),l=t==="range"&&f?.from&&!f?.to&&e.date>=f.from,d=`${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`,D=h&&x(e.date,h);return e.placeholder?a.createElement("div",{key:`placeholder-${n}`,"aria-hidden":"true","data-calendar-placeholder":"",className:a$1(R({variant:"default",size:K}),"invisible")}):a.createElement("button",{key:`${e.date.getTime()}-${n}`,ref:u=>{u?j.current.set(d,u):j.current.delete(d);},type:"button",onClick:()=>{T&&!e.isCurrentMonth&&$(new Date(e.date.getFullYear(),e.date.getMonth(),1)),_(e.date);},onKeyDown:u=>we(u,e.date),disabled:i||(T?false:!e.isCurrentMonth),className:a$1(R({variant:s?"selected":l?"range":e.isToday?"today":e.isCurrentMonth?i?"disabled":"default":"outside",size:K}),!e.isCurrentMonth&&"opacity-50",D&&"ring-2 ring-brand-500 ring-offset-2 z-10"),"aria-label":e.date.toLocaleDateString(v,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-selected":s,"aria-disabled":i,tabIndex:D?0:-1},e.date.getDate())})),t==="range"&&f?.from&&!f?.to&&a.createElement("div",{className:"mt-4 pt-4 border-t border-border"},a.createElement("p",{className:"text-xs text-muted-foreground text-center"},y.selectEndDate)))))))});Ve.displayName="Calendar";export{Pe as a,R as b,Ve as c};//# sourceMappingURL=chunk-7YBS3JIS.js.map
3
+ //# sourceMappingURL=chunk-7YBS3JIS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/core/calendar.tsx"],"names":["calendarVariants","cva","calendarDayVariants","getDaysInMonth","date","dateFnsGetDaysInMonth","getFirstDayOfMonth","firstDayOfWeek","firstDay","getDay","startOfMonth","isSameDay","date1","date2","dateFnsIsSameDay","isDateInRange","from","to","isWithinInterval","startOfDay","endOfDay","isBefore","isAfter","isDateDisabled","minDate","maxDate","disabledDates","disabledDays","d","formatDate","locale","formatDateRange","formatMultipleDates","dates","multipleSelected","count","getDayNames","formatter","sundayFirst","_","index","DEFAULT_LABELS","anchorDate","value","findEnabledDate","start","step","isDisabled","limit","candidate","i","shiftMonth","months","target","lastDay","Calendar","React","mode","defaultValue","onChange","placeholder","label","error","helperText","className","inputClassName","calendarClassName","variant","size","showOutsideDays","labelOverrides","props","ref","labels","useMemo","open","setOpen","useState","currentMonth","setCurrentMonth","focusedDate","setFocusedDate","calendarRef","useRef","dayButtonRefs","internalValue","setInternalValue","isControlled","calendarValue","isDisabledDate","today","preferred","monthStart","firstEnabled","handleValueChange","newValue","handleDateClick","rangeValue","multipleValue","dateIndex","displayValue","range","calendarDays","days","daysInMonth","prevMonth","daysInPrevMonth","remainingDays","nextMonth","goToMonth","sameDayNextMonth","landing","goToPreviousMonth","goToNextMonth","goToToday","handleKeyDown","moveFocus","useEffect","dateKey","button","dayNames","monthYearDisplay","cn","Button","day","isSelected","isInRange","isFocused","el","e"],"mappings":"sVAkBA,IAAMA,EAAAA,CAAmBC,GAAAA,CACvB,wDAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,uBAAA,CACT,OAAA,CAAS,wBAAA,CACT,KAAA,CAAO,+CACT,CAAA,CACA,IAAA,CAAM,CACJ,EAAA,CAAI,KAAA,CACJ,EAAA,CAAI,KAAA,CACJ,EAAA,CAAI,KACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,IAAA,CAAM,IACR,CACF,CACF,CAAA,CAEMC,CAAAA,CAAsBD,GAAAA,CAC1B,gMAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,gCAAA,CACT,QAAA,CACE,sEAAA,CACF,KAAA,CAAO,4DAAA,CACP,KAAA,CAAO,uDAAA,CACP,OAAA,CAAS,uBAAA,CACT,QAAA,CAAU,6CACZ,CAAA,CACA,IAAA,CAAM,CACJ,EAAA,CAAI,iBAAA,CACJ,EAAA,CAAI,iBAAA,CACJ,EAAA,CAAI,qBACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,IAAA,CAAM,IACR,CACF,CACF,CAAA,CA8BME,EAAAA,CAAkBC,CAAAA,EACfC,cAAAA,CAAsBD,CAAI,CAAA,CAG7BE,EAAAA,CAAqB,CAACF,CAAAA,CAAYG,CAAAA,GAAkC,CAExE,IAAMC,CAAAA,CAAWC,MAAAA,CAAOC,YAAAA,CAAaN,CAAI,CAAC,CAAA,CAI1C,OAAOG,CAAAA,GAAmB,CAAA,CAAKC,CAAAA,GAAa,CAAA,CAAI,CAAA,CAAIA,CAAAA,CAAW,CAAA,CAAKA,CACtE,CAAA,CAEMG,CAAAA,CAAY,CAChBC,CAAAA,CACAC,CAAAA,GAEI,CAACD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CAAI,IAAI,CAAA,CAC3C,QAAA,CACE7E,CAAAA,GACCsB,CAAAA,CAAkB,KAAA,CAAQ,CAACuD,EAAI,cAAA,CAAA,CAElC,SAAA,CAAWF,GAAAA,CACTxH,CAAAA,CAAoB,CAClB,OAAA,CAAS2H,CAAAA,CACL,UAAA,CACAC,CAAAA,CACE,OAAA,CACAF,CAAAA,CAAI,OAAA,CACF,OAAA,CACCA,CAAAA,CAAI,cAAA,CAEH7E,CAAAA,CACE,UAAA,CACA,SAAA,CAHF,SAAA,CAIV,IAAA,CAAAqB,CACF,CAAC,CAAA,CACD,CAACwD,CAAAA,CAAI,cAAA,EAAkB,YAAA,CACvBG,CAAAA,EACE,0CACJ,CAAA,CACA,aAAYH,CAAAA,CAAI,IAAA,CAAK,kBAAA,CAAmB9F,CAAAA,CAAQ,CAC9C,OAAA,CAAS,MAAA,CACT,IAAA,CAAM,SAAA,CACN,KAAA,CAAO,MAAA,CACP,GAAA,CAAK,SACP,CAAC,CAAA,CACD,eAAA,CAAe+F,CAAAA,CACf,eAAA,CAAe9E,CAAAA,CACf,QAAA,CAAUgF,CAAAA,CAAY,CAAA,CAAI,EAAA,CAAA,CAEzBH,CAAAA,CAAI,IAAA,CAAK,OAAA,EACZ,CAEJ,CAAC,CACH,CAAA,CAGCnE,CAAAA,GAAS,OAAA,EACP+B,CAAAA,EAA8C,IAAA,EAC/C,CAAEA,CAAAA,EAA8C,EAAA,EAC9ChC,CAAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,kCAAA,CAAA,CACbA,CAAAA,CAAA,aAAA,CAAC,GAAA,CAAA,CAAE,SAAA,CAAU,2CAAA,CAAA,CACViB,CAAAA,CAAO,aACV,CACF,CAEN,CACF,CACF,CACF,CACF,CAEJ,CACF,EAEAlB,EAAAA,CAAS,WAAA,CAAc,UAAA","file":"chunk-7YBS3JIS.js","sourcesContent":["import React, { useState, useMemo, useRef, useEffect } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {\n getDaysInMonth as dateFnsGetDaysInMonth,\n startOfMonth,\n getDay,\n isSameDay as dateFnsIsSameDay,\n isWithinInterval,\n isBefore,\n isAfter,\n startOfDay,\n endOfDay,\n} from \"date-fns\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\n// Calendar variants\nconst calendarVariants = cva(\n \"inline-block rounded-lg border bg-background shadow-lg\",\n {\n variants: {\n variant: {\n default: \"border-border bg-card\",\n outline: \"border-2 border-border\",\n ghost: \"border-transparent bg-transparent shadow-none\",\n },\n size: {\n sm: \"p-2\",\n md: \"p-3\",\n lg: \"p-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n);\n\nconst calendarDayVariants = cva(\n \"flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"hover:bg-muted text-foreground\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary/90 font-semibold\",\n range: \"bg-primary/10 text-primary hover:bg-primary/20 font-medium\",\n today: \"border-2 border-primary text-foreground font-semibold\",\n outside: \"text-muted-foreground\",\n disabled: \"text-muted-foreground/50 cursor-not-allowed\",\n },\n size: {\n sm: \"h-7 w-7 text-xs\",\n md: \"h-9 w-9 text-sm\",\n lg: \"h-11 w-11 text-base\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n);\n\nexport type CalendarMode = \"single\" | \"range\" | \"multiple\";\n\nexport interface CalendarProps extends VariantProps<typeof calendarVariants> {\n mode?: CalendarMode;\n value?: Date | Date[] | { from?: Date; to?: Date };\n defaultValue?: Date | Date[] | { from?: Date; to?: Date };\n onChange?: (\n value: Date | Date[] | { from?: Date; to?: Date } | undefined,\n ) => void;\n minDate?: Date;\n maxDate?: Date;\n disabledDates?: Date[];\n disabledDays?: number[]; // 0 = Sunday, 1 = Monday, etc.\n locale?: string;\n placeholder?: string;\n label?: string;\n error?: boolean;\n helperText?: string;\n className?: string;\n inputClassName?: string;\n calendarClassName?: string;\n showOutsideDays?: boolean;\n firstDayOfWeek?: 0 | 1; // 0 = Sunday, 1 = Monday\n /** Overrides for the calendar's own words. See {@link CalendarLabels}. */\n labels?: CalendarLabels;\n}\n\n// Helper functions using date-fns for robust date manipulation\nconst getDaysInMonth = (date: Date): number => {\n return dateFnsGetDaysInMonth(date);\n};\n\nconst getFirstDayOfMonth = (date: Date, firstDayOfWeek: 0 | 1): number => {\n // Use date-fns getDay for consistent day-of-week calculation\n const firstDay = getDay(startOfMonth(date));\n // Convert Sunday (0) to Monday-first (6) if needed\n // Sunday = 0, Monday = 1, ..., Saturday = 6\n // For Monday-first: Sunday becomes 6, Monday becomes 0, etc.\n return firstDayOfWeek === 1 ? (firstDay === 0 ? 6 : firstDay - 1) : firstDay;\n};\n\nconst isSameDay = (\n date1: Date | undefined,\n date2: Date | undefined,\n): boolean => {\n if (!date1 || !date2) return false;\n return dateFnsIsSameDay(date1, date2);\n};\n\nconst isDateInRange = (date: Date, from?: Date, to?: Date): boolean => {\n if (!from && !to) return false;\n if (from && to) {\n // Use date-fns isWithinInterval for proper date range checking\n return isWithinInterval(startOfDay(date), {\n start: startOfDay(from),\n end: endOfDay(to),\n });\n }\n if (from) return !isBefore(startOfDay(date), startOfDay(from));\n if (to) return !isAfter(startOfDay(date), endOfDay(to));\n return false;\n};\n\nconst isDateDisabled = (\n date: Date,\n minDate?: Date,\n maxDate?: Date,\n disabledDates?: Date[],\n disabledDays?: number[],\n): boolean => {\n if (minDate && isBefore(startOfDay(date), startOfDay(minDate))) return true;\n if (maxDate && isAfter(startOfDay(date), endOfDay(maxDate))) return true;\n if (disabledDates?.some((d) => isSameDay(d, date))) return true;\n if (disabledDays?.includes(getDay(date))) return true;\n return false;\n};\n\n/**\n * Formats through Intl, which every browser and Node already carries a full set\n * of locales for.\n *\n * This used to be `dateFnsFormat(date, \"MMM d, yyyy\")` with the locale accepted\n * and ignored, so `locale=\"da-DK\"` produced \"Sep 14, 2026\" next to a Danish month\n * heading. date-fns needs a locale *object* imported per language, which would\n * mean either bundling all of them or asking the caller to pass one; Intl needs\n * neither.\n */\nconst formatDate = (\n date: Date | undefined,\n locale: string = \"en-US\",\n): string => {\n if (!date) return \"\";\n return new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n }).format(date);\n};\n\nconst formatDateRange = (\n from?: Date,\n to?: Date,\n locale: string = \"en-US\",\n): string => {\n if (!from && !to) return \"\";\n if (from && to) {\n return `${formatDate(from, locale)} - ${formatDate(to, locale)}`;\n }\n if (from) return formatDate(from, locale);\n if (to) return formatDate(to, locale);\n return \"\";\n};\n\nconst formatMultipleDates = (\n dates: Date[],\n locale: string = \"en-US\",\n multipleSelected: (count: number) => string = (count) =>\n `${count} dates selected`,\n): string => {\n if (dates.length === 0) return \"\";\n if (dates.length === 1) return formatDate(dates[0], locale);\n return multipleSelected(dates.length);\n};\n\n/**\n * Weekday headings in the calendar's own language.\n *\n * They were the hardcoded strings Sun..Sat. 2024-01-07 is a Sunday, so seven days\n * from it is one full week in a known order, and Intl names them.\n */\nconst getDayNames = (locale: string, firstDayOfWeek: 0 | 1): string[] => {\n const formatter = new Intl.DateTimeFormat(locale, { weekday: \"short\" });\n const sundayFirst = Array.from({ length: 7 }, (_, index) =>\n formatter.format(new Date(2024, 0, 7 + index)),\n );\n return firstDayOfWeek === 1\n ? [...sundayFirst.slice(1), sundayFirst[0]!]\n : sundayFirst;\n};\n\n/**\n * Every string the calendar says on its own behalf.\n *\n * `locale` moves the dates; it cannot translate \"Today\". Without somewhere to put\n * these, a Danish calendar had Danish months and English buttons.\n */\nexport interface CalendarLabels {\n /** Accessible name of the trigger. Defaults to \"Open calendar\". */\n openCalendar?: string;\n /** Shown on the trigger when nothing is selected. The `placeholder` prop wins. */\n placeholder?: string;\n previousMonth?: string;\n nextMonth?: string;\n today?: string;\n /** Shown in range mode between picking the start and the end. */\n selectEndDate?: string;\n /** Trigger text for more than one date in multiple mode. */\n multipleSelected?: (count: number) => string;\n}\n\nconst DEFAULT_LABELS: Required<CalendarLabels> = {\n openCalendar: \"Open calendar\",\n placeholder: \"Select date...\",\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n today: \"Today\",\n selectEndDate: \"Select end date\",\n multipleSelected: (count) => `${count} dates selected`,\n};\n\n/** The date a selection is anchored on, whatever shape the selection has. */\nconst anchorDate = (\n value: Date | Date[] | { from?: Date; to?: Date } | undefined,\n): Date | undefined => {\n if (!value) return undefined;\n if (value instanceof Date) return value;\n if (Array.isArray(value)) return value[0];\n return value.from ?? value.to;\n};\n\n/**\n * Walks from `start` in `step`-day increments until it finds a date that is not\n * disabled.\n *\n * Roving focus used to move one day and stop there whether or not that day could\n * be focused. A disabled day is a disabled button, and a disabled button cannot\n * take focus - but it was still the only cell with `tabIndex=0`, so a calendar\n * with Tuesdays disabled had zero reachable dates and ArrowRight could not get\n * past Monday.\n *\n * `limit` is what stops this searching forever when every date is disabled, which\n * `disabledDays={[0,1,2,3,4,5,6]}` or an empty min/max window can produce. On\n * giving up it returns undefined and the caller leaves focus where it was.\n */\nconst findEnabledDate = (\n start: Date,\n step: number,\n isDisabled: (date: Date) => boolean,\n limit = 366,\n): Date | undefined => {\n const candidate = new Date(start);\n for (let i = 0; i < limit; i++) {\n if (!isDisabled(candidate)) return new Date(candidate);\n candidate.setDate(candidate.getDate() + step);\n }\n return undefined;\n};\n\n/** Same day number in another month, clamped to that month's length. */\nconst shiftMonth = (date: Date, months: number): Date => {\n const target = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay = dateFnsGetDaysInMonth(target);\n target.setDate(Math.min(date.getDate(), lastDay));\n return target;\n};\n\nexport const Calendar = React.forwardRef<HTMLDivElement, CalendarProps>(\n (\n {\n mode = \"single\",\n value,\n defaultValue,\n onChange,\n minDate,\n maxDate,\n disabledDates,\n disabledDays,\n locale = \"en-US\",\n placeholder,\n label,\n error,\n helperText,\n className,\n inputClassName,\n calendarClassName,\n variant,\n size,\n showOutsideDays = true,\n firstDayOfWeek = 1,\n labels: labelOverrides,\n ...props\n },\n ref,\n ) => {\n const labels = useMemo(\n () => ({ ...DEFAULT_LABELS, ...labelOverrides }),\n [labelOverrides],\n );\n\n const [open, setOpen] = useState(false);\n // Opening a calendar that already has a value used to land on the current\n // month: `value={new Date(2020, 0, 15)}` opened September 2026 and left the\n // reader to page back eighty months.\n const [currentMonth, setCurrentMonth] = useState(\n () => anchorDate(value ?? defaultValue) ?? new Date(),\n );\n const [focusedDate, setFocusedDate] = useState<Date | null>(null);\n const calendarRef = useRef<HTMLDivElement>(null);\n const dayButtonRefs = useRef<Map<string, HTMLButtonElement>>(new Map());\n\n // Controlled vs uncontrolled\n const [internalValue, setInternalValue] = useState<\n Date | Date[] | { from?: Date; to?: Date } | undefined\n >(defaultValue);\n\n const isControlled = value !== undefined;\n const calendarValue = isControlled ? value : internalValue;\n\n const isDisabledDate = React.useCallback(\n (date: Date) =>\n isDateDisabled(date, minDate, maxDate, disabledDates, disabledDays),\n [minDate, maxDate, disabledDates, disabledDays],\n );\n\n /**\n * Where focus starts when the calendar opens.\n *\n * It used to be today, unconditionally. That is the wrong date twice over: it\n * ignores a selection the reader already made, and today may be disabled - in\n * which case the only cell with `tabIndex=0` was a disabled button, so the\n * grid had no tab stop at all.\n *\n * The order is: the selected date, then today, then the first enabled day of\n * the month on screen. If nothing in reach is enabled, focus stays unset and\n * the grid simply has no tab stop, which is the truth.\n */\n React.useLayoutEffect(() => {\n if (!open || focusedDate) return;\n\n const today = startOfDay(new Date());\n const selected = anchorDate(calendarValue);\n const preferred = [selected, today].find(\n (date): date is Date => !!date && !isDisabledDate(date),\n );\n if (preferred) {\n setFocusedDate(startOfDay(preferred));\n return;\n }\n\n const monthStart = startOfMonth(currentMonth);\n const firstEnabled = findEnabledDate(\n monthStart,\n 1,\n isDisabledDate,\n dateFnsGetDaysInMonth(currentMonth),\n );\n if (firstEnabled) setFocusedDate(firstEnabled);\n }, [open, focusedDate, calendarValue, currentMonth, isDisabledDate]);\n\n // Handle value changes\n const handleValueChange = (\n newValue: Date | Date[] | { from?: Date; to?: Date } | undefined,\n ) => {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n };\n\n // Handle date selection\n const handleDateClick = (date: Date) => {\n if (isDateDisabled(date, minDate, maxDate, disabledDates, disabledDays)) {\n return;\n }\n\n if (mode === \"single\") {\n handleValueChange(date);\n setOpen(false);\n } else if (mode === \"range\") {\n const rangeValue = calendarValue as\n { from?: Date; to?: Date } | undefined;\n if (!rangeValue?.from || (rangeValue.from && rangeValue.to)) {\n // Start new range\n handleValueChange({ from: date });\n } else {\n // Complete range\n const from = rangeValue.from;\n const to = date;\n if (to < from) {\n handleValueChange({ from: to, to: from });\n } else {\n handleValueChange({ from, to });\n }\n setOpen(false);\n }\n } else if (mode === \"multiple\") {\n const multipleValue = (calendarValue as Date[]) || [];\n const dateIndex = multipleValue.findIndex((d) => isSameDay(d, date));\n if (dateIndex >= 0) {\n // Remove date\n handleValueChange(multipleValue.filter((_, i) => i !== dateIndex));\n } else {\n // Add date\n handleValueChange([...multipleValue, date]);\n }\n }\n };\n\n // Get display value\n const displayValue = useMemo(() => {\n if (!calendarValue) return \"\";\n\n if (mode === \"single\") {\n return formatDate(calendarValue as Date, locale);\n } else if (mode === \"range\") {\n const range = calendarValue as { from?: Date; to?: Date };\n return formatDateRange(range.from, range.to, locale);\n } else {\n return formatMultipleDates(\n calendarValue as Date[],\n locale,\n labels.multipleSelected,\n );\n }\n }, [calendarValue, mode, locale, labels.multipleSelected]);\n\n // Generate calendar days\n const calendarDays = useMemo(() => {\n const days: Array<{\n date: Date;\n isCurrentMonth: boolean;\n isToday: boolean;\n /** A spacer that holds a column open without showing a date. */\n placeholder?: boolean;\n }> = [];\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n const firstDay = getFirstDayOfMonth(currentMonth, firstDayOfWeek);\n const daysInMonth = getDaysInMonth(currentMonth);\n\n // Previous month days.\n //\n // The leading cells exist whether or not the dates in them are shown: they\n // are what puts the first of the month under the right weekday. Only adding\n // them when `showOutsideDays` was on meant a September starting on a\n // Tuesday rendered its 1st in the Monday column, with every date of the\n // month one heading out for the rest of the grid.\n //\n // With outside days hidden they become empty, non-interactive placeholders\n // instead - see the `placeholder` flag below.\n if (firstDay > 0) {\n const prevMonth = new Date(\n currentMonth.getFullYear(),\n currentMonth.getMonth() - 1,\n );\n const daysInPrevMonth = getDaysInMonth(prevMonth);\n for (\n let i = daysInPrevMonth - firstDay + 1;\n i <= daysInPrevMonth;\n i++\n ) {\n const date = new Date(\n prevMonth.getFullYear(),\n prevMonth.getMonth(),\n i,\n );\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n placeholder: !showOutsideDays,\n });\n }\n }\n\n // Current month days\n for (let i = 1; i <= daysInMonth; i++) {\n const date = new Date(\n currentMonth.getFullYear(),\n currentMonth.getMonth(),\n i,\n );\n days.push({\n date,\n isCurrentMonth: true,\n isToday: isSameDay(date, today),\n });\n }\n\n // Next month days\n if (showOutsideDays) {\n const remainingDays = 42 - days.length; // 6 weeks * 7 days\n const nextMonth = new Date(\n currentMonth.getFullYear(),\n currentMonth.getMonth() + 1,\n );\n for (let i = 1; i <= remainingDays; i++) {\n const date = new Date(\n nextMonth.getFullYear(),\n nextMonth.getMonth(),\n i,\n );\n days.push({\n date,\n isCurrentMonth: false,\n isToday: isSameDay(date, today),\n });\n }\n }\n\n return days;\n }, [currentMonth, showOutsideDays, firstDayOfWeek]);\n\n // Navigate months\n /**\n * Moves the grid, and brings focus with it.\n *\n * The header buttons only moved the month. Focus stayed on a date that was no\n * longer rendered, so the grid lost its tab stop and an arrow key jumped back\n * to the month you had just left.\n */\n const goToMonth = (months: number) => {\n const target = new Date(\n currentMonth.getFullYear(),\n currentMonth.getMonth() + months,\n 1,\n );\n setCurrentMonth(target);\n\n if (!focusedDate) return;\n const sameDayNextMonth = shiftMonth(focusedDate, months);\n const landing =\n findEnabledDate(\n sameDayNextMonth,\n 1,\n isDisabledDate,\n dateFnsGetDaysInMonth(target),\n ) ??\n findEnabledDate(\n sameDayNextMonth,\n -1,\n isDisabledDate,\n dateFnsGetDaysInMonth(target),\n );\n if (landing) setFocusedDate(landing);\n };\n\n const goToPreviousMonth = () => goToMonth(-1);\n const goToNextMonth = () => goToMonth(1);\n\n const goToToday = () => {\n const today = startOfDay(new Date());\n setCurrentMonth(today);\n // Today can be disabled, in which case focus goes to the nearest day of\n // that month that is not.\n const landing =\n findEnabledDate(today, 1, isDisabledDate, 31) ??\n findEnabledDate(today, -1, isDisabledDate, 31);\n if (landing) setFocusedDate(landing);\n };\n\n // Keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent, date: Date) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleDateClick(date);\n return;\n }\n\n /**\n * Every movement lands on a date that can actually take focus.\n *\n * Each key used to step once and stop, disabled or not. The resulting cell\n * got the grid's only `tabIndex=0` while being a disabled button, so\n * ArrowRight into a disabled Tuesday left the grid with no tab stop and no\n * way forward - pressing it again did the same thing from the same place.\n */\n const moveFocus = (\n candidate: Date,\n step: number,\n limit?: number,\n ): void => {\n const target = findEnabledDate(candidate, step, isDisabledDate, limit);\n // Nothing enabled in that direction: stay where we are rather than\n // moving focus onto something that cannot hold it.\n if (!target) return;\n\n setFocusedDate(target);\n if (\n target.getMonth() !== currentMonth.getMonth() ||\n target.getFullYear() !== currentMonth.getFullYear()\n ) {\n setCurrentMonth(new Date(target.getFullYear(), target.getMonth(), 1));\n }\n };\n\n const step = (days: number) => {\n const candidate = new Date(date);\n candidate.setDate(candidate.getDate() + days);\n moveFocus(candidate, days > 0 ? 1 : -1);\n };\n\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n step(1);\n return;\n }\n\n if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n step(-1);\n return;\n }\n\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n step(7);\n return;\n }\n\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n step(-7);\n return;\n }\n\n if (e.key === \"Home\") {\n e.preventDefault();\n // Forwards from the 1st: the first day of the month that is enabled.\n moveFocus(\n new Date(date.getFullYear(), date.getMonth(), 1),\n 1,\n dateFnsGetDaysInMonth(date),\n );\n return;\n }\n\n if (e.key === \"End\") {\n e.preventDefault();\n moveFocus(\n new Date(date.getFullYear(), date.getMonth() + 1, 0),\n -1,\n dateFnsGetDaysInMonth(date),\n );\n return;\n }\n\n if (e.key === \"PageUp\") {\n e.preventDefault();\n // `new Date(y, m - 1, 31)` from 31 March is 3 March, so a month-step from\n // the end of a long month used to skip the short month entirely.\n moveFocus(shiftMonth(date, -1), -1);\n return;\n }\n\n if (e.key === \"PageDown\") {\n e.preventDefault();\n moveFocus(shiftMonth(date, 1), 1);\n return;\n }\n\n if (e.key === \"Escape\") {\n e.preventDefault();\n setOpen(false);\n return;\n }\n };\n\n // Focus management\n useEffect(() => {\n if (focusedDate && open) {\n const dateKey = `${focusedDate.getFullYear()}-${focusedDate.getMonth()}-${focusedDate.getDate()}`;\n const button = dayButtonRefs.current.get(dateKey);\n if (button) {\n button.focus();\n }\n }\n }, [focusedDate, open]);\n\n // Day names\n const dayNames = useMemo(\n () => getDayNames(locale, firstDayOfWeek),\n [locale, firstDayOfWeek],\n );\n\n // Month/year display\n const monthYearDisplay = currentMonth.toLocaleDateString(locale, {\n month: \"long\",\n year: \"numeric\",\n });\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)} {...props}>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div className=\"space-y-2\">\n {label && (\n <label className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\">\n {label}\n </label>\n )}\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n className={cn(\n \"flex w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background\",\n \"placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2\",\n \"disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200 text-left\",\n error\n ? \"border-error-500 shadow-sm hover:border-error-600 focus-visible:ring-error-500/20 focus-visible:border-error-500\"\n : \"border-border shadow-sm hover:border-primary focus-visible:ring-ring/20 focus-visible:border-primary\",\n \"h-10\",\n inputClassName,\n )}\n // No onFocus handler here. Radix returns focus to the trigger\n // when the popover closes, so opening on focus meant selecting a\n // date closed it and immediately reopened it - the flicker. It\n // also popped the calendar open when tabbing past the field.\n onClick={() => setOpen(true)}\n aria-label={label || labels.openCalendar}\n aria-invalid={error}\n >\n {displayValue || (\n <span className=\"text-muted-foreground\">\n {placeholder ?? labels.placeholder}\n </span>\n )}\n </button>\n </Popover.Trigger>\n {helperText && (\n <p\n className={cn(\n \"text-sm text-muted-foreground\",\n error && \"text-error-600\",\n )}\n >\n {helperText}\n </p>\n )}\n </div>\n\n <Popover.Portal>\n <Popover.Content\n className={cn(\n \"z-50 w-auto rounded-lg border bg-popover p-4 shadow-lg\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n \"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n sideOffset={5}\n align=\"start\"\n >\n <div\n ref={calendarRef}\n className={cn(\n calendarVariants({ variant, size }),\n calendarClassName,\n )}\n role=\"application\"\n aria-label=\"Calendar\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between mb-4\">\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={goToPreviousMonth}\n aria-label={labels.previousMonth}\n >\n <svg\n className=\"h-4 w-4\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </Button>\n\n <h3\n className=\"text-sm font-semibold text-popover-foreground\"\n data-testid=\"calendar-month-year\"\n >\n {monthYearDisplay}\n </h3>\n\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={goToNextMonth}\n aria-label={labels.nextMonth}\n >\n <svg\n className=\"h-4 w-4\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </Button>\n </div>\n\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={goToToday}\n className=\"text-xs\"\n >\n {labels.today}\n </Button>\n </div>\n\n {/* Day names */}\n <div className=\"grid grid-cols-7 gap-1 mb-2\">\n {dayNames.map((day) => (\n <div\n key={day}\n className=\"text-center text-xs font-medium text-muted-foreground\"\n >\n {day}\n </div>\n ))}\n </div>\n\n {/* Calendar grid */}\n <div className=\"grid grid-cols-7 gap-1\">\n {calendarDays.map((day, index) => {\n const isSelected =\n mode === \"single\"\n ? isSameDay(day.date, calendarValue as Date | undefined)\n : mode === \"range\"\n ? isDateInRange(\n day.date,\n (calendarValue as { from?: Date; to?: Date })\n ?.from,\n (calendarValue as { from?: Date; to?: Date })?.to,\n )\n : (calendarValue as Date[])?.some((d) =>\n isSameDay(d, day.date),\n );\n\n const isDisabled = isDateDisabled(\n day.date,\n minDate,\n maxDate,\n disabledDates,\n disabledDays,\n );\n\n const isInRange =\n mode === \"range\" &&\n (calendarValue as { from?: Date; to?: Date })?.from &&\n !(calendarValue as { from?: Date; to?: Date })?.to &&\n day.date >=\n (calendarValue as { from?: Date; to?: Date }).from!;\n\n const dateKey = `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`;\n const isFocused =\n focusedDate && isSameDay(day.date, focusedDate);\n\n // A leading spacer: it holds the column open so the first\n // of the month lands under the right weekday, and it is not\n // a control, so it is out of the tab order and out of the\n // accessibility tree.\n if (day.placeholder) {\n return (\n <div\n key={`placeholder-${index}`}\n aria-hidden=\"true\"\n data-calendar-placeholder=\"\"\n className={cn(\n calendarDayVariants({ variant: \"default\", size }),\n \"invisible\",\n )}\n />\n );\n }\n\n return (\n <button\n key={`${day.date.getTime()}-${index}`}\n ref={(el) => {\n if (el) {\n dayButtonRefs.current.set(dateKey, el);\n } else {\n dayButtonRefs.current.delete(dateKey);\n }\n }}\n type=\"button\"\n onClick={() => {\n if (showOutsideDays && !day.isCurrentMonth) {\n // Navigate to the month of the clicked date\n setCurrentMonth(\n new Date(\n day.date.getFullYear(),\n day.date.getMonth(),\n 1,\n ),\n );\n // Synchronously: React batches both updates into one\n // render. Deferring the selection by a tick showed the\n // new month first and selected a frame later, which\n // read as a flash.\n handleDateClick(day.date);\n } else {\n handleDateClick(day.date);\n }\n }}\n onKeyDown={(e) => handleKeyDown(e, day.date)}\n disabled={\n isDisabled ||\n (showOutsideDays ? false : !day.isCurrentMonth)\n }\n className={cn(\n calendarDayVariants({\n variant: isSelected\n ? \"selected\"\n : isInRange\n ? \"range\"\n : day.isToday\n ? \"today\"\n : !day.isCurrentMonth\n ? \"outside\"\n : isDisabled\n ? \"disabled\"\n : \"default\",\n size,\n }),\n !day.isCurrentMonth && \"opacity-50\",\n isFocused &&\n \"ring-2 ring-brand-500 ring-offset-2 z-10\",\n )}\n aria-label={day.date.toLocaleDateString(locale, {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n })}\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n tabIndex={isFocused ? 0 : -1}\n >\n {day.date.getDate()}\n </button>\n );\n })}\n </div>\n\n {/* Footer for range mode */}\n {mode === \"range\" &&\n (calendarValue as { from?: Date; to?: Date })?.from &&\n !(calendarValue as { from?: Date; to?: Date })?.to && (\n <div className=\"mt-4 pt-4 border-t border-border\">\n <p className=\"text-xs text-muted-foreground text-center\">\n {labels.selectEndDate}\n </p>\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n </div>\n );\n },\n);\n\nCalendar.displayName = \"Calendar\";\n\nexport { calendarVariants, calendarDayVariants };\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import {a as a$1}from'./chunk-AVTJE2O2.js';import {a}from'./chunk-AC2JBXHQ.js';import*as t from'react';import*as e from'@radix-ui/react-alert-dialog';var P=e.Root,y=e.Trigger,s=e.Portal,n=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Overlay,{ref:o,className:a("fixed inset-0 z-50 bg-neutral-950/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",i),...a$1}));n.displayName=e.Overlay.displayName;var c=t.forwardRef(({className:i,...a$1},o)=>t.createElement(s,null,t.createElement(n,null),t.createElement(e.Content,{ref:o,className:a("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",i),...a$1})));c.displayName=e.Content.displayName;function f({className:i,...a$1}){return t.createElement("div",{className:a("flex flex-col gap-2",i),...a$1})}f.displayName="AlertDialogHeader";function d({className:i,...a$1}){return t.createElement("div",{className:a("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",i),...a$1})}d.displayName="AlertDialogFooter";var p=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Title,{ref:o,className:a("text-lg font-semibold text-foreground",i),...a$1}));p.displayName=e.Title.displayName;var g=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Description,{ref:o,className:a("text-sm text-muted-foreground",i),...a$1}));g.displayName=e.Description.displayName;var A=t.forwardRef(({className:i,variant:a$2="destructive",...o},m)=>t.createElement(e.Action,{ref:m,className:a(a$1({variant:a$2}),i),...o}));A.displayName=e.Action.displayName;var D=t.forwardRef(({className:i,...a$2},o)=>t.createElement(e.Cancel,{ref:o,className:a(a$1({variant:"outline"}),i),...a$2}));D.displayName=e.Cancel.displayName;export{P as a,y as b,s as c,n as d,c as e,f,d as g,p as h,g as i,A as j,D as k};//# sourceMappingURL=chunk-CT6LEOBW.js.map
3
- //# sourceMappingURL=chunk-CT6LEOBW.js.map
2
+ import {a as a$1}from'./chunk-O2VT23LK.js';import {a}from'./chunk-AC2JBXHQ.js';import*as t from'react';import*as e from'@radix-ui/react-alert-dialog';var P=e.Root,y=e.Trigger,s=e.Portal,n=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Overlay,{ref:o,className:a("fixed inset-0 z-50 bg-neutral-950/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",i),...a$1}));n.displayName=e.Overlay.displayName;var c=t.forwardRef(({className:i,...a$1},o)=>t.createElement(s,null,t.createElement(n,null),t.createElement(e.Content,{ref:o,className:a("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",i),...a$1})));c.displayName=e.Content.displayName;function f({className:i,...a$1}){return t.createElement("div",{className:a("flex flex-col gap-2",i),...a$1})}f.displayName="AlertDialogHeader";function d({className:i,...a$1}){return t.createElement("div",{className:a("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",i),...a$1})}d.displayName="AlertDialogFooter";var p=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Title,{ref:o,className:a("text-lg font-semibold text-foreground",i),...a$1}));p.displayName=e.Title.displayName;var g=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Description,{ref:o,className:a("text-sm text-muted-foreground",i),...a$1}));g.displayName=e.Description.displayName;var A=t.forwardRef(({className:i,variant:a$2="destructive",...o},m)=>t.createElement(e.Action,{ref:m,className:a(a$1({variant:a$2}),i),...o}));A.displayName=e.Action.displayName;var D=t.forwardRef(({className:i,...a$2},o)=>t.createElement(e.Cancel,{ref:o,className:a(a$1({variant:"outline"}),i),...a$2}));D.displayName=e.Cancel.displayName;export{P as a,y as b,s as c,n as d,c as e,f,d as g,p as h,g as i,A as j,D as k};//# sourceMappingURL=chunk-BQPFZMGP.js.map
3
+ //# sourceMappingURL=chunk-BQPFZMGP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/core/alert-dialog.tsx"],"names":["AlertDialog","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","className","props","ref","cn","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","variant","buttonVariants","AlertDialogCancel"],"mappings":"sJA2BA,IAAMA,CAAAA,CAAmC,CAAA,CAAA,IAAA,CACnCC,CAAAA,CAA0C,CAAA,CAAA,OAAA,CAC1CC,CAAAA,CAAyC,CAAA,CAAA,MAAA,CAEzCC,CAAAA,CAA2B,CAAA,CAAA,UAAA,CAG/B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,GAAM,CAAA,CAAGC,CAAAA,GAC1B,CAAA,CAAA,aAAA,CAAsB,CAAA,CAAA,OAAA,CAArB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWC,CAAAA,CACT,8JAAA,CAEAH,CACF,CAAA,CACC,GAAGC,GAAAA,CACN,CACD,EACDF,CAAAA,CAAmB,WAAA,CAAmC,CAAA,CAAA,OAAA,CAAQ,WAAA,CAE9D,IAAMK,CAAAA,CAA2B,CAAA,CAAA,UAAA,CAG/B,CAAC,CAAE,SAAA,CAAAJ,CAAAA,C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AAO,WAAA","file":"chunk-CT6LEOBW.js","sourcesContent":["import * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\n/**\n * A modal that interrupts to confirm something consequential: delete, revoke,\n * overwrite.\n *\n * Not a variant of `Dialog`, and not a styling choice. Radix enforces three\n * differences, all verified rather than assumed:\n *\n * - `role=\"alertdialog\"`, so it is announced as one\n * - clicking outside does not dismiss it, so a confirmation cannot be lost by\n * missing the button\n * - focus starts on Cancel, not on the action, so a reflexive Enter cancels\n * rather than deletes\n *\n * Escape *does* close it. That is deliberate on Radix's part and correct: a\n * modal a keyboard user cannot leave is a trap, and the APG asks every dialog to\n * be dismissible that way. Cancelling is the safe outcome here, so nothing is\n * lost by it.\n *\n * Reach for `Dialog` when the user opened it on purpose and can walk away, and\n * for this when the app is asking a question it needs answered.\n */\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-neutral-950/50 data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 \" +\n \"rounded-xl border border-border bg-background p-6 shadow-lg \" +\n \"data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 \" +\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"flex flex-col gap-2\", className)} {...props} />;\n}\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nexport interface AlertDialogActionProps extends React.ComponentPropsWithoutRef<\n typeof AlertDialogPrimitive.Action\n> {\n /**\n * Most alert dialogs confirm something destructive, so this defaults to the\n * destructive button rather than leaving every call site to remember.\n */\n variant?: \"default\" | \"destructive\";\n}\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n AlertDialogActionProps\n>(({ className, variant = \"destructive\", ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ variant }), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"]}
1
+ {"version":3,"sources":["../src/components/core/alert-dialog.tsx"],"names":["AlertDialog","AlertDialogTrigger","AlertDialogPortal","AlertDialogOverlay","className","props","ref","cn","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","variant","buttonVariants","AlertDialogCancel"],"mappings":"sJA2BA,IAAMA,CAAAA,CAAmC,CAAA,CAAA,IAAA,CACnCC,CAAAA,CAA0C,CAAA,CAAA,OAAA,CAC1CC,CAAAA,CAAyC,CAAA,CAAA,MAAA,CAEzCC,CAAAA,CAA2B,CAAA,CAAA,UAAA,CAG/B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,GAAM,CAAA,CAAGC,CAAAA,GAC1B,CAAA,CAAA,aAAA,CAAsB,CAAA,CAAA,O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AAAA,GAC1B,CAAA,CAAA,aAAA,CAAsB,CAAA,CAAA,MAAA,CAArB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWC,CAAAA,CAAGQ,GAAAA,CAAe,CAAE,OAAA,CAAS,SAAU,CAAC,CAAA,CAAGX,CAAS,CAAA,CAC9D,GAAGC,GAAAA,CACN,CACD,EACDW,CAAAA,CAAkB,WAAA,CAAmC,CAAA,CAAA,MAAA,CAAO,WAAA","file":"chunk-BQPFZMGP.js","sourcesContent":["import * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\n/**\n * A modal that interrupts to confirm something consequential: delete, revoke,\n * overwrite.\n *\n * Not a variant of `Dialog`, and not a styling choice. Radix enforces three\n * differences, all verified rather than assumed:\n *\n * - `role=\"alertdialog\"`, so it is announced as one\n * - clicking outside does not dismiss it, so a confirmation cannot be lost by\n * missing the button\n * - focus starts on Cancel, not on the action, so a reflexive Enter cancels\n * rather than deletes\n *\n * Escape *does* close it. That is deliberate on Radix's part and correct: a\n * modal a keyboard user cannot leave is a trap, and the APG asks every dialog to\n * be dismissible that way. Cancelling is the safe outcome here, so nothing is\n * lost by it.\n *\n * Reach for `Dialog` when the user opened it on purpose and can walk away, and\n * for this when the app is asking a question it needs answered.\n */\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-neutral-950/50 data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 \" +\n \"rounded-xl border border-border bg-background p-6 shadow-lg \" +\n \"data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 \" +\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"flex flex-col gap-2\", className)} {...props} />;\n}\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nexport interface AlertDialogActionProps extends React.ComponentPropsWithoutRef<\n typeof AlertDialogPrimitive.Action\n> {\n /**\n * Most alert dialogs confirm something destructive, so this defaults to the\n * destructive button rather than leaving every call site to remember.\n */\n variant?: \"default\" | \"destructive\";\n}\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n AlertDialogActionProps\n>(({ className, variant = \"destructive\", ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ variant }), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import {b}from'./chunk-AVTJE2O2.js';import {a}from'./chunk-AC2JBXHQ.js';import e,{useState,useCallback}from'react';import {cva}from'class-variance-authority';var S=cva("grid gap-4",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6"},spacing:{sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{columns:3,spacing:"md"}}),q=cva("relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg",{variants:{aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",landscape:"aspect-[4/3]",wide:"aspect-[16/9]"},hover:{none:"",scale:"hover:scale-105",zoom:"hover:scale-110",lift:"hover:-translate-y-2"}},defaultVariants:{aspectRatio:"square",hover:"scale"}}),A=cva("fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm",{variants:{animation:{fade:"animate-in fade-in duration-300",slide:"animate-in slide-in-from-bottom duration-300",zoom:"animate-in zoom-in duration-300"}},defaultVariants:{animation:"fade"}}),B=({images:a$1,className:y,itemClassName:k,columns:w=3,spacing:N="md",showLightbox:g=true,lightboxAnimation:I="fade",onImageClick:v,itemHover:V="scale",itemAspectRatio:C="square",showThumbnails:z=false,thumbnailSize:D="md",...P})=>{let[l,r]=useState(null),[i,n]=useState(-1),f=useCallback((t,s)=>{g&&(r(t),n(s)),v?.(t,s);},[g,v]),d=useCallback(()=>{r(null),n(-1);},[]),b$1=useCallback(()=>{if(i>0){let t=i-1;r(a$1[t]||null),n(t);}},[i,a$1]),p=useCallback(()=>{if(i<a$1.length-1){let t=i+1;r(a$1[t]||null),n(t);}},[i,a$1]),G=useCallback(t=>{t.key==="Escape"?d():t.key==="ArrowLeft"?b$1():t.key==="ArrowRight"&&p();},[d,b$1,p]);return e.createElement(e.Fragment,null,e.createElement("div",{className:a(S({columns:w,spacing:N}),y),...P},a$1.map((t,s)=>e.createElement("div",{key:t.id||s,className:a(q({aspectRatio:C,hover:V}),k),role:"button",tabIndex:0,onClick:()=>f(t,s),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(t,s));},"aria-label":`View image ${s+1}: ${t.alt}`},e.createElement("img",{src:z&&t.thumbnail?t.thumbnail:t.src,alt:t.alt,className:"w-full h-full object-cover",loading:"lazy"}),(t.title||t.description)&&e.createElement("div",{className:"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end"},e.createElement("div",{className:"p-4 text-white"},t.title&&e.createElement("h3",{className:"font-semibold text-sm sm:text-base"},t.title),t.description&&e.createElement("p",{className:"text-xs sm:text-sm text-white/80 mt-1"},t.description)))))),l&&g&&e.createElement("div",{className:a(A({animation:I})),onClick:d,onKeyDown:G,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"lightbox-title"},e.createElement("div",{className:"relative max-w-4xl max-h-[90vh] mx-4",onClick:t=>t.stopPropagation()},e.createElement("img",{src:l.src,alt:l.alt,className:"max-w-full max-h-full object-contain rounded-lg",id:"lightbox-title"}),(l.title||l.description)&&e.createElement("div",{className:"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg"},l.title&&e.createElement("h3",{className:"font-semibold text-lg mb-2"},l.title),l.description&&e.createElement("p",{className:"text-sm text-white/80"},l.description)),a$1.length>1&&e.createElement(e.Fragment,null,i>0&&e.createElement(b,{variant:"ghost",size:"sm",className:"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:b$1,"aria-label":"Previous image"},"\u2190"),i<a$1.length-1&&e.createElement(b,{variant:"ghost",size:"sm",className:"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:p,"aria-label":"Next image"},"\u2192")),e.createElement(b,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white",onClick:d,"aria-label":"Close lightbox"},"\u2715"),a$1.length>1&&e.createElement("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm"},i+1," / ",a$1.length))))},F=B;export{B as a,F as b};//# sourceMappingURL=chunk-2JQROMCM.js.map
3
- //# sourceMappingURL=chunk-2JQROMCM.js.map
2
+ import {b}from'./chunk-O2VT23LK.js';import {a}from'./chunk-AC2JBXHQ.js';import e,{useState,useCallback}from'react';import {cva}from'class-variance-authority';var S=cva("grid gap-4",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6"},spacing:{sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{columns:3,spacing:"md"}}),q=cva("relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg",{variants:{aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",landscape:"aspect-[4/3]",wide:"aspect-[16/9]"},hover:{none:"",scale:"hover:scale-105",zoom:"hover:scale-110",lift:"hover:-translate-y-2"}},defaultVariants:{aspectRatio:"square",hover:"scale"}}),A=cva("fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm",{variants:{animation:{fade:"animate-in fade-in duration-300",slide:"animate-in slide-in-from-bottom duration-300",zoom:"animate-in zoom-in duration-300"}},defaultVariants:{animation:"fade"}}),B=({images:a$1,className:y,itemClassName:k,columns:w=3,spacing:N="md",showLightbox:g=true,lightboxAnimation:I="fade",onImageClick:v,itemHover:V="scale",itemAspectRatio:C="square",showThumbnails:z=false,thumbnailSize:D="md",...P})=>{let[l,r]=useState(null),[i,n]=useState(-1),f=useCallback((t,s)=>{g&&(r(t),n(s)),v?.(t,s);},[g,v]),d=useCallback(()=>{r(null),n(-1);},[]),b$1=useCallback(()=>{if(i>0){let t=i-1;r(a$1[t]||null),n(t);}},[i,a$1]),p=useCallback(()=>{if(i<a$1.length-1){let t=i+1;r(a$1[t]||null),n(t);}},[i,a$1]),G=useCallback(t=>{t.key==="Escape"?d():t.key==="ArrowLeft"?b$1():t.key==="ArrowRight"&&p();},[d,b$1,p]);return e.createElement(e.Fragment,null,e.createElement("div",{className:a(S({columns:w,spacing:N}),y),...P},a$1.map((t,s)=>e.createElement("div",{key:t.id||s,className:a(q({aspectRatio:C,hover:V}),k),role:"button",tabIndex:0,onClick:()=>f(t,s),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(t,s));},"aria-label":`View image ${s+1}: ${t.alt}`},e.createElement("img",{src:z&&t.thumbnail?t.thumbnail:t.src,alt:t.alt,className:"w-full h-full object-cover",loading:"lazy"}),(t.title||t.description)&&e.createElement("div",{className:"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end"},e.createElement("div",{className:"p-4 text-white"},t.title&&e.createElement("h3",{className:"font-semibold text-sm sm:text-base"},t.title),t.description&&e.createElement("p",{className:"text-xs sm:text-sm text-white/80 mt-1"},t.description)))))),l&&g&&e.createElement("div",{className:a(A({animation:I})),onClick:d,onKeyDown:G,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"lightbox-title"},e.createElement("div",{className:"relative max-w-4xl max-h-[90vh] mx-4",onClick:t=>t.stopPropagation()},e.createElement("img",{src:l.src,alt:l.alt,className:"max-w-full max-h-full object-contain rounded-lg",id:"lightbox-title"}),(l.title||l.description)&&e.createElement("div",{className:"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg"},l.title&&e.createElement("h3",{className:"font-semibold text-lg mb-2"},l.title),l.description&&e.createElement("p",{className:"text-sm text-white/80"},l.description)),a$1.length>1&&e.createElement(e.Fragment,null,i>0&&e.createElement(b,{variant:"ghost",size:"sm",className:"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:b$1,"aria-label":"Previous image"},"\u2190"),i<a$1.length-1&&e.createElement(b,{variant:"ghost",size:"sm",className:"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:p,"aria-label":"Next image"},"\u2192")),e.createElement(b,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white",onClick:d,"aria-label":"Close lightbox"},"\u2715"),a$1.length>1&&e.createElement("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm"},i+1," / ",a$1.length))))},F=B;export{B as a,F as b};//# sourceMappingURL=chunk-F6CQ5ODU.js.map
3
+ //# sourceMappingURL=chunk-F6CQ5ODU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/marketing/gallery.tsx"],"names":["galleryVariants","cva","galleryItemVariants","lightboxVariants","Gallery","images","className","itemClassName","columns","spacing","showLightbox","lightboxAnimation","onImageClick","itemHover","itemAspectRatio","showThumbnails","_thumbnailSize","props","selectedImage","setSelectedImage","useState","selectedIndex","setSelectedIndex","handleImageClick","useCallback","image","index","handleCloseLightbox","handlePrevious","newIndex","handleNext","handleKeyDown","e","React","cn","Button","gallery_default"],"mappings":"8JAKA,IAAMA,CAAAA,CAAkBC,GAAAA,CACtB,aACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,CAAA,CAAG,aAAA,CACH,CAAA,CAAG,6BACH,CAAA,CAAG,2CAAA,CACH,CAAA,CAAG,2CAAA,CACH,EAAG,0DAAA,CACH,CAAA,CAAG,0DACL,CAAA,CACA,QAAS,CACP,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,CAAA,CACT,OAAA,CAAS,IACX,CACF,CACF,CAAA,CAEMC,CAAAA,CAAsBD,GAAAA,CAC1B,6GAAA,CACA,CACE,QAAA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jB,CAEJ,EAIDb,GAAAA,CAAO,MAAA,CAAS,CAAA,EACf4B,CAAAA,CAAA,cAAAA,CAAAA,CAAA,QAAA,CAAA,IAAA,CACGZ,CAAAA,CAAgB,CAAA,EACfY,CAAAA,CAAA,aAAA,CAACE,CAAAA,CAAA,CACC,QAAQ,OAAA,CACR,IAAA,CAAK,IAAA,CACL,SAAA,CAAU,mFAAA,CACV,OAAA,CAASP,GAAAA,CACT,YAAA,CAAW,kBACZ,QAED,CAAA,CAEDP,CAAAA,CAAgBhB,GAAAA,CAAO,MAAA,CAAS,CAAA,EAC/B4B,CAAAA,CAAA,aAAA,CAACE,EAAA,CACC,OAAA,CAAQ,OAAA,CACR,IAAA,CAAK,KACL,SAAA,CAAU,oFAAA,CACV,OAAA,CAASL,CAAAA,CACT,aAAW,YAAA,CAAA,CACZ,QAED,CAEJ,CAAA,CAIFG,CAAAA,CAAA,aAAA,CAACE,CAAAA,CAAA,CACC,QAAQ,OAAA,CACR,IAAA,CAAK,IAAA,CACL,SAAA,CAAU,kEACV,OAAA,CAASR,CAAAA,CACT,YAAA,CAAW,gBAAA,CAAA,CACZ,QAED,CAAA,CAGCtB,GAAAA,CAAO,MAAA,CAAS,CAAA,EACf4B,CAAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,+EACZZ,CAAAA,CAAgB,CAAA,CAAE,KAAA,CAAIhB,GAAAA,CAAO,MAChC,CAEJ,CACF,CAEJ,CAEJ,EAEO+B,CAAAA,CAAQhC","file":"chunk-2JQROMCM.js","sourcesContent":["import React, { useState, useCallback } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/core/button';\n\nconst galleryVariants = cva(\n 'grid gap-4',\n {\n variants: {\n columns: {\n 1: 'grid-cols-1',\n 2: 'grid-cols-1 sm:grid-cols-2',\n 3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',\n 4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',\n 5: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5',\n 6: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6',\n },\n spacing: {\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n },\n defaultVariants: {\n columns: 3,\n spacing: 'md',\n },\n }\n);\n\nconst galleryItemVariants = cva(\n 'relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg',\n {\n variants: {\n aspectRatio: {\n square: 'aspect-square',\n video: 'aspect-video',\n portrait: 'aspect-[3/4]',\n landscape: 'aspect-[4/3]',\n wide: 'aspect-[16/9]',\n },\n hover: {\n none: '',\n scale: 'hover:scale-105',\n zoom: 'hover:scale-110',\n lift: 'hover:-translate-y-2',\n },\n },\n defaultVariants: {\n aspectRatio: 'square',\n hover: 'scale',\n },\n }\n);\n\nconst lightboxVariants = cva(\n 'fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm',\n {\n variants: {\n animation: {\n fade: 'animate-in fade-in duration-300',\n slide: 'animate-in slide-in-from-bottom duration-300',\n zoom: 'animate-in zoom-in duration-300',\n },\n },\n defaultVariants: {\n animation: 'fade',\n },\n }\n);\n\nexport interface GalleryImage {\n id: string;\n src: string;\n alt: string;\n title?: string;\n description?: string;\n thumbnail?: string;\n}\n\nexport interface GalleryProps extends VariantProps<typeof galleryVariants> {\n images: GalleryImage[];\n className?: string;\n itemClassName?: string;\n showLightbox?: boolean;\n lightboxAnimation?: VariantProps<typeof lightboxVariants>['animation'];\n onImageClick?: (image: GalleryImage, index: number) => void;\n itemHover?: VariantProps<typeof galleryItemVariants>['hover'];\n itemAspectRatio?: VariantProps<typeof galleryItemVariants>['aspectRatio'];\n showThumbnails?: boolean;\n thumbnailSize?: 'sm' | 'md' | 'lg';\n}\n\nexport const Gallery: React.FC<GalleryProps> = ({\n images,\n className,\n itemClassName,\n columns = 3,\n spacing = 'md',\n showLightbox = true,\n lightboxAnimation = 'fade',\n onImageClick,\n itemHover = 'scale',\n itemAspectRatio = 'square',\n showThumbnails = false,\n thumbnailSize: _thumbnailSize = 'md',\n ...props\n}) => {\n const [selectedImage, setSelectedImage] = useState<GalleryImage | null>(null);\n const [selectedIndex, setSelectedIndex] = useState<number>(-1);\n\n const handleImageClick = useCallback((image: GalleryImage, index: number) => {\n if (showLightbox) {\n setSelectedImage(image);\n setSelectedIndex(index);\n }\n onImageClick?.(image, index);\n }, [showLightbox, onImageClick]);\n\n const handleCloseLightbox = useCallback(() => {\n setSelectedImage(null);\n setSelectedIndex(-1);\n }, []);\n\n const handlePrevious = useCallback(() => {\n if (selectedIndex > 0) {\n const newIndex = selectedIndex - 1;\n setSelectedImage(images[newIndex] || null);\n setSelectedIndex(newIndex);\n }\n }, [selectedIndex, images]);\n\n const handleNext = useCallback(() => {\n if (selectedIndex < images.length - 1) {\n const newIndex = selectedIndex + 1;\n setSelectedImage(images[newIndex] || null);\n setSelectedIndex(newIndex);\n }\n }, [selectedIndex, images]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n handleCloseLightbox();\n } else if (e.key === 'ArrowLeft') {\n handlePrevious();\n } else if (e.key === 'ArrowRight') {\n handleNext();\n }\n }, [handleCloseLightbox, handlePrevious, handleNext]);\n\n return (\n <>\n <div \n className={cn(galleryVariants({ columns, spacing }), className)}\n {...props}\n >\n {images.map((image, index) => (\n <div\n key={image.id || index}\n className={cn(\n galleryItemVariants({ \n aspectRatio: itemAspectRatio, \n hover: itemHover \n }),\n itemClassName\n )}\n role=\"button\"\n tabIndex={0}\n onClick={() => handleImageClick(image, index)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleImageClick(image, index);\n }\n }}\n aria-label={`View image ${index + 1}: ${image.alt}`}\n >\n <img\n src={showThumbnails && image.thumbnail ? image.thumbnail : image.src}\n alt={image.alt}\n className=\"w-full h-full object-cover\"\n loading=\"lazy\"\n />\n {(image.title || image.description) && (\n <div className=\"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end\">\n <div className=\"p-4 text-white\">\n {image.title && (\n <h3 className=\"font-semibold text-sm sm:text-base\">\n {image.title}\n </h3>\n )}\n {image.description && (\n <p className=\"text-xs sm:text-sm text-white/80 mt-1\">\n {image.description}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n ))}\n </div>\n\n {selectedImage && showLightbox && (\n <div\n className={cn(lightboxVariants({ animation: lightboxAnimation }))}\n onClick={handleCloseLightbox}\n onKeyDown={handleKeyDown}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"lightbox-title\"\n >\n <div \n className=\"relative max-w-4xl max-h-[90vh] mx-4\"\n onClick={(e) => e.stopPropagation()}\n >\n <img\n src={selectedImage.src}\n alt={selectedImage.alt}\n className=\"max-w-full max-h-full object-contain rounded-lg\"\n id=\"lightbox-title\"\n />\n \n {(selectedImage.title || selectedImage.description) && (\n <div className=\"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg\">\n {selectedImage.title && (\n <h3 className=\"font-semibold text-lg mb-2\">\n {selectedImage.title}\n </h3>\n )}\n {selectedImage.description && (\n <p className=\"text-sm text-white/80\">\n {selectedImage.description}\n </p>\n )}\n </div>\n )}\n\n {/* Navigation buttons */}\n {images.length > 1 && (\n <>\n {selectedIndex > 0 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handlePrevious}\n aria-label=\"Previous image\"\n >\n ←\n </Button>\n )}\n {selectedIndex < images.length - 1 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handleNext}\n aria-label=\"Next image\"\n >\n →\n </Button>\n )}\n </>\n )}\n\n {/* Close button */}\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handleCloseLightbox}\n aria-label=\"Close lightbox\"\n >\n ✕\n </Button>\n\n {/* Image counter */}\n {images.length > 1 && (\n <div className=\"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm\">\n {selectedIndex + 1} / {images.length}\n </div>\n )}\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport default Gallery;\n"]}
1
+ {"version":3,"sources":["../src/components/marketing/gallery.tsx"],"names":["galleryVariants","cva","galleryItemVariants","lightboxVariants","Gallery","images","className","itemClassName","columns","spacing","showLightbox","lightboxAnimation","onImageClick","itemHover","itemAspectRatio","showThumbnails","_thumbnailSize","props","selectedImage","setSelectedImage","useState","selectedIndex","setSelectedIndex","handleImageClick","useCallback","image","index","handleCloseLightbox","handlePrevious","newIndex","handleNext","handleKeyDown","e","React","cn","Button","gallery_default"],"mappings":"8JAKA,IAAMA,CAAAA,CAAkBC,GAAAA,CACtB,aACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,CAAA,CAAG,aAAA,CACH,CAAA,CAAG,6BACH,CAAA,CAAG,2CAAA,CACH,CAAA,CAAG,2CAAA,CACH,EAAG,0DAAA,CACH,CAAA,CAAG,0DACL,CAAA,CACA,QAAS,CACP,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OAAA,CACJ,EAAA,CAAI,OACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,CAAA,CACT,OAAA,CAAS,IACX,CACF,CACF,CAAA,CAEMC,CAAAA,CAAsBD,GAAAA,CAC1B,6GAAA,CACA,CACE,QAAA,CAAU,CACR,YAAa,CACX,MAAA,CAAQ,eAAA,CACR,KAAA,CAAO,eACP,QAAA,CAAU,cAAA,CACV,SAAA,CAAW,cAAA,CACX,KAAM,eACR,CAA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AAgB,CAAA,EACfY,CAAAA,CAAA,aAAA,CAACE,CAAAA,CAAA,CACC,QAAQ,OAAA,CACR,IAAA,CAAK,IAAA,CACL,SAAA,CAAU,mFAAA,CACV,OAAA,CAASP,GAAAA,CACT,YAAA,CAAW,kBACZ,QAED,CAAA,CAEDP,CAAAA,CAAgBhB,GAAAA,CAAO,MAAA,CAAS,CAAA,EAC/B4B,CAAAA,CAAA,aAAA,CAACE,EAAA,CACC,OAAA,CAAQ,OAAA,CACR,IAAA,CAAK,KACL,SAAA,CAAU,oFAAA,CACV,OAAA,CAASL,CAAAA,CACT,aAAW,YAAA,CAAA,CACZ,QAED,CAEJ,CAAA,CAIFG,CAAAA,CAAA,aAAA,CAACE,CAAAA,CAAA,CACC,QAAQ,OAAA,CACR,IAAA,CAAK,IAAA,CACL,SAAA,CAAU,kEACV,OAAA,CAASR,CAAAA,CACT,YAAA,CAAW,gBAAA,CAAA,CACZ,QAED,CAAA,CAGCtB,GAAAA,CAAO,MAAA,CAAS,CAAA,EACf4B,CAAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,+EACZZ,CAAAA,CAAgB,CAAA,CAAE,KAAA,CAAIhB,GAAAA,CAAO,MAChC,CAEJ,CACF,CAEJ,CAEJ,EAEO+B,CAAAA,CAAQhC","file":"chunk-F6CQ5ODU.js","sourcesContent":["import React, { useState, useCallback } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/core/button';\n\nconst galleryVariants = cva(\n 'grid gap-4',\n {\n variants: {\n columns: {\n 1: 'grid-cols-1',\n 2: 'grid-cols-1 sm:grid-cols-2',\n 3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',\n 4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',\n 5: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5',\n 6: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6',\n },\n spacing: {\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n },\n defaultVariants: {\n columns: 3,\n spacing: 'md',\n },\n }\n);\n\nconst galleryItemVariants = cva(\n 'relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg',\n {\n variants: {\n aspectRatio: {\n square: 'aspect-square',\n video: 'aspect-video',\n portrait: 'aspect-[3/4]',\n landscape: 'aspect-[4/3]',\n wide: 'aspect-[16/9]',\n },\n hover: {\n none: '',\n scale: 'hover:scale-105',\n zoom: 'hover:scale-110',\n lift: 'hover:-translate-y-2',\n },\n },\n defaultVariants: {\n aspectRatio: 'square',\n hover: 'scale',\n },\n }\n);\n\nconst lightboxVariants = cva(\n 'fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm',\n {\n variants: {\n animation: {\n fade: 'animate-in fade-in duration-300',\n slide: 'animate-in slide-in-from-bottom duration-300',\n zoom: 'animate-in zoom-in duration-300',\n },\n },\n defaultVariants: {\n animation: 'fade',\n },\n }\n);\n\nexport interface GalleryImage {\n id: string;\n src: string;\n alt: string;\n title?: string;\n description?: string;\n thumbnail?: string;\n}\n\nexport interface GalleryProps extends VariantProps<typeof galleryVariants> {\n images: GalleryImage[];\n className?: string;\n itemClassName?: string;\n showLightbox?: boolean;\n lightboxAnimation?: VariantProps<typeof lightboxVariants>['animation'];\n onImageClick?: (image: GalleryImage, index: number) => void;\n itemHover?: VariantProps<typeof galleryItemVariants>['hover'];\n itemAspectRatio?: VariantProps<typeof galleryItemVariants>['aspectRatio'];\n showThumbnails?: boolean;\n thumbnailSize?: 'sm' | 'md' | 'lg';\n}\n\nexport const Gallery: React.FC<GalleryProps> = ({\n images,\n className,\n itemClassName,\n columns = 3,\n spacing = 'md',\n showLightbox = true,\n lightboxAnimation = 'fade',\n onImageClick,\n itemHover = 'scale',\n itemAspectRatio = 'square',\n showThumbnails = false,\n thumbnailSize: _thumbnailSize = 'md',\n ...props\n}) => {\n const [selectedImage, setSelectedImage] = useState<GalleryImage | null>(null);\n const [selectedIndex, setSelectedIndex] = useState<number>(-1);\n\n const handleImageClick = useCallback((image: GalleryImage, index: number) => {\n if (showLightbox) {\n setSelectedImage(image);\n setSelectedIndex(index);\n }\n onImageClick?.(image, index);\n }, [showLightbox, onImageClick]);\n\n const handleCloseLightbox = useCallback(() => {\n setSelectedImage(null);\n setSelectedIndex(-1);\n }, []);\n\n const handlePrevious = useCallback(() => {\n if (selectedIndex > 0) {\n const newIndex = selectedIndex - 1;\n setSelectedImage(images[newIndex] || null);\n setSelectedIndex(newIndex);\n }\n }, [selectedIndex, images]);\n\n const handleNext = useCallback(() => {\n if (selectedIndex < images.length - 1) {\n const newIndex = selectedIndex + 1;\n setSelectedImage(images[newIndex] || null);\n setSelectedIndex(newIndex);\n }\n }, [selectedIndex, images]);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n handleCloseLightbox();\n } else if (e.key === 'ArrowLeft') {\n handlePrevious();\n } else if (e.key === 'ArrowRight') {\n handleNext();\n }\n }, [handleCloseLightbox, handlePrevious, handleNext]);\n\n return (\n <>\n <div \n className={cn(galleryVariants({ columns, spacing }), className)}\n {...props}\n >\n {images.map((image, index) => (\n <div\n key={image.id || index}\n className={cn(\n galleryItemVariants({ \n aspectRatio: itemAspectRatio, \n hover: itemHover \n }),\n itemClassName\n )}\n role=\"button\"\n tabIndex={0}\n onClick={() => handleImageClick(image, index)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleImageClick(image, index);\n }\n }}\n aria-label={`View image ${index + 1}: ${image.alt}`}\n >\n <img\n src={showThumbnails && image.thumbnail ? image.thumbnail : image.src}\n alt={image.alt}\n className=\"w-full h-full object-cover\"\n loading=\"lazy\"\n />\n {(image.title || image.description) && (\n <div className=\"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end\">\n <div className=\"p-4 text-white\">\n {image.title && (\n <h3 className=\"font-semibold text-sm sm:text-base\">\n {image.title}\n </h3>\n )}\n {image.description && (\n <p className=\"text-xs sm:text-sm text-white/80 mt-1\">\n {image.description}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n ))}\n </div>\n\n {selectedImage && showLightbox && (\n <div\n className={cn(lightboxVariants({ animation: lightboxAnimation }))}\n onClick={handleCloseLightbox}\n onKeyDown={handleKeyDown}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"lightbox-title\"\n >\n <div \n className=\"relative max-w-4xl max-h-[90vh] mx-4\"\n onClick={(e) => e.stopPropagation()}\n >\n <img\n src={selectedImage.src}\n alt={selectedImage.alt}\n className=\"max-w-full max-h-full object-contain rounded-lg\"\n id=\"lightbox-title\"\n />\n \n {(selectedImage.title || selectedImage.description) && (\n <div className=\"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg\">\n {selectedImage.title && (\n <h3 className=\"font-semibold text-lg mb-2\">\n {selectedImage.title}\n </h3>\n )}\n {selectedImage.description && (\n <p className=\"text-sm text-white/80\">\n {selectedImage.description}\n </p>\n )}\n </div>\n )}\n\n {/* Navigation buttons */}\n {images.length > 1 && (\n <>\n {selectedIndex > 0 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handlePrevious}\n aria-label=\"Previous image\"\n >\n ←\n </Button>\n )}\n {selectedIndex < images.length - 1 && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handleNext}\n aria-label=\"Next image\"\n >\n →\n </Button>\n )}\n </>\n )}\n\n {/* Close button */}\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white\"\n onClick={handleCloseLightbox}\n aria-label=\"Close lightbox\"\n >\n ✕\n </Button>\n\n {/* Image counter */}\n {images.length > 1 && (\n <div className=\"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm\">\n {selectedIndex + 1} / {images.length}\n </div>\n )}\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport default Gallery;\n"]}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- 'use strict';var chunk5PVFLXPO_cjs=require('./chunk-5PVFLXPO.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var e__default=/*#__PURE__*/_interopDefault(e);var S=classVarianceAuthority.cva("grid gap-4",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6"},spacing:{sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{columns:3,spacing:"md"}}),q=classVarianceAuthority.cva("relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg",{variants:{aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",landscape:"aspect-[4/3]",wide:"aspect-[16/9]"},hover:{none:"",scale:"hover:scale-105",zoom:"hover:scale-110",lift:"hover:-translate-y-2"}},defaultVariants:{aspectRatio:"square",hover:"scale"}}),A=classVarianceAuthority.cva("fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm",{variants:{animation:{fade:"animate-in fade-in duration-300",slide:"animate-in slide-in-from-bottom duration-300",zoom:"animate-in zoom-in duration-300"}},defaultVariants:{animation:"fade"}}),B=({images:a,className:y,itemClassName:k,columns:w=3,spacing:N="md",showLightbox:g=true,lightboxAnimation:I="fade",onImageClick:v,itemHover:V="scale",itemAspectRatio:C="square",showThumbnails:z=false,thumbnailSize:D="md",...P})=>{let[l,r]=e.useState(null),[i,n]=e.useState(-1),f=e.useCallback((t,s)=>{g&&(r(t),n(s)),v?.(t,s);},[g,v]),d=e.useCallback(()=>{r(null),n(-1);},[]),b=e.useCallback(()=>{if(i>0){let t=i-1;r(a[t]||null),n(t);}},[i,a]),p=e.useCallback(()=>{if(i<a.length-1){let t=i+1;r(a[t]||null),n(t);}},[i,a]),G=e.useCallback(t=>{t.key==="Escape"?d():t.key==="ArrowLeft"?b():t.key==="ArrowRight"&&p();},[d,b,p]);return e__default.default.createElement(e__default.default.Fragment,null,e__default.default.createElement("div",{className:chunkITRGJNWL_cjs.a(S({columns:w,spacing:N}),y),...P},a.map((t,s)=>e__default.default.createElement("div",{key:t.id||s,className:chunkITRGJNWL_cjs.a(q({aspectRatio:C,hover:V}),k),role:"button",tabIndex:0,onClick:()=>f(t,s),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(t,s));},"aria-label":`View image ${s+1}: ${t.alt}`},e__default.default.createElement("img",{src:z&&t.thumbnail?t.thumbnail:t.src,alt:t.alt,className:"w-full h-full object-cover",loading:"lazy"}),(t.title||t.description)&&e__default.default.createElement("div",{className:"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end"},e__default.default.createElement("div",{className:"p-4 text-white"},t.title&&e__default.default.createElement("h3",{className:"font-semibold text-sm sm:text-base"},t.title),t.description&&e__default.default.createElement("p",{className:"text-xs sm:text-sm text-white/80 mt-1"},t.description)))))),l&&g&&e__default.default.createElement("div",{className:chunkITRGJNWL_cjs.a(A({animation:I})),onClick:d,onKeyDown:G,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"lightbox-title"},e__default.default.createElement("div",{className:"relative max-w-4xl max-h-[90vh] mx-4",onClick:t=>t.stopPropagation()},e__default.default.createElement("img",{src:l.src,alt:l.alt,className:"max-w-full max-h-full object-contain rounded-lg",id:"lightbox-title"}),(l.title||l.description)&&e__default.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg"},l.title&&e__default.default.createElement("h3",{className:"font-semibold text-lg mb-2"},l.title),l.description&&e__default.default.createElement("p",{className:"text-sm text-white/80"},l.description)),a.length>1&&e__default.default.createElement(e__default.default.Fragment,null,i>0&&e__default.default.createElement(chunk5PVFLXPO_cjs.b,{variant:"ghost",size:"sm",className:"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:b,"aria-label":"Previous image"},"\u2190"),i<a.length-1&&e__default.default.createElement(chunk5PVFLXPO_cjs.b,{variant:"ghost",size:"sm",className:"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:p,"aria-label":"Next image"},"\u2192")),e__default.default.createElement(chunk5PVFLXPO_cjs.b,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white",onClick:d,"aria-label":"Close lightbox"},"\u2715"),a.length>1&&e__default.default.createElement("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm"},i+1," / ",a.length))))},F=B;exports.a=B;exports.b=F;//# sourceMappingURL=chunk-7PPAI3MM.cjs.map
3
- //# sourceMappingURL=chunk-7PPAI3MM.cjs.map
2
+ 'use strict';var chunk6UIT6XQH_cjs=require('./chunk-6UIT6XQH.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var e__default=/*#__PURE__*/_interopDefault(e);var S=classVarianceAuthority.cva("grid gap-4",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6"},spacing:{sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8"}},defaultVariants:{columns:3,spacing:"md"}}),q=classVarianceAuthority.cva("relative overflow-hidden rounded-lg bg-muted/50 transition-all duration-300 hover:scale-105 hover:shadow-lg",{variants:{aspectRatio:{square:"aspect-square",video:"aspect-video",portrait:"aspect-[3/4]",landscape:"aspect-[4/3]",wide:"aspect-[16/9]"},hover:{none:"",scale:"hover:scale-105",zoom:"hover:scale-110",lift:"hover:-translate-y-2"}},defaultVariants:{aspectRatio:"square",hover:"scale"}}),A=classVarianceAuthority.cva("fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm",{variants:{animation:{fade:"animate-in fade-in duration-300",slide:"animate-in slide-in-from-bottom duration-300",zoom:"animate-in zoom-in duration-300"}},defaultVariants:{animation:"fade"}}),B=({images:a,className:y,itemClassName:k,columns:w=3,spacing:N="md",showLightbox:g=true,lightboxAnimation:I="fade",onImageClick:v,itemHover:V="scale",itemAspectRatio:C="square",showThumbnails:z=false,thumbnailSize:D="md",...P})=>{let[l,r]=e.useState(null),[i,n]=e.useState(-1),f=e.useCallback((t,s)=>{g&&(r(t),n(s)),v?.(t,s);},[g,v]),d=e.useCallback(()=>{r(null),n(-1);},[]),b=e.useCallback(()=>{if(i>0){let t=i-1;r(a[t]||null),n(t);}},[i,a]),p=e.useCallback(()=>{if(i<a.length-1){let t=i+1;r(a[t]||null),n(t);}},[i,a]),G=e.useCallback(t=>{t.key==="Escape"?d():t.key==="ArrowLeft"?b():t.key==="ArrowRight"&&p();},[d,b,p]);return e__default.default.createElement(e__default.default.Fragment,null,e__default.default.createElement("div",{className:chunkITRGJNWL_cjs.a(S({columns:w,spacing:N}),y),...P},a.map((t,s)=>e__default.default.createElement("div",{key:t.id||s,className:chunkITRGJNWL_cjs.a(q({aspectRatio:C,hover:V}),k),role:"button",tabIndex:0,onClick:()=>f(t,s),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f(t,s));},"aria-label":`View image ${s+1}: ${t.alt}`},e__default.default.createElement("img",{src:z&&t.thumbnail?t.thumbnail:t.src,alt:t.alt,className:"w-full h-full object-cover",loading:"lazy"}),(t.title||t.description)&&e__default.default.createElement("div",{className:"absolute inset-0 bg-black/50 opacity-0 hover:opacity-100 transition-opacity duration-300 flex items-end"},e__default.default.createElement("div",{className:"p-4 text-white"},t.title&&e__default.default.createElement("h3",{className:"font-semibold text-sm sm:text-base"},t.title),t.description&&e__default.default.createElement("p",{className:"text-xs sm:text-sm text-white/80 mt-1"},t.description)))))),l&&g&&e__default.default.createElement("div",{className:chunkITRGJNWL_cjs.a(A({animation:I})),onClick:d,onKeyDown:G,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"lightbox-title"},e__default.default.createElement("div",{className:"relative max-w-4xl max-h-[90vh] mx-4",onClick:t=>t.stopPropagation()},e__default.default.createElement("img",{src:l.src,alt:l.alt,className:"max-w-full max-h-full object-contain rounded-lg",id:"lightbox-title"}),(l.title||l.description)&&e__default.default.createElement("div",{className:"absolute bottom-0 left-0 right-0 bg-black/80 text-white p-4 rounded-b-lg"},l.title&&e__default.default.createElement("h3",{className:"font-semibold text-lg mb-2"},l.title),l.description&&e__default.default.createElement("p",{className:"text-sm text-white/80"},l.description)),a.length>1&&e__default.default.createElement(e__default.default.Fragment,null,i>0&&e__default.default.createElement(chunk6UIT6XQH_cjs.b,{variant:"ghost",size:"sm",className:"absolute left-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:b,"aria-label":"Previous image"},"\u2190"),i<a.length-1&&e__default.default.createElement(chunk6UIT6XQH_cjs.b,{variant:"ghost",size:"sm",className:"absolute right-4 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white",onClick:p,"aria-label":"Next image"},"\u2192")),e__default.default.createElement(chunk6UIT6XQH_cjs.b,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 bg-black/50 hover:bg-black/70 text-white",onClick:d,"aria-label":"Close lightbox"},"\u2715"),a.length>1&&e__default.default.createElement("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded-full text-sm"},i+1," / ",a.length))))},F=B;exports.a=B;exports.b=F;//# sourceMappingURL=chunk-GEMIO54B.cjs.map
3
+ //# sourceMappingURL=chunk-GEMIO54B.cjs.map