@backstage/ui 0.18.0 → 0.19.0-next.0

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 (213) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/analytics/getNodeText.esm.js.map +1 -1
  3. package/dist/analytics/useAnalytics.esm.js.map +1 -1
  4. package/dist/components/Accordion/Accordion.esm.js.map +1 -1
  5. package/dist/components/Accordion/Accordion.module.css.esm.js.map +1 -1
  6. package/dist/components/Accordion/definition.esm.js.map +1 -1
  7. package/dist/components/Alert/Alert.esm.js.map +1 -1
  8. package/dist/components/Alert/Alert.module.css.esm.js.map +1 -1
  9. package/dist/components/Alert/definition.esm.js.map +1 -1
  10. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  11. package/dist/components/Avatar/Avatar.module.css.esm.js.map +1 -1
  12. package/dist/components/Avatar/definition.esm.js.map +1 -1
  13. package/dist/components/Badge/Badge.esm.js.map +1 -1
  14. package/dist/components/Badge/Badge.module.css.esm.js.map +1 -1
  15. package/dist/components/Badge/definition.esm.js.map +1 -1
  16. package/dist/components/Box/Box.esm.js.map +1 -1
  17. package/dist/components/Box/Box.module.css.esm.js.map +1 -1
  18. package/dist/components/Box/definition.esm.js.map +1 -1
  19. package/dist/components/Button/Button.esm.js.map +1 -1
  20. package/dist/components/Button/Button.module.css.esm.js.map +1 -1
  21. package/dist/components/Button/definition.esm.js.map +1 -1
  22. package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
  23. package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js.map +1 -1
  24. package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
  25. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  26. package/dist/components/ButtonLink/ButtonLink.module.css.esm.js.map +1 -1
  27. package/dist/components/ButtonLink/definition.esm.js.map +1 -1
  28. package/dist/components/Card/Card.esm.js.map +1 -1
  29. package/dist/components/Card/Card.module.css.esm.js.map +1 -1
  30. package/dist/components/Card/definition.esm.js.map +1 -1
  31. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  32. package/dist/components/Checkbox/Checkbox.module.css.esm.js.map +1 -1
  33. package/dist/components/Checkbox/definition.esm.js.map +1 -1
  34. package/dist/components/CheckboxGroup/CheckboxGroup.esm.js.map +1 -1
  35. package/dist/components/CheckboxGroup/CheckboxGroup.module.css.esm.js.map +1 -1
  36. package/dist/components/CheckboxGroup/definition.esm.js.map +1 -1
  37. package/dist/components/Combobox/Combobox.esm.js +72 -10
  38. package/dist/components/Combobox/Combobox.esm.js.map +1 -1
  39. package/dist/components/Combobox/Combobox.module.css.esm.js.map +1 -1
  40. package/dist/components/Combobox/ComboboxInput.esm.js.map +1 -1
  41. package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -1
  42. package/dist/components/Combobox/ComboboxListBox.esm.js +11 -34
  43. package/dist/components/Combobox/ComboboxListBox.esm.js.map +1 -1
  44. package/dist/components/Combobox/definition.esm.js +1 -1
  45. package/dist/components/Combobox/definition.esm.js.map +1 -1
  46. package/dist/components/Combobox/useAsyncComboboxState.esm.js.map +1 -1
  47. package/dist/components/Container/Container.esm.js.map +1 -1
  48. package/dist/components/Container/Container.module.css.esm.js.map +1 -1
  49. package/dist/components/Container/definition.esm.js.map +1 -1
  50. package/dist/components/DatePicker/DatePicker.esm.js.map +1 -1
  51. package/dist/components/DatePicker/DatePicker.module.css.esm.js.map +1 -1
  52. package/dist/components/DatePicker/DatePickerCalendar.esm.js.map +1 -1
  53. package/dist/components/DatePicker/DatePickerGroup.esm.js.map +1 -1
  54. package/dist/components/DatePicker/definition.esm.js.map +1 -1
  55. package/dist/components/DateRangePicker/DateRangePicker.esm.js.map +1 -1
  56. package/dist/components/DateRangePicker/DateRangePicker.module.css.esm.js.map +1 -1
  57. package/dist/components/DateRangePicker/DateRangePickerCalendar.esm.js.map +1 -1
  58. package/dist/components/DateRangePicker/DateRangePickerGroup.esm.js.map +1 -1
  59. package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
  60. package/dist/components/Dialog/Dialog.esm.js.map +1 -1
  61. package/dist/components/Dialog/Dialog.module.css.esm.js.map +1 -1
  62. package/dist/components/Dialog/definition.esm.js.map +1 -1
  63. package/dist/components/FieldError/FieldError.esm.js.map +1 -1
  64. package/dist/components/FieldError/FieldError.module.css.esm.js.map +1 -1
  65. package/dist/components/FieldError/definition.esm.js.map +1 -1
  66. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  67. package/dist/components/FieldLabel/FieldLabel.module.css.esm.js.map +1 -1
  68. package/dist/components/FieldLabel/definition.esm.js.map +1 -1
  69. package/dist/components/Flex/Flex.esm.js.map +1 -1
  70. package/dist/components/Flex/Flex.module.css.esm.js.map +1 -1
  71. package/dist/components/Flex/definition.esm.js.map +1 -1
  72. package/dist/components/FullPage/FullPage.esm.js.map +1 -1
  73. package/dist/components/FullPage/FullPage.module.css.esm.js.map +1 -1
  74. package/dist/components/FullPage/definition.esm.js.map +1 -1
  75. package/dist/components/Grid/Grid.esm.js.map +1 -1
  76. package/dist/components/Grid/Grid.module.css.esm.js.map +1 -1
  77. package/dist/components/Grid/definition.esm.js.map +1 -1
  78. package/dist/components/Header/Header.esm.js.map +1 -1
  79. package/dist/components/Header/Header.module.css.esm.js.map +1 -1
  80. package/dist/components/Header/HeaderMetadataStatus.esm.js.map +1 -1
  81. package/dist/components/Header/HeaderMetadataStatus.module.css.esm.js.map +1 -1
  82. package/dist/components/Header/HeaderMetadataUsers.esm.js.map +1 -1
  83. package/dist/components/Header/HeaderMetadataUsers.module.css.esm.js.map +1 -1
  84. package/dist/components/Header/HeaderNav.esm.js.map +1 -1
  85. package/dist/components/Header/HeaderNav.module.css.esm.js.map +1 -1
  86. package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
  87. package/dist/components/Header/HeaderNavIndicators.esm.js.map +1 -1
  88. package/dist/components/Header/definition.esm.js.map +1 -1
  89. package/dist/components/Link/Link.esm.js.map +1 -1
  90. package/dist/components/Link/Link.module.css.esm.js.map +1 -1
  91. package/dist/components/Link/definition.esm.js.map +1 -1
  92. package/dist/components/List/List.esm.js.map +1 -1
  93. package/dist/components/List/List.module.css.esm.js.map +1 -1
  94. package/dist/components/List/definition.esm.js.map +1 -1
  95. package/dist/components/Menu/Menu.esm.js.map +1 -1
  96. package/dist/components/Menu/Menu.module.css.esm.js.map +1 -1
  97. package/dist/components/Menu/definition.esm.js.map +1 -1
  98. package/dist/components/NumberField/NumberField.esm.js.map +1 -1
  99. package/dist/components/NumberField/NumberField.module.css.esm.js.map +1 -1
  100. package/dist/components/NumberField/definition.esm.js.map +1 -1
  101. package/dist/components/PasswordField/PasswordField.esm.js.map +1 -1
  102. package/dist/components/PasswordField/PasswordField.module.css.esm.js.map +1 -1
  103. package/dist/components/PasswordField/definition.esm.js.map +1 -1
  104. package/dist/components/PluginHeader/PluginHeader.esm.js.map +1 -1
  105. package/dist/components/PluginHeader/PluginHeader.module.css.esm.js.map +1 -1
  106. package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js.map +1 -1
  107. package/dist/components/PluginHeader/definition.esm.js.map +1 -1
  108. package/dist/components/PluginHeader/useIsTruncated.esm.js.map +1 -1
  109. package/dist/components/Popover/Popover.esm.js.map +1 -1
  110. package/dist/components/Popover/Popover.module.css.esm.js.map +1 -1
  111. package/dist/components/Popover/definition.esm.js.map +1 -1
  112. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
  113. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js.map +1 -1
  114. package/dist/components/RadioGroup/definition.esm.js.map +1 -1
  115. package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
  116. package/dist/components/SearchAutocomplete/SearchAutocomplete.module.css.esm.js.map +1 -1
  117. package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
  118. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  119. package/dist/components/SearchField/SearchField.module.css.esm.js.map +1 -1
  120. package/dist/components/SearchField/definition.esm.js.map +1 -1
  121. package/dist/components/Select/Select.esm.js.map +1 -1
  122. package/dist/components/Select/Select.module.css.esm.js.map +1 -1
  123. package/dist/components/Select/SelectContent.esm.js.map +1 -1
  124. package/dist/components/Select/SelectItem.esm.js.map +1 -1
  125. package/dist/components/Select/SelectListBox.esm.js.map +1 -1
  126. package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
  127. package/dist/components/Select/definition.esm.js.map +1 -1
  128. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  129. package/dist/components/Skeleton/Skeleton.module.css.esm.js.map +1 -1
  130. package/dist/components/Skeleton/definition.esm.js.map +1 -1
  131. package/dist/components/Slider/Slider.esm.js.map +1 -1
  132. package/dist/components/Slider/Slider.module.css.esm.js.map +1 -1
  133. package/dist/components/Slider/definition.esm.js.map +1 -1
  134. package/dist/components/Switch/Switch.esm.js.map +1 -1
  135. package/dist/components/Switch/Switch.module.css.esm.js.map +1 -1
  136. package/dist/components/Switch/definition.esm.js.map +1 -1
  137. package/dist/components/Table/Table.module.css.esm.js.map +1 -1
  138. package/dist/components/Table/components/Cell.esm.js.map +1 -1
  139. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  140. package/dist/components/Table/components/CellText.esm.js.map +1 -1
  141. package/dist/components/Table/components/Column.esm.js.map +1 -1
  142. package/dist/components/Table/components/Row.esm.js.map +1 -1
  143. package/dist/components/Table/components/Table.esm.js.map +1 -1
  144. package/dist/components/Table/components/TableBody.esm.js.map +1 -1
  145. package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
  146. package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
  147. package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
  148. package/dist/components/Table/definition.esm.js.map +1 -1
  149. package/dist/components/Table/hooks/getEffectivePageSize.esm.js.map +1 -1
  150. package/dist/components/Table/hooks/useCompletePagination.esm.js.map +1 -1
  151. package/dist/components/Table/hooks/useCursorPagination.esm.js.map +1 -1
  152. package/dist/components/Table/hooks/useDebouncedReload.esm.js.map +1 -1
  153. package/dist/components/Table/hooks/useDebouncedValue.esm.js.map +1 -1
  154. package/dist/components/Table/hooks/useOffsetPagination.esm.js.map +1 -1
  155. package/dist/components/Table/hooks/usePageCache.esm.js.map +1 -1
  156. package/dist/components/Table/hooks/useQueryState.esm.js.map +1 -1
  157. package/dist/components/Table/hooks/useStableCallback.esm.js.map +1 -1
  158. package/dist/components/Table/hooks/useTable.esm.js.map +1 -1
  159. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  160. package/dist/components/TablePagination/TablePagination.module.css.esm.js.map +1 -1
  161. package/dist/components/TablePagination/definition.esm.js.map +1 -1
  162. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  163. package/dist/components/Tabs/Tabs.module.css.esm.js.map +1 -1
  164. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  165. package/dist/components/Tabs/definition.esm.js.map +1 -1
  166. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  167. package/dist/components/TagGroup/TagGroup.module.css.esm.js.map +1 -1
  168. package/dist/components/TagGroup/definition.esm.js.map +1 -1
  169. package/dist/components/Text/Text.esm.js.map +1 -1
  170. package/dist/components/Text/Text.module.css.esm.js.map +1 -1
  171. package/dist/components/Text/definition.esm.js.map +1 -1
  172. package/dist/components/TextAreaField/TextAreaField.esm.js.map +1 -1
  173. package/dist/components/TextAreaField/TextAreaField.module.css.esm.js.map +1 -1
  174. package/dist/components/TextAreaField/definition.esm.js.map +1 -1
  175. package/dist/components/TextField/TextField.esm.js.map +1 -1
  176. package/dist/components/TextField/TextField.module.css.esm.js.map +1 -1
  177. package/dist/components/TextField/definition.esm.js.map +1 -1
  178. package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
  179. package/dist/components/ToggleButton/ToggleButton.module.css.esm.js.map +1 -1
  180. package/dist/components/ToggleButton/definition.esm.js.map +1 -1
  181. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js.map +1 -1
  182. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.module.css.esm.js.map +1 -1
  183. package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
  184. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  185. package/dist/components/Tooltip/Tooltip.module.css.esm.js.map +1 -1
  186. package/dist/components/Tooltip/definition.esm.js.map +1 -1
  187. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
  188. package/dist/components/VisuallyHidden/VisuallyHidden.module.css.esm.js.map +1 -1
  189. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
  190. package/dist/css/styles.css +23 -1
  191. package/dist/hooks/useBg.esm.js.map +1 -1
  192. package/dist/hooks/useBreakpoint.esm.js.map +1 -1
  193. package/dist/hooks/useCollectionAdapter.esm.js.map +1 -1
  194. package/dist/hooks/useDefinition/defineComponent.esm.js.map +1 -1
  195. package/dist/hooks/useDefinition/helpers.esm.js.map +1 -1
  196. package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
  197. package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js.map +1 -1
  198. package/dist/hooks/useDelayedVisibility.esm.js.map +1 -1
  199. package/dist/hooks/useIsomorphicLayoutEffect.esm.js.map +1 -1
  200. package/dist/hooks/useResolvedHref.esm.js.map +1 -1
  201. package/dist/hooks/useTrackedSelectionKeys.esm.js.map +1 -1
  202. package/dist/index.d.ts +7 -2
  203. package/dist/navigation/BUIRoutingProvider.esm.js.map +1 -1
  204. package/dist/navigation/useNavigation.esm.js.map +1 -1
  205. package/dist/navigation/useRouting.esm.js.map +1 -1
  206. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
  207. package/dist/provider/BUIContext.esm.js.map +1 -1
  208. package/dist/provider/BUIProvider.esm.js.map +1 -1
  209. package/dist/utils/linkUtils.esm.js.map +1 -1
  210. package/dist/utils/selectableCollection.esm.js +13 -1
  211. package/dist/utils/selectableCollection.esm.js.map +1 -1
  212. package/dist/utils/utilityClassMap.esm.js.map +1 -1
  213. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.esm.js","sources":["../../../src/hooks/useDefinition/helpers.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 { breakpoints } from '../useBreakpoint';\nimport { utilityClassMap } from '../../utils/utilityClassMap';\nimport type { ComponentConfig, UnwrapResponsive, UtilityStyle } from './types';\n\nconst namedBreakpoints = breakpoints.filter(b => b.id !== 'initial');\n\nfunction isResponsiveObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n namedBreakpoints.some(b => b.id in value)\n );\n}\n\nexport function resolveResponsiveValue<T>(\n value: T,\n breakpoint: string,\n): UnwrapResponsive<T> {\n if (!isResponsiveObject(value)) {\n return value as UnwrapResponsive<T>;\n }\n\n const index = breakpoints.findIndex(b => b.id === breakpoint);\n\n // Look for value at current breakpoint or smaller\n for (let i = index; i >= 0; i--) {\n const key = breakpoints[i].id;\n if (key in value && value[key] !== undefined) {\n return value[key] as UnwrapResponsive<T>;\n }\n }\n\n // If no value found, check from smallest breakpoint up\n for (let i = 0; i < breakpoints.length; i++) {\n const key = breakpoints[i].id;\n if (key in value && value[key] !== undefined) {\n return value[key] as UnwrapResponsive<T>;\n }\n }\n\n return value as UnwrapResponsive<T>;\n}\n\nexport function resolveDefinitionProps<D extends ComponentConfig<any, any>>(\n definition: D,\n props: Record<string, any>,\n breakpoint: string,\n): {\n ownPropsResolved: Record<string, any>;\n restProps: Record<string, any>;\n} {\n const ownPropKeys = new Set(Object.keys(definition.propDefs));\n const utilityPropKeys = new Set(definition.utilityProps ?? []);\n\n const ownPropsRaw: Record<string, any> = {};\n const restProps: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (ownPropKeys.has(key)) {\n ownPropsRaw[key] = value;\n } else if (!(utilityPropKeys as Set<string>).has(key)) {\n restProps[key] = value;\n }\n }\n\n const ownPropsResolved: Record<string, any> = {};\n\n for (const [key, config] of Object.entries(definition.propDefs)) {\n const rawValue = ownPropsRaw[key];\n const resolvedValue = resolveResponsiveValue(rawValue, breakpoint);\n const finalValue = resolvedValue ?? (config as any).default;\n if (finalValue !== undefined) {\n ownPropsResolved[key] = finalValue;\n }\n }\n\n return { ownPropsResolved, restProps };\n}\n\nexport function processUtilityProps<Keys extends string>(\n props: Record<string, any>,\n utilityPropKeys: readonly Keys[],\n): { utilityClasses: string; utilityStyle: UtilityStyle<Keys> } {\n const utilityClassList: string[] = [];\n const generatedStyle: Record<string, unknown> = {};\n\n const handleUtilityValue = (\n key: string,\n inputVal: unknown,\n prefix: string = '',\n ) => {\n // Get utility class configuration for this key\n const utilityConfig = utilityClassMap[key as keyof typeof utilityClassMap];\n\n if (!utilityConfig) {\n // Skip if no config found for this key\n return;\n }\n\n const val =\n 'transform' in utilityConfig\n ? utilityConfig.transform(inputVal)\n : inputVal;\n\n // Check if value is in the list of valid values for this utility\n const values = utilityConfig.values as readonly (string | number)[];\n if (values.length > 0 && values.includes(val as string | number)) {\n // Generate utility class with value suffix and optional breakpoint prefix\n const className = prefix\n ? `${prefix}${utilityConfig.class}-${val}`\n : `${utilityConfig.class}-${val}`;\n utilityClassList.push(className);\n } else if ('cssVar' in utilityConfig && utilityConfig.cssVar) {\n // Custom value - add CSS custom property AND utility class name\n // Only if cssVar is defined (properties with fixed values don't have cssVar)\n const cssVar = utilityConfig.cssVar;\n const cssVarKey = prefix ? `${cssVar}-${prefix.slice(0, -1)}` : cssVar;\n // CSS custom properties need to be set on the style object\n generatedStyle[cssVarKey] = val;\n\n // Add utility class name (without value suffix) with optional breakpoint prefix\n const className = prefix\n ? `${prefix}${utilityConfig.class}`\n : utilityConfig.class;\n utilityClassList.push(className);\n }\n // If no cssVar and value is not in valid values, skip (invalid value for fixed-value property)\n };\n\n for (const key of utilityPropKeys) {\n const value = props[key];\n if (value === undefined || value === null) {\n continue;\n }\n\n // Check if value is a responsive object\n if (typeof value === 'object' && value !== null) {\n const breakpointValues = value as { [key: string]: unknown };\n // Handle responsive object values\n for (const bp in breakpointValues) {\n const prefix = bp === 'initial' ? '' : `${bp}:`;\n handleUtilityValue(key, breakpointValues[bp], prefix);\n }\n } else {\n // Handle simple value\n handleUtilityValue(key, value);\n }\n }\n\n return {\n utilityClasses: utilityClassList.join(' '),\n utilityStyle: generatedStyle as UtilityStyle<Keys>,\n };\n}\n"],"names":[],"mappings":";;;AAoBA,MAAM,mBAAmB,WAAA,CAAY,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,SAAS,CAAA;AAEnE,SAAS,mBAAmB,KAAA,EAAkD;AAC5E,EAAA,OACE,OAAO,KAAA,KAAU,QAAA,IACjB,KAAA,KAAU,IAAA,IACV,iBAAiB,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,EAAA,IAAM,KAAK,CAAA;AAE5C;AAEO,SAAS,sBAAA,CACd,OACA,UAAA,EACqB;AACrB,EAAA,IAAI,CAAC,kBAAA,CAAmB,KAAK,CAAA,EAAG;AAC9B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,QAAQ,WAAA,CAAY,SAAA,CAAU,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,UAAU,CAAA;AAG5D,EAAA,KAAA,IAAS,CAAA,GAAI,KAAA,EAAO,CAAA,IAAK,CAAA,EAAG,CAAA,EAAA,EAAK;AAC/B,IAAA,MAAM,GAAA,GAAM,WAAA,CAAY,CAAC,CAAA,CAAE,EAAA;AAC3B,IAAA,IAAI,GAAA,IAAO,KAAA,I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AAA,GAAY,MAAA,GAAS,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,OAAO,KAAA,CAAM,CAAA,EAAG,EAAE,CAAC,CAAA,CAAA,GAAK,MAAA;AAEhE,MAAA,cAAA,CAAe,SAAS,CAAA,GAAI,GAAA;AAG5B,MAAA,MAAM,SAAA,GAAY,SACd,CAAA,EAAG,MAAM,GAAG,aAAA,CAAc,KAAK,KAC/B,aAAA,CAAc,KAAA;AAClB,MAAA,gBAAA,CAAiB,KAAK,SAAS,CAAA;AAAA,IACjC;AAAA,EAEF,CAAA;AAEA,EAAA,KAAA,MAAW,OAAO,eAAA,EAAiB;AACjC,IAAA,MAAM,KAAA,GAAQ,MAAM,GAAG,CAAA;AACvB,IAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM;AACzC,MAAA;AAAA,IACF;AAGA,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,EAAM;AAC/C,MAAA,MAAM,gBAAA,GAAmB,KAAA;AAEzB,MAAA,KAAA,MAAW,MAAM,gBAAA,EAAkB;AACjC,QAAA,MAAM,MAAA,GAAS,EAAA,KAAO,SAAA,GAAY,EAAA,GAAK,GAAG,EAAE,CAAA,CAAA,CAAA;AAC5C,QAAA,kBAAA,CAAmB,GAAA,EAAK,gBAAA,CAAiB,EAAE,CAAA,EAAG,MAAM,CAAA;AAAA,MACtD;AAAA,IACF,CAAA,MAAO;AAEL,MAAA,kBAAA,CAAmB,KAAK,KAAK,CAAA;AAAA,IAC/B;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,cAAA,EAAgB,gBAAA,CAAiB,IAAA,CAAK,GAAG,CAAA;AAAA,IACzC,YAAA,EAAc;AAAA,GAChB;AACF;;;;"}
1
+ {"version":3,"file":"helpers.esm.js","sources":["../../../src/hooks/useDefinition/helpers.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 { breakpoints } from '../useBreakpoint';\nimport { utilityClassMap } from '../../utils/utilityClassMap';\nimport type { ComponentConfig, UnwrapResponsive, UtilityStyle } from './types';\n\nconst namedBreakpoints = breakpoints.filter(b => b.id !== 'initial');\n\nfunction isResponsiveObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n namedBreakpoints.some(b => b.id in value)\n );\n}\n\nexport function resolveResponsiveValue<T>(\n value: T,\n breakpoint: string,\n): UnwrapResponsive<T> {\n if (!isResponsiveObject(value)) {\n return value as UnwrapResponsive<T>;\n }\n\n const index = breakpoints.findIndex(b => b.id === breakpoint);\n\n // Look for value at current breakpoint or smaller\n for (let i = index; i >= 0; i--) {\n const key = breakpoints[i].id;\n if (key in value && value[key] !== undefined) {\n return value[key] as UnwrapResponsive<T>;\n }\n }\n\n // If no value found, check from smallest breakpoint up\n for (let i = 0; i < breakpoints.length; i++) {\n const key = breakpoints[i].id;\n if (key in value && value[key] !== undefined) {\n return value[key] as UnwrapResponsive<T>;\n }\n }\n\n return value as UnwrapResponsive<T>;\n}\n\nexport function resolveDefinitionProps<D extends ComponentConfig<any, any>>(\n definition: D,\n props: Record<string, any>,\n breakpoint: string,\n): {\n ownPropsResolved: Record<string, any>;\n restProps: Record<string, any>;\n} {\n const ownPropKeys = new Set(Object.keys(definition.propDefs));\n const utilityPropKeys = new Set(definition.utilityProps ?? []);\n\n const ownPropsRaw: Record<string, any> = {};\n const restProps: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (ownPropKeys.has(key)) {\n ownPropsRaw[key] = value;\n } else if (!(utilityPropKeys as Set<string>).has(key)) {\n restProps[key] = value;\n }\n }\n\n const ownPropsResolved: Record<string, any> = {};\n\n for (const [key, config] of Object.entries(definition.propDefs)) {\n const rawValue = ownPropsRaw[key];\n const resolvedValue = resolveResponsiveValue(rawValue, breakpoint);\n const finalValue = resolvedValue ?? (config as any).default;\n if (finalValue !== undefined) {\n ownPropsResolved[key] = finalValue;\n }\n }\n\n return { ownPropsResolved, restProps };\n}\n\nexport function processUtilityProps<Keys extends string>(\n props: Record<string, any>,\n utilityPropKeys: readonly Keys[],\n): { utilityClasses: string; utilityStyle: UtilityStyle<Keys> } {\n const utilityClassList: string[] = [];\n const generatedStyle: Record<string, unknown> = {};\n\n const handleUtilityValue = (\n key: string,\n inputVal: unknown,\n prefix: string = '',\n ) => {\n // Get utility class configuration for this key\n const utilityConfig = utilityClassMap[key as keyof typeof utilityClassMap];\n\n if (!utilityConfig) {\n // Skip if no config found for this key\n return;\n }\n\n const val =\n 'transform' in utilityConfig\n ? utilityConfig.transform(inputVal)\n : inputVal;\n\n // Check if value is in the list of valid values for this utility\n const values = utilityConfig.values as readonly (string | number)[];\n if (values.length > 0 && values.includes(val as string | number)) {\n // Generate utility class with value suffix and optional breakpoint prefix\n const className = prefix\n ? `${prefix}${utilityConfig.class}-${val}`\n : `${utilityConfig.class}-${val}`;\n utilityClassList.push(className);\n } else if ('cssVar' in utilityConfig && utilityConfig.cssVar) {\n // Custom value - add CSS custom property AND utility class name\n // Only if cssVar is defined (properties with fixed values don't have cssVar)\n const cssVar = utilityConfig.cssVar;\n const cssVarKey = prefix ? `${cssVar}-${prefix.slice(0, -1)}` : cssVar;\n // CSS custom properties need to be set on the style object\n generatedStyle[cssVarKey] = val;\n\n // Add utility class name (without value suffix) with optional breakpoint prefix\n const className = prefix\n ? `${prefix}${utilityConfig.class}`\n : utilityConfig.class;\n utilityClassList.push(className);\n }\n // If no cssVar and value is not in valid values, skip (invalid value for fixed-value property)\n };\n\n for (const key of utilityPropKeys) {\n const value = props[key];\n if (value === undefined || value === null) {\n continue;\n }\n\n // Check if value is a responsive object\n if (typeof value === 'object' && value !== null) {\n const breakpointValues = value as { [key: string]: unknown };\n // Handle responsive object values\n for (const bp in breakpointValues) {\n const prefix = bp === 'initial' ? '' : `${bp}:`;\n handleUtilityValue(key, breakpointValues[bp], prefix);\n }\n } else {\n // Handle simple value\n handleUtilityValue(key, value);\n }\n }\n\n return {\n utilityClasses: utilityClassList.join(' '),\n utilityStyle: generatedStyle as UtilityStyle<Keys>,\n };\n}\n"],"names":[],"mappings":";;;AAoBA,MAAM,mBAAmB,WAAA,CAAY,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,SAAS,CAAA;AAEnE,SAAS,mBAAmB,KAAA,EAAkD;AAC5E,EAAA,OACE,OAAO,KAAA,KAAU,QAAA,IACjB,KAAA,KAAU,IAAA,IACV,iBAAiB,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,EAAA,IAAM,KAAK,CAAA;AAE5C;AAEO,SAAS,sBAAA,CACd,OACA,UAAA,EACqB;AACrB,EAAA,IAAI,CAAC,kBAAA,CAAmB,KAAK,CAAA,EAAG;AAC9B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,MAAM,QAAQ,WAAA,CAAY,SAAA,CAAU,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,UAAU,CAAA;AAG5D,EAAA,KAAA,IAAS,CAAA,GAAI,KAAA,EAAO,CAAA,IAAK,CAAA,EAAG,CAAA,EAAA,EAAK;AAC/B,IAAA,MAAM,GAAA,GAAM,WAAA,CAAY,CAAC,CAAA,CAAE,EAAA;AAC3B,IAAA,IAAI,GAAA,IAAO,KAAA,IAAS,KAAA,CAAM,GAAG,MAAM,MAAA,EAAW;AAC5C,MAAA,OAAO,MAAM,GAAG,CAAA;AAAA,IAClB;AAAA,EACF;AAGA,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,WAAA,CAAY,QAAQ,CAAA,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,MAAM,SAAA,GAAY,SACd,CAAA,EAAG,MAAM,GAAG,aAAA,CAAc,KAAK,KAC/B,aAAA,CAAc,KAAA;AAClB,MAAA,gBAAA,CAAiB,KAAK,SAAS,CAAA;AAAA,IACjC;AAAA,EAEF,CAAA;AAEA,EAAA,KAAA,MAAW,OAAO,eAAA,EAAiB;AACjC,IAAA,MAAM,KAAA,GAAQ,MAAM,GAAG,CAAA;AACvB,IAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM;AACzC,MAAA;AAAA,IACF;AAGA,IAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA,EAAM;AAC/C,MAAA,MAAM,gBAAA,GAAmB,KAAA;AAEzB,MAAA,KAAA,MAAW,MAAM,gBAAA,EAAkB;AACjC,QAAA,MAAM,MAAA,GAAS,EAAA,KAAO,SAAA,GAAY,EAAA,GAAK,GAAG,EAAE,CAAA,CAAA,CAAA;AAC5C,QAAA,kBAAA,CAAmB,GAAA,EAAK,gBAAA,CAAiB,EAAE,CAAA,EAAG,MAAM,CAAA;AAAA,MACtD;AAAA,IACF,CAAA,MAAO;AAEL,MAAA,kBAAA,CAAmB,KAAK,KAAK,CAAA;AAAA,IAC/B;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,cAAA,EAAgB,gBAAA,CAAiB,IAAA,CAAK,GAAG,CAAA;AAAA,IACzC,YAAA,EAAc;AAAA,GAChB;AACF;;"}
@@ -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 { 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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AA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IACA,GAAI,UAAA,CAAW,SAAA,GAAY,EAAE,SAAA,KAAc,EAAC;AAAA,IAC5C,GAAI,UAAA,CAAW,UAAA,GAAa,EAAE,UAAA,KAAe;AAAC,GAChD;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,IAAA,MAAM,UAAA,GAAa,iBAAiB,GAAG,CAAA;AAEvC,IAAA,IAAI,eAAe,MAAA,EAAW;AAE5B,MAAA,IAAI,GAAA,KAAQ,IAAA,IAAQ,UAAA,CAAW,EAAA,KAAO,UAAA,EAAY;AAElD,MAAA,IAAK,OAAe,aAAA,EAAe;AAEjC,QAAA,cAAA,CAAe,QAAQ,GAAA,CAAI,WAAA,EAAa,CAAA,CAAE,CAAA,GAAI,OAAO,UAAU,CAAA;AAAA,MACjE;AAAA,IACF;AAAA,EACF;AAGA,EAAA,MAAM,UAAA,GAAa,aAAA;AAAA,IACjB,UAAA,CAAW,EAAA,KAAO,UAAA,GAAa,gBAAA,CAAiB,EAAA,GAAK;AAAA,GACvD;AAGA,EAAA,MAAM,aAAa,aAAA,EAAc;AAGjC,EA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,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,EAAC;AAAA,IAC5C,GAAI,UAAA,CAAW,UAAA,GAAa,EAAE,UAAA,KAAe;AAAC,GAChD;AACF;;"}
@@ -1 +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,UAAA;AAAA,EACA,IAAA,EAAM,IAAA;AAAA,EACN;AACF,CAAA,EAEiB;AACf,EAAA,MAAM,KAAA,GAAQ,EAAE,GAAG,SAAA,EAAW,UAAA,EAAW;AACzC,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,KAAA,EAAO,CAAA;AAC1B;AAEA,SAAS,sBAAA,CAAyC;AAAA,EAChD,KAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,UAAA,GAAa,oBAAoB,KAAK,CAAA;AAC5C,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAwB,IAAA,EAAY,SAAA,EAAsB,CAAA;AAE9E;AAEA,SAAS,sBAAA,CAAyC;AAAA,EAChD,KAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,IAAI,UAAA,GAA+B;AAAA,IACjC,IAAA,EAAM,MAAA;AAAA,IACN,aAAA,EAAe;AAAA,GACjB;AACA,EAAA,IAAI,MAAM,IAAA,EAAM;AACd,IAAA,UAAA,GAAa;AAAA,MACX,IAAA,EAAM,QAAA;AAAA,MACN,aAAA,EAAe,KAAA;AAAA,MACf,UAAU,KAAA,CAAM,IAAA;AAAA,MAChB,aAAa,KAAA,CAAM;AAAA,KACrB;AAAA,EACF;AAEA,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAwB,IAAA,EAAY,SAAA,EAAsB,CAAA;AAE9E;AAOO,SAAS,wBACd,OAAA,EAC+B;AAC/B,EAAA,MAAM,OAAA,GAAU,qBAAA,CAAsB,EAAE,QAAA,EAAU,MAAM,CAAA;AACxD,EAAA,MAAM,eAAA,GAAkB,QAAQ,kBAAA,EAAmB;AAEnD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,sBAAA;AAAA,EACT;AACA,EAAA,OAAO,sBAAA;AACT;;;;"}
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,UAAA;AAAA,EACA,IAAA,EAAM,IAAA;AAAA,EACN;AACF,CAAA,EAEiB;AACf,EAAA,MAAM,KAAA,GAAQ,EAAE,GAAG,SAAA,EAAW,UAAA,EAAW;AACzC,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,KAAA,EAAO,CAAA;AAC1B;AAEA,SAAS,sBAAA,CAAyC;AAAA,EAChD,KAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,UAAA,GAAa,oBAAoB,KAAK,CAAA;AAC5C,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAwB,IAAA,EAAY,SAAA,EAAsB,CAAA;AAE9E;AAEA,SAAS,sBAAA,CAAyC;AAAA,EAChD,KAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,IAAI,UAAA,GAA+B;AAAA,IACjC,IAAA,EAAM,MAAA;AAAA,IACN,aAAA,EAAe;AAAA,GACjB;AACA,EAAA,IAAI,MAAM,IAAA,EAAM;AACd,IAAA,UAAA,GAAa;AAAA,MACX,IAAA,EAAM,QAAA;AAAA,MACN,aAAA,EAAe,KAAA;AAAA,MACf,UAAU,KAAA,CAAM,IAAA;AAAA,MAChB,aAAa,KAAA,CAAM;AAAA,KACrB;AAAA,EACF;AAEA,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,UAAA,EAAwB,IAAA,EAAY,SAAA,EAAsB,CAAA;AAE9E;AAOO,SAAS,wBACd,OAAA,EAC+B;AAC/B,EAAA,MAAM,OAAA,GAAU,qBAAA,CAAsB,EAAE,QAAA,EAAU,MAAM,CAAA;AACxD,EAAA,MAAM,eAAA,GAAkB,QAAQ,kBAAA,EAAmB;AAEnD,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,OAAO,sBAAA;AAAA,EACT;AACA,EAAA,OAAO,sBAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDelayedVisibility.esm.js","sources":["../../src/hooks/useDelayedVisibility.ts"],"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 { useEffect, useState } from 'react';\n\n/** @internal */\nexport function useDelayedVisibility(isVisible: boolean, delayMs: number) {\n const [isDelayedVisible, setIsDelayedVisible] = useState(false);\n\n useEffect(() => {\n if (!isVisible) {\n setIsDelayedVisible(false);\n return undefined;\n }\n\n const timer = setTimeout(() => setIsDelayedVisible(true), delayMs);\n return () => clearTimeout(timer);\n }, [delayMs, isVisible]);\n\n return isVisible && isDelayedVisible;\n}\n"],"names":[],"mappings":";;AAmBO,SAAS,oBAAA,CAAqB,WAAoB,OAAA,EAAiB;AACxE,EAAA,MAAM,CAAC,gBAAA,EAAkB,mBAAmB,CAAA,GAAI,SAAS,KAAK,CAAA;AAE9D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,mBAAA,CAAoB,KAAK,CAAA;AACzB,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,mBAAA,CAAoB,IAAI,GAAG,OAAO,CAAA;AACjE,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,OAAA,EAAS,SAAS,CAAC,CAAA;AAEvB,EAAA,OAAO,SAAA,IAAa,gBAAA;AACtB;;;;"}
1
+ {"version":3,"file":"useDelayedVisibility.esm.js","sources":["../../src/hooks/useDelayedVisibility.ts"],"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 { useEffect, useState } from 'react';\n\n/** @internal */\nexport function useDelayedVisibility(isVisible: boolean, delayMs: number) {\n const [isDelayedVisible, setIsDelayedVisible] = useState(false);\n\n useEffect(() => {\n if (!isVisible) {\n setIsDelayedVisible(false);\n return undefined;\n }\n\n const timer = setTimeout(() => setIsDelayedVisible(true), delayMs);\n return () => clearTimeout(timer);\n }, [delayMs, isVisible]);\n\n return isVisible && isDelayedVisible;\n}\n"],"names":[],"mappings":";;AAmBO,SAAS,oBAAA,CAAqB,WAAoB,OAAA,EAAiB;AACxE,EAAA,MAAM,CAAC,gBAAA,EAAkB,mBAAmB,CAAA,GAAI,SAAS,KAAK,CAAA;AAE9D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,mBAAA,CAAoB,KAAK,CAAA;AACzB,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,QAAQ,UAAA,CAAW,MAAM,mBAAA,CAAoB,IAAI,GAAG,OAAO,CAAA;AACjE,IAAA,OAAO,MAAM,aAAa,KAAK,CAAA;AAAA,EACjC,CAAA,EAAG,CAAC,OAAA,EAAS,SAAS,CAAC,CAAA;AAEvB,EAAA,OAAO,SAAA,IAAa,gBAAA;AACtB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIsomorphicLayoutEffect.esm.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.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 */\nimport { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"names":[],"mappings":";;AAiBO,MAAM,yBAAA,GACX,OAAO,MAAA,KAAW,WAAA,GAAc,eAAA,GAAkB;;;;"}
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.esm.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.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 */\nimport { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"names":[],"mappings":";;AAiBO,MAAM,yBAAA,GACX,OAAO,MAAA,KAAW,WAAA,GAAc,eAAA,GAAkB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useResolvedHref.esm.js","sources":["../../src/hooks/useResolvedHref.ts"],"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 { useHref, useInRouterContext } from 'react-router-dom';\nimport { isExternalLink } from '../utils/linkUtils';\n\n/**\n * Resolves an href for rendering. External URLs are returned unchanged;\n * internal paths are resolved through react-router's useHref so they\n * respect the current basename and route context.\n *\n * @internal\n */\nexport function useResolvedHref(href: string): string;\nexport function useResolvedHref(href: string | undefined): string | undefined;\nexport function useResolvedHref(href: string | undefined): string | undefined {\n const hasRouter = useInRouterContext();\n // useHref throws outside a Router, so we guard with useInRouterContext.\n // The guard is safe because a component's router context does not\n // change during its lifetime, keeping the hook call count stable.\n if (!hasRouter) {\n return href;\n }\n const resolved = useHref(href ?? '');\n if (!href || isExternalLink(href)) {\n return href;\n }\n return resolved;\n}\n"],"names":[],"mappings":";;;AA4BO,SAAS,gBAAgB,IAAA,EAA8C;AAC5E,EAAA,MAAM,YAAY,kBAAA,EAAmB;AAIrC,EAAA,IAAI,CAAC,SAAA,EAAW;AACd,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,IAAA,IAAQ,EAAE,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,IAAQ,cAAA,CAAe,IAAI,CAAA,EAAG;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"useResolvedHref.esm.js","sources":["../../src/hooks/useResolvedHref.ts"],"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 { useHref, useInRouterContext } from 'react-router-dom';\nimport { isExternalLink } from '../utils/linkUtils';\n\n/**\n * Resolves an href for rendering. External URLs are returned unchanged;\n * internal paths are resolved through react-router's useHref so they\n * respect the current basename and route context.\n *\n * @internal\n */\nexport function useResolvedHref(href: string): string;\nexport function useResolvedHref(href: string | undefined): string | undefined;\nexport function useResolvedHref(href: string | undefined): string | undefined {\n const hasRouter = useInRouterContext();\n // useHref throws outside a Router, so we guard with useInRouterContext.\n // The guard is safe because a component's router context does not\n // change during its lifetime, keeping the hook call count stable.\n if (!hasRouter) {\n return href;\n }\n const resolved = useHref(href ?? '');\n if (!href || isExternalLink(href)) {\n return href;\n }\n return resolved;\n}\n"],"names":[],"mappings":";;;AA4BO,SAAS,gBAAgB,IAAA,EAA8C;AAC5E,EAAA,MAAM,YAAY,kBAAA,EAAmB;AAIrC,EAAA,IAAI,CAAC,SAAA,EAAW;AACd,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,IAAA,IAAQ,EAAE,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,IAAQ,cAAA,CAAe,IAAI,CAAA,EAAG;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA;AACT;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTrackedSelectionKeys.esm.js","sources":["../../src/hooks/useTrackedSelectionKeys.ts"],"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, useState } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\n\ntype UseTrackedSelectionKeysProps = {\n selectedKeys?: Selection;\n defaultSelectedKeys?: Selection;\n onSelectionChange?: (keys: Selection) => void;\n};\n\nexport function useTrackedSelectionKeys({\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n}: UseTrackedSelectionKeysProps) {\n const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] =\n useState<Selection>(() => defaultSelectedKeys ?? new Set<Key>());\n\n const handleSelectionChange = useCallback(\n (keys: Selection) => {\n setUncontrolledSelectedKeys(keys);\n onSelectionChange?.(keys);\n },\n [onSelectionChange],\n );\n\n return {\n selectedKeys: selectedKeys ?? uncontrolledSelectedKeys,\n onSelectionChange: handleSelectionChange,\n };\n}\n"],"names":[],"mappings":";;AAyBO,SAAS,uBAAA,CAAwB;AAAA,EACtC,YAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,MAAM,CAAC,0BAA0B,2BAA2B,CAAA,GAC1D,SAAoB,MAAM,mBAAA,oBAAuB,IAAI,GAAA,EAAU,CAAA;AAEjE,EAAA,MAAM,qBAAA,GAAwB,WAAA;AAAA,IAC5B,CAAC,IAAA,KAAoB;AACnB,MAAA,2BAAA,CAA4B,IAAI,CAAA;AAChC,MAAA,iBAAA,GAAoB,IAAI,CAAA;AAAA,IAC1B,CAAA;AAAA,IACA,CAAC,iBAAiB;AAAA,GACpB;AAEA,EAAA,OAAO;AAAA,IACL,cAAc,YAAA,IAAgB,wBAAA;AAAA,IAC9B,iBAAA,EAAmB;AAAA,GACrB;AACF;;;;"}
1
+ {"version":3,"file":"useTrackedSelectionKeys.esm.js","sources":["../../src/hooks/useTrackedSelectionKeys.ts"],"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, useState } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\n\ntype UseTrackedSelectionKeysProps = {\n selectedKeys?: Selection;\n defaultSelectedKeys?: Selection;\n onSelectionChange?: (keys: Selection) => void;\n};\n\nexport function useTrackedSelectionKeys({\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n}: UseTrackedSelectionKeysProps) {\n const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] =\n useState<Selection>(() => defaultSelectedKeys ?? new Set<Key>());\n\n const handleSelectionChange = useCallback(\n (keys: Selection) => {\n setUncontrolledSelectedKeys(keys);\n onSelectionChange?.(keys);\n },\n [onSelectionChange],\n );\n\n return {\n selectedKeys: selectedKeys ?? uncontrolledSelectedKeys,\n onSelectionChange: handleSelectionChange,\n };\n}\n"],"names":[],"mappings":";;AAyBO,SAAS,uBAAA,CAAwB;AAAA,EACtC,YAAA;AAAA,EACA,mBAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,MAAM,CAAC,0BAA0B,2BAA2B,CAAA,GAC1D,SAAoB,MAAM,mBAAA,oBAAuB,IAAI,GAAA,EAAU,CAAA;AAEjE,EAAA,MAAM,qBAAA,GAAwB,WAAA;AAAA,IAC5B,CAAC,IAAA,KAAoB;AACnB,MAAA,2BAAA,CAA4B,IAAI,CAAA;AAChC,MAAA,iBAAA,GAAoB,IAAI,CAAA;AAAA,IAC1B,CAAA;AAAA,IACA,CAAC,iBAAiB;AAAA,GACpB;AAEA,EAAA,OAAO;AAAA,IACL,cAAc,YAAA,IAAgB,wBAAA;AAAA,IAC9B,iBAAA,EAAmB;AAAA,GACrB;AACF;;"}
package/dist/index.d.ts CHANGED
@@ -2537,8 +2537,8 @@ declare const ComboboxListBoxDefinition: {
2537
2537
  readonly options: {};
2538
2538
  readonly items: {};
2539
2539
  readonly children: {};
2540
+ readonly hiddenKey: {};
2540
2541
  readonly dependencies: {};
2541
- readonly search: {};
2542
2542
  readonly loading: {};
2543
2543
  readonly isStale: {};
2544
2544
  readonly getItemTextValue: {};
@@ -3778,7 +3778,12 @@ type MenuSectionOwnProps = {
3778
3778
  children: React.ReactNode;
3779
3779
  className?: string;
3780
3780
  };
3781
- /** @public */
3781
+ /**
3782
+ * Props for a section within a menu. Disable items using `disabledKeys` on
3783
+ * {@link MenuProps} or `isDisabled` on {@link MenuItemProps}.
3784
+ *
3785
+ * @public
3786
+ */
3782
3787
  interface MenuSectionProps<T> extends MenuSectionOwnProps, Omit<MenuSectionProps$1<T>, keyof MenuSectionOwnProps> {
3783
3788
  }
3784
3789
  /** @public */
@@ -1 +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;;;;"}
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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigation.esm.js","sources":["../../src/navigation/useNavigation.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 {\n useCallback,\n useMemo,\n type HTMLAttributeAnchorTarget,\n type JSX,\n type MouseEvent,\n type ReactElement,\n} from 'react';\nimport { createPath, type NavigateOptions } from 'react-router-dom';\nimport { isBrowserOwnedHref } from '../utils/linkUtils';\nimport type { BUIRoutingIntegration } from './types';\nimport {\n fallbackRoutingIntegration,\n useRoutingIntegration,\n} from './useRouting';\n\n/** @internal */\nexport type NavigationProps = {\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n download?: boolean | string;\n routerOptions?: NavigateOptions;\n};\n\n/** @internal */\nexport type AnchorNavigation = { canMatchRoute: boolean } & (\n | { type: 'none' }\n | { type: 'native'; ariaHref: string; browserHref: string }\n | {\n type: 'router';\n ariaHref: string;\n to: string;\n Link: BUIRoutingIntegration['Link'];\n routerOptions?: NavigateOptions;\n routerLinkOptions: Omit<NavigateOptions, 'flushSync'> | undefined;\n navigateWithFullOptions?: () => void;\n }\n);\n\ntype PolymorphicRenderFunction = (...args: any[]) => ReactElement;\n\nexport { isBrowserOwnedHref } from '../utils/linkUtils';\n\n/** @internal */\nexport function isNativeNavigation(props: NavigationProps): boolean {\n const { href, target, download } = props;\n return Boolean(\n (href !== undefined && isBrowserOwnedHref(href)) ||\n (target && target !== '_self') ||\n (download !== undefined && download !== false),\n );\n}\n\n/**\n * A BUI component may come from a plugin that was built and released\n * independently from the application. We therefore cannot assume that the\n * component and the application's BUIProvider use the same BUI version or the\n * same installed copy of React Aria.\n *\n * These are two separate compatibility concerns:\n *\n * 1. BUIProvider version. A provider with routing support supplies the\n * application's React Router hooks and Link component. An older provider\n * does not, so the component falls back to directly imported React Router\n * APIs. This fallback can be removed when providers without routing support\n * are no longer supported.\n *\n * 2. React Aria package instance. React context is only visible to components\n * using the same React Aria copy. A plugin using another copy cannot see the\n * application's React Aria RouterProvider.\n *\n * Internal links render a React Router Link, either directly or through React\n * Aria's render prop. In both cases, React Aria's generated props, including its\n * click handler, are passed to that Link. React Router runs this supplied click\n * handler before its own navigation handler.\n *\n * - If the component can see the application's React Aria RouterProvider,\n * React Aria prevents the click's default behavior and delegates navigation\n * through that provider. React Router sees the prevented event and does not\n * navigate a second time.\n * - If the component uses a separate React Aria copy, it cannot see that\n * provider. React Aria leaves the event unhandled, so the rendered React\n * Router Link performs the navigation.\n *\n * Navigation options are provided to both paths so they behave consistently.\n * React Router Link does not support `flushSync`, so when that option is\n * enabled, BUI calls `navigate` directly if React Aria did not already handle\n * an ordinary click. Modified clicks and other browser-owned activation still\n * reach the rendered anchor unchanged.\n *\n * This dual click handling exists for compatibility with older BUI components\n * and older BUIProvider implementations. Once supported applications and\n * plugins are required to use both a routing-capable BUIProvider and BUI\n * components that render React Router links, the React Aria RouterProvider and\n * its delegated-navigation path can be removed. The rendered React Router Link\n * can then become the only client-side navigation path for anchors.\n *\n * After selecting the routing integration, this hook determines who should\n * handle the destination. React Router handles ordinary internal links. The\n * browser handles external URLs, custom URL schemes, downloads, and links with\n * a non-self target. Route matching is tracked separately: an internal tab can\n * still match the current route even when its activation is browser-owned. A\n * missing href does not navigate.\n *\n * @internal\n */\nexport function useAnchorNavigation(props: NavigationProps): AnchorNavigation {\n const { href, routerOptions: navigateOptions } = props;\n const routingIntegration = useRoutingIntegration();\n const routing = routingIntegration ?? fallbackRoutingIntegration;\n const navigate = routing.useNavigate();\n // React hooks must be called in the same order on every render. Missing hrefs,\n // external URLs, and custom URL schemes do not need route resolution, so \".\"\n // is used as a harmless placeholder when calling the router hooks.\n const routerHref =\n href !== undefined && !isBrowserOwnedHref(href) ? href : '.';\n const relativeOptions = { relative: navigateOptions?.relative };\n const resolvedPath = routing.useResolvedPath(routerHref, relativeOptions);\n const resolvedHref = routing.useHref(routerHref, relativeOptions);\n const navigateWithOptions = useCallback(() => {\n if (href !== undefined) {\n navigate(href, navigateOptions);\n }\n }, [navigate, href, navigateOptions]);\n const delegatedRouterOptions = useMemo(() => {\n if (!routingIntegration || href === undefined) {\n return undefined;\n }\n return routingIntegration.createRouterOptions(\n navigateWithOptions,\n navigateOptions,\n );\n }, [routingIntegration, navigateWithOptions, href, navigateOptions]);\n let routerLinkOptions: Omit<NavigateOptions, 'flushSync'> | undefined;\n if (navigateOptions) {\n // React Aria accepts all NavigateOptions when it delegates through its\n // RouterProvider. React Router Link accepts the same options except\n // flushSync, so omit that option from the props passed to the rendered Link.\n const { flushSync: _flushSync, ...supportedOptions } = navigateOptions;\n routerLinkOptions = supportedOptions;\n }\n const navigateWithFullOptions =\n navigateOptions?.flushSync === true ? navigateWithOptions : undefined;\n\n if (href === undefined) {\n return { type: 'none', canMatchRoute: false };\n }\n const canMatchRoute = !isBrowserOwnedHref(href);\n if (isNativeNavigation(props)) {\n return {\n type: 'native',\n canMatchRoute,\n ariaHref: href,\n browserHref: isBrowserOwnedHref(href) ? href : resolvedHref,\n };\n }\n if (routingIntegration) {\n return {\n type: 'router',\n canMatchRoute,\n ariaHref: href,\n to: href,\n Link: routingIntegration.Link,\n routerOptions: delegatedRouterOptions,\n routerLinkOptions,\n navigateWithFullOptions,\n };\n }\n return {\n type: 'router',\n canMatchRoute,\n ariaHref: createPath(resolvedPath),\n to: href,\n Link: fallbackRoutingIntegration.Link,\n routerOptions: navigateOptions,\n routerLinkOptions,\n navigateWithFullOptions,\n };\n}\n\n/**\n * Completes an eligible click with the one navigation option that React Router\n * Link cannot represent. Callers invoke this after React Aria's click handler.\n *\n * @internal\n */\nexport function handleRouterLinkClick(\n event: MouseEvent<HTMLAnchorElement>,\n navigation: AnchorNavigation,\n) {\n const navigateWithFullOptions =\n navigation.type === 'router'\n ? navigation.navigateWithFullOptions\n : undefined;\n if (\n !navigateWithFullOptions ||\n event.defaultPrevented ||\n event.button !== 0 ||\n (event.currentTarget.target && event.currentTarget.target !== '_self') ||\n event.metaKey ||\n event.altKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n\n event.preventDefault();\n navigateWithFullOptions();\n}\n\n/**\n * Converts the selected navigation behavior into props understood by React\n * Aria.\n *\n * Internal destinations are rendered as the selected React Router Link.\n * `routerOptions` are used when React Aria delegates the click through its\n * RouterProvider. The equivalent Link props are also applied to the rendered\n * React Router Link for components that cannot see that provider.\n *\n * Destinations handled by the browser are rendered as plain anchors. Their\n * final href includes any React Router basename exactly once.\n *\n * @internal\n */\nexport function getReactAriaAnchorProps(\n navigation: AnchorNavigation,\n props: {\n href?: string;\n routerOptions?: NavigateOptions;\n },\n): {\n href?: string;\n routerOptions?: NavigateOptions;\n render?: PolymorphicRenderFunction;\n} {\n switch (navigation.type) {\n case 'none':\n return {\n href: props.href,\n routerOptions: props.routerOptions,\n render: undefined,\n };\n case 'router':\n return {\n href: navigation.ariaHref,\n routerOptions: navigation.routerOptions,\n render: (domProps: JSX.IntrinsicElements['a']) => {\n const {\n href: _href,\n onClick: reactAriaOnClick,\n ...routerLinkProps\n } = domProps;\n const onClick = navigation.navigateWithFullOptions\n ? (event: MouseEvent<HTMLAnchorElement>) => {\n reactAriaOnClick?.(event);\n handleRouterLinkClick(event, navigation);\n }\n : reactAriaOnClick;\n return (\n <navigation.Link\n {...routerLinkProps}\n {...navigation.routerLinkOptions}\n {...(onClick ? { onClick } : {})}\n to={navigation.to}\n />\n );\n },\n };\n case 'native':\n return {\n href: navigation.ariaHref,\n routerOptions: props.routerOptions,\n // React Aria classifies the raw href, while the final DOM anchor needs\n // the router-resolved href so a basename is applied exactly once.\n render: (domProps: JSX.IntrinsicElements['a']) => (\n <a {...domProps} href={navigation.browserHref} />\n ),\n };\n }\n}\n"],"names":[],"mappings":";;;;;;AA4DO,SAAS,mBAAmB,KAAA,EAAiC;AAClE,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,QAAA,EAAS,GAAI,KAAA;AACnC,EAAA,OAAO,OAAA;AAAA,IACJ,IAAA,KAAS,MAAA,IAAa,kBAAA,CAAmB,IAAI,CAAA,I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A,KAAY,EAAC;AAAA,cAC9B,IAAI,UAAA,CAAW;AAAA;AAAA,WACjB;AAAA,QAEJ;AAAA,OACF;AAAA,IACF,KAAK,QAAA;AACH,MAAA,OAAO;AAAA,QACL,MAAM,UAAA,CAAW,QAAA;AAAA,QACjB,eAAe,KAAA,CAAM,aAAA;AAAA;AAAA;AAAA,QAGrB,MAAA,EAAQ,CAAC,QAAA,qBACP,GAAA,CAAC,OAAG,GAAG,QAAA,EAAU,IAAA,EAAM,UAAA,CAAW,WAAA,EAAa;AAAA,OAEnD;AAAA;AAEN;;;;"}
1
+ {"version":3,"file":"useNavigation.esm.js","sources":["../../src/navigation/useNavigation.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 {\n useCallback,\n useMemo,\n type HTMLAttributeAnchorTarget,\n type JSX,\n type MouseEvent,\n type ReactElement,\n} from 'react';\nimport { createPath, type NavigateOptions } from 'react-router-dom';\nimport { isBrowserOwnedHref } from '../utils/linkUtils';\nimport type { BUIRoutingIntegration } from './types';\nimport {\n fallbackRoutingIntegration,\n useRoutingIntegration,\n} from './useRouting';\n\n/** @internal */\nexport type NavigationProps = {\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n download?: boolean | string;\n routerOptions?: NavigateOptions;\n};\n\n/** @internal */\nexport type AnchorNavigation = { canMatchRoute: boolean } & (\n | { type: 'none' }\n | { type: 'native'; ariaHref: string; browserHref: string }\n | {\n type: 'router';\n ariaHref: string;\n to: string;\n Link: BUIRoutingIntegration['Link'];\n routerOptions?: NavigateOptions;\n routerLinkOptions: Omit<NavigateOptions, 'flushSync'> | undefined;\n navigateWithFullOptions?: () => void;\n }\n);\n\ntype PolymorphicRenderFunction = (...args: any[]) => ReactElement;\n\nexport { isBrowserOwnedHref } from '../utils/linkUtils';\n\n/** @internal */\nexport function isNativeNavigation(props: NavigationProps): boolean {\n const { href, target, download } = props;\n return Boolean(\n (href !== undefined && isBrowserOwnedHref(href)) ||\n (target && target !== '_self') ||\n (download !== undefined && download !== false),\n );\n}\n\n/**\n * A BUI component may come from a plugin that was built and released\n * independently from the application. We therefore cannot assume that the\n * component and the application's BUIProvider use the same BUI version or the\n * same installed copy of React Aria.\n *\n * These are two separate compatibility concerns:\n *\n * 1. BUIProvider version. A provider with routing support supplies the\n * application's React Router hooks and Link component. An older provider\n * does not, so the component falls back to directly imported React Router\n * APIs. This fallback can be removed when providers without routing support\n * are no longer supported.\n *\n * 2. React Aria package instance. React context is only visible to components\n * using the same React Aria copy. A plugin using another copy cannot see the\n * application's React Aria RouterProvider.\n *\n * Internal links render a React Router Link, either directly or through React\n * Aria's render prop. In both cases, React Aria's generated props, including its\n * click handler, are passed to that Link. React Router runs this supplied click\n * handler before its own navigation handler.\n *\n * - If the component can see the application's React Aria RouterProvider,\n * React Aria prevents the click's default behavior and delegates navigation\n * through that provider. React Router sees the prevented event and does not\n * navigate a second time.\n * - If the component uses a separate React Aria copy, it cannot see that\n * provider. React Aria leaves the event unhandled, so the rendered React\n * Router Link performs the navigation.\n *\n * Navigation options are provided to both paths so they behave consistently.\n * React Router Link does not support `flushSync`, so when that option is\n * enabled, BUI calls `navigate` directly if React Aria did not already handle\n * an ordinary click. Modified clicks and other browser-owned activation still\n * reach the rendered anchor unchanged.\n *\n * This dual click handling exists for compatibility with older BUI components\n * and older BUIProvider implementations. Once supported applications and\n * plugins are required to use both a routing-capable BUIProvider and BUI\n * components that render React Router links, the React Aria RouterProvider and\n * its delegated-navigation path can be removed. The rendered React Router Link\n * can then become the only client-side navigation path for anchors.\n *\n * After selecting the routing integration, this hook determines who should\n * handle the destination. React Router handles ordinary internal links. The\n * browser handles external URLs, custom URL schemes, downloads, and links with\n * a non-self target. Route matching is tracked separately: an internal tab can\n * still match the current route even when its activation is browser-owned. A\n * missing href does not navigate.\n *\n * @internal\n */\nexport function useAnchorNavigation(props: NavigationProps): AnchorNavigation {\n const { href, routerOptions: navigateOptions } = props;\n const routingIntegration = useRoutingIntegration();\n const routing = routingIntegration ?? fallbackRoutingIntegration;\n const navigate = routing.useNavigate();\n // React hooks must be called in the same order on every render. Missing hrefs,\n // external URLs, and custom URL schemes do not need route resolution, so \".\"\n // is used as a harmless placeholder when calling the router hooks.\n const routerHref =\n href !== undefined && !isBrowserOwnedHref(href) ? href : '.';\n const relativeOptions = { relative: navigateOptions?.relative };\n const resolvedPath = routing.useResolvedPath(routerHref, relativeOptions);\n const resolvedHref = routing.useHref(routerHref, relativeOptions);\n const navigateWithOptions = useCallback(() => {\n if (href !== undefined) {\n navigate(href, navigateOptions);\n }\n }, [navigate, href, navigateOptions]);\n const delegatedRouterOptions = useMemo(() => {\n if (!routingIntegration || href === undefined) {\n return undefined;\n }\n return routingIntegration.createRouterOptions(\n navigateWithOptions,\n navigateOptions,\n );\n }, [routingIntegration, navigateWithOptions, href, navigateOptions]);\n let routerLinkOptions: Omit<NavigateOptions, 'flushSync'> | undefined;\n if (navigateOptions) {\n // React Aria accepts all NavigateOptions when it delegates through its\n // RouterProvider. React Router Link accepts the same options except\n // flushSync, so omit that option from the props passed to the rendered Link.\n const { flushSync: _flushSync, ...supportedOptions } = navigateOptions;\n routerLinkOptions = supportedOptions;\n }\n const navigateWithFullOptions =\n navigateOptions?.flushSync === true ? navigateWithOptions : undefined;\n\n if (href === undefined) {\n return { type: 'none', canMatchRoute: false };\n }\n const canMatchRoute = !isBrowserOwnedHref(href);\n if (isNativeNavigation(props)) {\n return {\n type: 'native',\n canMatchRoute,\n ariaHref: href,\n browserHref: isBrowserOwnedHref(href) ? href : resolvedHref,\n };\n }\n if (routingIntegration) {\n return {\n type: 'router',\n canMatchRoute,\n ariaHref: href,\n to: href,\n Link: routingIntegration.Link,\n routerOptions: delegatedRouterOptions,\n routerLinkOptions,\n navigateWithFullOptions,\n };\n }\n return {\n type: 'router',\n canMatchRoute,\n ariaHref: createPath(resolvedPath),\n to: href,\n Link: fallbackRoutingIntegration.Link,\n routerOptions: navigateOptions,\n routerLinkOptions,\n navigateWithFullOptions,\n };\n}\n\n/**\n * Completes an eligible click with the one navigation option that React Router\n * Link cannot represent. Callers invoke this after React Aria's click handler.\n *\n * @internal\n */\nexport function handleRouterLinkClick(\n event: MouseEvent<HTMLAnchorElement>,\n navigation: AnchorNavigation,\n) {\n const navigateWithFullOptions =\n navigation.type === 'router'\n ? navigation.navigateWithFullOptions\n : undefined;\n if (\n !navigateWithFullOptions ||\n event.defaultPrevented ||\n event.button !== 0 ||\n (event.currentTarget.target && event.currentTarget.target !== '_self') ||\n event.metaKey ||\n event.altKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n\n event.preventDefault();\n navigateWithFullOptions();\n}\n\n/**\n * Converts the selected navigation behavior into props understood by React\n * Aria.\n *\n * Internal destinations are rendered as the selected React Router Link.\n * `routerOptions` are used when React Aria delegates the click through its\n * RouterProvider. The equivalent Link props are also applied to the rendered\n * React Router Link for components that cannot see that provider.\n *\n * Destinations handled by the browser are rendered as plain anchors. Their\n * final href includes any React Router basename exactly once.\n *\n * @internal\n */\nexport function getReactAriaAnchorProps(\n navigation: AnchorNavigation,\n props: {\n href?: string;\n routerOptions?: NavigateOptions;\n },\n): {\n href?: string;\n routerOptions?: NavigateOptions;\n render?: PolymorphicRenderFunction;\n} {\n switch (navigation.type) {\n case 'none':\n return {\n href: props.href,\n routerOptions: props.routerOptions,\n render: undefined,\n };\n case 'router':\n return {\n href: navigation.ariaHref,\n routerOptions: navigation.routerOptions,\n render: (domProps: JSX.IntrinsicElements['a']) => {\n const {\n href: _href,\n onClick: reactAriaOnClick,\n ...routerLinkProps\n } = domProps;\n const onClick = navigation.navigateWithFullOptions\n ? (event: MouseEvent<HTMLAnchorElement>) => {\n reactAriaOnClick?.(event);\n handleRouterLinkClick(event, navigation);\n }\n : reactAriaOnClick;\n return (\n <navigation.Link\n {...routerLinkProps}\n {...navigation.routerLinkOptions}\n {...(onClick ? { onClick } : {})}\n to={navigation.to}\n />\n );\n },\n };\n case 'native':\n return {\n href: navigation.ariaHref,\n routerOptions: props.routerOptions,\n // React Aria classifies the raw href, while the final DOM anchor needs\n // the router-resolved href so a basename is applied exactly once.\n render: (domProps: JSX.IntrinsicElements['a']) => (\n <a {...domProps} href={navigation.browserHref} />\n ),\n };\n }\n}\n"],"names":[],"mappings":";;;;;;AA4DO,SAAS,mBAAmB,KAAA,EAAiC;AAClE,EAAA,MAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,QAAA,EAAS,GAAI,KAAA;AACnC,EAAA,OAAO,OAAA;AAAA,IACJ,IAAA,KAAS,MAAA,IAAa,kBAAA,CAAmB,IAAI,CAAA,IAC3C,UAAU,MAAA,KAAW,OAAA,IACrB,QAAA,KAAa,MAAA,IAAa,QAAA,KAAa;AAAA,GAC5C;AACF;AAuDO,SAAS,oBAAoB,KAAA,EAA0C;AAC5E,EAAA,MAAM,EAAE,IAAA,EAAM,aAAA,EAAe,eAAA,EAAgB,GAAI,KAAA;AACjD,EAAA,MAAM,qBAAqB,qBAAA,EAAsB;AACjD,EAAA,MAAM,UAAU,kBAAA,IAAsB,0BAAA;AACtC,EAAA,MAAM,QAAA,GAAW,QAAQ,WAAA,EAAY;AAIrC,EAAA,MAAM,aACJ,IAAA,KAAS,MAAA,IAAa,CAAC,kBAAA,CAAmB,IAAI,IAAI,IAAA,GAAO,GAAA;AAC3D,EAAA,MAAM,eAAA,GAAkB,EAAE,QAAA,EAAU,eAAA,EAAiB,QAAA,EAAS;AAC9D,EAAA,MAAM,YAAA,GAAe,OAAA,CAAQ,eAAA,CAAgB,UAAA,EAAY,eAAe,CAAA;AACxE,EAAA,MAAM,YAAA,G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AAK,QAAA;AACH,MAAA,OAAO;AAAA,QACL,MAAM,UAAA,CAAW,QAAA;AAAA,QACjB,eAAe,UAAA,CAAW,aAAA;AAAA,QAC1B,MAAA,EAAQ,CAAC,QAAA,KAAyC;AAChD,UAAA,MAAM;AAAA,YACJ,IAAA,EAAM,KAAA;AAAA,YACN,OAAA,EAAS,gBAAA;AAAA,YACT,GAAG;AAAA,WACL,GAAI,QAAA;AACJ,UAAA,MAAM,OAAA,GAAU,UAAA,CAAW,uBAAA,GACvB,CAAC,KAAA,KAAyC;AACxC,YAAA,gBAAA,GAAmB,KAAK,CAAA;AACxB,YAAA,qBAAA,CAAsB,OAAO,UAAU,CAAA;AAAA,UACzC,CAAA,GACA,gBAAA;AACJ,UAAA,uBACE,GAAA;AAAA,YAAC,UAAA,CAAW,IAAA;AAAA,YAAX;AAAA,cACE,GAAG,eAAA;AAAA,cACH,GAAG,UAAA,CAAW,iBAAA;AAAA,cACd,GAAI,OAAA,GAAU,EAAE,OAAA,KAAY,EAAC;AAAA,cAC9B,IAAI,UAAA,CAAW;AAAA;AAAA,WACjB;AAAA,QAEJ;AAAA,OACF;AAAA,IACF,KAAK,QAAA;AACH,MAAA,OAAO;AAAA,QACL,MAAM,UAAA,CAAW,QAAA;AAAA,QACjB,eAAe,KAAA,CAAM,aAAA;AAAA;AAAA;AAAA,QAGrB,MAAA,EAAQ,CAAC,QAAA,qBACP,GAAA,CAAC,OAAG,GAAG,QAAA,EAAU,IAAA,EAAM,UAAA,CAAW,WAAA,EAAa;AAAA,OAEnD;AAAA;AAEN;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRouting.esm.js","sources":["../../src/navigation/useRouting.ts"],"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 { useVersionedContext } from '@backstage/version-bridge';\nimport {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n} from 'react-router-dom';\nimport type { BUIContextVersions } from '../provider/BUIContext';\nimport type { BUIRoutingIntegration } from './types';\n\n/** @internal */\nexport function useRoutingIntegration(): BUIRoutingIntegration | undefined;\n/** @internal */\nexport function useRoutingIntegration(options: {\n fallback: true;\n}): BUIRoutingIntegration;\n/** @internal */\nexport function useRoutingIntegration(options?: {\n fallback?: true;\n}): BUIRoutingIntegration | undefined {\n const routing =\n useVersionedContext<BUIContextVersions>('bui')?.atVersion(2)?.routing;\n if (routing) {\n return routing;\n }\n if (options?.fallback) {\n return fallbackRoutingIntegration;\n }\n return undefined;\n}\n\n/** @internal */\nexport const fallbackRoutingIntegration: BUIRoutingIntegration = {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n createRouterOptions(_action, options) {\n return { ...options };\n },\n};\n"],"names":[],"mappings":";;;AAmCO,SAAS,sBAAsB,OAAA,EAEA;AACpC,EAAA,MAAM,UACJ,mBAAA,CAAwC,KAAK,CAAA,EAAG,SAAA,CAAU,CAAC,CAAA,EAAG,OAAA;AAChE,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAO,OAAA;AAAA,EACT;AACA,EAAA,IAAI,SAAS,QAAA,EAAU;AACrB,IAAA,OAAO,0BAAA;AAAA,EACT;AACA,EAAA,OAAO,MAAA;AACT;AAGO,MAAM,0BAAA,GAAoD;AAAA,EAC/D,IAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA,CAAoB,SAAS,OAAA,EAAS;AACpC,IAAA,OAAO,EAAE,GAAG,OAAA,EAAQ;AAAA,EACtB;AACF;;;;"}
1
+ {"version":3,"file":"useRouting.esm.js","sources":["../../src/navigation/useRouting.ts"],"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 { useVersionedContext } from '@backstage/version-bridge';\nimport {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n} from 'react-router-dom';\nimport type { BUIContextVersions } from '../provider/BUIContext';\nimport type { BUIRoutingIntegration } from './types';\n\n/** @internal */\nexport function useRoutingIntegration(): BUIRoutingIntegration | undefined;\n/** @internal */\nexport function useRoutingIntegration(options: {\n fallback: true;\n}): BUIRoutingIntegration;\n/** @internal */\nexport function useRoutingIntegration(options?: {\n fallback?: true;\n}): BUIRoutingIntegration | undefined {\n const routing =\n useVersionedContext<BUIContextVersions>('bui')?.atVersion(2)?.routing;\n if (routing) {\n return routing;\n }\n if (options?.fallback) {\n return fallbackRoutingIntegration;\n }\n return undefined;\n}\n\n/** @internal */\nexport const fallbackRoutingIntegration: BUIRoutingIntegration = {\n Link,\n useHref,\n useInRouterContext,\n useLocation,\n useNavigate,\n useResolvedPath,\n createRouterOptions(_action, options) {\n return { ...options };\n },\n};\n"],"names":[],"mappings":";;;AAmCO,SAAS,sBAAsB,OAAA,EAEA;AACpC,EAAA,MAAM,UACJ,mBAAA,CAAwC,KAAK,CAAA,EAAG,SAAA,CAAU,CAAC,CAAA,EAAG,OAAA;AAChE,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAO,OAAA;AAAA,EACT;AACA,EAAA,IAAI,SAAS,QAAA,EAAU;AACrB,IAAA,OAAO,0BAAA;AAAA,EACT;AACA,EAAA,OAAO,MAAA;AACT;AAGO,MAAM,0BAAA,GAAoD;AAAA,EAC/D,IAAA;AAAA,EACA,OAAA;AAAA,EACA,kBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA,CAAoB,SAAS,OAAA,EAAS;AACpC,IAAA,OAAO,EAAE,GAAG,OAAA,EAAQ;AAAA,EACtB;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"style-inject.es.esm.js","sources":["../../../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;AAC/C,IAAI,CAAC,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B,IAAI;AACJ,EAAE,CAAC,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B,EAAE;;AAEF,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,EAAE,CAAC,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD,EAAE;AACF;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"BUIContext.esm.js","sources":["../../src/provider/BUIContext.ts"],"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 { createVersionedContext } from '@backstage/version-bridge';\nimport type { UseAnalyticsFn } from '../analytics/types';\nimport type { BUIRoutingIntegration } from '../navigation/types';\n\n/** @internal */\nexport type BUIContextValueV1 = {\n useAnalytics?: UseAnalyticsFn;\n};\n\n/** @internal */\nexport type BUIContextValueV2 = {\n useAnalytics?: UseAnalyticsFn;\n routing: BUIRoutingIntegration;\n};\n\n/** @internal */\nexport type BUIContextVersions = {\n 1: BUIContextValueV1;\n 2: BUIContextValueV2;\n};\n\n/** @internal */\nexport const BUIContext = createVersionedContext<BUIContextVersions>('bui');\n"],"names":[],"mappings":";;AAsCO,MAAM,UAAA,GAAa,uBAA2C,KAAK;;;;"}
1
+ {"version":3,"file":"BUIContext.esm.js","sources":["../../src/provider/BUIContext.ts"],"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 { createVersionedContext } from '@backstage/version-bridge';\nimport type { UseAnalyticsFn } from '../analytics/types';\nimport type { BUIRoutingIntegration } from '../navigation/types';\n\n/** @internal */\nexport type BUIContextValueV1 = {\n useAnalytics?: UseAnalyticsFn;\n};\n\n/** @internal */\nexport type BUIContextValueV2 = {\n useAnalytics?: UseAnalyticsFn;\n routing: BUIRoutingIntegration;\n};\n\n/** @internal */\nexport type BUIContextVersions = {\n 1: BUIContextValueV1;\n 2: BUIContextValueV2;\n};\n\n/** @internal */\nexport const BUIContext = createVersionedContext<BUIContextVersions>('bui');\n"],"names":[],"mappings":";;AAsCO,MAAM,UAAA,GAAa,uBAA2C,KAAK;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BUIProvider.esm.js","sources":["../../src/provider/BUIProvider.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 { useMemo, type ReactNode } from 'react';\nimport { createVersionedValueMap } from '@backstage/version-bridge';\nimport { BUIContext } from './BUIContext';\nimport type { UseAnalyticsFn } from '../analytics/types';\nimport {\n BUIRoutingProvider,\n buiRoutingIntegration,\n} from '../navigation/BUIRoutingProvider';\n\n/** @public */\nexport type BUIProviderProps = {\n useAnalytics?: UseAnalyticsFn;\n children: ReactNode;\n};\n\n/**\n * Provides integration capabilities to all descendant BUI components.\n *\n * When rendered inside the Backstage app router, BUI components use\n * client-side navigation for internal links. Relative destinations resolve\n * from the route of the component that renders the link, and the router\n * basename applies once.\n *\n * External and scheme links, downloads, and links with non-self targets use the\n * browser's native navigation. BUI components rendered outside React Router use\n * native links without throwing.\n *\n * @example\n * ```tsx\n * import { BUIProvider } from '@backstage/ui';\n * import { useAnalytics as useBackstageAnalytics } from '@backstage/core-plugin-api';\n *\n * function App() {\n * return (\n * <BUIProvider useAnalytics={useBackstageAnalytics}>\n * <AppContent />\n * </BUIProvider>\n * );\n * }\n * ```\n *\n * @public\n */\nexport function BUIProvider(props: BUIProviderProps) {\n const { useAnalytics, children } = props;\n const value = useMemo(\n () =>\n createVersionedValueMap({\n 1: { useAnalytics },\n 2: { useAnalytics, routing: buiRoutingIntegration },\n }),\n [useAnalytics],\n );\n\n const content = (\n <BUIContext.Provider value={value}>{children}</BUIContext.Provider>\n );\n return <BUIRoutingProvider>{content}</BUIRoutingProvider>;\n}\n"],"names":[],"mappings":";;;;;;AA2DO,SAAS,YAAY,KAAA,EAAyB;AACnD,EAAA,MAAM,EAAE,YAAA,EAAc,QAAA,EAAS,GAAI,KAAA;AACnC,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,uBAAA,CAAwB;AAAA,MACtB,CAAA,EAAG,EAAE,YAAA,EAAa;AAAA,MAClB,CAAA,EAAG,EAAE,YAAA,EAAc,OAAA,EAAS,qBAAA;AAAsB,KACnD,CAAA;AAAA,IACH,CAAC,YAAY;AAAA,GACf;AAEA,EAAA,MAAM,0BACJ,GAAA,CAAC,UAAA,CAAW,QAAA,EAAX,EAAoB,OAAe,QAAA,EAAS,CAAA;AAE/C,EAAA,uBAAO,GAAA,CAAC,sBAAoB,QAAA,EAAA,OAAA,EAAQ,CAAA;AACtC;;;;"}
1
+ {"version":3,"file":"BUIProvider.esm.js","sources":["../../src/provider/BUIProvider.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 { useMemo, type ReactNode } from 'react';\nimport { createVersionedValueMap } from '@backstage/version-bridge';\nimport { BUIContext } from './BUIContext';\nimport type { UseAnalyticsFn } from '../analytics/types';\nimport {\n BUIRoutingProvider,\n buiRoutingIntegration,\n} from '../navigation/BUIRoutingProvider';\n\n/** @public */\nexport type BUIProviderProps = {\n useAnalytics?: UseAnalyticsFn;\n children: ReactNode;\n};\n\n/**\n * Provides integration capabilities to all descendant BUI components.\n *\n * When rendered inside the Backstage app router, BUI components use\n * client-side navigation for internal links. Relative destinations resolve\n * from the route of the component that renders the link, and the router\n * basename applies once.\n *\n * External and scheme links, downloads, and links with non-self targets use the\n * browser's native navigation. BUI components rendered outside React Router use\n * native links without throwing.\n *\n * @example\n * ```tsx\n * import { BUIProvider } from '@backstage/ui';\n * import { useAnalytics as useBackstageAnalytics } from '@backstage/core-plugin-api';\n *\n * function App() {\n * return (\n * <BUIProvider useAnalytics={useBackstageAnalytics}>\n * <AppContent />\n * </BUIProvider>\n * );\n * }\n * ```\n *\n * @public\n */\nexport function BUIProvider(props: BUIProviderProps) {\n const { useAnalytics, children } = props;\n const value = useMemo(\n () =>\n createVersionedValueMap({\n 1: { useAnalytics },\n 2: { useAnalytics, routing: buiRoutingIntegration },\n }),\n [useAnalytics],\n );\n\n const content = (\n <BUIContext.Provider value={value}>{children}</BUIContext.Provider>\n );\n return <BUIRoutingProvider>{content}</BUIRoutingProvider>;\n}\n"],"names":[],"mappings":";;;;;;AA2DO,SAAS,YAAY,KAAA,EAAyB;AACnD,EAAA,MAAM,EAAE,YAAA,EAAc,QAAA,EAAS,GAAI,KAAA;AACnC,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACZ,MACE,uBAAA,CAAwB;AAAA,MACtB,CAAA,EAAG,EAAE,YAAA,EAAa;AAAA,MAClB,CAAA,EAAG,EAAE,YAAA,EAAc,OAAA,EAAS,qBAAA;AAAsB,KACnD,CAAA;AAAA,IACH,CAAC,YAAY;AAAA,GACf;AAEA,EAAA,MAAM,0BACJ,GAAA,CAAC,UAAA,CAAW,QAAA,EAAX,EAAoB,OAAe,QAAA,EAAS,CAAA;AAE/C,EAAA,uBAAO,GAAA,CAAC,sBAAoB,QAAA,EAAA,OAAA,EAAQ,CAAA;AACtC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"linkUtils.esm.js","sources":["../../src/utils/linkUtils.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\nconst ABSOLUTE_DESTINATION = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\n/** @internal */\nexport function isBrowserOwnedHref(href: string): boolean {\n return ABSOLUTE_DESTINATION.test(href);\n}\n\n/**\n * Determines if a link is external.\n * @param href - The href of the link.\n * @returns True if the link is external, false otherwise.\n * @internal\n */\nexport function isExternalLink(href?: string): boolean {\n return href ? isBrowserOwnedHref(href) : false;\n}\n\n/**\n * Checks if an href is an internal link (not external and not empty).\n *\n * @internal\n */\nexport function isInternalLink(href: string | undefined): href is string {\n return !!href && !isExternalLink(href);\n}\n"],"names":[],"mappings":"AAgBA,MAAM,oBAAA,GAAuB,+BAAA;AAGtB,SAAS,mBAAmB,IAAA,EAAuB;AACxD,EAAA,OAAO,oBAAA,CAAqB,KAAK,IAAI,CAAA;AACvC;AAQO,SAAS,eAAe,IAAA,EAAwB;AACrD,EAAA,OAAO,IAAA,GAAO,kBAAA,CAAmB,IAAI,CAAA,GAAI,KAAA;AAC3C;AAOO,SAAS,eAAe,IAAA,EAA0C;AACvE,EAAA,OAAO,CAAC,CAAC,IAAA,IAAQ,CAAC,eAAe,IAAI,CAAA;AACvC;;;;"}
1
+ {"version":3,"file":"linkUtils.esm.js","sources":["../../src/utils/linkUtils.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\nconst ABSOLUTE_DESTINATION = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\n/** @internal */\nexport function isBrowserOwnedHref(href: string): boolean {\n return ABSOLUTE_DESTINATION.test(href);\n}\n\n/**\n * Determines if a link is external.\n * @param href - The href of the link.\n * @returns True if the link is external, false otherwise.\n * @internal\n */\nexport function isExternalLink(href?: string): boolean {\n return href ? isBrowserOwnedHref(href) : false;\n}\n\n/**\n * Checks if an href is an internal link (not external and not empty).\n *\n * @internal\n */\nexport function isInternalLink(href: string | undefined): href is string {\n return !!href && !isExternalLink(href);\n}\n"],"names":[],"mappings":"AAgBA,MAAM,oBAAA,GAAuB,+BAAA;AAGtB,SAAS,mBAAmB,IAAA,EAAuB;AACxD,EAAA,OAAO,oBAAA,CAAqB,KAAK,IAAI,CAAA;AACvC;AAQO,SAAS,eAAe,IAAA,EAAwB;AACrD,EAAA,OAAO,IAAA,GAAO,kBAAA,CAAmB,IAAI,CAAA,GAAI,KAAA;AAC3C;AAOO,SAAS,eAAe,IAAA,EAA0C;AACvE,EAAA,OAAO,CAAC,CAAC,IAAA,IAAQ,CAAC,eAAe,IAAI,CAAA;AACvC;;"}
@@ -70,6 +70,18 @@ function toSelection(value) {
70
70
  }
71
71
  return new Set(Array.isArray(value) ? value : [value]);
72
72
  }
73
+ function filterOptionSections(options, query, filter) {
74
+ return options.flatMap((option) => {
75
+ if (!("options" in option)) {
76
+ return filter(option, query) ? option : [];
77
+ }
78
+ const filteredOptions = option.options.filter((item) => filter(item, query));
79
+ if (filteredOptions.length === 0) {
80
+ return [];
81
+ }
82
+ return { title: option.title, options: filteredOptions };
83
+ });
84
+ }
73
85
 
74
- export { flattenOptions, getItemKeys, isAsyncListSource, normalizeOption, normalizeOptions, resolveCollectionSource, toSelection };
86
+ export { filterOptionSections, flattenOptions, getItemKeys, isAsyncListSource, normalizeOption, normalizeOptions, resolveCollectionSource, toSelection };
75
87
  //# sourceMappingURL=selectableCollection.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectableCollection.esm.js","sources":["../../src/utils/selectableCollection.ts"],"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 {\n AsyncListSource,\n CollectionItem,\n IdentifiedOption,\n NormalizedOption,\n NormalizedOptionSection,\n Option,\n OptionSection,\n} from '../types/selectableCollection';\nimport type { Key, Selection } from 'react-aria-components';\n\n/** @internal */\nexport function normalizeOption(option: Option): NormalizedOption {\n if (option.id !== undefined) {\n return option;\n }\n\n return {\n id: option.value,\n label: option.label,\n disabled: option.disabled,\n };\n}\n\n/** @internal */\nexport function normalizeOptions(\n options: ReadonlyArray<Option | OptionSection>,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.map(option => {\n if ('options' in option) {\n return {\n title: option.title,\n options: option.options.map(normalizeOption),\n };\n }\n\n return normalizeOption(option);\n });\n}\n\n/** @internal */\nexport function isAsyncListSource<T>(\n source: Iterable<T> | AsyncListSource<T>,\n): source is AsyncListSource<T> {\n return (\n typeof source === 'object' &&\n source !== null &&\n 'items' in source &&\n 'filterText' in source &&\n 'setFilterText' in source &&\n 'loadingState' in source &&\n 'loadMore' in source\n );\n}\n\n/** @internal */\nexport function flattenOptions(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n): NormalizedOption[] {\n return options.flatMap(option => {\n if ('options' in option) {\n return option.options;\n }\n\n return option;\n });\n}\n\n/** @internal */\nexport function getItemKeys(items: Iterable<CollectionItem>) {\n return new Set(Array.from(items, item => item.id));\n}\n\n/** @internal */\nexport function resolveCollectionSource<T extends CollectionItem>({\n options,\n items,\n}: {\n options?:\n | ReadonlyArray<Option | OptionSection>\n | AsyncListSource<IdentifiedOption>;\n items?: Iterable<T> | AsyncListSource<T>;\n}) {\n const plainOptions = Array.isArray(options) ? options : undefined;\n const normalizedOptions = plainOptions\n ? normalizeOptions(plainOptions)\n : undefined;\n const flatOptions = normalizedOptions\n ? flattenOptions(normalizedOptions)\n : undefined;\n const asyncOptions = options && !Array.isArray(options) ? options : undefined;\n\n if (items !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: items,\n rendersItems: true,\n };\n }\n\n if (asyncOptions !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: asyncOptions as unknown as AsyncListSource<T>,\n rendersItems: true,\n };\n }\n\n return {\n options: plainOptions,\n flatOptions,\n source: (flatOptions as T[] | undefined) ?? [],\n rendersItems: false,\n };\n}\n\n/** @internal */\nexport function toSelection(\n value: Key | ReadonlyArray<Key> | null | undefined,\n): Selection {\n if (value == null) {\n return new Set();\n }\n\n return new Set(Array.isArray(value) ? value : [value]);\n}\n\n/** @internal */\nexport function filterOptionSections(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n query: string,\n filter: (option: NormalizedOption, query: string) => boolean,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.flatMap(option => {\n if (!('options' in option)) {\n return filter(option, query) ? option : [];\n }\n\n const filteredOptions = option.options.filter(item => filter(item, query));\n if (filteredOptions.length === 0) {\n return [];\n }\n\n return { title: option.title, options: filteredOptions };\n });\n}\n"],"names":[],"mappings":"AA4BO,SAAS,gBAAgB,MAAA,EAAkC;AAChE,EAAA,IAAI,MAAA,CAAO,OAAO,MAAA,EAAW;AAC3B,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO;AAAA,IACL,IAAI,MAAA,CAAO,KAAA;AAAA,IACX,OAAO,MAAA,CAAO,KAAA;AAAA,IACd,UAAU,MAAA,CAAO;AAAA,GACnB;AACF;AAGO,SAAS,iBACd,OAAA,EACmD;AACnD,EAAA,OAAO,OAAA,CAAQ,IAAI,CAAA,M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Q,OAAO,IAAI,OAAA,GAAU,MAAA;AAEpE,EAAA,IAAI,UAAU,MAAA,EAAW;AACvB,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,YAAA;AAAA,MACT,WAAA;AAAA,MACA,MAAA,EAAQ,KAAA;AAAA,MACR,YAAA,EAAc;AAAA,KAChB;AAAA,EACF;AAEA,EAAA,IAAI,iBAAiB,MAAA,EAAW;AAC9B,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,YAAA;AAAA,MACT,WAAA;AAAA,MACA,MAAA,EAAQ,YAAA;AAAA,MACR,YAAA,EAAc;AAAA,KAChB;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,YAAA;AAAA,IACT,WAAA;AAAA,IACA,MAAA,EAAS,eAAmC,EAAC;AAAA,IAC7C,YAAA,EAAc;AAAA,GAChB;AACF;AAGO,SAAS,YACd,KAAA,EACW;AACX,EAAA,IAAI,SAAS,IAAA,EAAM;AACjB,IAAA,2BAAW,GAAA,EAAI;AAAA,EACjB;AAEA,EAAA,OAAO,IAAI,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAA,GAAQ,CAAC,KAAK,CAAC,CAAA;AACvD;;;;"}
1
+ {"version":3,"file":"selectableCollection.esm.js","sources":["../../src/utils/selectableCollection.ts"],"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 {\n AsyncListSource,\n CollectionItem,\n IdentifiedOption,\n NormalizedOption,\n NormalizedOptionSection,\n Option,\n OptionSection,\n} from '../types/selectableCollection';\nimport type { Key, Selection } from 'react-aria-components';\n\n/** @internal */\nexport function normalizeOption(option: Option): NormalizedOption {\n if (option.id !== undefined) {\n return option;\n }\n\n return {\n id: option.value,\n label: option.label,\n disabled: option.disabled,\n };\n}\n\n/** @internal */\nexport function normalizeOptions(\n options: ReadonlyArray<Option | OptionSection>,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.map(option => {\n if ('options' in option) {\n return {\n title: option.title,\n options: option.options.map(normalizeOption),\n };\n }\n\n return normalizeOption(option);\n });\n}\n\n/** @internal */\nexport function isAsyncListSource<T>(\n source: Iterable<T> | AsyncListSource<T>,\n): source is AsyncListSource<T> {\n return (\n typeof source === 'object' &&\n source !== null &&\n 'items' in source &&\n 'filterText' in source &&\n 'setFilterText' in source &&\n 'loadingState' in source &&\n 'loadMore' in source\n );\n}\n\n/** @internal */\nexport function flattenOptions(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n): NormalizedOption[] {\n return options.flatMap(option => {\n if ('options' in option) {\n return option.options;\n }\n\n return option;\n });\n}\n\n/** @internal */\nexport function getItemKeys(items: Iterable<CollectionItem>) {\n return new Set(Array.from(items, item => item.id));\n}\n\n/** @internal */\nexport function resolveCollectionSource<T extends CollectionItem>({\n options,\n items,\n}: {\n options?:\n | ReadonlyArray<Option | OptionSection>\n | AsyncListSource<IdentifiedOption>;\n items?: Iterable<T> | AsyncListSource<T>;\n}) {\n const plainOptions = Array.isArray(options) ? options : undefined;\n const normalizedOptions = plainOptions\n ? normalizeOptions(plainOptions)\n : undefined;\n const flatOptions = normalizedOptions\n ? flattenOptions(normalizedOptions)\n : undefined;\n const asyncOptions = options && !Array.isArray(options) ? options : undefined;\n\n if (items !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: items,\n rendersItems: true,\n };\n }\n\n if (asyncOptions !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: asyncOptions as unknown as AsyncListSource<T>,\n rendersItems: true,\n };\n }\n\n return {\n options: plainOptions,\n flatOptions,\n source: (flatOptions as T[] | undefined) ?? [],\n rendersItems: false,\n };\n}\n\n/** @internal */\nexport function toSelection(\n value: Key | ReadonlyArray<Key> | null | undefined,\n): Selection {\n if (value == null) {\n return new Set();\n }\n\n return new Set(Array.isArray(value) ? value : [value]);\n}\n\n/** @internal */\nexport function filterOptionSections(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n query: string,\n filter: (option: NormalizedOption, query: string) => boolean,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.flatMap(option => {\n if (!('options' in option)) {\n return filter(option, query) ? option : [];\n }\n\n const filteredOptions = option.options.filter(item => filter(item, query));\n if (filteredOptions.length === 0) {\n return [];\n }\n\n return { title: option.title, options: filteredOptions };\n });\n}\n"],"names":[],"mappings":"AA4BO,SAAS,gBAAgB,MAAA,EAAkC;AAChE,EAAA,IAAI,MAAA,CAAO,OAAO,MAAA,EAAW;AAC3B,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO;AAAA,IACL,IAAI,MAAA,CAAO,KAAA;AAAA,IACX,OAAO,MAAA,CAAO,KAAA;AAAA,IACd,UAAU,MAAA,CAAO;AAAA,GACnB;AACF;AAGO,SAAS,iBACd,OAAA,EACmD;AACnD,EAAA,OAAO,OAAA,CAAQ,IAAI,CAAA,MAAA,KAAU;AAC3B,IAAA,IAAI,aAAa,MAAA,EAAQ;AACvB,MAAA,OAAO;AAAA,QACL,OAAO,MAAA,CAAO,KAAA;AAAA,QACd,OAAA,EAAS,MAAA,CAAO,OAAA,CAAQ,GAAA,CAAI,eAAe;AAAA,OAC7C;AAAA,IACF;AAEA,IAAA,OAAO,gBAAgB,MAAM,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;AAGO,SAAS,kBACd,MAAA,EAC8B;AAC9B,EAAA,OACE,OAAO,MAAA,KAAW,QAAA,IAClB,MAAA,KAAW,IAAA,IACX,OAAA,IAAW,MAAA,IACX,YAAA,IAAgB,MAAA,IAChB,eAAA,IAAmB,MAAA,IACn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A;AAAA,IACT,WAAA;AAAA,IACA,MAAA,EAAS,eAAmC,EAAC;AAAA,IAC7C,YAAA,EAAc;AAAA,GAChB;AACF;AAGO,SAAS,YACd,KAAA,EACW;AACX,EAAA,IAAI,SAAS,IAAA,EAAM;AACjB,IAAA,2BAAW,GAAA,EAAI;AAAA,EACjB;AAEA,EAAA,OAAO,IAAI,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAA,GAAQ,CAAC,KAAK,CAAC,CAAA;AACvD;AAGO,SAAS,oBAAA,CACd,OAAA,EACA,KAAA,EACA,MAAA,EACmD;AACnD,EAAA,OAAO,OAAA,CAAQ,QAAQ,CAAA,MAAA,KAAU;AAC/B,IAAA,IAAI,EAAE,aAAa,MAAA,CAAA,EAAS;AAC1B,MAAA,OAAO,MAAA,CAAO,MAAA,EAAQ,KAAK,CAAA,GAAI,SAAS,EAAC;AAAA,IAC3C;AAEA,IAAA,MAAM,eAAA,GAAkB,OAAO,OAAA,CAAQ,MAAA,CAAO,UAAQ,MAAA,CAAO,IAAA,EAAM,KAAK,CAAC,CAAA;AACzE,IAAA,IAAI,eAAA,CAAgB,WAAW,CAAA,EAAG;AAChC,MAAA,OAAO,EAAC;AAAA,IACV;AAEA,IAAA,OAAO,EAAE,KAAA,EAAO,MAAA,CAAO,KAAA,EAAO,SAAS,eAAA,EAAgB;AAAA,EACzD,CAAC,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utilityClassMap.esm.js","sources":["../../src/utils/utilityClassMap.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\n// Valid spacing values that have predefined utility classes\nconst validSpacingValues = [\n '0.5',\n '1',\n '1.5',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n] as const;\n\nconst columnsValues = [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n 'auto',\n] as const;\n\nexport const utilityClassMap = {\n m: {\n class: 'bui-m',\n cssVar: '--m',\n values: validSpacingValues,\n },\n mb: {\n class: 'bui-mb',\n cssVar: '--mb',\n values: validSpacingValues,\n },\n ml: {\n class: 'bui-ml',\n cssVar: '--ml',\n values: validSpacingValues,\n },\n mr: {\n class: 'bui-mr',\n cssVar: '--mr',\n values: validSpacingValues,\n },\n mt: {\n class: 'bui-mt',\n cssVar: '--mt',\n values: validSpacingValues,\n },\n mx: {\n class: 'bui-mx',\n cssVar: '--mx',\n values: validSpacingValues,\n },\n my: {\n class: 'bui-my',\n cssVar: '--my',\n values: validSpacingValues,\n },\n p: {\n class: 'bui-p',\n cssVar: '--p',\n values: validSpacingValues,\n },\n pb: {\n class: 'bui-pb',\n cssVar: '--pb',\n values: validSpacingValues,\n },\n pl: {\n class: 'bui-pl',\n cssVar: '--pl',\n values: validSpacingValues,\n },\n pr: {\n class: 'bui-pr',\n cssVar: '--pr',\n values: validSpacingValues,\n },\n pt: {\n class: 'bui-pt',\n cssVar: '--pt',\n values: validSpacingValues,\n },\n px: {\n class: 'bui-px',\n cssVar: '--px',\n values: validSpacingValues,\n },\n py: {\n class: 'bui-py',\n cssVar: '--py',\n values: validSpacingValues,\n },\n width: {\n class: 'bui-w',\n cssVar: '--width',\n values: [], // Always use custom value\n },\n minWidth: {\n class: 'bui-min-w',\n cssVar: '--min-width',\n values: [], // Always use custom value\n },\n maxWidth: {\n class: 'bui-max-w',\n cssVar: '--max-width',\n values: [], // Always use custom value\n },\n height: {\n class: 'bui-h',\n cssVar: '--height',\n values: [], // Always use custom value\n },\n minHeight: {\n class: 'bui-min-h',\n cssVar: '--min-height',\n values: [], // Always use custom value\n },\n maxHeight: {\n class: 'bui-max-h',\n cssVar: '--max-height',\n values: [], // Always use custom value\n },\n gap: {\n class: 'bui-gap',\n cssVar: '--gap',\n values: validSpacingValues,\n },\n position: {\n class: 'bui-position',\n values: ['static', 'relative', 'absolute', 'fixed', 'sticky'],\n },\n display: {\n class: 'bui-display',\n values: ['none', 'flex', 'block', 'inline'],\n },\n align: {\n class: 'bui-align',\n values: ['start', 'center', 'end', 'baseline', 'stretch'],\n },\n justify: {\n class: 'bui-jc',\n values: ['start', 'center', 'end', 'between'],\n },\n direction: {\n class: 'bui-fd',\n values: ['row', 'column', 'row-reverse', 'column-reverse'],\n },\n columns: {\n class: 'bui-columns',\n values: columnsValues,\n },\n colSpan: {\n class: 'bui-col-span',\n values: columnsValues,\n },\n colEnd: {\n class: 'bui-col-end',\n values: columnsValues,\n },\n colStart: {\n class: 'bui-col-start',\n values: columnsValues,\n },\n rowSpan: {\n class: 'bui-row-span',\n values: columnsValues,\n },\n grow: {\n class: 'bui-grow',\n cssVar: '--grow',\n values: [],\n transform: input => (typeof input === 'boolean' ? Number(input) : input),\n },\n shrink: {\n class: 'bui-shrink',\n cssVar: '--shrink',\n values: [],\n transform: input => (typeof input === 'boolean' ? Number(input) : input),\n },\n basis: {\n class: 'bui-basis',\n cssVar: '--basis',\n values: [],\n transform: input => (typeof input === 'number' ? `${input}px` : input),\n },\n} as const satisfies Record<\n string,\n {\n class: string;\n cssVar?: string;\n values: readonly (string | number)[];\n transform?: (input: unknown) => unknown;\n }\n>;\n"],"names":[],"mappings":"AAiBA,MAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;A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AA,EAAQ;AAAA,IACN,KAAA,EAAO,aAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,eAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,OAAA,EAAS;AAAA,IACP,KAAA,EAAO,cAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,KAAA,EAAO,UAAA;AAAA,IACP,MAAA,EAAQ,QAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,SAAA,GAAY,MAAA,CAAO,KAAK,CAAA,GAAI;AAAA,GACpE;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,YAAA;AAAA,IACP,MAAA,EAAQ,UAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,SAAA,GAAY,MAAA,CAAO,KAAK,CAAA,GAAI;AAAA,GACpE;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,WAAA;AAAA,IACP,MAAA,EAAQ,SAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,QAAA,GAAW,CAAA,EAAG,KAAK,CAAA,EAAA,CAAA,GAAO;AAAA;AAEpE;;;;"}
1
+ {"version":3,"file":"utilityClassMap.esm.js","sources":["../../src/utils/utilityClassMap.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\n// Valid spacing values that have predefined utility classes\nconst validSpacingValues = [\n '0.5',\n '1',\n '1.5',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n] as const;\n\nconst columnsValues = [\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n 'auto',\n] as const;\n\nexport const utilityClassMap = {\n m: {\n class: 'bui-m',\n cssVar: '--m',\n values: validSpacingValues,\n },\n mb: {\n class: 'bui-mb',\n cssVar: '--mb',\n values: validSpacingValues,\n },\n ml: {\n class: 'bui-ml',\n cssVar: '--ml',\n values: validSpacingValues,\n },\n mr: {\n class: 'bui-mr',\n cssVar: '--mr',\n values: validSpacingValues,\n },\n mt: {\n class: 'bui-mt',\n cssVar: '--mt',\n values: validSpacingValues,\n },\n mx: {\n class: 'bui-mx',\n cssVar: '--mx',\n values: validSpacingValues,\n },\n my: {\n class: 'bui-my',\n cssVar: '--my',\n values: validSpacingValues,\n },\n p: {\n class: 'bui-p',\n cssVar: '--p',\n values: validSpacingValues,\n },\n pb: {\n class: 'bui-pb',\n cssVar: '--pb',\n values: validSpacingValues,\n },\n pl: {\n class: 'bui-pl',\n cssVar: '--pl',\n values: validSpacingValues,\n },\n pr: {\n class: 'bui-pr',\n cssVar: '--pr',\n values: validSpacingValues,\n },\n pt: {\n class: 'bui-pt',\n cssVar: '--pt',\n values: validSpacingValues,\n },\n px: {\n class: 'bui-px',\n cssVar: '--px',\n values: validSpacingValues,\n },\n py: {\n class: 'bui-py',\n cssVar: '--py',\n values: validSpacingValues,\n },\n width: {\n class: 'bui-w',\n cssVar: '--width',\n values: [], // Always use custom value\n },\n minWidth: {\n class: 'bui-min-w',\n cssVar: '--min-width',\n values: [], // Always use custom value\n },\n maxWidth: {\n class: 'bui-max-w',\n cssVar: '--max-width',\n values: [], // Always use custom value\n },\n height: {\n class: 'bui-h',\n cssVar: '--height',\n values: [], // Always use custom value\n },\n minHeight: {\n class: 'bui-min-h',\n cssVar: '--min-height',\n values: [], // Always use custom value\n },\n maxHeight: {\n class: 'bui-max-h',\n cssVar: '--max-height',\n values: [], // Always use custom value\n },\n gap: {\n class: 'bui-gap',\n cssVar: '--gap',\n values: validSpacingValues,\n },\n position: {\n class: 'bui-position',\n values: ['static', 'relative', 'absolute', 'fixed', 'sticky'],\n },\n display: {\n class: 'bui-display',\n values: ['none', 'flex', 'block', 'inline'],\n },\n align: {\n class: 'bui-align',\n values: ['start', 'center', 'end', 'baseline', 'stretch'],\n },\n justify: {\n class: 'bui-jc',\n values: ['start', 'center', 'end', 'between'],\n },\n direction: {\n class: 'bui-fd',\n values: ['row', 'column', 'row-reverse', 'column-reverse'],\n },\n columns: {\n class: 'bui-columns',\n values: columnsValues,\n },\n colSpan: {\n class: 'bui-col-span',\n values: columnsValues,\n },\n colEnd: {\n class: 'bui-col-end',\n values: columnsValues,\n },\n colStart: {\n class: 'bui-col-start',\n values: columnsValues,\n },\n rowSpan: {\n class: 'bui-row-span',\n values: columnsValues,\n },\n grow: {\n class: 'bui-grow',\n cssVar: '--grow',\n values: [],\n transform: input => (typeof input === 'boolean' ? Number(input) : input),\n },\n shrink: {\n class: 'bui-shrink',\n cssVar: '--shrink',\n values: [],\n transform: input => (typeof input === 'boolean' ? Number(input) : input),\n },\n basis: {\n class: 'bui-basis',\n cssVar: '--basis',\n values: [],\n transform: input => (typeof input === 'number' ? `${input}px` : input),\n },\n} as const satisfies Record<\n string,\n {\n class: string;\n cssVar?: string;\n values: readonly (string | number)[];\n transform?: (input: unknown) => unknown;\n }\n>;\n"],"names":[],"mappings":"AAiBA,MAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAA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,EAAQ;AAAA,IACN,KAAA,EAAO,aAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,eAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,OAAA,EAAS;AAAA,IACP,KAAA,EAAO,cAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,KAAA,EAAO,UAAA;AAAA,IACP,MAAA,EAAQ,QAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,SAAA,GAAY,MAAA,CAAO,KAAK,CAAA,GAAI;AAAA,GACpE;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,YAAA;AAAA,IACP,MAAA,EAAQ,UAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,SAAA,GAAY,MAAA,CAAO,KAAK,CAAA,GAAI;AAAA,GACpE;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,WAAA;AAAA,IACP,MAAA,EAAQ,SAAA;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,WAAW,CAAA,KAAA,KAAU,OAAO,UAAU,QAAA,GAAW,CAAA,EAAG,KAAK,CAAA,EAAA,CAAA,GAAO;AAAA;AAEpE;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/ui",
3
- "version": "0.18.0",
3
+ "version": "0.19.0-next.0",
4
4
  "backstage": {
5
5
  "role": "web-library"
6
6
  },
@@ -50,21 +50,21 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/version-bridge": "^1.0.12",
53
+ "@backstage/version-bridge": "1.0.12",
54
54
  "@braintree/sanitize-url": "^7.1.2",
55
55
  "@internationalized/date": "^3.12.0",
56
56
  "@remixicon/react": ">=4.6.0 <4.9.0",
57
57
  "@tanstack/react-table": "^8.21.3",
58
58
  "clsx": "^2.1.1",
59
59
  "marked": "^15.0.12",
60
- "react-aria": "~3.48.0",
61
- "react-aria-components": "~1.17.0",
62
- "react-stately": "~3.46.0",
60
+ "react-aria": "~3.53.0",
61
+ "react-aria-components": "~1.22.0",
62
+ "react-stately": "~3.51.0",
63
63
  "use-sync-external-store": "^1.4.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@backstage/cli": "^0.36.6",
67
- "@backstage/core-components": "^0.18.14",
66
+ "@backstage/cli": "0.36.7-next.0",
67
+ "@backstage/core-components": "0.18.15-next.3",
68
68
  "@storybook/react-vite": "^10.4.0",
69
69
  "@testing-library/dom": "^10.0.0",
70
70
  "@testing-library/jest-dom": "^6.0.0",