@backstage/ui 0.17.2-next.0 → 0.18.0-next.2

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 (159) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/analytics/useAnalytics.esm.js +5 -5
  3. package/dist/analytics/useAnalytics.esm.js.map +1 -1
  4. package/dist/components/Accordion/definition.esm.js +3 -1
  5. package/dist/components/Accordion/definition.esm.js.map +1 -1
  6. package/dist/components/Alert/definition.esm.js +3 -1
  7. package/dist/components/Alert/definition.esm.js.map +1 -1
  8. package/dist/components/Avatar/definition.esm.js +3 -1
  9. package/dist/components/Avatar/definition.esm.js.map +1 -1
  10. package/dist/components/Badge/definition.esm.js +3 -1
  11. package/dist/components/Badge/definition.esm.js.map +1 -1
  12. package/dist/components/Box/definition.esm.js +3 -1
  13. package/dist/components/Box/definition.esm.js.map +1 -1
  14. package/dist/components/Button/definition.esm.js +3 -1
  15. package/dist/components/Button/definition.esm.js.map +1 -1
  16. package/dist/components/ButtonIcon/definition.esm.js +3 -1
  17. package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
  18. package/dist/components/ButtonLink/ButtonLink.esm.js +39 -23
  19. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  20. package/dist/components/ButtonLink/definition.esm.js +4 -1
  21. package/dist/components/ButtonLink/definition.esm.js.map +1 -1
  22. package/dist/components/Card/Card.esm.js +2 -1
  23. package/dist/components/Card/Card.esm.js.map +1 -1
  24. package/dist/components/Card/definition.esm.js +3 -1
  25. package/dist/components/Card/definition.esm.js.map +1 -1
  26. package/dist/components/Checkbox/definition.esm.js +3 -1
  27. package/dist/components/Checkbox/definition.esm.js.map +1 -1
  28. package/dist/components/CheckboxGroup/definition.esm.js +3 -1
  29. package/dist/components/CheckboxGroup/definition.esm.js.map +1 -1
  30. package/dist/components/Combobox/ComboboxItem.esm.js +37 -11
  31. package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -1
  32. package/dist/components/Combobox/definition.esm.js +4 -1
  33. package/dist/components/Combobox/definition.esm.js.map +1 -1
  34. package/dist/components/Container/definition.esm.js +3 -1
  35. package/dist/components/Container/definition.esm.js.map +1 -1
  36. package/dist/components/DatePicker/definition.esm.js +3 -1
  37. package/dist/components/DatePicker/definition.esm.js.map +1 -1
  38. package/dist/components/DateRangePicker/definition.esm.js +3 -1
  39. package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
  40. package/dist/components/Dialog/definition.esm.js +3 -1
  41. package/dist/components/Dialog/definition.esm.js.map +1 -1
  42. package/dist/components/FieldError/definition.esm.js +3 -1
  43. package/dist/components/FieldError/definition.esm.js.map +1 -1
  44. package/dist/components/FieldLabel/definition.esm.js +3 -1
  45. package/dist/components/FieldLabel/definition.esm.js.map +1 -1
  46. package/dist/components/Flex/definition.esm.js +3 -1
  47. package/dist/components/Flex/definition.esm.js.map +1 -1
  48. package/dist/components/FullPage/definition.esm.js +3 -1
  49. package/dist/components/FullPage/definition.esm.js.map +1 -1
  50. package/dist/components/Grid/definition.esm.js +3 -1
  51. package/dist/components/Grid/definition.esm.js.map +1 -1
  52. package/dist/components/Header/HeaderMetadataStatus.esm.js +3 -1
  53. package/dist/components/Header/HeaderMetadataStatus.esm.js.map +1 -1
  54. package/dist/components/Header/HeaderMetadataUsers.esm.js +3 -1
  55. package/dist/components/Header/HeaderMetadataUsers.esm.js.map +1 -1
  56. package/dist/components/Header/HeaderNav.esm.js +67 -24
  57. package/dist/components/Header/HeaderNav.esm.js.map +1 -1
  58. package/dist/components/Header/HeaderNavDefinition.esm.js +4 -1
  59. package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
  60. package/dist/components/Header/definition.esm.js +3 -1
  61. package/dist/components/Header/definition.esm.js.map +1 -1
  62. package/dist/components/Link/Link.esm.js +64 -23
  63. package/dist/components/Link/Link.esm.js.map +1 -1
  64. package/dist/components/Link/definition.esm.js +4 -1
  65. package/dist/components/Link/definition.esm.js.map +1 -1
  66. package/dist/components/List/List.esm.js +3 -2
  67. package/dist/components/List/List.esm.js.map +1 -1
  68. package/dist/components/List/definition.esm.js +3 -1
  69. package/dist/components/List/definition.esm.js.map +1 -1
  70. package/dist/components/Menu/Menu.esm.js +48 -14
  71. package/dist/components/Menu/Menu.esm.js.map +1 -1
  72. package/dist/components/Menu/definition.esm.js +5 -1
  73. package/dist/components/Menu/definition.esm.js.map +1 -1
  74. package/dist/components/NumberField/definition.esm.js +3 -1
  75. package/dist/components/NumberField/definition.esm.js.map +1 -1
  76. package/dist/components/PasswordField/definition.esm.js +3 -1
  77. package/dist/components/PasswordField/definition.esm.js.map +1 -1
  78. package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js +3 -1
  79. package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js.map +1 -1
  80. package/dist/components/PluginHeader/definition.esm.js +3 -1
  81. package/dist/components/PluginHeader/definition.esm.js.map +1 -1
  82. package/dist/components/Popover/definition.esm.js +3 -1
  83. package/dist/components/Popover/definition.esm.js.map +1 -1
  84. package/dist/components/RadioGroup/definition.esm.js +3 -1
  85. package/dist/components/RadioGroup/definition.esm.js.map +1 -1
  86. package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js +23 -5
  87. package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
  88. package/dist/components/SearchAutocomplete/definition.esm.js +4 -1
  89. package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
  90. package/dist/components/SearchField/definition.esm.js +3 -1
  91. package/dist/components/SearchField/definition.esm.js.map +1 -1
  92. package/dist/components/Select/SelectItem.esm.js +17 -3
  93. package/dist/components/Select/SelectItem.esm.js.map +1 -1
  94. package/dist/components/Select/definition.esm.js +4 -1
  95. package/dist/components/Select/definition.esm.js.map +1 -1
  96. package/dist/components/Skeleton/definition.esm.js +3 -1
  97. package/dist/components/Skeleton/definition.esm.js.map +1 -1
  98. package/dist/components/Slider/definition.esm.js +3 -1
  99. package/dist/components/Slider/definition.esm.js.map +1 -1
  100. package/dist/components/Switch/definition.esm.js +3 -1
  101. package/dist/components/Switch/definition.esm.js.map +1 -1
  102. package/dist/components/Table/components/Row.esm.js +9 -9
  103. package/dist/components/Table/components/Row.esm.js.map +1 -1
  104. package/dist/components/Table/components/TableBodySkeleton.esm.js +3 -1
  105. package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
  106. package/dist/components/Table/components/TableRoot.esm.js +3 -2
  107. package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
  108. package/dist/components/Table/definition.esm.js +3 -2
  109. package/dist/components/Table/definition.esm.js.map +1 -1
  110. package/dist/components/Table/hooks/useCompletePagination.esm.js +45 -15
  111. package/dist/components/Table/hooks/useCompletePagination.esm.js.map +1 -1
  112. package/dist/components/Table/hooks/useDebouncedReload.esm.js +5 -4
  113. package/dist/components/Table/hooks/useDebouncedReload.esm.js.map +1 -1
  114. package/dist/components/Table/hooks/usePageCache.esm.js +7 -4
  115. package/dist/components/Table/hooks/usePageCache.esm.js.map +1 -1
  116. package/dist/components/TablePagination/TablePagination.esm.js +3 -1
  117. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  118. package/dist/components/TablePagination/definition.esm.js +3 -1
  119. package/dist/components/TablePagination/definition.esm.js.map +1 -1
  120. package/dist/components/Tabs/Tabs.esm.js +38 -15
  121. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  122. package/dist/components/Tabs/definition.esm.js +4 -1
  123. package/dist/components/Tabs/definition.esm.js.map +1 -1
  124. package/dist/components/TagGroup/TagGroup.esm.js +12 -12
  125. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  126. package/dist/components/TagGroup/definition.esm.js +3 -2
  127. package/dist/components/TagGroup/definition.esm.js.map +1 -1
  128. package/dist/components/Text/definition.esm.js +3 -1
  129. package/dist/components/Text/definition.esm.js.map +1 -1
  130. package/dist/components/TextAreaField/definition.esm.js +3 -1
  131. package/dist/components/TextAreaField/definition.esm.js.map +1 -1
  132. package/dist/components/TextField/definition.esm.js +3 -1
  133. package/dist/components/TextField/definition.esm.js.map +1 -1
  134. package/dist/components/ToggleButton/definition.esm.js +3 -1
  135. package/dist/components/ToggleButton/definition.esm.js.map +1 -1
  136. package/dist/components/ToggleButtonGroup/definition.esm.js +3 -1
  137. package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
  138. package/dist/components/Tooltip/definition.esm.js +3 -1
  139. package/dist/components/Tooltip/definition.esm.js.map +1 -1
  140. package/dist/components/VisuallyHidden/definition.esm.js +3 -1
  141. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
  142. package/dist/hooks/useDefinition/useDefinition.esm.js +8 -13
  143. package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
  144. package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js +50 -0
  145. package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js.map +1 -0
  146. package/dist/index.d.ts +43 -8
  147. package/dist/navigation/BUIRoutingProvider.esm.js +44 -0
  148. package/dist/navigation/BUIRoutingProvider.esm.js.map +1 -0
  149. package/dist/navigation/useNavigation.esm.js +130 -0
  150. package/dist/navigation/useNavigation.esm.js.map +1 -0
  151. package/dist/navigation/useRouting.esm.js +27 -0
  152. package/dist/navigation/useRouting.esm.js.map +1 -0
  153. package/dist/provider/BUIContext.esm.js +6 -0
  154. package/dist/provider/BUIContext.esm.js.map +1 -0
  155. package/dist/provider/BUIProvider.esm.js +5 -13
  156. package/dist/provider/BUIProvider.esm.js.map +1 -1
  157. package/dist/utils/linkUtils.esm.js +6 -12
  158. package/dist/utils/linkUtils.esm.js.map +1 -1
  159. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TextAreaField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TextAreaFieldOwnProps } from './types';\nimport styles from './TextAreaField.module.css';\n\n/**\n * Component definition for TextAreaField\n * @public\n */\nexport const TextAreaFieldDefinition = defineComponent<TextAreaFieldOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-TextAreaField',\n textArea: 'bui-TextArea',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n placeholder: {},\n rows: { default: 3 },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,EAAA,EAAI,UAAA;AAAA,IACJ,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,MAC9C,WAAW,EAAC;AAAA,MACZ,aAAa,EAAC;AAAA,MACd,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACnB,OAAO,EAAC;AAAA,MACR,aAAa,EAAC;AAAA,MACd,gBAAgB;AAAC;AACnB;AAEJ;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TextAreaField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TextAreaFieldOwnProps } from './types';\nimport styles from './TextAreaField.module.css';\n\n/**\n * Component definition for TextAreaField\n * @public\n */\nexport const TextAreaFieldDefinition = defineComponent<TextAreaFieldOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-TextAreaField',\n textArea: 'bui-TextArea',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n placeholder: {},\n rows: { default: 3 },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,EAAA,EAAI,UAAA;AAAA,IACJ,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,MAC9C,WAAW,EAAC;AAAA,MACZ,aAAa,EAAC;AAAA,MACd,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,MACnB,OAAO,EAAC;AAAA,MACR,aAAa,EAAC;AAAA,MACd,gBAAgB;AAAC;AACnB;AAEJ;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './TextField.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TextField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TextFieldOwnProps } from './types';\nimport styles from './TextField.module.css';\n\n/**\n * Component definition for TextField\n * @public\n */\nexport const TextFieldDefinition = defineComponent<TextFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TextField',\n inputWrapper: 'bui-InputWrapper',\n input: 'bui-Input',\n inputIcon: 'bui-InputIcon',\n inputAction: 'bui-InputAction',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: {},\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,mBAAA,GAAsB,iBAAmC,CAAE;AAAA,EACtE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,YAAA,EAAc,kBAAA;AAAA,IACd,KAAA,EAAO,WAAA;AAAA,IACP,SAAA,EAAW,eAAA;AAAA,IACX,WAAA,EAAa;AAAA,GACf;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,gBAAgB;AAAC;AAErB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TextField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TextFieldOwnProps } from './types';\nimport styles from './TextField.module.css';\n\n/**\n * Component definition for TextField\n * @public\n */\nexport const TextFieldDefinition = defineComponent<TextFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TextField',\n inputWrapper: 'bui-InputWrapper',\n input: 'bui-Input',\n inputIcon: 'bui-InputIcon',\n inputAction: 'bui-InputAction',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: {},\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,mBAAA,GAAsB,iBAAmC,CAAE;AAAA,EACtE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,YAAA,EAAc,kBAAA;AAAA,IACd,KAAA,EAAO,WAAA;AAAA,IACP,SAAA,EAAW,eAAA;AAAA,IACX,WAAA,EAAa;AAAA,GACf;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,gBAAgB;AAAC;AAErB,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './ToggleButton.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ToggleButton/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ToggleButtonOwnProps } from './types';\nimport styles from './ToggleButton.module.css';\n\n/**\n * Component definition for ToggleButton\n * @public\n */\nexport const ToggleButtonDefinition = defineComponent<ToggleButtonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ToggleButton',\n content: 'bui-ToggleButtonContent',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ToggleButton/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ToggleButtonOwnProps } from './types';\nimport styles from './ToggleButton.module.css';\n\n/**\n * Component definition for ToggleButton\n * @public\n */\nexport const ToggleButtonDefinition = defineComponent<ToggleButtonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ToggleButton',\n content: 'bui-ToggleButtonContent',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './ToggleButtonGroup.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ToggleButtonGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ToggleButtonGroupOwnProps } from './types';\nimport styles from './ToggleButtonGroup.module.css';\n\n/**\n * Component definition for ToggleButtonGroup\n * @public\n */\nexport const ToggleButtonGroupDefinition =\n defineComponent<ToggleButtonGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ToggleButtonGroup',\n },\n propDefs: {\n className: {},\n children: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,2BAAA,GACX,iBAA2C,CAAE;AAAA,EAC3C,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,UAAU;AAAC;AAEf,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ToggleButtonGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ToggleButtonGroupOwnProps } from './types';\nimport styles from './ToggleButtonGroup.module.css';\n\n/**\n * Component definition for ToggleButtonGroup\n * @public\n */\nexport const ToggleButtonGroupDefinition =\n defineComponent<ToggleButtonGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ToggleButtonGroup',\n },\n propDefs: {\n className: {},\n children: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,2BAAA,GACX,iBAA2C,CAAE;AAAA,EAC3C,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,UAAU;AAAC;AAEf,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Tooltip.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Tooltip/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TooltipOwnProps } from './types';\nimport styles from './Tooltip.module.css';\n\n/**\n * Component definition for Tooltip\n * @public\n */\nexport const TooltipDefinition = defineComponent<TooltipOwnProps>()({\n styles,\n classNames: {\n tooltip: 'bui-Tooltip',\n content: 'bui-TooltipContent',\n arrow: 'bui-TooltipArrow',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,aAAA;AAAA,IACT,OAAA,EAAS,oBAAA;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Tooltip/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TooltipOwnProps } from './types';\nimport styles from './Tooltip.module.css';\n\n/**\n * Component definition for Tooltip\n * @public\n */\nexport const TooltipDefinition = defineComponent<TooltipOwnProps>()({\n styles,\n classNames: {\n tooltip: 'bui-Tooltip',\n content: 'bui-TooltipContent',\n arrow: 'bui-TooltipArrow',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,aAAA;AAAA,IACT,OAAA,EAAS,oBAAA;AAAA,IACT,KAAA,EAAO;AAAA,GACT;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './VisuallyHidden.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/VisuallyHidden/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { VisuallyHiddenOwnProps } from './types';\nimport styles from './VisuallyHidden.module.css';\n\n/**\n * Component definition for VisuallyHidden\n * @public\n */\nexport const VisuallyHiddenDefinition =\n defineComponent<VisuallyHiddenOwnProps>()({\n styles,\n classNames: {\n root: 'bui-VisuallyHidden',\n },\n propDefs: {\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,wBAAA,GACX,iBAAwC,CAAE;AAAA,EACxC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/VisuallyHidden/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { VisuallyHiddenOwnProps } from './types';\nimport styles from './VisuallyHidden.module.css';\n\n/**\n * Component definition for VisuallyHidden\n * @public\n */\nexport const VisuallyHiddenDefinition =\n defineComponent<VisuallyHiddenOwnProps>()({\n styles,\n classNames: {\n root: 'bui-VisuallyHidden',\n },\n propDefs: {\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,wBAAA,GACX,iBAAwC,CAAE;AAAA,EACxC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -4,25 +4,19 @@ import { useBreakpoint } from '../useBreakpoint.esm.js';
4
4
  import { useBgProvider, useBgConsumer, BgProvider } from '../useBg.esm.js';
5
5
  import { resolveDefinitionProps, processUtilityProps } from './helpers.esm.js';
6
6
  import { useAnalytics, noopTracker } from '../../analytics/useAnalytics.esm.js';
7
- import { useInRouterContext, useResolvedPath, createPath } from 'react-router-dom';
8
- import { isExternalLink } from '../../utils/linkUtils.esm.js';
7
+ import { useDefinitionNavigation } from './useDefinitionNavigation.esm.js';
9
8
 
10
9
  function useDefinition(definition, props, options) {
11
10
  const { breakpoint } = useBreakpoint();
12
- let hrefResolvedProps = props;
13
- const hasRouter = useInRouterContext();
14
- if (hasRouter) {
15
- const rawHref = props.href;
16
- const resolved = useResolvedPath(rawHref ?? "");
17
- if (rawHref !== void 0 && !isExternalLink(rawHref)) {
18
- hrefResolvedProps = { ...props, href: createPath(resolved) };
19
- }
20
- }
21
11
  const { ownPropsResolved, restProps } = resolveDefinitionProps(
22
12
  definition,
23
- hrefResolvedProps,
13
+ props,
24
14
  breakpoint
25
15
  );
16
+ let navigation;
17
+ if (definition.navigation) {
18
+ navigation = useDefinitionNavigation(definition.navigation);
19
+ }
26
20
  const dataAttributes = {};
27
21
  for (const [key, config] of Object.entries(definition.propDefs)) {
28
22
  const finalValue = ownPropsResolved[key];
@@ -79,7 +73,8 @@ function useDefinition(definition, props, options) {
79
73
  restProps,
80
74
  dataAttributes,
81
75
  utilityStyle,
82
- ...definition.analytics ? { analytics } : {}
76
+ ...definition.analytics ? { analytics } : {},
77
+ ...definition.navigation ? { navigation } : {}
83
78
  };
84
79
  }
85
80
 
@@ -1 +1 @@
1
- {"version":3,"file":"useDefinition.esm.js","sources":["../../../src/hooks/useDefinition/useDefinition.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { useBreakpoint } from '../useBreakpoint';\nimport { useBgProvider, useBgConsumer, BgProvider } from '../useBg';\nimport { resolveDefinitionProps, processUtilityProps } from './helpers';\nimport { useAnalytics } from '../../analytics/useAnalytics';\nimport { noopTracker } from '../../analytics/useAnalytics';\nimport {\n useResolvedPath,\n useInRouterContext,\n createPath,\n} from 'react-router-dom';\nimport { isExternalLink } from '../../utils/linkUtils';\nimport type {\n ComponentConfig,\n UseDefinitionOptions,\n UseDefinitionResult,\n UtilityKeys,\n} from './types';\n\nexport function useDefinition<\n D extends ComponentConfig<any, any>,\n P extends Record<string, any>,\n>(\n definition: D,\n props: P,\n options?: UseDefinitionOptions<D>,\n): UseDefinitionResult<D, P> {\n const { breakpoint } = useBreakpoint();\n\n let hrefResolvedProps = props;\n const hasRouter = useInRouterContext();\n if (hasRouter) {\n const rawHref = (props as any).href;\n const resolved = useResolvedPath(rawHref ?? '');\n if (rawHref !== undefined && !isExternalLink(rawHref)) {\n hrefResolvedProps = { ...props, href: createPath(resolved) } as P;\n }\n }\n\n // Resolve all props centrally — applies responsive values and defaults\n const { ownPropsResolved, restProps } = resolveDefinitionProps(\n definition,\n hrefResolvedProps,\n breakpoint,\n );\n\n const dataAttributes: Record<string, string | undefined> = {};\n\n for (const [key, config] of Object.entries(definition.propDefs)) {\n const finalValue = ownPropsResolved[key];\n\n if (finalValue !== undefined) {\n // Skip data-bg for bg prop when the provider path handles it\n if (key === 'bg' && definition.bg === 'provider') continue;\n\n if ((config as any).dataAttribute) {\n // eslint-disable-next-line no-restricted-syntax\n dataAttributes[`data-${key.toLowerCase()}`] = String(finalValue);\n }\n }\n }\n\n // Provider: resolve bg and provide context for children\n const providerBg = useBgProvider(\n definition.bg === 'provider' ? ownPropsResolved.bg : undefined,\n );\n\n // Consumer: read parent context bg\n const consumerBg = useBgConsumer();\n\n // Provider: set data-bg from the resolved provider bg\n if (definition.bg === 'provider' && providerBg.bg !== undefined) {\n dataAttributes['data-bg'] = String(providerBg.bg);\n }\n\n // Consumer: set data-on-bg from the parent context\n if (definition.bg === 'consumer' && consumerBg.bg !== undefined) {\n dataAttributes['data-on-bg'] = String(consumerBg.bg);\n }\n\n const { utilityClasses, utilityStyle } = processUtilityProps<UtilityKeys<D>>(\n props,\n (definition.utilityProps ?? []) as readonly UtilityKeys<D>[],\n );\n\n // Analytics: conditionally call useAnalytics based on definition flag\n let analytics = noopTracker;\n if (definition.analytics) {\n const tracker = useAnalytics();\n analytics = ownPropsResolved.noTrack ? noopTracker : tracker;\n }\n\n const utilityTarget =\n options?.utilityTarget !== undefined ? options.utilityTarget : 'root';\n const classNameTarget =\n options?.classNameTarget !== undefined ? options.classNameTarget : 'root';\n\n const classes: Record<string, string> = {};\n\n for (const [name, cssKey] of Object.entries(definition.classNames)) {\n classes[name] = clsx(\n cssKey as string,\n definition.styles[cssKey as keyof typeof definition.styles],\n utilityTarget === name && utilityClasses,\n classNameTarget === name && ownPropsResolved.className,\n );\n }\n\n let children: ReactNode | undefined;\n let childrenWithBgProvider: ReactNode | undefined;\n\n if (definition.bg === 'provider') {\n childrenWithBgProvider = providerBg.bg ? (\n <BgProvider bg={providerBg.bg}>{props.children}</BgProvider>\n ) : (\n props.children\n );\n } else {\n children = props.children;\n }\n\n return {\n ownProps: {\n classes,\n ...ownPropsResolved,\n ...(definition.bg === 'provider'\n ? { childrenWithBgProvider }\n : { children }),\n },\n restProps,\n dataAttributes,\n utilityStyle,\n ...(definition.analytics ? { analytics } : {}),\n } as unknown as UseDefinitionResult<D, P>;\n}\n"],"names":[],"mappings":";;;;;;;;;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AiB;AAAA,KAC/C;AAAA,EACF;AAEA,EAAA,IAAI,QAAA;AACJ,EAAA,IAAI,sBAAA;AAEJ,EAAA,IAAI,UAAA,CAAW,OAAO,UAAA,EAAY;AAChC,IAAA,sBAAA,GAAyB,UAAA,CAAW,EAAA,mBAClC,GAAA,CAAC,UAAA,EAAA,EAAW,EAAA,EAAI,WAAW,EAAA,EAAK,QAAA,EAAA,KAAA,CAAM,QAAA,EAAS,CAAA,GAE/C,KAAA,CAAM,QAAA;AAAA,EAEV,CAAA,MAAO;AACL,IAAA,QAAA,GAAW,KAAA,CAAM,QAAA;AAAA,EACnB;AAEA,EAAA,OAAO;AAAA,IACL,QAAA,EAAU;AAAA,MACR,OAAA;AAAA,MACA,GAAG,gBAAA;AAAA,MACH,GAAI,WAAW,EAAA,KAAO,UAAA,GAClB,EAAE,sBAAA,EAAuB,GACzB,EAAE,QAAA;AAAS,KACjB;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IACA,GAAI,UAAA,CAAW,SAAA,GAAY,EAAE,SAAA,KAAc;AAAC,GAC9C;AACF;;;;"}
1
+ {"version":3,"file":"useDefinition.esm.js","sources":["../../../src/hooks/useDefinition/useDefinition.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { useBreakpoint } from '../useBreakpoint';\nimport { useBgProvider, useBgConsumer, BgProvider } from '../useBg';\nimport { resolveDefinitionProps, processUtilityProps } from './helpers';\nimport { useAnalytics } from '../../analytics/useAnalytics';\nimport { noopTracker } from '../../analytics/useAnalytics';\nimport { useDefinitionNavigation } from './useDefinitionNavigation';\nimport type {\n ComponentConfig,\n UseDefinitionOptions,\n UseDefinitionResult,\n UtilityKeys,\n} from './types';\n\nexport function useDefinition<\n D extends ComponentConfig<any, any>,\n P extends Record<string, any>,\n>(\n definition: D,\n props: P,\n options?: UseDefinitionOptions<D>,\n): UseDefinitionResult<D, P> {\n const { breakpoint } = useBreakpoint();\n\n // Resolve all props centrally — applies responsive values and defaults\n const { ownPropsResolved, restProps } = resolveDefinitionProps(\n definition,\n props,\n breakpoint,\n );\n\n let navigation;\n if (definition.navigation) {\n // Component definitions are module constants, so this hook condition is\n // stable for the lifetime of the component.\n navigation = useDefinitionNavigation(definition.navigation);\n }\n\n const dataAttributes: Record<string, string | undefined> = {};\n\n for (const [key, config] of Object.entries(definition.propDefs)) {\n const finalValue = ownPropsResolved[key];\n\n if (finalValue !== undefined) {\n // Skip data-bg for bg prop when the provider path handles it\n if (key === 'bg' && definition.bg === 'provider') continue;\n\n if ((config as any).dataAttribute) {\n // eslint-disable-next-line no-restricted-syntax\n dataAttributes[`data-${key.toLowerCase()}`] = String(finalValue);\n }\n }\n }\n\n // Provider: resolve bg and provide context for children\n const providerBg = useBgProvider(\n definition.bg === 'provider' ? ownPropsResolved.bg : undefined,\n );\n\n // Consumer: read parent context bg\n const consumerBg = useBgConsumer();\n\n // Provider: set data-bg from the resolved provider bg\n if (definition.bg === 'provider' && providerBg.bg !== undefined) {\n dataAttributes['data-bg'] = String(providerBg.bg);\n }\n\n // Consumer: set data-on-bg from the parent context\n if (definition.bg === 'consumer' && consumerBg.bg !== undefined) {\n dataAttributes['data-on-bg'] = String(consumerBg.bg);\n }\n\n const { utilityClasses, utilityStyle } = processUtilityProps<UtilityKeys<D>>(\n props,\n (definition.utilityProps ?? []) as readonly UtilityKeys<D>[],\n );\n\n // Analytics: conditionally call useAnalytics based on definition flag\n let analytics = noopTracker;\n if (definition.analytics) {\n const tracker = useAnalytics();\n analytics = ownPropsResolved.noTrack ? noopTracker : tracker;\n }\n\n const utilityTarget =\n options?.utilityTarget !== undefined ? options.utilityTarget : 'root';\n const classNameTarget =\n options?.classNameTarget !== undefined ? options.classNameTarget : 'root';\n\n const classes: Record<string, string> = {};\n\n for (const [name, cssKey] of Object.entries(definition.classNames)) {\n classes[name] = clsx(\n cssKey as string,\n definition.styles[cssKey as keyof typeof definition.styles],\n utilityTarget === name && utilityClasses,\n classNameTarget === name && ownPropsResolved.className,\n );\n }\n\n let children: ReactNode | undefined;\n let childrenWithBgProvider: ReactNode | undefined;\n\n if (definition.bg === 'provider') {\n childrenWithBgProvider = providerBg.bg ? (\n <BgProvider bg={providerBg.bg}>{props.children}</BgProvider>\n ) : (\n props.children\n );\n } else {\n children = props.children;\n }\n\n return {\n ownProps: {\n classes,\n ...ownPropsResolved,\n ...(definition.bg === 'provider'\n ? { childrenWithBgProvider }\n : { children }),\n },\n restProps,\n dataAttributes,\n utilityStyle,\n ...(definition.analytics ? { analytics } : {}),\n ...(definition.navigation ? { navigation } : {}),\n } as unknown as UseDefinitionResult<D, P>;\n}\n"],"names":[],"mappings":";;;;;;;;AA+BO,SAAS,aAAA,CAId,UAAA,EACA,KAAA,EACA,OAAA,EAC2B;AAC3B,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,aAAA,EAAc;AAGrC,EAAA,MAAM,EAAE,gBAAA,EAAkB,SAAA,EAAU,GAAI,sBAAA;AAAA,IACtC,UAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,IAAI,UAAA;AACJ,EAAA,IAAI,WAAW,UAAA,EAAY;AAGzB,IAAA,UAAA,GAAa,uBAAA,CAAwB,WAAW,UAAU,CAAA;AAAA,EAC5D;AAEA,EAAA,MAAM,iBAAqD,EAAC;AAE5D,EAAA,KAAA,MAAW,CAAC,KAAK,MAAM,CAAA,IAAK,OAAO,OAAA,CAAQ,UAAA,CAAW,QAAQ,CAAA,EAAG;AAC/D,I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 'react/jsx-runtime';
2
+ import { useAnchorNavigation } from '../../navigation/useNavigation.esm.js';
3
+ import { useRoutingIntegration } from '../../navigation/useRouting.esm.js';
4
+
5
+ function NavigationView({
6
+ navigation,
7
+ view: View,
8
+ viewProps
9
+ }) {
10
+ const props = { ...viewProps, navigation };
11
+ return /* @__PURE__ */ jsx(View, { ...props });
12
+ }
13
+ function RoutedAnchorNavigation({
14
+ props,
15
+ view,
16
+ viewProps
17
+ }) {
18
+ const navigation = useAnchorNavigation(props);
19
+ return /* @__PURE__ */ jsx(NavigationView, { navigation, view, viewProps });
20
+ }
21
+ function NativeAnchorNavigation({
22
+ props,
23
+ view,
24
+ viewProps
25
+ }) {
26
+ let navigation = {
27
+ type: "none",
28
+ canMatchRoute: false
29
+ };
30
+ if (props.href) {
31
+ navigation = {
32
+ type: "native",
33
+ canMatchRoute: false,
34
+ ariaHref: props.href,
35
+ browserHref: props.href
36
+ };
37
+ }
38
+ return /* @__PURE__ */ jsx(NavigationView, { navigation, view, viewProps });
39
+ }
40
+ function useDefinitionNavigation(_config) {
41
+ const routing = useRoutingIntegration({ fallback: true });
42
+ const inRouterContext = routing.useInRouterContext();
43
+ if (inRouterContext) {
44
+ return RoutedAnchorNavigation;
45
+ }
46
+ return NativeAnchorNavigation;
47
+ }
48
+
49
+ export { useDefinitionNavigation };
50
+ //# sourceMappingURL=useDefinitionNavigation.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDefinitionNavigation.esm.js","sources":["../../../src/hooks/useDefinition/useDefinitionNavigation.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComponentType, ReactElement } from 'react';\nimport {\n useAnchorNavigation,\n type AnchorNavigation,\n type NavigationProps,\n} from '../../navigation/useNavigation';\nimport { useRoutingIntegration } from '../../navigation/useRouting';\nimport type {\n DefinitionNavigationComponent,\n DefinitionNavigationConfig,\n} from './types';\n\ntype NavigationResolverProps<N, P extends object> = {\n props: NavigationProps;\n view: ComponentType<P & { navigation: N }>;\n viewProps: P;\n};\n\ntype AnchorNavigationProps<P extends object> = NavigationResolverProps<\n AnchorNavigation,\n P\n>;\n\nfunction NavigationView<N, P extends object>({\n navigation,\n view: View,\n viewProps,\n}: Omit<NavigationResolverProps<N, P>, 'props'> & {\n navigation: N;\n}): ReactElement {\n const props = { ...viewProps, navigation } as P & { navigation: N };\n return <View {...props} />;\n}\n\nfunction RoutedAnchorNavigation<P extends object>({\n props,\n view,\n viewProps,\n}: AnchorNavigationProps<P>): ReactElement {\n const navigation = useAnchorNavigation(props);\n return (\n <NavigationView navigation={navigation} view={view} viewProps={viewProps} />\n );\n}\n\nfunction NativeAnchorNavigation<P extends object>({\n props,\n view,\n viewProps,\n}: AnchorNavigationProps<P>): ReactElement {\n let navigation: AnchorNavigation = {\n type: 'none',\n canMatchRoute: false,\n };\n if (props.href) {\n navigation = {\n type: 'native',\n canMatchRoute: false,\n ariaHref: props.href,\n browserHref: props.href,\n };\n }\n\n return (\n <NavigationView navigation={navigation} view={view} viewProps={viewProps} />\n );\n}\n\n/**\n * Selects a resolver component so router-specific hooks only mount when a\n * React Router context is available. The resolver injects the normalized\n * navigation into the component view as an ordinary React prop.\n */\nexport function useDefinitionNavigation(\n _config: DefinitionNavigationConfig,\n): DefinitionNavigationComponent {\n const routing = useRoutingIntegration({ fallback: true });\n const inRouterContext = routing.useInRouterContext();\n\n if (inRouterContext) {\n return RoutedAnchorNavigation;\n }\n return NativeAnchorNavigation;\n}\n"],"names":[],"mappings":";;;;AAuCA,SAAS,cAAA,CAAoC;AAAA,EAC3C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-1491,7 +1491,7 @@ type TabOwnProps = {
1491
1491
  *
1492
1492
  * @public
1493
1493
  */
1494
- interface TabProps extends TabOwnProps, Omit<TabProps$1, keyof TabOwnProps> {
1494
+ interface TabProps extends TabOwnProps, Omit<TabProps$1, keyof TabOwnProps | 'render'> {
1495
1495
  }
1496
1496
  /**
1497
1497
  * Own props for the TabPanel component.
@@ -1894,6 +1894,9 @@ declare const HeaderNavItemDefinition: {
1894
1894
  readonly root: "bui-HeaderNavItem";
1895
1895
  };
1896
1896
  readonly analytics: true;
1897
+ readonly navigation: {
1898
+ readonly type: "anchor";
1899
+ };
1897
1900
  readonly propDefs: {
1898
1901
  readonly noTrack: {};
1899
1902
  readonly id: {};
@@ -2012,7 +2015,7 @@ type ButtonLinkOwnProps = {
2012
2015
  *
2013
2016
  * @public
2014
2017
  */
2015
- interface ButtonLinkProps extends Omit<LinkProps$1, keyof ButtonLinkOwnProps>, ButtonLinkOwnProps {
2018
+ interface ButtonLinkProps extends Omit<LinkProps$1, keyof ButtonLinkOwnProps | 'render'>, ButtonLinkOwnProps {
2016
2019
  }
2017
2020
 
2018
2021
  /**
@@ -2036,6 +2039,9 @@ declare const ButtonLinkDefinition: {
2036
2039
  };
2037
2040
  readonly bg: "consumer";
2038
2041
  readonly analytics: true;
2042
+ readonly navigation: {
2043
+ readonly type: "anchor";
2044
+ };
2039
2045
  readonly propDefs: {
2040
2046
  readonly noTrack: {};
2041
2047
  readonly size: {
@@ -2413,7 +2419,7 @@ type ComboboxItemOwnProps = {
2413
2419
  className?: string;
2414
2420
  };
2415
2421
  /** @public */
2416
- type ComboboxItemProps<T extends object = object> = ComboboxItemOwnProps & Omit<ListBoxItemProps<T>, keyof ComboboxItemOwnProps>;
2422
+ type ComboboxItemProps<T extends object = object> = ComboboxItemOwnProps & Omit<ListBoxItemProps<T>, keyof ComboboxItemOwnProps | 'render'>;
2417
2423
  /** @public */
2418
2424
  type ComboboxItemTextOwnProps = {
2419
2425
  title: string;
@@ -2560,6 +2566,9 @@ declare const ComboboxItemDefinition: {
2560
2566
  readonly indicator: "bui-ComboboxItemIndicator";
2561
2567
  readonly content: "bui-ComboboxItemContent";
2562
2568
  };
2569
+ readonly navigation: {
2570
+ readonly type: "anchor";
2571
+ };
2563
2572
  readonly propDefs: {
2564
2573
  readonly children: {};
2565
2574
  readonly textValue: {};
@@ -3134,6 +3143,12 @@ interface QueryOptions<TFilter> {
3134
3143
  }
3135
3144
  /** @public */
3136
3145
  interface PaginationOptions extends Partial<Pick<TablePaginationProps, 'pageSize' | 'pageSizeOptions' | 'onPageSizeChange' | 'onNextPage' | 'onPreviousPage' | 'showPageSizeOptions' | 'getLabel' | 'showPaginationLabel'>> {
3146
+ /**
3147
+ * The zero-based item offset to use for the initial page.
3148
+ *
3149
+ * In complete mode, the offset is adjusted to the last available page if
3150
+ * the data later becomes too short for the current page.
3151
+ */
3137
3152
  initialOffset?: number;
3138
3153
  }
3139
3154
  /** @public */
@@ -3190,6 +3205,11 @@ type UseTableCompleteOptions<T extends TableItem, TFilter = unknown> = QueryOpti
3190
3205
  */
3191
3206
  filterDebounceMs?: number;
3192
3207
  } & ({
3208
+ /**
3209
+ * Controlled table data. Set to `undefined` while loading new data;
3210
+ * the previous data and pagination metadata remain visible and are
3211
+ * reported as stale.
3212
+ */
3193
3213
  data: T[] | undefined;
3194
3214
  getData?: never;
3195
3215
  } | {
@@ -3740,7 +3760,7 @@ type MenuItemOwnProps = {
3740
3760
  className?: string;
3741
3761
  };
3742
3762
  /** @public */
3743
- interface MenuItemProps extends MenuItemOwnProps, Omit<MenuItemProps$1, keyof MenuItemOwnProps> {
3763
+ interface MenuItemProps extends MenuItemOwnProps, Omit<MenuItemProps$1, keyof MenuItemOwnProps | 'render'> {
3744
3764
  }
3745
3765
  /** @public */
3746
3766
  type MenuListBoxItemOwnProps = {
@@ -3748,7 +3768,7 @@ type MenuListBoxItemOwnProps = {
3748
3768
  className?: string;
3749
3769
  };
3750
3770
  /** @public */
3751
- interface MenuListBoxItemProps extends MenuListBoxItemOwnProps, Omit<ListBoxItemProps, keyof MenuListBoxItemOwnProps> {
3771
+ interface MenuListBoxItemProps extends MenuListBoxItemOwnProps, Omit<ListBoxItemProps, keyof MenuListBoxItemOwnProps | 'render'> {
3752
3772
  }
3753
3773
  /** @public */
3754
3774
  type MenuSectionOwnProps = {
@@ -3962,7 +3982,7 @@ type SearchAutocompleteItemOwnProps = {
3962
3982
  className?: string;
3963
3983
  };
3964
3984
  /** @public */
3965
- interface SearchAutocompleteItemProps extends SearchAutocompleteItemOwnProps, Omit<ListBoxItemProps, keyof SearchAutocompleteItemOwnProps> {
3985
+ interface SearchAutocompleteItemProps extends SearchAutocompleteItemOwnProps, Omit<ListBoxItemProps, keyof SearchAutocompleteItemOwnProps | 'render'> {
3966
3986
  }
3967
3987
 
3968
3988
  /**
@@ -4104,7 +4124,7 @@ type LinkOwnProps = {
4104
4124
  className?: string;
4105
4125
  };
4106
4126
  /** @public */
4107
- interface LinkProps extends Omit<LinkProps$1, 'children' | 'className'>, LinkOwnProps {
4127
+ interface LinkProps extends Omit<LinkProps$1, 'children' | 'className' | 'render'>, LinkOwnProps {
4108
4128
  }
4109
4129
 
4110
4130
  /**
@@ -4126,6 +4146,9 @@ declare const LinkDefinition: {
4126
4146
  readonly root: "bui-Link";
4127
4147
  };
4128
4148
  readonly analytics: true;
4149
+ readonly navigation: {
4150
+ readonly type: "anchor";
4151
+ };
4129
4152
  readonly propDefs: {
4130
4153
  readonly noTrack: {};
4131
4154
  readonly variant: {
@@ -4458,7 +4481,7 @@ type SelectItemOwnProps = {
4458
4481
  className?: string;
4459
4482
  };
4460
4483
  /** @public */
4461
- type SelectItemProps<T extends object = object> = SelectItemOwnProps & Omit<ListBoxItemProps<T>, keyof SelectItemOwnProps | 'textValue'> & {
4484
+ type SelectItemProps<T extends object = object> = SelectItemOwnProps & Omit<ListBoxItemProps<T>, keyof SelectItemOwnProps | 'render' | 'textValue'> & {
4462
4485
  textValue: string;
4463
4486
  };
4464
4487
  /** @public */
@@ -4616,6 +4639,9 @@ declare const SelectItemDefinition: {
4616
4639
  readonly indicator: "bui-SelectItemIndicator";
4617
4640
  readonly content: "bui-SelectItemContent";
4618
4641
  };
4642
+ readonly navigation: {
4643
+ readonly type: "anchor";
4644
+ };
4619
4645
  readonly propDefs: {
4620
4646
  readonly children: {};
4621
4647
  readonly showSelectionIndicator: {};
@@ -4972,6 +4998,15 @@ type BUIProviderProps = {
4972
4998
  /**
4973
4999
  * Provides integration capabilities to all descendant BUI components.
4974
5000
  *
5001
+ * When rendered inside the Backstage app router, BUI components use
5002
+ * client-side navigation for internal links. Relative destinations resolve
5003
+ * from the route of the component that renders the link, and the router
5004
+ * basename applies once.
5005
+ *
5006
+ * External and scheme links, downloads, and links with non-self targets use the
5007
+ * browser's native navigation. BUI components rendered outside React Router use
5008
+ * native links without throwing.
5009
+ *
4975
5010
  * @example
4976
5011
  * ```tsx
4977
5012
  * import { BUIProvider } from '@backstage/ui';
@@ -0,0 +1,44 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useCallback } from 'react';
3
+ import { RouterProvider } from 'react-aria-components';
4
+ import { useResolvedPath, useNavigate, useLocation, useInRouterContext, useHref, Link } from 'react-router-dom';
5
+ import { useResolvedHref } from '../hooks/useResolvedHref.esm.js';
6
+
7
+ const delegatedNavigations = /* @__PURE__ */ new WeakMap();
8
+ const buiRoutingIntegration = {
9
+ Link,
10
+ useHref,
11
+ useInRouterContext,
12
+ useLocation,
13
+ useNavigate,
14
+ useResolvedPath,
15
+ createRouterOptions(action, options) {
16
+ const routerOptions = { ...options };
17
+ delegatedNavigations.set(routerOptions, action);
18
+ return routerOptions;
19
+ }
20
+ };
21
+ function BUIRoutingProvider({ children }) {
22
+ if (!useInRouterContext()) {
23
+ return children;
24
+ }
25
+ return /* @__PURE__ */ jsx(ReactAriaRoutingProvider, { children });
26
+ }
27
+ function ReactAriaRoutingProvider({ children }) {
28
+ const providerNavigate = useNavigate();
29
+ const navigate = useCallback(
30
+ (href, options) => {
31
+ const delegatedNavigation = options ? delegatedNavigations.get(options) : void 0;
32
+ if (delegatedNavigation) {
33
+ delegatedNavigation();
34
+ return;
35
+ }
36
+ providerNavigate(href, options);
37
+ },
38
+ [providerNavigate]
39
+ );
40
+ return /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref: useResolvedHref, children });
41
+ }
42
+
43
+ export { BUIRoutingProvider, buiRoutingIntegration };
44
+ //# sourceMappingURL=BUIRoutingProvider.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BUIRoutingProvider.esm.js","sources":["../../src/navigation/BUIRoutingProvider.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, type ReactNode } from 'react';\nimport { RouterProvider } from 'react-aria-components';\nimport {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n} from 'react-router-dom';\nimport { useResolvedHref } from '../hooks/useResolvedHref';\nimport type { BUIRoutingIntegration } from './types';\n\n// BUIProvider mounts this provider centrally so older BUI components from the\n// same React Aria module instance keep delegated client-side navigation.\n// Collection roots also mount it locally so their synthetic link items and the\n// provider always use the same React Aria module instance. Preserving each\n// item's href and original activation event lets React Aria choose between\n// client navigation and temporary-anchor activation for native link behavior.\n//\n// The exact options object identifies a component-scoped action. Unregistered\n// objects, including those from older BUI components or direct React Aria\n// usage, use the provider's router context instead. A separate React Aria\n// module instance cannot reach this provider and is handled by the rendered\n// host Link in useNavigation.\nconst delegatedNavigations = new WeakMap<object, () => void>();\n\n/** @internal */\nexport const buiRoutingIntegration: BUIRoutingIntegration = {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n createRouterOptions(action, options) {\n const routerOptions = { ...options };\n delegatedNavigations.set(routerOptions, action);\n return routerOptions;\n },\n};\n\n/** @internal */\nexport function BUIRoutingProvider({ children }: { children: ReactNode }) {\n if (!useInRouterContext()) {\n return children;\n }\n return <ReactAriaRoutingProvider>{children}</ReactAriaRoutingProvider>;\n}\n\nfunction ReactAriaRoutingProvider({ children }: { children: ReactNode }) {\n const providerNavigate = useNavigate();\n const navigate = useCallback(\n (href: string, options: object | undefined) => {\n const delegatedNavigation = options\n ? delegatedNavigations.get(options)\n : undefined;\n if (delegatedNavigation) {\n delegatedNavigation();\n return;\n }\n providerNavigate(href, options);\n },\n [providerNavigate],\n );\n\n return (\n <RouterProvider navigate={navigate} useHref={useResolvedHref}>\n {children}\n </RouterProvider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAyCA,MAAM,oBAAA,uBAA2B,OAAA,EAA4B;AAGtD,MAAM,qBAAA,GAA+C;AAAA,EAC1D,IAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA,CAAoB,QAAQ,OAAA,EAAS;AACnC,IAAA,MAAM,aAAA,GAAgB,EAAE,GAAG,OAAA,EAAQ;AACnC,IAAA,oBAAA,CAAqB,GAAA,CAAI,eAAe,MAAM,CAAA;AAC9C,IAAA,OAAO,aAAA;AAAA,EACT;AACF;AAGO,SAAS,kBAAA,CAAmB,EAAE,QAAA,EAAS,EAA4B;AACxE,EAAA,IAAI,CAAC,oBAAmB,EAAG;AACzB,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,uBAAO,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA;AAC7C;AAEA,SAAS,wBAAA,CAAyB,EAAE,QAAA,EAAS,EAA4B;AACvE,EAAA,MAAM,mBAAmB,WAAA,EAAY;AACrC,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,MAAc,OAAA,KAAgC;AAC7C,MAAA,MAAM,mBAAA,GAAsB,OAAA,GACxB,oBAAA,CAAqB,GAAA,CAAI,OAAO,CAAA,GAChC,MAAA;AACJ,MAAA,IAAI,mBAAA,EAAqB;AACvB,QAAA,mBAAA,EAAoB;AACpB,QAAA;AAAA,MACF;AACA,MAAA,gBAAA,CAAiB,MAAM,OAAO,CAAA;AAAA,IAChC,CAAA;AAAA,IACA,CAAC,gBAAgB;AAAA,GACnB;AAEA,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EAAS,iBAC1C,QAAA,EACH,CAAA;AAEJ;;;;"}
@@ -0,0 +1,130 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useCallback, useMemo } from 'react';
3
+ import { createPath } from 'react-router-dom';
4
+ import { isBrowserOwnedHref } from '../utils/linkUtils.esm.js';
5
+ import { useRoutingIntegration, fallbackRoutingIntegration } from './useRouting.esm.js';
6
+
7
+ function isNativeNavigation(props) {
8
+ const { href, target, download } = props;
9
+ return Boolean(
10
+ href !== void 0 && isBrowserOwnedHref(href) || target && target !== "_self" || download !== void 0 && download !== false
11
+ );
12
+ }
13
+ function useAnchorNavigation(props) {
14
+ const { href, routerOptions: navigateOptions } = props;
15
+ const routingIntegration = useRoutingIntegration();
16
+ const routing = routingIntegration ?? fallbackRoutingIntegration;
17
+ const navigate = routing.useNavigate();
18
+ const routerHref = href !== void 0 && !isBrowserOwnedHref(href) ? href : ".";
19
+ const relativeOptions = { relative: navigateOptions?.relative };
20
+ const resolvedPath = routing.useResolvedPath(routerHref, relativeOptions);
21
+ const resolvedHref = routing.useHref(routerHref, relativeOptions);
22
+ const navigateWithOptions = useCallback(() => {
23
+ if (href !== void 0) {
24
+ navigate(href, navigateOptions);
25
+ }
26
+ }, [navigate, href, navigateOptions]);
27
+ const delegatedRouterOptions = useMemo(() => {
28
+ if (!routingIntegration || href === void 0) {
29
+ return void 0;
30
+ }
31
+ return routingIntegration.createRouterOptions(
32
+ navigateWithOptions,
33
+ navigateOptions
34
+ );
35
+ }, [routingIntegration, navigateWithOptions, href, navigateOptions]);
36
+ let routerLinkOptions;
37
+ if (navigateOptions) {
38
+ const { flushSync: _flushSync, ...supportedOptions } = navigateOptions;
39
+ routerLinkOptions = supportedOptions;
40
+ }
41
+ const navigateWithFullOptions = navigateOptions?.flushSync === true ? navigateWithOptions : void 0;
42
+ if (href === void 0) {
43
+ return { type: "none", canMatchRoute: false };
44
+ }
45
+ const canMatchRoute = !isBrowserOwnedHref(href);
46
+ if (isNativeNavigation(props)) {
47
+ return {
48
+ type: "native",
49
+ canMatchRoute,
50
+ ariaHref: href,
51
+ browserHref: isBrowserOwnedHref(href) ? href : resolvedHref
52
+ };
53
+ }
54
+ if (routingIntegration) {
55
+ return {
56
+ type: "router",
57
+ canMatchRoute,
58
+ ariaHref: href,
59
+ to: href,
60
+ Link: routingIntegration.Link,
61
+ routerOptions: delegatedRouterOptions,
62
+ routerLinkOptions,
63
+ navigateWithFullOptions
64
+ };
65
+ }
66
+ return {
67
+ type: "router",
68
+ canMatchRoute,
69
+ ariaHref: createPath(resolvedPath),
70
+ to: href,
71
+ Link: fallbackRoutingIntegration.Link,
72
+ routerOptions: navigateOptions,
73
+ routerLinkOptions,
74
+ navigateWithFullOptions
75
+ };
76
+ }
77
+ function handleRouterLinkClick(event, navigation) {
78
+ const navigateWithFullOptions = navigation.type === "router" ? navigation.navigateWithFullOptions : void 0;
79
+ if (!navigateWithFullOptions || event.defaultPrevented || event.button !== 0 || event.currentTarget.target && event.currentTarget.target !== "_self" || event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {
80
+ return;
81
+ }
82
+ event.preventDefault();
83
+ navigateWithFullOptions();
84
+ }
85
+ function getReactAriaAnchorProps(navigation, props) {
86
+ switch (navigation.type) {
87
+ case "none":
88
+ return {
89
+ href: props.href,
90
+ routerOptions: props.routerOptions,
91
+ render: void 0
92
+ };
93
+ case "router":
94
+ return {
95
+ href: navigation.ariaHref,
96
+ routerOptions: navigation.routerOptions,
97
+ render: (domProps) => {
98
+ const {
99
+ href: _href,
100
+ onClick: reactAriaOnClick,
101
+ ...routerLinkProps
102
+ } = domProps;
103
+ const onClick = navigation.navigateWithFullOptions ? (event) => {
104
+ reactAriaOnClick?.(event);
105
+ handleRouterLinkClick(event, navigation);
106
+ } : reactAriaOnClick;
107
+ return /* @__PURE__ */ jsx(
108
+ navigation.Link,
109
+ {
110
+ ...routerLinkProps,
111
+ ...navigation.routerLinkOptions,
112
+ ...onClick ? { onClick } : {},
113
+ to: navigation.to
114
+ }
115
+ );
116
+ }
117
+ };
118
+ case "native":
119
+ return {
120
+ href: navigation.ariaHref,
121
+ routerOptions: props.routerOptions,
122
+ // React Aria classifies the raw href, while the final DOM anchor needs
123
+ // the router-resolved href so a basename is applied exactly once.
124
+ render: (domProps) => /* @__PURE__ */ jsx("a", { ...domProps, href: navigation.browserHref })
125
+ };
126
+ }
127
+ }
128
+
129
+ export { getReactAriaAnchorProps, handleRouterLinkClick, isBrowserOwnedHref, isNativeNavigation, useAnchorNavigation };
130
+ //# sourceMappingURL=useNavigation.esm.js.map