se-design 1.0.62-dev → 1.0.62

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 (291) hide show
  1. package/dist/assets/colors.css +9 -22
  2. package/dist/assets/icons/ai-off.svg +4 -4
  3. package/dist/assets/icons/command.svg +1 -1
  4. package/dist/assets/style.css +1 -1
  5. package/dist/components/BreadCrumbs/index.d.ts +0 -2
  6. package/dist/components/Button/index.d.ts +1 -5
  7. package/dist/components/InfoTooltip/index.d.ts +5 -1
  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 +3 -3
  192. package/dist/index24.js +2 -2
  193. package/dist/index24.js.map +1 -1
  194. package/dist/index27.js +1 -1
  195. package/dist/index29.js +1 -1
  196. package/dist/index3.js +21 -23
  197. package/dist/index3.js.map +1 -1
  198. package/dist/index34.js +1 -1
  199. package/dist/index36.js +38 -35
  200. package/dist/index36.js.map +1 -1
  201. package/dist/index37.js +5 -4
  202. package/dist/index37.js.map +1 -1
  203. package/dist/index38.js +3 -3
  204. package/dist/index43.js +16 -16
  205. package/dist/index43.js.map +1 -1
  206. package/dist/index44.js +2 -2
  207. package/dist/index45.js +2 -2
  208. package/dist/index48.js +1 -1
  209. package/dist/index49.js +30 -48
  210. package/dist/index49.js.map +1 -1
  211. package/dist/index5.js +113 -113
  212. package/dist/index50.js +2 -2
  213. package/dist/index50.js.map +1 -1
  214. package/dist/index56.js +2 -2
  215. package/dist/index56.js.map +1 -1
  216. package/dist/index6.js +1 -1
  217. package/dist/index60.js +45 -39
  218. package/dist/index60.js.map +1 -1
  219. package/dist/index63.js +1 -1
  220. package/dist/index64.js +1 -1
  221. package/dist/index66.js +17 -19
  222. package/dist/index66.js.map +1 -1
  223. package/dist/index68.js +5 -55
  224. package/dist/index68.js.map +1 -1
  225. package/dist/index69.js +9 -5
  226. package/dist/index69.js.map +1 -1
  227. package/dist/index71.js +5 -0
  228. package/dist/index71.js.map +1 -0
  229. package/dist/index72.js +2 -2
  230. package/dist/index72.js.map +1 -1
  231. package/dist/index73.js +2 -2
  232. package/dist/index73.js.map +1 -1
  233. package/dist/index74.js +2 -2
  234. package/dist/index74.js.map +1 -1
  235. package/dist/index75.js +1 -1
  236. package/dist/index75.js.map +1 -1
  237. package/dist/index76.js +1 -1
  238. package/dist/index76.js.map +1 -1
  239. package/dist/index77.js +1 -1
  240. package/dist/index77.js.map +1 -1
  241. package/dist/index78.js +1 -1
  242. package/dist/index78.js.map +1 -1
  243. package/dist/index79.js +1 -1
  244. package/dist/index79.js.map +1 -1
  245. package/dist/index8.js +5 -5
  246. package/dist/index8.js.map +1 -1
  247. package/dist/index80.js +1 -1
  248. package/dist/index80.js.map +1 -1
  249. package/dist/index81.js +1 -1
  250. package/dist/index81.js.map +1 -1
  251. package/dist/index82.js +1 -1
  252. package/dist/index82.js.map +1 -1
  253. package/dist/index83.js +1 -1
  254. package/dist/index83.js.map +1 -1
  255. package/dist/index84.js +1 -1
  256. package/dist/index84.js.map +1 -1
  257. package/dist/index85.js +1 -1
  258. package/dist/index85.js.map +1 -1
  259. package/dist/index86.js +1 -1
  260. package/dist/index86.js.map +1 -1
  261. package/dist/index87.js +1 -1
  262. package/dist/index87.js.map +1 -1
  263. package/dist/index88.js +1 -1
  264. package/dist/index88.js.map +1 -1
  265. package/dist/index89.js +1 -1
  266. package/dist/index89.js.map +1 -1
  267. package/dist/index90.js +1 -1
  268. package/dist/index90.js.map +1 -1
  269. package/dist/index91.js +1 -1
  270. package/dist/index91.js.map +1 -1
  271. package/dist/index92.js +1 -1
  272. package/dist/index92.js.map +1 -1
  273. package/dist/index93.js +1 -1
  274. package/dist/index93.js.map +1 -1
  275. package/dist/index94.js +1 -1
  276. package/dist/index94.js.map +1 -1
  277. package/dist/index95.js +1 -1
  278. package/dist/index95.js.map +1 -1
  279. package/dist/index96.js +1 -1
  280. package/dist/index96.js.map +1 -1
  281. package/dist/index97.js +2 -2
  282. package/dist/index97.js.map +1 -1
  283. package/dist/index98.js +1 -1
  284. package/dist/index98.js.map +1 -1
  285. package/dist/index99.js +2 -2
  286. package/dist/index99.js.map +1 -1
  287. package/package.json +1 -1
  288. package/dist/index186.js +0 -8
  289. package/dist/index186.js.map +0 -1
  290. package/dist/index70.js +0 -12
  291. 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;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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MACP,YAAYC;AAAA,IAClB,IAAQ,CAAA,CAAE,GAAG,KAAK,MAAM,aAAauC,KAAwB,gBAAAlD,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]}
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;AACpB,QAAIX,EAAQY,SAAS,KAAK,CAACZ,EAAQa,SAASP,CAAS,GAAG;AACtD,YAAMQ,IAAeZ,KAAoBF,EAAQ,CAAC,KAAK;AACvDO,MAAAA,EAAkBO,CAAY;AAAA,IAChC;AAAA,EACF,GAAG,CAACd,GAASM,GAAWJ,CAAgB,CAAC;AAEzC,QAAMa,IAAejB,EAAMkB,YACzB,CAACC,MAAe;AACdV,IAAAA,EAAkBU,CAAE,GACpBZ,IAAgBY,CAAE;AAAA,EACpB,GACA,CAACZ,CAAa,CAChB,GAEMa,IAAYpB,EAAMkB,Y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AAUnC,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,7 +1,7 @@
1
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";
2
+ import { useStableId as S } from "./index184.js";
3
+ import { getA11yNameAttributes as _ } from "./index69.js";
4
+ import { mergeIds as $ } from "./index185.js";
5
5
  /* empty css */
6
6
  function b() {
7
7
  return b = Object.assign ? Object.assign.bind() : function(s) {
package/dist/index24.js CHANGED
@@ -4,7 +4,7 @@ import { Icon as M } from "./index5.js";
4
4
  import { Checkbox as me } from "./index22.js";
5
5
  import { Button as R } from "./index3.js";
6
6
  import { InputWithIcon as fe } from "./index51.js";
7
- import { useStableId as T } from "./index185.js";
7
+ import { useStableId as T } from "./index184.js";
8
8
  import { useCombobox as pe } from "./index191.js";
9
9
  function m() {
10
10
  return m = Object.assign ? Object.assign.bind() : function(t) {
@@ -156,7 +156,7 @@ const Ee = (t) => {
156
156
  }, P && L(), /* @__PURE__ */ o.createElement("div", {
157
157
  className: "flex flex-col max-h-80 overflow-y-auto"
158
158
  }, e.length > 0 ? e.map((r) => re(r)) : /* @__PURE__ */ o.createElement("div", {
159
- className: "px-3 py-4 text-center text-[var(--color-gray-700)] text-sm",
159
+ className: "px-3 py-4 text-center text-[var(--color-gray-500)] text-sm",
160
160
  role: "status",
161
161
  "aria-live": "polite"
162
162
  }, A)), /* @__PURE__ */ o.createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"index24.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { InputWithIcon } from '../InputWithIcon';\nimport { useStableId } from '../../utils/useStableId';\nimport { useCombobox } from '../../utils/a11y/useCombobox';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n ariaLabel?: string;\n type: 'select' | 'multi-select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue | DropdownValue[];\n customSelectedValue?: string;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue, srcOption: boolean) => React.ReactNode;\n className?: string;\n iconColor?: string;\n disabled?: boolean;\n dropdownClassName?: string;\n hasError?: boolean;\n errorMessage?: string;\n onApply?: (selectedValue: DropdownValue[]) => void;\n onClear?: () => void;\n customDropdownContent?: () => React.ReactNode;\n isBorderless?: boolean;\n dropDownSrcAutomationId?: string;\n dropDownSelectAutomationId?: string;\n dropDownContentAutomationId?: string;\n shouldShowSearch?: boolean;\n searchPlaceholder?: string;\n searchResultEmptyMessage?: string;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [selectedDropDownValues, setSelectedDropDownValues] = useState<DropdownValue[]>(() =>\n props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : []\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n const labelId = useStableId(undefined, 'dropdown-label');\n const listboxId = useStableId(undefined, 'dropdown-listbox');\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select',\n iconColor = 'var(--color-gray-700)',\n disabled = false,\n dropdownClassName = '',\n hasError = false,\n errorMessage = '',\n customDropdownContent = null,\n isBorderless = false,\n shouldShowSearch = false,\n searchPlaceholder = 'Search...',\n searchResultEmptyMessage = 'No results found',\n ariaLabel = '',\n customSelectedValue = ''\n } = props;\n\n useEffect(() => {\n const newValues = props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : [];\n setSelectedDropDownValues(newValues);\n }, [props?.defaultSelectedValue]);\n\n useEffect(() => {\n if (!isDropDownOpen) {\n setSearchQuery('');\n }\n }, [isDropDownOpen]);\n\n const isMultiSelect = props?.type === 'multi-select';\n\n const getFilteredOptions = () => {\n if (!searchQuery.trim()) {\n return dropDownOptions || [];\n }\n return (dropDownOptions || []).filter((option) => {\n const optionValue = option?.[selectBy]?.toString().toLowerCase() || '';\n return optionValue.includes(searchQuery.toLowerCase());\n });\n };\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValues([dropDownOption]);\n setIsDropDownOpen(false);\n props?.onOptionClick?.(dropDownOption);\n };\n\n // Use useCombobox hook for keyboard navigation (only for single-select)\n const filteredOptions = getFilteredOptions();\n const {\n listboxProps,\n getOptionProps,\n highlightedIndex,\n containerProps: comboboxContainerProps,\n inputProps: comboboxInputProps\n } = useCombobox({\n items: isMultiSelect ? [] : filteredOptions, // Only use for single-select\n isOpen: isDropDownOpen && !isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: (item: DropdownValue) => {\n handleDropDownOptionClick(item);\n },\n listboxId,\n disabled: isMultiSelect || disabled,\n hasItems: filteredOptions.length > 0\n });\n\n const getSelectedDropDownValue = (option: DropdownValue, isSrcOption: boolean = false) => {\n if (isMultiSelect) {\n return defaultText;\n }\n\n // if custom selected value is provided, use it instead of the option value\n if (isSrcOption && customSelectedValue) {\n return customSelectedValue;\n }\n\n return option?.[selectBy] || defaultText;\n };\n\n const clearSelectedDropDownValues = () => {\n setSelectedDropDownValues([]);\n props?.onClear?.();\n };\n\n const optionChip = (option: DropdownValue, srcOption: boolean = false) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option, srcOption);\n }\n\n if (isMultiSelect && selectedDropDownValues?.length > 0) {\n const firstSelectedLabel = selectedDropDownValues[0]?.[selectBy] || '';\n const remainingCount = selectedDropDownValues.length - 1;\n\n // For multiple selections: text takes remaining space, count takes minimum space needed\n return (\n <div className={`option-chip flex items-center w-full`}>\n <div\n className={`${remainingCount > 0 ? 'w-full' : 'flex-1'} truncate`}\n >{`${defaultText}: ${firstSelectedLabel}`}</div>\n {remainingCount > 0 && <div className=\"flex-shrink-0\">+{remainingCount}</div>}\n </div>\n );\n }\n\n return (\n <p className={`option-chip flex flex-1 items-center justify-between`}>\n {getSelectedDropDownValue(option, srcOption)}\n </p>\n );\n };\n\n const renderSearchBar = () => {\n return (\n <div className=\" w-full relative flex items-center border-b border-[var(--color-gray-300)]\">\n <InputWithIcon\n leftIcon={{ name: 'search', position: 'left', style: { color: 'var(--color-gray-500)' } }}\n value={searchQuery}\n onChange={(value) => setSearchQuery(value)}\n placeholder={searchPlaceholder}\n style={{ margin: 0, gap: 0 }}\n inputStyle={{ width: '100%', border: 'none', outline: 'none' }}\n />\n </div>\n );\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue, index: number) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValues[0]?.[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValues[0]?.[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n const isHighlighted = highlightedIndex === index;\n const optionProps = !isMultiSelect ? getOptionProps(index, isOptionSelected) : {};\n \n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className={`option break-words px-3 py-2 hover:bg-gray-100 cursor-pointer select-none flex items-center justify-between ${\n isOptionSelected ? 'selected' : ''\n } ${isHighlighted ? 'bg-gray-100' : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleDropDownOptionClick(dropDownOption);\n }\n }}\n tabIndex={-1}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n {...optionProps}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {optionChip({ ...dropDownOption, isOptionSelected }, false)}\n {isOptionSelected && <Icon name=\"checkmark\" stroke={iconColor} />}\n </div>\n );\n };\n\n const renderDropdownContents = () => {\n return (\n <div \n className=\"dropdown-content dropdown-options\" \n aria-label=\"Dropdown options\"\n {...listboxProps}\n >\n {shouldShowSearch && renderSearchBar()}\n <div className=\"flex flex-col max-h-80 overflow-y-auto\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n <div\n className=\"px-3 py-4 text-center text-[var(--color-gray-700)] text-sm\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {searchResultEmptyMessage}\n </div>\n )}\n </div>\n </div>\n );\n };\n\n const handleMultiSelectDropdownOptionClick = (isSelected: boolean, dropDownOption: DropdownValue) => {\n let newSelectedDropDownValues: DropdownValue[] = [];\n if (isSelected) {\n newSelectedDropDownValues = [...selectedDropDownValues, dropDownOption];\n } else {\n newSelectedDropDownValues = selectedDropDownValues?.filter(\n (option) => option[optionsUniqueBy] !== dropDownOption[optionsUniqueBy]\n );\n }\n setSelectedDropDownValues(newSelectedDropDownValues);\n };\n\n const handleApplySelectedDropDownValues = () => {\n popoverRef.current?.togglePopover();\n props?.onApply?.(selectedDropDownValues);\n };\n\n const multiSelectDropdownOptionJSX = (dropDownOption: DropdownValue) => {\n const isOptionSelected = selectedDropDownValues.some(\n (option) => option[optionsUniqueBy] === dropDownOption[optionsUniqueBy]\n );\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className=\"option px-3 py-2 hover:bg-gray-100 cursor-pointer select-none flex items-center justify-between\"\n >\n <Checkbox\n automationId=\"checkbox\"\n className=\"checkbox\"\n defaultChecked={isOptionSelected}\n onChange={(value) => handleMultiSelectDropdownOptionClick(value, dropDownOption)}\n label={dropDownOption?.label}\n />\n </div>\n );\n };\n\n const renderMultiSelectDropdownContents = () => {\n const filteredOptions = getFilteredOptions();\n return (\n <div\n className=\"dropdown-content dropdown-options\"\n role=\"listbox\"\n aria-label=\"Multi-select dropdown options\"\n aria-multiselectable=\"true\"\n >\n {shouldShowSearch && renderSearchBar()}\n <div className=\"flex flex-col max-h-80 overflow-y-auto\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption) => multiSelectDropdownOptionJSX(dropDownOption))\n ) : (\n <div\n className=\"px-3 py-4 text-center text-[var(--color-gray-700)] text-sm\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {searchResultEmptyMessage}\n </div>\n )}\n </div>\n <div className=\"flex items-center justify-end gap-4 p-3 border-t border-[var(--color-gray-200)]\">\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} />\n </div>\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen\n ? 'border-[var(--color-blue-500)]'\n : disabled\n ? 'border-[var(--color-gray-300)]'\n : 'border-[var(--color-gray-600)]';\n const errorBorderColor = hasError ? 'border-[var(--color-red-500)]' : '';\n const dropDownSelectClass = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${\n isBorderless ? 'border-0' : `border rounded-md ${errorBorderColor ? errorBorderColor : borderColor}`\n } flex items-center ${dropdownClassName}`;\n\n return (\n <div className={dropDownSelectClass}>\n <div\n className=\"flex-1 min-w-0\"\n data-automation-id={props?.dropDownSelectAutomationId || 'selected-dropdown-value'}\n >\n {optionChip(selectedDropDownValues[0], true)}\n </div>\n <div className=\"flex-shrink-0 ml-2\" aria-hidden=\"true\">\n <Icon\n name={'chevron'}\n rotation={isDropDownOpen ? '180' : '0'}\n className={`transition-transform`}\n stroke={iconColor}\n />\n </div>\n </div>\n );\n };\n\n const getDropdownAriaLabel = () => {\n return ariaLabel || `Select option`;\n };\n\n return (\n <div\n className={`se-design-dropdown-container${props?.className ? ` ${props?.className}` : ''}`}\n style={props?.style}\n >\n {props?.label && (\n <div id={labelId} className=\"se-design-dropdown-label mb-[3px] text-[var(--color-gray-700)] text-sm\">\n {props?.label}\n </div>\n )}\n <div\n style={props?.style}\n className={`${disabled ? 'bg-[var(--color-gray-50)] rounded-md cursor-not-allowed' : ''}`}\n {...(!isMultiSelect ? comboboxContainerProps : {})}\n >\n <Popover\n ref={popoverRef}\n isPopoverOpen={isDropDownOpen}\n renderPopoverContents={\n customDropdownContent\n ? customDropdownContent\n : isMultiSelect\n ? renderMultiSelectDropdownContents\n : renderDropdownContents\n }\n contentWidth={'full'}\n renderPopoverSrcElement={renderDropdownSelect}\n onPopoverToggle={(value) => setIsDropDownOpen(value)}\n disabled={disabled}\n automationId={props?.dropDownSrcAutomationId}\n popoverContentAutomationId={props?.dropDownContentAutomationId}\n ariaLabelledBy={props?.label ? labelId : undefined}\n ariaLabel={props?.label ? undefined : getDropdownAriaLabel()}\n sourceRole=\"combobox\"\n {...(!isMultiSelect && comboboxInputProps ? {\n 'aria-activedescendant': comboboxInputProps['aria-activedescendant'],\n 'aria-controls': comboboxInputProps['aria-controls'],\n 'aria-expanded': comboboxInputProps['aria-expanded']\n } : {})}\n />\n </div>\n {hasError && <div className=\"text-[var(--color-red-500)] text-sm\">{errorMessage}</div>}\n </div>\n );\n};\n"],"names":["Dropdown","props","isDropDownOpen","setIsDropDownOpen","useState","searchQuery","setSearchQuery","selectedDropDownValues","setSelectedDropDownValues","defaultSelectedValue","Array","isArray","popoverRef","useRef","labelId","useStableId","undefined","listboxId","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","iconColor","disabled","dropdownClassName","hasError","errorMessage","customDropdownContent","isBorderless","shouldShowSearch","searchPlaceholder","searchResultEmptyMessage","ariaLabel","customSelectedValue","useEffect","newValues","isMultiSelect","type","getFilteredOptions","trim","filter","option","toString","toLowerCase","includes","handleDropDownOptionClick","dropDownOption","onOptionClick","filteredOptions","listboxProps","getOptionProps","highlightedIndex","containerProps","comboboxContainerProps","inputProps","comboboxInputProps","useCombobox","items","isOpen","onOpenChange","onSelect","item","hasItems","length","getSelectedDropDownValue","isSrcOption","clearSelectedDropDownValues","onClear","optionChip","srcOption","renderOptionChip","firstSelectedLabel","remainingCount","React","createElement","className","renderSearchBar","InputWithIcon","leftIcon","name","position","style","color","value","onChange","placeholder","margin","gap","inputStyle","width","border","outline","dropDownOptionJsx","index","optionTxt","dropDownSelectedValue","selectByUniqueId","isOptionSelected","isHighlighted","optionProps","_extends","key","id","onClick","onKeyDown","e","preventDefault","tabIndex","automationId","Icon","stroke","renderDropdownContents","map","role","handleMultiSelectDropdownOptionClick","isSelected","newSelectedDropDownValues","handleApplySelectedDropDownValues","current","togglePopover","onApply","multiSelectDropdownOptionJSX","some","Checkbox","defaultChecked","label","renderMultiSelectDropdownContents","Button","size","renderDropdownSelect","borderColor","errorBorderColor","dropDownSelectClass","dropDownSelectAutomationId","rotation","getDropdownAriaLabel","Popover","ref","isPopoverOpen","renderPopoverContents","contentWidth","renderPopoverSrcElement","onPopoverToggle","dropDownSrcAutomationId","popoverContentAutomationId","dropDownContentAutomationId","ariaLabelledBy","sourceRole"],"mappings":";;;;;;;;;;;;;;;;;AA8CO,MAAMA,KAA+BC,CAAAA,MAAU;AACpD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C,CAACG,GAAwBC,CAAyB,IAAIJ,EAA0B,MACpFH,GAAOQ,uBACHC,MAAMC,QAAQV,GAAOQ,oBAAoB,IACvCR,GAAOQ,uBACP,CAACR,EAAMQ,oBAAoB,IAC7B,EACN,GACMG,IAAaC,GAAuC,IAAI,GACxDC,IAAUC,EAAYC,QAAW,gBAAgB,GACjDC,IAAYF,EAAYC,QAAW,kBAAkB,GAErD;AAAA,IACJE,UAAAA,IAAW;AAAA,IACXC,iBAAAA,IAAkB;AAAA,IAClBC,iBAAAA,IAAkB;AAAA,IAClBC,iBAAAA;AAAAA,IACAC,aAAAA,IAAc;AAAA,IACdC,WAAAA,IAAY;AAAA,IACZC,UAAAA,IAAW;AAAA,IACXC,mBAAAA,IAAoB;AAAA,IACpBC,UAAAA,IAAW;AAAA,IACXC,cAAAA,IAAe;AAAA,IACfC,uBAAAA,IAAwB;AAAA,IACxBC,cAAAA,IAAe;AAAA,IACfC,kBAAAA,IAAmB;AAAA,IACnBC,mBAAAA,IAAoB;AAAA,IACpBC,0BAAAA,IAA2B;AAAA,IAC3BC,WAAAA,IAAY;AAAA,IACZC,qBAAAA,IAAsB;AAAA,EAAA,IACpBjC;AAEJkC,EAAAA,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,EAAA,GACN,CAAC/G,KAAiBmB,IAAqB;AAAA,IAC1C,yBAAyBA,EAAmB,uBAAuB;AAAA,IACnE,iBAAiBA,EAAmB,eAAe;AAAA,IACnD,iBAAiBA,EAAmB,eAAe;AAAA,EAAA,IACjD,CAAA,CAAE,CACP,CACE,GACJ9B,KAAYgD,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAU;AAAA,EAAA,GAAuCjD,CAAkB,CAClF;AAET;"}
1
+ {"version":3,"file":"index24.js","sources":["../src/components/Dropdown/index.tsx"],"sourcesContent":["import React, { FC, useState, useRef, useEffect } from 'react';\n\nimport { Popover, PopoverHandle } from 'src/components/Popover';\nimport { Icon } from 'components/Icon';\nimport { Checkbox } from '../Checkbox';\nimport { Button } from '../Button';\nimport { InputWithIcon } from '../InputWithIcon';\nimport { useStableId } from '../../utils/useStableId';\nimport { useCombobox } from '../../utils/a11y/useCombobox';\n\ntype DropdownValue = {\n [key: string]: any;\n};\n\ntype DropdownProps = {\n label?: string;\n ariaLabel?: string;\n type: 'select' | 'multi-select';\n dropDownOptions?: DropdownValue[];\n defaultText?: string;\n selectBy?: string;\n optionsUniqueBy?: string;\n displaySelected?: boolean;\n defaultSelectedValue?: DropdownValue | DropdownValue[];\n customSelectedValue?: string;\n onOptionClick?: (selectedValue: DropdownValue) => void;\n style?: React.CSSProperties;\n renderOptionChip?: (option: DropdownValue, srcOption: boolean) => React.ReactNode;\n className?: string;\n iconColor?: string;\n disabled?: boolean;\n dropdownClassName?: string;\n hasError?: boolean;\n errorMessage?: string;\n onApply?: (selectedValue: DropdownValue[]) => void;\n onClear?: () => void;\n customDropdownContent?: () => React.ReactNode;\n isBorderless?: boolean;\n dropDownSrcAutomationId?: string;\n dropDownSelectAutomationId?: string;\n dropDownContentAutomationId?: string;\n shouldShowSearch?: boolean;\n searchPlaceholder?: string;\n searchResultEmptyMessage?: string;\n};\n\nexport const Dropdown: FC<DropdownProps> = (props) => {\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [selectedDropDownValues, setSelectedDropDownValues] = useState<DropdownValue[]>(() =>\n props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : []\n );\n const popoverRef = useRef<HTMLDivElement & PopoverHandle>(null);\n const labelId = useStableId(undefined, 'dropdown-label');\n const listboxId = useStableId(undefined, 'dropdown-listbox');\n\n const {\n selectBy = '',\n optionsUniqueBy = '',\n displaySelected = false,\n dropDownOptions,\n defaultText = 'Select',\n iconColor = 'var(--color-gray-700)',\n disabled = false,\n dropdownClassName = '',\n hasError = false,\n errorMessage = '',\n customDropdownContent = null,\n isBorderless = false,\n shouldShowSearch = false,\n searchPlaceholder = 'Search...',\n searchResultEmptyMessage = 'No results found',\n ariaLabel = '',\n customSelectedValue = ''\n } = props;\n\n useEffect(() => {\n const newValues = props?.defaultSelectedValue\n ? Array.isArray(props?.defaultSelectedValue)\n ? props?.defaultSelectedValue\n : [props.defaultSelectedValue]\n : [];\n setSelectedDropDownValues(newValues);\n }, [props?.defaultSelectedValue]);\n\n useEffect(() => {\n if (!isDropDownOpen) {\n setSearchQuery('');\n }\n }, [isDropDownOpen]);\n\n const isMultiSelect = props?.type === 'multi-select';\n\n const getFilteredOptions = () => {\n if (!searchQuery.trim()) {\n return dropDownOptions || [];\n }\n return (dropDownOptions || []).filter((option) => {\n const optionValue = option?.[selectBy]?.toString().toLowerCase() || '';\n return optionValue.includes(searchQuery.toLowerCase());\n });\n };\n\n const handleDropDownOptionClick = (dropDownOption: any) => {\n setSelectedDropDownValues([dropDownOption]);\n setIsDropDownOpen(false);\n props?.onOptionClick?.(dropDownOption);\n };\n\n // Use useCombobox hook for keyboard navigation (only for single-select)\n const filteredOptions = getFilteredOptions();\n const {\n listboxProps,\n getOptionProps,\n highlightedIndex,\n containerProps: comboboxContainerProps,\n inputProps: comboboxInputProps\n } = useCombobox({\n items: isMultiSelect ? [] : filteredOptions, // Only use for single-select\n isOpen: isDropDownOpen && !isMultiSelect,\n onOpenChange: setIsDropDownOpen,\n onSelect: (item: DropdownValue) => {\n handleDropDownOptionClick(item);\n },\n listboxId,\n disabled: isMultiSelect || disabled,\n hasItems: filteredOptions.length > 0\n });\n\n const getSelectedDropDownValue = (option: DropdownValue, isSrcOption: boolean = false) => {\n if (isMultiSelect) {\n return defaultText;\n }\n\n // if custom selected value is provided, use it instead of the option value\n if (isSrcOption && customSelectedValue) {\n return customSelectedValue;\n }\n\n return option?.[selectBy] || defaultText;\n };\n\n const clearSelectedDropDownValues = () => {\n setSelectedDropDownValues([]);\n props?.onClear?.();\n };\n\n const optionChip = (option: DropdownValue, srcOption: boolean = false) => {\n if (props?.renderOptionChip) {\n return props?.renderOptionChip(option, srcOption);\n }\n\n if (isMultiSelect && selectedDropDownValues?.length > 0) {\n const firstSelectedLabel = selectedDropDownValues[0]?.[selectBy] || '';\n const remainingCount = selectedDropDownValues.length - 1;\n\n // For multiple selections: text takes remaining space, count takes minimum space needed\n return (\n <div className={`option-chip flex items-center w-full`}>\n <div\n className={`${remainingCount > 0 ? 'w-full' : 'flex-1'} truncate`}\n >{`${defaultText}: ${firstSelectedLabel}`}</div>\n {remainingCount > 0 && <div className=\"flex-shrink-0\">+{remainingCount}</div>}\n </div>\n );\n }\n\n return (\n <p className={`option-chip flex flex-1 items-center justify-between`}>\n {getSelectedDropDownValue(option, srcOption)}\n </p>\n );\n };\n\n const renderSearchBar = () => {\n return (\n <div className=\" w-full relative flex items-center border-b border-[var(--color-gray-300)]\">\n <InputWithIcon\n leftIcon={{ name: 'search', position: 'left', style: { color: 'var(--color-gray-500)' } }}\n value={searchQuery}\n onChange={(value) => setSearchQuery(value)}\n placeholder={searchPlaceholder}\n style={{ margin: 0, gap: 0 }}\n inputStyle={{ width: '100%', border: 'none', outline: 'none' }}\n />\n </div>\n );\n };\n\n const dropDownOptionJsx = (dropDownOption: DropdownValue, index: number) => {\n const optionTxt = dropDownOption[selectBy];\n const dropDownSelectedValue = selectedDropDownValues[0]?.[selectBy] || defaultText;\n const selectByUniqueId = optionsUniqueBy?.length\n ? dropDownOption[optionsUniqueBy] == selectedDropDownValues[0]?.[optionsUniqueBy]\n : true;\n const isOptionSelected = displaySelected && optionTxt === dropDownSelectedValue && selectByUniqueId;\n const isHighlighted = highlightedIndex === index;\n const optionProps = !isMultiSelect ? getOptionProps(index, isOptionSelected) : {};\n \n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className={`option break-words px-3 py-2 hover:bg-gray-100 cursor-pointer select-none flex items-center justify-between ${\n isOptionSelected ? 'selected' : ''\n } ${isHighlighted ? 'bg-gray-100' : ''}`}\n onClick={() => handleDropDownOptionClick(dropDownOption)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleDropDownOptionClick(dropDownOption);\n }\n }}\n tabIndex={-1}\n data-automation-id={`dropdown-option-${dropDownOption?.automationId || index}`}\n {...optionProps}\n aria-selected={isOptionSelected ? 'true' : 'false'}\n >\n {optionChip({ ...dropDownOption, isOptionSelected }, false)}\n {isOptionSelected && <Icon name=\"checkmark\" stroke={iconColor} />}\n </div>\n );\n };\n\n const renderDropdownContents = () => {\n return (\n <div \n className=\"dropdown-content dropdown-options\" \n aria-label=\"Dropdown options\"\n {...listboxProps}\n >\n {shouldShowSearch && renderSearchBar()}\n <div className=\"flex flex-col max-h-80 overflow-y-auto\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption, index) => dropDownOptionJsx(dropDownOption, index))\n ) : (\n <div\n className=\"px-3 py-4 text-center text-[var(--color-gray-700)] text-sm\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {searchResultEmptyMessage}\n </div>\n )}\n </div>\n </div>\n );\n };\n\n const handleMultiSelectDropdownOptionClick = (isSelected: boolean, dropDownOption: DropdownValue) => {\n let newSelectedDropDownValues: DropdownValue[] = [];\n if (isSelected) {\n newSelectedDropDownValues = [...selectedDropDownValues, dropDownOption];\n } else {\n newSelectedDropDownValues = selectedDropDownValues?.filter(\n (option) => option[optionsUniqueBy] !== dropDownOption[optionsUniqueBy]\n );\n }\n setSelectedDropDownValues(newSelectedDropDownValues);\n };\n\n const handleApplySelectedDropDownValues = () => {\n popoverRef.current?.togglePopover();\n props?.onApply?.(selectedDropDownValues);\n };\n\n const multiSelectDropdownOptionJSX = (dropDownOption: DropdownValue) => {\n const isOptionSelected = selectedDropDownValues.some(\n (option) => option[optionsUniqueBy] === dropDownOption[optionsUniqueBy]\n );\n return (\n <div\n key={dropDownOption.id || dropDownOption.value}\n className=\"option px-3 py-2 hover:bg-gray-100 cursor-pointer select-none flex items-center justify-between\"\n >\n <Checkbox\n automationId=\"checkbox\"\n className=\"checkbox\"\n defaultChecked={isOptionSelected}\n onChange={(value) => handleMultiSelectDropdownOptionClick(value, dropDownOption)}\n label={dropDownOption?.label}\n />\n </div>\n );\n };\n\n const renderMultiSelectDropdownContents = () => {\n const filteredOptions = getFilteredOptions();\n return (\n <div\n className=\"dropdown-content dropdown-options\"\n role=\"listbox\"\n aria-label=\"Multi-select dropdown options\"\n aria-multiselectable=\"true\"\n >\n {shouldShowSearch && renderSearchBar()}\n <div className=\"flex flex-col max-h-80 overflow-y-auto\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map((dropDownOption) => multiSelectDropdownOptionJSX(dropDownOption))\n ) : (\n <div\n className=\"px-3 py-4 text-center text-[var(--color-gray-500)] text-sm\"\n role=\"status\"\n aria-live=\"polite\"\n >\n {searchResultEmptyMessage}\n </div>\n )}\n </div>\n <div className=\"flex items-center justify-end gap-4 p-3 border-t border-[var(--color-gray-200)]\">\n <Button label=\"Clear\" type=\"link\" size=\"sm\" onClick={clearSelectedDropDownValues} />\n <Button label=\"Apply\" type=\"primary\" size=\"sm\" onClick={handleApplySelectedDropDownValues} />\n </div>\n </div>\n );\n };\n\n const renderDropdownSelect = () => {\n const borderColor = isDropDownOpen\n ? 'border-[var(--color-blue-500)]'\n : disabled\n ? 'border-[var(--color-gray-300)]'\n : 'border-[var(--color-gray-600)]';\n const errorBorderColor = hasError ? 'border-[var(--color-red-500)]' : '';\n const dropDownSelectClass = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${\n isBorderless ? 'border-0' : `border rounded-md ${errorBorderColor ? errorBorderColor : borderColor}`\n } flex items-center ${dropdownClassName}`;\n\n return (\n <div className={dropDownSelectClass}>\n <div\n className=\"flex-1 min-w-0\"\n data-automation-id={props?.dropDownSelectAutomationId || 'selected-dropdown-value'}\n >\n {optionChip(selectedDropDownValues[0], true)}\n </div>\n <div className=\"flex-shrink-0 ml-2\" aria-hidden=\"true\">\n <Icon\n name={'chevron'}\n rotation={isDropDownOpen ? '180' : '0'}\n className={`transition-transform`}\n stroke={iconColor}\n />\n </div>\n </div>\n );\n };\n\n const getDropdownAriaLabel = () => {\n return ariaLabel || `Select option`;\n };\n\n return (\n <div\n className={`se-design-dropdown-container${props?.className ? ` ${props?.className}` : ''}`}\n style={props?.style}\n >\n {props?.label && (\n <div id={labelId} className=\"se-design-dropdown-label mb-[3px] text-[var(--color-gray-700)] text-sm\">\n {props?.label}\n </div>\n )}\n <div\n style={props?.style}\n className={`${disabled ? 'bg-[var(--color-gray-50)] rounded-md cursor-not-allowed' : ''}`}\n {...(!isMultiSelect ? comboboxContainerProps : {})}\n >\n <Popover\n ref={popoverRef}\n isPopoverOpen={isDropDownOpen}\n renderPopoverContents={\n customDropdownContent\n ? customDropdownContent\n : isMultiSelect\n ? renderMultiSelectDropdownContents\n : renderDropdownContents\n }\n contentWidth={'full'}\n renderPopoverSrcElement={renderDropdownSelect}\n onPopoverToggle={(value) => setIsDropDownOpen(value)}\n disabled={disabled}\n automationId={props?.dropDownSrcAutomationId}\n popoverContentAutomationId={props?.dropDownContentAutomationId}\n ariaLabelledBy={props?.label ? labelId : undefined}\n ariaLabel={props?.label ? undefined : getDropdownAriaLabel()}\n sourceRole=\"combobox\"\n {...(!isMultiSelect && comboboxInputProps ? {\n 'aria-activedescendant': comboboxInputProps['aria-activedescendant'],\n 'aria-controls': comboboxInputProps['aria-controls'],\n 'aria-expanded': comboboxInputProps['aria-expanded']\n } : {})}\n />\n </div>\n {hasError && <div className=\"text-[var(--color-red-500)] text-sm\">{errorMessage}</div>}\n </div>\n );\n};\n"],"names":["Dropdown","props","isDropDownOpen","setIsDropDownOpen","useState","searchQuery","setSearchQuery","selectedDropDownValues","setSelectedDropDownValues","defaultSelectedValue","Array","isArray","popoverRef","useRef","labelId","useStableId","undefined","listboxId","selectBy","optionsUniqueBy","displaySelected","dropDownOptions","defaultText","iconColor","disabled","dropdownClassName","hasError","errorMessage","customDropdownContent","isBorderless","shouldShowSearch","searchPlaceholder","searchResultEmptyMessage","ariaLabel","customSelectedValue","useEffect","newValues","isMultiSelect","type","getFilteredOptions","trim","filter","option","toString","toLowerCase","includes","handleDropDownOptionClick","dropDownOption","onOptionClick","filteredOptions","listboxProps","getOptionProps","highlightedIndex","containerProps","comboboxContainerProps","inputProps","comboboxInputProps","useCombobox","items","isOpen","onOpenChange","onSelect","item","hasItems","length","getSelectedDropDownValue","isSrcOption","clearSelectedDropDownValues","onClear","optionChip","srcOption","renderOptionChip","firstSelectedLabel","remainingCount","React","createElement","className","renderSearchBar","InputWithIcon","leftIcon","name","position","style","color","value","onChange","placeholder","margin","gap","inputStyle","width","border","outline","dropDownOptionJsx","index","optionTxt","dropDownSelectedValue","selectByUniqueId","isOptionSelected","isHighlighted","optionProps","_extends","key","id","onClick","onKeyDown","e","preventDefault","tabIndex","automationId","Icon","stroke","renderDropdownContents","map","role","handleMultiSelectDropdownOptionClick","isSelected","newSelectedDropDownValues","handleApplySelectedDropDownValues","current","togglePopover","onApply","multiSelectDropdownOptionJSX","some","Checkbox","defaultChecked","label","renderMultiSelectDropdownContents","Button","size","renderDropdownSelect","borderColor","errorBorderColor","dropDownSelectClass","dropDownSelectAutomationId","rotation","getDropdownAriaLabel","Popover","ref","isPopoverOpen","renderPopoverContents","contentWidth","renderPopoverSrcElement","onPopoverToggle","dropDownSrcAutomationId","popoverContentAutomationId","dropDownContentAutomationId","ariaLabelledBy","sourceRole"],"mappings":";;;;;;;;;;;;;;;;;AA8CO,MAAMA,KAA+BC,CAAAA,MAAU;AACpD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C,CAACG,GAAwBC,CAAyB,IAAIJ,EAA0B,MACpFH,GAAOQ,uBACHC,MAAMC,QAAQV,GAAOQ,oBAAoB,IACvCR,GAAOQ,uBACP,CAACR,EAAMQ,oBAAoB,IAC7B,EACN,GACMG,IAAaC,GAAuC,IAAI,GACxDC,IAAUC,EAAYC,QAAW,gBAAgB,GACjDC,IAAYF,EAAYC,QAAW,kBAAkB,GAErD;AAAA,IACJE,UAAAA,IAAW;AAAA,IACXC,iBAAAA,IAAkB;AAAA,IAClBC,iBAAAA,IAAkB;AAAA,IAClBC,iBAAAA;AAAAA,IACAC,aAAAA,IAAc;AAAA,IACdC,WAAAA,IAAY;AAAA,IACZC,UAAAA,IAAW;AAAA,IACXC,mBAAAA,IAAoB;AAAA,IACpBC,UAAAA,IAAW;AAAA,IACXC,cAAAA,IAAe;AAAA,IACfC,uBAAAA,IAAwB;AAAA,IACxBC,cAAAA,IAAe;AAAA,IACfC,kBAAAA,IAAmB;AAAA,IACnBC,mBAAAA,IAAoB;AAAA,IACpBC,0BAAAA,IAA2B;AAAA,IAC3BC,WAAAA,IAAY;AAAA,IACZC,qBAAAA,IAAsB;AAAA,EAAA,IACpBjC;AAEJkC,EAAAA,EAAU,MAAM;AACd,UAAMC,IAAYnC,GAAOQ,uBACrBC,MAAMC,QAAQV,GAAOQ,oBAAoB,IACvCR,GAAOQ,uBACP,CAACR,EAAMQ,oBAAoB,IAC7B,CAAA;AACJD,IAAAA,EAA0B4B,CAAS;AAAA,EACrC,GAAG,CAACnC,GAAOQ,oBAAoB,CAAC,GAEhC0B,EAA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;AAAA,IAAKC,WAAU;AAAA,EAAA,GAAuCjD,CAAkB,CAClF;AAET;"}
package/dist/index27.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import d, { useMemo as S, useRef as D, useEffect as c } from "react";
2
2
  import { Icon as j } from "./index5.js";
3
- import { getA11yNameAttributes as B } from "./index70.js";
3
+ import { getA11yNameAttributes as B } from "./index69.js";
4
4
  import { useDismissOnEscape as M } from "./index193.js";
5
5
  /* empty css */
6
6
  function m() {
package/dist/index29.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import e, { forwardRef as G } from "react";
2
2
  import { Icon as H } from "./index5.js";
3
3
  import { Button as b } from "./index3.js";
4
- import { useStableId as I } from "./index185.js";
4
+ import { useStableId as I } from "./index184.js";
5
5
  import { getRegionAttributes as J } from "./index65.js";
6
6
  import { useAccessiblePress as K } from "./index66.js";
7
7
  /* empty css */
package/dist/index3.js CHANGED
@@ -1,6 +1,6 @@
1
- import r, { forwardRef as I } from "react";
2
- import { getA11yNameAttributes as R } from "./index70.js";
3
- import { useAccessiblePress as z } from "./index66.js";
1
+ import r, { forwardRef as _ } from "react";
2
+ import { getA11yNameAttributes as I } from "./index69.js";
3
+ import { useAccessiblePress as R } from "./index66.js";
4
4
  import { Icon as b } from "./index5.js";
5
5
  /* empty css */
6
6
  function c() {
@@ -12,7 +12,7 @@ function c() {
12
12
  return e;
13
13
  }, c.apply(null, arguments);
14
14
  }
15
- const a = "focus-outline", D = {
15
+ const a = "focus-outline", z = {
16
16
  primary: "primary-btn disabled-btn pointer-events-none cursor-not-allowed",
17
17
  secondary: "secondary-btn disabled-btn pointer-events-none cursor-not-allowed",
18
18
  ghost: "ghost-btn disabled-btn pointer-events-none cursor-not-allowed",
@@ -36,14 +36,14 @@ const a = "focus-outline", D = {
36
36
  // padding: 8px, 12px
37
37
  lg: "py-3 px-4 large"
38
38
  // padding: 12px, 16px
39
- }, U = {
39
+ }, D = {
40
40
  blue: "theme-blue",
41
41
  red: "theme-red",
42
42
  yellow: "theme-yellow",
43
43
  green: "theme-green",
44
44
  ai: "theme-ai",
45
45
  white: "theme-white"
46
- }, q = /* @__PURE__ */ I(({
46
+ }, U = /* @__PURE__ */ _(({
47
47
  type: e = "primary",
48
48
  theme: n = "blue",
49
49
  size: s = "md",
@@ -60,46 +60,44 @@ const a = "focus-outline", D = {
60
60
  ariaLabel: w,
61
61
  ariaLabelledBy: N,
62
62
  ariaDescribedBy: v,
63
- isPressed: x,
64
- onClick: k,
65
- onKeyboardActivate: C,
66
- ...E
67
- }, $) => {
63
+ onClick: x,
64
+ onKeyboardActivate: k,
65
+ ...C
66
+ }, E) => {
68
67
  const m = e === "unstyled", {
69
- pressProps: P,
68
+ pressProps: $,
70
69
  isDisabled: d
71
- } = z({
70
+ } = R({
72
71
  disabled: y,
73
72
  loading: o,
74
73
  isNative: !0,
75
74
  // native <button> => hook does NOT add Enter/Space onKeyDown
76
- pressed: x,
77
- onClick: k,
78
- onKeyboardActivate: C
79
- }), j = !m && e !== "link" ? p[s] : "", A = m ? "" : U[n], B = d ? D[e] : p[e], l = i?.name ? {
75
+ onClick: x,
76
+ onKeyboardActivate: k
77
+ }), P = !m && e !== "link" ? p[s] : "", j = m ? "" : D[n], A = d ? z[e] : p[e], l = i?.name ? {
80
78
  ...i,
81
79
  stroke: d ? "var(--color-gray-600)" : i.stroke
82
- } : void 0, O = ["se-design-button", A, j, B, f, m ? "" : "rounded-[6px] flex gap-1 items-center min-w-fit"].filter(Boolean).join(" "), _ = R({
80
+ } : void 0, B = ["se-design-button", j, P, A, f, m ? "" : "rounded-[6px] flex gap-1 items-center min-w-fit"].filter(Boolean).join(" "), O = I({
83
81
  ariaLabel: w,
84
82
  ariaLabelledBy: N,
85
83
  ariaDescribedBy: v
86
84
  });
87
85
  return /* @__PURE__ */ r.createElement("button", c({
88
- ref: $,
86
+ ref: E,
89
87
  type: "button",
90
- className: O,
88
+ className: B,
91
89
  disabled: d,
92
90
  autoFocus: h,
93
91
  "data-automation-id": g
94
- }, E, P, _), o && /* @__PURE__ */ r.createElement("div", {
92
+ }, C, $, O), o && /* @__PURE__ */ r.createElement("div", {
95
93
  "aria-hidden": "true",
96
94
  className: "animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full"
97
95
  }), !o && l?.name && u === "left" && /* @__PURE__ */ r.createElement(b, l), t && /* @__PURE__ */ r.createElement("span", {
98
96
  className: "button-label [font-weight:inherit]"
99
97
  }, t), !o && l?.name && u === "right" && /* @__PURE__ */ r.createElement(b, l));
100
98
  });
101
- q.displayName = "Button";
99
+ U.displayName = "Button";
102
100
  export {
103
- q as Button
101
+ U as Button
104
102
  };
105
103
  //# sourceMappingURL=index3.js.map