se-design 1.0.69-dev → 1.0.70

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 (249) hide show
  1. package/dist/assets/icons/file-filled-checked.svg +8 -0
  2. package/dist/index113.js +1 -1
  3. package/dist/index113.js.map +1 -1
  4. package/dist/index114.js +2 -2
  5. package/dist/index114.js.map +1 -1
  6. package/dist/index115.js +2 -2
  7. package/dist/index115.js.map +1 -1
  8. package/dist/index116.js +1 -1
  9. package/dist/index116.js.map +1 -1
  10. package/dist/index117.js +1 -1
  11. package/dist/index117.js.map +1 -1
  12. package/dist/index118.js +1 -1
  13. package/dist/index118.js.map +1 -1
  14. package/dist/index119.js +2 -2
  15. package/dist/index119.js.map +1 -1
  16. package/dist/index120.js +2 -2
  17. package/dist/index120.js.map +1 -1
  18. package/dist/index121.js +2 -2
  19. package/dist/index121.js.map +1 -1
  20. package/dist/index122.js +1 -1
  21. package/dist/index122.js.map +1 -1
  22. package/dist/index123.js +1 -1
  23. package/dist/index123.js.map +1 -1
  24. package/dist/index124.js +1 -1
  25. package/dist/index124.js.map +1 -1
  26. package/dist/index125.js +1 -1
  27. package/dist/index125.js.map +1 -1
  28. package/dist/index126.js +1 -1
  29. package/dist/index126.js.map +1 -1
  30. package/dist/index127.js +1 -1
  31. package/dist/index127.js.map +1 -1
  32. package/dist/index128.js +1 -1
  33. package/dist/index128.js.map +1 -1
  34. package/dist/index129.js +1 -1
  35. package/dist/index129.js.map +1 -1
  36. package/dist/index130.js +2 -2
  37. package/dist/index130.js.map +1 -1
  38. package/dist/index131.js +2 -2
  39. package/dist/index131.js.map +1 -1
  40. package/dist/index132.js +1 -1
  41. package/dist/index132.js.map +1 -1
  42. package/dist/index133.js +1 -1
  43. package/dist/index133.js.map +1 -1
  44. package/dist/index134.js +1 -1
  45. package/dist/index134.js.map +1 -1
  46. package/dist/index135.js +1 -1
  47. package/dist/index135.js.map +1 -1
  48. package/dist/index136.js +1 -1
  49. package/dist/index136.js.map +1 -1
  50. package/dist/index137.js +1 -1
  51. package/dist/index137.js.map +1 -1
  52. package/dist/index138.js +1 -1
  53. package/dist/index138.js.map +1 -1
  54. package/dist/index139.js +2 -2
  55. package/dist/index139.js.map +1 -1
  56. package/dist/index140.js +1 -1
  57. package/dist/index140.js.map +1 -1
  58. package/dist/index141.js +2 -2
  59. package/dist/index141.js.map +1 -1
  60. package/dist/index142.js +2 -2
  61. package/dist/index142.js.map +1 -1
  62. package/dist/index143.js +2 -2
  63. package/dist/index143.js.map +1 -1
  64. package/dist/index144.js +2 -2
  65. package/dist/index144.js.map +1 -1
  66. package/dist/index145.js +1 -1
  67. package/dist/index145.js.map +1 -1
  68. package/dist/index146.js +1 -1
  69. package/dist/index146.js.map +1 -1
  70. package/dist/index147.js +1 -1
  71. package/dist/index147.js.map +1 -1
  72. package/dist/index148.js +1 -1
  73. package/dist/index148.js.map +1 -1
  74. package/dist/index149.js +1 -1
  75. package/dist/index149.js.map +1 -1
  76. package/dist/index15.js +2 -2
  77. package/dist/index150.js +1 -1
  78. package/dist/index150.js.map +1 -1
  79. package/dist/index151.js +1 -1
  80. package/dist/index151.js.map +1 -1
  81. package/dist/index152.js +1 -1
  82. package/dist/index152.js.map +1 -1
  83. package/dist/index153.js +1 -1
  84. package/dist/index153.js.map +1 -1
  85. package/dist/index154.js +1 -1
  86. package/dist/index154.js.map +1 -1
  87. package/dist/index155.js +1 -1
  88. package/dist/index155.js.map +1 -1
  89. package/dist/index156.js +1 -1
  90. package/dist/index156.js.map +1 -1
  91. package/dist/index157.js +1 -1
  92. package/dist/index157.js.map +1 -1
  93. package/dist/index158.js +1 -1
  94. package/dist/index158.js.map +1 -1
  95. package/dist/index159.js +1 -1
  96. package/dist/index159.js.map +1 -1
  97. package/dist/index160.js +1 -1
  98. package/dist/index160.js.map +1 -1
  99. package/dist/index161.js +1 -1
  100. package/dist/index161.js.map +1 -1
  101. package/dist/index162.js +1 -1
  102. package/dist/index162.js.map +1 -1
  103. package/dist/index163.js +1 -1
  104. package/dist/index163.js.map +1 -1
  105. package/dist/index164.js +1 -1
  106. package/dist/index164.js.map +1 -1
  107. package/dist/index165.js +1 -1
  108. package/dist/index165.js.map +1 -1
  109. package/dist/index166.js +1 -1
  110. package/dist/index166.js.map +1 -1
  111. package/dist/index167.js +1 -1
  112. package/dist/index167.js.map +1 -1
  113. package/dist/index168.js +1 -1
  114. package/dist/index168.js.map +1 -1
  115. package/dist/index169.js +2 -2
  116. package/dist/index169.js.map +1 -1
  117. package/dist/index170.js +2 -2
  118. package/dist/index170.js.map +1 -1
  119. package/dist/index171.js +1 -1
  120. package/dist/index171.js.map +1 -1
  121. package/dist/index172.js +1 -1
  122. package/dist/index172.js.map +1 -1
  123. package/dist/index173.js +2 -2
  124. package/dist/index173.js.map +1 -1
  125. package/dist/index174.js +2 -2
  126. package/dist/index174.js.map +1 -1
  127. package/dist/index175.js +1 -1
  128. package/dist/index175.js.map +1 -1
  129. package/dist/index176.js +1 -1
  130. package/dist/index176.js.map +1 -1
  131. package/dist/index177.js +1 -1
  132. package/dist/index177.js.map +1 -1
  133. package/dist/index178.js +1 -1
  134. package/dist/index178.js.map +1 -1
  135. package/dist/index179.js +1 -1
  136. package/dist/index179.js.map +1 -1
  137. package/dist/index18.js +1 -1
  138. package/dist/index180.js +1 -1
  139. package/dist/index180.js.map +1 -1
  140. package/dist/index181.js +1 -1
  141. package/dist/index181.js.map +1 -1
  142. package/dist/index182.js +1 -1
  143. package/dist/index182.js.map +1 -1
  144. package/dist/index183.js +2 -2
  145. package/dist/index183.js.map +1 -1
  146. package/dist/index184.js +2 -2
  147. package/dist/index184.js.map +1 -1
  148. package/dist/index185.js +2 -2
  149. package/dist/index185.js.map +1 -1
  150. package/dist/index186.js +2 -149
  151. package/dist/index186.js.map +1 -1
  152. package/dist/index187.js +149 -9
  153. package/dist/index187.js.map +1 -1
  154. package/dist/index188.js +8 -5
  155. package/dist/index188.js.map +1 -1
  156. package/dist/index189.js +5 -4
  157. package/dist/index189.js.map +1 -1
  158. package/dist/index190.js +8 -0
  159. package/dist/index190.js.map +1 -0
  160. package/dist/{index192.js → index193.js} +1 -1
  161. package/dist/{index192.js.map → index193.js.map} +1 -1
  162. package/dist/{index194.js → index195.js} +2 -2
  163. package/dist/{index194.js.map → index195.js.map} +1 -1
  164. package/dist/{index196.js → index197.js} +1 -1
  165. package/dist/{index196.js.map → index197.js.map} +1 -1
  166. package/dist/{index204.js → index205.js} +1 -1
  167. package/dist/{index204.js.map → index205.js.map} +1 -1
  168. package/dist/{index212.js → index213.js} +1 -1
  169. package/dist/{index212.js.map → index213.js.map} +1 -1
  170. package/dist/index216.js +32 -43
  171. package/dist/index216.js.map +1 -1
  172. package/dist/index217.js +46 -0
  173. package/dist/index217.js.map +1 -0
  174. package/dist/index22.js +2 -2
  175. package/dist/{index225.js → index226.js} +1 -1
  176. package/dist/{index225.js.map → index226.js.map} +1 -1
  177. package/dist/index228.js +57 -20
  178. package/dist/index228.js.map +1 -1
  179. package/dist/index229.js +1 -1
  180. package/dist/index230.js +9 -18
  181. package/dist/index230.js.map +1 -1
  182. package/dist/index231.js +9 -9
  183. package/dist/index231.js.map +1 -1
  184. package/dist/index232.js +4 -9
  185. package/dist/index232.js.map +1 -1
  186. package/dist/index233.js +170 -5
  187. package/dist/index233.js.map +1 -1
  188. package/dist/index234.js +11 -170
  189. package/dist/index234.js.map +1 -1
  190. package/dist/index235.js +22 -11
  191. package/dist/index235.js.map +1 -1
  192. package/dist/index236.js +18 -5
  193. package/dist/index236.js.map +1 -1
  194. package/dist/index237.js +5 -5
  195. package/dist/index237.js.map +1 -1
  196. package/dist/index238.js +5 -37
  197. package/dist/index238.js.map +1 -1
  198. package/dist/index239.js +38 -2
  199. package/dist/index239.js.map +1 -1
  200. package/dist/index24.js +2 -2
  201. package/dist/index240.js +2 -8
  202. package/dist/index240.js.map +1 -1
  203. package/dist/index241.js +7 -326
  204. package/dist/index241.js.map +1 -1
  205. package/dist/index242.js +324 -47
  206. package/dist/index242.js.map +1 -1
  207. package/dist/index243.js +50 -2
  208. package/dist/index243.js.map +1 -1
  209. package/dist/index244.js +2 -76
  210. package/dist/index244.js.map +1 -1
  211. package/dist/index245.js +65 -82
  212. package/dist/index245.js.map +1 -1
  213. package/dist/index246.js +89 -48
  214. package/dist/index246.js.map +1 -1
  215. package/dist/index247.js +51 -7
  216. package/dist/index247.js.map +1 -1
  217. package/dist/index248.js +7 -4
  218. package/dist/index248.js.map +1 -1
  219. package/dist/index249.js +4 -51
  220. package/dist/index249.js.map +1 -1
  221. package/dist/index250.js +52 -2
  222. package/dist/index250.js.map +1 -1
  223. package/dist/index251.js +2 -2
  224. package/dist/index252.js +5 -0
  225. package/dist/index252.js.map +1 -0
  226. package/dist/index27.js +1 -1
  227. package/dist/index29.js +1 -1
  228. package/dist/index34.js +1 -1
  229. package/dist/index35.js +1 -1
  230. package/dist/index37.js +2 -2
  231. package/dist/index38.js +2 -2
  232. package/dist/index39.js +1 -1
  233. package/dist/index44.js +2 -2
  234. package/dist/index45.js +3 -3
  235. package/dist/index48.js +2 -2
  236. package/dist/index5.js +86 -84
  237. package/dist/index5.js.map +1 -1
  238. package/dist/index51.js +1 -1
  239. package/dist/index52.js +1 -1
  240. package/dist/index56.js +1 -1
  241. package/dist/index6.js +1 -1
  242. package/dist/index62.js +1 -1
  243. package/dist/index64.js +2 -2
  244. package/dist/index8.js +2 -2
  245. package/package.json +1 -1
  246. package/dist/index215.js +0 -35
  247. package/dist/index215.js.map +0 -1
  248. package/dist/index227.js +0 -62
  249. package/dist/index227.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index187.js","sources":["../src/utils/a11y/elementVisibility.ts"],"sourcesContent":["/**\n * Checks if an element is visible in the DOM.\n * \n * An element is considered visible if:\n * - It exists in the DOM\n * - It's not hidden via CSS (display: none, visibility: hidden)\n * - It has actual dimensions (width > 0 and height > 0)\n * \n * @param element - The element to check, or null\n * @returns true if the element is visible, false otherwise\n * \n * @example\n * const element = document.getElementById('my-element');\n * if (isElementVisible(element)) {\n * // Element is visible\n * }\n */\nexport function isElementVisible(element: HTMLElement | null): boolean {\n if (!element) return false;\n\n // Check computed style for display/visibility\n const style = window.getComputedStyle(element);\n if (style.display === 'none' || style.visibility === 'hidden') {\n return false;\n }\n\n // Check if element has dimensions\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\n"],"names":["isElementVisible","element","style","window","getComputedStyle","display","visibility","rect","getBoundingClientRect","width","height"],"mappings":"AAiBO,SAASA,EAAiBC,GAAsC;AACrE,MAAI,CAACA,EAAS,QAAO;AAGrB,QAAMC,IAAQC,OAAOC,iBAAiBH,CAAO;AAC7C,MAAIC,EAAMG,YAAY,UAAUH,EAAMI,eAAe;AACnD,WAAO;AAIT,QAAMC,IAAON,EAAQO,sBAAAA;AACrB,SAAOD,EAAKE,QAAQ,KAAKF,EAAKG,SAAS;AACzC;"}
1
+ {"version":3,"file":"index187.js","sources":["../node_modules/react-svg/dist/react-svg.esm.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport { SVGInjector } from '@tanem/svg-injector';\nimport * as PropTypes from 'prop-types';\nimport * as React from 'react';\n\n// Hat-tip: https://github.com/mui/material-ui/tree/master/packages/mui-utils/src.\nvar ownerWindow = function ownerWindow(node) {\n var doc = (node == null ? void 0 : node.ownerDocument) || document;\n return doc.defaultView || window;\n};\n\n// Hat-tip: https://github.com/developit/preact-compat/blob/master/src/index.js#L402.\nvar shallowDiffers = function shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) {\n return true;\n }\n }\n for (var _i in b) {\n if (a[_i] !== b[_i]) {\n return true;\n }\n }\n return false;\n};\n\nvar _excluded = [\"afterInjection\", \"beforeInjection\", \"desc\", \"evalScripts\", \"fallback\", \"httpRequestWithCredentials\", \"loading\", \"renumerateIRIElements\", \"src\", \"title\", \"useRequestCache\", \"wrapper\"];\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar ReactSVG = /*#__PURE__*/function (_React$Component) {\n function ReactSVG() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.initialState = {\n hasError: false,\n isLoading: true\n };\n _this.state = _this.initialState;\n _this._isMounted = false;\n _this.reactWrapper = void 0;\n _this.nonReactWrapper = void 0;\n _this.refCallback = function (reactWrapper) {\n _this.reactWrapper = reactWrapper;\n };\n return _this;\n }\n _inheritsLoose(ReactSVG, _React$Component);\n var _proto = ReactSVG.prototype;\n _proto.renderSVG = function renderSVG() {\n var _this2 = this;\n /* istanbul ignore else */\n if (this.reactWrapper instanceof ownerWindow(this.reactWrapper).Node) {\n var _this$props = this.props,\n desc = _this$props.desc,\n evalScripts = _this$props.evalScripts,\n httpRequestWithCredentials = _this$props.httpRequestWithCredentials,\n renumerateIRIElements = _this$props.renumerateIRIElements,\n src = _this$props.src,\n title = _this$props.title,\n useRequestCache = _this$props.useRequestCache;\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n var onError = this.props.onError;\n var beforeInjection = this.props.beforeInjection;\n var afterInjection = this.props.afterInjection;\n var wrapper = this.props.wrapper;\n var nonReactWrapper;\n var nonReactTarget;\n if (wrapper === 'svg') {\n nonReactWrapper = document.createElementNS(svgNamespace, wrapper);\n nonReactWrapper.setAttribute('xmlns', svgNamespace);\n nonReactWrapper.setAttribute('xmlns:xlink', xlinkNamespace);\n nonReactTarget = document.createElementNS(svgNamespace, wrapper);\n } else {\n nonReactWrapper = document.createElement(wrapper);\n nonReactTarget = document.createElement(wrapper);\n }\n nonReactWrapper.appendChild(nonReactTarget);\n nonReactTarget.dataset.src = src;\n this.nonReactWrapper = this.reactWrapper.appendChild(nonReactWrapper);\n var handleError = function handleError(error) {\n _this2.removeSVG();\n if (!_this2._isMounted) {\n onError(error);\n return;\n }\n _this2.setState(function () {\n return {\n hasError: true,\n isLoading: false\n };\n }, function () {\n onError(error);\n });\n };\n var afterEach = function afterEach(error, svg) {\n if (error) {\n handleError(error);\n return;\n }\n // TODO (Tane): It'd be better to cleanly unsubscribe from SVGInjector\n // callbacks instead of tracking a property like this.\n if (_this2._isMounted) {\n _this2.setState(function () {\n return {\n isLoading: false\n };\n }, function () {\n try {\n afterInjection(svg);\n } catch (afterInjectionError) {\n handleError(afterInjectionError);\n }\n });\n }\n };\n var beforeEach = function beforeEach(svg) {\n svg.setAttribute('role', 'img');\n if (desc) {\n var originalDesc = svg.querySelector(':scope > desc');\n if (originalDesc) {\n svg.removeChild(originalDesc);\n }\n var newDesc = document.createElement('desc');\n newDesc.innerHTML = desc;\n svg.prepend(newDesc);\n }\n if (title) {\n var originalTitle = svg.querySelector(':scope > title');\n if (originalTitle) {\n svg.removeChild(originalTitle);\n }\n var newTitle = document.createElement('title');\n newTitle.innerHTML = title;\n svg.prepend(newTitle);\n }\n try {\n beforeInjection(svg);\n } catch (error) {\n handleError(error);\n }\n };\n SVGInjector(nonReactTarget, {\n afterEach: afterEach,\n beforeEach: beforeEach,\n cacheRequests: useRequestCache,\n evalScripts: evalScripts,\n httpRequestWithCredentials: httpRequestWithCredentials,\n renumerateIRIElements: renumerateIRIElements\n });\n }\n };\n _proto.removeSVG = function removeSVG() {\n var _this$nonReactWrapper;\n if ((_this$nonReactWrapper = this.nonReactWrapper) != null && _this$nonReactWrapper.parentNode) {\n this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper);\n this.nonReactWrapper = null;\n }\n };\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.renderSVG();\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this3 = this;\n if (shallowDiffers(_extends({}, prevProps), this.props)) {\n this.setState(function () {\n return _this3.initialState;\n }, function () {\n _this3.removeSVG();\n _this3.renderSVG();\n });\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeSVG();\n };\n _proto.render = function render() {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n var _this$props2 = this.props;\n _this$props2.afterInjection;\n _this$props2.beforeInjection;\n _this$props2.desc;\n _this$props2.evalScripts;\n var Fallback = _this$props2.fallback;\n _this$props2.httpRequestWithCredentials;\n var Loading = _this$props2.loading;\n _this$props2.renumerateIRIElements;\n _this$props2.src;\n _this$props2.title;\n _this$props2.useRequestCache;\n var wrapper = _this$props2.wrapper,\n rest = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n /* eslint-enable @typescript-eslint/no-unused-vars */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var Wrapper = wrapper;\n return /*#__PURE__*/React.createElement(Wrapper, _extends({}, rest, {\n ref: this.refCallback\n }, wrapper === 'svg' ? {\n xmlns: svgNamespace,\n xmlnsXlink: xlinkNamespace\n } : {}), this.state.isLoading && Loading && /*#__PURE__*/React.createElement(Loading, null), this.state.hasError && Fallback && /*#__PURE__*/React.createElement(Fallback, null));\n };\n return ReactSVG;\n}(React.Component);\nReactSVG.defaultProps = {\n afterInjection: function afterInjection() {\n return undefined;\n },\n beforeInjection: function beforeInjection() {\n return undefined;\n },\n desc: '',\n evalScripts: 'never',\n fallback: null,\n httpRequestWithCredentials: false,\n loading: null,\n onError: function onError() {\n return undefined;\n },\n renumerateIRIElements: true,\n title: '',\n useRequestCache: true,\n wrapper: 'div'\n};\nReactSVG.propTypes = {\n afterInjection: PropTypes.func,\n beforeInjection: PropTypes.func,\n desc: PropTypes.string,\n evalScripts: PropTypes.oneOf(['always', 'once', 'never']),\n fallback: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n httpRequestWithCredentials: PropTypes.bool,\n loading: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n onError: PropTypes.func,\n renumerateIRIElements: PropTypes.bool,\n src: PropTypes.string.isRequired,\n title: PropTypes.string,\n useRequestCache: PropTypes.bool,\n wrapper: PropTypes.oneOf(['div', 'span', 'svg'])\n} ;\n\nexport { ReactSVG };\n//# sourceMappingURL=react-svg.esm.js.map\n"],"names":["_objectWithoutPropertiesLoose","_extends","_inheritsLoose","SVGInjector","propTypesExports","React","ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_proto","_this2","_this$props","desc","evalScripts","httpRequestWithCredentials","renumerateIRIElements","src","title","useRequestCache","onError","beforeInjection","afterInjection","wrapper","nonReactWrapper","nonReactTarget","handleError","error","afterEach","svg","afterInjectionError","beforeEach","originalDesc","newDesc","originalTitle","newTitle","_this$nonReactWrapper","prevProps","_this3","_this$props2","Fallback","Loading","rest","Wrapper","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":"AAOA,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,KAAAC,SAAA;AAAA,YAAAC,OAAA;AACA,IAAIC,IAAc,SAAqBC,GAAM;AAC3C,MAAIC,IAA+BD,GAAK,iBAAkB;AAC1D,SAAOC,EAAI,eAAe;AAC5B,GAGIC,IAAiB,SAAwBC,GAAGC,GAAG;AACjD,WAASC,KAAKF;AACZ,QAAI,EAAEE,KAAKD;AACT,aAAO;AAGX,WAASE,KAAMF;AACb,QAAID,EAAEG,CAAE,MAAMF,EAAEE,CAAE;AAChB,aAAO;AAGX,SAAO;AACT,GAEIC,IAAY,CAAC,kBAAkB,mBAAmB,QAAQ,eAAe,YAAY,8BAA8B,WAAW,yBAAyB,OAAO,SAAS,mBAAmB,SAAS,GACnMC,IAAe,8BACfC,IAAiB,gCACjBC,IAAwB,yBAAUC,GAAkB;AACtD,WAASD,IAAW;AAElB,a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AAAlD,EAAM,cAAckD,GAAS,IAAI,GAAG,KAAK,MAAM,YAAYD,KAAyB,gBAAAjD,EAAM,cAAciD,GAAU,IAAI,CAAC;AAAA,EAClL,GACOrC;AACT,EAAEZ,EAAM,SAAS;AACjBY,EAAS,eAAe;AAAA,EACtB,gBAAgB,WAA0B;AAAA,EAE1C;AAAA,EACA,iBAAiB,WAA2B;AAAA,EAE5C;AAAA,EACA,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV,4BAA4B;AAAA,EAC5B,SAAS;AAAA,EACT,SAAS,WAAmB;AAAA,EAE5B;AAAA,EACA,uBAAuB;AAAA,EACvB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,SAAS;AACX;AACAA,EAAS,YAAY;AAAA,EACnB,gBAAgByC,EAAAA;AAAAA,EAChB,iBAAiBA,EAAAA;AAAAA,EACjB,MAAMC,EAAAA;AAAAA,EACN,aAAaC,EAAAA,MAAgB,CAAC,UAAU,QAAQ,OAAO,CAAC;AAAA,EACxD,UAAUC,EAAAA,UAAoB,CAACH,EAAAA,MAAgBI,EAAAA,QAAkBH,EAAAA,MAAgB,CAAC;AAAA,EAClF,4BAA4BI,EAAAA;AAAAA,EAC5B,SAASF,EAAAA,UAAoB,CAACH,EAAAA,MAAgBI,EAAAA,QAAkBH,EAAAA,MAAgB,CAAC;AAAA,EACjF,SAASD,EAAAA;AAAAA,EACT,uBAAuBK,EAAAA;AAAAA,EACvB,KAAKJ,EAAAA,OAAiB;AAAA,EACtB,OAAOA,EAAAA;AAAAA,EACP,iBAAiBI,EAAAA;AAAAA,EACjB,SAASH,EAAAA,MAAgB,CAAC,OAAO,QAAQ,KAAK,CAAC;AACjD;","x_google_ignoreList":[0]}
package/dist/index188.js CHANGED
@@ -1,9 +1,12 @@
1
- import { useRef as n } from "react";
2
- function u(e, t = "se-id") {
3
- const r = n("");
4
- return r.current || (r.current = `${t}-${crypto.randomUUID()}`), e || r.current;
1
+ function n(i) {
2
+ if (!i) return !1;
3
+ const t = window.getComputedStyle(i);
4
+ if (t.display === "none" || t.visibility === "hidden")
5
+ return !1;
6
+ const e = i.getBoundingClientRect();
7
+ return e.width > 0 && e.height > 0;
5
8
  }
6
9
  export {
7
- u as useStableId
10
+ n as isElementVisible
8
11
  };
9
12
  //# sourceMappingURL=index188.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index188.js","sources":["../src/utils/useStableId.ts"],"sourcesContent":["import { useRef } from 'react';\n\n/**\n * Generates a stable unique ID for component instances (React 16 compatible).\n * Returns the provided id if given, otherwise generates a stable per-mount id.\n * \n * @param id - Optional explicit id\n * @param prefix - Prefix for auto-generated ids (default: 'se-id')\n * @returns Stable id string\n */\nexport function useStableId(id?: string, prefix: string = 'se-id'): string {\n const autoIdRef = useRef<string>('');\n \n if (!autoIdRef.current) {\n autoIdRef.current = `${prefix}-${crypto.randomUUID()}`;\n }\n \n return id || autoIdRef.current;\n}\n\n\n\n\n\n\n\n"],"names":["useRef","useStableId","id","prefix","autoIdRef","current","crypto","randomUUID"],"mappings":"AAUO,SAAA,UAAAA,SAAA;AAAA,SAASC,EAAYC,GAAaC,IAAiB,SAAiB;AACzE,QAAMC,IAAYJ,EAAe,EAAE;AAEnC,SAAKI,EAAUC,YACbD,EAAUC,UAAU,GAAGF,CAAM,IAAIG,OAAOC,YAAY,KAG/CL,KAAME,EAAUC;AACzB;"}
1
+ {"version":3,"file":"index188.js","sources":["../src/utils/a11y/elementVisibility.ts"],"sourcesContent":["/**\n * Checks if an element is visible in the DOM.\n * \n * An element is considered visible if:\n * - It exists in the DOM\n * - It's not hidden via CSS (display: none, visibility: hidden)\n * - It has actual dimensions (width > 0 and height > 0)\n * \n * @param element - The element to check, or null\n * @returns true if the element is visible, false otherwise\n * \n * @example\n * const element = document.getElementById('my-element');\n * if (isElementVisible(element)) {\n * // Element is visible\n * }\n */\nexport function isElementVisible(element: HTMLElement | null): boolean {\n if (!element) return false;\n\n // Check computed style for display/visibility\n const style = window.getComputedStyle(element);\n if (style.display === 'none' || style.visibility === 'hidden') {\n return false;\n }\n\n // Check if element has dimensions\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\n"],"names":["isElementVisible","element","style","window","getComputedStyle","display","visibility","rect","getBoundingClientRect","width","height"],"mappings":"AAiBO,SAASA,EAAiBC,GAAsC;AACrE,MAAI,CAACA,EAAS,QAAO;AAGrB,QAAMC,IAAQC,OAAOC,iBAAiBH,CAAO;AAC7C,MAAIC,EAAMG,YAAY,UAAUH,EAAMI,eAAe;AACnD,WAAO;AAIT,QAAMC,IAAON,EAAQO,sBAAAA;AACrB,SAAOD,EAAKE,QAAQ,KAAKF,EAAKG,SAAS;AACzC;"}
package/dist/index189.js CHANGED
@@ -1,8 +1,9 @@
1
- function o(...n) {
2
- const t = [...new Set(n.filter((e) => !!e).flatMap((e) => e.trim().split(/\s+/)).filter(Boolean))];
3
- return t.length > 0 ? t.join(" ") : void 0;
1
+ import { useRef as n } from "react";
2
+ function u(e, t = "se-id") {
3
+ const r = n("");
4
+ return r.current || (r.current = `${t}-${crypto.randomUUID()}`), e || r.current;
4
5
  }
5
6
  export {
6
- o as mergeIds
7
+ u as useStableId
7
8
  };
8
9
  //# sourceMappingURL=index189.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index189.js","sources":["../src/utils/mergeIds.ts"],"sourcesContent":["/**\n * Merges multiple ID strings into a single space-separated string.\n * Filters out falsy values and deduplicates IDs while preserving order.\n * \n * Useful for ARIA attributes (aria-describedby, aria-labelledby) and class names.\n * \n * @param ids - Array of id strings (or undefined/null)\n * @returns Merged space-separated id string, or undefined if no valid ids\n * \n * @example\n * mergeIds('error-1', undefined, 'helper-1', 'error-1')\n * // Returns: 'error-1 helper-1'\n */\nexport function mergeIds(...ids: (string | undefined | null)[]): string | undefined {\n const uniqueIds = [\n ...new Set(\n ids\n .filter((id): id is string => Boolean(id))\n .flatMap(id => id.trim().split(/\\s+/))\n .filter(Boolean)\n )\n ];\n \n return uniqueIds.length > 0 ? uniqueIds.join(' ') : undefined;\n}\n"],"names":["mergeIds","ids","uniqueIds","Set","filter","id","Boolean","flatMap","trim","split","length","join","undefined"],"mappings":"AAaO,SAASA,KAAYC,GAAwD;AAClF,QAAMC,IAAY,CAChB,GAAG,IAAIC,IACLF,EACGG,OAAO,CAACC,MAAqBC,EAAQD,CAAG,EACxCE,QAAQF,CAAAA,MAAMA,EAAGG,OAAOC,MAAM,KAAK,CAAC,EACpCL,OAAOE,OAAO,CACnB,CAAC;AAGH,SAAOJ,EAAUQ,SAAS,IAAIR,EAAUS,KAAK,GAAG,IAAIC;AACtD;"}
1
+ {"version":3,"file":"index189.js","sources":["../src/utils/useStableId.ts"],"sourcesContent":["import { useRef } from 'react';\n\n/**\n * Generates a stable unique ID for component instances (React 16 compatible).\n * Returns the provided id if given, otherwise generates a stable per-mount id.\n * \n * @param id - Optional explicit id\n * @param prefix - Prefix for auto-generated ids (default: 'se-id')\n * @returns Stable id string\n */\nexport function useStableId(id?: string, prefix: string = 'se-id'): string {\n const autoIdRef = useRef<string>('');\n \n if (!autoIdRef.current) {\n autoIdRef.current = `${prefix}-${crypto.randomUUID()}`;\n }\n \n return id || autoIdRef.current;\n}\n\n\n\n\n\n\n\n"],"names":["useRef","useStableId","id","prefix","autoIdRef","current","crypto","randomUUID"],"mappings":"AAUO,SAAA,UAAAA,SAAA;AAAA,SAASC,EAAYC,GAAaC,IAAiB,SAAiB;AACzE,QAAMC,IAAYJ,EAAe,EAAE;AAEnC,SAAKI,EAAUC,YACbD,EAAUC,UAAU,GAAGF,CAAM,IAAIG,OAAOC,YAAY,KAG/CL,KAAME,EAAUC;AACzB;"}
@@ -0,0 +1,8 @@
1
+ function o(...n) {
2
+ const t = [...new Set(n.filter((e) => !!e).flatMap((e) => e.trim().split(/\s+/)).filter(Boolean))];
3
+ return t.length > 0 ? t.join(" ") : void 0;
4
+ }
5
+ export {
6
+ o as mergeIds
7
+ };
8
+ //# sourceMappingURL=index190.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index190.js","sources":["../src/utils/mergeIds.ts"],"sourcesContent":["/**\n * Merges multiple ID strings into a single space-separated string.\n * Filters out falsy values and deduplicates IDs while preserving order.\n * \n * Useful for ARIA attributes (aria-describedby, aria-labelledby) and class names.\n * \n * @param ids - Array of id strings (or undefined/null)\n * @returns Merged space-separated id string, or undefined if no valid ids\n * \n * @example\n * mergeIds('error-1', undefined, 'helper-1', 'error-1')\n * // Returns: 'error-1 helper-1'\n */\nexport function mergeIds(...ids: (string | undefined | null)[]): string | undefined {\n const uniqueIds = [\n ...new Set(\n ids\n .filter((id): id is string => Boolean(id))\n .flatMap(id => id.trim().split(/\\s+/))\n .filter(Boolean)\n )\n ];\n \n return uniqueIds.length > 0 ? uniqueIds.join(' ') : undefined;\n}\n"],"names":["mergeIds","ids","uniqueIds","Set","filter","id","Boolean","flatMap","trim","split","length","join","undefined"],"mappings":"AAaO,SAASA,KAAYC,GAAwD;AAClF,QAAMC,IAAY,CAChB,GAAG,IAAIC,IACLF,EACGG,OAAO,CAACC,MAAqBC,EAAQD,CAAG,EACxCE,QAAQF,CAAAA,MAAMA,EAAGG,OAAOC,MAAM,KAAK,CAAC,EACpCL,OAAOE,OAAO,CACnB,CAAC;AAGH,SAAOJ,EAAUQ,SAAS,IAAIR,EAAUS,KAAK,GAAG,IAAIC;AACtD;"}
@@ -24,4 +24,4 @@ function p({
24
24
  export {
25
25
  p as useDismissOnFocusOut
26
26
  };
27
- //# sourceMappingURL=index192.js.map
27
+ //# sourceMappingURL=index193.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index192.js","sources":["../src/utils/a11y/useDismissOnFocusOut.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type UseDismissOnFocusOutOptions = {\n /**\n * Disable all handlers (no-ops). Useful when a component provides alternate\n * focus/keyboard behavior (e.g., disabled-trigger tooltip wrapper).\n */\n disabled?: boolean;\n /**\n * Called when focus enters anywhere within the target.\n */\n onFocusIn?: () => void;\n /**\n * Called when focus leaves the target (i.e., focus moves to an element\n * outside the currentTarget).\n */\n onFocusOut?: () => void;\n /**\n * Called when Escape is pressed while focus is within the target.\n */\n onEscape?: () => void;\n /**\n * Whether Escape should trigger dismissal. Default: true.\n */\n closeOnEscape?: boolean;\n};\n\nexport type UseDismissOnFocusOutReturn<T extends HTMLElement = HTMLElement> = {\n onFocusCapture: (e: React.FocusEvent<T>) => void;\n onBlurCapture: (e: React.FocusEvent<T>) => void;\n onKeyDownCapture: (e: React.KeyboardEvent<T>) => void;\n};\n\n/**\n * Returns capture-phase handlers to \"show on focus within\" and \"dismiss on focus out\",\n * with optional Escape-to-dismiss.\n *\n * Intended for non-interactive surfaces like tooltips where content should remain\n * visible while focus stays within the wrapper.\n */\nexport function useDismissOnFocusOut<T extends HTMLElement = HTMLElement>({\n disabled = false,\n onFocusIn,\n onFocusOut,\n onEscape,\n closeOnEscape = true\n}: UseDismissOnFocusOutOptions): UseDismissOnFocusOutReturn<T> {\n const onFocusCapture = React.useCallback(\n (_e: React.FocusEvent<T>) => {\n if (disabled) return;\n onFocusIn?.();\n },\n [disabled, onFocusIn]\n );\n\n const onBlurCapture = React.useCallback(\n (e: React.FocusEvent<T>) => {\n if (disabled) return;\n\n const nextFocused = e.relatedTarget as Node | null;\n if (nextFocused && e.currentTarget.contains(nextFocused)) return;\n\n onFocusOut?.();\n },\n [disabled, onFocusOut]\n );\n\n const onKeyDownCapture = React.useCallback(\n (e: React.KeyboardEvent<T>) => {\n if (disabled || !closeOnEscape || e.key !== 'Escape') return;\n\n e.preventDefault();\n onEscape?.();\n },\n [disabled, closeOnEscape, onEscape]\n );\n\n return { onFocusCapture, onBlurCapture, onKeyDownCapture };\n}\n\n"],"names":["React","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","closeOnEscape","onFocusCapture","useCallback","_e","onBlurCapture","e","nextFocused","relatedTarget","currentTarget","contains","onKeyDownCapture","key","preventDefault"],"mappings":"AAwCO,YAAAA,OAAA;AAAA,SAASC,EAA0D;AAAA,EACxEC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AACW,GAAkC;AAC7D,QAAMC,IAAiBP,EAAMQ,YAC3B,CAACC,MAA4B;AAC3B,IAAIP,KACJC,IAAAA;AAAAA,EACF,GACA,CAACD,GAAUC,CAAS,CACtB,GAEMO,IAAgBV,EAAMQ,YAC1B,CAACG,MAA2B;AAC1B,QAAIT,EAAU;AAEd,UAAMU,IAAcD,EAAEE;AACtB,IAAID,KAAeD,EAAEG,cAAcC,SAASH,CAAW,KAEvDR,IAAAA;AAAAA,EACF,GACA,CAACF,GAAUE,CAAU,CACvB,GAEMY,IAAmBhB,EAAMQ,YAC7B,CAACG,MAA8B;AAC7B,IAAIT,KAAY,CAACI,KAAiBK,EAAEM,QAAQ,aAE5CN,EAAEO,eAAAA,GACFb,IAAAA;AAAAA,EACF,GACA,CAACH,GAAUI,GAAeD,CAAQ,CACpC;AAEA,SAAO;AAAA,IAAEE,gBAAAA;AAAAA,IAAgBG,eAAAA;AAAAA,IAAeM,kBAAAA;AAAAA,EAAAA;AAC1C;"}
1
+ {"version":3,"file":"index193.js","sources":["../src/utils/a11y/useDismissOnFocusOut.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type UseDismissOnFocusOutOptions = {\n /**\n * Disable all handlers (no-ops). Useful when a component provides alternate\n * focus/keyboard behavior (e.g., disabled-trigger tooltip wrapper).\n */\n disabled?: boolean;\n /**\n * Called when focus enters anywhere within the target.\n */\n onFocusIn?: () => void;\n /**\n * Called when focus leaves the target (i.e., focus moves to an element\n * outside the currentTarget).\n */\n onFocusOut?: () => void;\n /**\n * Called when Escape is pressed while focus is within the target.\n */\n onEscape?: () => void;\n /**\n * Whether Escape should trigger dismissal. Default: true.\n */\n closeOnEscape?: boolean;\n};\n\nexport type UseDismissOnFocusOutReturn<T extends HTMLElement = HTMLElement> = {\n onFocusCapture: (e: React.FocusEvent<T>) => void;\n onBlurCapture: (e: React.FocusEvent<T>) => void;\n onKeyDownCapture: (e: React.KeyboardEvent<T>) => void;\n};\n\n/**\n * Returns capture-phase handlers to \"show on focus within\" and \"dismiss on focus out\",\n * with optional Escape-to-dismiss.\n *\n * Intended for non-interactive surfaces like tooltips where content should remain\n * visible while focus stays within the wrapper.\n */\nexport function useDismissOnFocusOut<T extends HTMLElement = HTMLElement>({\n disabled = false,\n onFocusIn,\n onFocusOut,\n onEscape,\n closeOnEscape = true\n}: UseDismissOnFocusOutOptions): UseDismissOnFocusOutReturn<T> {\n const onFocusCapture = React.useCallback(\n (_e: React.FocusEvent<T>) => {\n if (disabled) return;\n onFocusIn?.();\n },\n [disabled, onFocusIn]\n );\n\n const onBlurCapture = React.useCallback(\n (e: React.FocusEvent<T>) => {\n if (disabled) return;\n\n const nextFocused = e.relatedTarget as Node | null;\n if (nextFocused && e.currentTarget.contains(nextFocused)) return;\n\n onFocusOut?.();\n },\n [disabled, onFocusOut]\n );\n\n const onKeyDownCapture = React.useCallback(\n (e: React.KeyboardEvent<T>) => {\n if (disabled || !closeOnEscape || e.key !== 'Escape') return;\n\n e.preventDefault();\n onEscape?.();\n },\n [disabled, closeOnEscape, onEscape]\n );\n\n return { onFocusCapture, onBlurCapture, onKeyDownCapture };\n}\n\n"],"names":["React","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","closeOnEscape","onFocusCapture","useCallback","_e","onBlurCapture","e","nextFocused","relatedTarget","currentTarget","contains","onKeyDownCapture","key","preventDefault"],"mappings":"AAwCO,YAAAA,OAAA;AAAA,SAASC,EAA0D;AAAA,EACxEC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AACW,GAAkC;AAC7D,QAAMC,IAAiBP,EAAMQ,YAC3B,CAACC,MAA4B;AAC3B,IAAIP,KACJC,IAAAA;AAAAA,EACF,GACA,CAACD,GAAUC,CAAS,CACtB,GAEMO,IAAgBV,EAAMQ,YAC1B,CAACG,MAA2B;AAC1B,QAAIT,EAAU;AAEd,UAAMU,IAAcD,EAAEE;AACtB,IAAID,KAAeD,EAAEG,cAAcC,SAASH,CAAW,KAEvDR,IAAAA;AAAAA,EACF,GACA,CAACF,GAAUE,CAAU,CACvB,GAEMY,IAAmBhB,EAAMQ,YAC7B,CAACG,MAA8B;AAC7B,IAAIT,KAAY,CAACI,KAAiBK,EAAEM,QAAQ,aAE5CN,EAAEO,eAAAA,GACFb,IAAAA;AAAAA,EACF,GACA,CAACH,GAAUI,GAAeD,CAAQ,CACpC;AAEA,SAAO;AAAA,IAAEE,gBAAAA;AAAAA,IAAgBG,eAAAA;AAAAA,IAAeM,kBAAAA;AAAAA,EAAAA;AAC1C;"}
@@ -1,6 +1,6 @@
1
1
  import { useRef as u, useCallback as f, useEffect as P } from "react";
2
2
  import { useComboboxNavigation as y } from "./index229.js";
3
- import { useDismissOnFocusOut as R } from "./index192.js";
3
+ import { useDismissOnFocusOut as R } from "./index193.js";
4
4
  function M({
5
5
  items: l,
6
6
  isOpen: t,
@@ -84,4 +84,4 @@ function M({
84
84
  export {
85
85
  M as useCombobox
86
86
  };
87
- //# sourceMappingURL=index194.js.map
87
+ //# sourceMappingURL=index195.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index194.js","sources":["../src/utils/a11y/useCombobox.ts"],"sourcesContent":["import { useRef, useCallback, useEffect } from 'react';\nimport type { RefObject } from 'react';\nimport { useComboboxNavigation } from './useComboboxNavigation';\nimport { useDismissOnFocusOut } from './useDismissOnFocusOut';\nimport type { UseDismissOnFocusOutReturn } from './useDismissOnFocusOut';\n\nexport interface UseComboboxOptions<T = any> {\n /**\n * Array of items to navigate through\n */\n items: T[];\n \n /**\n * Whether the dropdown is currently open\n */\n isOpen: boolean;\n \n /**\n * Callback to change the open state\n */\n onOpenChange: (open: boolean) => void;\n \n /**\n * Callback when an item is selected (Enter key)\n */\n onSelect: (item: T, index: number) => void;\n \n /**\n * Stable ID for the listbox element\n */\n listboxId: string;\n \n /**\n * Whether to wrap around at the ends of the list.\n * Default: true\n */\n loop?: boolean;\n \n /**\n * Whether keyboard navigation is disabled\n * (e.g., for custom rendered content)\n */\n disabled?: boolean;\n \n /**\n * CSS selector for option elements (default: '[role=\"option\"]')\n */\n optionSelector?: string;\n \n /**\n * Whether the listbox has any items to show\n * Used for aria-expanded logic\n * Default: items.length > 0\n */\n hasItems?: boolean;\n}\n\nexport interface UseComboboxReturn {\n /**\n * Props to spread on the container element (handles dismiss on focus out)\n */\n containerProps: UseDismissOnFocusOutReturn<HTMLElement>;\n \n /**\n * Props to spread on the combobox input element\n */\n inputProps: {\n role: 'combobox';\n 'aria-expanded': boolean;\n 'aria-haspopup': 'listbox';\n 'aria-controls': string | undefined;\n 'aria-autocomplete': 'list';\n 'aria-activedescendant': string | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n };\n \n /**\n * Props to spread on the listbox element\n */\n listboxProps: {\n id: string;\n role: 'listbox';\n ref: RefObject<HTMLDivElement | null>;\n onMouseDownCapture: (e: React.MouseEvent) => void;\n onMouseUpCapture: (e: React.MouseEvent) => void;\n onMouseLeave: (e: React.MouseEvent) => void;\n };\n \n /**\n * Generate props for an option element at the given index\n * @param selected - Whether this option is the currently selected/chosen value (not keyboard highlight)\n */\n getOptionProps: (index: number, selected?: boolean) => {\n id: string;\n role: 'option';\n 'aria-selected': boolean;\n };\n \n /**\n * Currently highlighted index (-1 if none)\n */\n highlightedIndex: number;\n \n /**\n * Set the highlighted index manually\n */\n setHighlightedIndex: (index: number | ((prev: number) => number)) => void;\n \n /**\n * Generate stable ID for an option\n */\n getOptionId: (listboxId: string, index: number) => string;\n}\n\n/**\n * Comprehensive hook for implementing WAI-ARIA combobox pattern.\n * \n * Combines:\n * - Keyboard navigation (Arrow Up/Down, Enter, Escape, Tab)\n * - Focus management and dismissal\n * - ARIA attributes for accessibility\n * - Auto-scroll highlighted item into view\n * \n * This hook provides a complete, batteries-included solution for building\n * accessible combobox components (autocomplete, select, search with suggestions, etc.)\n * \n * @example Basic usage\n * ```tsx\n * const MyCombobox = () => {\n * const [isOpen, setIsOpen] = useState(false);\n * const [items, setItems] = useState(['Apple', 'Banana', 'Cherry']);\n * \n * const {\n * containerProps,\n * inputProps,\n * listboxProps,\n * getOptionProps,\n * highlightedIndex\n * } = useCombobox({\n * items,\n * isOpen,\n * onOpenChange: setIsOpen,\n * onSelect: (item) => console.log('Selected:', item),\n * listboxId: 'my-listbox'\n * });\n * \n * return (\n * <div {...containerProps}>\n * <input {...inputProps} />\n * {isOpen && (\n * <div {...listboxProps}>\n * {items.map((item, i) => (\n * <div key={i} {...getOptionProps(i)}>\n * {item}\n * </div>\n * ))}\n * </div>\n * )}\n * </div>\n * );\n * };\n * ```\n * \n * @example With custom ARIA labels and handlers\n * ```tsx\n * const MySearchBox = () => {\n * const [query, setQuery] = useState('');\n * const [suggestions, setSuggestions] = useState([]);\n * const [isOpen, setIsOpen] = useState(false);\n * \n * const { containerProps, inputProps, listboxProps, getOptionProps } = useCombobox({\n * items: suggestions,\n * isOpen,\n * onOpenChange: setIsOpen,\n * onSelect: (suggestion) => {\n * setQuery(suggestion);\n * setIsOpen(false);\n * },\n * listboxId: 'search-suggestions'\n * });\n * \n * return (\n * <div {...containerProps}>\n * <input\n * {...inputProps}\n * value={query}\n * onChange={(e) => setQuery(e.target.value)}\n * aria-label=\"Search\"\n * />\n * {isOpen && suggestions.length > 0 && (\n * <div {...listboxProps} aria-label=\"Search suggestions\">\n * {suggestions.map((suggestion, i) => (\n * <div\n * key={i}\n * {...getOptionProps(i)}\n * onClick={() => {\n * setQuery(suggestion);\n * setIsOpen(false);\n * }}\n * >\n * {suggestion}\n * </div>\n * ))}\n * </div>\n * )}\n * </div>\n * );\n * };\n * ```\n */\nexport function useCombobox<T = any>({\n items,\n isOpen,\n onOpenChange,\n onSelect,\n listboxId,\n loop = true,\n disabled = false,\n optionSelector = '[role=\"option\"]',\n hasItems\n}: UseComboboxOptions<T>): UseComboboxReturn {\n const listboxRef = useRef<HTMLDivElement | null>(null);\n const pointerDownInListboxRef = useRef(false);\n const tabKeyPressedRef = useRef(false);\n \n // Determine if we should show as expanded\n const shouldShowExpanded = hasItems !== undefined ? hasItems : items.length > 0;\n \n // Close dropdown callback\n const closeDropdown = useCallback(() => {\n onOpenChange(false);\n }, [onOpenChange]);\n\n // Ensure pointer state doesn't get stuck when listbox unmounts\n useEffect(() => {\n if (!isOpen) {\n pointerDownInListboxRef.current = false;\n }\n }, [isOpen]);\n \n // Keyboard navigation with aria-activedescendant\n const navigation = useComboboxNavigation<T>({\n items,\n isOpen,\n onSelect,\n onClose: closeDropdown,\n onOpen: () => onOpenChange(true),\n loop,\n disabled,\n listboxRef,\n optionSelector\n });\n \n // Focus out / Escape dismissal\n const dismissHandlers = useDismissOnFocusOut({\n onFocusOut: closeDropdown,\n onEscape: closeDropdown,\n disabled: !isOpen\n });\n\n const containerProps: UseDismissOnFocusOutReturn<HTMLElement> = {\n ...dismissHandlers,\n onBlurCapture: (e) => {\n // Clicking inside a listbox option can blur the input (relatedTarget is null),\n // which would dismiss before the click handler runs. Prevent that.\n if (pointerDownInListboxRef.current) return;\n \n // Tab key pressed - let Tab handler close dropdown, skip blur detection\n if (tabKeyPressedRef.current) {\n tabKeyPressedRef.current = false;\n return;\n }\n \n dismissHandlers.onBlurCapture(e);\n }\n };\n \n // Build input props\n const inputProps = {\n role: 'combobox' as const,\n 'aria-expanded': isOpen && shouldShowExpanded,\n 'aria-haspopup': 'listbox' as const,\n 'aria-controls': isOpen ? listboxId : undefined,\n 'aria-autocomplete': 'list' as const,\n 'aria-activedescendant': \n navigation.highlightedIndex >= 0 \n ? navigation.getOptionId(listboxId, navigation.highlightedIndex) \n : undefined,\n onKeyDown: (e: React.KeyboardEvent) => {\n // Set flag when Tab is pressed (before blur fires)\n if (e.key === 'Tab') {\n tabKeyPressedRef.current = true;\n }\n navigation.handleKeyDown(e);\n }\n };\n \n // Build listbox props\n const listboxProps = {\n id: listboxId,\n role: 'listbox' as const,\n ref: listboxRef,\n onMouseDownCapture: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = true;\n },\n onMouseUpCapture: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = false;\n },\n onMouseLeave: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = false;\n }\n };\n \n // Option props generator\n const getOptionProps = useCallback(\n (index: number, selected: boolean = false) => ({\n id: navigation.getOptionId(listboxId, index),\n role: 'option' as const,\n 'aria-selected': selected\n }),\n [navigation.getOptionId, listboxId]\n );\n \n return {\n containerProps,\n inputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex: navigation.highlightedIndex,\n setHighlightedIndex: navigation.setHighlightedIndex,\n getOptionId: navigation.getOptionId\n };\n}\n"],"names":["useRef","useCallback","useEffect","useComboboxNavigation","useDismissOnFocusOut","useCombobox","items","isOpen","onOpenChange","onSelect","listboxId","loop","disabled","optionSelector","hasItems","listboxRef","pointerDownInListboxRef","tabKeyPressedRef","shouldShowExpanded","undefined","length","closeDropdown","current","navigation","onClose","onOpen","dismissHandlers","onFocusOut","onEscape","containerProps","onBlurCapture","e","inputProps","role","highlightedIndex","getOptionId","onKeyDown","key","handleKeyDown","listboxProps","id","ref","onMouseDownCapture","_e","onMouseUpCapture","onMouseLeave","getOptionProps","index","selected","setHighlightedIndex"],"mappings":"AAkNO,SAAA,UAAAA,GAAA,eAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,SAAA,wBAAAC,SAAA;AAAA,SAASC,EAAqB;AAAA,EACnCC,OAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,UAAAA,IAAW;AAAA,EACXC,gBAAAA,IAAiB;AAAA,EACjBC,UAAAA;AACqB,GAAsB;AAC3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,EAAEM,QAAQ,UACZpB,EAAiBK,UAAU,KAE7BC,EAAWe,cAAcP,CAAC;AAAA,IAC5B;AAAA,EAAA,GAIIQ,IAAe;AAAA,IACnBC,IAAI9B;AAAAA,IACJuB,MAAM;AAAA,IACNQ,KAAK1B;AAAAA,IACL2B,oBAAoBA,CAACC,MAAyB;AAC5C3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,IACAsB,kBAAkBA,CAACD,MAAyB;AAC1C3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,IACAuB,cAAcA,CAACF,MAAyB;AACtC3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,EAAA,GAIIwB,IAAiB7C,EACrB,CAAC8C,GAAeC,IAAoB,QAAW;AAAA,IAC7CR,IAAIjB,EAAWY,YAAYzB,GAAWqC,CAAK;AAAA,IAC3Cd,MAAM;AAAA,IACN,iBAAiBe;AAAAA,EAAAA,IAEnB,CAACzB,EAAWY,aAAazB,CAAS,CACpC;AAEA,SAAO;AAAA,IACLmB,gBAAAA;AAAAA,IACAG,YAAAA;AAAAA,IACAO,cAAAA;AAAAA,IACAO,gBAAAA;AAAAA,IACAZ,kBAAkBX,EAAWW;AAAAA,IAC7Be,qBAAqB1B,EAAW0B;AAAAA,IAChCd,aAAaZ,EAAWY;AAAAA,EAAAA;AAE5B;"}
1
+ {"version":3,"file":"index195.js","sources":["../src/utils/a11y/useCombobox.ts"],"sourcesContent":["import { useRef, useCallback, useEffect } from 'react';\nimport type { RefObject } from 'react';\nimport { useComboboxNavigation } from './useComboboxNavigation';\nimport { useDismissOnFocusOut } from './useDismissOnFocusOut';\nimport type { UseDismissOnFocusOutReturn } from './useDismissOnFocusOut';\n\nexport interface UseComboboxOptions<T = any> {\n /**\n * Array of items to navigate through\n */\n items: T[];\n \n /**\n * Whether the dropdown is currently open\n */\n isOpen: boolean;\n \n /**\n * Callback to change the open state\n */\n onOpenChange: (open: boolean) => void;\n \n /**\n * Callback when an item is selected (Enter key)\n */\n onSelect: (item: T, index: number) => void;\n \n /**\n * Stable ID for the listbox element\n */\n listboxId: string;\n \n /**\n * Whether to wrap around at the ends of the list.\n * Default: true\n */\n loop?: boolean;\n \n /**\n * Whether keyboard navigation is disabled\n * (e.g., for custom rendered content)\n */\n disabled?: boolean;\n \n /**\n * CSS selector for option elements (default: '[role=\"option\"]')\n */\n optionSelector?: string;\n \n /**\n * Whether the listbox has any items to show\n * Used for aria-expanded logic\n * Default: items.length > 0\n */\n hasItems?: boolean;\n}\n\nexport interface UseComboboxReturn {\n /**\n * Props to spread on the container element (handles dismiss on focus out)\n */\n containerProps: UseDismissOnFocusOutReturn<HTMLElement>;\n \n /**\n * Props to spread on the combobox input element\n */\n inputProps: {\n role: 'combobox';\n 'aria-expanded': boolean;\n 'aria-haspopup': 'listbox';\n 'aria-controls': string | undefined;\n 'aria-autocomplete': 'list';\n 'aria-activedescendant': string | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n };\n \n /**\n * Props to spread on the listbox element\n */\n listboxProps: {\n id: string;\n role: 'listbox';\n ref: RefObject<HTMLDivElement | null>;\n onMouseDownCapture: (e: React.MouseEvent) => void;\n onMouseUpCapture: (e: React.MouseEvent) => void;\n onMouseLeave: (e: React.MouseEvent) => void;\n };\n \n /**\n * Generate props for an option element at the given index\n * @param selected - Whether this option is the currently selected/chosen value (not keyboard highlight)\n */\n getOptionProps: (index: number, selected?: boolean) => {\n id: string;\n role: 'option';\n 'aria-selected': boolean;\n };\n \n /**\n * Currently highlighted index (-1 if none)\n */\n highlightedIndex: number;\n \n /**\n * Set the highlighted index manually\n */\n setHighlightedIndex: (index: number | ((prev: number) => number)) => void;\n \n /**\n * Generate stable ID for an option\n */\n getOptionId: (listboxId: string, index: number) => string;\n}\n\n/**\n * Comprehensive hook for implementing WAI-ARIA combobox pattern.\n * \n * Combines:\n * - Keyboard navigation (Arrow Up/Down, Enter, Escape, Tab)\n * - Focus management and dismissal\n * - ARIA attributes for accessibility\n * - Auto-scroll highlighted item into view\n * \n * This hook provides a complete, batteries-included solution for building\n * accessible combobox components (autocomplete, select, search with suggestions, etc.)\n * \n * @example Basic usage\n * ```tsx\n * const MyCombobox = () => {\n * const [isOpen, setIsOpen] = useState(false);\n * const [items, setItems] = useState(['Apple', 'Banana', 'Cherry']);\n * \n * const {\n * containerProps,\n * inputProps,\n * listboxProps,\n * getOptionProps,\n * highlightedIndex\n * } = useCombobox({\n * items,\n * isOpen,\n * onOpenChange: setIsOpen,\n * onSelect: (item) => console.log('Selected:', item),\n * listboxId: 'my-listbox'\n * });\n * \n * return (\n * <div {...containerProps}>\n * <input {...inputProps} />\n * {isOpen && (\n * <div {...listboxProps}>\n * {items.map((item, i) => (\n * <div key={i} {...getOptionProps(i)}>\n * {item}\n * </div>\n * ))}\n * </div>\n * )}\n * </div>\n * );\n * };\n * ```\n * \n * @example With custom ARIA labels and handlers\n * ```tsx\n * const MySearchBox = () => {\n * const [query, setQuery] = useState('');\n * const [suggestions, setSuggestions] = useState([]);\n * const [isOpen, setIsOpen] = useState(false);\n * \n * const { containerProps, inputProps, listboxProps, getOptionProps } = useCombobox({\n * items: suggestions,\n * isOpen,\n * onOpenChange: setIsOpen,\n * onSelect: (suggestion) => {\n * setQuery(suggestion);\n * setIsOpen(false);\n * },\n * listboxId: 'search-suggestions'\n * });\n * \n * return (\n * <div {...containerProps}>\n * <input\n * {...inputProps}\n * value={query}\n * onChange={(e) => setQuery(e.target.value)}\n * aria-label=\"Search\"\n * />\n * {isOpen && suggestions.length > 0 && (\n * <div {...listboxProps} aria-label=\"Search suggestions\">\n * {suggestions.map((suggestion, i) => (\n * <div\n * key={i}\n * {...getOptionProps(i)}\n * onClick={() => {\n * setQuery(suggestion);\n * setIsOpen(false);\n * }}\n * >\n * {suggestion}\n * </div>\n * ))}\n * </div>\n * )}\n * </div>\n * );\n * };\n * ```\n */\nexport function useCombobox<T = any>({\n items,\n isOpen,\n onOpenChange,\n onSelect,\n listboxId,\n loop = true,\n disabled = false,\n optionSelector = '[role=\"option\"]',\n hasItems\n}: UseComboboxOptions<T>): UseComboboxReturn {\n const listboxRef = useRef<HTMLDivElement | null>(null);\n const pointerDownInListboxRef = useRef(false);\n const tabKeyPressedRef = useRef(false);\n \n // Determine if we should show as expanded\n const shouldShowExpanded = hasItems !== undefined ? hasItems : items.length > 0;\n \n // Close dropdown callback\n const closeDropdown = useCallback(() => {\n onOpenChange(false);\n }, [onOpenChange]);\n\n // Ensure pointer state doesn't get stuck when listbox unmounts\n useEffect(() => {\n if (!isOpen) {\n pointerDownInListboxRef.current = false;\n }\n }, [isOpen]);\n \n // Keyboard navigation with aria-activedescendant\n const navigation = useComboboxNavigation<T>({\n items,\n isOpen,\n onSelect,\n onClose: closeDropdown,\n onOpen: () => onOpenChange(true),\n loop,\n disabled,\n listboxRef,\n optionSelector\n });\n \n // Focus out / Escape dismissal\n const dismissHandlers = useDismissOnFocusOut({\n onFocusOut: closeDropdown,\n onEscape: closeDropdown,\n disabled: !isOpen\n });\n\n const containerProps: UseDismissOnFocusOutReturn<HTMLElement> = {\n ...dismissHandlers,\n onBlurCapture: (e) => {\n // Clicking inside a listbox option can blur the input (relatedTarget is null),\n // which would dismiss before the click handler runs. Prevent that.\n if (pointerDownInListboxRef.current) return;\n \n // Tab key pressed - let Tab handler close dropdown, skip blur detection\n if (tabKeyPressedRef.current) {\n tabKeyPressedRef.current = false;\n return;\n }\n \n dismissHandlers.onBlurCapture(e);\n }\n };\n \n // Build input props\n const inputProps = {\n role: 'combobox' as const,\n 'aria-expanded': isOpen && shouldShowExpanded,\n 'aria-haspopup': 'listbox' as const,\n 'aria-controls': isOpen ? listboxId : undefined,\n 'aria-autocomplete': 'list' as const,\n 'aria-activedescendant': \n navigation.highlightedIndex >= 0 \n ? navigation.getOptionId(listboxId, navigation.highlightedIndex) \n : undefined,\n onKeyDown: (e: React.KeyboardEvent) => {\n // Set flag when Tab is pressed (before blur fires)\n if (e.key === 'Tab') {\n tabKeyPressedRef.current = true;\n }\n navigation.handleKeyDown(e);\n }\n };\n \n // Build listbox props\n const listboxProps = {\n id: listboxId,\n role: 'listbox' as const,\n ref: listboxRef,\n onMouseDownCapture: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = true;\n },\n onMouseUpCapture: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = false;\n },\n onMouseLeave: (_e: React.MouseEvent) => {\n pointerDownInListboxRef.current = false;\n }\n };\n \n // Option props generator\n const getOptionProps = useCallback(\n (index: number, selected: boolean = false) => ({\n id: navigation.getOptionId(listboxId, index),\n role: 'option' as const,\n 'aria-selected': selected\n }),\n [navigation.getOptionId, listboxId]\n );\n \n return {\n containerProps,\n inputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex: navigation.highlightedIndex,\n setHighlightedIndex: navigation.setHighlightedIndex,\n getOptionId: navigation.getOptionId\n };\n}\n"],"names":["useRef","useCallback","useEffect","useComboboxNavigation","useDismissOnFocusOut","useCombobox","items","isOpen","onOpenChange","onSelect","listboxId","loop","disabled","optionSelector","hasItems","listboxRef","pointerDownInListboxRef","tabKeyPressedRef","shouldShowExpanded","undefined","length","closeDropdown","current","navigation","onClose","onOpen","dismissHandlers","onFocusOut","onEscape","containerProps","onBlurCapture","e","inputProps","role","highlightedIndex","getOptionId","onKeyDown","key","handleKeyDown","listboxProps","id","ref","onMouseDownCapture","_e","onMouseUpCapture","onMouseLeave","getOptionProps","index","selected","setHighlightedIndex"],"mappings":"AAkNO,SAAA,UAAAA,GAAA,eAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,SAAA,wBAAAC,SAAA;AAAA,SAASC,EAAqB;AAAA,EACnCC,OAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,UAAAA,IAAW;AAAA,EACXC,gBAAAA,IAAiB;AAAA,EACjBC,UAAAA;AACqB,GAAs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,MAAIA,EAAEM,QAAQ,UACZpB,EAAiBK,UAAU,KAE7BC,EAAWe,cAAcP,CAAC;AAAA,IAC5B;AAAA,EAAA,GAIIQ,IAAe;AAAA,IACnBC,IAAI9B;AAAAA,IACJuB,MAAM;AAAA,IACNQ,KAAK1B;AAAAA,IACL2B,oBAAoBA,CAACC,MAAyB;AAC5C3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,IACAsB,kBAAkBA,CAACD,MAAyB;AAC1C3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,IACAuB,cAAcA,CAACF,MAAyB;AACtC3B,MAAAA,EAAwBM,UAAU;AAAA,IACpC;AAAA,EAAA,GAIIwB,IAAiB7C,EACrB,CAAC8C,GAAeC,IAAoB,QAAW;AAAA,IAC7CR,IAAIjB,EAAWY,YAAYzB,GAAWqC,CAAK;AAAA,IAC3Cd,MAAM;AAAA,IACN,iBAAiBe;AAAAA,EAAAA,IAEnB,CAACzB,EAAWY,aAAazB,CAAS,CACpC;AAEA,SAAO;AAAA,IACLmB,gBAAAA;AAAAA,IACAG,YAAAA;AAAAA,IACAO,cAAAA;AAAAA,IACAO,gBAAAA;AAAAA,IACAZ,kBAAkBX,EAAWW;AAAAA,IAC7Be,qBAAqB1B,EAAW0B;AAAAA,IAChCd,aAAaZ,EAAWY;AAAAA,EAAAA;AAE5B;"}
@@ -23,4 +23,4 @@ function p({
23
23
  export {
24
24
  p as useDismissOnEscape
25
25
  };
26
- //# sourceMappingURL=index196.js.map
26
+ //# sourceMappingURL=index197.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index196.js","sources":["../src/utils/a11y/useDismissOnEscape.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\nexport interface UseDismissOnEscapeOptions<T extends HTMLElement = HTMLElement> {\n /**\n * Container element ref to check if focus is within.\n * Escape will only trigger if focus is within this container.\n */\n containerRef: RefObject<T | null>;\n /**\n * Callback when Escape key is pressed and focus is within container.\n */\n onDismiss?: () => void;\n /**\n * Whether the Escape handler is active.\n * Default: true\n */\n enabled?: boolean;\n /**\n * Whether to call preventDefault() when handling Escape.\n * Default: true\n */\n preventDefault?: boolean;\n /**\n * Whether to call stopPropagation() when handling Escape.\n * Default: true\n */\n stopPropagation?: boolean;\n}\n\n/**\n * Hook to handle Escape key dismissal when focus is within a container.\n * \n * This is a UX pattern: if user is interacting with an overlay/sidebar\n * (indicated by focus being within it), Escape should close it.\n * \n * @example\n * ```tsx\n * const MySidebar = ({ isOpen, onClose }) => {\n * const containerRef = useRef<HTMLDivElement>(null);\n * \n * useDismissOnEscape({\n * containerRef,\n * onDismiss: onClose,\n * enabled: isOpen\n * });\n * \n * return <div ref={containerRef}>...</div>;\n * };\n * ```\n */\nexport function useDismissOnEscape<T extends HTMLElement = HTMLElement>({\n containerRef,\n onDismiss,\n enabled = true,\n preventDefault = true,\n stopPropagation = true\n}: UseDismissOnEscapeOptions<T>): void {\n useEffect(() => {\n if (!enabled || !onDismiss) return;\n \n const container = containerRef.current;\n if (!container) return;\n\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && container.contains(document.activeElement)) {\n preventDefault && e.preventDefault();\n stopPropagation && e.stopPropagation();\n onDismiss();\n }\n };\n\n document.addEventListener('keydown', handleEscape, { capture: true });\n return () => document.removeEventListener('keydown', handleEscape, { capture: true });\n }, [enabled, onDismiss, containerRef, preventDefault, stopPropagation]);\n}\n"],"names":["useEffect","useDismissOnEscape","containerRef","onDismiss","enabled","preventDefault","stopPropagation","container","current","handleEscape","e","key","contains","document","activeElement","addEventListener","capture","removeEventListener"],"mappings":"AAmDO,SAAA,aAAAA,SAAA;AAAA,SAASC,EAAwD;AAAA,EACtEC,cAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,gBAAAA,IAAiB;AAAA,EACjBC,iBAAAA,IAAkB;AACU,GAAS;AACrCN,EAAAA,EAAU,MAAM;AACd,QAAI,CAACI,KAAW,CAACD,EAAW;AAE5B,UAAMI,IAAYL,EAAaM;AAC/B,QAAI,CAACD,EAAW;AAEhB,UAAME,IAAeA,CAACC,MAAqB;AACzC,MAAIA,EAAEC,QAAQ,YAAYJ,EAAUK,SAASC,SAASC,aAAa,MACjET,KAAkBK,EAAEL,eAAAA,GACpBC,KAAmBI,EAAEJ,gBAAAA,GACrBH,EAAAA;AAAAA,IAEJ;AAEAU,oBAASE,iBAAiB,WAAWN,GAAc;AAAA,MAAEO,SAAS;AAAA,IAAA,CAAM,GAC7D,MAAMH,SAASI,oBAAoB,WAAWR,GAAc;AAAA,MAAEO,SAAS;AAAA,IAAA,CAAM;AAAA,EACtF,GAAG,CAACZ,GAASD,GAAWD,GAAcG,GAAgBC,CAAe,CAAC;AACxE;"}
1
+ {"version":3,"file":"index197.js","sources":["../src/utils/a11y/useDismissOnEscape.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\nexport interface UseDismissOnEscapeOptions<T extends HTMLElement = HTMLElement> {\n /**\n * Container element ref to check if focus is within.\n * Escape will only trigger if focus is within this container.\n */\n containerRef: RefObject<T | null>;\n /**\n * Callback when Escape key is pressed and focus is within container.\n */\n onDismiss?: () => void;\n /**\n * Whether the Escape handler is active.\n * Default: true\n */\n enabled?: boolean;\n /**\n * Whether to call preventDefault() when handling Escape.\n * Default: true\n */\n preventDefault?: boolean;\n /**\n * Whether to call stopPropagation() when handling Escape.\n * Default: true\n */\n stopPropagation?: boolean;\n}\n\n/**\n * Hook to handle Escape key dismissal when focus is within a container.\n * \n * This is a UX pattern: if user is interacting with an overlay/sidebar\n * (indicated by focus being within it), Escape should close it.\n * \n * @example\n * ```tsx\n * const MySidebar = ({ isOpen, onClose }) => {\n * const containerRef = useRef<HTMLDivElement>(null);\n * \n * useDismissOnEscape({\n * containerRef,\n * onDismiss: onClose,\n * enabled: isOpen\n * });\n * \n * return <div ref={containerRef}>...</div>;\n * };\n * ```\n */\nexport function useDismissOnEscape<T extends HTMLElement = HTMLElement>({\n containerRef,\n onDismiss,\n enabled = true,\n preventDefault = true,\n stopPropagation = true\n}: UseDismissOnEscapeOptions<T>): void {\n useEffect(() => {\n if (!enabled || !onDismiss) return;\n \n const container = containerRef.current;\n if (!container) return;\n\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && container.contains(document.activeElement)) {\n preventDefault && e.preventDefault();\n stopPropagation && e.stopPropagation();\n onDismiss();\n }\n };\n\n document.addEventListener('keydown', handleEscape, { capture: true });\n return () => document.removeEventListener('keydown', handleEscape, { capture: true });\n }, [enabled, onDismiss, containerRef, preventDefault, stopPropagation]);\n}\n"],"names":["useEffect","useDismissOnEscape","containerRef","onDismiss","enabled","preventDefault","stopPropagation","container","current","handleEscape","e","key","contains","document","activeElement","addEventListener","capture","removeEventListener"],"mappings":"AAmDO,SAAA,aAAAA,SAAA;AAAA,SAASC,EAAwD;AAAA,EACtEC,cAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,gBAAAA,IAAiB;AAAA,EACjBC,iBAAAA,IAAkB;AACU,GAAS;AACrCN,EAAAA,EAAU,MAAM;AACd,QAAI,CAACI,KAAW,CAACD,EAAW;AAE5B,UAAMI,IAAYL,EAAaM;AAC/B,QAAI,CAACD,EAAW;AAEhB,UAAME,IAAeA,CAACC,MAAqB;AACzC,MAAIA,EAAEC,QAAQ,YAAYJ,EAAUK,SAASC,SAASC,aAAa,MACjET,KAAkBK,EAAEL,eAAAA,GACpBC,KAAmBI,EAAEJ,gBAAAA,GACrBH,EAAAA;AAAAA,IAEJ;AAEAU,oBAASE,iBAAiB,WAAWN,GAAc;AAAA,MAAEO,SAAS;AAAA,IAAA,CAAM,GAC7D,MAAMH,SAASI,oBAAoB,WAAWR,GAAc;AAAA,MAAEO,SAAS;AAAA,IAAA,CAAM;AAAA,EACtF,GAAG,CAACZ,GAASD,GAAWD,GAAcG,GAAgBC,CAAe,CAAC;AACxE;"}
@@ -12,4 +12,4 @@ function n(o, u) {
12
12
  export {
13
13
  n as debounce
14
14
  };
15
- //# sourceMappingURL=index204.js.map
15
+ //# sourceMappingURL=index205.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index204.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAO,SAASA,EAA6CC,GAASC,GAAc;AAChF,MAAIC;AACJ,QAAMC,IAAYA,IAAIC,MAAwB;AAC5C,IAAIF,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,IACd,GAAGH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACvB,IAAIJ,kBAAsBA,CAAO,GACjCA,IAAU;AAAA,EACZ,GACOC;AACT;"}
1
+ {"version":3,"file":"index205.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAO,SAASA,EAA6CC,GAASC,GAAc;AAChF,MAAIC;AACJ,QAAMC,IAAYA,IAAIC,MAAwB;AAC5C,IAAIF,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,IACd,GAAGH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACvB,IAAIJ,kBAAsBA,CAAO,GACjCA,IAAU;AAAA,EACZ,GACOC;AACT;"}
@@ -1233,4 +1233,4 @@ const e = [
1233
1233
  export {
1234
1234
  e as default
1235
1235
  };
1236
- //# sourceMappingURL=index212.js.map
1236
+ //# sourceMappingURL=index213.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index212.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index216.js CHANGED
@@ -1,46 +1,35 @@
1
- import { useCallback as g } from "react";
2
- import { useRovingFocus as x } from "./index68.js";
3
- const u = (e, t) => `tab${t ? `-${t}` : ""}-${e}`, c = (e, t) => `panel${t ? `-${t}` : ""}-${e}`;
4
- function P({
5
- itemIds: e,
6
- orientation: t = "horizontal",
7
- activeNavigationItem: n,
8
- idBase: r = ""
9
- }) {
10
- const {
11
- setFocusedId: f,
12
- handleKeyDown: l,
13
- getRovingItemProps: s
14
- } = x({
15
- itemIds: e,
16
- defaultFocusedId: n,
17
- orientation: t,
18
- loop: !0
19
- });
20
- return {
21
- getTabProps: g((o) => {
22
- const {
23
- ref: b,
24
- tabIndex: a,
25
- onFocus: p
26
- } = s(o), d = n === o;
27
- return {
28
- ref: b,
29
- tabIndex: a,
30
- onFocus: p,
31
- id: u(o, r),
32
- "aria-controls": c(o, r),
33
- "aria-selected": d,
34
- role: "tab"
35
- };
36
- }, [n, s, r]),
37
- setFocusedTabId: f,
38
- handleKeyDown: l,
39
- getPanelId: (o) => c(o, r),
40
- getTabId: (o) => u(o, r)
41
- };
42
- }
1
+ import u, { forwardRef as c } from "react";
2
+ import { Button as p } from "./index3.js";
3
+ const b = /* @__PURE__ */ c(({
4
+ id: t,
5
+ label: e,
6
+ isSelected: a,
7
+ isDisabled: r = !1,
8
+ panelId: o,
9
+ tabIndex: l,
10
+ className: n = "",
11
+ automationId: d,
12
+ onClick: s,
13
+ onFocus: f,
14
+ onKeyDown: i
15
+ }, m) => /* @__PURE__ */ u.createElement(p, {
16
+ ref: m,
17
+ type: "unstyled",
18
+ label: e,
19
+ disabled: r,
20
+ onClick: s,
21
+ className: n,
22
+ automationId: d,
23
+ role: "tab",
24
+ id: t,
25
+ "aria-selected": a,
26
+ "aria-controls": o,
27
+ tabIndex: l,
28
+ onFocus: f,
29
+ onKeyDown: i
30
+ }));
31
+ b.displayName = "TabButton";
43
32
  export {
44
- P as useTabsA11y
33
+ b as TabButton
45
34
  };
46
35
  //# sourceMappingURL=index216.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index216.js","sources":["../src/components/NavigationBar/useTabsA11y.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useRovingFocus } from '../../utils/a11y';\n\nconst getTabId = (itemId: string, idBase: string) => {\n const suffix = idBase ? `-${idBase}` : '';\n return `tab${suffix}-${itemId}`;\n};\n\nconst getPanelId = (itemId: string, idBase: string) => {\n const suffix = idBase ? `-${idBase}` : '';\n return `panel${suffix}-${itemId}`;\n};\n\ninterface UseTabsA11yProps {\n itemIds: string[];\n orientation?: 'horizontal' | 'vertical';\n activeNavigationItem: string;\n idBase?: string;\n}\n\ninterface TabA11yProps {\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n id: string;\n 'aria-controls': string;\n 'aria-selected': boolean;\n role: 'tab';\n}\n\n/**\n * Hook for managing Tabs (NavigationBar) focus and ARIA props.\n * Handles roving tabindex pattern and generates tab-specific ARIA attributes.\n * \n * @example\n * const itemIds = useMemo(() => navigationItems.map(item => item.id), [navigationItems]);\n * const { getTabProps, setFocusedTabId, handleKeyDown } = useTabsA11y({\n * itemIds,\n * activeNavigationItem: 'tab-1',\n * orientation: 'horizontal',\n * idBase: 'settings'\n * });\n */\nexport function useTabsA11y({\n itemIds,\n orientation = 'horizontal',\n activeNavigationItem,\n idBase = ''\n}: UseTabsA11yProps) {\n const {\n setFocusedId: setFocusedTabId,\n handleKeyDown,\n getRovingItemProps\n } = useRovingFocus({\n itemIds,\n defaultFocusedId: activeNavigationItem,\n orientation,\n loop: true\n });\n\n /**\n * Get all props needed for a tab button.\n * Combines roving focus props (ref, tabIndex) with tab-specific ARIA attributes.\n */\n const getTabProps = useCallback((itemId: string): TabA11yProps => {\n const { ref, tabIndex, onFocus } = getRovingItemProps(itemId);\n const isSelected = activeNavigationItem === itemId;\n\n return {\n ref,\n tabIndex,\n onFocus,\n id: getTabId(itemId, idBase),\n 'aria-controls': getPanelId(itemId, idBase),\n 'aria-selected': isSelected,\n role: 'tab'\n };\n }, [activeNavigationItem, getRovingItemProps, idBase]);\n\n return {\n getTabProps,\n setFocusedTabId,\n handleKeyDown,\n getPanelId: (itemId: string) => getPanelId(itemId, idBase),\n getTabId: (itemId: string) => getTabId(itemId, idBase)\n };\n}\n\n"],"names":["useCallback","useRovingFocus","getTabId","itemId","idBase","getPanelId","useTabsA11y","itemIds","orientation","activeNavigationItem","setFocusedId","setFocusedTabId","handleKeyDown","getRovingItemProps","defaultFocusedId","loop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}
1
+ {"version":3,"file":"index216.js","sources":["../src/components/NavigationBar/TabButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button } from '../Button';\n\nexport interface TabButtonProps {\n id: string;\n label: string;\n isSelected: boolean;\n isDisabled?: boolean;\n panelId: string;\n tabIndex: number;\n className?: string;\n automationId?: string;\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;\n onFocus: () => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Internal TabButton component for NavigationBar.\n * Uses Button (unstyled) internally for consistent activation handling.\n * Supports forwardRef for focus management (roving tabindex).\n */\nexport const TabButton = forwardRef<HTMLButtonElement, TabButtonProps>(\n (\n {\n id,\n label,\n isSelected,\n isDisabled = false,\n panelId,\n tabIndex,\n className = '',\n automationId,\n onClick,\n onFocus,\n onKeyDown\n },\n ref\n ) => {\n return (\n <Button\n ref={ref}\n type=\"unstyled\"\n label={label}\n disabled={isDisabled}\n onClick={onClick}\n className={className}\n automationId={automationId}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n aria-controls={panelId}\n tabIndex={tabIndex}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n />\n );\n }\n);\n\nTabButton.displayName = 'TabButton';\n"],"names":["React__default","forwardRef","Button","TabButton","id","label","isSelected","isDisabled","panelId","tabIndex","className","automationId","onClick","onFocus","onKeyDown","ref","React","createElement","type","disabled","role","displayName"],"mappings":"AAsBO,OAAAA,KAAA,cAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,MAAMC,sBACX,CACE;AAAA,EACEC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AACF,GACAC,MAGEC,gBAAAA,EAAAC,cAACf,GAAM;AAAA,EACLa,KAAAA;AAAAA,EACAG,MAAK;AAAA,EACLb,OAAAA;AAAAA,EACAc,UAAUZ;AAAAA,EACVK,SAAAA;AAAAA,EACAF,WAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAS,MAAK;AAAA,EACLhB,IAAAA;AAAAA,EACA,iBAAeE;AAAAA,EACf,iBAAeE;AAAAA,EACfC,UAAAA;AAAAA,EACAI,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,CACD,CAGP;AAEAX,EAAUkB,cAAc;"}
@@ -0,0 +1,46 @@
1
+ import { useCallback as g } from "react";
2
+ import { useRovingFocus as x } from "./index68.js";
3
+ const u = (e, t) => `tab${t ? `-${t}` : ""}-${e}`, c = (e, t) => `panel${t ? `-${t}` : ""}-${e}`;
4
+ function P({
5
+ itemIds: e,
6
+ orientation: t = "horizontal",
7
+ activeNavigationItem: n,
8
+ idBase: r = ""
9
+ }) {
10
+ const {
11
+ setFocusedId: f,
12
+ handleKeyDown: l,
13
+ getRovingItemProps: s
14
+ } = x({
15
+ itemIds: e,
16
+ defaultFocusedId: n,
17
+ orientation: t,
18
+ loop: !0
19
+ });
20
+ return {
21
+ getTabProps: g((o) => {
22
+ const {
23
+ ref: b,
24
+ tabIndex: a,
25
+ onFocus: p
26
+ } = s(o), d = n === o;
27
+ return {
28
+ ref: b,
29
+ tabIndex: a,
30
+ onFocus: p,
31
+ id: u(o, r),
32
+ "aria-controls": c(o, r),
33
+ "aria-selected": d,
34
+ role: "tab"
35
+ };
36
+ }, [n, s, r]),
37
+ setFocusedTabId: f,
38
+ handleKeyDown: l,
39
+ getPanelId: (o) => c(o, r),
40
+ getTabId: (o) => u(o, r)
41
+ };
42
+ }
43
+ export {
44
+ P as useTabsA11y
45
+ };
46
+ //# sourceMappingURL=index217.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index217.js","sources":["../src/components/NavigationBar/useTabsA11y.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useRovingFocus } from '../../utils/a11y';\n\nconst getTabId = (itemId: string, idBase: string) => {\n const suffix = idBase ? `-${idBase}` : '';\n return `tab${suffix}-${itemId}`;\n};\n\nconst getPanelId = (itemId: string, idBase: string) => {\n const suffix = idBase ? `-${idBase}` : '';\n return `panel${suffix}-${itemId}`;\n};\n\ninterface UseTabsA11yProps {\n itemIds: string[];\n orientation?: 'horizontal' | 'vertical';\n activeNavigationItem: string;\n idBase?: string;\n}\n\ninterface TabA11yProps {\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n id: string;\n 'aria-controls': string;\n 'aria-selected': boolean;\n role: 'tab';\n}\n\n/**\n * Hook for managing Tabs (NavigationBar) focus and ARIA props.\n * Handles roving tabindex pattern and generates tab-specific ARIA attributes.\n * \n * @example\n * const itemIds = useMemo(() => navigationItems.map(item => item.id), [navigationItems]);\n * const { getTabProps, setFocusedTabId, handleKeyDown } = useTabsA11y({\n * itemIds,\n * activeNavigationItem: 'tab-1',\n * orientation: 'horizontal',\n * idBase: 'settings'\n * });\n */\nexport function useTabsA11y({\n itemIds,\n orientation = 'horizontal',\n activeNavigationItem,\n idBase = ''\n}: UseTabsA11yProps) {\n const {\n setFocusedId: setFocusedTabId,\n handleKeyDown,\n getRovingItemProps\n } = useRovingFocus({\n itemIds,\n defaultFocusedId: activeNavigationItem,\n orientation,\n loop: true\n });\n\n /**\n * Get all props needed for a tab button.\n * Combines roving focus props (ref, tabIndex) with tab-specific ARIA attributes.\n */\n const getTabProps = useCallback((itemId: string): TabA11yProps => {\n const { ref, tabIndex, onFocus } = getRovingItemProps(itemId);\n const isSelected = activeNavigationItem === itemId;\n\n return {\n ref,\n tabIndex,\n onFocus,\n id: getTabId(itemId, idBase),\n 'aria-controls': getPanelId(itemId, idBase),\n 'aria-selected': isSelected,\n role: 'tab'\n };\n }, [activeNavigationItem, getRovingItemProps, idBase]);\n\n return {\n getTabProps,\n setFocusedTabId,\n handleKeyDown,\n getPanelId: (itemId: string) => getPanelId(itemId, idBase),\n getTabId: (itemId: string) => getTabId(itemId, idBase)\n };\n}\n\n"],"names":["useCallback","useRovingFocus","getTabId","itemId","idBase","getPanelId","useTabsA11y","itemIds","orientation","activeNavigationItem","setFocusedId","setFocusedTabId","handleKeyDown","getRovingItemProps","defaultFocusedId","loop","getTabProps","ref","tabIndex","onFocus","isSelected","id","role"],"mappings":"AAGA,SAAA,eAAAA,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,MAAMC,IAAWA,CAACC,GAAgBC,MAEzB,MADQA,IAAS,IAAIA,CAAM,KAAK,EACpB,IAAID,CAAM,IAGzBE,IAAaA,CAACF,GAAgBC,MAE3B,QADQA,IAAS,IAAIA,CAAM,KAAK,EAClB,IAAID,CAAM;AAiC1B,SAASG,EAAY;AAAA,EAC1BC,SAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,sBAAAA;AAAAA,EACAL,QAAAA,IAAS;AACO,GAAG;AACnB,QAAM;AAAA,IACJM,cAAcC;AAAAA,IACdC,eAAAA;AAAAA,IACAC,oBAAAA;AAAAA,EAAAA,IACEZ,EAAe;AAAA,IACjBM,SAAAA;AAAAA,IACAO,kBAAkBL;AAAAA,IAClBD,aAAAA;AAAAA,IACAO,MAAM;AAAA,EAAA,CACP;AAqBD,SAAO;AAAA,IACLC,aAhBkBhB,EAAY,CAACG,MAAiC;AAChE,YAAM;AAAA,QAAEc,KAAAA;AAAAA,QAAKC,UAAAA;AAAAA,QAAUC,SAAAA;AAAAA,MAAAA,IAAYN,EAAmBV,CAAM,GACtDiB,IAAaX,MAAyBN;AAE5C,aAAO;AAAA,QACLc,KAAAA;AAAAA,QACAC,UAAAA;AAAAA,QACAC,SAAAA;AAAAA,QACAE,IAAInB,EAASC,GAAQC,CAAM;AAAA,QAC3B,iBAAiBC,EAAWF,GAAQC,CAAM;AAAA,QAC1C,iBAAiBgB;AAAAA,QACjBE,MAAM;AAAA,MAAA;AAAA,IAEV,GAAG,CAACb,GAAsBI,GAAoBT,CAAM,CAAC;AAAA,IAInDO,iBAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAP,YAAYA,CAACF,MAAmBE,EAAWF,GAAQC,CAAM;AAAA,IACzDF,UAAUA,CAACC,MAAmBD,EAASC,GAAQC,CAAM;AAAA,EAAA;AAEzD;"}
package/dist/index22.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import s, { useState as S, useEffect as _ } from "react";
2
- import { useStableId as $ } from "./index188.js";
2
+ import { useStableId as $ } from "./index189.js";
3
3
  import { getA11yNameAttributes as j } from "./index70.js";
4
- import { mergeIds as B } from "./index189.js";
4
+ import { mergeIds as B } from "./index190.js";
5
5
  /* empty css */
6
6
  function d() {
7
7
  return d = Object.assign ? Object.assign.bind() : function(l) {
@@ -4,4 +4,4 @@ function n(e) {
4
4
  export {
5
5
  n as delay
6
6
  };
7
- //# sourceMappingURL=index225.js.map
7
+ //# sourceMappingURL=index226.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index225.js","sources":["../src/utils/delay.ts"],"sourcesContent":["/**\n * Delays execution by the specified number of milliseconds\n * @param ms - The number of milliseconds to delay\n * @returns A Promise that resolves after the specified delay\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n} "],"names":["delay","ms","Promise","resolve","setTimeout"],"mappings":"AAKO,SAASA,EAAMC,GAA2B;AAC7C,SAAO,IAAIC,QAAQC,CAAAA,MAAWC,WAAWD,GAASF,CAAE,CAAC;AACzD;"}
1
+ {"version":3,"file":"index226.js","sources":["../src/utils/delay.ts"],"sourcesContent":["/**\n * Delays execution by the specified number of milliseconds\n * @param ms - The number of milliseconds to delay\n * @returns A Promise that resolves after the specified delay\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n} "],"names":["delay","ms","Promise","resolve","setTimeout"],"mappings":"AAKO,SAASA,EAAMC,GAA2B;AAC7C,SAAO,IAAIC,QAAQC,CAAAA,MAAWC,WAAWD,GAASF,CAAE,CAAC;AACzD;"}
package/dist/index228.js CHANGED
@@ -1,25 +1,62 @@
1
- const l = ["button:not([disabled])", "[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", '[tabindex]:not([tabindex="-1"]):not([disabled])', '[contenteditable="true"]'].join(", "), a = [l, '[role="menuitem"]', '[role="option"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'].join(", ");
2
- function u({
3
- container: e,
4
- includeRoles: t = !1,
5
- additionalSelectors: r = [],
6
- filterHidden: s = !1
7
- }) {
8
- if (!e) return [];
9
- const d = [t ? a : l, ...r].filter(Boolean).join(", "), i = Array.from(e.querySelectorAll(d));
10
- return s ? i.filter((n) => {
11
- const o = window.getComputedStyle(n);
12
- return o.display !== "none" && o.visibility !== "hidden" && o.opacity !== "0" && !n.hasAttribute("hidden") && n.offsetWidth > 0 && n.offsetHeight > 0;
13
- }) : i;
1
+ import { useRef as E, useLayoutEffect as f } from "react";
2
+ import { getFirstFocusableElement as d, getFocusableElements as g } from "./index235.js";
3
+ function y(e, t) {
4
+ return t === "first" ? d({
5
+ container: e
6
+ }) || e : t === "container" ? e : typeof t == "string" ? e.querySelector(t) : t instanceof HTMLElement ? t : null;
14
7
  }
15
- function c(e) {
16
- const t = u(e);
17
- return t.length > 0 ? t[0] : null;
8
+ function L({
9
+ enabled: e,
10
+ containerRef: t,
11
+ restoreFocus: i = !0,
12
+ initialFocus: l = "first"
13
+ }) {
14
+ const s = E(null), m = E(null);
15
+ return f(() => {
16
+ if (!e) {
17
+ i && s.current && requestAnimationFrame(() => {
18
+ s.current?.focus(), s.current = null;
19
+ });
20
+ return;
21
+ }
22
+ const r = t.current;
23
+ r && (s.current = document.activeElement, requestAnimationFrame(() => {
24
+ y(r, l)?.focus();
25
+ }));
26
+ }, [e, t, i, l]), f(() => {
27
+ if (!e) return;
28
+ const r = t.current;
29
+ if (!r) return;
30
+ const c = (n) => {
31
+ if (n.key === "Tab") {
32
+ const u = g({
33
+ container: r
34
+ });
35
+ if (u.length === 0) {
36
+ n.preventDefault(), r.focus();
37
+ return;
38
+ }
39
+ const o = u[0], a = u[u.length - 1], v = document.activeElement;
40
+ n.shiftKey && v === o ? (n.preventDefault(), a.focus()) : !n.shiftKey && v === a && (n.preventDefault(), o.focus());
41
+ }
42
+ };
43
+ return document.addEventListener("keydown", c, !0), () => document.removeEventListener("keydown", c, !0);
44
+ }, [e, t]), f(() => {
45
+ if (!e) return;
46
+ const r = t.current;
47
+ if (!r) return;
48
+ const c = (n) => {
49
+ const u = n.target;
50
+ r.contains(u) ? m.current = u : (m.current || d({
51
+ container: r
52
+ }) || r).focus();
53
+ };
54
+ return document.addEventListener("focusin", c, !0), () => document.removeEventListener("focusin", c, !0);
55
+ }, [e, t]), {
56
+ triggerRef: s
57
+ };
18
58
  }
19
59
  export {
20
- l as FOCUSABLE_SELECTOR,
21
- a as FOCUSABLE_WITH_ROLES_SELECTOR,
22
- c as getFirstFocusableElement,
23
- u as getFocusableElements
60
+ L as useFocusTrap
24
61
  };
25
62
  //# sourceMappingURL=index228.js.map