{"version":3,"file":"AccessibleCanvasControl.DYyccYs2.mjs","names":["React.useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/9aMSZCkNyiSpqDeM8owi/j8po09IVvgq474LhYAh1/AccessibleCanvasControl.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";const navInteractionStyles=`\n.pc-nav-interactive,\n.pc-nav-interactive * {\n    transition: color 180ms cubic-bezier(0.2, 0.2, 0, 1), -webkit-text-fill-color 180ms cubic-bezier(0.2, 0.2, 0, 1);\n}\n\n.pc-nav-interactive:hover,\n.pc-nav-interactive:hover *,\n.pc-nav-interactive:active,\n.pc-nav-interactive:active *,\n.pc-nav-interactive:focus-visible,\n.pc-nav-interactive:focus-visible *,\n.pc-nav-interactive:focus-within,\n.pc-nav-interactive:focus-within * {\n    color: #ffcc00 !important;\n    -webkit-text-fill-color: #ffcc00 !important;\n    --framer-text-color: #ffcc00 !important;\n}\n`;function NavInteractionStyle(){return /*#__PURE__*/_jsx(\"style\",{children:navInteractionStyles});}function navClassName(className){return[className,\"pc-nav-interactive\"].filter(Boolean).join(\" \");}function isActivationKey(event){return event.key===\"Enter\"||event.key===\" \";}/** Shared keyboard-focus treatment for semantic canvas controls. */export function FocusVisibleControl(Component){return /*#__PURE__*/React.forwardRef(function FocusVisibleControlOverride(props,ref){const[focused,setFocused]=React.useState(false);const accessibleLabel=props[\"aria-label\"]??props.ariaLabel??\"\";const isPatchAccordion=/^(Expand|Collapse) (Behind This Patch|Patch Challenge)$/.test(accessibleLabel);const accordionState=accessibleLabel.startsWith(\"Collapse\");return /*#__PURE__*/_jsx(Component,{...props,ref:ref,...isPatchAccordion?{\"aria-expanded\":accordionState}:{},onPointerDown:event=>{setFocused(false);props.onPointerDown?.(event);},onFocus:event=>{setFocused(event.currentTarget.matches(\":focus-visible\"));props.onFocus?.(event);},onBlur:event=>{setFocused(false);props.onBlur?.(event);},style:{...props.style,outline:focused?\"3px solid #0A84FF\":props.style?.outline,outlineOffset:focused?3:props.style?.outlineOffset}});});}/** Adds the Patch Crew yellow interaction state to navigation links. */export function NavInteractiveControl(Component){return /*#__PURE__*/React.forwardRef(function NavInteractiveControlOverride(props,ref){return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(NavInteractionStyle,{}),/*#__PURE__*/_jsx(Component,{...props,ref:ref,className:navClassName(props.className)})]});});}/** Makes Framer canvas menu triggers work with Enter and Space as well as pointer input. */export function KeyboardAccessibleControl(Component){return /*#__PURE__*/React.forwardRef(function KeyboardAccessibleControlOverride(props,ref){const[focused,setFocused]=React.useState(false);const[expanded,setExpanded]=React.useState(false);const activate=event=>{setExpanded(current=>!current);props.onTap?.(event);};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(NavInteractionStyle,{}),/*#__PURE__*/_jsx(Component,{...props,ref:ref,className:navClassName(props.className),\"aria-expanded\":expanded,onPointerDown:event=>{setFocused(false);props.onPointerDown?.(event);},onTap:event=>activate(event),onKeyDown:event=>{if(isActivationKey(event)){event.preventDefault();activate(event);}props.onKeyDown?.(event);},onFocus:event=>{setFocused(event.currentTarget.matches(\":focus-visible\"));props.onFocus?.(event);},onBlur:event=>{setFocused(false);props.onBlur?.(event);},style:{...props.style,outline:focused?\"3px solid #0A84FF\":props.style?.outline,outlineOffset:focused?3:props.style?.outlineOffset}})]});});}\nexport const __FramerMetadata__ = {\"exports\":{\"FocusVisibleControl\":{\"type\":\"reactHoc\",\"name\":\"FocusVisibleControl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"KeyboardAccessibleControl\":{\"type\":\"reactHoc\",\"name\":\"KeyboardAccessibleControl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NavInteractiveControl\":{\"type\":\"reactHoc\",\"name\":\"NavInteractiveControl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AccessibleCanvasControl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