@proyecto-viviana/solidaria 0.0.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 (109) hide show
  1. package/dist/button/createButton.d.ts +29 -0
  2. package/dist/button/createButton.d.ts.map +1 -0
  3. package/dist/button/createToggleButton.d.ts +41 -0
  4. package/dist/button/createToggleButton.d.ts.map +1 -0
  5. package/dist/button/index.d.ts +5 -0
  6. package/dist/button/index.d.ts.map +1 -0
  7. package/dist/button/types.d.ts +66 -0
  8. package/dist/button/types.d.ts.map +1 -0
  9. package/dist/checkbox/createCheckbox.d.ts +56 -0
  10. package/dist/checkbox/createCheckbox.d.ts.map +1 -0
  11. package/dist/checkbox/createCheckboxGroup.d.ts +53 -0
  12. package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -0
  13. package/dist/checkbox/createCheckboxGroupItem.d.ts +25 -0
  14. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -0
  15. package/dist/checkbox/createCheckboxGroupState.d.ts +71 -0
  16. package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -0
  17. package/dist/checkbox/index.d.ts +9 -0
  18. package/dist/checkbox/index.d.ts.map +1 -0
  19. package/dist/index.d.ts +15 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +2834 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/interactions/FocusableProvider.d.ts +26 -0
  24. package/dist/interactions/FocusableProvider.d.ts.map +1 -0
  25. package/dist/interactions/PressEvent.d.ts +63 -0
  26. package/dist/interactions/PressEvent.d.ts.map +1 -0
  27. package/dist/interactions/createFocus.d.ts +31 -0
  28. package/dist/interactions/createFocus.d.ts.map +1 -0
  29. package/dist/interactions/createFocusRing.d.ts +37 -0
  30. package/dist/interactions/createFocusRing.d.ts.map +1 -0
  31. package/dist/interactions/createFocusWithin.d.ts +27 -0
  32. package/dist/interactions/createFocusWithin.d.ts.map +1 -0
  33. package/dist/interactions/createFocusable.d.ts +65 -0
  34. package/dist/interactions/createFocusable.d.ts.map +1 -0
  35. package/dist/interactions/createHover.d.ts +41 -0
  36. package/dist/interactions/createHover.d.ts.map +1 -0
  37. package/dist/interactions/createKeyboard.d.ts +35 -0
  38. package/dist/interactions/createKeyboard.d.ts.map +1 -0
  39. package/dist/interactions/createPress.d.ts +49 -0
  40. package/dist/interactions/createPress.d.ts.map +1 -0
  41. package/dist/interactions/index.d.ts +10 -0
  42. package/dist/interactions/index.d.ts.map +1 -0
  43. package/dist/label/createField.d.ts +51 -0
  44. package/dist/label/createField.d.ts.map +1 -0
  45. package/dist/label/createLabel.d.ts +49 -0
  46. package/dist/label/createLabel.d.ts.map +1 -0
  47. package/dist/label/createLabels.d.ts +16 -0
  48. package/dist/label/createLabels.d.ts.map +1 -0
  49. package/dist/label/index.d.ts +6 -0
  50. package/dist/label/index.d.ts.map +1 -0
  51. package/dist/link/createLink.d.ts +65 -0
  52. package/dist/link/createLink.d.ts.map +1 -0
  53. package/dist/link/index.d.ts +2 -0
  54. package/dist/link/index.d.ts.map +1 -0
  55. package/dist/progress/createProgressBar.d.ts +47 -0
  56. package/dist/progress/createProgressBar.d.ts.map +1 -0
  57. package/dist/progress/index.d.ts +2 -0
  58. package/dist/progress/index.d.ts.map +1 -0
  59. package/dist/radio/createRadio.d.ts +68 -0
  60. package/dist/radio/createRadio.d.ts.map +1 -0
  61. package/dist/radio/createRadioGroup.d.ts +85 -0
  62. package/dist/radio/createRadioGroup.d.ts.map +1 -0
  63. package/dist/radio/createRadioGroupState.d.ts +77 -0
  64. package/dist/radio/createRadioGroupState.d.ts.map +1 -0
  65. package/dist/radio/index.d.ts +4 -0
  66. package/dist/radio/index.d.ts.map +1 -0
  67. package/dist/separator/createSeparator.d.ts +38 -0
  68. package/dist/separator/createSeparator.d.ts.map +1 -0
  69. package/dist/separator/index.d.ts +2 -0
  70. package/dist/separator/index.d.ts.map +1 -0
  71. package/dist/ssr/index.d.ts +24 -0
  72. package/dist/ssr/index.d.ts.map +1 -0
  73. package/dist/switch/createSwitch.d.ts +34 -0
  74. package/dist/switch/createSwitch.d.ts.map +1 -0
  75. package/dist/switch/index.d.ts +2 -0
  76. package/dist/switch/index.d.ts.map +1 -0
  77. package/dist/textfield/createTextField.d.ts +73 -0
  78. package/dist/textfield/createTextField.d.ts.map +1 -0
  79. package/dist/textfield/index.d.ts +2 -0
  80. package/dist/textfield/index.d.ts.map +1 -0
  81. package/dist/toggle/createToggle.d.ts +94 -0
  82. package/dist/toggle/createToggle.d.ts.map +1 -0
  83. package/dist/toggle/createToggleState.d.ts +34 -0
  84. package/dist/toggle/createToggleState.d.ts.map +1 -0
  85. package/dist/toggle/index.d.ts +5 -0
  86. package/dist/toggle/index.d.ts.map +1 -0
  87. package/dist/utils/dom.d.ts +51 -0
  88. package/dist/utils/dom.d.ts.map +1 -0
  89. package/dist/utils/events.d.ts +29 -0
  90. package/dist/utils/events.d.ts.map +1 -0
  91. package/dist/utils/filterDOMProps.d.ts +29 -0
  92. package/dist/utils/filterDOMProps.d.ts.map +1 -0
  93. package/dist/utils/focus.d.ts +20 -0
  94. package/dist/utils/focus.d.ts.map +1 -0
  95. package/dist/utils/geometry.d.ts +40 -0
  96. package/dist/utils/geometry.d.ts.map +1 -0
  97. package/dist/utils/globalListeners.d.ts +36 -0
  98. package/dist/utils/globalListeners.d.ts.map +1 -0
  99. package/dist/utils/index.d.ts +11 -0
  100. package/dist/utils/index.d.ts.map +1 -0
  101. package/dist/utils/mergeProps.d.ts +8 -0
  102. package/dist/utils/mergeProps.d.ts.map +1 -0
  103. package/dist/utils/platform.d.ts +14 -0
  104. package/dist/utils/platform.d.ts.map +1 -0
  105. package/dist/utils/reactivity.d.ts +28 -0
  106. package/dist/utils/reactivity.d.ts.map +1 -0
  107. package/dist/utils/textSelection.d.ts +19 -0
  108. package/dist/utils/textSelection.d.ts.map +1 -0
  109. package/package.json +50 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/interactions/PressEvent.ts","../src/utils/mergeProps.ts","../src/utils/filterDOMProps.ts","../src/utils/reactivity.ts","../src/utils/platform.ts","../src/utils/dom.ts","../src/utils/geometry.ts","../src/utils/events.ts","../src/utils/textSelection.ts","../src/utils/focus.ts","../src/utils/globalListeners.ts","../src/interactions/createPress.ts","../src/interactions/createFocus.ts","../src/interactions/createFocusWithin.ts","../src/interactions/createKeyboard.ts","../src/interactions/createFocusable.ts","../src/interactions/createFocusRing.ts","../src/interactions/createHover.ts","../src/button/createButton.ts","../src/button/createToggleButton.ts","../../solid-stately/dist/index.js","../src/toggle/createToggle.ts","../src/checkbox/createCheckbox.ts","../src/ssr/index.ts","../src/label/createLabels.ts","../src/label/createLabel.ts","../src/label/createField.ts","../src/checkbox/createCheckboxGroup.ts","../src/checkbox/createCheckboxGroupItem.ts","../src/radio/createRadioGroup.ts","../src/radio/createRadio.ts","../src/switch/createSwitch.ts","../src/link/createLink.ts","../src/textfield/createTextField.ts","../src/progress/createProgressBar.ts","../src/separator/createSeparator.ts"],"sourcesContent":["/**\n * PressEvent class that matches React-Aria's PressEvent interface.\n * Wraps native events with press-specific data.\n */\n\nexport type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';\nexport type PressEventType = 'pressstart' | 'pressend' | 'pressup' | 'press';\n\nexport interface IPressEvent {\n /** The type of press event being fired. */\n type: PressEventType;\n /** The pointer type that triggered the press event. */\n pointerType: PointerType;\n /** The target element of the press event. */\n target: Element;\n /** Whether the shift keyboard modifier was held during the press event. */\n shiftKey: boolean;\n /** Whether the ctrl keyboard modifier was held during the press event. */\n ctrlKey: boolean;\n /** Whether the meta keyboard modifier was held during the press event. */\n metaKey: boolean;\n /** Whether the alt keyboard modifier was held during the press event. */\n altKey: boolean;\n /** X position of the press relative to the target element. */\n x: number;\n /** Y position of the press relative to the target element. */\n y: number;\n /**\n * By default, press events stop propagation to parent elements.\n * Call continuePropagation() to allow the event to bubble up.\n */\n continuePropagation(): void;\n}\n\n/**\n * PressEvent class that provides all press event data.\n * Based on React-Aria's PressEvent implementation.\n */\nexport class PressEvent implements IPressEvent {\n type: PressEventType;\n pointerType: PointerType;\n target: Element;\n shiftKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n x: number;\n y: number;\n\n #shouldStopPropagation = true;\n\n constructor(\n type: PressEventType,\n pointerType: PointerType,\n originalEvent: Event | null,\n target: Element\n ) {\n this.type = type;\n this.pointerType = pointerType;\n this.target = target;\n\n // Extract modifier keys from the original event\n const e = originalEvent as MouseEvent | KeyboardEvent | null;\n this.shiftKey = e?.shiftKey ?? false;\n this.ctrlKey = e?.ctrlKey ?? false;\n this.metaKey = e?.metaKey ?? false;\n this.altKey = e?.altKey ?? false;\n\n // Calculate position relative to target\n this.x = 0;\n this.y = 0;\n\n if (originalEvent && 'clientX' in originalEvent && target) {\n const rect = target.getBoundingClientRect();\n this.x = (originalEvent as MouseEvent).clientX - rect.left;\n this.y = (originalEvent as MouseEvent).clientY - rect.top;\n } else if (target) {\n // For keyboard events, use center of element\n const rect = target.getBoundingClientRect();\n this.x = rect.width / 2;\n this.y = rect.height / 2;\n }\n }\n\n /**\n * Call this to allow the press event to propagate to parent elements.\n * By default, press events stop propagation.\n */\n continuePropagation(): void {\n this.#shouldStopPropagation = false;\n }\n\n /**\n * Whether the event should stop propagation.\n * Used internally by the press handler.\n */\n get shouldStopPropagation(): boolean {\n return this.#shouldStopPropagation;\n }\n}\n\n/**\n * Creates a PressEvent from a native event.\n */\nexport function createPressEvent(\n type: PressEventType,\n pointerType: PointerType,\n originalEvent: Event | null,\n target: Element\n): PressEvent {\n return new PressEvent(type, pointerType, originalEvent, target);\n}\n","type Props = { [key: string]: unknown };\n\n/**\n * Merges multiple props objects together, handling event handlers specially\n * by chaining them rather than replacing.\n *\n * Based on react-aria's mergeProps but adapted for SolidJS.\n */\nexport function mergeProps<T extends object>(...args: T[]): Record<string, unknown> {\n const result: Props = {};\n\n for (const props of args) {\n for (const key in props) {\n const value = props[key];\n const existingValue = result[key];\n\n if (\n typeof existingValue === 'function' &&\n typeof value === 'function' &&\n key.startsWith('on') &&\n key[2] === key[2]?.toUpperCase()\n ) {\n // Chain event handlers\n result[key] = chainHandlers(existingValue as Function, value as Function);\n } else if (key === 'class' || key === 'className') {\n // Merge class names\n result[key] = mergeClassNames(existingValue, value);\n } else if (key === 'style' && typeof existingValue === 'object' && typeof value === 'object') {\n // Merge style objects\n result[key] = { ...(existingValue as object), ...(value as object) };\n } else if (value !== undefined) {\n result[key] = value;\n }\n }\n }\n\n return result;\n}\n\nfunction chainHandlers(existingHandler: Function, newHandler: Function) {\n return (...args: unknown[]) => {\n existingHandler(...args);\n newHandler(...args);\n };\n}\n\nfunction mergeClassNames(...classes: unknown[]): string {\n return classes.filter(Boolean).join(' ');\n}\n","/**\n * filterDOMProps for Solidaria\n *\n * Filters out all props that aren't valid DOM props.\n * This is a 1:1 port of @react-aria/utils filterDOMProps.\n */\n\nconst DOMPropNames = new Set(['id']);\n\nconst labelablePropNames = new Set([\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-details',\n]);\n\n// See LinkDOMProps in dom.d.ts.\nconst linkPropNames = new Set([\n 'href',\n 'hrefLang',\n 'target',\n 'rel',\n 'download',\n 'ping',\n 'referrerPolicy',\n]);\n\nconst globalAttrs = new Set(['dir', 'lang', 'hidden', 'inert', 'translate']);\n\nconst globalEvents = new Set([\n 'onClick',\n 'onAuxClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onScroll',\n 'onWheel',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionCancel',\n 'onTransitionEnd',\n 'onTransitionRun',\n 'onTransitionStart',\n]);\n\nconst propRe = /^(data-.*)$/;\n\nexport interface FilterDOMPropsOptions {\n /**\n * If labelling associated aria properties should be included in the filter.\n */\n labelable?: boolean;\n /** Whether the element is a link and should include DOM props for <a> elements. */\n isLink?: boolean;\n /** Whether to include global DOM attributes. */\n global?: boolean;\n /** Whether to include DOM events. */\n events?: boolean;\n /**\n * A Set of other property names that should be included in the filter.\n */\n propNames?: Set<string>;\n}\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(\n props: Record<string, unknown>,\n opts: FilterDOMPropsOptions = {}\n): Record<string, unknown> {\n const { labelable, isLink, global, events = global, propNames } = opts;\n const filteredProps: Record<string, unknown> = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) &&\n (DOMPropNames.has(prop) ||\n (labelable && labelablePropNames.has(prop)) ||\n (isLink && linkPropNames.has(prop)) ||\n (global && globalAttrs.has(prop)) ||\n (events &&\n (globalEvents.has(prop) ||\n (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||\n propNames?.has(prop) ||\n propRe.test(prop))\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n","/**\n * Reactivity utilities for Solidaria\n *\n * Provides type-safe utilities for working with SolidJS reactivity patterns.\n */\n\nimport { Accessor } from 'solid-js';\n\n/**\n * A value that may be either a raw value or an accessor function.\n * This is a common pattern in SolidJS for props that may be reactive.\n */\nexport type MaybeAccessor<T> = T | Accessor<T>;\n\n/**\n * Unwraps a MaybeAccessor to get the underlying value.\n * If the input is a function, it calls it to get the value.\n * Otherwise, it returns the value directly.\n *\n * @param value - The value or accessor to unwrap.\n */\nexport function access<T>(value: MaybeAccessor<T>): T {\n return typeof value === 'function' ? (value as Accessor<T>)() : value;\n}\n\n/**\n * A value that may be undefined or an accessor that returns the value or undefined.\n */\nexport type MaybeAccessorValue<T> = T | undefined | Accessor<T | undefined>;\n\n/**\n * Checks if a value is an accessor function.\n */\nexport function isAccessor<T>(value: MaybeAccessor<T>): value is Accessor<T> {\n return typeof value === 'function';\n}\n","/**\n * Platform detection utilities.\n * Based on @react-aria/utils platform detection.\n */\n\nfunction testPlatform(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.platform || (window.navigator as any).userAgentData?.platform || '')\n : false;\n}\n\nfunction testUserAgent(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.userAgent)\n : false;\n}\n\nexport function isMac(): boolean {\n return testPlatform(/^Mac/i);\n}\n\nexport function isIPhone(): boolean {\n return testPlatform(/^iPhone/i);\n}\n\nexport function isIPad(): boolean {\n return testPlatform(/^iPad/i) || (isMac() && navigator.maxTouchPoints > 1);\n}\n\nexport function isIOS(): boolean {\n return isIPhone() || isIPad();\n}\n\nexport function isAppleDevice(): boolean {\n return isMac() || isIOS();\n}\n\nexport function isWebKit(): boolean {\n return testUserAgent(/AppleWebKit/i) && !isChrome();\n}\n\nexport function isChrome(): boolean {\n return testUserAgent(/Chrome/i);\n}\n\nexport function isAndroid(): boolean {\n return testUserAgent(/Android/i);\n}\n\nexport function isFirefox(): boolean {\n return testUserAgent(/Firefox/i);\n}\n","/**\n * DOM utilities for cross-browser compatibility.\n * Based on @react-aria/utils DOM utilities.\n */\n\n/**\n * Gets the owner document of an element, or the global document.\n */\nexport function getOwnerDocument(el: Element | null | undefined): Document {\n return el?.ownerDocument ?? document;\n}\n\n/**\n * Gets the owner window of an element, or the global window.\n */\nexport function getOwnerWindow(el: Element | null | undefined): Window & typeof globalThis {\n return getOwnerDocument(el).defaultView ?? window;\n}\n\n/**\n * Cross-browser implementation of Node.contains that works with ShadowDOM.\n * In Safari, Node.contains doesn't properly detect elements inside shadow roots.\n */\nexport function nodeContains(parent: Node | null, child: Node | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n // Standard contains check\n if (parent.contains(child)) {\n return true;\n }\n\n // Check if child is in a shadow root\n let node: Node | null = child;\n while (node) {\n if (node === parent) {\n return true;\n }\n\n // Check shadow root host\n if ((node as ShadowRoot).host) {\n node = (node as ShadowRoot).host;\n } else {\n node = node.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * Gets the event target, handling composed path for shadow DOM.\n */\nexport function getEventTarget<T extends EventTarget>(event: Event): T | null {\n // Use composedPath to get the real target when using Shadow DOM\n if (typeof event.composedPath === 'function') {\n const path = event.composedPath();\n if (path.length > 0) {\n return path[0] as T;\n }\n }\n return event.target as T | null;\n}\n\n/**\n * Checks if an element is a valid focusable element.\n */\nexport function isFocusable(element: Element): boolean {\n // Check if element is disabled\n if ((element as HTMLInputElement).disabled) {\n return false;\n }\n\n // Check native focusable elements\n const tagName = element.tagName.toLowerCase();\n if (['input', 'select', 'textarea', 'button', 'a', 'area'].includes(tagName)) {\n // For anchor elements, they must have href to be focusable\n if (tagName === 'a' || tagName === 'area') {\n return element.hasAttribute('href');\n }\n return true;\n }\n\n // Check for tabIndex\n const tabIndex = element.getAttribute('tabindex');\n if (tabIndex != null && tabIndex !== '-1') {\n return true;\n }\n\n // Check for contenteditable\n if (element.hasAttribute('contenteditable') && element.getAttribute('contenteditable') !== 'false') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Checks if a keyboard event should trigger the default action (like clicking).\n */\nexport function isValidKeyboardEvent(event: KeyboardEvent, currentTarget: Element): boolean {\n const { key, code } = event;\n const element = currentTarget as HTMLElement;\n const tagName = element.tagName.toLowerCase();\n const role = element.getAttribute('role');\n\n // Only accept Enter and Space\n const isActivationKey = key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space';\n if (!isActivationKey) {\n return false;\n }\n\n // Text inputs should handle their own keyboard events\n if (tagName === 'textarea') {\n return false;\n }\n\n // Content editable elements should handle their own keyboard events\n if (element.isContentEditable) {\n return false;\n }\n\n // Links should only respond to Enter, not Space\n const isLink = tagName === 'a' || role === 'link';\n if (isLink && key !== 'Enter') {\n return false;\n }\n\n // Input elements have specific key handling\n if (tagName === 'input') {\n return isValidInputKey(element as HTMLInputElement, key);\n }\n\n return true;\n}\n\n/**\n * Checks if a key is valid for a specific input type.\n */\nexport function isValidInputKey(target: HTMLInputElement, key: string): boolean {\n const type = target.type.toLowerCase();\n\n // Checkbox and radio only respond to Space\n if (type === 'checkbox' || type === 'radio') {\n return key === ' ' || key === 'Spacebar';\n }\n\n // Text-like inputs handle their own keyboard events\n const textInputTypes = [\n 'text', 'search', 'url', 'tel', 'email', 'password',\n 'date', 'month', 'week', 'time', 'datetime-local', 'number'\n ];\n if (textInputTypes.includes(type)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Checks if an element is an HTML anchor link (has href attribute).\n */\nexport function isHTMLAnchorLink(target: Element): boolean {\n return target.tagName === 'A' && target.hasAttribute('href');\n}\n\n/**\n * Whether to prevent default on keyboard events for this element.\n */\nexport function shouldPreventDefaultKeyboard(target: Element, key: string): boolean {\n const tagName = target.tagName.toLowerCase();\n\n // Never prevent default on inputs - they handle their own behavior\n if (tagName === 'input' || tagName === 'textarea' || tagName === 'select') {\n return false;\n }\n\n // Don't prevent default on links for Enter (native navigation)\n if ((tagName === 'a' || target.getAttribute('role') === 'link') && key === 'Enter') {\n return false;\n }\n\n // Buttons with submit/reset type should not prevent default\n if (tagName === 'button') {\n const type = (target as HTMLButtonElement).type;\n if (type === 'submit' || type === 'reset') {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether to prevent default on pointer up for this element.\n */\nexport function shouldPreventDefaultUp(target: Element): boolean {\n const tagName = target.tagName.toLowerCase();\n\n // Never prevent default on form elements\n if (tagName === 'input' || tagName === 'textarea' || tagName === 'select') {\n return false;\n }\n\n // Don't prevent default on links\n if (tagName === 'a' || target.getAttribute('role') === 'link') {\n return false;\n }\n\n // Buttons with submit/reset type should not prevent default\n if (tagName === 'button') {\n const type = (target as HTMLButtonElement).type;\n if (type === 'submit' || type === 'reset') {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Opens a link, supporting both same-window and new-window navigation.\n * Used for keyboard activation of links with Space key (which doesn't natively open links).\n */\nexport function openLink(target: HTMLAnchorElement, event: Event, allowOpener = false): void {\n const { href, target: linkTarget, rel } = target;\n\n // Handle modifier keys for open-in-new-tab behavior\n const keyEvent = event as KeyboardEvent;\n const shouldOpenInNewTab =\n linkTarget === '_blank' ||\n keyEvent?.metaKey ||\n keyEvent?.ctrlKey ||\n keyEvent?.shiftKey ||\n keyEvent?.altKey;\n\n if (shouldOpenInNewTab) {\n const features = !allowOpener && rel?.includes('noopener') ? 'noopener' : undefined;\n window.open(href, linkTarget || '_blank', features);\n } else {\n window.location.href = href;\n }\n}\n","/**\n * Geometry utilities for pointer/touch hit testing.\n * Based on @react-aria/interactions geometry utilities.\n */\n\nexport interface Rect {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\nexport interface EventPoint {\n clientX: number;\n clientY: number;\n width?: number;\n height?: number;\n radiusX?: number;\n radiusY?: number;\n}\n\n/**\n * Checks if two rectangles overlap.\n */\nexport function areRectanglesOverlapping(a: Rect, b: Rect): boolean {\n // Check if one rectangle is to the left of the other\n if (a.left > b.right || b.left > a.right) {\n return false;\n }\n\n // Check if one rectangle is above the other\n if (a.top > b.bottom || b.top > a.bottom) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Gets the bounding rectangle for an event point (touch/pointer).\n * Takes into account the size of the touch point.\n */\nexport function getPointClientRect(point: EventPoint): Rect {\n let offsetX = 0;\n let offsetY = 0;\n\n // Use width/height if available (PointerEvent)\n if (point.width !== undefined && point.width > 0) {\n offsetX = point.width / 2;\n } else if (point.radiusX !== undefined && point.radiusX > 0) {\n // Fallback to radiusX/radiusY (Touch)\n offsetX = point.radiusX;\n }\n\n if (point.height !== undefined && point.height > 0) {\n offsetY = point.height / 2;\n } else if (point.radiusY !== undefined && point.radiusY > 0) {\n offsetY = point.radiusY;\n }\n\n return {\n top: point.clientY - offsetY,\n right: point.clientX + offsetX,\n bottom: point.clientY + offsetY,\n left: point.clientX - offsetX,\n };\n}\n\n/**\n * Checks if a pointer/touch point is over an element.\n */\nexport function isPointOverTarget(point: EventPoint, target: Element): boolean {\n const rect = target.getBoundingClientRect();\n const pointRect = getPointClientRect(point);\n\n return areRectanglesOverlapping(\n {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n },\n pointRect\n );\n}\n\n/**\n * Gets the first touch from a TouchEvent's targetTouches.\n */\nexport function getTouchFromEvent(event: TouchEvent): Touch | null {\n const { targetTouches } = event;\n if (targetTouches.length > 0) {\n return targetTouches[0];\n }\n return null;\n}\n\n/**\n * Finds a touch by its identifier in changedTouches.\n */\nexport function getTouchById(event: TouchEvent, pointerId: number | null): Touch | null {\n if (pointerId == null) {\n return null;\n }\n\n const { changedTouches } = event;\n for (let i = 0; i < changedTouches.length; i++) {\n const touch = changedTouches[i];\n if (touch.identifier === pointerId) {\n return touch;\n }\n }\n\n return null;\n}\n","/**\n * Event utilities for detecting virtual clicks and event handling.\n * Based on @react-aria/utils event utilities.\n */\n\n/**\n * Checks if a click event was generated from a virtual source like a screen reader.\n * Virtual clicks typically have detail of 0 and may have zero coordinates.\n */\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // The detail property is 0 for non-mouse clicks (keyboard, screen reader)\n // However, we need to be careful about actual clicks at (0,0) or events\n // that have been re-dispatched\n if ((event as any).mozInputSource === 0 && event.isTrusted) {\n // Firefox bug: clicks from screen readers have mozInputSource = 0\n return true;\n }\n\n // Android TalkBack fires click events with detail=1 but offsetX/offsetY = 0\n if (isAndroidTalkBackClick(event)) {\n return true;\n }\n\n // Screen readers on Safari/Chrome have detail = 0\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\n/**\n * Detects Android TalkBack clicks which have detail=1 but zero offsets.\n */\nfunction isAndroidTalkBackClick(event: MouseEvent | PointerEvent): boolean {\n // TalkBack on Android sends click events with detail=1 but offsetX/Y = 0\n return (\n event.detail === 1 &&\n (event as MouseEvent).offsetX === 0 &&\n (event as MouseEvent).offsetY === 0\n );\n}\n\n/**\n * Checks if a pointer event was generated by a virtual source.\n * iOS VoiceOver fires pointer events with incorrect coordinates.\n * These events have zero width/height.\n */\nexport function isVirtualPointerEvent(event: PointerEvent): boolean {\n // Virtual events typically have no dimensions\n // iOS VoiceOver fires pointer events with width=0, height=0\n return (\n (event.width === 0 && event.height === 0) ||\n // Some screen readers send events with pointerType but no actual pointer\n (event.pointerType === 'mouse' &&\n event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.buttons === 0)\n );\n}\n\n/**\n * Creates a synthetic mouse event for programmatic clicking.\n */\nexport function createMouseEvent(type: string, nativeEvent?: Event): MouseEvent {\n const init: MouseEventInit = {\n bubbles: true,\n cancelable: true,\n view: window,\n };\n\n // Copy properties from the native event if provided\n if (nativeEvent) {\n const e = nativeEvent as MouseEvent;\n init.screenX = e.screenX;\n init.screenY = e.screenY;\n init.clientX = e.clientX;\n init.clientY = e.clientY;\n init.ctrlKey = e.ctrlKey;\n init.shiftKey = e.shiftKey;\n init.altKey = e.altKey;\n init.metaKey = e.metaKey;\n init.button = e.button;\n init.buttons = e.buttons;\n init.relatedTarget = e.relatedTarget;\n }\n\n return new MouseEvent(type, init);\n}\n\n/**\n * Creates a chain of event handlers that calls each in sequence.\n */\nexport function chain<T extends (...args: any[]) => any>(\n ...callbacks: (T | undefined | null)[]\n): T {\n return ((...args: Parameters<T>) => {\n for (const callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n }) as T;\n}\n\n/**\n * Sets the target property on an event object.\n * Used for synthetic events where target needs to be modified.\n */\nexport function setEventTarget<T extends Event>(event: T, target: EventTarget): void {\n Object.defineProperty(event, 'target', {\n value: target,\n writable: false,\n configurable: true,\n });\n Object.defineProperty(event, 'currentTarget', {\n value: target,\n writable: false,\n configurable: true,\n });\n}\n","/**\n * Text selection management utilities.\n * Based on @react-aria/interactions textSelection utilities.\n *\n * On iOS, long press triggers text selection. The only way to prevent this\n * is to set user-select: none on the entire page. On other platforms,\n * we can just set it on the target element.\n */\n\nimport { isIOS } from './platform';\nimport { getOwnerDocument } from './dom';\n\ntype State = 'default' | 'disabled' | 'restoring';\n\n// Global state to manage text selection across multiple press interactions\nlet state: State = 'default';\nlet savedUserSelect = '';\nlet modifiedElementMap = new WeakMap<HTMLElement, string>();\n\n/**\n * Disables text selection on the page or element during press.\n * On iOS, applies to the entire document. On other platforms, just the target.\n */\nexport function disableTextSelection(target?: HTMLElement): void {\n if (isIOS()) {\n // iOS requires disabling selection on the entire page\n if (state === 'default') {\n const documentElement = getOwnerDocument(target).documentElement;\n savedUserSelect = documentElement.style.webkitUserSelect;\n documentElement.style.webkitUserSelect = 'none';\n }\n state = 'disabled';\n } else if (target) {\n // On other platforms, just disable on the target\n const element = target as HTMLElement;\n if (!modifiedElementMap.has(element)) {\n modifiedElementMap.set(element, element.style.userSelect);\n element.style.userSelect = 'none';\n }\n }\n}\n\n/**\n * Restores text selection after press ends.\n * On iOS, waits 300ms to avoid selection appearing during tap.\n */\nexport function restoreTextSelection(target?: HTMLElement): void {\n if (isIOS()) {\n // Don't restore if another press is active\n if (state !== 'disabled') {\n return;\n }\n\n state = 'restoring';\n\n // Wait for iOS to finish any pending selection actions\n // 300ms is the iOS long-press delay\n setTimeout(() => {\n // Use runAfterTransition to avoid CSS recomputation during animation\n runAfterTransition(() => {\n // Only restore if still in 'restoring' state (no new press started)\n if (state === 'restoring') {\n const documentElement = getOwnerDocument(target).documentElement;\n if (savedUserSelect) {\n documentElement.style.webkitUserSelect = savedUserSelect;\n } else {\n documentElement.style.removeProperty('-webkit-user-select');\n }\n savedUserSelect = '';\n state = 'default';\n }\n });\n }, 300);\n } else if (target) {\n // On other platforms, restore immediately\n const element = target as HTMLElement;\n const savedValue = modifiedElementMap.get(element);\n if (savedValue !== undefined) {\n if (savedValue) {\n element.style.userSelect = savedValue;\n } else {\n element.style.removeProperty('user-select');\n }\n modifiedElementMap.delete(element);\n }\n }\n}\n\n// Tracks pending transitions for runAfterTransition\nconst pendingTransitions = new Set<() => void>();\nlet transitionTimeout: ReturnType<typeof setTimeout> | null = null;\n\n/**\n * Runs a callback after CSS transitions complete.\n * Batches multiple callbacks to avoid unnecessary layout thrashing.\n */\nfunction runAfterTransition(callback: () => void): void {\n // If we haven't started tracking transitions, run immediately\n pendingTransitions.add(callback);\n\n // Debounce - wait for any transitions to settle\n if (transitionTimeout != null) {\n clearTimeout(transitionTimeout);\n }\n\n transitionTimeout = setTimeout(() => {\n // Run all pending callbacks\n for (const cb of pendingTransitions) {\n cb();\n }\n pendingTransitions.clear();\n transitionTimeout = null;\n }, 0);\n}\n","/**\n * Focus management utilities.\n * Based on @react-aria/utils focus utilities.\n */\n\nimport { getOwnerDocument } from './dom';\n\n/**\n * Focuses an element without scrolling the page.\n * Uses preventScroll option with fallback for older browsers.\n */\nexport function focusWithoutScrolling(element: HTMLElement | null): void {\n if (!element) return;\n\n // Try using the modern preventScroll option\n try {\n element.focus({ preventScroll: true });\n } catch {\n // Fallback for browsers that don't support preventScroll\n // Save scroll positions and restore after focus\n const scrollableElements = getScrollableAncestors(element);\n const scrollPositions = scrollableElements.map((el) => ({\n element: el,\n scrollTop: el.scrollTop,\n scrollLeft: el.scrollLeft,\n }));\n\n element.focus();\n\n // Restore scroll positions\n for (const { element: el, scrollTop, scrollLeft } of scrollPositions) {\n el.scrollTop = scrollTop;\n el.scrollLeft = scrollLeft;\n }\n }\n}\n\n/**\n * Gets all scrollable ancestors of an element.\n */\nfunction getScrollableAncestors(element: Element): Element[] {\n const ancestors: Element[] = [];\n let parent = element.parentElement;\n\n while (parent) {\n const style = getComputedStyle(parent);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n\n if (\n overflowY === 'auto' ||\n overflowY === 'scroll' ||\n overflowX === 'auto' ||\n overflowX === 'scroll'\n ) {\n ancestors.push(parent);\n }\n\n parent = parent.parentElement;\n }\n\n // Also include the document scrolling element\n const doc = getOwnerDocument(element);\n ancestors.push(doc.documentElement);\n\n return ancestors;\n}\n\n// State for preventFocus\nlet ignoreFocus = false;\nlet preventFocusTimeout: ReturnType<typeof setTimeout> | null = null;\n\n/**\n * Prevents focus from moving to a new element temporarily.\n * Used when clicking on a button that shouldn't steal focus.\n */\nexport function preventFocus(target: Element): void {\n // Find the closest focusable ancestor\n const focusableAncestor = findFocusableAncestor(target);\n if (!focusableAncestor) return;\n\n const document = getOwnerDocument(target);\n const activeElement = document.activeElement;\n\n // Set flag to ignore next focus event\n ignoreFocus = true;\n\n // Capture focus events and prevent them from changing focus\n const onFocus = (e: Event) => {\n if (ignoreFocus) {\n e.stopImmediatePropagation();\n // Refocus the original element if focus moved\n if (activeElement && activeElement !== document.body) {\n (activeElement as HTMLElement).focus();\n }\n }\n };\n\n const onBlur = (e: Event) => {\n if (ignoreFocus) {\n e.stopImmediatePropagation();\n }\n };\n\n // Use capturing to intercept focus before it reaches elements\n // Cast to HTMLElement to access focus event listeners\n const el = focusableAncestor as HTMLElement;\n el.addEventListener('focus', onFocus, true);\n el.addEventListener('blur', onBlur, true);\n el.addEventListener('focusin', onFocus, true);\n el.addEventListener('focusout', onBlur, true);\n\n // Clean up after the current event cycle\n if (preventFocusTimeout != null) {\n clearTimeout(preventFocusTimeout);\n }\n\n preventFocusTimeout = setTimeout(() => {\n ignoreFocus = false;\n el.removeEventListener('focus', onFocus, true);\n el.removeEventListener('blur', onBlur, true);\n el.removeEventListener('focusin', onFocus, true);\n el.removeEventListener('focusout', onBlur, true);\n preventFocusTimeout = null;\n }, 0);\n}\n\n/**\n * Finds the closest focusable ancestor or the element itself.\n */\nfunction findFocusableAncestor(element: Element): Element | null {\n let current: Element | null = element;\n\n while (current) {\n if (\n current.hasAttribute('tabindex') ||\n ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA', 'A'].includes(current.tagName)\n ) {\n return current;\n }\n current = current.parentElement;\n }\n\n return element;\n}\n\n/**\n * Safely focuses an element, alias for focusWithoutScrolling.\n * This matches the react-aria focusSafely function name.\n */\nexport const focusSafely = focusWithoutScrolling;\n","/**\n * Global listener management utility.\n * Based on @react-aria/utils useGlobalListeners hook, adapted for SolidJS.\n *\n * In SolidJS, we use onCleanup for automatic cleanup instead of useEffect return.\n */\n\nimport { onCleanup } from 'solid-js';\n\nexport interface GlobalListenerOptions extends AddEventListenerOptions {\n /** Whether to add the listener to the window instead of document */\n isWindow?: boolean;\n}\n\n/**\n * Creates a manager for global event listeners that automatically cleans up.\n * Use this in a component to register document/window level listeners\n * that will be removed when the component unmounts.\n */\nexport function createGlobalListeners() {\n const listeners: Array<{\n target: EventTarget;\n type: string;\n handler: EventListener;\n options?: AddEventListenerOptions;\n }> = [];\n\n /**\n * Adds a global event listener.\n */\n function addGlobalListener<K extends keyof DocumentEventMap>(\n type: K,\n handler: (ev: DocumentEventMap[K]) => void,\n options?: GlobalListenerOptions\n ): void;\n function addGlobalListener<K extends keyof WindowEventMap>(\n type: K,\n handler: (ev: WindowEventMap[K]) => void,\n options?: GlobalListenerOptions & { isWindow: true }\n ): void;\n function addGlobalListener(\n type: string,\n handler: EventListener,\n options?: GlobalListenerOptions\n ): void {\n const target = options?.isWindow ? window : document;\n const listenerOptions = options\n ? {\n capture: options.capture,\n passive: options.passive,\n once: options.once,\n }\n : undefined;\n\n target.addEventListener(type, handler, listenerOptions);\n listeners.push({ target, type, handler, options: listenerOptions });\n }\n\n /**\n * Removes a specific global event listener.\n */\n function removeGlobalListener<K extends keyof DocumentEventMap>(\n type: K,\n handler: (ev: DocumentEventMap[K]) => void,\n options?: AddEventListenerOptions\n ): void;\n function removeGlobalListener<K extends keyof WindowEventMap>(\n type: K,\n handler: (ev: WindowEventMap[K]) => void,\n options?: AddEventListenerOptions & { isWindow: true }\n ): void;\n function removeGlobalListener(\n type: string,\n handler: EventListener,\n options?: AddEventListenerOptions & { isWindow?: boolean }\n ): void {\n const target = options?.isWindow ? window : document;\n const listenerOptions = options\n ? {\n capture: options.capture,\n }\n : undefined;\n\n target.removeEventListener(type, handler, listenerOptions);\n\n // Remove from tracked listeners\n const index = listeners.findIndex(\n (l) =>\n l.target === target &&\n l.type === type &&\n l.handler === handler &&\n l.options?.capture === listenerOptions?.capture\n );\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n }\n\n /**\n * Removes all registered global listeners.\n */\n function removeAllGlobalListeners(): void {\n for (const { target, type, handler, options } of listeners) {\n target.removeEventListener(type, handler, options);\n }\n listeners.length = 0;\n }\n\n // Automatically clean up when the component/scope is disposed\n onCleanup(removeAllGlobalListeners);\n\n return {\n addGlobalListener,\n removeGlobalListener,\n removeAllGlobalListeners,\n };\n}\n\n/**\n * Simple utility to add a single global listener with automatic cleanup.\n * For one-off listeners where the full manager isn't needed.\n */\nexport function addGlobalListenerOnce<K extends keyof DocumentEventMap>(\n type: K,\n handler: (ev: DocumentEventMap[K]) => void,\n options?: GlobalListenerOptions\n): () => void {\n const target = options?.isWindow ? window : document;\n const listenerOptions = options\n ? {\n capture: options.capture,\n passive: options.passive,\n once: options.once,\n }\n : undefined;\n\n target.addEventListener(type, handler as EventListener, listenerOptions);\n\n return () => {\n target.removeEventListener(type, handler as EventListener, listenerOptions);\n };\n}\n","/**\n * createPress - Handles press interactions across mouse, touch, keyboard, and virtual clicks.\n *\n * This is a 1-1 port of React-Aria's usePress hook adapted for SolidJS.\n * All behaviors, edge cases, and platform-specific handling are preserved.\n */\n\nimport { createSignal, JSX, Accessor, onCleanup } from 'solid-js';\nimport { PressEvent, PointerType, createPressEvent } from './PressEvent';\nimport {\n nodeContains,\n getEventTarget,\n isValidKeyboardEvent,\n isHTMLAnchorLink,\n shouldPreventDefaultKeyboard,\n isVirtualClick,\n isVirtualPointerEvent,\n isPointOverTarget,\n getTouchFromEvent,\n getTouchById,\n disableTextSelection,\n restoreTextSelection,\n preventFocus,\n openLink,\n isMac,\n createGlobalListeners,\n} from '../utils';\n\n// Re-export PressEvent types\nexport { PressEvent, type PointerType } from './PressEvent';\nexport type { IPressEvent, PressEventType } from './PressEvent';\n\nexport interface CreatePressProps {\n /** Whether the target is currently disabled. */\n isDisabled?: Accessor<boolean> | boolean;\n /** Handler called when the press is released over the target. */\n onPress?: (e: PressEvent) => void;\n /** Handler called when a press interaction starts. */\n onPressStart?: (e: PressEvent) => void;\n /**\n * Handler called when a press interaction ends, either\n * over the target or when the pointer leaves the target.\n */\n onPressEnd?: (e: PressEvent) => void;\n /** Handler called when a press is released over the target, regardless of whether it started on the target. */\n onPressUp?: (e: PressEvent) => void;\n /** Handler called when the press state changes. */\n onPressChange?: (isPressed: boolean) => void;\n /** Whether the press should be visual only, not triggering onPress. */\n isPressed?: Accessor<boolean> | boolean;\n /** Whether to prevent focus when pressing. */\n preventFocusOnPress?: boolean;\n /** Whether long press should cancel when pointer moves out of target. */\n shouldCancelOnPointerExit?: boolean;\n /** Whether text selection should be allowed during press. */\n allowTextSelectionOnPress?: boolean;\n}\n\nexport interface PressResult {\n /** Whether the target is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Props to spread on the target element. */\n pressProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nfunction isDisabledValue(isDisabled: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isDisabled === 'function') {\n return isDisabled();\n }\n return isDisabled ?? false;\n}\n\nfunction isPressedValue(isPressed: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isPressed === 'function') {\n return isPressed();\n }\n return isPressed ?? false;\n}\n\n// Symbol to track if a link click was handled by us\nconst LINK_CLICKED = Symbol('linkClicked');\n\n// CSS for preventing double-tap zoom delay\nlet pressableCSSInjected = false;\nfunction injectPressableCSS(): void {\n if (pressableCSSInjected || typeof document === 'undefined') return;\n\n const style = document.createElement('style');\n style.id = 'solidaria-pressable-style';\n style.textContent = `\n [data-solidaria-pressable] {\n touch-action: pan-x pan-y pinch-zoom;\n }\n `;\n document.head.appendChild(style);\n pressableCSSInjected = true;\n}\n\n/**\n * Handles press interactions across mouse, touch, keyboard, and screen readers.\n * Provides consistent press behavior regardless of input method.\n *\n * Based on react-aria's usePress but adapted for SolidJS.\n */\nexport function createPress(props: CreatePressProps = {}): PressResult {\n // Internal pressed state (for visual feedback)\n const [internalIsPressed, setInternalIsPressed] = createSignal(false);\n\n // Use controlled isPressed if provided, otherwise internal state\n const isPressed = (): boolean => {\n const controlledPressed = isPressedValue(props.isPressed);\n if (controlledPressed) {\n return controlledPressed;\n }\n return internalIsPressed();\n };\n\n // State tracking (using plain variables - SolidJS doesn't need refs for mutable state)\n let pressState = {\n isPressed: false,\n ignoreEmulatedMouseEvents: false,\n ignoreClickAfterPress: false,\n didFirePressStart: false,\n isTriggeringEvent: false,\n activePointerId: null as number | null,\n target: null as Element | null,\n isOverTarget: false,\n pointerType: null as PointerType | null,\n userSelect: undefined as string | undefined,\n metaKeyEvents: null as Map<string, KeyboardEvent> | null,\n clickCleanup: null as (() => void) | null,\n };\n\n // Global listeners manager\n const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();\n\n // Inject CSS on first use\n injectPressableCSS();\n\n // --- Event Triggers ---\n\n const triggerPressStart = (originalEvent: Event, pointerType: PointerType): boolean => {\n if (isDisabledValue(props.isDisabled) || pressState.didFirePressStart) {\n return false;\n }\n\n let shouldStopPropagation = true;\n pressState.isTriggeringEvent = true;\n\n if (props.onPressStart) {\n const event = createPressEvent('pressstart', pointerType, originalEvent, pressState.target!);\n props.onPressStart(event);\n shouldStopPropagation = event.shouldStopPropagation;\n }\n\n if (props.onPressChange) {\n props.onPressChange(true);\n }\n\n pressState.isTriggeringEvent = false;\n pressState.didFirePressStart = true;\n setInternalIsPressed(true);\n\n return shouldStopPropagation;\n };\n\n const triggerPressEnd = (originalEvent: Event, pointerType: PointerType, wasPressed = true): void => {\n if (!pressState.didFirePressStart) {\n return;\n }\n\n pressState.ignoreClickAfterPress = true;\n pressState.didFirePressStart = false;\n pressState.isTriggeringEvent = true;\n\n if (props.onPressEnd) {\n const event = createPressEvent('pressend', pointerType, originalEvent, pressState.target!);\n props.onPressEnd(event);\n }\n\n if (props.onPressChange) {\n props.onPressChange(false);\n }\n\n setInternalIsPressed(false);\n\n if (wasPressed && !isDisabledValue(props.isDisabled)) {\n if (props.onPress) {\n const event = createPressEvent('press', pointerType, originalEvent, pressState.target!);\n props.onPress(event);\n }\n }\n\n pressState.isTriggeringEvent = false;\n };\n\n const triggerPressUp = (originalEvent: Event, pointerType: PointerType): void => {\n if (isDisabledValue(props.isDisabled)) {\n return;\n }\n\n if (props.onPressUp) {\n pressState.isTriggeringEvent = true;\n const event = createPressEvent('pressup', pointerType, originalEvent, pressState.target!);\n props.onPressUp(event);\n pressState.isTriggeringEvent = false;\n }\n };\n\n const cancel = (originalEvent: Event): void => {\n if (!pressState.isPressed) {\n return;\n }\n\n if (pressState.isOverTarget && pressState.target) {\n triggerPressEnd(originalEvent, pressState.pointerType ?? 'mouse', false);\n }\n\n pressState.isPressed = false;\n pressState.isOverTarget = false;\n pressState.activePointerId = null;\n pressState.pointerType = null;\n\n removeAllGlobalListeners();\n\n // Clean up click timeout/listener if set\n if (pressState.clickCleanup) {\n pressState.clickCleanup();\n pressState.clickCleanup = null;\n }\n\n if (!props.allowTextSelectionOnPress) {\n restoreTextSelection(pressState.target as HTMLElement);\n }\n };\n\n // --- Pointer Event Handlers (used when PointerEvent is available) ---\n\n const onPointerDown: JSX.EventHandler<HTMLElement, PointerEvent> = (e) => {\n // Only handle left clicks, and ignore events that bubbled through portals\n if (e.button !== 0 || !nodeContains(e.currentTarget, getEventTarget(e))) {\n return;\n }\n\n // iOS VoiceOver bug: fires pointer events with incorrect coordinates\n // Let the click handler deal with it instead\n if (isVirtualPointerEvent(e)) {\n pressState.pointerType = 'virtual';\n return;\n }\n\n pressState.pointerType = e.pointerType as PointerType;\n\n if (!pressState.isPressed) {\n pressState.isPressed = true;\n pressState.isOverTarget = true;\n pressState.activePointerId = e.pointerId;\n pressState.target = e.currentTarget;\n\n if (!props.allowTextSelectionOnPress) {\n disableTextSelection(pressState.target as HTMLElement);\n }\n\n const shouldStopPropagation = triggerPressStart(e, pressState.pointerType);\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n\n // Set up global listeners for pointer events\n addGlobalListener('pointerup', onPointerUp);\n addGlobalListener('pointercancel', onPointerCancel);\n }\n };\n\n // Mouse down handler when using pointer events - only prevents focus, doesn't trigger press\n const onMouseDownPointer: JSX.EventHandler<HTMLElement, MouseEvent> = (e) => {\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n return;\n }\n\n if (e.button === 0) {\n // Prevent focus if requested\n if (props.preventFocusOnPress) {\n preventFocus(e.currentTarget);\n }\n e.stopPropagation();\n }\n };\n\n const onPointerUp = (e: PointerEvent): void => {\n // Only handle events for our active pointer\n if (e.pointerId !== pressState.activePointerId || !pressState.isPressed || e.button !== 0 || !pressState.target) {\n return;\n }\n\n const isOverTarget = nodeContains(pressState.target, getEventTarget(e) as Element);\n if (isOverTarget && pressState.pointerType != null && pressState.pointerType !== 'virtual') {\n // Pointer released over target - wait for onClick to complete the press sequence.\n // This matches React-Aria's behavior for compatibility with DOM mutations and third-party libraries.\n // https://github.com/adobe/react-spectrum/issues/1513\n // https://issues.chromium.org/issues/40732224\n //\n // However, if stopPropagation is called on the click event (e.g., by a child input element),\n // the onClick handler on this element won't fire. We work around this by triggering a click\n // ourselves after a timeout. This timeout is canceled during the click event in case the\n // real one fires first. The timeout must be at least 32ms, because Safari on iOS delays the\n // click event on non-form elements without certain ARIA roles (for hover emulation).\n // https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm#L875-L892\n let clickFired = false;\n const timeout = setTimeout(() => {\n // Guard for SSR/test environments where the element may no longer exist\n if (typeof HTMLElement === 'undefined') {\n return;\n }\n if (pressState.isPressed && pressState.target instanceof HTMLElement) {\n if (clickFired) {\n // Click already happened, just cancel the press state\n cancel(e);\n } else {\n // Click didn't happen (probably due to stopPropagation), trigger it manually\n pressState.target.focus();\n pressState.target.click();\n }\n }\n }, 80);\n\n // Use a capturing listener to track if a click occurred.\n // If stopPropagation is called it may never reach our handler.\n const doc = pressState.target.ownerDocument ?? document;\n const clickListener = () => {\n clickFired = true;\n };\n doc.addEventListener('click', clickListener, true);\n\n // Store cleanup function\n pressState.clickCleanup = () => {\n clearTimeout(timeout);\n doc.removeEventListener('click', clickListener, true);\n };\n\n pressState.isOverTarget = false;\n } else {\n // Pointer released outside target, or virtual - cancel the press\n cancel(e);\n }\n };\n\n const onPointerCancel = (e: PointerEvent): void => {\n if (e.pointerId === pressState.activePointerId) {\n cancel(e);\n }\n };\n\n const onPointerEnter: JSX.EventHandler<HTMLElement, PointerEvent> = (e) => {\n if (e.pointerId === pressState.activePointerId && pressState.target && !pressState.isOverTarget && pressState.pointerType != null) {\n pressState.isOverTarget = true;\n triggerPressStart(e, pressState.pointerType);\n }\n };\n\n const onPointerLeave: JSX.EventHandler<HTMLElement, PointerEvent> = (e) => {\n if (e.pointerId === pressState.activePointerId && pressState.target && pressState.isOverTarget && pressState.pointerType != null) {\n pressState.isOverTarget = false;\n triggerPressEnd(e, pressState.pointerType, false);\n\n if (props.shouldCancelOnPointerExit) {\n cancel(e);\n }\n }\n };\n\n // --- Touch Event Handlers (fallback for testing/older browsers) ---\n\n const onTouchStart: JSX.EventHandler<HTMLElement, TouchEvent> = (e) => {\n if (isDisabledValue(props.isDisabled)) {\n return;\n }\n\n // If already pressed via pointer events, ignore touch events\n if (pressState.isPressed) {\n return;\n }\n\n const touch = getTouchFromEvent(e);\n if (!touch) {\n return;\n }\n\n pressState.activePointerId = touch.identifier;\n pressState.ignoreEmulatedMouseEvents = true;\n pressState.isOverTarget = true;\n pressState.isPressed = true;\n pressState.target = e.currentTarget;\n pressState.pointerType = 'touch';\n\n if (!props.allowTextSelectionOnPress) {\n disableTextSelection(pressState.target as HTMLElement);\n }\n\n const shouldStopPropagation = triggerPressStart(e, 'touch');\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n\n addGlobalListener('scroll', onScroll, { capture: true, isWindow: true });\n };\n\n const onTouchMove: JSX.EventHandler<HTMLElement, TouchEvent> = (e) => {\n if (!pressState.isPressed) {\n return;\n }\n\n const touch = getTouchById(e, pressState.activePointerId);\n if (!touch) {\n return;\n }\n\n const target = pressState.target!;\n const isOverTarget = isPointOverTarget(touch, target);\n\n if (isOverTarget !== pressState.isOverTarget) {\n pressState.isOverTarget = isOverTarget;\n if (isOverTarget) {\n triggerPressStart(e, 'touch');\n } else {\n triggerPressEnd(e, 'touch', false);\n\n if (props.shouldCancelOnPointerExit) {\n cancel(e);\n }\n }\n }\n };\n\n const onTouchEnd: JSX.EventHandler<HTMLElement, TouchEvent> = (e) => {\n if (!pressState.isPressed) {\n return;\n }\n\n const touch = getTouchById(e, pressState.activePointerId);\n if (!touch) {\n return;\n }\n\n const target = pressState.target!;\n const isOverTarget = isPointOverTarget(touch, target);\n\n if (isOverTarget) {\n triggerPressUp(e, 'touch');\n }\n\n triggerPressEnd(e, 'touch', isOverTarget && pressState.isOverTarget);\n\n pressState.isPressed = false;\n pressState.isOverTarget = false;\n pressState.activePointerId = null;\n pressState.pointerType = null;\n\n removeAllGlobalListeners();\n\n if (!props.allowTextSelectionOnPress) {\n restoreTextSelection(target as HTMLElement);\n }\n };\n\n const onTouchCancel: JSX.EventHandler<HTMLElement, TouchEvent> = (e) => {\n cancel(e);\n };\n\n const onScroll = (e: Event): void => {\n if (pressState.isPressed && nodeContains(e.target as Element, pressState.target)) {\n cancel(e);\n }\n };\n\n // --- Mouse Event Handlers (fallback when PointerEvent is not available) ---\n\n const onMouseDownFallback: JSX.EventHandler<HTMLElement, MouseEvent> = (e) => {\n // Only handle left button\n if (e.button !== 0) {\n return;\n }\n\n // Ignore emulated mouse events from touch\n if (pressState.ignoreEmulatedMouseEvents) {\n e.stopPropagation();\n return;\n }\n\n pressState.isPressed = true;\n pressState.isOverTarget = true;\n pressState.target = e.currentTarget;\n pressState.pointerType = isVirtualClick(e) ? 'virtual' : 'mouse';\n\n const shouldStopPropagation = triggerPressStart(e, pressState.pointerType);\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n\n addGlobalListener('mouseup', onMouseUpFallback);\n };\n\n const onMouseUpFallback = (e: MouseEvent): void => {\n if (e.button !== 0) {\n return;\n }\n\n if (!pressState.ignoreEmulatedMouseEvents && e.button === 0 && !pressState.isPressed) {\n triggerPressUp(e, pressState.pointerType || 'mouse');\n }\n };\n\n const onMouseEnterFallback: JSX.EventHandler<HTMLElement, MouseEvent> = (e) => {\n if (!pressState.isPressed || pressState.ignoreEmulatedMouseEvents) {\n return;\n }\n\n if (pressState.isPressed && !pressState.ignoreEmulatedMouseEvents && pressState.pointerType != null) {\n pressState.isOverTarget = true;\n triggerPressStart(e, pressState.pointerType);\n }\n };\n\n const onMouseLeaveFallback: JSX.EventHandler<HTMLElement, MouseEvent> = (e) => {\n if (!pressState.isPressed || pressState.ignoreEmulatedMouseEvents) {\n return;\n }\n\n if (pressState.isPressed && !pressState.ignoreEmulatedMouseEvents && pressState.pointerType != null) {\n pressState.isOverTarget = false;\n triggerPressEnd(e, pressState.pointerType, false);\n\n if (props.shouldCancelOnPointerExit) {\n cancel(e);\n }\n }\n };\n\n // --- Keyboard Event Handlers ---\n\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {\n if (isDisabledValue(props.isDisabled)) {\n return;\n }\n\n if (!isValidKeyboardEvent(e, e.currentTarget)) {\n // Allow event to propagate for invalid keys\n if (e.key === 'Enter') {\n e.stopPropagation();\n }\n return;\n }\n\n // Prevent key repeat\n if (e.repeat) {\n e.preventDefault();\n return;\n }\n\n pressState.target = e.currentTarget;\n pressState.isPressed = true;\n pressState.isOverTarget = true;\n pressState.pointerType = 'keyboard';\n\n const shouldStopPropagation = triggerPressStart(e, 'keyboard');\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n\n // Prevent default for non-native interactive elements\n if (shouldPreventDefaultKeyboard(e.currentTarget, e.key)) {\n e.preventDefault();\n }\n\n // macOS bug: keyup doesn't fire while Meta key is held\n // Track keydown events while Meta is held so we can manually dispatch keyup\n if (isMac() && e.metaKey && !e.ctrlKey && !e.altKey) {\n pressState.metaKeyEvents = pressState.metaKeyEvents || new Map();\n pressState.metaKeyEvents.set(e.key, e);\n }\n\n // For Enter key on native buttons, the click fires on keydown\n // Set flag to ignore it\n if (e.key === 'Enter') {\n pressState.ignoreClickAfterPress = true;\n }\n\n // Set up global keyup listener\n addGlobalListener('keyup', onKeyUp, { capture: true });\n };\n\n const onKeyUp = (e: KeyboardEvent): void => {\n if (!pressState.isPressed || pressState.pointerType !== 'keyboard') {\n return;\n }\n\n if (!isValidKeyboardEvent(e, pressState.target!)) {\n return;\n }\n\n // Handle macOS Meta key bug\n if (isMac() && e.key === 'Meta' && pressState.metaKeyEvents?.size) {\n // When Meta releases, dispatch keyup for any keys that were pressed during\n for (const [key, event] of pressState.metaKeyEvents) {\n pressState.target?.dispatchEvent(\n new KeyboardEvent('keyup', {\n key,\n code: event.code,\n bubbles: true,\n cancelable: true,\n })\n );\n }\n pressState.metaKeyEvents.clear();\n return;\n }\n\n const target = pressState.target!;\n triggerPressUp(e, 'keyboard');\n triggerPressEnd(e, 'keyboard', pressState.isOverTarget);\n\n pressState.isPressed = false;\n pressState.pointerType = null;\n\n removeAllGlobalListeners();\n\n // Prevent default to avoid triggering native action\n e.preventDefault();\n\n // Handle link activation with non-Enter keys (Space)\n // Native links only respond to Enter, but we want Space to work too\n if (e.key === ' ' && isHTMLAnchorLink(target) && !(target as any)[LINK_CLICKED]) {\n (target as any)[LINK_CLICKED] = true;\n openLink(target as HTMLAnchorElement, e);\n // Clean up the marker\n setTimeout(() => {\n delete (target as any)[LINK_CLICKED];\n }, 0);\n }\n\n // For Space key, the click fires after keyup\n // Set flag to ignore it\n if (e.key === ' ') {\n pressState.ignoreClickAfterPress = true;\n }\n };\n\n // --- Click Event Handler ---\n\n const onClick: JSX.EventHandler<HTMLElement, MouseEvent> = (e) => {\n // Don't handle click if it's not on the target\n if (!nodeContains(e.currentTarget, e.target as Element)) {\n return;\n }\n\n // Only process left clicks that aren't from our own event triggers\n if (e.button === 0 && !pressState.isTriggeringEvent) {\n if (isDisabledValue(props.isDisabled)) {\n e.preventDefault();\n return;\n }\n\n // If triggered from a screen reader or by using element.click(),\n // trigger as if it were a keyboard/virtual click.\n if (\n !pressState.ignoreEmulatedMouseEvents &&\n !pressState.isPressed &&\n (pressState.pointerType === 'virtual' || isVirtualClick(e))\n ) {\n pressState.target = e.currentTarget;\n triggerPressStart(e, 'virtual');\n triggerPressUp(e, 'virtual');\n triggerPressEnd(e, 'virtual', true);\n } else if (pressState.isPressed && pressState.pointerType !== 'keyboard') {\n // Complete the press sequence for pointer/touch/mouse events\n const pointerType =\n pressState.pointerType ||\n ((e as unknown as PointerEvent).pointerType as PointerType) ||\n 'virtual';\n triggerPressUp(e, pointerType);\n triggerPressEnd(e, pointerType, true);\n pressState.isOverTarget = false;\n cancel(e);\n }\n\n pressState.ignoreEmulatedMouseEvents = false;\n }\n };\n\n // --- Drag Event Handler ---\n\n const onDragStart: JSX.EventHandler<HTMLElement, DragEvent> = (e) => {\n // Safari doesn't fire pointercancel on drag, so we need to cancel manually\n if (pressState.isPressed) {\n cancel(e);\n }\n };\n\n // --- Build Props ---\n // Conditionally use pointer events or mouse events based on browser support\n // This matches React-Aria's approach exactly\n\n const pressProps: JSX.HTMLAttributes<HTMLElement> & { 'data-solidaria-pressable': string } =\n typeof PointerEvent !== 'undefined'\n ? {\n // Keyboard events\n onKeyDown,\n onKeyUp,\n onClick,\n onDragStart,\n // Pointer events (preferred when available)\n onPointerDown,\n onPointerEnter,\n onPointerLeave,\n // Mouse down only for focus prevention when using pointer events\n onMouseDown: onMouseDownPointer,\n // Touch events (always included for ignoreEmulatedMouseEvents handling)\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n onTouchCancel,\n // Attribute for CSS touch-action\n 'data-solidaria-pressable': '',\n }\n : {\n // Keyboard events\n onKeyDown,\n onKeyUp,\n onClick,\n onDragStart,\n // Mouse events (fallback when PointerEvent not available)\n onMouseDown: onMouseDownFallback,\n onMouseEnter: onMouseEnterFallback,\n onMouseLeave: onMouseLeaveFallback,\n // Touch events (always included)\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n onTouchCancel,\n // Attribute for CSS touch-action\n 'data-solidaria-pressable': '',\n };\n\n // Clean up on unmount\n onCleanup(() => {\n removeAllGlobalListeners();\n // Clean up click timeout/listener if pending\n if (pressState.clickCleanup) {\n pressState.clickCleanup();\n pressState.clickCleanup = null;\n }\n });\n\n return {\n isPressed,\n pressProps,\n };\n}\n","/**\n * createFocus - Handles focus events for the immediate target.\n *\n * This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.\n * Focus events on child elements will be ignored.\n */\n\nimport { JSX, onCleanup } from 'solid-js';\nimport { getOwnerDocument, getEventTarget } from '../utils';\n\nexport interface FocusEvents {\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n}\n\nexport interface CreateFocusProps extends FocusEvents {\n /** Whether the focus events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusResult {\n /** Props to spread onto the target element. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Synthetic blur event handler for Firefox bug workaround.\n * React (and we) don't fire onBlur when an element is disabled.\n * Most browsers fire a native focusout event in this case, except for Firefox.\n * We use a MutationObserver to watch for the disabled attribute.\n */\nfunction createSyntheticBlurHandler(\n onBlur: ((e: FocusEvent) => void) | undefined\n): (_e: FocusEvent, target: Element) => (() => void) | undefined {\n let isFocused = false;\n let observer: MutationObserver | null = null;\n\n return (_e: FocusEvent, target: Element) => {\n if (\n target instanceof HTMLButtonElement ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n ) {\n isFocused = true;\n\n const onBlurHandler = (blurEvent: Event) => {\n isFocused = false;\n\n if ((target as HTMLButtonElement).disabled && onBlur) {\n onBlur(blurEvent as FocusEvent);\n }\n\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n\n target.addEventListener('focusout', onBlurHandler, { once: true });\n\n observer = new MutationObserver(() => {\n if (isFocused && (target as HTMLButtonElement).disabled) {\n observer?.disconnect();\n const relatedTarget = target === document.activeElement ? null : document.activeElement;\n target.dispatchEvent(new FocusEvent('blur', { relatedTarget }));\n target.dispatchEvent(new FocusEvent('focusout', { bubbles: true, relatedTarget }));\n }\n });\n\n observer.observe(target, { attributes: true, attributeFilter: ['disabled'] });\n\n // Return cleanup function\n return () => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Handles focus events for the immediate target.\n * Focus events on child elements will be ignored.\n *\n * Based on react-aria's useFocus but adapted for SolidJS.\n */\nexport function createFocus(props: CreateFocusProps = {}): FocusResult {\n const { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;\n\n let cleanupRef: (() => void) | undefined;\n const syntheticBlurHandler = createSyntheticBlurHandler(onBlurProp);\n\n // Cleanup on unmount\n onCleanup(() => {\n if (cleanupRef) {\n cleanupRef();\n }\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Only handle if target is the currentTarget (not bubbled from children)\n if (e.target === e.currentTarget) {\n if (onBlurProp) {\n onBlurProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(false);\n }\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument?.activeElement;\n\n if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {\n if (onFocusProp) {\n onFocusProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(true);\n }\n\n // Set up synthetic blur handler for Firefox bug\n cleanupRef = syntheticBlurHandler(e, e.target);\n }\n };\n\n // If disabled or no handlers, return empty props\n if (isDisabled) {\n return {\n focusProps: {},\n };\n }\n\n const hasHandlers = onFocusProp || onFocusChange || onBlurProp;\n\n return {\n focusProps: {\n onFocus: hasHandlers ? onFocus : undefined,\n onBlur: onBlurProp || onFocusChange ? onBlur : undefined,\n },\n };\n}\n","/**\n * createFocusWithin - Handles focus events for the target and its descendants.\n *\n * This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.\n */\n\nimport { JSX, onCleanup } from 'solid-js';\nimport { getOwnerDocument, getEventTarget, nodeContains, createGlobalListeners } from '../utils';\nimport { setEventTarget } from '../utils/events';\n\nexport interface FocusWithinProps {\n /** Whether the focus within events should be disabled. */\n isDisabled?: boolean;\n /** Handler that is called when the target element or a descendant receives focus. */\n onFocusWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the target element and all descendants lose focus. */\n onBlurWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the focus within state changes. */\n onFocusWithinChange?: (isFocusWithin: boolean) => void;\n}\n\nexport interface FocusWithinResult {\n /** Props to spread onto the target element. */\n focusWithinProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Handles focus events for the target and its descendants.\n *\n * Based on react-aria's useFocusWithin but adapted for SolidJS.\n */\nexport function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResult {\n const { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;\n\n // State tracking\n let isFocusWithin = false;\n\n // Global listeners manager\n const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();\n\n // Cleanup on unmount\n onCleanup(() => {\n removeAllGlobalListeners();\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // We don't want to trigger onBlurWithin and then immediately onFocusWithin again\n // when moving focus inside the element. Only trigger if the currentTarget doesn't\n // include the relatedTarget (where focus is moving).\n if (isFocusWithin && !e.currentTarget.contains(e.relatedTarget as Node)) {\n isFocusWithin = false;\n removeAllGlobalListeners();\n\n if (onBlurWithin) {\n onBlurWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument?.activeElement;\n\n if (!isFocusWithin && activeElement === getEventTarget(e)) {\n if (onFocusWithin) {\n onFocusWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(true);\n }\n\n isFocusWithin = true;\n\n // Browsers don't fire blur events when elements are removed from the DOM.\n // However, if a focus event occurs outside the element we're tracking, we\n // can manually fire onBlur.\n const currentTarget = e.currentTarget;\n\n addGlobalListener(\n 'focus',\n (focusEvent: Event) => {\n if (isFocusWithin && !nodeContains(currentTarget, (focusEvent as FocusEvent).target as Element)) {\n // Create a synthetic blur event\n const window = ownerDocument?.defaultView;\n if (window) {\n const nativeEvent = new window.FocusEvent('blur', {\n relatedTarget: (focusEvent as FocusEvent).target as Element,\n });\n setEventTarget(nativeEvent, currentTarget);\n\n isFocusWithin = false;\n removeAllGlobalListeners();\n\n if (onBlurWithin) {\n onBlurWithin(nativeEvent);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n }\n }\n },\n { capture: true }\n );\n }\n };\n\n if (isDisabled) {\n return {\n focusWithinProps: {\n onFocus: undefined,\n onBlur: undefined,\n },\n };\n }\n\n return {\n focusWithinProps: {\n onFocus,\n onBlur,\n },\n };\n}\n","/**\n * createKeyboard - Handles keyboard interactions for a focusable element.\n *\n * This is a 1-1 port of React-Aria's useKeyboard hook adapted for SolidJS.\n */\n\nimport { JSX } from 'solid-js';\n\n/**\n * Keyboard event with continuePropagation support.\n * By default, keyboard events stop propagation.\n */\nexport interface KeyboardEvent extends globalThis.KeyboardEvent {\n /** Call this to allow the event to propagate to parent elements. */\n continuePropagation(): void;\n}\n\nexport interface KeyboardEvents {\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n}\n\nexport interface CreateKeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Wraps a keyboard event handler to make stopPropagation the default,\n * and support continuePropagation instead.\n */\nfunction createEventHandler<T extends globalThis.KeyboardEvent>(\n handler?: (e: KeyboardEvent) => void\n): ((e: T) => void) | undefined {\n if (!handler) {\n return undefined;\n }\n\n return (e: T) => {\n let shouldStopPropagation = true;\n\n // Create a wrapped event with continuePropagation\n const event = Object.assign(e, {\n continuePropagation() {\n shouldStopPropagation = false;\n },\n }) as KeyboardEvent;\n\n handler(event);\n\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n };\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n *\n * Based on react-aria's useKeyboard but adapted for SolidJS.\n */\nexport function createKeyboard(props: CreateKeyboardProps = {}): KeyboardResult {\n if (props.isDisabled) {\n return {\n keyboardProps: {},\n };\n }\n\n return {\n keyboardProps: {\n onKeyDown: createEventHandler(props.onKeyDown),\n onKeyUp: createEventHandler(props.onKeyUp),\n },\n };\n}\n","/**\n * createFocusable - Makes an element focusable and capable of auto focus.\n *\n * This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.\n */\n\nimport { JSX, Accessor, createContext, useContext, onMount } from 'solid-js';\nimport { createFocus, type FocusEvents } from './createFocus';\nimport { createKeyboard, type KeyboardEvents } from './createKeyboard';\nimport { mergeProps, focusSafely } from '../utils';\n\nexport interface FocusableDOMProps {\n /** Whether to exclude the element from the sequential tab order. */\n excludeFromTabOrder?: boolean;\n}\n\nexport interface FocusableProps extends FocusEvents, KeyboardEvents {\n /** Whether the element should receive focus on mount. */\n autoFocus?: boolean;\n}\n\nexport interface CreateFocusableProps extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: Accessor<boolean> | boolean;\n}\n\nexport interface FocusableResult {\n /** Props to spread on the focusable element. */\n focusableProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// --- FocusableContext ---\n\nexport interface FocusableContextValue {\n ref?: (el: HTMLElement) => void;\n [key: string]: unknown;\n}\n\n/**\n * Context for passing focusable props to nested focusable children.\n * Used by FocusableProvider to pass DOM props to the nearest focusable child.\n */\nexport const FocusableContext = createContext<FocusableContextValue | null>(null);\n\n/**\n * Hook to consume the FocusableContext and sync the ref.\n */\nfunction useFocusableContext(\n setRef: (el: HTMLElement) => void\n): Omit<FocusableContextValue, 'ref'> {\n const context = useContext(FocusableContext) || {};\n\n // If context has a ref, sync our ref to it\n if (context.ref) {\n const contextRef = context.ref;\n // Create a combined ref that calls both\n const originalSetRef = setRef;\n setRef = (el: HTMLElement) => {\n originalSetRef(el);\n contextRef(el);\n };\n }\n\n // Return context without the ref\n const { ref: _, ...otherProps } = context;\n return otherProps;\n}\n\nexport interface FocusableProviderProps {\n /** The child element to provide DOM props to. */\n children?: JSX.Element;\n}\n\nfunction isDisabledValue(isDisabled: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isDisabled === 'function') {\n return isDisabled();\n }\n return isDisabled ?? false;\n}\n\n/**\n * Makes an element focusable, handling disabled state and tab order.\n * Provides focus state tracking and autoFocus support.\n *\n * Based on react-aria's useFocusable but adapted for SolidJS.\n *\n * @example\n * ```tsx\n * import { createFocusable } from 'solidaria';\n *\n * function FocusableInput(props) {\n * let ref;\n * const { focusableProps } = createFocusable({\n * autoFocus: props.autoFocus,\n * onFocusChange: (focused) => console.log('Focus:', focused),\n * });\n *\n * return (\n * <input\n * {...focusableProps}\n * ref={(el) => { ref = el; focusableProps.ref?.(el); }}\n * />\n * );\n * }\n * ```\n */\nexport function createFocusable(\n props: CreateFocusableProps = {},\n ref?: (el: HTMLElement) => void\n): FocusableResult {\n let elementRef: HTMLElement | null = null;\n let autoFocusDone = false;\n\n // Set up ref handler\n const setRef = (el: HTMLElement) => {\n elementRef = el;\n ref?.(el);\n };\n\n // Get focus and keyboard props from the respective hooks\n const { focusProps } = createFocus({\n isDisabled: isDisabledValue(props.isDisabled),\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onFocusChange: props.onFocusChange,\n });\n\n const { keyboardProps } = createKeyboard({\n isDisabled: isDisabledValue(props.isDisabled),\n onKeyDown: props.onKeyDown,\n onKeyUp: props.onKeyUp,\n });\n\n // Merge focus and keyboard interactions\n const interactions = mergeProps(focusProps, keyboardProps);\n\n // Get context props (from FocusableProvider if present)\n const contextProps = useFocusableContext(setRef);\n const interactionProps = isDisabledValue(props.isDisabled) ? {} : contextProps;\n\n // Handle autoFocus\n onMount(() => {\n if (props.autoFocus && elementRef && !autoFocusDone) {\n focusSafely(elementRef);\n autoFocusDone = true;\n }\n });\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (isDisabledValue(props.isDisabled)) {\n tabIndex = undefined;\n }\n\n // Build final focusable props\n const focusableProps = mergeProps(\n {\n ...interactions,\n tabIndex,\n ref: setRef,\n },\n interactionProps\n ) as JSX.HTMLAttributes<HTMLElement>;\n\n return {\n focusableProps,\n };\n}\n","/**\n * createFocusRing hook for Solidaria\n *\n * Determines whether a focus ring should be visible for a given element.\n * Focus rings are visible when the user navigates with keyboard, but hidden\n * when using mouse/touch.\n *\n * Port of @react-aria/focus useFocusRing.\n */\n\nimport { type JSX, type Accessor, createSignal, createEffect, onCleanup } from 'solid-js';\nimport { createFocus } from './createFocus';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface FocusRingProps {\n /** Whether the element is a text input. */\n isTextInput?: boolean;\n /** Whether the element will be auto focused. */\n autoFocus?: boolean;\n /** Whether focus should be tracked within the element. */\n within?: boolean;\n}\n\nexport interface FocusRingResult {\n /** Whether the element is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the focus ring should be visible. */\n isFocusVisible: Accessor<boolean>;\n /** Props to spread on the element to track focus. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// ============================================\n// GLOBAL STATE\n// ============================================\n\ntype Modality = 'keyboard' | 'pointer' | 'virtual';\n\nlet currentModality: Modality | null = null;\nlet hasSetupGlobalListeners = false;\nlet changeHandlers = new Set<(modality: Modality) => void>();\n\nfunction triggerChangeHandlers(modality: Modality) {\n currentModality = modality;\n for (const handler of changeHandlers) {\n handler(modality);\n }\n}\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n // Ignore modifier keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta') {\n return;\n }\n currentModality = 'keyboard';\n triggerChangeHandlers('keyboard');\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n currentModality = 'pointer';\n if (e.type === 'mousedown' || e.type === 'pointerdown') {\n triggerChangeHandlers('pointer');\n }\n}\n\nfunction setupGlobalFocusListeners() {\n if (typeof document === 'undefined' || hasSetupGlobalListeners) {\n return;\n }\n\n hasSetupGlobalListeners = true;\n\n // Track keyboard vs pointer modality\n document.addEventListener('keydown', handleKeyboardEvent, true);\n document.addEventListener('keyup', handleKeyboardEvent, true);\n document.addEventListener('mousedown', handlePointerEvent, true);\n document.addEventListener('pointerdown', handlePointerEvent, true);\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Determines whether a focus ring should be visible for a given element.\n *\n * Focus rings are visible when:\n * - The element is focused AND\n * - The user is navigating with keyboard (not mouse/touch)\n *\n * For text inputs, focus rings are always visible when focused.\n */\nexport function createFocusRing(props: FocusRingProps = {}): FocusRingResult {\n const { isTextInput = false, autoFocus = false } = props;\n\n const [isFocused, setIsFocused] = createSignal(false);\n const [isFocusVisible, setIsFocusVisible] = createSignal(autoFocus);\n const [modality, setModality] = createSignal<Modality | null>(currentModality);\n\n // Setup global listeners\n createEffect(() => {\n setupGlobalFocusListeners();\n\n const handler = (newModality: Modality) => {\n setModality(newModality);\n };\n\n changeHandlers.add(handler);\n onCleanup(() => {\n changeHandlers.delete(handler);\n });\n });\n\n // Update focus visible based on modality and focus state\n createEffect(() => {\n const focused = isFocused();\n const mod = modality();\n\n if (focused) {\n // Text inputs always show focus ring when focused\n // Otherwise, only show if last interaction was keyboard\n setIsFocusVisible(isTextInput || mod === 'keyboard');\n } else {\n setIsFocusVisible(false);\n }\n });\n\n // Use createFocus to track focus state\n const focusResult = createFocus({\n onFocus: () => setIsFocused(true),\n onBlur: () => setIsFocused(false),\n });\n\n return {\n isFocused,\n isFocusVisible,\n focusProps: focusResult.focusProps as JSX.HTMLAttributes<HTMLElement>,\n };\n}\n","/**\n * createHover hook for Solidaria\n *\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n *\n * Port of @react-aria/interactions useHover.\n */\n\nimport { type JSX, type Accessor, createSignal, createEffect, onCleanup, createMemo } from 'solid-js';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface HoverEvent {\n /** The type of hover event being fired. */\n type: 'hoverstart' | 'hoverend';\n /** The pointer type that triggered the hover event. */\n pointerType: 'mouse' | 'pen';\n /** The target element of the hover event. */\n target: Element;\n}\n\nexport interface HoverEvents {\n /** Handler called when the hover starts. */\n onHoverStart?: (e: HoverEvent) => void;\n /** Handler called when the hover ends. */\n onHoverEnd?: (e: HoverEvent) => void;\n /** Handler called when the hover state changes. */\n onHoverChange?: (isHovering: boolean) => void;\n}\n\nexport interface CreateHoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the element is currently hovered. */\n isHovered: Accessor<boolean>;\n}\n\n// ============================================\n// GLOBAL STATE\n// ============================================\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 50);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n if (typeof document === 'undefined') {\n return () => {};\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n document.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n document.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n document.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n document.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Handles pointer hover interactions for an element.\n */\nexport function createHover(props: MaybeAccessor<CreateHoverProps> = {}): HoverResult {\n const getProps = () => access(props);\n const [isHovered, setIsHovered] = createSignal(false);\n\n // Track internal hover state\n let state = {\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '' as 'mouse' | 'pen' | '',\n target: null as Element | null,\n };\n\n // Setup global touch events\n createEffect(() => {\n const cleanup = setupGlobalTouchEvents();\n onCleanup(cleanup);\n });\n\n // Reset hover when disabled\n createEffect(() => {\n const p = getProps();\n if (p.isDisabled && state.isHovered) {\n triggerHoverEnd(state.target as Element, state.pointerType as 'mouse' | 'pen');\n }\n });\n\n function triggerHoverStart(target: Element, pointerType: 'mouse' | 'pen') {\n const p = getProps();\n state.pointerType = pointerType;\n\n if (p.isDisabled || state.isHovered) {\n return;\n }\n\n state.isHovered = true;\n state.target = target;\n\n p.onHoverStart?.({\n type: 'hoverstart',\n target,\n pointerType,\n });\n\n p.onHoverChange?.(true);\n setIsHovered(true);\n }\n\n function triggerHoverEnd(target: Element | null, pointerType: 'mouse' | 'pen') {\n const p = getProps();\n state.pointerType = '';\n state.target = null;\n\n if (!state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n\n p.onHoverEnd?.({\n type: 'hoverend',\n target,\n pointerType,\n });\n\n p.onHoverChange?.(false);\n setIsHovered(false);\n }\n\n const hoverProps = createMemo<JSX.HTMLAttributes<HTMLElement>>(() => {\n if (typeof PointerEvent !== 'undefined') {\n return {\n onPointerEnter: (e: PointerEvent) => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n if (e.pointerType === 'touch') {\n return;\n }\n triggerHoverStart(e.currentTarget as Element, e.pointerType as 'mouse' | 'pen');\n },\n onPointerLeave: (e: PointerEvent) => {\n const p = getProps();\n if (!p.isDisabled && (e.currentTarget as Element).contains(e.target as Element)) {\n triggerHoverEnd(e.currentTarget as Element, e.pointerType as 'mouse' | 'pen');\n }\n },\n };\n }\n\n // Fallback for environments without PointerEvent (mainly tests)\n return {\n onMouseEnter: (e: MouseEvent) => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e.currentTarget as Element, 'mouse');\n }\n state.ignoreEmulatedMouseEvents = false;\n },\n onMouseLeave: (e: MouseEvent) => {\n const p = getProps();\n if (!p.isDisabled && (e.currentTarget as Element).contains(e.target as Element)) {\n triggerHoverEnd(e.currentTarget as Element, 'mouse');\n }\n },\n };\n });\n\n return {\n hoverProps: hoverProps() as JSX.HTMLAttributes<HTMLElement>,\n isHovered,\n };\n}\n","import { Accessor } from 'solid-js';\nimport { createPress } from '../interactions';\nimport { createFocusable } from '../interactions';\nimport { mergeProps, filterDOMProps } from '../utils';\nimport type { AriaButtonProps, ButtonAria } from './types';\n\nfunction isDisabledValue(isDisabled: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isDisabled === 'function') {\n return isDisabled();\n }\n return isDisabled ?? false;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a button component.\n * Handles press interactions across mouse, touch, keyboard and screen readers.\n *\n * Based on react-aria's useButton but adapted for SolidJS.\n *\n * @example\n * ```tsx\n * import { createButton } from 'solidaria';\n *\n * function Button(props) {\n * let ref;\n * const { buttonProps, isPressed } = createButton(props);\n *\n * return (\n * <button\n * {...buttonProps}\n * ref={ref}\n * class={isPressed() ? 'pressed' : ''}\n * >\n * {props.children}\n * </button>\n * );\n * }\n * ```\n */\nexport function createButton(props: AriaButtonProps = {}): ButtonAria {\n const elementType = props.elementType ?? 'button';\n\n const { pressProps, isPressed } = createPress({\n isDisabled: props.isDisabled,\n onPress: props.onPress,\n onPressStart: props.onPressStart,\n onPressEnd: props.onPressEnd,\n onPressUp: props.onPressUp,\n onPressChange: props.onPressChange,\n preventFocusOnPress: props.preventFocusOnPress,\n });\n\n const { focusableProps } = createFocusable({\n isDisabled: props.isDisabled,\n autoFocus: props.autoFocus,\n excludeFromTabOrder: props.excludeFromTabOrder,\n });\n\n const isNativeButton = elementType === 'button' || elementType === 'input';\n const isLink = elementType === 'a';\n const disabled = isDisabledValue(props.isDisabled);\n\n // Build base props based on element type\n let additionalProps: Record<string, unknown> = {};\n\n if (isNativeButton) {\n additionalProps = {\n type: props.type ?? 'button',\n disabled: disabled,\n // Form-related attributes\n ...(props.form && { form: props.form }),\n ...(props.formAction && { formAction: props.formAction }),\n ...(props.formEncType && { formEncType: props.formEncType }),\n ...(props.formMethod && { formMethod: props.formMethod }),\n ...(props.formNoValidate && { formNoValidate: props.formNoValidate }),\n ...(props.formTarget && { formTarget: props.formTarget }),\n ...(props.name && { name: props.name }),\n ...(props.value && { value: props.value }),\n };\n } else {\n // Non-native buttons need role and tabIndex\n additionalProps = {\n role: 'button',\n tabIndex: disabled ? undefined : 0,\n 'aria-disabled': disabled ? true : undefined,\n };\n\n if (isLink) {\n additionalProps.href = props.href;\n additionalProps.target = props.target;\n additionalProps.rel = props.rel;\n }\n }\n\n // ARIA attributes\n const ariaProps: Record<string, unknown> = {};\n\n if (props['aria-pressed'] !== undefined) {\n ariaProps['aria-pressed'] = props['aria-pressed'];\n }\n if (props['aria-haspopup'] !== undefined) {\n ariaProps['aria-haspopup'] = props['aria-haspopup'];\n }\n if (props['aria-expanded'] !== undefined) {\n ariaProps['aria-expanded'] = props['aria-expanded'];\n }\n if (props['aria-label']) {\n ariaProps['aria-label'] = props['aria-label'];\n }\n if (props['aria-labelledby']) {\n ariaProps['aria-labelledby'] = props['aria-labelledby'];\n }\n if (props['aria-describedby']) {\n ariaProps['aria-describedby'] = props['aria-describedby'];\n }\n if (props['aria-controls']) {\n ariaProps['aria-controls'] = props['aria-controls'];\n }\n if (props['aria-current'] !== undefined) {\n ariaProps['aria-current'] = props['aria-current'];\n }\n\n const buttonProps = mergeProps(\n filterDOMProps(props as Record<string, unknown>, { labelable: true }),\n additionalProps,\n ariaProps,\n focusableProps as Record<string, unknown>,\n pressProps as Record<string, unknown>\n );\n\n return {\n buttonProps,\n isPressed,\n };\n}\n","import { Accessor, createSignal } from 'solid-js';\nimport { createButton } from './createButton';\nimport { mergeProps } from '../utils';\nimport type { AriaButtonProps, ButtonAria } from './types';\nimport type { PressEvent } from '../interactions';\n\nexport interface AriaToggleButtonProps extends Omit<AriaButtonProps, 'aria-pressed'> {\n /** Whether the button is selected (controlled). */\n isSelected?: Accessor<boolean> | boolean;\n /** Handler called when the button's selection state changes. */\n onChange?: (isSelected: boolean) => void;\n /** The default selected state (uncontrolled). */\n defaultSelected?: boolean;\n}\n\nexport interface ToggleButtonAria extends ButtonAria {\n /** Whether the button is currently selected. */\n isSelected: Accessor<boolean>;\n}\n\nfunction getSelectedValue(isSelected: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isSelected === 'function') {\n return isSelected();\n }\n return isSelected ?? false;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a toggle button component.\n * Toggle buttons allow users to toggle a selection on or off.\n *\n * Based on react-aria's useToggleButton but adapted for SolidJS.\n *\n * @example\n * ```tsx\n * import { createToggleButton } from 'solidaria';\n *\n * function ToggleButton(props) {\n * const { buttonProps, isPressed, isSelected } = createToggleButton(props);\n *\n * return (\n * <button\n * {...buttonProps}\n * class={isSelected() ? 'selected' : ''}\n * style={{ opacity: isPressed() ? 0.8 : 1 }}\n * >\n * {props.children}\n * </button>\n * );\n * }\n * ```\n */\nexport function createToggleButton(props: AriaToggleButtonProps = {}): ToggleButtonAria {\n // Handle controlled vs uncontrolled state\n const isControlled = props.isSelected !== undefined;\n const [uncontrolledSelected, setUncontrolledSelected] = createSignal(\n props.defaultSelected ?? false\n );\n\n const isSelected = (): boolean => {\n if (isControlled) {\n return getSelectedValue(props.isSelected);\n }\n return uncontrolledSelected();\n };\n\n const toggleSelection = () => {\n const newValue = !isSelected();\n if (!isControlled) {\n setUncontrolledSelected(newValue);\n }\n props.onChange?.(newValue);\n };\n\n // Create the press handler that toggles selection\n const onPress = (e: PressEvent) => {\n toggleSelection();\n props.onPress?.(e);\n };\n\n // Get button props with our custom press handler\n const { buttonProps: baseButtonProps, isPressed } = createButton(\n mergeProps(props, {\n onPress,\n }) as AriaButtonProps\n );\n\n // Create buttonProps with a getter for aria-pressed so it stays reactive\n const buttonProps = {\n ...baseButtonProps,\n get 'aria-pressed'() {\n return isSelected();\n },\n };\n\n return {\n buttonProps,\n isPressed,\n isSelected,\n };\n}\n","import { createSignal, createUniqueId, untrack } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nfunction access(value) {\n return typeof value === \"function\" ? value() : value;\n}\nfunction isAccessor(value) {\n return typeof value === \"function\";\n}\nfunction createToggleState(props = {}) {\n const getProps = () => access(props);\n const initialProps = getProps();\n const initialSelected = initialProps.isSelected ?? initialProps.defaultSelected ?? false;\n const [internalSelected, setInternalSelected] = createSignal(initialSelected);\n const isControlled = () => getProps().isSelected !== void 0;\n const isSelected = () => {\n const p = getProps();\n return isControlled() ? p.isSelected ?? false : internalSelected();\n };\n function setSelected(value) {\n var _a;\n const p = getProps();\n if (p.isReadOnly) {\n return;\n }\n if (!isControlled()) {\n setInternalSelected(value);\n }\n (_a = p.onChange) == null ? void 0 : _a.call(p, value);\n }\n function toggle() {\n const p = getProps();\n if (p.isReadOnly) {\n return;\n }\n setSelected(!isSelected());\n }\n return {\n isSelected,\n defaultSelected: initialProps.defaultSelected ?? initialSelected,\n setSelected,\n toggle\n };\n}\nfunction createTextFieldState(props = {}) {\n const getProps = () => access(props);\n const initialProps = getProps();\n const initialValue = initialProps.value ?? initialProps.defaultValue ?? \"\";\n const [internalValue, setInternalValue] = createSignal(initialValue);\n const isControlled = () => getProps().value !== void 0;\n const value = () => {\n const p = getProps();\n return isControlled() ? p.value ?? \"\" : internalValue();\n };\n function setValue(newValue) {\n var _a;\n const p = getProps();\n if (!isControlled()) {\n setInternalValue(newValue);\n }\n (_a = p.onChange) == null ? void 0 : _a.call(p, newValue);\n }\n return {\n value,\n setValue\n };\n}\nfunction createCheckboxGroupState(props = {}) {\n const getProps = () => access(props);\n const initialProps = getProps();\n const initialValue = initialProps.value ?? initialProps.defaultValue ?? [];\n const [internalValue, setInternalValue] = createSignal(initialValue);\n const isControlled = () => getProps().value !== void 0;\n const value = () => {\n const p = getProps();\n return isControlled() ? p.value ?? [] : internalValue();\n };\n const isRequired = () => {\n const p = getProps();\n return !!p.isRequired && value().length === 0;\n };\n const isInvalid = () => {\n return getProps().isInvalid ?? false;\n };\n function setValue(newValue) {\n var _a;\n const p = getProps();\n if (p.isReadOnly || p.isDisabled) {\n return;\n }\n if (!isControlled()) {\n setInternalValue(newValue);\n }\n (_a = p.onChange) == null ? void 0 : _a.call(p, newValue);\n }\n function isSelected(checkValue) {\n return value().includes(checkValue);\n }\n function addValue(addVal) {\n const p = getProps();\n if (p.isReadOnly || p.isDisabled) {\n return;\n }\n const current = value();\n if (!current.includes(addVal)) {\n setValue([...current, addVal]);\n }\n }\n function removeValue(removeVal) {\n const p = getProps();\n if (p.isReadOnly || p.isDisabled) {\n return;\n }\n const current = value();\n if (current.includes(removeVal)) {\n setValue(current.filter((v) => v !== removeVal));\n }\n }\n function toggleValue(toggleVal) {\n const p = getProps();\n if (p.isReadOnly || p.isDisabled) {\n return;\n }\n const current = value();\n if (current.includes(toggleVal)) {\n setValue(current.filter((v) => v !== toggleVal));\n } else {\n setValue([...current, toggleVal]);\n }\n }\n return {\n value,\n defaultValue: initialProps.defaultValue ?? initialValue,\n get isDisabled() {\n return getProps().isDisabled ?? false;\n },\n get isReadOnly() {\n return getProps().isReadOnly ?? false;\n },\n get isInvalid() {\n return isInvalid();\n },\n isRequired,\n isSelected,\n setValue,\n addValue,\n removeValue,\n toggleValue\n };\n}\nfunction createIsSSR() {\n return isServer;\n}\nfunction createId(defaultId) {\n if (defaultId) {\n return defaultId;\n }\n return `solid-stately-${createUniqueId()}`;\n}\nconst canUseDOM = !isServer;\nconst radioGroupSyncVersion = /* @__PURE__ */ new WeakMap();\nfunction createRadioGroupState(props = {}) {\n const getProps = () => access(props);\n const initialProps = untrack(() => getProps());\n const name = initialProps.name || `radio-group-${createId()}`;\n const [internalValue, setInternalValue] = createSignal(\n initialProps.defaultValue ?? null\n );\n const [lastFocusedValue, setLastFocusedValueInternal] = createSignal(null);\n const [syncVersion, setSyncVersion] = createSignal(0);\n const isControlled = () => getProps().value !== void 0;\n const selectedValue = () => {\n const p = getProps();\n if (p.value !== void 0) {\n return p.value ?? null;\n }\n return internalValue();\n };\n const isInvalid = () => {\n return getProps().isInvalid ?? false;\n };\n function setSelectedValue(value) {\n var _a;\n const p = getProps();\n if (p.isReadOnly || p.isDisabled) {\n return;\n }\n setSyncVersion((v) => v + 1);\n if (!isControlled()) {\n setInternalValue(value);\n }\n if (value != null) {\n (_a = p.onChange) == null ? void 0 : _a.call(p, value);\n }\n }\n function setLastFocusedValue(value) {\n setLastFocusedValueInternal(value);\n }\n const state = {\n name,\n selectedValue,\n defaultSelectedValue: initialProps.defaultValue ?? null,\n setSelectedValue,\n lastFocusedValue,\n setLastFocusedValue,\n get isDisabled() {\n return getProps().isDisabled ?? false;\n },\n get isReadOnly() {\n return getProps().isReadOnly ?? false;\n },\n get isRequired() {\n return getProps().isRequired ?? false;\n },\n get isInvalid() {\n return isInvalid();\n }\n };\n radioGroupSyncVersion.set(state, syncVersion);\n return state;\n}\nexport {\n access,\n canUseDOM,\n createCheckboxGroupState,\n createId,\n createIsSSR,\n createRadioGroupState,\n createTextFieldState,\n createToggleState,\n isAccessor,\n radioGroupSyncVersion\n};\n//# sourceMappingURL=index.js.map\n","/**\n * Toggle hook for Solidaria\n *\n * Handles interactions for toggle elements, e.g. Checkboxes and Switches.\n *\n * This is a 1:1 port of @react-aria/toggle's useToggle hook.\n */\n\nimport { JSX, Accessor, createEffect } from 'solid-js';\nimport { createPress } from '../interactions/createPress';\nimport { createFocusable } from '../interactions/createFocusable';\nimport { mergeProps } from '../utils/mergeProps';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\nimport { type ToggleState } from '@proyecto-viviana/solid-stately';\nimport { type PressEvent } from '../interactions/PressEvent';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaToggleProps {\n /** Whether the element should be selected (controlled). */\n isSelected?: boolean;\n /** Whether the element should be selected by default (uncontrolled). */\n defaultSelected?: boolean;\n /** Handler that is called when the element's selection state changes. */\n onChange?: (isSelected: boolean) => void;\n /** The value of the input element, used when submitting an HTML form. */\n value?: string;\n /** The name of the input element, used when submitting an HTML form. */\n name?: string;\n /** The form to associate the input with. */\n form?: string;\n /** Whether the element is disabled. */\n isDisabled?: boolean;\n /** Whether the element is read only. */\n isReadOnly?: boolean;\n /** Whether the element is required. */\n isRequired?: boolean;\n /** Whether the element is invalid. */\n isInvalid?: boolean;\n /** The element's children. */\n children?: JSX.Element;\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Identifies the element (or elements) that provide an error message for the object. */\n 'aria-errormessage'?: string;\n /** Identifies the element (or elements) whose contents or presence are controlled by the current element. */\n 'aria-controls'?: string;\n /** The element's unique identifier. */\n id?: string;\n /** Handler that is called when the press is released over the target. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction starts. */\n onPressStart?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. */\n onPressEnd?: (e: PressEvent) => void;\n /** Handler that is called when the press state changes. */\n onPressChange?: (isPressed: boolean) => void;\n /** Handler that is called when a press is released over the target, regardless of whether it started on the target or not. */\n onPressUp?: (e: PressEvent) => void;\n /** Handler that is called when the element is clicked. */\n onClick?: (e: MouseEvent) => void;\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n /** Whether to exclude the element from the tab order. */\n excludeFromTabOrder?: boolean;\n /** Whether to autofocus the element. */\n autoFocus?: boolean;\n}\n\nexport interface ToggleAria {\n /** Props to be spread on the label element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n /** Props to be spread on the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Whether the toggle is selected. */\n isSelected: Accessor<boolean>;\n /** Whether the toggle is in a pressed state. */\n isPressed: Accessor<boolean>;\n /** Whether the toggle is disabled. */\n isDisabled: boolean;\n /** Whether the toggle is read only. */\n isReadOnly: boolean;\n /** Whether the toggle is invalid. */\n isInvalid: boolean;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Handles interactions for toggle elements, e.g. Checkboxes and Switches.\n */\nexport function createToggle(\n props: MaybeAccessor<AriaToggleProps>,\n state: ToggleState,\n ref: () => HTMLInputElement | null\n): ToggleAria {\n const getProps = () => access(props);\n\n const isDisabled = () => getProps().isDisabled ?? false;\n const isReadOnly = () => getProps().isReadOnly ?? false;\n const isInvalid = () => {\n return getProps().isInvalid ?? false;\n };\n\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n const { pressProps, isPressed } = createPress({\n get onPressStart() { return getProps().onPressStart; },\n get onPressEnd() { return getProps().onPressEnd; },\n get onPressChange() { return getProps().onPressChange; },\n get onPress() { return getProps().onPress; },\n get onPressUp() { return getProps().onPressUp; },\n get isDisabled() { return isDisabled(); },\n });\n\n // Handle press state on the label.\n const { pressProps: labelPressProps, isPressed: isLabelPressed } = createPress({\n get onPressStart() { return getProps().onPressStart; },\n get onPressEnd() { return getProps().onPressEnd; },\n get onPressChange() { return getProps().onPressChange; },\n get onPressUp() { return getProps().onPressUp; },\n onPress(e: PressEvent) {\n getProps().onPress?.(e);\n state.toggle();\n ref()?.focus();\n },\n get isDisabled() { return isDisabled() || isReadOnly(); },\n });\n\n // Handle focusable - extract the relevant props for createFocusable\n const { focusableProps } = createFocusable({\n get isDisabled() { return isDisabled(); },\n get autoFocus() { return getProps().autoFocus; },\n get onFocus() { return getProps().onFocus; },\n get onBlur() { return getProps().onBlur; },\n get onFocusChange() { return getProps().onFocusChange; },\n get onKeyDown() { return getProps().onKeyDown; },\n get onKeyUp() { return getProps().onKeyUp; },\n get excludeFromTabOrder() { return getProps().excludeFromTabOrder; },\n }, ref as unknown as (el: HTMLElement) => void);\n\n // Combine press and focusable props for input\n const interactions = mergeProps(pressProps, focusableProps);\n\n // Filter DOM props\n const domProps = () => filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n // Handle input change\n const onChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n // Since we spread props on label, onChange will end up there as well as in here.\n // So we have to stop propagation at the lowest level that we care about\n e.stopPropagation();\n\n // Don't update state if readonly\n if (isReadOnly()) {\n // Reset the checkbox to its previous state since the browser already toggled it\n e.currentTarget.checked = state.isSelected();\n return;\n }\n\n state.setSelected(e.currentTarget.checked);\n };\n\n // Warn if no accessible label\n createEffect(() => {\n const p = getProps();\n const hasChildren = p.children != null;\n const hasAriaLabel = p['aria-label'] != null || p['aria-labelledby'] != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') {\n console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n }\n });\n\n // Combined pressed state\n const combinedIsPressed: Accessor<boolean> = () => isPressed() || isLabelPressed();\n\n return {\n labelProps: mergeProps(labelPressProps, {\n onClick: (e: MouseEvent) => e.preventDefault(),\n }),\n get inputProps() {\n const p = getProps();\n return mergeProps(domProps(), {\n 'aria-invalid': isInvalid() || undefined,\n 'aria-errormessage': p['aria-errormessage'],\n 'aria-controls': p['aria-controls'],\n 'aria-readonly': isReadOnly() || undefined,\n onChange,\n disabled: isDisabled(),\n ...(p.value == null ? {} : { value: p.value }),\n name: p.name,\n form: p.form,\n type: 'checkbox' as const,\n ...interactions,\n // Stop click propagation to prevent labelProps.onClick from calling preventDefault\n // which would prevent the checkbox from toggling in JSDOM/testing-library environments\n onClick: (e: MouseEvent) => e.stopPropagation(),\n }) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n isSelected: state.isSelected,\n isPressed: combinedIsPressed,\n isDisabled: isDisabled(),\n isReadOnly: isReadOnly(),\n isInvalid: isInvalid(),\n };\n}\n","/**\n * Checkbox hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n *\n * This is a 1:1 port of @react-aria/checkbox's useCheckbox hook.\n */\n\nimport { JSX, Accessor, createEffect } from 'solid-js';\nimport { createToggle, type AriaToggleProps } from '../toggle';\nimport { type ToggleState } from '@proyecto-viviana/solid-stately';\nimport { createPress } from '../interactions/createPress';\nimport { mergeProps } from '../utils/mergeProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaCheckboxProps extends AriaToggleProps {\n /**\n * Indeterminism is presentational only.\n * The indeterminate visual representation remains regardless of user interaction.\n */\n isIndeterminate?: boolean;\n /**\n * Whether the checkbox is required.\n */\n isRequired?: boolean;\n /**\n * The validation behavior for the checkbox.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n}\n\nexport interface CheckboxAria {\n /** Props for the label wrapper element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Whether the checkbox is selected. */\n isSelected: Accessor<boolean>;\n /** Whether the checkbox is in a pressed state. */\n isPressed: Accessor<boolean>;\n /** Whether the checkbox is disabled. */\n isDisabled: boolean;\n /** Whether the checkbox is read only. */\n isReadOnly: boolean;\n /** Whether the checkbox is invalid. */\n isInvalid: boolean;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component.\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n *\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox, as returned by `createToggleState`.\n * @param inputRef - A ref accessor for the HTML input element.\n */\nexport function createCheckbox(\n props: MaybeAccessor<AriaCheckboxProps>,\n state: ToggleState,\n inputRef: () => HTMLInputElement | null\n): CheckboxAria {\n const getProps = () => access(props);\n\n // Get toggle aria props\n const toggleResult = createToggle(props, state, inputRef);\n const {\n labelProps: baseLabelProps,\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly,\n isInvalid,\n } = toggleResult;\n\n // Handle indeterminate state\n createEffect(() => {\n const input = inputRef();\n const isIndeterminate = getProps().isIndeterminate;\n if (input) {\n // indeterminate is a property, but it can only be set via javascript\n // https://css-tricks.com/indeterminate-checkboxes/\n input.indeterminate = !!isIndeterminate;\n }\n });\n\n // Reset validation state on label press for checkbox with a hidden input.\n const { pressProps } = createPress({\n get isDisabled() {\n return isDisabled || isReadOnly;\n },\n onPress() {\n // Validation state reset would be handled here if we had form validation\n // For now, this is a no-op placeholder matching React-Aria's pattern\n },\n });\n\n return {\n labelProps: mergeProps(\n baseLabelProps as unknown as Record<string, unknown>,\n pressProps as unknown as Record<string, unknown>,\n {\n // Prevent label from being focused when mouse down on it.\n // Note, this does not prevent the input from being focused in the `click` event.\n onMouseDown: (e: MouseEvent) => e.preventDefault(),\n } as Record<string, unknown>\n ) as JSX.LabelHTMLAttributes<HTMLLabelElement>,\n get inputProps() {\n const p = getProps();\n const { isRequired, validationBehavior = 'aria' } = p;\n\n return mergeProps(toggleResult.inputProps, {\n checked: isSelected(),\n 'aria-required': (isRequired && validationBehavior === 'aria') || undefined,\n required: isRequired && validationBehavior === 'native',\n }) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n isSelected,\n isPressed,\n isDisabled,\n isReadOnly,\n isInvalid,\n };\n}\n","/**\n * SSR utilities for Solidaria\n *\n * SolidJS has built-in SSR support with `isServer` and `createUniqueId()`.\n * These utilities provide a consistent API matching React-Aria's patterns.\n */\n\nimport { createUniqueId } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n/**\n * Returns whether the component is currently being server side rendered.\n * Can be used to delay browser-specific rendering until after hydration.\n */\nexport function createIsSSR(): boolean {\n return isServer;\n}\n\n/**\n * Generate a unique ID that is stable across server and client.\n * Uses SolidJS's built-in createUniqueId which handles SSR correctly.\n *\n * @param defaultId - Optional default ID to use instead of generating one.\n */\nexport function createId(defaultId?: string): string {\n if (defaultId) {\n return defaultId;\n }\n return `solidaria-${createUniqueId()}`;\n}\n\n/**\n * Check if we can use DOM APIs.\n * This is useful for code that needs to run only in the browser.\n */\nexport const canUseDOM = !isServer;\n","/**\n * Labels utility for Solidaria\n *\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n *\n * This is a 1:1 port of @react-aria/utils's useLabels hook.\n */\n\nimport { createId } from '../ssr';\nimport type { AriaLabelingProps, DOMProps } from './createLabel';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n *\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function createLabels(\n props: DOMProps & AriaLabelingProps,\n defaultLabel?: string\n): DOMProps & AriaLabelingProps {\n let {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n } = props;\n\n // Generate an ID if not provided\n id = createId(id);\n\n // If there is both an aria-label and aria-labelledby,\n // combine them by pointing to the element itself.\n if (labelledBy && label) {\n const ids = new Set([id, ...labelledBy.trim().split(/\\s+/)]);\n labelledBy = [...ids].join(' ');\n } else if (labelledBy) {\n labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n }\n\n // If no labels are provided, use the default\n if (!label && !labelledBy && defaultLabel) {\n label = defaultLabel;\n }\n\n return {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy,\n };\n}\n","/**\n * Label hook for Solidaria\n *\n * Provides the accessibility implementation for labels and their associated elements.\n * Labels provide context for user inputs.\n *\n * This is a 1:1 port of @react-aria/label's useLabel hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createId } from '../ssr';\nimport { createLabels } from './createLabels';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaLabelingProps {\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Identifies the element (or elements) that provide a detailed, extended description for the object. */\n 'aria-details'?: string;\n}\n\nexport interface LabelableProps {\n /** The content to display as the label. */\n label?: JSX.Element;\n}\n\nexport interface DOMProps {\n /** The element's unique identifier. */\n id?: string;\n}\n\nexport interface LabelAriaProps extends LabelableProps, DOMProps, AriaLabelingProps {\n /**\n * The HTML element used to render the label, e.g. 'label', or 'span'.\n * @default 'label'\n */\n labelElementType?: 'label' | 'span' | 'div';\n}\n\nexport interface LabelAria {\n /** Props to apply to the label container element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement> | JSX.HTMLAttributes<HTMLSpanElement>;\n /** Props to apply to the field container element being labeled. */\n fieldProps: AriaLabelingProps & DOMProps;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the accessibility implementation for labels and their associated elements.\n * Labels provide context for user inputs.\n *\n * @param props - The props for labels and fields.\n */\nexport function createLabel(props: MaybeAccessor<LabelAriaProps>): LabelAria {\n const getProps = () => access(props);\n\n const id = createId(getProps().id);\n const labelId = createId();\n\n const getLabelProps = (): LabelAria['labelProps'] => {\n const { label, labelElementType = 'label' } = getProps();\n\n if (!label) {\n return {};\n }\n\n return {\n id: labelId,\n ...(labelElementType === 'label' ? { for: id } : {}),\n };\n };\n\n const getFieldProps = (): LabelAria['fieldProps'] => {\n const {\n label,\n 'aria-labelledby': ariaLabelledby,\n 'aria-label': ariaLabel,\n } = getProps();\n\n let labelledBy = ariaLabelledby;\n\n if (label) {\n labelledBy = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;\n } else if (!ariaLabelledby && !ariaLabel && process.env.NODE_ENV !== 'production') {\n console.warn(\n 'If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility'\n );\n }\n\n return createLabels({\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': labelledBy,\n });\n };\n\n return {\n get labelProps() {\n return getLabelProps();\n },\n get fieldProps() {\n return getFieldProps();\n },\n };\n}\n","/**\n * Field hook for Solidaria\n *\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * This is a 1:1 port of @react-aria/label's useField hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createId } from '../ssr';\nimport { createLabel, type LabelAriaProps, type LabelAria, type AriaLabelingProps, type DOMProps } from './createLabel';\nimport { mergeProps } from '../utils/mergeProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface HelpTextProps {\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: JSX.Element;\n /** An error message for the field. */\n errorMessage?: JSX.Element | ((validation: ValidationResult) => JSX.Element);\n}\n\nexport interface ValidationResult {\n /** Whether the input value is invalid. */\n isInvalid: boolean;\n /** The current error messages for the input if it is invalid, otherwise an empty array. */\n validationErrors: string[];\n /** The native validity state for the input. */\n validationDetails: ValidityState;\n}\n\nexport interface Validation<T> {\n /** Whether the input value is invalid. */\n isInvalid?: boolean;\n /** Whether the input is required before form submission. */\n isRequired?: boolean;\n /** A function that returns an error message if a given value is invalid. */\n validate?: (value: T) => string | string[] | true | null | undefined;\n}\n\nexport interface AriaFieldProps extends LabelAriaProps, HelpTextProps, Omit<Validation<any>, 'isRequired'> {}\n\nexport interface FieldAria extends LabelAria {\n /** Props for the description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * @param props - Props for the Field.\n */\nexport function createField(props: MaybeAccessor<AriaFieldProps>): FieldAria {\n const getProps = () => access(props);\n\n const { labelProps, fieldProps: baseLabelFieldProps } = createLabel(props);\n\n // Generate IDs for description and error message\n const descriptionId = createId();\n const errorMessageId = createId();\n\n const getDescriptionProps = (): FieldAria['descriptionProps'] => {\n const { description, errorMessage, isInvalid } = getProps();\n\n // Only include ID if description exists or there's an error message that might be shown\n if (!description && !errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: descriptionId,\n };\n };\n\n const getErrorMessageProps = (): FieldAria['errorMessageProps'] => {\n const { errorMessage, isInvalid } = getProps();\n\n // Only include ID if there's an error message and the field is invalid\n if (!errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: errorMessageId,\n };\n };\n\n const getFieldProps = (): AriaLabelingProps & DOMProps => {\n const { description, errorMessage, isInvalid } = getProps();\n\n const describedByIds: string[] = [];\n\n // Add description ID if description exists\n if (description) {\n describedByIds.push(descriptionId);\n }\n\n // Add error message ID if field is invalid and error message exists\n // Use aria-describedby for error message because aria-errormessage is unsupported\n // using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268\n if (isInvalid && errorMessage) {\n describedByIds.push(errorMessageId);\n }\n\n // Add any existing aria-describedby from props\n const existingDescribedBy = getProps()['aria-describedby'];\n if (existingDescribedBy) {\n describedByIds.push(existingDescribedBy);\n }\n\n const ariaDescribedBy = describedByIds.length > 0 ? describedByIds.join(' ') : undefined;\n\n return mergeProps(baseLabelFieldProps, {\n 'aria-describedby': ariaDescribedBy,\n }) as AriaLabelingProps & DOMProps;\n };\n\n return {\n get labelProps() {\n return labelProps;\n },\n get fieldProps() {\n return getFieldProps();\n },\n get descriptionProps() {\n return getDescriptionProps();\n },\n get errorMessageProps() {\n return getErrorMessageProps();\n },\n };\n}\n","/**\n * Checkbox group hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n *\n * This is a 1:1 port of @react-aria/checkbox's useCheckboxGroup hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createField } from '../label';\nimport { createFocusWithin } from '../interactions/createFocusWithin';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { mergeProps } from '../utils/mergeProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\nimport { type CheckboxGroupState, type CheckboxGroupProps } from '@proyecto-viviana/solid-stately';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaCheckboxGroupProps extends CheckboxGroupProps {\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Identifies the element (or elements) that provide a detailed, extended description for the object. */\n 'aria-details'?: string;\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: JSX.Element;\n /** An error message for the field. */\n errorMessage?: JSX.Element;\n}\n\nexport interface CheckboxGroupAria {\n /** Props for the checkbox group wrapper element. */\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the checkbox group's visible label (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the checkbox group description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the checkbox group error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the checkbox group is invalid. */\n isInvalid: boolean;\n}\n\n// WeakMap to share data between checkbox group and checkbox group items\nexport const checkboxGroupData = new WeakMap<\n CheckboxGroupState,\n {\n name?: string;\n form?: string;\n descriptionId?: string;\n errorMessageId?: string;\n validationBehavior: 'aria' | 'native';\n }\n>();\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox group component.\n * Checkbox groups allow users to select multiple items from a list of options.\n *\n * @param props - Props for the checkbox group.\n * @param state - State for the checkbox group, as returned by `createCheckboxGroupState`.\n */\nexport function createCheckboxGroup(\n props: MaybeAccessor<AriaCheckboxGroupProps>,\n state: CheckboxGroupState\n): CheckboxGroupAria {\n const getProps = () => access(props);\n\n const isInvalid = () => state.isInvalid;\n\n // Use field for label association\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } = createField({\n get label() { return getProps().label; },\n get 'aria-label'() { return getProps()['aria-label']; },\n get 'aria-labelledby'() { return getProps()['aria-labelledby']; },\n get 'aria-describedby'() { return getProps()['aria-describedby']; },\n get 'aria-details'() { return getProps()['aria-details']; },\n get description() { return getProps().description; },\n get errorMessage() { return getProps().errorMessage ?? (isInvalid() ? 'Invalid selection' : undefined); },\n get isInvalid() { return isInvalid(); },\n // Checkbox group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n });\n\n // Store data for checkbox group items\n checkboxGroupData.set(state, {\n name: getProps().name,\n form: getProps().form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: 'aria',\n });\n\n // Filter DOM props\n const domProps = () => filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n // Handle focus within\n const { focusWithinProps } = createFocusWithin({\n get onBlurWithin() { return getProps().onBlur; },\n get onFocusWithin() { return getProps().onFocus; },\n get onFocusWithinChange() { return getProps().onFocusChange; },\n });\n\n return {\n get groupProps() {\n return mergeProps(domProps(), {\n role: 'group',\n 'aria-disabled': state.isDisabled || undefined,\n ...fieldProps,\n ...focusWithinProps,\n }) as JSX.HTMLAttributes<HTMLElement>;\n },\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get descriptionProps() {\n return descriptionProps;\n },\n get errorMessageProps() {\n return errorMessageProps;\n },\n get isInvalid() {\n return isInvalid();\n },\n };\n}\n","/**\n * Checkbox group item hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a checkbox component\n * contained within a checkbox group.\n *\n * This is a 1:1 port of @react-aria/checkbox's useCheckboxGroupItem hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createCheckbox, type AriaCheckboxProps, type CheckboxAria } from './createCheckbox';\nimport { type ToggleState, type CheckboxGroupState } from '@proyecto-viviana/solid-stately';\nimport { checkboxGroupData } from './createCheckboxGroup';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaCheckboxGroupItemProps extends Omit<AriaCheckboxProps, 'isSelected' | 'defaultSelected'> {\n /** The value of the checkbox. */\n value: string;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a checkbox component\n * contained within a checkbox group.\n *\n * @param props - Props for the checkbox.\n * @param state - State for the checkbox group, as returned by `createCheckboxGroupState`.\n * @param inputRef - A ref accessor for the HTML input element.\n */\nexport function createCheckboxGroupItem(\n props: MaybeAccessor<AriaCheckboxGroupItemProps>,\n state: CheckboxGroupState,\n inputRef: () => HTMLInputElement | null\n): CheckboxAria {\n const getProps = () => access(props);\n\n // Create toggle state that syncs with the group state\n const toggleState: ToggleState = {\n isSelected: () => state.isSelected(getProps().value),\n defaultSelected: state.defaultValue.includes(getProps().value),\n setSelected(isSelected: boolean) {\n const value = getProps().value;\n if (isSelected) {\n state.addValue(value);\n } else {\n state.removeValue(value);\n }\n getProps().onChange?.(isSelected);\n },\n toggle() {\n state.toggleValue(getProps().value);\n },\n };\n\n // Get group data\n const getGroupData = () => checkboxGroupData.get(state);\n\n // Build checkbox props\n const checkboxProps = (): AriaCheckboxProps => {\n const p = getProps();\n const groupData = getGroupData();\n\n return {\n ...p,\n isReadOnly: p.isReadOnly ?? state.isReadOnly,\n isDisabled: p.isDisabled ?? state.isDisabled,\n name: p.name ?? groupData?.name,\n form: p.form ?? groupData?.form,\n isRequired: p.isRequired ?? state.isRequired(),\n validationBehavior: p.validationBehavior ?? groupData?.validationBehavior ?? 'aria',\n };\n };\n\n // Use the checkbox hook\n const result = createCheckbox(checkboxProps, toggleState, inputRef);\n\n // Add group-level aria-describedby\n return {\n ...result,\n get inputProps() {\n const baseInputProps = result.inputProps;\n const groupData = getGroupData();\n\n const describedByIds: string[] = [];\n\n // Add props aria-describedby\n const propsDescribedBy = getProps()['aria-describedby'];\n if (propsDescribedBy) {\n describedByIds.push(propsDescribedBy);\n }\n\n // Add error message ID if group is invalid\n if (state.isInvalid && groupData?.errorMessageId) {\n describedByIds.push(groupData.errorMessageId);\n }\n\n // Add description ID\n if (groupData?.descriptionId) {\n describedByIds.push(groupData.descriptionId);\n }\n\n const ariaDescribedBy = describedByIds.length > 0 ? describedByIds.join(' ') : undefined;\n\n return {\n ...baseInputProps,\n 'aria-describedby': ariaDescribedBy,\n } as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n };\n}\n","/**\n * Radio group hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a radio group component.\n * Radio groups allow users to select a single item from a list of mutually exclusive options.\n *\n * This is a 1:1 port of @react-aria/radio's useRadioGroup hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createField } from '../label/createField';\nimport { createFocusWithin } from '../interactions/createFocusWithin';\nimport { mergeProps } from '../utils/mergeProps';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { createId } from '../ssr';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\nimport { type RadioGroupState } from '@proyecto-viviana/solid-stately';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaRadioGroupProps {\n /** The content to display as the label. */\n label?: JSX.Element;\n /** A description for the radio group. Provides additional context. */\n description?: JSX.Element;\n /** An error message for the radio group. */\n errorMessage?: JSX.Element | ((validation: { isInvalid: boolean; validationErrors: string[] }) => JSX.Element);\n /** Whether the radio group is disabled. */\n isDisabled?: boolean;\n /** Whether the radio group is read only. */\n isReadOnly?: boolean;\n /** Whether the radio group is required. */\n isRequired?: boolean;\n /** Whether the radio group is invalid. */\n isInvalid?: boolean;\n /** The axis the Radio Button(s) should align with. Defaults to 'vertical'. */\n orientation?: 'horizontal' | 'vertical';\n /** The name of the radio group, used when submitting an HTML form. */\n name?: string;\n /** The form to associate the radio group with. */\n form?: string;\n /** Validation behavior for the radio group. */\n validationBehavior?: 'aria' | 'native';\n /** Handler that is called when the radio group receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the radio group loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the radio group's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Identifies the element (or elements) that provide an error message for the object. */\n 'aria-errormessage'?: string;\n /** The element's unique identifier. */\n id?: string;\n}\n\nexport interface RadioGroupAria {\n /** Props for the radio group wrapper element. */\n radioGroupProps: JSX.HTMLAttributes<HTMLDivElement>;\n /** Props for the radio group's visible label (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the radio group description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the radio group error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the radio group is invalid. */\n isInvalid: boolean;\n /** Validation errors, if any. */\n validationErrors: string[];\n /** Validation details, if any. */\n validationDetails: Record<string, boolean>;\n}\n\n// WeakMap to share data between radio group and radio items\ninterface RadioGroupData {\n name: string;\n form: string | undefined;\n descriptionId: string | undefined;\n errorMessageId: string | undefined;\n validationBehavior: 'aria' | 'native';\n}\n\nexport const radioGroupData: WeakMap<RadioGroupState, RadioGroupData> = new WeakMap();\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a radio group component.\n * Radio groups allow users to select a single item from a list of mutually exclusive options.\n */\nexport function createRadioGroup(\n props: MaybeAccessor<AriaRadioGroupProps>,\n state: RadioGroupState\n): RadioGroupAria {\n const getProps = () => access(props);\n\n const orientation = () => getProps().orientation ?? 'vertical';\n const isReadOnly = () => getProps().isReadOnly ?? false;\n const isRequired = () => getProps().isRequired ?? false;\n const isDisabled = () => getProps().isDisabled ?? false;\n const validationBehavior = () => getProps().validationBehavior ?? 'aria';\n\n // Use field for label, description, error message\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } = createField({\n get label() { return getProps().label; },\n get description() { return getProps().description; },\n get errorMessage() { return getProps().errorMessage; },\n get isInvalid() { return state.isInvalid; },\n // Radio group is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n });\n\n // Handle focus within - reset focusable radio when group loses focus and no selection\n const { focusWithinProps } = createFocusWithin({\n onBlurWithin(e: FocusEvent) {\n getProps().onBlur?.(e);\n if (!state.selectedValue()) {\n state.setLastFocusedValue(null);\n }\n },\n onFocusWithin: (e: FocusEvent) => getProps().onFocus?.(e),\n onFocusWithinChange: (isFocused: boolean) => getProps().onFocusChange?.(isFocused),\n });\n\n // Filter DOM props\n const domProps = () => filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n // Generate group name\n const groupName = getProps().name ?? createId();\n\n // Store data for radio items to access\n radioGroupData.set(state, {\n name: groupName,\n form: getProps().form,\n descriptionId: descriptionProps.id,\n errorMessageId: errorMessageProps.id,\n validationBehavior: validationBehavior(),\n });\n\n // Keyboard navigation handler for arrow keys\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const onKeyDown = (_e: KeyboardEvent) => {\n // For now, we rely on native radio behavior\n // The complex tree walker implementation can be added later if needed\n // Most browsers handle arrow key navigation natively for radio groups\n };\n\n return {\n get radioGroupProps() {\n return mergeProps(\n domProps(),\n focusWithinProps as unknown as Record<string, unknown>,\n {\n role: 'radiogroup',\n onKeyDown,\n 'aria-invalid': state.isInvalid || undefined,\n 'aria-errormessage': getProps()['aria-errormessage'],\n 'aria-readonly': isReadOnly() || undefined,\n 'aria-required': isRequired() || undefined,\n 'aria-disabled': isDisabled() || undefined,\n 'aria-orientation': orientation(),\n ...fieldProps,\n }\n ) as JSX.HTMLAttributes<HTMLDivElement>;\n },\n labelProps: labelProps as JSX.HTMLAttributes<HTMLElement>,\n descriptionProps,\n errorMessageProps,\n get isInvalid() {\n return state.isInvalid;\n },\n get validationErrors() {\n return []; // Simplified - full validation can be added later\n },\n get validationDetails() {\n return {}; // Simplified - full validation can be added later\n },\n };\n}\n","/**\n * Radio hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for an individual\n * radio button in a radio group.\n *\n * This is a 1:1 port of @react-aria/radio's useRadio hook.\n */\n\nimport { JSX, Accessor, createEffect } from 'solid-js';\nimport { createPress } from '../interactions/createPress';\nimport { createFocusable } from '../interactions/createFocusable';\nimport { mergeProps } from '../utils/mergeProps';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\nimport { type RadioGroupState, radioGroupSyncVersion } from '@proyecto-viviana/solid-stately';\nimport { radioGroupData } from './createRadioGroup';\nimport { type PressEvent } from '../interactions/PressEvent';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaRadioProps {\n /** The value of the radio button, used when submitting an HTML form. */\n value: string;\n /** Whether the radio button is disabled. */\n isDisabled?: boolean;\n /** The label for the radio button. */\n children?: JSX.Element;\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Handler that is called when the press is released over the target. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction starts. */\n onPressStart?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. */\n onPressEnd?: (e: PressEvent) => void;\n /** Handler that is called when the press state changes. */\n onPressChange?: (isPressed: boolean) => void;\n /** Handler that is called when a press is released over the target, regardless of whether it started on the target or not. */\n onPressUp?: (e: PressEvent) => void;\n /** Handler that is called when the element is clicked. */\n onClick?: (e: MouseEvent) => void;\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n /** Whether to autofocus the element. */\n autoFocus?: boolean;\n}\n\nexport interface RadioAria {\n /** Props for the label wrapper element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Whether the radio is disabled. */\n isDisabled: boolean;\n /** Whether the radio is currently selected. */\n isSelected: Accessor<boolean>;\n /** Whether the radio is in a pressed state. */\n isPressed: Accessor<boolean>;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for an individual\n * radio button in a radio group.\n */\nexport function createRadio(\n props: MaybeAccessor<AriaRadioProps>,\n state: RadioGroupState,\n ref: () => HTMLInputElement | null\n): RadioAria {\n const getProps = () => access(props);\n\n const isDisabled = () => getProps().isDisabled || state.isDisabled;\n const value = () => getProps().value;\n const isSelected: Accessor<boolean> = () => {\n const selected = state.selectedValue();\n const v = value();\n return selected === v;\n };\n\n // Warn if no accessible label\n createEffect(() => {\n const p = getProps();\n const hasChildren = p.children != null;\n const hasAriaLabel = p['aria-label'] != null || p['aria-labelledby'] != null;\n if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') {\n console.warn('If you do not provide children, you must specify an aria-label for accessibility');\n }\n });\n\n // SolidJS-specific: Sync DOM checked state whenever selection changes\n // This handles:\n // 1. Initial render with controlled value\n // 2. Controlled mode where parent doesn't update value after click\n // 3. Native radio group behavior (clicking one unchecks others)\n //\n // Unlike React's VDOM reconciliation that re-applies all props on every render,\n // SolidJS only updates when signals change. Native radio behavior can change\n // the DOM checked state without our knowledge, so we need to actively sync.\n //\n // We track `syncVersion` to ensure this effect runs on EVERY selection attempt,\n // even in controlled mode where isSelected() may not change.\n createEffect(() => {\n const inputEl = ref();\n if (!inputEl) return;\n\n // Track syncVersion to trigger on any selection attempt\n // This is crucial for controlled mode where isSelected() may not change\n // syncVersion is stored in an internal WeakMap to maintain API parity with React-Aria\n const syncVersion = radioGroupSyncVersion.get(state);\n syncVersion?.();\n\n // Read the reactive state to establish tracking and get current value\n const shouldBeChecked = isSelected();\n\n // Sync the DOM checked state immediately\n if (inputEl.checked !== shouldBeChecked) {\n inputEl.checked = shouldBeChecked;\n }\n });\n\n // Handle input change\n // SolidJS-specific: Unlike React, the input's `checked` state can get out of sync\n // with our reactive state. This happens because:\n // 1. A readonly `<input type=\"radio\" />` is always \"checkable\" in the browser\n // 2. Even controlled inputs (`<input checked={isChecked} />`) will change their\n // internal `checked` state when clicked, regardless of what the signal says\n //\n // To prevent this, we force the input's `checked` DOM property to match our state\n // after processing the change. This is the pattern used by Kobalte and other\n // SolidJS component libraries.\n const onChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n e.stopPropagation();\n\n const target = e.target as HTMLInputElement;\n\n // Guard against disabled state - JSDOM's fireEvent may bypass disabled check\n if (isDisabled()) {\n target.checked = isSelected();\n return;\n }\n\n state.setSelectedValue(value());\n\n // Focus the input when clicked\n // In real browsers this happens automatically, but JSDOM/fireEvent doesn't trigger it\n target.focus();\n\n // Force the DOM checked state to match our reactive state\n // This handles controlled mode where the parent might not update the value\n target.checked = isSelected();\n };\n\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n const { pressProps, isPressed } = createPress({\n get onPressStart() { return getProps().onPressStart; },\n get onPressEnd() { return getProps().onPressEnd; },\n get onPressChange() { return getProps().onPressChange; },\n get onPress() { return getProps().onPress; },\n get onPressUp() { return getProps().onPressUp; },\n get isDisabled() { return isDisabled(); },\n });\n\n // Handle press state on the label.\n const { pressProps: labelPressProps, isPressed: isLabelPressed } = createPress({\n get onPressStart() { return getProps().onPressStart; },\n get onPressEnd() { return getProps().onPressEnd; },\n get onPressChange() { return getProps().onPressChange; },\n get onPressUp() { return getProps().onPressUp; },\n onPress(e: PressEvent) {\n getProps().onPress?.(e);\n state.setSelectedValue(value());\n ref()?.focus();\n },\n get isDisabled() { return isDisabled(); },\n });\n\n // Handle focusable\n const { focusableProps } = createFocusable({\n get isDisabled() { return isDisabled(); },\n get autoFocus() { return getProps().autoFocus; },\n onFocus(e: FocusEvent) {\n getProps().onFocus?.(e);\n state.setLastFocusedValue(value());\n },\n get onBlur() { return getProps().onBlur; },\n get onFocusChange() { return getProps().onFocusChange; },\n get onKeyDown() { return getProps().onKeyDown; },\n get onKeyUp() { return getProps().onKeyUp; },\n }, ref as unknown as (el: HTMLElement) => void);\n\n // Combine press and focusable props for input\n const interactions = mergeProps(pressProps, focusableProps);\n\n // Filter DOM props\n const domProps = () => filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n // Calculate tabIndex based on selection and focus state\n const getTabIndex = (): number | undefined => {\n if (isDisabled()) {\n return undefined;\n }\n\n const selected = state.selectedValue();\n const lastFocused = state.lastFocusedValue();\n const currentValue = value();\n\n if (selected != null) {\n // If there's a selection, only the selected radio is focusable\n if (selected === currentValue) {\n return 0;\n }\n return -1;\n } else {\n // If no selection, the last focused or first radio is focusable\n if (lastFocused === currentValue || lastFocused == null) {\n return 0;\n }\n return -1;\n }\n };\n\n // Get group data\n const getGroupData = () => radioGroupData.get(state);\n\n // Combined pressed state\n const combinedIsPressed: Accessor<boolean> = () => isPressed() || isLabelPressed();\n\n return {\n labelProps: mergeProps(labelPressProps, {\n onClick: (e: MouseEvent) => e.preventDefault(),\n onMouseDown: (e: MouseEvent) => e.preventDefault(),\n }),\n get inputProps() {\n const p = getProps();\n const groupData = getGroupData();\n\n // Build aria-describedby\n const describedByIds: string[] = [];\n if (p['aria-describedby']) {\n describedByIds.push(p['aria-describedby']);\n }\n if (state.isInvalid && groupData?.errorMessageId) {\n describedByIds.push(groupData.errorMessageId);\n }\n if (groupData?.descriptionId) {\n describedByIds.push(groupData.descriptionId);\n }\n const ariaDescribedBy = describedByIds.length > 0 ? describedByIds.join(' ') : undefined;\n\n return mergeProps(domProps(), interactions, {\n type: 'radio' as const,\n name: groupData?.name,\n form: groupData?.form,\n tabIndex: getTabIndex(),\n disabled: isDisabled(),\n required: state.isRequired && groupData?.validationBehavior === 'native',\n checked: isSelected(),\n value: value(),\n onChange,\n 'aria-describedby': ariaDescribedBy,\n }) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n isDisabled: isDisabled(),\n isSelected,\n isPressed: combinedIsPressed,\n };\n}\n","/**\n * Switch hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n *\n * This is a 1:1 port of @react-aria/switch's useSwitch hook.\n */\n\nimport { JSX, Accessor } from 'solid-js';\nimport { createToggle, type AriaToggleProps } from '../toggle/createToggle';\nimport { type ToggleState } from '@proyecto-viviana/solid-stately';\nimport { type MaybeAccessor } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaSwitchProps extends AriaToggleProps {\n // Switch uses the same props as toggle\n}\n\nexport interface SwitchAria {\n /** Props for the label wrapper element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Whether the switch is selected. */\n isSelected: Accessor<boolean>;\n /** Whether the switch is in a pressed state. */\n isPressed: Accessor<boolean>;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a switch component.\n * A switch is similar to a checkbox, but represents on/off values as opposed to selection.\n */\nexport function createSwitch(\n props: MaybeAccessor<AriaSwitchProps>,\n state: ToggleState,\n ref: () => HTMLInputElement | null\n): SwitchAria {\n // Don't destructure inputProps - it's a getter that needs to be evaluated each time\n const toggle = createToggle(props, state, ref);\n\n return {\n labelProps: toggle.labelProps,\n get inputProps() {\n // Access toggle.inputProps (the getter) each time to get fresh values\n const baseProps = toggle.inputProps;\n return {\n ...baseProps,\n role: 'switch' as const,\n checked: toggle.isSelected(),\n };\n },\n isSelected: toggle.isSelected,\n isPressed: toggle.isPressed,\n isDisabled: toggle.isDisabled,\n isReadOnly: toggle.isReadOnly,\n };\n}\n","/**\n * Link hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n *\n * This is a 1:1 port of @react-aria/link's useLink hook.\n */\n\nimport { type Accessor } from 'solid-js';\nimport { createPress } from '../interactions/createPress';\nimport { createFocusable } from '../interactions/createFocusable';\nimport { mergeProps } from '../utils/mergeProps';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\nimport { type PressEvent } from '../interactions/PressEvent';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean;\n /** The HTML element used to render the link, e.g. 'a', or 'span'. @default 'a' */\n elementType?: string;\n /** The URL to link to. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Handler that is called when the press is released over the target. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction starts. */\n onPressStart?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction ends. */\n onPressEnd?: (e: PressEvent) => void;\n /** Handler that is called when the element is clicked. */\n onClick?: (e: MouseEvent) => void;\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n /** Whether to autofocus the element. */\n autoFocus?: boolean;\n /** Indicates the current \"page\" or state within a set of related elements. */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean;\n /** Defines a string value that labels the current element. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: Record<string, unknown>;\n /** Whether the link is currently pressed. */\n isPressed: Accessor<boolean>;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function createLink(\n props: MaybeAccessor<AriaLinkProps> = {}\n): LinkAria {\n const getProps = () => access(props);\n\n const isDisabled = () => getProps().isDisabled ?? false;\n const elementType = () => getProps().elementType ?? 'a';\n\n // Create press handling\n const { pressProps, isPressed } = createPress({\n get isDisabled() { return isDisabled(); },\n get onPress() { return getProps().onPress; },\n get onPressStart() { return getProps().onPressStart; },\n get onPressEnd() { return getProps().onPressEnd; },\n });\n\n // Create focusable handling\n const { focusableProps } = createFocusable({\n get isDisabled() { return isDisabled(); },\n get autoFocus() { return getProps().autoFocus; },\n get onFocus() { return getProps().onFocus; },\n get onBlur() { return getProps().onBlur; },\n get onFocusChange() { return getProps().onFocusChange; },\n get onKeyDown() { return getProps().onKeyDown; },\n get onKeyUp() { return getProps().onKeyUp; },\n });\n\n // Build link props\n const getLinkProps = (): Record<string, unknown> => {\n const p = getProps();\n const elType = elementType();\n const disabled = isDisabled();\n\n let baseProps: Record<string, unknown> = {};\n\n // If not an <a>, add role and tabIndex\n if (elType !== 'a') {\n baseProps = {\n role: 'link',\n tabIndex: disabled ? undefined : 0,\n };\n }\n\n // Add link-specific props\n if (elType === 'a') {\n if (p.href) baseProps.href = p.href;\n if (p.target) baseProps.target = p.target;\n if (p.rel) baseProps.rel = p.rel;\n }\n\n // ARIA attributes\n const ariaProps: Record<string, unknown> = {\n 'aria-disabled': disabled || undefined,\n };\n\n if (p['aria-current'] !== undefined) {\n ariaProps['aria-current'] = p['aria-current'];\n }\n if (p['aria-label']) {\n ariaProps['aria-label'] = p['aria-label'];\n }\n if (p['aria-labelledby']) {\n ariaProps['aria-labelledby'] = p['aria-labelledby'];\n }\n if (p['aria-describedby']) {\n ariaProps['aria-describedby'] = p['aria-describedby'];\n }\n\n // Handle onClick - only call user's onClick when not disabled\n const onClick = (e: MouseEvent) => {\n // If disabled, prevent navigation and don't call user's onClick\n if (disabled) {\n e.preventDefault();\n return;\n }\n\n // Call user's onClick if provided\n p.onClick?.(e);\n };\n\n return mergeProps(\n filterDOMProps(p as Record<string, unknown>, { labelable: true }),\n baseProps,\n ariaProps,\n focusableProps as Record<string, unknown>,\n pressProps as Record<string, unknown>,\n { onClick }\n );\n };\n\n return {\n get linkProps() {\n return getLinkProps();\n },\n isPressed,\n };\n}\n","/**\n * TextField hook for Solidaria\n *\n * Provides the behavior and accessibility implementation for a text field.\n *\n * This is a 1:1 port of @react-aria/textfield's useTextField hook.\n */\n\nimport { JSX } from 'solid-js';\nimport { createField, type AriaFieldProps, type FieldAria } from '../label';\nimport { createFocusable, type FocusableProps } from '../interactions';\nimport { mergeProps, filterDOMProps } from '../utils';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaTextFieldProps extends AriaFieldProps, FocusableProps {\n /** The current value (controlled). */\n value?: string;\n /** The default value (uncontrolled). */\n defaultValue?: string;\n /** Handler that is called when the value changes. */\n onChange?: (value: string) => void;\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n /** Whether the input is read only. */\n isReadOnly?: boolean;\n /** Whether the input is required. */\n isRequired?: boolean;\n /** The type of input to render. */\n type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | string;\n /** The input mode hint for virtual keyboards. */\n inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n /** The name of the input element, used when submitting an HTML form. */\n name?: string;\n /** Regex pattern to validate the input value. */\n pattern?: string;\n /** The maximum number of characters supported by the input. */\n maxLength?: number;\n /** The minimum number of characters required by the input. */\n minLength?: number;\n /** Placeholder text for the input. */\n placeholder?: string;\n /** Whether to enable auto complete. */\n autoComplete?: string;\n /** Whether to enable auto correct. */\n autoCorrect?: string;\n /** Whether to enable spell check. */\n spellCheck?: 'true' | 'false';\n /** Controls whether and how text input is automatically capitalized. */\n autoCapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n /** The element type to use for the input. Defaults to 'input'. */\n inputElementType?: 'input' | 'textarea';\n\n // Clipboard events\n onCopy?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>;\n onCut?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>;\n onPaste?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>;\n\n // Composition events\n onCompositionStart?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>;\n onCompositionEnd?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>;\n onCompositionUpdate?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>;\n\n // Selection events\n onSelect?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, Event>;\n\n // Input events\n onBeforeInput?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, InputEvent>;\n onInput?: JSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, InputEvent>;\n}\n\nexport interface TextFieldAria<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement> extends Omit<FieldAria, 'fieldProps'> {\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<T>;\n /** Whether the text field is invalid. */\n isInvalid: boolean;\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the behavior and accessibility implementation for a text field.\n * Text fields allow users to input text with a keyboard.\n *\n * @param props - Props for the text field.\n * @param ref - Optional ref callback for the input element.\n */\nexport function createTextField<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(\n props: MaybeAccessor<AriaTextFieldProps>,\n ref?: (el: T) => void\n): TextFieldAria<T> {\n const getProps = () => access(props);\n\n // Get field accessibility props (label, description, error message)\n const { labelProps, fieldProps, descriptionProps, errorMessageProps } = createField(props);\n\n // Get focusable props\n const { focusableProps } = createFocusable(\n {\n get isDisabled() {\n return getProps().isDisabled;\n },\n get autoFocus() {\n return getProps().autoFocus;\n },\n onFocus: getProps().onFocus,\n onBlur: getProps().onBlur,\n onFocusChange: getProps().onFocusChange,\n onKeyDown: getProps().onKeyDown,\n onKeyUp: getProps().onKeyUp,\n },\n ref as ((el: HTMLElement) => void) | undefined\n );\n\n // Filter DOM props\n const getDomProps = () => filterDOMProps(getProps() as Record<string, unknown>, { labelable: true });\n\n // Build input props\n const getInputProps = (): JSX.InputHTMLAttributes<T> => {\n const p = getProps();\n const isInvalid = p.isInvalid ?? false;\n const isTextarea = p.inputElementType === 'textarea';\n\n return mergeProps(\n getDomProps(),\n {\n disabled: p.isDisabled,\n readOnly: p.isReadOnly,\n required: p.isRequired,\n 'aria-required': p.isRequired || undefined,\n 'aria-invalid': isInvalid || undefined,\n value: p.value ?? p.defaultValue ?? '',\n onChange: (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n p.onChange?.(target.value);\n },\n // Don't include type and pattern for textarea elements\n type: isTextarea ? undefined : (p.type ?? 'text'),\n inputMode: p.inputMode,\n name: p.name,\n pattern: isTextarea ? undefined : p.pattern,\n maxLength: p.maxLength,\n minLength: p.minLength,\n placeholder: p.placeholder,\n autoComplete: p.autoComplete,\n autoCorrect: p.autoCorrect,\n autoCapitalize: p.autoCapitalize,\n spellCheck: p.spellCheck,\n\n // Clipboard events\n onCopy: p.onCopy,\n onCut: p.onCut,\n onPaste: p.onPaste,\n\n // Composition events\n onCompositionStart: p.onCompositionStart,\n onCompositionEnd: p.onCompositionEnd,\n onCompositionUpdate: p.onCompositionUpdate,\n\n // Selection events\n onSelect: p.onSelect,\n\n // Input events\n onBeforeInput: p.onBeforeInput,\n onInput: p.onInput,\n },\n focusableProps as Record<string, unknown>,\n fieldProps as Record<string, unknown>\n ) as JSX.InputHTMLAttributes<T>;\n };\n\n const getIsInvalid = () => {\n return getProps().isInvalid ?? false;\n };\n\n return {\n get labelProps() {\n return labelProps;\n },\n get inputProps() {\n return getInputProps();\n },\n get descriptionProps() {\n return descriptionProps;\n },\n get errorMessageProps() {\n return errorMessageProps;\n },\n get isInvalid() {\n return getIsInvalid();\n },\n };\n}\n","/**\n * ProgressBar hook for Solidaria\n *\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n *\n * This is a 1:1 port of @react-aria/progress's useProgressBar hook.\n */\n\nimport { createLabel } from '../label/createLabel';\nimport { mergeProps } from '../utils/mergeProps';\nimport { filterDOMProps } from '../utils/filterDOMProps';\nimport { type MaybeAccessor, access } from '../utils/reactivity';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport interface AriaProgressBarProps {\n /** The current value (controlled). */\n value?: number;\n /** The smallest value allowed for the input. @default 0 */\n minValue?: number;\n /** The largest value allowed for the input. @default 100 */\n maxValue?: number;\n /** The content to display as the value's label (e.g. 1 of 4). */\n valueLabel?: string;\n /** Whether presentation is indeterminate when progress isn't known. */\n isIndeterminate?: boolean;\n /** The display format of the value label. */\n formatOptions?: Intl.NumberFormatOptions;\n /** The content to display as the label. */\n label?: string;\n /** An accessibility label for this item. */\n 'aria-label'?: string;\n /** Identifies the element (or elements) that labels the current element. */\n 'aria-labelledby'?: string;\n /** Identifies the element (or elements) that describes the object. */\n 'aria-describedby'?: string;\n /** Identifies the element (or elements) that provide a detailed, extended description for the object. */\n 'aria-details'?: string;\n}\n\nexport interface ProgressBarAria {\n /** Props for the progress bar container element. */\n progressBarProps: Record<string, unknown>;\n /** Props for the progress bar's visual label element (if any). */\n labelProps: Record<string, unknown>;\n}\n\n// ============================================\n// UTILITIES\n// ============================================\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n// ============================================\n// IMPLEMENTATION\n// ============================================\n\n/**\n * Provides the accessibility implementation for a progress bar component.\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport function createProgressBar(\n props: MaybeAccessor<AriaProgressBarProps> = {}\n): ProgressBarAria {\n const getProps = () => access(props);\n\n // Create label handling\n const { labelProps, fieldProps } = createLabel({\n get label() { return getProps().label; },\n get 'aria-label'() { return getProps()['aria-label']; },\n get 'aria-labelledby'() { return getProps()['aria-labelledby']; },\n // Progress bar is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span',\n });\n\n // Build progress bar props\n const getProgressBarProps = (): Record<string, unknown> => {\n const p = getProps();\n const value = p.value ?? 0;\n const minValue = p.minValue ?? 0;\n const maxValue = p.maxValue ?? 100;\n const isIndeterminate = p.isIndeterminate ?? false;\n const formatOptions = p.formatOptions ?? { style: 'percent' as const };\n\n const clampedValue = clamp(value, minValue, maxValue);\n const percentage = (clampedValue - minValue) / (maxValue - minValue);\n\n // Format value label\n let valueLabel = p.valueLabel;\n if (!isIndeterminate && !valueLabel) {\n const valueToFormat = formatOptions.style === 'percent' ? percentage : clampedValue;\n try {\n const formatter = new Intl.NumberFormat(undefined, formatOptions);\n valueLabel = formatter.format(valueToFormat);\n } catch {\n // Fallback if formatting fails\n valueLabel = `${Math.round(percentage * 100)}%`;\n }\n }\n\n const domProps = filterDOMProps(p as Record<string, unknown>, { labelable: true });\n\n return mergeProps(domProps, fieldProps as Record<string, unknown>, {\n 'aria-valuenow': isIndeterminate ? undefined : clampedValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-valuetext': isIndeterminate ? undefined : valueLabel,\n role: 'progressbar',\n });\n };\n\n return {\n get progressBarProps() {\n return getProgressBarProps();\n },\n get labelProps() {\n return labelProps as Record<string, unknown>;\n },\n };\n}\n","/**\n * createSeparator - SolidJS implementation of React Aria's useSeparator\n *\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n */\n\nimport type { JSX } from 'solid-js';\nimport { access, type MaybeAccessor } from '../utils';\nimport { filterDOMProps } from '../utils';\n\n// ============================================\n// TYPES\n// ============================================\n\nexport type Orientation = 'horizontal' | 'vertical';\n\nexport interface AriaSeparatorProps {\n /**\n * The orientation of the separator.\n * @default 'horizontal'\n */\n orientation?: Orientation;\n /**\n * The HTML element type that will be used to render the separator.\n * @default 'hr'\n */\n elementType?: string;\n /** An accessibility label for the separator. */\n 'aria-label'?: string;\n /** Identifies the element(s) that labels the separator. */\n 'aria-labelledby'?: string;\n /** The element's unique identifier. */\n id?: string;\n}\n\nexport interface SeparatorAria {\n /** Props for the separator element. */\n separatorProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// ============================================\n// CREATE SEPARATOR\n// ============================================\n\n/**\n * Provides the accessibility implementation for a separator.\n * A separator is a visual divider between two groups of content,\n * e.g. groups of menu items or sections of a page.\n */\nexport function createSeparator(\n props: MaybeAccessor<AriaSeparatorProps> = {}\n): SeparatorAria {\n const getSeparatorProps = (): JSX.HTMLAttributes<HTMLElement> => {\n const p = access(props);\n const domProps = filterDOMProps(p as Record<string, unknown>, { labelable: true });\n\n // if orientation is horizontal, aria-orientation default is horizontal, so we leave it undefined\n // if it's vertical, we need to specify it\n let ariaOrientation: 'vertical' | undefined;\n if (p.orientation === 'vertical') {\n ariaOrientation = 'vertical';\n }\n\n // hr elements implicitly have role = separator and a horizontal orientation\n if (p.elementType !== 'hr') {\n return {\n ...domProps,\n role: 'separator',\n 'aria-orientation': ariaOrientation,\n };\n }\n\n return domProps;\n };\n\n return {\n get separatorProps() {\n return getSeparatorProps();\n },\n };\n}\n"],"names":["access","document","isDisabledValue","window","state","createId"],"mappings":";;;;;;;;;;;;;AAsCO,MAAM,WAAkC;AAAA,EAa7C,YACE,MACA,aACA,eACA,QACA;AAjBF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,+CAAyB;AAQvB,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,SAAS;AAGd,UAAM,IAAI;AACV,SAAK,YAAW,uBAAG,aAAY;AAC/B,SAAK,WAAU,uBAAG,YAAW;AAC7B,SAAK,WAAU,uBAAG,YAAW;AAC7B,SAAK,UAAS,uBAAG,WAAU;AAG3B,SAAK,IAAI;AACT,SAAK,IAAI;AAET,QAAI,iBAAiB,aAAa,iBAAiB,QAAQ;AACzD,YAAM,OAAO,OAAO,sBAAA;AACpB,WAAK,IAAK,cAA6B,UAAU,KAAK;AACtD,WAAK,IAAK,cAA6B,UAAU,KAAK;AAAA,IACxD,WAAW,QAAQ;AAEjB,YAAM,OAAO,OAAO,sBAAA;AACpB,WAAK,IAAI,KAAK,QAAQ;AACtB,WAAK,IAAI,KAAK,SAAS;AAAA,IACzB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAA4B;AAC1B,uBAAK,wBAAyB;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,wBAAiC;AACnC,WAAO,mBAAK;AAAA,EACd;AACF;AAlDE;AAuDK,SAAS,iBACd,MACA,aACA,eACA,QACY;AACZ,SAAO,IAAI,WAAW,MAAM,aAAa,eAAe,MAAM;AAChE;ACvGO,SAAS,cAAgC,MAAoC;;AAClF,QAAM,SAAgB,CAAA;AAEtB,aAAW,SAAS,MAAM;AACxB,eAAW,OAAO,OAAO;AACvB,YAAM,QAAQ,MAAM,GAAG;AACvB,YAAM,gBAAgB,OAAO,GAAG;AAEhC,UACE,OAAO,kBAAkB,cACzB,OAAO,UAAU,cACj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