se-design 1.0.62-dev → 1.0.63-dev

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 (307) hide show
  1. package/dist/assets/colors.css +9 -22
  2. package/dist/assets/icons/command.svg +1 -1
  3. package/dist/assets/style.css +1 -1
  4. package/dist/components/Banner/index.d.ts +1 -0
  5. package/dist/components/BreadCrumbs/index.d.ts +0 -2
  6. package/dist/components/Button/index.d.ts +1 -5
  7. package/dist/components/Checkbox/index.d.ts +5 -0
  8. package/dist/index.js +21 -23
  9. package/dist/index.js.map +1 -1
  10. package/dist/index100.js +1 -1
  11. package/dist/index100.js.map +1 -1
  12. package/dist/index101.js +1 -1
  13. package/dist/index101.js.map +1 -1
  14. package/dist/index102.js +2 -2
  15. package/dist/index102.js.map +1 -1
  16. package/dist/index103.js +1 -1
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js +2 -2
  19. package/dist/index104.js.map +1 -1
  20. package/dist/index105.js +1 -1
  21. package/dist/index105.js.map +1 -1
  22. package/dist/index106.js +1 -1
  23. package/dist/index106.js.map +1 -1
  24. package/dist/index107.js +1 -1
  25. package/dist/index107.js.map +1 -1
  26. package/dist/index108.js +2 -2
  27. package/dist/index108.js.map +1 -1
  28. package/dist/index109.js +1 -1
  29. package/dist/index109.js.map +1 -1
  30. package/dist/index110.js +2 -2
  31. package/dist/index110.js.map +1 -1
  32. package/dist/index111.js +2 -2
  33. package/dist/index111.js.map +1 -1
  34. package/dist/index112.js +2 -2
  35. package/dist/index112.js.map +1 -1
  36. package/dist/index113.js +2 -2
  37. package/dist/index113.js.map +1 -1
  38. package/dist/index114.js +1 -1
  39. package/dist/index114.js.map +1 -1
  40. package/dist/index115.js +1 -1
  41. package/dist/index115.js.map +1 -1
  42. package/dist/index116.js +1 -1
  43. package/dist/index116.js.map +1 -1
  44. package/dist/index117.js +2 -2
  45. package/dist/index117.js.map +1 -1
  46. package/dist/index118.js +2 -2
  47. package/dist/index118.js.map +1 -1
  48. package/dist/index119.js +2 -2
  49. package/dist/index119.js.map +1 -1
  50. package/dist/index120.js +1 -1
  51. package/dist/index120.js.map +1 -1
  52. package/dist/index121.js +1 -1
  53. package/dist/index121.js.map +1 -1
  54. package/dist/index122.js +1 -1
  55. package/dist/index122.js.map +1 -1
  56. package/dist/index123.js +1 -1
  57. package/dist/index123.js.map +1 -1
  58. package/dist/index124.js +1 -1
  59. package/dist/index124.js.map +1 -1
  60. package/dist/index125.js +1 -1
  61. package/dist/index125.js.map +1 -1
  62. package/dist/index126.js +1 -1
  63. package/dist/index126.js.map +1 -1
  64. package/dist/index127.js +1 -1
  65. package/dist/index127.js.map +1 -1
  66. package/dist/index128.js +2 -2
  67. package/dist/index128.js.map +1 -1
  68. package/dist/index129.js +2 -2
  69. package/dist/index129.js.map +1 -1
  70. package/dist/index130.js +1 -1
  71. package/dist/index130.js.map +1 -1
  72. package/dist/index131.js +1 -1
  73. package/dist/index131.js.map +1 -1
  74. package/dist/index132.js +1 -1
  75. package/dist/index132.js.map +1 -1
  76. package/dist/index133.js +1 -1
  77. package/dist/index133.js.map +1 -1
  78. package/dist/index134.js +1 -1
  79. package/dist/index134.js.map +1 -1
  80. package/dist/index135.js +1 -1
  81. package/dist/index135.js.map +1 -1
  82. package/dist/index136.js +2 -2
  83. package/dist/index136.js.map +1 -1
  84. package/dist/index137.js +1 -1
  85. package/dist/index137.js.map +1 -1
  86. package/dist/index138.js +2 -2
  87. package/dist/index138.js.map +1 -1
  88. package/dist/index139.js +2 -2
  89. package/dist/index139.js.map +1 -1
  90. package/dist/index140.js +2 -2
  91. package/dist/index140.js.map +1 -1
  92. package/dist/index141.js +2 -2
  93. package/dist/index141.js.map +1 -1
  94. package/dist/index142.js +1 -1
  95. package/dist/index142.js.map +1 -1
  96. package/dist/index143.js +1 -1
  97. package/dist/index143.js.map +1 -1
  98. package/dist/index144.js +1 -1
  99. package/dist/index144.js.map +1 -1
  100. package/dist/index145.js +1 -1
  101. package/dist/index145.js.map +1 -1
  102. package/dist/index146.js +1 -1
  103. package/dist/index146.js.map +1 -1
  104. package/dist/index147.js +1 -1
  105. package/dist/index147.js.map +1 -1
  106. package/dist/index148.js +1 -1
  107. package/dist/index148.js.map +1 -1
  108. package/dist/index149.js +1 -1
  109. package/dist/index149.js.map +1 -1
  110. package/dist/index15.js +2 -2
  111. package/dist/index150.js +1 -1
  112. package/dist/index150.js.map +1 -1
  113. package/dist/index151.js +1 -1
  114. package/dist/index151.js.map +1 -1
  115. package/dist/index152.js +1 -1
  116. package/dist/index152.js.map +1 -1
  117. package/dist/index153.js +1 -1
  118. package/dist/index153.js.map +1 -1
  119. package/dist/index154.js +1 -1
  120. package/dist/index154.js.map +1 -1
  121. package/dist/index155.js +1 -1
  122. package/dist/index155.js.map +1 -1
  123. package/dist/index156.js +1 -1
  124. package/dist/index156.js.map +1 -1
  125. package/dist/index157.js +1 -1
  126. package/dist/index157.js.map +1 -1
  127. package/dist/index158.js +1 -1
  128. package/dist/index158.js.map +1 -1
  129. package/dist/index159.js +1 -1
  130. package/dist/index159.js.map +1 -1
  131. package/dist/index160.js +1 -1
  132. package/dist/index160.js.map +1 -1
  133. package/dist/index161.js +1 -1
  134. package/dist/index161.js.map +1 -1
  135. package/dist/index162.js +1 -1
  136. package/dist/index162.js.map +1 -1
  137. package/dist/index163.js +1 -1
  138. package/dist/index163.js.map +1 -1
  139. package/dist/index164.js +1 -1
  140. package/dist/index164.js.map +1 -1
  141. package/dist/index165.js +2 -2
  142. package/dist/index165.js.map +1 -1
  143. package/dist/index166.js +2 -2
  144. package/dist/index166.js.map +1 -1
  145. package/dist/index167.js +1 -1
  146. package/dist/index167.js.map +1 -1
  147. package/dist/index168.js +1 -1
  148. package/dist/index168.js.map +1 -1
  149. package/dist/index169.js +2 -2
  150. package/dist/index169.js.map +1 -1
  151. package/dist/index17.js +1 -1
  152. package/dist/index170.js +2 -2
  153. package/dist/index170.js.map +1 -1
  154. package/dist/index171.js +1 -1
  155. package/dist/index171.js.map +1 -1
  156. package/dist/index172.js +1 -1
  157. package/dist/index172.js.map +1 -1
  158. package/dist/index173.js +1 -1
  159. package/dist/index173.js.map +1 -1
  160. package/dist/index174.js +1 -1
  161. package/dist/index174.js.map +1 -1
  162. package/dist/index175.js +1 -1
  163. package/dist/index175.js.map +1 -1
  164. package/dist/index176.js +1 -1
  165. package/dist/index176.js.map +1 -1
  166. package/dist/index177.js +1 -1
  167. package/dist/index177.js.map +1 -1
  168. package/dist/index178.js +1 -1
  169. package/dist/index178.js.map +1 -1
  170. package/dist/index179.js +2 -2
  171. package/dist/index179.js.map +1 -1
  172. package/dist/index18.js +2 -2
  173. package/dist/index180.js +2 -2
  174. package/dist/index180.js.map +1 -1
  175. package/dist/index181.js +2 -2
  176. package/dist/index181.js.map +1 -1
  177. package/dist/index182.js +149 -2
  178. package/dist/index182.js.map +1 -1
  179. package/dist/index183.js +9 -149
  180. package/dist/index183.js.map +1 -1
  181. package/dist/index184.js +5 -8
  182. package/dist/index184.js.map +1 -1
  183. package/dist/index185.js +4 -5
  184. package/dist/index185.js.map +1 -1
  185. package/dist/index188.js +27 -0
  186. package/dist/index188.js.map +1 -0
  187. package/dist/index189.js +58 -20
  188. package/dist/index189.js.map +1 -1
  189. package/dist/index191.js +1 -1
  190. package/dist/index212.js +1 -1
  191. package/dist/index22.js +66 -65
  192. package/dist/index22.js.map +1 -1
  193. package/dist/index224.js +1 -1
  194. package/dist/index225.js +1 -1
  195. package/dist/index226.js +21 -9
  196. package/dist/index226.js.map +1 -1
  197. package/dist/index227.js +18 -9
  198. package/dist/index227.js.map +1 -1
  199. package/dist/index228.js +9 -4
  200. package/dist/index228.js.map +1 -1
  201. package/dist/index229.js +10 -170
  202. package/dist/index229.js.map +1 -1
  203. package/dist/index230.js +5 -11
  204. package/dist/index230.js.map +1 -1
  205. package/dist/index231.js +170 -22
  206. package/dist/index231.js.map +1 -1
  207. package/dist/index232.js +11 -19
  208. package/dist/index232.js.map +1 -1
  209. package/dist/index24.js +2 -2
  210. package/dist/index24.js.map +1 -1
  211. package/dist/index27.js +1 -1
  212. package/dist/index29.js +39 -37
  213. package/dist/index29.js.map +1 -1
  214. package/dist/index3.js +21 -23
  215. package/dist/index3.js.map +1 -1
  216. package/dist/index34.js +1 -1
  217. package/dist/index36.js +38 -35
  218. package/dist/index36.js.map +1 -1
  219. package/dist/index37.js +5 -4
  220. package/dist/index37.js.map +1 -1
  221. package/dist/index38.js +3 -3
  222. package/dist/index43.js +16 -16
  223. package/dist/index43.js.map +1 -1
  224. package/dist/index44.js +2 -2
  225. package/dist/index45.js +2 -2
  226. package/dist/index48.js +1 -1
  227. package/dist/index49.js +30 -48
  228. package/dist/index49.js.map +1 -1
  229. package/dist/index5.js +113 -113
  230. package/dist/index50.js +2 -2
  231. package/dist/index50.js.map +1 -1
  232. package/dist/index56.js +2 -2
  233. package/dist/index56.js.map +1 -1
  234. package/dist/index6.js +1 -1
  235. package/dist/index63.js +1 -1
  236. package/dist/index64.js +1 -1
  237. package/dist/index66.js +17 -19
  238. package/dist/index66.js.map +1 -1
  239. package/dist/index68.js +5 -55
  240. package/dist/index68.js.map +1 -1
  241. package/dist/index69.js +9 -5
  242. package/dist/index69.js.map +1 -1
  243. package/dist/index71.js +5 -0
  244. package/dist/index71.js.map +1 -0
  245. package/dist/index72.js +2 -2
  246. package/dist/index72.js.map +1 -1
  247. package/dist/index73.js +2 -2
  248. package/dist/index73.js.map +1 -1
  249. package/dist/index74.js +2 -2
  250. package/dist/index74.js.map +1 -1
  251. package/dist/index75.js +1 -1
  252. package/dist/index75.js.map +1 -1
  253. package/dist/index76.js +1 -1
  254. package/dist/index76.js.map +1 -1
  255. package/dist/index77.js +1 -1
  256. package/dist/index77.js.map +1 -1
  257. package/dist/index78.js +1 -1
  258. package/dist/index78.js.map +1 -1
  259. package/dist/index79.js +1 -1
  260. package/dist/index79.js.map +1 -1
  261. package/dist/index8.js +5 -5
  262. package/dist/index8.js.map +1 -1
  263. package/dist/index80.js +1 -1
  264. package/dist/index80.js.map +1 -1
  265. package/dist/index81.js +1 -1
  266. package/dist/index81.js.map +1 -1
  267. package/dist/index82.js +1 -1
  268. package/dist/index82.js.map +1 -1
  269. package/dist/index83.js +1 -1
  270. package/dist/index83.js.map +1 -1
  271. package/dist/index84.js +1 -1
  272. package/dist/index84.js.map +1 -1
  273. package/dist/index85.js +1 -1
  274. package/dist/index85.js.map +1 -1
  275. package/dist/index86.js +1 -1
  276. package/dist/index86.js.map +1 -1
  277. package/dist/index87.js +1 -1
  278. package/dist/index87.js.map +1 -1
  279. package/dist/index88.js +1 -1
  280. package/dist/index88.js.map +1 -1
  281. package/dist/index89.js +1 -1
  282. package/dist/index89.js.map +1 -1
  283. package/dist/index90.js +1 -1
  284. package/dist/index90.js.map +1 -1
  285. package/dist/index91.js +1 -1
  286. package/dist/index91.js.map +1 -1
  287. package/dist/index92.js +1 -1
  288. package/dist/index92.js.map +1 -1
  289. package/dist/index93.js +1 -1
  290. package/dist/index93.js.map +1 -1
  291. package/dist/index94.js +1 -1
  292. package/dist/index94.js.map +1 -1
  293. package/dist/index95.js +1 -1
  294. package/dist/index95.js.map +1 -1
  295. package/dist/index96.js +1 -1
  296. package/dist/index96.js.map +1 -1
  297. package/dist/index97.js +2 -2
  298. package/dist/index97.js.map +1 -1
  299. package/dist/index98.js +1 -1
  300. package/dist/index98.js.map +1 -1
  301. package/dist/index99.js +2 -2
  302. package/dist/index99.js.map +1 -1
  303. package/package.json +1 -1
  304. package/dist/index186.js +0 -8
  305. package/dist/index186.js.map +0 -1
  306. package/dist/index70.js +0 -12
  307. package/dist/index70.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index183.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;A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AAAA,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]}
1
+ {"version":3,"file":"index183.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/index184.js CHANGED
@@ -1,12 +1,9 @@
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;
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;
8
5
  }
9
6
  export {
10
- n as isElementVisible
7
+ u as useStableId
11
8
  };
12
9
  //# sourceMappingURL=index184.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index184.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":"index184.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;"}
package/dist/index185.js CHANGED
@@ -1,9 +1,8 @@
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 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;
5
4
  }
6
5
  export {
7
- u as useStableId
6
+ o as mergeIds
8
7
  };
9
8
  //# sourceMappingURL=index185.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index185.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":"index185.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;"}
@@ -0,0 +1,27 @@
1
+ import * as e from "react";
2
+ function p({
3
+ disabled: t = !1,
4
+ onFocusIn: u,
5
+ onFocusOut: n,
6
+ onEscape: a,
7
+ closeOnEscape: c = !0
8
+ }) {
9
+ const f = e.useCallback((r) => {
10
+ t || u?.();
11
+ }, [t, u]), s = e.useCallback((r) => {
12
+ if (t) return;
13
+ const o = r.relatedTarget;
14
+ o && r.currentTarget.contains(o) || n?.();
15
+ }, [t, n]), C = e.useCallback((r) => {
16
+ t || !c || r.key !== "Escape" || (r.preventDefault(), a?.());
17
+ }, [t, c, a]);
18
+ return {
19
+ onFocusCapture: f,
20
+ onBlurCapture: s,
21
+ onKeyDownCapture: C
22
+ };
23
+ }
24
+ export {
25
+ p as useDismissOnFocusOut
26
+ };
27
+ //# sourceMappingURL=index188.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index188.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;"}
package/dist/index189.js CHANGED
@@ -1,27 +1,65 @@
1
- import * as e from "react";
2
- function p({
3
- disabled: t = !1,
4
- onFocusIn: u,
5
- onFocusOut: n,
6
- onEscape: a,
7
- closeOnEscape: c = !0
1
+ import * as o from "react";
2
+ function w({
3
+ itemIds: t,
4
+ tabIndex: p = 0,
5
+ defaultFocusedId: l,
6
+ orientation: f = "horizontal",
7
+ loop: u = !0,
8
+ onFocusChange: h
8
9
  }) {
9
- const f = e.useCallback((r) => {
10
- t || u?.();
11
- }, [t, u]), s = e.useCallback((r) => {
12
- if (t) return;
13
- const o = r.relatedTarget;
14
- o && r.currentTarget.contains(o) || n?.();
15
- }, [t, n]), C = e.useCallback((r) => {
16
- t || !c || r.key !== "Escape" || (r.preventDefault(), a?.());
17
- }, [t, c, a]);
10
+ const [a, g] = o.useState(l || t[0] || ""), k = o.useRef({});
11
+ o.useEffect(() => {
12
+ if (t.length > 0 && !t.includes(a)) {
13
+ const e = l || t[0] || "";
14
+ g(e);
15
+ }
16
+ }, [t, a, l]);
17
+ const v = o.useCallback((e) => {
18
+ g(e), h?.(e);
19
+ }, [h]), s = o.useCallback((e) => {
20
+ if (t.length === 0) return;
21
+ const c = t.indexOf(a), n = Math.max(0, c);
22
+ let r = n;
23
+ switch (e) {
24
+ case "first":
25
+ r = 0;
26
+ break;
27
+ case "last":
28
+ r = t.length - 1;
29
+ break;
30
+ case "prev":
31
+ u ? r = (n - 1 + t.length) % t.length : r = Math.max(0, n - 1);
32
+ break;
33
+ case "next":
34
+ u ? r = (n + 1) % t.length : r = Math.min(t.length - 1, n + 1);
35
+ break;
36
+ }
37
+ const x = t[r];
38
+ x && k.current[x]?.focus();
39
+ }, [t, a, u]), i = o.useCallback((e) => ({
40
+ ref: (c) => {
41
+ k.current[e] = c;
42
+ },
43
+ tabIndex: a === e ? p : -1
44
+ }), [a, p]), b = o.useCallback((e) => {
45
+ if (e.key === "Home") {
46
+ e.preventDefault(), e.stopPropagation(), s("first");
47
+ return;
48
+ }
49
+ if (e.key === "End") {
50
+ e.preventDefault(), e.stopPropagation(), s("last");
51
+ return;
52
+ }
53
+ const c = f === "horizontal" ? "ArrowLeft" : "ArrowUp", n = f === "horizontal" ? "ArrowRight" : "ArrowDown";
54
+ e.key === c ? (e.preventDefault(), e.stopPropagation(), s("prev")) : e.key === n && (e.preventDefault(), e.stopPropagation(), s("next"));
55
+ }, [f, s]);
18
56
  return {
19
- onFocusCapture: f,
20
- onBlurCapture: s,
21
- onKeyDownCapture: C
57
+ setFocusedId: v,
58
+ handleKeyDown: b,
59
+ getRovingItemProps: i
22
60
  };
23
61
  }
24
62
  export {
25
- p as useDismissOnFocusOut
63
+ w as useRovingFocus
26
64
  };
27
65
  //# sourceMappingURL=index189.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index189.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":"index189.js","sources":["../src/utils/a11y/useRovingFocus.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type RovingDirection = 'prev' | 'next' | 'first' | 'last';\n\nexport interface UseRovingFocusOptions {\n /**\n * Array of item IDs in order\n */\n itemIds: string[];\n\n /**\n * The tabIndex to apply to the currently focused item in the roving group.\n * Defaults to 0 \n */\n tabIndex?: number;\n\n /**\n * Initial focused item ID. Defaults to first item.\n */\n defaultFocusedId?: string;\n\n /**\n * Orientation for arrow key mapping.\n * - horizontal: ArrowLeft/ArrowRight\n * - vertical: ArrowUp/ArrowDown\n */\n orientation?: 'horizontal' | 'vertical';\n\n /**\n * Whether navigation wraps around at ends. Defaults to true.\n */\n loop?: boolean;\n\n /**\n * Callback when focus changes\n */\n onFocusChange?: (id: string) => void;\n}\n\nexport interface RovingItemProps {\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n}\n\nexport interface UseRovingFocusReturn {\n /**\n * Set focused item ID manually\n */\n setFocusedId: (id: string) => void;\n\n /**\n * Keyboard handler for arrow/Home/End navigation.\n * Attach to each item's onKeyDown.\n */\n handleKeyDown: (e: React.KeyboardEvent) => void;\n\n /**\n * Get props for an item in the roving focus group (ref + tabIndex)\n */\n getRovingItemProps: (id: string) => RovingItemProps;\n}\n\n/**\n * Hook for managing roving focus pattern (roving tabindex).\n * Reusable for composite widgets: tabs, toolbars, menus, listboxes, radio groups.\n *\n * @example\n * const { getRovingItemProps, handleKeyDown } = useRovingFocus({\n * itemIds: ['tab1', 'tab2', 'tab3'],\n * orientation: 'horizontal'\n * });\n *\n * // In render:\n * <button {...getRovingItemProps('tab1')} onKeyDown={handleKeyDown}>Tab 1</button>\n */\nexport function useRovingFocus({\n itemIds,\n tabIndex = 0,\n defaultFocusedId,\n orientation = 'horizontal',\n loop = true,\n onFocusChange\n}: UseRovingFocusOptions): UseRovingFocusReturn {\n const [focusedId, setFocusedIdState] = React.useState<string>(\n defaultFocusedId || itemIds[0] || ''\n );\n\n const itemRefs = React.useRef<Record<string, HTMLElement | null>>({});\n\n // Sync focusedId if itemIds change and current focusedId is no longer valid\n React.useEffect(() => {\n if (itemIds.length > 0 && !itemIds.includes(focusedId)) {\n const newFocusedId = defaultFocusedId || itemIds[0] || '';\n setFocusedIdState(newFocusedId);\n }\n }, [itemIds, focusedId, defaultFocusedId]);\n\n const setFocusedId = React.useCallback(\n (id: string) => {\n setFocusedIdState(id);\n onFocusChange?.(id);\n },\n [onFocusChange]\n );\n\n const moveFocus = React.useCallback(\n (direction: RovingDirection) => {\n if (itemIds.length === 0) return;\n\n const currentIdx = itemIds.indexOf(focusedId);\n const safeIdx = Math.max(0, currentIdx);\n let nextIdx = safeIdx;\n\n switch (direction) {\n case 'first':\n nextIdx = 0;\n break;\n case 'last':\n nextIdx = itemIds.length - 1;\n break;\n case 'prev':\n if (loop) {\n nextIdx = (safeIdx - 1 + itemIds.length) % itemIds.length;\n } else {\n nextIdx = Math.max(0, safeIdx - 1);\n }\n break;\n case 'next':\n if (loop) {\n nextIdx = (safeIdx + 1) % itemIds.length;\n } else {\n nextIdx = Math.min(itemIds.length - 1, safeIdx + 1);\n }\n break;\n }\n\n const nextId = itemIds[nextIdx];\n if (!nextId) return;\n\n // Focus the element\n itemRefs.current[nextId]?.focus();\n // Note: We don't call setFocusedId here because the element's onFocus\n // should handle that (follows \"focus follows DOM focus\" pattern)\n },\n [itemIds, focusedId, loop]\n );\n\n const getRovingItemProps = React.useCallback(\n (id: string): RovingItemProps => ({\n ref: (el: HTMLElement | null) => {\n itemRefs.current[id] = el;\n },\n tabIndex: focusedId === id ? tabIndex : -1\n }),\n [focusedId, tabIndex]\n );\n\n // Keyboard handler for arrow/Home/End navigation\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Home') {\n e.preventDefault();\n e.stopPropagation();\n moveFocus('first');\n return;\n }\n if (e.key === 'End') {\n e.preventDefault();\n e.stopPropagation();\n moveFocus('last');\n return;\n }\n\n const prevKey = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n\n if (e.key === prevKey) {\n e.preventDefault();\n e.stopPropagation();\n moveFocus('prev');\n } else if (e.key === nextKey) {\n e.preventDefault();\n e.stopPropagation();\n moveFocus('next');\n }\n },\n [orientation, moveFocus]\n );\n\n return {\n setFocusedId,\n handleKeyDown,\n getRovingItemProps\n };\n}\n"],"names":["React","useRovingFocus","itemIds","tabIndex","defaultFocusedId","orientation","loop","onFocusChange","focusedId","setFocusedIdState","useState","itemRefs","useRef","useEffect","length","includes","newFocusedId","setFocusedId","useCallback","id","moveFocus","direction","currentIdx","indexOf","safeIdx","Math","max","nextIdx","min","nextId","current","focus","getRovingItemProps","ref","el","handleKeyDown","e","key","preventDefault","stopPropagation","prevKey","nextKey"],"mappings":"AA2EO,YAAAA,OAAA;AAAA,SAASC,EAAe;AAAA,EAC7BC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,kBAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,MAAAA,IAAO;AAAA,EACPC,eAAAA;AACqB,GAAyB;AAC9C,QAAM,CAACC,GAAWC,CAAiB,IAAIT,EAAMU,SAC3CN,KAAoBF,EAAQ,CAAC,KAAK,EACpC,GAEMS,IAAWX,EAAMY,OAA2C,EAAE;AAGpEZ,EAAAA,EAAMa,UAAU,MAAM;A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AAUK,MAAcW,IAAKhB,IAAW;AAAA,EAAA,IAE1C,CAACK,GAAWL,CAAQ,CACtB,GAGMgC,IAAgBnC,EAAMkB,YAC1B,CAACkB,MAA2B;AAC1B,QAAIA,EAAEC,QAAQ,QAAQ;AACpBD,QAAEE,eAAAA,GACFF,EAAEG,gBAAAA,GACFnB,EAAU,OAAO;AACjB;AAAA,IACF;AACA,QAAIgB,EAAEC,QAAQ,OAAO;AACnBD,QAAEE,eAAAA,GACFF,EAAEG,gBAAAA,GACFnB,EAAU,MAAM;AAChB;AAAA,IACF;AAEA,UAAMoB,IAAUnC,MAAgB,eAAe,cAAc,WACvDoC,IAAUpC,MAAgB,eAAe,eAAe;AAE9D,IAAI+B,EAAEC,QAAQG,KACZJ,EAAEE,eAAAA,GACFF,EAAEG,gBAAAA,GACFnB,EAAU,MAAM,KACPgB,EAAEC,QAAQI,MACnBL,EAAEE,eAAAA,GACFF,EAAEG,gBAAAA,GACFnB,EAAU,MAAM;AAAA,EAEpB,GACA,CAACf,GAAae,CAAS,CACzB;AAEA,SAAO;AAAA,IACLH,cAAAA;AAAAA,IACAkB,eAAAA;AAAAA,IACAH,oBAAAA;AAAAA,EAAAA;AAEJ;"}
package/dist/index191.js CHANGED
@@ -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 "./index225.js";
3
- import { useDismissOnFocusOut as R } from "./index189.js";
3
+ import { useDismissOnFocusOut as R } from "./index188.js";
4
4
  function M({
5
5
  items: l,
6
6
  isOpen: t,
package/dist/index212.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useCallback as d } from "react";
2
- import { useRovingFocus as g } from "./index68.js";
2
+ import { useRovingFocus as g } from "./index189.js";
3
3
  const u = (e, t) => `tab${t ? `-${t}` : ""}-${e}`, c = (e, t) => `panel${t ? `-${t}` : ""}-${e}`;
4
4
  function P({
5
5
  itemIds: e,
package/dist/index22.js CHANGED
@@ -1,82 +1,83 @@
1
- import i, { useState as D, useEffect as O } from "react";
2
- import { useStableId as S } from "./index185.js";
3
- import { getA11yNameAttributes as _ } from "./index70.js";
4
- import { mergeIds as $ } from "./index186.js";
1
+ import s, { useState as S, useEffect as _ } from "react";
2
+ import { useStableId as $ } from "./index184.js";
3
+ import { getA11yNameAttributes as j } from "./index69.js";
4
+ import { mergeIds as B } from "./index185.js";
5
5
  /* empty css */
6
- function b() {
7
- return b = Object.assign ? Object.assign.bind() : function(s) {
8
- for (var a = 1; a < arguments.length; a++) {
9
- var n = arguments[a];
10
- for (var e in n) ({}).hasOwnProperty.call(n, e) && (s[e] = n[e]);
6
+ function d() {
7
+ return d = Object.assign ? Object.assign.bind() : function(l) {
8
+ for (var c = 1; c < arguments.length; c++) {
9
+ var r = arguments[c];
10
+ for (var e in r) ({}).hasOwnProperty.call(r, e) && (l[e] = r[e]);
11
11
  }
12
- return s;
13
- }, b.apply(null, arguments);
12
+ return l;
13
+ }, d.apply(null, arguments);
14
14
  }
15
- const F = ({
16
- className: s = "",
17
- automationId: a = "",
18
- defaultChecked: n = !1,
19
- disabled: e = !1,
20
- onChange: d,
21
- checkMarkType: r = "",
22
- label: h = "",
23
- disabledLabel: f = "",
24
- containerAutomationId: g = "",
25
- ariaLabel: p,
26
- ariaLabelledBy: E,
27
- ariaDescribedBy: v
15
+ const z = ({
16
+ className: l = "",
17
+ automationId: c = "",
18
+ defaultChecked: r = !1,
19
+ checked: e,
20
+ disabled: n = !1,
21
+ onChange: h,
22
+ checkMarkType: i = "",
23
+ label: x = "",
24
+ disabledLabel: g = "",
25
+ containerAutomationId: v = "",
26
+ ariaLabel: E,
27
+ ariaLabelledBy: y,
28
+ ariaDescribedBy: C
28
29
  }) => {
29
- const [t, u] = D(n);
30
- O(() => {
31
- u(n);
32
- }, [n]);
33
- const y = (c) => {
34
- e || (u((o) => !o), d?.(!t, c));
35
- }, N = (c) => {
36
- if (!e && (c.key === "Enter" || c.key === " ")) {
37
- c.preventDefault(), c.stopPropagation();
38
- const o = !t;
39
- u(o);
40
- const m = c.currentTarget.closest("label")?.querySelector("input");
41
- m && d?.(o, {
42
- target: m,
43
- currentTarget: m
30
+ const o = e !== void 0, [t, u] = S(o ? e : r);
31
+ _(() => {
32
+ u(o ? e : r);
33
+ }, [e, r]);
34
+ const N = (a) => {
35
+ n || (o || u((m) => !m), h?.(o ? !e : !t, a));
36
+ }, I = (a) => {
37
+ if (!n && (a.key === "Enter" || a.key === " ")) {
38
+ a.preventDefault(), a.stopPropagation();
39
+ const m = o ? !e : !t;
40
+ o || u(m);
41
+ const f = a.currentTarget.closest("label")?.querySelector("input");
42
+ f && h?.(m, {
43
+ target: f,
44
+ currentTarget: f
44
45
  });
45
46
  }
46
- }, C = () => e ? t && r === "tick" ? "disabled-tick" : t && r === "minus-checkbox" ? "disabled-minus-checkbox" : t && !r ? "disabled-tick" : "disabled-default" : r === "minus-checkbox" && t ? "minus-checkbox" : t ? "checked" : "unchecked", I = () => e ? "checkbox-label-disabled" : "checkbox-label", x = () => e && f ? f : h, l = S(void 0, "checkbox-input"), k = h ? `${l}-label` : void 0, w = _({
47
- ariaLabelledBy: $(k, E),
48
- ariaLabel: p,
49
- ariaDescribedBy: v
50
- }), A = () => r === "minus-checkbox" && t ? "mixed" : t ? "true" : "false";
51
- return /* @__PURE__ */ i.createElement("div", {
47
+ }, w = () => n ? t && i === "tick" ? "disabled-tick" : t && i === "minus-checkbox" ? "disabled-minus-checkbox" : t && !i ? "disabled-tick" : "disabled-default" : i === "minus-checkbox" && t ? "minus-checkbox" : t ? "checked" : "unchecked", A = () => n ? "checkbox-label-disabled" : "checkbox-label", k = () => n && g ? g : x, b = $(void 0, "checkbox-input"), p = x ? `${b}-label` : void 0, D = j({
48
+ ariaLabelledBy: B(p, y),
49
+ ariaLabel: E,
50
+ ariaDescribedBy: C
51
+ }), O = () => i === "minus-checkbox" && t ? "mixed" : t ? "true" : "false";
52
+ return /* @__PURE__ */ s.createElement("div", {
52
53
  className: "se-design-checkbox-ctn"
53
- }, /* @__PURE__ */ i.createElement("label", b({
54
+ }, /* @__PURE__ */ s.createElement("label", d({
54
55
  role: "checkbox",
55
- htmlFor: l,
56
- className: `se-design-checkbox ${s} ${C()}`,
57
- "data-automation-id": g || "checkbox-container",
58
- tabIndex: e ? -1 : 0,
59
- "aria-checked": A(),
60
- "aria-disabled": e ? "true" : "false"
61
- }, w, {
62
- onKeyDown: N
63
- }), /* @__PURE__ */ i.createElement("input", {
64
- id: l,
56
+ htmlFor: b,
57
+ className: `se-design-checkbox ${l} ${w()}`,
58
+ "data-automation-id": v || "checkbox-container",
59
+ tabIndex: n ? -1 : 0,
60
+ "aria-checked": O(),
61
+ "aria-disabled": n ? "true" : "false"
62
+ }, D, {
63
+ onKeyDown: I
64
+ }), /* @__PURE__ */ s.createElement("input", {
65
+ id: b,
65
66
  type: "checkbox",
66
67
  checked: t,
67
- onChange: y,
68
- disabled: e,
68
+ onChange: N,
69
+ disabled: n,
69
70
  "aria-hidden": "true"
70
- }), /* @__PURE__ */ i.createElement("span", {
71
+ }), /* @__PURE__ */ s.createElement("span", {
71
72
  className: "checkbox-item",
72
- "data-automation-id": a
73
- }), x()?.length > 0 && /* @__PURE__ */ i.createElement("span", {
74
- id: k,
75
- className: I(),
73
+ "data-automation-id": c
74
+ }), k()?.length > 0 && /* @__PURE__ */ s.createElement("span", {
75
+ id: p,
76
+ className: A(),
76
77
  "data-automation-id": "checkbox-label"
77
- }, x())));
78
+ }, k())));
78
79
  };
79
80
  export {
80
- F as Checkbox
81
+ z as Checkbox
81
82
  };
82
83
  //# sourceMappingURL=index22.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index22.js","sources":["../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect } from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport { mergeIds } from '../../utils/mergeIds';\nimport './style.scss';\n\nexport interface CheckboxProps {\n className?: string;\n automationId?: string;\n defaultChecked?: boolean;\n onChange?: (checked: boolean, e: React.ChangeEvent<HTMLInputElement>) => void;\n disabled?: boolean;\n checkMarkType?: 'tick' | 'minus-checkbox' | '';\n label?: string;\n disabledLabel?: string;\n containerAutomationId?: string;\n /**\n * Explicit accessible name for the checkbox.\n * Used as fallback when ariaLabelledBy is not provided and no internal label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this checkbox (for screen reader association).\n * Typically used when checkbox is part of a larger labelled context.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this checkbox (provides additional context).\n * Often used for help text or instructions.\n */\n ariaDescribedBy?: string;\n}\n\nexport const Checkbox: FC<CheckboxProps> = ({\n className = '',\n automationId = '',\n defaultChecked = false,\n disabled = false,\n onChange,\n checkMarkType = '',\n label = '',\n disabledLabel = '',\n containerAutomationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n}) => {\n const [isChecked, setIsChecked] = useState(defaultChecked);\n\n useEffect(() => {\n setIsChecked(defaultChecked);\n }, [defaultChecked]);\n\n const handleClick = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n setIsChecked((prev) => (checkMarkType === 'minus-checkbox' ? !prev : !prev));\n onChange?.(!isChecked, e);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLLabelElement | HTMLSpanElement>) => {\n if (disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const newChecked = !isChecked;\n setIsChecked(newChecked);\n \n // Create a proper synthetic event for the onChange callback\n const inputElement = e.currentTarget.closest('label')?.querySelector('input');\n if (inputElement) {\n const syntheticEvent = {\n target: inputElement,\n currentTarget: inputElement,\n } as React.ChangeEvent<HTMLInputElement>;\n onChange?.(newChecked, syntheticEvent);\n }\n }\n };\n\n const getCheckBoxClassName = () => {\n // Handle disabled states with proper checked status\n if (disabled) {\n if (isChecked && checkMarkType === 'tick') return 'disabled-tick';\n if (isChecked && checkMarkType === 'minus-checkbox') return 'disabled-minus-checkbox';\n if (isChecked && !checkMarkType) return 'disabled-tick'; // Default to tick for checked disabled\n return 'disabled-default'; // Unchecked disabled\n }\n\n // Handle enabled states\n if (checkMarkType === 'minus-checkbox' && isChecked) return 'minus-checkbox';\n return isChecked ? 'checked' : 'unchecked';\n };\n\n const getLabelClassName = () => {\n return disabled ? 'checkbox-label-disabled' : 'checkbox-label';\n };\n\n const getLabelText = () => {\n if (disabled && disabledLabel) {\n return disabledLabel;\n }\n return label;\n };\n \n // Generate stable IDs (persists across renders)\n const inputId = useStableId(undefined, 'checkbox-input');\n const labelId = label ? `${inputId}-label` : undefined;\n\n const a11yNameAttributes = getA11yNameAttributes({\n ariaLabelledBy: mergeIds(labelId, ariaLabelledBy),\n ariaLabel,\n ariaDescribedBy\n });\n\n // Determine aria-checked value: \"mixed\" for indeterminate, \"true\" for checked, \"false\" for unchecked\n const getAriaChecked = () => {\n if (checkMarkType === 'minus-checkbox' && isChecked) {\n return 'mixed'; // Indeterminate/half-checked state\n }\n return isChecked ? 'true' : 'false';\n };\n\n return (\n <div className=\"se-design-checkbox-ctn\">\n <label\n role=\"checkbox\"\n htmlFor={inputId}\n className={`se-design-checkbox ${className} ${getCheckBoxClassName()}`}\n data-automation-id={containerAutomationId || 'checkbox-container'}\n tabIndex={disabled ? -1 : 0}\n aria-checked={getAriaChecked()}\n aria-disabled={disabled ? 'true' : 'false'}\n {...a11yNameAttributes}\n onKeyDown={handleKeyDown}\n >\n <input\n id={inputId}\n type=\"checkbox\"\n checked={isChecked}\n onChange={handleClick}\n disabled={disabled}\n aria-hidden=\"true\"\n />\n <span className=\"checkbox-item\" data-automation-id={automationId}></span>\n {getLabelText()?.length > 0 && (\n <span id={labelId} className={getLabelClassName()} data-automation-id=\"checkbox-label\">\n {getLabelText()}\n </span>\n )}\n </label>\n </div>\n );\n};\n"],"names":["Checkbox","className","automationId","defaultChecked","disabled","onChange","checkMarkType","label","disabledLabel","containerAutomationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","isChecked","setIsChecked","useState","useEffect","handleClick","e","prev","handleKeyDown","key","preventDefault","stopPropagation","newChecked","inputElement","currentTarget","closest","querySelector","target","getCheckBoxClassName","getLabelClassName","getLabelText","inputId","useStableId","undefined","labelId","a11yNameAttributes","getA11yNameAttributes","mergeIds","getAriaChecked","React","createElement","_extends","role","htmlFor","tabIndex","onKeyDown","id","type","checked","length"],"mappings":";;;;;;;;;;;;;;AAiCO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,gBAAAA,IAAiB;AAAA,EACjBC,UAAAA,IAAW;AAAA,EACXC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,OAAAA,IAAQ;AAAA,EACRC,eAAAA,IAAgB;AAAA,EAChBC,uBAAAA,IAAwB;AAAA,EACxBC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AACF,MAAM;AACJ,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAASZ,CAAc;AAEzDa,EAAAA,EAAU,MAAM;AACdF,IAAAA,EAAaX,CAAc;AAAA,EAC7B,GAAG,CAACA,CAAc,CAAC;AAEnB,QAAMc,IAAcA,CAACC,MAA2C;AAC9D,IAAId,MACJU,EAAcK,OAA+C,CAACA,CAAa,GAC3Ed,IAAW,CAACQ,GAAWK,CAAC;AAAA,EAC1B,GAEME,IAAgBA,CAACF,MAA+D;AACpF,QAAId,CAAAA,MACAc,EAAEG,QAAQ,WAAWH,EAAEG,QAAQ,MAAK;AACtCH,MAAAA,EAAEI,eAAAA,GACFJ,EAAEK,gBAAAA;AACF,YAAMC,IAAa,CAACX;AACpBC,MAAAA,EAAaU,CAAU;AAGvB,YAAMC,IAAeP,EAAEQ,cAAcC,QAAQ,OAAO,GAAGC,cAAc,OAAO;AAC5E,MAAIH,KAKFpB,IAAWmB,GAJY;AAAA,QACrBK,QAAQJ;AAAAA,QACRC,eAAeD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AoBC;AAAAA,EAAAA,CAAoB,GACvE8B,EAAAA,GAAgBmB,SAAS,KACxBV,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMM,IAAIZ;AAAAA,IAASnC,WAAW8B,EAAAA;AAAAA,IAAqB,sBAAmB;AAAA,EAAA,GACnEC,EAAAA,CACG,CAEH,CACJ;AAET;"}
1
+ {"version":3,"file":"index22.js","sources":["../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect } from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport { mergeIds } from '../../utils/mergeIds';\nimport './style.scss';\n\nexport interface CheckboxProps {\n className?: string;\n automationId?: string;\n defaultChecked?: boolean;\n /**\n * Controlled checked value. When provided, the checkbox is controlled by the parent\n * and its visual state always reflects this prop. Use `onChange` to update the parent state.\n */\n checked?: boolean;\n onChange?: (checked: boolean, e: React.ChangeEvent<HTMLInputElement>) => void;\n disabled?: boolean;\n checkMarkType?: 'tick' | 'minus-checkbox' | '';\n label?: string;\n disabledLabel?: string;\n containerAutomationId?: string;\n /**\n * Explicit accessible name for the checkbox.\n * Used as fallback when ariaLabelledBy is not provided and no internal label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this checkbox (for screen reader association).\n * Typically used when checkbox is part of a larger labelled context.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this checkbox (provides additional context).\n * Often used for help text or instructions.\n */\n ariaDescribedBy?: string;\n}\n\nexport const Checkbox: FC<CheckboxProps> = ({\n className = '',\n automationId = '',\n defaultChecked = false,\n checked,\n disabled = false,\n onChange,\n checkMarkType = '',\n label = '',\n disabledLabel = '',\n containerAutomationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n}) => {\n const isControlled = checked !== undefined;\n const [isChecked, setIsChecked] = useState(isControlled ? checked : defaultChecked);\n\n useEffect(() => {\n if (isControlled) {\n setIsChecked(checked!);\n } else {\n setIsChecked(defaultChecked);\n }\n }, [checked, defaultChecked]);\n\n const handleClick = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n if (!isControlled) {\n setIsChecked((prev) => !prev);\n }\n onChange?.(isControlled ? !checked : !isChecked, e);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLLabelElement | HTMLSpanElement>) => {\n if (disabled) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n const newChecked = isControlled ? !checked : !isChecked;\n if (!isControlled) {\n setIsChecked(newChecked);\n }\n\n // Create a proper synthetic event for the onChange callback\n const inputElement = e.currentTarget.closest('label')?.querySelector('input');\n if (inputElement) {\n const syntheticEvent = {\n target: inputElement,\n currentTarget: inputElement,\n } as React.ChangeEvent<HTMLInputElement>;\n onChange?.(newChecked, syntheticEvent);\n }\n }\n };\n\n const getCheckBoxClassName = () => {\n // Handle disabled states with proper checked status\n if (disabled) {\n if (isChecked && checkMarkType === 'tick') return 'disabled-tick';\n if (isChecked && checkMarkType === 'minus-checkbox') return 'disabled-minus-checkbox';\n if (isChecked && !checkMarkType) return 'disabled-tick'; // Default to tick for checked disabled\n return 'disabled-default'; // Unchecked disabled\n }\n\n // Handle enabled states\n if (checkMarkType === 'minus-checkbox' && isChecked) return 'minus-checkbox';\n return isChecked ? 'checked' : 'unchecked';\n };\n\n const getLabelClassName = () => {\n return disabled ? 'checkbox-label-disabled' : 'checkbox-label';\n };\n\n const getLabelText = () => {\n if (disabled && disabledLabel) {\n return disabledLabel;\n }\n return label;\n };\n \n // Generate stable IDs (persists across renders)\n const inputId = useStableId(undefined, 'checkbox-input');\n const labelId = label ? `${inputId}-label` : undefined;\n\n const a11yNameAttributes = getA11yNameAttributes({\n ariaLabelledBy: mergeIds(labelId, ariaLabelledBy),\n ariaLabel,\n ariaDescribedBy\n });\n\n // Determine aria-checked value: \"mixed\" for indeterminate, \"true\" for checked, \"false\" for unchecked\n const getAriaChecked = () => {\n if (checkMarkType === 'minus-checkbox' && isChecked) {\n return 'mixed'; // Indeterminate/half-checked state\n }\n return isChecked ? 'true' : 'false';\n };\n\n return (\n <div className=\"se-design-checkbox-ctn\">\n <label\n role=\"checkbox\"\n htmlFor={inputId}\n className={`se-design-checkbox ${className} ${getCheckBoxClassName()}`}\n data-automation-id={containerAutomationId || 'checkbox-container'}\n tabIndex={disabled ? -1 : 0}\n aria-checked={getAriaChecked()}\n aria-disabled={disabled ? 'true' : 'false'}\n {...a11yNameAttributes}\n onKeyDown={handleKeyDown}\n >\n <input\n id={inputId}\n type=\"checkbox\"\n checked={isChecked}\n onChange={handleClick}\n disabled={disabled}\n aria-hidden=\"true\"\n />\n <span className=\"checkbox-item\" data-automation-id={automationId}></span>\n {getLabelText()?.length > 0 && (\n <span id={labelId} className={getLabelClassName()} data-automation-id=\"checkbox-label\">\n {getLabelText()}\n </span>\n )}\n </label>\n </div>\n );\n};\n"],"names":["Checkbox","className","automationId","defaultChecked","checked","disabled","onChange","checkMarkType","label","disabledLabel","containerAutomationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","isControlled","undefined","isChecked","setIsChecked","useState","useEffect","handleClick","e","prev","handleKeyDown","key","preventDefault","stopPropagation","newChecked","inputElement","currentTarget","closest","querySelector","target","getCheckBoxClassName","getLabelClassName","getLabelText","inputId","useStableId","labelId","a11yNameAttributes","getA11yNameAttributes","mergeIds","getAriaChecked","React","createElement","_extends","role","htmlFor","tabIndex","onKeyDown","id","type","length"],"mappings":";;;;;;;;;;;;;;AAsCO,MAAMA,IAA8BA,CAAC;AAAA,EAC1CC,WAAAA,IAAY;AAAA,EACZC,cAAAA,IAAe;AAAA,EACfC,gBAAAA,IAAiB;AAAA,EACjBC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,OAAAA,IAAQ;AAAA,EACRC,eAAAA,IAAgB;AAAA,EAChBC,uBAAAA,IAAwB;AAAA,EACxBC,WAAA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,EAASH,GAAS1B,CAAc;AAAA,IAChDD,WAAAA;AAAAA,IACAE,iBAAAA;AAAAA,EAAAA,CACD,GAGK6B,IAAiBA,MACjBnC,MAAkB,oBAAoBS,IACjC,UAEFA,IAAY,SAAS;AAG9B,SACE2B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAK3C,WAAU;AAAA,EAAA,GACb0C,gBAAAA,EAAAC,cAAA,SAAAC,EAAA;AAAA,IACEC,MAAK;AAAA,IACLC,SAASX;AAAAA,IACTnC,WAAW,sBAAsBA,CAAS,IAAIgC,GAAsB;AAAA,IACpE,sBAAoBvB,KAAyB;AAAA,IAC7CsC,UAAU3C,IAAW,KAAK;AAAA,IAC1B,gBAAcqC,EAAAA;AAAAA,IACd,iBAAerC,IAAW,SAAS;AAAA,EAAA,GAC/BkC,GAAkB;AAAA,IACtBU,WAAW1B;AAAAA,EAAAA,CAAc,GAEzBoB,gBAAAA,EAAAC,cAAA,SAAA;AAAA,IACEM,IAAId;AAAAA,IACJe,MAAK;AAAA,IACL/C,SAASY;AAAAA,IACTV,UAAUc;AAAAA,IACVf,UAAAA;AAAAA,IACA,eAAY;AAAA,EAAA,CACb,GACDsC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAM3C,WAAU;AAAA,IAAgB,sBAAoBC;AAAAA,EAAAA,CAAoB,GACvEiC,EAAAA,GAAgBiB,SAAS,KACxBT,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMM,IAAIZ;AAAAA,IAASrC,WAAWiC,EAAAA;AAAAA,IAAqB,sBAAmB;AAAA,EAAA,GACnEC,EAAAA,CACG,CAEH,CACJ;AAET;"}
package/dist/index224.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useRef as E, useLayoutEffect as f } from "react";
2
- import { getFirstFocusableElement as d, getFocusableElements as g } from "./index231.js";
2
+ import { getFirstFocusableElement as d, getFocusableElements as g } from "./index226.js";
3
3
  function y(e, t) {
4
4
  return t === "first" ? d({
5
5
  container: e
package/dist/index225.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState as m, useEffect as w, useCallback as b } from "react";
2
- import { useScrollActiveIntoView as x } from "./index232.js";
2
+ import { useScrollActiveIntoView as x } from "./index227.js";
3
3
  function E({
4
4
  items: u,
5
5
  isOpen: t,
package/dist/index226.js CHANGED
@@ -1,13 +1,25 @@
1
- function r(t, i) {
2
- if (t == null) return {};
3
- var o = {};
4
- for (var e in t) if ({}.hasOwnProperty.call(t, e)) {
5
- if (i.indexOf(e) !== -1) continue;
6
- o[e] = t[e];
7
- }
8
- return o;
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;
14
+ }
15
+ function c(e) {
16
+ const t = u(e);
17
+ return t.length > 0 ? t[0] : null;
9
18
  }
10
19
  export {
11
- r as default
20
+ l as FOCUSABLE_SELECTOR,
21
+ a as FOCUSABLE_WITH_ROLES_SELECTOR,
22
+ c as getFirstFocusableElement,
23
+ u as getFocusableElements
12
24
  };
13
25
  //# sourceMappingURL=index226.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index226.js","sources":["../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,GAAGC,GAAG;AAC3C,MAAYD,KAAR,KAAW,QAAO,CAAA;AACtB,MAAIE,IAAI,CAAA;AACR,WAASC,KAAKH,EAAG,KAAI,CAAA,EAAG,eAAe,KAAKA,GAAGG,CAAC,GAAG;AACjD,QAAWF,EAAE,QAAQE,CAAC,MAAlB,GAAqB;AACzB,IAAAD,EAAEC,CAAC,IAAIH,EAAEG,CAAC;AAAA,EACZ;AACA,SAAOD;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index226.js","sources":["../src/utils/a11y/focusableElements.ts"],"sourcesContent":["/**\n * Utilities for finding focusable elements within a container.\n * \n * Used for focus management in modals, popovers, and other interactive overlays.\n */\n\n/**\n * Base selector for standard focusable elements.\n * Matches: buttons, links, inputs, selects, textareas, elements with tabindex >= 0, contenteditable.\n */\nexport const FOCUSABLE_SELECTOR = [\n 'button:not([disabled])',\n '[href]',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"]):not([disabled])',\n '[contenteditable=\"true\"]'\n].join(', ');\n\n/**\n * Extended selector that includes ARIA role-based focusable elements.\n * Useful for composite widgets like menus, listboxes, etc.\n */\nexport const FOCUSABLE_WITH_ROLES_SELECTOR = [\n FOCUSABLE_SELECTOR,\n '[role=\"menuitem\"]',\n '[role=\"option\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]'\n].join(', ');\n\n/**\n * Options for getFocusableElements\n */\nexport interface GetFocusableElementsOptions {\n /**\n * Container element to search within. If null/undefined, returns empty array.\n */\n container: HTMLElement | null;\n /**\n * Whether to include role-based focusable elements (menuitem, option, etc.).\n * Default: false (uses base selector only)\n */\n includeRoles?: boolean;\n /**\n * Additional custom selectors to include.\n */\n additionalSelectors?: string[];\n /**\n * Whether to filter out hidden/invisible elements.\n * Default: false (returns all matching elements regardless of visibility)\n */\n filterHidden?: boolean;\n}\n\n/**\n * Get all focusable elements within a container.\n * \n * @example Basic usage (standard focusable elements)\n * ```ts\n * const focusables = getFocusableElements({ container: dialogRef.current });\n * focusables[0]?.focus(); // Focus first element\n * ```\n * \n * @example With role-based elements (for menus/listboxes)\n * ```ts\n * const focusables = getFocusableElements({ \n * container: menuRef.current,\n * includeRoles: true \n * });\n * ```\n * \n * @example With custom selectors\n * ```ts\n * const focusables = getFocusableElements({ \n * container: customWidgetRef.current,\n * additionalSelectors: ['[data-focusable=\"true\"]']\n * });\n * ```\n */\nexport function getFocusableElements({\n container,\n includeRoles = false,\n additionalSelectors = [],\n filterHidden = false\n}: GetFocusableElementsOptions): HTMLElement[] {\n if (!container) return [];\n\n const selector = [\n includeRoles ? FOCUSABLE_WITH_ROLES_SELECTOR : FOCUSABLE_SELECTOR,\n ...additionalSelectors\n ].filter(Boolean).join(', ');\n\n const elements = Array.from(container.querySelectorAll<HTMLElement>(selector));\n\n if (!filterHidden) return elements;\n\n // Filter out hidden/invisible elements\n return elements.filter((el) => {\n const style = window.getComputedStyle(el);\n return (\n style.display !== 'none' &&\n style.visibility !== 'hidden' &&\n style.opacity !== '0' &&\n !el.hasAttribute('hidden') &&\n el.offsetWidth > 0 &&\n el.offsetHeight > 0\n );\n });\n}\n\n/**\n * Get the first focusable element in a container.\n * Returns null if none found.\n */\nexport function getFirstFocusableElement(\n options: GetFocusableElementsOptions\n): HTMLElement | null {\n const focusables = getFocusableElements(options);\n return focusables.length > 0 ? focusables[0] : null;\n}\n\n/**\n * Get the last focusable element in a container.\n * Returns null if none found.\n */\nexport function getLastFocusableElement(\n options: GetFocusableElementsOptions\n): HTMLElement | null {\n const focusables = getFocusableElements(options);\n return focusables.length > 0 ? focusables[focusables.length - 1] : null;\n}\n"],"names":["FOCUSABLE_SELECTOR","join","FOCUSABLE_WITH_ROLES_SELECTOR","getFocusableElements","container","includeRoles","additionalSelectors","filterHidden","selector","filter","Boolean","elements","Array","from","querySelectorAll","el","style","window","getComputedStyle","display","visibility","opacity","hasAttribute","offsetWidth","offsetHeight","getFirstFocusableElement","options","focusables","length"],"mappings":"AAUO,MAAMA,IAAqB,CAChC,0BACA,UACA,yBACA,0BACA,4BACA,mDACA,0BAA0B,EAC1BC,KAAK,IAAI,GAMEC,IAAgC,CAC3CF,GACA,qBACA,mBACA,6BACA,wBAAwB,EACxBC,KAAK,IAAI;AAmDJ,SAASE,EAAqB;AAAA,EACnCC,WAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,qBAAAA,IAAsB,CAAA;AAAA,EACtBC,cAAAA,IAAe;AACY,GAAkB;AAC7C,MAAI,CAACH,EAAW,QAAO,CAAA;AAEvB,QAAMI,IAAW,CACfH,IAAeH,IAAgCF,GAC/C,GAAGM,CAAmB,EACtBG,OAAOC,OAAO,EAAET,KAAK,IAAI,GAErBU,IAAWC,MAAMC,KAAKT,EAAUU,iBAA8BN,CAAQ,CAAC;AAE7E,SAAKD,IAGEI,EAASF,OAAQM,CAAAA,MAAO;AAC7B,UAAMC,IAAQC,OAAOC,iBAAiBH,CAAE;AACxC,WACEC,EAAMG,YAAY,UAClBH,EAAMI,eAAe,YACrBJ,EAAMK,YAAY,OAClB,CAACN,EAAGO,aAAa,QAAQ,KACzBP,EAAGQ,cAAc,KACjBR,EAAGS,eAAe;AAAA,EAEtB,CAAC,IAbyBb;AAc5B;AAMO,SAASc,EACdC,GACoB;AACpB,QAAMC,IAAaxB,EAAqBuB,CAAO;AAC/C,SAAOC,EAAWC,SAAS,IAAID,EAAW,CAAC,IAAI;AACjD;"}
package/dist/index227.js CHANGED
@@ -1,13 +1,22 @@
1
- function e() {
2
- return e = Object.assign ? Object.assign.bind() : function(t) {
3
- for (var n = 1; n < arguments.length; n++) {
4
- var a = arguments[n];
5
- for (var r in a) ({}).hasOwnProperty.call(a, r) && (t[r] = a[r]);
6
- }
7
- return t;
8
- }, e.apply(null, arguments);
1
+ import { useEffect as s } from "react";
2
+ const u = {
3
+ block: "nearest"
4
+ };
5
+ function m({
6
+ containerRef: t,
7
+ activeIndex: o,
8
+ itemSelector: r = '[role="option"]',
9
+ enabled: c = !0,
10
+ scrollOptions: e = u
11
+ }) {
12
+ s(() => {
13
+ if (!c || o < 0 || !t?.current)
14
+ return;
15
+ const n = t.current.querySelectorAll(r)[o];
16
+ n && n.scrollIntoView(e);
17
+ }, [o, t, r, c, e]);
9
18
  }
10
19
  export {
11
- e as default
20
+ m as useScrollActiveIntoView
12
21
  };
13
22
  //# sourceMappingURL=index227.js.map