@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":"PluginHeader.esm.js","sources":["../../../src/components/PluginHeader/PluginHeader.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 type { PluginHeaderProps } from './types';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PluginHeaderDefinition } from './definition';\nimport { type NavigateOptions } from 'react-router-dom';\nimport { Children, useMemo, useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { Box } from '../Box';\nimport { Link } from '../Link';\nimport { RiShapesLine } from '@remixicon/react';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { PluginHeaderBreadcrumbs } from './PluginHeaderBreadcrumbs';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * Renders a plugin header with icon, title, custom actions, and optional tabs.\n * Always participates in the background context system so descendants (e.g. buttons)\n * get the correct `data-on-bg` styling inside the toolbar and tabs.\n *\n * @public\n */\nexport const PluginHeader = (props: PluginHeaderProps) => {\n const { ownProps } = useDefinition(PluginHeaderDefinition, props);\n const {\n classes,\n tabs,\n icon,\n title,\n titleLink,\n breadcrumbs,\n customActions,\n onTabSelectionChange,\n } = ownProps;\n\n const hasTabs = tabs && tabs.length > 0;\n const hasBreadcrumbs = breadcrumbs && breadcrumbs.length > 0;\n const rootRef = useRef<HTMLDivElement>(null);\n const animationFrameRef = useRef<number | undefined>(undefined);\n const lastAppliedHeightRef = useRef<number | undefined>(undefined);\n\n const actionChildren = useMemo(() => {\n return Children.toArray(customActions);\n }, [customActions]);\n\n useIsomorphicLayoutEffect(() => {\n const el = rootRef.current;\n if (!el) {\n return undefined;\n }\n\n const cancelScheduledUpdate = () => {\n if (animationFrameRef.current === undefined) {\n return;\n }\n\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = undefined;\n };\n\n const applyHeight = (height: number) => {\n if (lastAppliedHeightRef.current === height) {\n return;\n }\n\n lastAppliedHeightRef.current = height;\n document.documentElement.style.setProperty(\n '--bui-header-height',\n `${height}px`,\n );\n };\n\n const getHeight = () => {\n const marginBottom =\n parseFloat(window.getComputedStyle(el).marginBottom) || 0;\n return el.offsetHeight + marginBottom;\n };\n\n const scheduleHeightUpdate = () => {\n cancelScheduledUpdate();\n animationFrameRef.current = requestAnimationFrame(() => {\n animationFrameRef.current = undefined;\n applyHeight(getHeight());\n });\n };\n\n // Set height once immediately so the initial layout is correct.\n applyHeight(getHeight());\n\n // Observe for resize changes if ResizeObserver is available\n // (not present in Jest/jsdom by default)\n if (typeof ResizeObserver === 'undefined') {\n return () => {\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }\n\n const observer = new ResizeObserver(() => {\n scheduleHeightUpdate();\n });\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }, []);\n\n const titleText = title || 'Your plugin';\n\n return (\n <div ref={rootRef} className={classes.root}>\n <div className={classes.toolbar} data-has-tabs={hasTabs ? '' : undefined}>\n <div className={classes.toolbarContent}>\n <Box bg=\"neutral\" className={classes.toolbarIcon} aria-hidden=\"true\">\n {icon || <RiShapesLine />}\n </Box>\n {hasBreadcrumbs ? (\n <div className={classes.toolbarName}>\n <VisuallyHidden>\n <h1>{titleText}</h1>\n </VisuallyHidden>\n <PluginHeaderBreadcrumbs\n entries={breadcrumbs}\n className={classes.breadcrumbs}\n ellipsisClassName={classes.breadcrumbsEllipsis}\n />\n </div>\n ) : (\n <h1 className={classes.toolbarName}>\n {titleLink ? (\n <Link href={titleLink} standalone variant=\"body-medium\">\n {titleText}\n </Link>\n ) : (\n <Text as=\"span\" variant=\"body-medium\">\n {titleText}\n </Text>\n )}\n </h1>\n )}\n </div>\n <div className={classes.toolbarControls}>{actionChildren}</div>\n </div>\n {hasTabs && (\n <div className={classes.tabs}>\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2CO,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAwB,KAAK,CAAA;AAChE,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AAEJ,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AACtC,EAAA,MAAM,cAAA,GAAiB,WAAA,IAAe,WAAA,CAAY,MAAA,GAAS,CAAA;AAC3D,EAAA,MAAM,OAAA,GAAU,OAAuB,IAAI,CAAA;AAC3C,EAAA,MAAM,iBAAA,GAAoB,OAA2B,MAAS,CAAA;AAC9D,EAAA,MAAM,oBAAA,GAAuB,OAA2B,MAAS,CAAA;AAEjE,EAAA,MAAM,cAAA,GAAiB,QAAQ,MAAM;AACnC,I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AAe,GAAA,CAAI,aAAA;AAAA,QAElB,QAAA,EAAA,GAAA,CAAI;AAAA,OAAA;AAAA,MALA,GAAA,CAAI;AAAA,KAOZ,CAAA,EACH,CAAA,EACF,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PluginHeader.esm.js","sources":["../../../src/components/PluginHeader/PluginHeader.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 type { PluginHeaderProps } from './types';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PluginHeaderDefinition } from './definition';\nimport { type NavigateOptions } from 'react-router-dom';\nimport { Children, useMemo, useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { Box } from '../Box';\nimport { Link } from '../Link';\nimport { RiShapesLine } from '@remixicon/react';\nimport { Text } from '../Text';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport { PluginHeaderBreadcrumbs } from './PluginHeaderBreadcrumbs';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * Renders a plugin header with icon, title, custom actions, and optional tabs.\n * Always participates in the background context system so descendants (e.g. buttons)\n * get the correct `data-on-bg` styling inside the toolbar and tabs.\n *\n * @public\n */\nexport const PluginHeader = (props: PluginHeaderProps) => {\n const { ownProps } = useDefinition(PluginHeaderDefinition, props);\n const {\n classes,\n tabs,\n icon,\n title,\n titleLink,\n breadcrumbs,\n customActions,\n onTabSelectionChange,\n } = ownProps;\n\n const hasTabs = tabs && tabs.length > 0;\n const hasBreadcrumbs = breadcrumbs && breadcrumbs.length > 0;\n const rootRef = useRef<HTMLDivElement>(null);\n const animationFrameRef = useRef<number | undefined>(undefined);\n const lastAppliedHeightRef = useRef<number | undefined>(undefined);\n\n const actionChildren = useMemo(() => {\n return Children.toArray(customActions);\n }, [customActions]);\n\n useIsomorphicLayoutEffect(() => {\n const el = rootRef.current;\n if (!el) {\n return undefined;\n }\n\n const cancelScheduledUpdate = () => {\n if (animationFrameRef.current === undefined) {\n return;\n }\n\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = undefined;\n };\n\n const applyHeight = (height: number) => {\n if (lastAppliedHeightRef.current === height) {\n return;\n }\n\n lastAppliedHeightRef.current = height;\n document.documentElement.style.setProperty(\n '--bui-header-height',\n `${height}px`,\n );\n };\n\n const getHeight = () => {\n const marginBottom =\n parseFloat(window.getComputedStyle(el).marginBottom) || 0;\n return el.offsetHeight + marginBottom;\n };\n\n const scheduleHeightUpdate = () => {\n cancelScheduledUpdate();\n animationFrameRef.current = requestAnimationFrame(() => {\n animationFrameRef.current = undefined;\n applyHeight(getHeight());\n });\n };\n\n // Set height once immediately so the initial layout is correct.\n applyHeight(getHeight());\n\n // Observe for resize changes if ResizeObserver is available\n // (not present in Jest/jsdom by default)\n if (typeof ResizeObserver === 'undefined') {\n return () => {\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }\n\n const observer = new ResizeObserver(() => {\n scheduleHeightUpdate();\n });\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }, []);\n\n const titleText = title || 'Your plugin';\n\n return (\n <div ref={rootRef} className={classes.root}>\n <div className={classes.toolbar} data-has-tabs={hasTabs ? '' : undefined}>\n <div className={classes.toolbarContent}>\n <Box bg=\"neutral\" className={classes.toolbarIcon} aria-hidden=\"true\">\n {icon || <RiShapesLine />}\n </Box>\n {hasBreadcrumbs ? (\n <div className={classes.toolbarName}>\n <VisuallyHidden>\n <h1>{titleText}</h1>\n </VisuallyHidden>\n <PluginHeaderBreadcrumbs\n entries={breadcrumbs}\n className={classes.breadcrumbs}\n ellipsisClassName={classes.breadcrumbsEllipsis}\n />\n </div>\n ) : (\n <h1 className={classes.toolbarName}>\n {titleLink ? (\n <Link href={titleLink} standalone variant=\"body-medium\">\n {titleText}\n </Link>\n ) : (\n <Text as=\"span\" variant=\"body-medium\">\n {titleText}\n </Text>\n )}\n </h1>\n )}\n </div>\n <div className={classes.toolbarControls}>{actionChildren}</div>\n </div>\n {hasTabs && (\n <div className={classes.tabs}>\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2CO,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAwB,KAAK,CAAA;AAChE,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AAEJ,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AACtC,EAAA,MAAM,cAAA,GAAiB,WAAA,IAAe,WAAA,CAAY,MAAA,GAAS,CAAA;AAC3D,EAAA,MAAM,OAAA,GAAU,OAAuB,IAAI,CAAA;AAC3C,EAAA,MAAM,iBAAA,GAAoB,OAA2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,GAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QAEC,IAAI,GAAA,CAAI,EAAA;AAAA,QACR,MAAM,GAAA,CAAI,IAAA;AAAA,QACV,eAAe,GAAA,CAAI,aAAA;AAAA,QAElB,QAAA,EAAA,GAAA,CAAI;AAAA,OAAA;AAAA,MALA,GAAA,CAAI;AAAA,KAOZ,CAAA,EACH,CAAA,EACF,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PluginHeader.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"PluginHeader.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PluginHeaderBreadcrumbs.esm.js","sources":["../../../src/components/PluginHeader/PluginHeaderBreadcrumbs.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 { PluginHeaderBreadcrumbEntry } from './types';\nimport { Link } from '../Link';\nimport { Text } from '../Text';\nimport { MenuTrigger, Menu, MenuItem } from '../Menu';\nimport { RiArrowRightSLine } from '@remixicon/react';\nimport {\n Focusable,\n Breadcrumb as RACBreadcrumb,\n Breadcrumbs as RACBreadcrumbs,\n Button as RACButton,\n} from 'react-aria-components';\nimport { useIsTruncated } from './useIsTruncated';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\n\nconst COLLAPSE_THRESHOLD = 5;\nconst ROOT_ITEMS = 1;\nconst LEADING_ITEMS = 1;\n\n/** Separator icon that appears after non-current segments */\nfunction BreadcrumbSeparator() {\n return (\n <span aria-hidden=\"true\">\n <RiArrowRightSLine size={16} />\n </span>\n );\n}\n\n/** Wraps children in a tooltip that shows on hover when the label is truncated. */\nfunction BreadcrumbTooltipWrapper(props: {\n showTooltip: boolean;\n label: string;\n children: React.ReactNode;\n}) {\n const { showTooltip, label, children } = props;\n\n return (\n <TooltipTrigger delay={300} isDisabled={!showTooltip}>\n {children}\n <Tooltip>{label}</Tooltip>\n </TooltipTrigger>\n );\n}\n\n/** Renders a link in the breadcrumbs trail */\nfunction BreadcrumbLink(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n const { ref, truncated } = useIsTruncated<HTMLAnchorElement>();\n return (\n <BreadcrumbTooltipWrapper label={entry.label} showTooltip={truncated}>\n <Link\n href={entry.href}\n standalone\n variant=\"body-medium\"\n truncate\n ref={ref}\n >\n {entry.label}\n </Link>\n </BreadcrumbTooltipWrapper>\n );\n}\n\n/**\n * Renders a text in the breadcrumbs trail.\n * If it is truncated, it becomes focusable (requirement for the tooltip to work)\n */\nfunction BreadcrumbText(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n const { ref, truncated } = useIsTruncated<HTMLParagraphElement>();\n\n return (\n <BreadcrumbTooltipWrapper label={entry.label} showTooltip={truncated}>\n <Focusable excludeFromTabOrder={!truncated}>\n <Text variant=\"body-medium\" truncate ref={ref}>\n {entry.label}\n </Text>\n </Focusable>\n </BreadcrumbTooltipWrapper>\n );\n}\n\n/** Renders an ellipsis button that opens a menu with the collapsed breadcrumb items. */\nfunction CollapsedSegment(props: {\n items: PluginHeaderBreadcrumbEntry[];\n ellipsisClassName?: string;\n}) {\n const { items, ellipsisClassName } = props;\n const ariaLabel = 'Show more breadcrumbs';\n return (\n <RACBreadcrumb key=\"collapsed\">\n <MenuTrigger>\n <RACButton aria-label={ariaLabel} className={ellipsisClassName}>\n <Text as=\"span\" variant=\"body-medium\">\n …\n </Text>\n </RACButton>\n <Menu>\n {items.map(item => (\n <MenuItem key={item.href} href={item.href}>\n {item.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n <BreadcrumbSeparator />\n </RACBreadcrumb>\n );\n}\n\n/** Renders a non-current breadcrumb segment as a link with a trailing separator. */\nfunction AncestorSegment(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n return (\n <RACBreadcrumb key={entry.href}>\n <BreadcrumbLink entry={entry} />\n <BreadcrumbSeparator />\n </RACBreadcrumb>\n );\n}\n\n/**\n * Renders the current page in the breadcrumbs trail\n * - RAC Breadcrumbs will attach `data-current` to this segment\n * - If it's the only entry (eg. we are on the root page of the Plugin), it will render as a link\n * - Otherwise renders as text\n * - If truncated, will be focusable and show a breadcrumb\n */\nfunction CurrentSegment(props: {\n entry: PluginHeaderBreadcrumbEntry;\n isSingleEntry: boolean;\n}) {\n const { entry, isSingleEntry } = props;\n return (\n <RACBreadcrumb key={entry.href}>\n {isSingleEntry ? (\n <BreadcrumbLink entry={entry} />\n ) : (\n <BreadcrumbText entry={entry} />\n )}\n </RACBreadcrumb>\n );\n}\n\n/**\n * Renders a breadcrumb navigation trail from an ordered list of entries.\n *\n * - Uses RAC Breadcrumb and Breadcrumbs internally for a11y utils\n * - A single entry renders as a clickable link (plugin root page).\n * - Multiple entries render ancestors as links and the last entry as plain text.\n * - When there are {@link COLLAPSE_THRESHOLD} or more entries, middle items\n * collapse behind an ellipsis menu, keeping the root and leading items visible.\n *\n * @internal\n */\nexport function PluginHeaderBreadcrumbs(props: {\n entries: PluginHeaderBreadcrumbEntry[];\n className?: string;\n ellipsisClassName?: string;\n}) {\n const { entries, className, ellipsisClassName } = props;\n\n if (entries.length === 0) return null;\n\n const isSingleEntry = entries.length === 1;\n const current = entries[entries.length - 1];\n const rest = entries.slice(0, -1);\n\n let ancestorItems: React.ReactNode = null;\n\n if (entries.length >= COLLAPSE_THRESHOLD) {\n const root = rest.slice(0, ROOT_ITEMS);\n const leading = rest.slice(-LEADING_ITEMS);\n const collapsed = rest.slice(ROOT_ITEMS, -LEADING_ITEMS);\n\n ancestorItems = (\n <>\n {root.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ))}\n <CollapsedSegment\n items={collapsed}\n ellipsisClassName={ellipsisClassName}\n />\n {leading.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ))}\n </>\n );\n } else {\n ancestorItems = rest.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ));\n }\n\n return (\n <nav id=\"Breadcrumbs\" aria-label=\"Breadcrumbs\" className={className}>\n <RACBreadcrumbs>\n {ancestorItems}\n <CurrentSegment entry={current} isSingleEntry={isSingleEntry} />\n </RACBreadcrumbs>\n </nav>\n );\n}\n"],"names":["RACBreadcrumb","RACButton","RACBreadcrumbs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,kBAAA,GAAqB,CAAA;AAC3B,MAAM,UAAA,GAAa,CAAA;AAInB,SAAS,mBAAA,GAAsB;AAC7B,EAAA,uBACE,GAAA,CAAC,UAAK,aAAA,EAAY,MAAA,EAChB,8BAAC,iBAAA,EAAA,EAAkB,IAAA,EAAM,IAAI,CAAA,EAC/B,CAAA;AAEJ;AAGA,SAAS,yBAAyB,KAAA,EAI/B;AACD,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAO,QAAA,EAAS,GAAI,KAAA;AAEzC,EAAA,4BACG,cAAA,EAAA,EAAe,KAAA,EAAO,GAAA,EAAK,UAAA,EAAY,CAAC,WAAA,EACtC,QAAA,EAAA;AAAA,IAAA,QAAA;AAAA,oBACD,GAAA,CAAC,WAAS,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAClB,CAAA;AAEJ;AAGA,SAAS,eAAe,KAAA,EAA+C;AACrE,EAAA,MAAM,EAAE,OAAM,GAAI,KAAA;AAClB,EAAA,MAAM,EAAE,GAAA,EAAK,SAAA,EAAU,GAAI,cAAA,EAAkC;AAC7D,EAAA,2BACG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AAA,EAChE,CAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PluginHeaderBreadcrumbs.esm.js","sources":["../../../src/components/PluginHeader/PluginHeaderBreadcrumbs.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 { PluginHeaderBreadcrumbEntry } from './types';\nimport { Link } from '../Link';\nimport { Text } from '../Text';\nimport { MenuTrigger, Menu, MenuItem } from '../Menu';\nimport { RiArrowRightSLine } from '@remixicon/react';\nimport {\n Focusable,\n Breadcrumb as RACBreadcrumb,\n Breadcrumbs as RACBreadcrumbs,\n Button as RACButton,\n} from 'react-aria-components';\nimport { useIsTruncated } from './useIsTruncated';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\n\nconst COLLAPSE_THRESHOLD = 5;\nconst ROOT_ITEMS = 1;\nconst LEADING_ITEMS = 1;\n\n/** Separator icon that appears after non-current segments */\nfunction BreadcrumbSeparator() {\n return (\n <span aria-hidden=\"true\">\n <RiArrowRightSLine size={16} />\n </span>\n );\n}\n\n/** Wraps children in a tooltip that shows on hover when the label is truncated. */\nfunction BreadcrumbTooltipWrapper(props: {\n showTooltip: boolean;\n label: string;\n children: React.ReactNode;\n}) {\n const { showTooltip, label, children } = props;\n\n return (\n <TooltipTrigger delay={300} isDisabled={!showTooltip}>\n {children}\n <Tooltip>{label}</Tooltip>\n </TooltipTrigger>\n );\n}\n\n/** Renders a link in the breadcrumbs trail */\nfunction BreadcrumbLink(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n const { ref, truncated } = useIsTruncated<HTMLAnchorElement>();\n return (\n <BreadcrumbTooltipWrapper label={entry.label} showTooltip={truncated}>\n <Link\n href={entry.href}\n standalone\n variant=\"body-medium\"\n truncate\n ref={ref}\n >\n {entry.label}\n </Link>\n </BreadcrumbTooltipWrapper>\n );\n}\n\n/**\n * Renders a text in the breadcrumbs trail.\n * If it is truncated, it becomes focusable (requirement for the tooltip to work)\n */\nfunction BreadcrumbText(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n const { ref, truncated } = useIsTruncated<HTMLParagraphElement>();\n\n return (\n <BreadcrumbTooltipWrapper label={entry.label} showTooltip={truncated}>\n <Focusable excludeFromTabOrder={!truncated}>\n <Text variant=\"body-medium\" truncate ref={ref}>\n {entry.label}\n </Text>\n </Focusable>\n </BreadcrumbTooltipWrapper>\n );\n}\n\n/** Renders an ellipsis button that opens a menu with the collapsed breadcrumb items. */\nfunction CollapsedSegment(props: {\n items: PluginHeaderBreadcrumbEntry[];\n ellipsisClassName?: string;\n}) {\n const { items, ellipsisClassName } = props;\n const ariaLabel = 'Show more breadcrumbs';\n return (\n <RACBreadcrumb key=\"collapsed\">\n <MenuTrigger>\n <RACButton aria-label={ariaLabel} className={ellipsisClassName}>\n <Text as=\"span\" variant=\"body-medium\">\n …\n </Text>\n </RACButton>\n <Menu>\n {items.map(item => (\n <MenuItem key={item.href} href={item.href}>\n {item.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n <BreadcrumbSeparator />\n </RACBreadcrumb>\n );\n}\n\n/** Renders a non-current breadcrumb segment as a link with a trailing separator. */\nfunction AncestorSegment(props: { entry: PluginHeaderBreadcrumbEntry }) {\n const { entry } = props;\n return (\n <RACBreadcrumb key={entry.href}>\n <BreadcrumbLink entry={entry} />\n <BreadcrumbSeparator />\n </RACBreadcrumb>\n );\n}\n\n/**\n * Renders the current page in the breadcrumbs trail\n * - RAC Breadcrumbs will attach `data-current` to this segment\n * - If it's the only entry (eg. we are on the root page of the Plugin), it will render as a link\n * - Otherwise renders as text\n * - If truncated, will be focusable and show a breadcrumb\n */\nfunction CurrentSegment(props: {\n entry: PluginHeaderBreadcrumbEntry;\n isSingleEntry: boolean;\n}) {\n const { entry, isSingleEntry } = props;\n return (\n <RACBreadcrumb key={entry.href}>\n {isSingleEntry ? (\n <BreadcrumbLink entry={entry} />\n ) : (\n <BreadcrumbText entry={entry} />\n )}\n </RACBreadcrumb>\n );\n}\n\n/**\n * Renders a breadcrumb navigation trail from an ordered list of entries.\n *\n * - Uses RAC Breadcrumb and Breadcrumbs internally for a11y utils\n * - A single entry renders as a clickable link (plugin root page).\n * - Multiple entries render ancestors as links and the last entry as plain text.\n * - When there are {@link COLLAPSE_THRESHOLD} or more entries, middle items\n * collapse behind an ellipsis menu, keeping the root and leading items visible.\n *\n * @internal\n */\nexport function PluginHeaderBreadcrumbs(props: {\n entries: PluginHeaderBreadcrumbEntry[];\n className?: string;\n ellipsisClassName?: string;\n}) {\n const { entries, className, ellipsisClassName } = props;\n\n if (entries.length === 0) return null;\n\n const isSingleEntry = entries.length === 1;\n const current = entries[entries.length - 1];\n const rest = entries.slice(0, -1);\n\n let ancestorItems: React.ReactNode = null;\n\n if (entries.length >= COLLAPSE_THRESHOLD) {\n const root = rest.slice(0, ROOT_ITEMS);\n const leading = rest.slice(-LEADING_ITEMS);\n const collapsed = rest.slice(ROOT_ITEMS, -LEADING_ITEMS);\n\n ancestorItems = (\n <>\n {root.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ))}\n <CollapsedSegment\n items={collapsed}\n ellipsisClassName={ellipsisClassName}\n />\n {leading.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ))}\n </>\n );\n } else {\n ancestorItems = rest.map(entry => (\n <AncestorSegment key={entry.href} entry={entry} />\n ));\n }\n\n return (\n <nav id=\"Breadcrumbs\" aria-label=\"Breadcrumbs\" className={className}>\n <RACBreadcrumbs>\n {ancestorItems}\n <CurrentSegment entry={current} isSingleEntry={isSingleEntry} />\n </RAC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AA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,IAAA,CAAK,IAAI,CAAA,KAAA,qBACR,GAAA,CAAC,mBAAiC,KAAA,EAAA,EAAZ,KAAA,CAAM,IAAoB,CACjD,CAAA;AAAA,sBACD,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,SAAA;AAAA,UACP;AAAA;AAAA,OACF;AAAA,MACC,OAAA,CAAQ,IAAI,CAAA,KAAA,qBACX,GAAA,CAAC,mBAAiC,KAAA,EAAA,EAAZ,KAAA,CAAM,IAAoB,CACjD;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ,CAAA,MAAO;AACL,IAAA,aAAA,GAAgB,IAAA,CAAK,IAAI,CAAA,KAAA,qBACvB,GAAA,CAAC,mBAAiC,KAAA,EAAA,EAAZ,KAAA,CAAM,IAAoB,CACjD,CAAA;AAAA,EACH;AAEA,EAAA,uBACE,GAAA,CAAC,SAAI,EAAA,EAAG,aAAA,EAAc,cAAW,aAAA,EAAc,SAAA,EAC7C,+BAACE,WAAA,EAAA,EACE,QAAA,EAAA;AAAA,IAAA,aAAA;AAAA,oBACD,GAAA,CAAC,cAAA,EAAA,EAAe,KAAA,EAAO,OAAA,EAAS,aAAA,EAA8B;AAAA,GAAA,EAChE,CAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n toolbarContent: 'bui-PluginHeaderToolbarContent',\n toolbarControls: 'bui-PluginHeaderToolbarControls',\n toolbarIcon: 'bui-PluginHeaderToolbarIcon',\n toolbarName: 'bui-PluginHeaderToolbarName',\n breadcrumbs: 'bui-PluginHeaderBreadcrumbs',\n breadcrumbsEllipsis: 'bui-PluginHeaderBreadcrumbsEllipsis',\n tabs: 'bui-PluginHeaderTabsWrapper',\n },\n propDefs: {\n icon: {},\n title: {},\n titleLink: {},\n breadcrumbs: {},\n customActions: {},\n tabs: {},\n onTabSelectionChange: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS,yBAAA;AAAA,IACT,cAAA,EAAgB,gCAAA;AAAA,IAChB,eAAA,EAAiB,iCAAA;AAAA,IACjB,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,mBAAA,EAAqB,qCAAA;AAAA,IACrB,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,sBAAsB,EAAC;AAAA,IACvB,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n toolbarContent: 'bui-PluginHeaderToolbarContent',\n toolbarControls: 'bui-PluginHeaderToolbarControls',\n toolbarIcon: 'bui-PluginHeaderToolbarIcon',\n toolbarName: 'bui-PluginHeaderToolbarName',\n breadcrumbs: 'bui-PluginHeaderBreadcrumbs',\n breadcrumbsEllipsis: 'bui-PluginHeaderBreadcrumbsEllipsis',\n tabs: 'bui-PluginHeaderTabsWrapper',\n },\n propDefs: {\n icon: {},\n title: {},\n titleLink: {},\n breadcrumbs: {},\n customActions: {},\n tabs: {},\n onTabSelectionChange: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS,yBAAA;AAAA,IACT,cAAA,EAAgB,gCAAA;AAAA,IAChB,eAAA,EAAiB,iCAAA;AAAA,IACjB,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,mBAAA,EAAqB,qCAAA;AAAA,IACrB,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,sBAAsB,EAAC;AAAA,IACvB,WAAW;AAAC;AAEhB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIsTruncated.esm.js","sources":["../../../src/components/PluginHeader/useIsTruncated.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 { useRef, useState } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\n\nconst DEBOUNCE_MS = 150;\n\nfunction observeResize(\n el: HTMLElement,\n callback: () => void,\n): (() => void) | undefined {\n if (typeof ResizeObserver === 'undefined') return undefined; // ResizeObserver isn't available in all runtimes (e.g. older browsers, SSR, Jest/jsdom)\n\n let timerId: ReturnType<typeof setTimeout> | undefined;\n const observer = new ResizeObserver(() => {\n clearTimeout(timerId);\n timerId = setTimeout(callback, DEBOUNCE_MS);\n });\n observer.observe(el);\n return () => {\n clearTimeout(timerId);\n observer.disconnect();\n };\n}\n\n/**\n * Tracks whether a text element is overflowing its container via CSS truncation.\n * Useful for conditionally showing a tooltip only when text is truncated.\n *\n * Checks on every render and whenever the element resizes (via ResizeObserver, debounced).\n *\n * @example\n * ```tsx\n * const { ref, truncated } = useIsTruncated();\n *\n * <TooltipTrigger isDisabled={!truncated}>\n * <span ref={ref}>\n * {label}\n * </span>\n * <Tooltip>{label}</Tooltip>\n * </TooltipTrigger>\n * ```\n *\n * @internal\n */\nexport function useIsTruncated<T extends HTMLElement = HTMLElement>(): {\n ref: React.RefObject<T>;\n truncated: boolean;\n} {\n const ref = useRef<T>(null);\n const [truncated, setTruncated] = useState(false);\n\n // Re-check after each render in case the content changes without a resize event.\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n setTruncated(el.scrollWidth > el.clientWidth);\n });\n\n // Also keep it up-to-date when the element resizes.\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el) return undefined;\n\n const check = () => setTruncated(el.scrollWidth > el.clientWidth);\n\n return observeResize(el, check);\n }, []);\n\n return { ref, truncated };\n}\n"],"names":[],"mappings":";;;AAmBA,MAAM,WAAA,GAAc,GAAA;AAEpB,SAAS,aAAA,CACP,IACA,QAAA,EAC0B;AAC1B,EAAA,IAAI,OAAO,cAAA,KAAmB,WAAA,EAAa,OAAO,MAAA;AAElD,EAAA,IAAI,OAAA;AACJ,EAAA,MAAM,QAAA,GAAW,IAAI,cAAA,CAAe,MAAM;AACxC,IAAA,YAAA,CAAa,OAAO,CAAA;AACpB,IAAA,OAAA,GAAU,UAAA,CAAW,UAAU,WAAW,CAAA;AAAA,EAC5C,CAAC,CAAA;AACD,EAAA,QAAA,CAAS,QAAQ,EAAE,CAAA;AACnB,EAAA,OAAO,MAAM;AACX,IAAA,YAAA,CAAa,OAAO,CAAA;AACpB,IAAA,QAAA,CAAS,UAAA,EAAW;AAAA,EACtB,CAAA;AACF;AAsBO,SAAS,cAAA,GAGd;AACA,EAAA,MAAM,GAAA,GAAM,OAAU,IAAI,CAAA;AAC1B,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAGhD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,KAAK,GAAA,CAAI,OAAA;AACf,IAAA,IAAI,CAAC,EAAA,EAAI;AACT,IAAA,YAAA,CAAa,EAAA,CAAG,WAAA,GAAc,EAAA,CAAG,WAAW,CAAA;AAAA,EAC9C,CAAC,CAAA;AAGD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,KAAK,GAAA,CAAI,OAAA;AACf,IAAA,IAAI,CAAC,IAAI,OAAO,MAAA;AAEhB,IAAA,MAAM,QAAQ,MAAM,YAAA,CAAa,EAAA,CAAG,WAAA,GAAc,GAAG,WAAW,CAAA;AAEhE,IAAA,OAAO,aAAA,CAAc,IAAI,KAAK,CAAA;AAAA,EAChC,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,KAAK,SAAA,EAAU;AAC1B;;;;"}
1
+ {"version":3,"file":"useIsTruncated.esm.js","sources":["../../../src/components/PluginHeader/useIsTruncated.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 { useRef, useState } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\n\nconst DEBOUNCE_MS = 150;\n\nfunction observeResize(\n el: HTMLElement,\n callback: () => void,\n): (() => void) | undefined {\n if (typeof ResizeObserver === 'undefined') return undefined; // ResizeObserver isn't available in all runtimes (e.g. older browsers, SSR, Jest/jsdom)\n\n let timerId: ReturnType<typeof setTimeout> | undefined;\n const observer = new ResizeObserver(() => {\n clearTimeout(timerId);\n timerId = setTimeout(callback, DEBOUNCE_MS);\n });\n observer.observe(el);\n return () => {\n clearTimeout(timerId);\n observer.disconnect();\n };\n}\n\n/**\n * Tracks whether a text element is overflowing its container via CSS truncation.\n * Useful for conditionally showing a tooltip only when text is truncated.\n *\n * Checks on every render and whenever the element resizes (via ResizeObserver, debounced).\n *\n * @example\n * ```tsx\n * const { ref, truncated } = useIsTruncated();\n *\n * <TooltipTrigger isDisabled={!truncated}>\n * <span ref={ref}>\n * {label}\n * </span>\n * <Tooltip>{label}</Tooltip>\n * </TooltipTrigger>\n * ```\n *\n * @internal\n */\nexport function useIsTruncated<T extends HTMLElement = HTMLElement>(): {\n ref: React.RefObject<T>;\n truncated: boolean;\n} {\n const ref = useRef<T>(null);\n const [truncated, setTruncated] = useState(false);\n\n // Re-check after each render in case the content changes without a resize event.\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n setTruncated(el.scrollWidth > el.clientWidth);\n });\n\n // Also keep it up-to-date when the element resizes.\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el) return undefined;\n\n const check = () => setTruncated(el.scrollWidth > el.clientWidth);\n\n return observeResize(el, check);\n }, []);\n\n return { ref, truncated };\n}\n"],"names":[],"mappings":";;;AAmBA,MAAM,WAAA,GAAc,GAAA;AAEpB,SAAS,aAAA,CACP,IACA,QAAA,EAC0B;AAC1B,EAAA,IAAI,OAAO,cAAA,KAAmB,WAAA,EAAa,OAAO,MAAA;AAElD,EAAA,IAAI,OAAA;AACJ,EAAA,MAAM,QAAA,GAAW,IAAI,cAAA,CAAe,MAAM;AACxC,IAAA,YAAA,CAAa,OAAO,CAAA;AACpB,IAAA,OAAA,GAAU,UAAA,CAAW,UAAU,WAAW,CAAA;AAAA,EAC5C,CAAC,CAAA;AACD,EAAA,QAAA,CAAS,QAAQ,EAAE,CAAA;AACnB,EAAA,OAAO,MAAM;AACX,IAAA,YAAA,CAAa,OAAO,CAAA;AACpB,IAAA,QAAA,CAAS,UAAA,EAAW;AAAA,EACtB,CAAA;AACF;AAsBO,SAAS,cAAA,GAGd;AACA,EAAA,MAAM,GAAA,GAAM,OAAU,IAAI,CAAA;AAC1B,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAGhD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,KAAK,GAAA,CAAI,OAAA;AACf,IAAA,IAAI,CAAC,EAAA,EAAI;AACT,IAAA,YAAA,CAAa,EAAA,CAAG,WAAA,GAAc,EAAA,CAAG,WAAW,CAAA;AAAA,EAC9C,CAAC,CAAA;AAGD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,KAAK,GAAA,CAAI,OAAA;AACf,IAAA,IAAI,CAAC,IAAI,OAAO,MAAA;AAEhB,IAAA,MAAM,QAAQ,MAAM,YAAA,CAAa,EAAA,CAAG,WAAA,GAAc,GAAG,WAAW,CAAA;AAEhE,IAAA,OAAO,aAAA,CAAc,IAAI,KAAK,CAAA;AAAA,EAChC,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,KAAK,SAAA,EAAU;AAC1B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.esm.js","sources":["../../../src/components/Popover/Popover.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 { forwardRef } from 'react';\nimport { useId } from 'react-aria';\nimport { OverlayArrow, Popover as AriaPopover } from 'react-aria-components';\nimport { PopoverProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PopoverDefinition } from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n/**\n * A popover component built on React Aria Components that displays floating\n * content anchored to a trigger element.\n *\n * @remarks\n * The Popover component supports multiple placements (top, right, bottom, left),\n * automatic viewport-constrained scrolling, and conditional arrow rendering. It\n * automatically handles positioning, collision detection, and ARIA attributes for\n * accessibility. Content is automatically padded and scrollable when it exceeds\n * available space.\n *\n * @example\n * Basic usage with DialogTrigger:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open Popover</Button>\n * <Popover>\n * <Text>Popover content</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @example\n * With custom placement and no arrow:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <Popover placement=\"right\" hideArrow>\n * <Text>Content without arrow</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @public\n */\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(PopoverDefinition, props);\n const { classes, children, hideArrow } = ownProps;\n const svgPathId = useId();\n\n return (\n <AriaPopover className={classes.root} {...restProps} ref={ref}>\n {({ trigger }) => (\n <>\n {!hideArrow &&\n trigger !== 'MenuTrigger' &&\n trigger !== 'SubmenuTrigger' && (\n <OverlayArrow className={classes.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <defs>\n <path\n id={svgPathId}\n fillRule=\"evenodd\"\n d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\"\n />\n </defs>\n\n <use href={`#${svgPathId}`} />\n <use href={`#${svgPathId}`} />\n\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n )}\n <BgReset>\n <Box bg=\"neutral\" className={classes.content}>\n {children}\n </Box>\n </BgReset>\n </>\n )}\n </AriaPopover>\n );\n },\n);\n\nPopover.displayName = 'Popover';\n"],"names":["AriaPopover"],"mappings":";;;;;;;;;;AA4DO,MAAM,OAAA,GAAU,UAAA;AAAA,EACrB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,mBAAmB,KAAK,CAAA;AACtE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,SAAA,EAAU,GAAI,QAAA;AACzC,IAAA,MAAM,YAAY,KAAA,EAAM;AAExB,IAAA,uBACE,GAAA,CAACA,SAAA,EAAA,EAAY,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,GAAA,EAClD,QAAA,EAAA,CAAC,EAAE,OAAA,EAAQ,qBACV,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,CAAC,aACA,OAAA,KAAY,aAAA,IACZ,YAAY,gBAAA,oBACV,GAAA,CAAC,gBAAa,SAAA,EAAW,OAAA,CAAQ,OAC/B,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,OAAM,IAAA,EAAK,MAAA,EAAO,MAAK,OAAA,EAAQ,WAAA,EAAY,MAAK,MAAA,EACnD,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAI,SAAA;AAAA,YACJ,QAAA,EAAS,SAAA;AAAA,YACT,CAAA,EAAE;AAAA;AAAA,SACJ,EACF,CAAA;AAAA,wBAEA,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAC5B,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAE5B,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,qSAAA,EAAsS;AAAA,OAAA,EAChT,CAAA,EACF,CAAA;AAAA,sBAEJ,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,WAAU,SAAA,EAAW,OAAA,CAAQ,OAAA,EAClC,QAAA,EACH,CAAA,EACF;AAAA,KAAA,EACF,CAAA,EAEJ,CAAA;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA;;;;"}
1
+ {"version":3,"file":"Popover.esm.js","sources":["../../../src/components/Popover/Popover.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 { forwardRef } from 'react';\nimport { useId } from 'react-aria';\nimport { OverlayArrow, Popover as AriaPopover } from 'react-aria-components';\nimport { PopoverProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PopoverDefinition } from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n/**\n * A popover component built on React Aria Components that displays floating\n * content anchored to a trigger element.\n *\n * @remarks\n * The Popover component supports multiple placements (top, right, bottom, left),\n * automatic viewport-constrained scrolling, and conditional arrow rendering. It\n * automatically handles positioning, collision detection, and ARIA attributes for\n * accessibility. Content is automatically padded and scrollable when it exceeds\n * available space.\n *\n * @example\n * Basic usage with DialogTrigger:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open Popover</Button>\n * <Popover>\n * <Text>Popover content</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @example\n * With custom placement and no arrow:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <Popover placement=\"right\" hideArrow>\n * <Text>Content without arrow</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @public\n */\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(PopoverDefinition, props);\n const { classes, children, hideArrow } = ownProps;\n const svgPathId = useId();\n\n return (\n <AriaPopover className={classes.root} {...restProps} ref={ref}>\n {({ trigger }) => (\n <>\n {!hideArrow &&\n trigger !== 'MenuTrigger' &&\n trigger !== 'SubmenuTrigger' && (\n <OverlayArrow className={classes.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <defs>\n <path\n id={svgPathId}\n fillRule=\"evenodd\"\n d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\"\n />\n </defs>\n\n <use href={`#${svgPathId}`} />\n <use href={`#${svgPathId}`} />\n\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n )}\n <BgReset>\n <Box bg=\"neutral\" className={classes.content}>\n {children}\n </Box>\n </BgReset>\n </>\n )}\n </AriaPopover>\n );\n },\n);\n\nPopover.displayName = 'Popover';\n"],"names":["AriaPopover"],"mappings":";;;;;;;;;;AA4DO,MAAM,OAAA,GAAU,UAAA;AAAA,EACrB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,mBAAmB,KAAK,CAAA;AACtE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,SAAA,EAAU,GAAI,QAAA;AACzC,IAAA,MAAM,YAAY,KAAA,EAAM;AAExB,IAAA,uBACE,GAAA,CAACA,SAAA,EAAA,EAAY,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,GAAA,EAClD,QAAA,EAAA,CAAC,EAAE,OAAA,EAAQ,qBACV,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,CAAC,aACA,OAAA,KAAY,aAAA,IACZ,YAAY,gBAAA,oBACV,GAAA,CAAC,gBAAa,SAAA,EAAW,OAAA,CAAQ,OAC/B,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,OAAM,IAAA,EAAK,MAAA,EAAO,MAAK,OAAA,EAAQ,WAAA,EAAY,MAAK,MAAA,EACnD,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAI,SAAA;AAAA,YACJ,QAAA,EAAS,SAAA;AAAA,YACT,CAAA,EAAE;AAAA;AAAA,SACJ,EACF,CAAA;AAAA,wBAEA,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAC5B,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAE5B,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,qSAAA,EAAsS;AAAA,OAAA,EAChT,CAAA,EACF,CAAA;AAAA,sBAEJ,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,WAAU,SAAA,EAAW,OAAA,CAAQ,OAAA,EAClC,QAAA,EACH,CAAA,EACF;AAAA,KAAA,EACF,CAAA,EAEJ,CAAA;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"Popover.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PopoverOwnProps } from './types';\nimport styles from './Popover.module.css';\n\n/**\n * Component definition for Popover\n * @public\n */\nexport const PopoverDefinition = defineComponent<PopoverOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Popover',\n arrow: 'bui-PopoverArrow',\n content: 'bui-PopoverContent',\n },\n propDefs: {\n children: {},\n hideArrow: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PopoverOwnProps } from './types';\nimport styles from './Popover.module.css';\n\n/**\n * Component definition for Popover\n * @public\n */\nexport const PopoverDefinition = defineComponent<PopoverOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Popover',\n arrow: 'bui-PopoverArrow',\n content: 'bui-PopoverContent',\n },\n propDefs: {\n children: {},\n hideArrow: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,WAAW;AAAC;AAEhB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { RadioGroupDefinition, RadioDefinition } from './definition';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/**\n * A group of radio buttons for selecting a single option from a set, with an integrated label, description, and error display.\n *\n * @public\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioGroupDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n isRequired,\n children,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'RadioGroup requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaRadioGroup className={classes.root} {...restProps} ref={ref}>\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <div className={classes.content}>{children}</div>\n <FieldError />\n </AriaRadioGroup>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/**\n * A single radio button for use within a RadioGroup.\n *\n * @public\n */\nexport const Radio = forwardRef<HTMLLabelElement, RadioProps>((props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioDefinition, props);\n\n return (\n <AriaRadio className={ownProps.classes.root} {...restProps} ref={ref} />\n );\n});\n\nRadio.displayName = 'Radio';\n"],"names":["AriaRadioGroup","AriaRadio"],"mappings":";;;;;;;;;;AAiCO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,QAAA;AAEJ,IAAA,MAAM,SAAA,GAAY,UAAU,YAAY,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,UAAU,iBAAiB,CAAA;AAElD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAGrC,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAE/C,IAAA,4BACGA,YAAA,EAAA,EAAe,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EACtD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,KAAA;AAAA,UACA,cAAA,EAAgB,kBAAA;AAAA,UAChB,WAAA;AAAA,UACA,eAAA,EAAgB;AAAA;AAAA,OAClB;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAU,QAAA,EAAS,CAAA;AAAA,0BAC1C,UAAA,EAAA,EAAW;AAAA,KAAA,EACd,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAOlB,MAAM,KAAA,GAAQ,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,iBAAiB,KAAK,CAAA;AAEpE,EAAA,uBACE,GAAA,CAACC,WAAU,SAAA,EAAW,QAAA,CAAS,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EAAU,CAAA;AAE1E,CAAC;AAED,KAAA,CAAM,WAAA,GAAc,OAAA;;;;"}
1
+ {"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { RadioGroupDefinition, RadioDefinition } from './definition';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/**\n * A group of radio buttons for selecting a single option from a set, with an integrated label, description, and error display.\n *\n * @public\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioGroupDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n isRequired,\n children,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'RadioGroup requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaRadioGroup className={classes.root} {...restProps} ref={ref}>\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <div className={classes.content}>{children}</div>\n <FieldError />\n </AriaRadioGroup>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/**\n * A single radio button for use within a RadioGroup.\n *\n * @public\n */\nexport const Radio = forwardRef<HTMLLabelElement, RadioProps>((props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioDefinition, props);\n\n return (\n <AriaRadio className={ownProps.classes.root} {...restProps} ref={ref} />\n );\n});\n\nRad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c,YAAA;AAOlB,MAAM,KAAA,GAAQ,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,iBAAiB,KAAK,CAAA;AAEpE,EAAA,uBACE,GAAA,CAACC,WAAU,SAAA,EAAW,QAAA,CAAS,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EAAU,CAAA;AAE1E,CAAC;AAED,KAAA,CAAM,WAAA,GAAc,OAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"RadioGroup.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { RadioGroupOwnProps, RadioOwnProps } from './types';\nimport styles from './RadioGroup.module.css';\n\n/**\n * Component definition for RadioGroup\n * @public\n */\nexport const RadioGroupDefinition = defineComponent<RadioGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n },\n propDefs: {\n children: {},\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n\n/**\n * Component definition for Radio\n * @public\n */\nexport const RadioDefinition = defineComponent<RadioOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Radio',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;AAMM,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { RadioGroupOwnProps, RadioOwnProps } from './types';\nimport styles from './RadioGroup.module.css';\n\n/**\n * Component definition for RadioGroup\n * @public\n */\nexport const RadioGroupDefinition = defineComponent<RadioGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n },\n propDefs: {\n children: {},\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n\n/**\n * Component definition for Radio\n * @public\n */\nexport const RadioDefinition = defineComponent<RadioOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Radio',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;AAMM,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.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 { Children, useRef } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from 'react-stately';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/**\n * A search input that shows a dropdown list of suggestions as the user types, with loading and empty states.\n *\n * @public\n */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n {...dataAttributes}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\ntype SearchAutocompleteItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SearchAutocompleteItemDefinition,\n SearchAutocompleteItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SearchAutocompleteItemView({\n definitionResult,\n navigation,\n}: SearchAutocompleteItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n {...navigationProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n\n/**\n * An individual option item within a SearchAutocomplete dropdown.\n *\n * @public\n */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const definitionResult = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SearchAutocompleteItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;;AAmDA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,YAAY,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACvE,CAAA;AAOO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,4BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA,GAAmB,cAAA;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,I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S,GAAI,QAAA;AAC9B,EAAA,MAAM,eAAA,GAAkB,uBAAA,CAAwB,UAAA,EAAY,SAAS,CAAA;AAErE,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MACH,GAAG,eAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;AAEJ;AAOO,SAAS,uBAAuB,KAAA,EAAoC;AACzE,EAAA,MAAM,gBAAA,GAAmB,aAAA;AAAA,IACvB,gCAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,aAAa,gBAAA,CAAiB,UAAA;AAEpC,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAO,gBAAA,CAAiB,SAAA;AAAA,MACxB,IAAA,EAAM,0BAAA;AAAA,MACN,SAAA,EAAW,EAAE,gBAAA;AAAiB;AAAA,GAChC;AAEJ;;;;"}
1
+ {"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.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 { Children, useRef } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from 'react-stately';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/**\n * A search input that shows a dropdown list of suggestions as the user types, with loading and empty states.\n *\n * @public\n */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n {...dataAttributes}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\ntype SearchAutocompleteItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SearchAutocompleteItemDefinition,\n SearchAutocompleteItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SearchAutocompleteItemView({\n definitionResult,\n navigation,\n}: SearchAutocompleteItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n {...navigationProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n\n/**\n * An individual option item within a SearchAutocomplete dropdown.\n *\n * @public\n */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const definitionResult = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SearchAutocompleteItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;;AAmDA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,YAAY,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACvE,CAAA;AAOO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,4BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,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,QAAA,EAAU,SAAA,EAAU,GAAI,gBAAA;AAChC,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAC9B,EAAA,MAAM,eAAA,GAAkB,uBAAA,CAAwB,UAAA,EAAY,SAAS,CAAA;AAErE,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MACH,GAAG,eAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;AAEJ;AAOO,SAAS,uBAAuB,KAAA,EAAoC;AACzE,EAAA,MAAM,gBAAA,GAAmB,aAAA;AAAA,IACvB,gCAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,aAAa,gBAAA,CAAiB,UAAA;AAEpC,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAO,gBAAA,CAAiB,SAAA;AAAA,MACxB,IAAA,EAAM,0BAAA;AAAA,MACN,SAAA,EAAW,EAAE,gBAAA;AAAiB;AAAA,GAChC;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAutocomplete.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"SearchAutocomplete.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n navigation: { type: 'anchor' },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BO,MAAM,4BAAA,GACX,iBAA4C,CAAE;AAAA,EAC5C,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,mCAAA;AAAA,IACb,gBAAA,EAAkB,6BAAA;AAAA,IAClB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,OAAA,EAAS,+BAAA;AAAA,IACT,KAAA,EAAO,6BAAA;AAAA,IACP,OAAA,EAAS,+BAAA;AAAA,IACT,YAAA,EAAc,oCAAA;AAAA,IACd,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAc,EAAC;AAAA,IACf,mBAAmB,EAAC;AAAA,IACpB,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,YAAY,EAAC;AAAA,IACb,eAAe,EAAC;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,kBAAkB,EAAC;AAAA,IACnB,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;AAGI,MAAM,gCAAA,GACX,iBAAgD,CAAE;AAAA,EAChD,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,4BAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,UAAA,EAAY,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n navigation: { type: 'anchor' },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AA2BO,MAAM,4BAAA,GACX,iBAA4C,CAAE;AAAA,EAC5C,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,mCAAA;AAAA,IACb,gBAAA,EAAkB,6BAAA;AAAA,IAClB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,OAAA,EAAS,+BAAA;AAAA,IACT,KAAA,EAAO,6BAAA;AAAA,IACP,OAAA,EAAS,+BAAA;AAAA,IACT,YAAA,EAAc,oCAAA;AAAA,IACd,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAc,EAAC;AAAA,IACf,mBAAmB,EAAC;AAAA,IACpB,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,YAAY,EAAC;AAAA,IACb,eAAe,EAAC;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,kBAAkB,EAAC;AAAA,IACnB,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;AAGI,MAAM,gCAAA,GACX,iBAAgD,CAAE;AAAA,EAChD,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,4BAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,UAAA,EAAY,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState, useRef } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SearchFieldDefinition } from './definition';\n\nimport type { SearchFieldProps } from './types';\n\n/**\n * A text input optimized for search queries, with a built-in clear button, optional icon, and support for a collapsible mode.\n *\n * @public\n */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SearchFieldDefinition,\n props,\n );\n const {\n classes,\n label,\n icon,\n secondaryLabel,\n placeholder,\n startCollapsed,\n description,\n } = ownProps;\n\n useEffect(() => {\n if (!label && !restProps['aria-label'] && !restProps['aria-labelledby']) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, restProps['aria-label'], restProps['aria-labelledby']]);\n\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (restProps.isRequired ? 'Required' : null);\n\n const handleFocusChange = (isFocused: boolean) => {\n restProps.onFocusChange?.(isFocused);\n setIsFocused(isFocused);\n };\n\n const handleContainerClick = () => {\n inputRef.current?.focus();\n };\n\n const hasInputRef = !!inputRef.current;\n const hasValue = !!inputRef.current?.value;\n\n const isCollapsed = hasInputRef\n ? startCollapsed && !hasValue && !isFocused\n : startCollapsed &&\n !restProps.value &&\n !restProps.defaultValue &&\n !isFocused;\n\n return (\n <AriaSearchField\n className={classes.root}\n {...dataAttributes}\n data-collapsed={isCollapsed}\n {...restProps}\n onFocusChange={handleFocusChange}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <div\n className={classes.inputWrapper}\n data-size={dataAttributes['data-size']}\n onClick={handleContainerClick}\n >\n {icon !== false && (\n <div\n className={classes.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n ref={inputRef}\n className={classes.input}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={classes.clear}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["isFocused","AriaSearchField"],"mappings":";;;;;;;;;;;AAmCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,qBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA,KACF,GAAI,QAAA;AAEJ,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,SAAS,CAAC,SAAA,CAAU,YAAY,CAAA,IAAK,CAAC,SAAA,CAAU,iBAAiB,CAAA,EAAG;AACvE,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,CAAU,YAAY,CAAA,EAAG,SAAA,CAAU,iBAAiB,CAAC,CAAC,CAAA;AAEjE,IAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,IAAA,MAAM,QAAA,GAAW,OAAyB,IAAI,CAAA;AAG9C,IAAA,MAAM,kBAA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AAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,OAAA,CAAQ,SAAA;AAAA,oBACnB,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBACrC,aAAA,EAAY,MAAA;AAAA,oBAEX,QAAA,EAAA,IAAA,wBAAS,aAAA,EAAA,EAAc;AAAA;AAAA,iBAC1B;AAAA,gCAEF,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,GAAA,EAAK,QAAA;AAAA,oBACL,WAAW,OAAA,CAAQ,KAAA;AAAA,oBAClB,GAAI,IAAA,KAAS,KAAA,IAAS,EAAE,aAAa,IAAA,EAAK;AAAA,oBAC3C;AAAA;AAAA,iBACF;AAAA,gCACA,GAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,OAAA,CAAQ,KAAA;AAAA,oBACnB,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBAErC,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA;AACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
1
+ {"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState, useRef } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SearchFieldDefinition } from './definition';\n\nimport type { SearchFieldProps } from './types';\n\n/**\n * A text input optimized for search queries, with a built-in clear button, optional icon, and support for a collapsible mode.\n *\n * @public\n */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SearchFieldDefinition,\n props,\n );\n const {\n classes,\n label,\n icon,\n secondaryLabel,\n placeholder,\n startCollapsed,\n description,\n } = ownProps;\n\n useEffect(() => {\n if (!label && !restProps['aria-label'] && !restProps['aria-labelledby']) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, restProps['aria-label'], restProps['aria-labelledby']]);\n\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (restProps.isRequired ? 'Required' : null);\n\n const handleFocusChange = (isFocused: boolean) => {\n restProps.onFocusChange?.(isFocused);\n setIsFocused(isFocused);\n };\n\n const handleContainerClick = () => {\n inputRef.current?.focus();\n };\n\n const hasInputRef = !!inputRef.current;\n const hasValue = !!inputRef.current?.value;\n\n const isCollapsed = hasInputRef\n ? startCollapsed && !hasValue && !isFocused\n : startCollapsed &&\n !restProps.value &&\n !restProps.defaultValue &&\n !isFocused;\n\n return (\n <AriaSearchField\n className={classes.root}\n {...dataAttributes}\n data-collapsed={isCollapsed}\n {...restProps}\n onFocusChange={handleFocusChange}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <div\n className={classes.inputWrapper}\n data-size={dataAttributes['data-size']}\n onClick={handleContainerClick}\n >\n {icon !== false && (\n <div\n className={classes.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n ref={inputRef}\n className={classes.input}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={classes.clear}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["isFocused","AriaSearchField"],"mappings":";;;;;;;;;;;AAmCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,qBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA,KACF,GAAI,QAAA;AAEJ,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,SAAS,CAAC,SAAA,CAAU,YAAY,CAAA,IAAK,CAAC,SAAA,CAAU,iBAAiB,CAAA,EAAG;AACvE,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,CAAU,YAAY,CAAA,EAAG,SAAA,CAAU,iBAAiB,CAAC,CAAC,CAAA;AAEjE,IAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,IAAA,MAAM,QAAA,GAAW,OAAyB,IAAI,CAAA;AAG9C,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,SAAA,CAAU,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAEzD,IAAA,MAAM,iBAAA,GAAoB,CAACA,UAAAA,KAAuB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,oBACrC,aAAA,EAAY,MAAA;AAAA,oBAEX,QAAA,EAAA,IAAA,wBAAS,aAAA,EAAA,EAAc;AAAA;AAAA,iBAC1B;AAAA,gCAEF,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,GAAA,EAAK,QAAA;AAAA,oBACL,WAAW,OAAA,CAAQ,KAAA;AAAA,oBAClB,GAAI,IAAA,KAAS,KAAA,IAAS,EAAE,aAAa,IAAA,EAAK;AAAA,oBAC3C;AAAA;AAAA,iBACF;AAAA,gCACA,GAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,OAAA,CAAQ,KAAA;AAAA,oBACnB,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBAErC,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA;AACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"SearchField.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { SearchFieldOwnProps } from './types';\nimport styles from './SearchField.module.css';\n\n/**\n * Component definition for SearchField\n * @public\n */\nexport const SearchFieldDefinition = defineComponent<SearchFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-SearchFieldClear',\n inputWrapper: 'bui-SearchFieldInputWrapper',\n input: 'bui-SearchFieldInput',\n inputIcon: 'bui-SearchFieldInputIcon',\n },\n bg: 'consumer',\n propDefs: {\n startCollapsed: { dataAttribute: true, default: false },\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: { default: 'Search' },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,sBAAA;AAAA,IACP,YAAA,EAAc,6BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IACtD,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,MAAM,EAAC;AAAA,IACP,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,gBAAgB;AAAC;AAErB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchField/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { SearchFieldOwnProps } from './types';\nimport styles from './SearchField.module.css';\n\n/**\n * Component definition for SearchField\n * @public\n */\nexport const SearchFieldDefinition = defineComponent<SearchFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-SearchFieldClear',\n inputWrapper: 'bui-SearchFieldInputWrapper',\n input: 'bui-SearchFieldInput',\n inputIcon: 'bui-SearchFieldInputIcon',\n },\n bg: 'consumer',\n propDefs: {\n startCollapsed: { dataAttribute: true, default: false },\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: { default: 'Search' },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,sBAAA;AAAA,IACP,YAAA,EAAc,6BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IACtD,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,MAAM,EAAC;AAAA,IACP,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,gBAAgB;AAAC;AAErB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Select as AriaSelect } from 'react-aria-components';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { Key } from 'react-aria-components';\nimport type { ChangeValueType } from 'react-stately/useSelectState';\nimport type { SelectContentOwnProps, SelectProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectDefinition } from './definition';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { Popover } from '../Popover';\nimport { SelectTrigger } from './SelectTrigger';\nimport { SelectContent } from './SelectContent';\nimport {\n useCollectionAdapter,\n type CollectionAdapterResult,\n} from '../../hooks/useCollectionAdapter';\nimport { useTrackedSelectionKeys } from '../../hooks/useTrackedSelectionKeys';\nimport {\n getItemKeys,\n resolveCollectionSource,\n toSelection,\n} from '../../utils/selectableCollection';\n\nfunction resolveSelectSearch<T extends CollectionItem>({\n search,\n searchable,\n searchPlaceholder,\n}: {\n search?: SelectContentOwnProps<T>['search'];\n searchable?: boolean;\n searchPlaceholder?: string;\n}): SelectContentOwnProps<T>['search'] {\n if (search !== undefined) {\n return search;\n }\n\n if (searchable) {\n return { placeholder: searchPlaceholder };\n }\n\n return undefined;\n}\n\nfunction resolveContentSearch<T extends CollectionItem>(\n search: SelectContentOwnProps<T>['search'],\n collection: CollectionAdapterResult<T>,\n): SelectContentOwnProps<T>['search'] {\n if (typeof search !== 'object') {\n return search;\n }\n\n return {\n ...search,\n inputValue: collection.inputValue,\n defaultInputValue: collection.defaultInputValue,\n onInputChange: collection.onInputChange,\n } as SelectContentOwnProps<T>['search'];\n}\n\nfunction getRetainedOptions<T extends CollectionItem>(\n flatOptions: NormalizedOption[] | undefined,\n canonicalItems: T[],\n) {\n if (!flatOptions) {\n return undefined;\n }\n\n const sourceIds = getItemKeys(flatOptions);\n return canonicalItems.filter(item => !sourceIds.has(item.id));\n}\n\n/**\n * A dropdown picker for selecting one or multiple options from a list, with optional search filtering and inline error display.\n *\n * @public\n */\nfunction SelectImpl<\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends CollectionItem = NormalizedOption,\n>(props: SelectProps<M, T>, ref: React.ForwardedRef<HTMLDivElement>) {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SelectDefinition,\n {\n placeholder: 'Select an option',\n ...props,\n },\n );\n\n const {\n classes,\n label,\n description,\n options,\n icon,\n searchable,\n searchPlaceholder,\n search,\n loading,\n items,\n children,\n dependencies,\n isRequired,\n secondaryLabel,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n const resolvedSearch = resolveSelectSearch<T>({\n search: search as SelectContentOwnProps<T>['search'],\n searchable,\n searchPlaceholder,\n });\n const collectionSource = resolveCollectionSource<T>({ options, items });\n const controlledValue =\n restProps.value !== undefined ? restProps.value : restProps.selectedKey;\n const defaultValue =\n restProps.defaultValue !== undefined\n ? restProps.defaultValue\n : restProps.defaultSelectedKey;\n const trackedSelection = useTrackedSelectionKeys({\n selectedKeys:\n controlledValue === undefined ? undefined : toSelection(controlledValue),\n defaultSelectedKeys: toSelection(defaultValue),\n });\n const collection = useCollectionAdapter({\n items: collectionSource.source,\n selectedKeys: trackedSelection.selectedKeys,\n search: resolvedSearch,\n loading,\n });\n const retainedOptions = getRetainedOptions(\n collectionSource.flatOptions,\n collection.canonicalItems,\n );\n const renderedItems = collectionSource.rendersItems\n ? collection.canonicalItems\n : undefined;\n const contentSearch = resolveContentSearch(resolvedSearch, collection);\n const handleChange = (value: ChangeValueType<M>) => {\n trackedSelection.onSelectionChange(toSelection(value));\n restProps.onChange?.(value);\n };\n\n return (\n <AriaSelect\n className={classes.root}\n {...dataAttributes}\n ref={ref}\n {...restProps}\n onChange={handleChange}\n allowsEmptyCollection\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <SelectTrigger icon={icon} />\n <FieldError />\n <Popover className={classes.popover} hideArrow {...dataAttributes}>\n <SelectContent\n search={contentSearch}\n options={collectionSource.options}\n items={renderedItems}\n dependencies={dependencies}\n loading={collection.loading}\n isStale={collection.isStale}\n visibleIds={collection.visibleIds}\n retainedOptions={\n retainedOptions as unknown as ReadonlyArray<NormalizedOption>\n }\n >\n {children}\n </SelectContent>\n </Popover>\n </AriaSelect>\n );\n}\n\n/** @public */\nexport const Select = forwardRef(SelectImpl) as {\n <\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends { id: Key } = NormalizedOption,\n >(\n props: SelectProps<M, T> & React.RefAttributes<HTMLDivElement>,\n ): React.ReactElement | null;\n displayName?: string;\n};\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,SAAS,mBAAA,CAA8C;AAAA,EACrD,MAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAIuC;AACrC,EAAA,IAAI,WAAW,MAAA,EAAW;AACxB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,O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C,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
1
+ {"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Select as AriaSelect } from 'react-aria-components';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { Key } from 'react-aria-components';\nimport type { ChangeValueType } from 'react-stately/useSelectState';\nimport type { SelectContentOwnProps, SelectProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectDefinition } from './definition';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { Popover } from '../Popover';\nimport { SelectTrigger } from './SelectTrigger';\nimport { SelectContent } from './SelectContent';\nimport {\n useCollectionAdapter,\n type CollectionAdapterResult,\n} from '../../hooks/useCollectionAdapter';\nimport { useTrackedSelectionKeys } from '../../hooks/useTrackedSelectionKeys';\nimport {\n getItemKeys,\n resolveCollectionSource,\n toSelection,\n} from '../../utils/selectableCollection';\n\nfunction resolveSelectSearch<T extends CollectionItem>({\n search,\n searchable,\n searchPlaceholder,\n}: {\n search?: SelectContentOwnProps<T>['search'];\n searchable?: boolean;\n searchPlaceholder?: string;\n}): SelectContentOwnProps<T>['search'] {\n if (search !== undefined) {\n return search;\n }\n\n if (searchable) {\n return { placeholder: searchPlaceholder };\n }\n\n return undefined;\n}\n\nfunction resolveContentSearch<T extends CollectionItem>(\n search: SelectContentOwnProps<T>['search'],\n collection: CollectionAdapterResult<T>,\n): SelectContentOwnProps<T>['search'] {\n if (typeof search !== 'object') {\n return search;\n }\n\n return {\n ...search,\n inputValue: collection.inputValue,\n defaultInputValue: collection.defaultInputValue,\n onInputChange: collection.onInputChange,\n } as SelectContentOwnProps<T>['search'];\n}\n\nfunction getRetainedOptions<T extends CollectionItem>(\n flatOptions: NormalizedOption[] | undefined,\n canonicalItems: T[],\n) {\n if (!flatOptions) {\n return undefined;\n }\n\n const sourceIds = getItemKeys(flatOptions);\n return canonicalItems.filter(item => !sourceIds.has(item.id));\n}\n\n/**\n * A dropdown picker for selecting one or multiple options from a list, with optional search filtering and inline error display.\n *\n * @public\n */\nfunction SelectImpl<\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends CollectionItem = NormalizedOption,\n>(props: SelectProps<M, T>, ref: React.ForwardedRef<HTMLDivElement>) {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SelectDefinition,\n {\n placeholder: 'Select an option',\n ...props,\n },\n );\n\n const {\n classes,\n label,\n description,\n options,\n icon,\n searchable,\n searchPlaceholder,\n search,\n loading,\n items,\n children,\n dependencies,\n isRequired,\n secondaryLabel,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n const resolvedSearch = resolveSelectSearch<T>({\n search: search as SelectContentOwnProps<T>['search'],\n searchable,\n searchPlaceholder,\n });\n const collectionSource = resolveCollectionSource<T>({ options, items });\n const controlledValue =\n restProps.value !== undefined ? restProps.value : restProps.selectedKey;\n const defaultValue =\n restProps.defaultValue !== undefined\n ? restProps.defaultValue\n : restProps.defaultSelectedKey;\n const trackedSelection = useTrackedSelectionKeys({\n selectedKeys:\n controlledValue === undefined ? undefined : toSelection(controlledValue),\n defaultSelectedKeys: toSelection(defaultValue),\n });\n const collection = useCollectionAdapter({\n items: collectionSource.source,\n selectedKeys: trackedSelection.selectedKeys,\n search: resolvedSearch,\n loading,\n });\n const retainedOptions = getRetainedOptions(\n collectionSource.flatOptions,\n collection.canonicalItems,\n );\n const renderedItems = collectionSource.rendersItems\n ? collection.canonicalItems\n : undefined;\n const contentSearch = resolveContentSearch(resolvedSearch, collection);\n const handleChange = (value: ChangeValueType<M>) => {\n trackedSelection.onSelectionChange(toSelection(value));\n restProps.onChange?.(value);\n };\n\n return (\n <AriaSelect\n className={classes.root}\n {...dataAttributes}\n ref={ref}\n {...restProps}\n onChange={handleChange}\n allowsEmptyCollection\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <SelectTrigger icon={icon} />\n <FieldError />\n <Popover className={classes.popover} hideArrow {...dataAttributes}>\n <SelectContent\n search={contentSearch}\n options={collectionSource.options}\n items={renderedItems}\n dependencies={dependencies}\n loading={collection.loading}\n isStale={collection.isStale}\n visibleIds={collection.visibleIds}\n retainedOptions={\n retainedOptions as unknown as ReadonlyArray<NormalizedOption>\n }\n >\n {children}\n </SelectContent>\n </Popover>\n </AriaSelect>\n );\n}\n\n/** @public */\nexport const Select = forwardRef(SelectImpl) as {\n <\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends { id: Key } = NormalizedOption,\n >(\n props: SelectProps<M, T> & React.RefAttributes<HTMLDivElement>,\n ): React.ReactElement | null;\n displayName?: string;\n};\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,SAAS,mBAAA,CAA8C;AAAA,EACrD,MAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAIuC;AACrC,EAAA,IAAI,WAAW,MAAA,EAAW;AACxB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OA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,MAAA,CAAO,WAAA,GAAc,QAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"Select.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectContent.esm.js","sources":["../../../src/components/Select/SelectContent.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 {\n Input,\n SearchField,\n Autocomplete,\n Button,\n type Key,\n} from 'react-aria-components';\nimport { useFilter } from 'react-aria';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectContentDefinition } from './definition';\nimport { SelectListBox } from './SelectListBox';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { SelectContentOwnProps } from './types';\nimport type { Node } from '@react-types/shared';\n\ntype SearchFilter<T extends CollectionItem> = (\n textValue: string,\n inputValue: string,\n node: Node<T>,\n) => boolean;\n\nfunction getSearchFilter<T extends CollectionItem>({\n visibleIds,\n filter,\n contains,\n}: {\n visibleIds?: Set<Key>;\n filter?: (item: T, query: string) => boolean;\n contains: (textValue: string, inputValue: string) => boolean;\n}): SearchFilter<T> {\n if (visibleIds) {\n return (_textValue, _inputValue, node) => visibleIds.has(node.key);\n }\n\n if (filter) {\n return (_textValue, inputValue, node) =>\n filter(node.value as T, inputValue);\n }\n\n return (textValue, inputValue) => contains(textValue, inputValue);\n}\n\nexport function SelectContent<T extends CollectionItem = NormalizedOption>(\n props: SelectContentOwnProps<T>,\n) {\n const { contains } = useFilter({ sensitivity: 'base' });\n const { ownProps } = useDefinition(SelectContentDefinition, props);\n const {\n classes,\n search,\n options,\n items,\n children,\n dependencies,\n loading,\n isStale,\n visibleIds,\n retainedOptions,\n } = ownProps;\n\n const listBox = (\n <div className={classes.results}>\n <SelectListBox\n options={options}\n items={items}\n dependencies={dependencies}\n loading={loading}\n isStale={isStale}\n retainedOptions={retainedOptions}\n >\n {children}\n </SelectListBox>\n </div>\n );\n\n if (!search) {\n return <div className={classes.root}>{listBox}</div>;\n }\n\n const searchProps = typeof search === 'object' ? search : undefined;\n const placeholder = searchProps?.placeholder ?? 'Search...';\n const filter = getSearchFilter({\n visibleIds,\n filter: searchProps?.filter,\n contains,\n });\n\n return (\n <Autocomplete\n inputValue={searchProps?.inputValue}\n defaultInputValue={searchProps?.defaultInputValue}\n onInputChange={searchProps?.onInputChange}\n filter={filter}\n >\n <div className={classes.root}>\n <SearchField\n autoFocus\n className={classes.searchWrapper}\n aria-label={placeholder}\n >\n <Input placeholder={placeholder} className={classes.search} />\n <Button className={classes.searchClear}>\n <RiCloseCircleLine />\n </Button>\n </SearchField>\n {listBox}\n </div>\n </Autocomplete>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAyCA,SAAS,eAAA,CAA0C;AAAA,EACjD,UAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAIoB;AAClB,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,OAAO,CAAC,UAAA,EAAY,WAAA,EAAa,SAAS,UAAA,CAAW,GAAA,CAAI,KAAK,GAAG,CAAA;AAAA,EACnE;AAEA,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,OAAO,CAAC,UAAA,EAAY,UAAA,EAAY,SAC9B,MAAA,CAAO,IAAA,CAAK,OAAY,UAAU,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,CAAC,SAAA,EAAW,UAAA,KAAe,QA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EAAa,iBAAA;AAAA,MAChC,eAAe,WAAA,EAAa,aAAA;AAAA,MAC5B,MAAA;AAAA,MAEA,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,IAAA,EACtB,QAAA,EAAA;AAAA,wBAAA,IAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAS,IAAA;AAAA,YACT,WAAW,OAAA,CAAQ,aAAA;AAAA,YACnB,YAAA,EAAY,WAAA;AAAA,YAEZ,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,KAAA,EAAA,EAAM,WAAA,EAA0B,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAQ,CAAA;AAAA,kCAC3D,MAAA,EAAA,EAAO,SAAA,EAAW,QAAQ,WAAA,EACzB,QAAA,kBAAA,GAAA,CAAC,qBAAkB,CAAA,EACrB;AAAA;AAAA;AAAA,SACF;AAAA,QACC;AAAA,OAAA,EACH;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"SelectContent.esm.js","sources":["../../../src/components/Select/SelectContent.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 {\n Input,\n SearchField,\n Autocomplete,\n Button,\n type Key,\n} from 'react-aria-components';\nimport { useFilter } from 'react-aria';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectContentDefinition } from './definition';\nimport { SelectListBox } from './SelectListBox';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { SelectContentOwnProps } from './types';\nimport type { Node } from '@react-types/shared';\n\ntype SearchFilter<T extends CollectionItem> = (\n textValue: string,\n inputValue: string,\n node: Node<T>,\n) => boolean;\n\nfunction getSearchFilter<T extends CollectionItem>({\n visibleIds,\n filter,\n contains,\n}: {\n visibleIds?: Set<Key>;\n filter?: (item: T, query: string) => boolean;\n contains: (textValue: string, inputValue: string) => boolean;\n}): SearchFilter<T> {\n if (visibleIds) {\n return (_textValue, _inputValue, node) => visibleIds.has(node.key);\n }\n\n if (filter) {\n return (_textValue, inputValue, node) =>\n filter(node.value as T, inputValue);\n }\n\n return (textValue, inputValue) => contains(textValue, inputValue);\n}\n\nexport function SelectContent<T extends CollectionItem = NormalizedOption>(\n props: SelectContentOwnProps<T>,\n) {\n const { contains } = useFilter({ sensitivity: 'base' });\n const { ownProps } = useDefinition(SelectContentDefinition, props);\n const {\n classes,\n search,\n options,\n items,\n children,\n dependencies,\n loading,\n isStale,\n visibleIds,\n retainedOptions,\n } = ownProps;\n\n const listBox = (\n <div className={classes.results}>\n <SelectListBox\n options={options}\n items={items}\n dependencies={dependencies}\n loading={loading}\n isStale={isStale}\n retainedOptions={retainedOptions}\n >\n {children}\n </SelectListBox>\n </div>\n );\n\n if (!search) {\n return <div className={classes.root}>{listBox}</div>;\n }\n\n const searchProps = typeof search === 'object' ? search : undefined;\n const placeholder = searchProps?.placeholder ?? 'Search...';\n const filter = getSearchFilter({\n visibleIds,\n filter: searchProps?.filter,\n contains,\n });\n\n return (\n <Autocomplete\n inputValue={searchProps?.inputValue}\n defaultInputValue={searchProps?.defaultInputValue}\n onInputChange={searchProps?.onInputChange}\n filter={filter}\n >\n <div className={classes.root}>\n <SearchField\n autoFocus\n className={classes.searchWrapper}\n aria-label={placeholder}\n >\n <Input placeholder={placeholder} className={classes.search} />\n <Button className={classes.searchClear}>\n <RiCloseCircleLine />\n </Button>\n </SearchField>\n {listBox}\n </div>\n </Autocomplete>\n );\n}\n"],"names":[],"mappings":";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CAAQ,MAAO,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,EAChD;AAEA,EAAA,MAAM,WAAA,GAAc,OAAO,MAAA,KAAW,QAAA,GAAW,MAAA,GAAS,MAAA;AAC1D,EAAA,MAAM,WAAA,GAAc,aAAa,WAAA,IAAe,WAAA;AAChD,EAAA,MAAM,SAAS,eAAA,CAAgB;AAAA,IAC7B,UAAA;AAAA,IACA,QAAQ,WAAA,EAAa,MAAA;AAAA,IACrB;AAAA,GACD,CAAA;AAED,EAAA,uBACE,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,YAAY,WAAA,EAAa,UAAA;AAAA,MACzB,mBAAmB,WAAA,EAAa,iBAAA;AAAA,MAChC,eAAe,WAAA,EAAa,aAAA;AAAA,MAC5B,MAAA;AAAA,MAEA,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,IAAA,EACtB,QAAA,EAAA;AAAA,wBAAA,IAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAS,IAAA;AAAA,YACT,WAAW,OAAA,CAAQ,aAAA;AAAA,YACnB,YAAA,EAAY,WAAA;AAAA,YAEZ,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,KAAA,EAAA,EAAM,WAAA,EAA0B,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAQ,CAAA;AAAA,kCAC3D,MAAA,EAAA,EAAO,SAAA,EAAW,QAAQ,WAAA,EACzB,QAAA,kBAAA,GAAA,CAAC,qBAAkB,CAAA,EACrB;AAAA;AAAA;AAAA,SACF;AAAA,QACC;AAAA,OAAA,EACH;AAAA;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectItem.esm.js","sources":["../../../src/components/Select/SelectItem.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 { RiCheckLine } from '@remixicon/react';\nimport { ListBoxItem, Text } from 'react-aria-components';\nimport { Avatar } from '../Avatar';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SelectItemDefinition,\n SelectItemProfileDefinition,\n SelectItemTextDefinition,\n} from './definition';\nimport type {\n SelectItemProfileProps,\n SelectItemProps,\n SelectItemTextProps,\n} from './types';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype SelectItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SelectItemDefinition,\n SelectItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SelectItemView({ definitionResult, navigation }: SelectItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children, showSelectionIndicator } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem className={classes.root} {...restProps} {...navigationProps}>\n {values => {\n const content =\n typeof children === 'function' ? children(values) : children;\n\n if (!showSelectionIndicator) {\n return content;\n }\n\n return (\n <>\n <div className={classes.indicator}>\n <RiCheckLine aria-hidden=\"true\" />\n </div>\n <div className={classes.content}>{content}</div>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\n/**\n * A low-level Select item wrapper for custom item content.\n *\n * @public\n */\nexport function SelectItem<T extends object = object>(\n props: SelectItemProps<T>,\n) {\n const definitionResult = useDefinition(SelectItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SelectItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\n/**\n * A Select item preset with a title and optional supporting content.\n *\n * @public\n */\nexport function SelectItemText<T extends object = object>(\n props: SelectItemTextProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemTextDefinition,\n props,\n );\n const { classes, title, description, leadingIcon } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={title}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n {leadingIcon && (\n <div className={classes.leadingIcon}>{leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text slot=\"label\" className={classes.title}>\n {title}\n </Text>\n {description && (\n <Text slot=\"description\" className={classes.description}>\n {description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\n/**\n * A Select item preset for a person or other named profile.\n *\n * @public\n */\nexport function SelectItemProfile<T extends object = object>(\n props: SelectItemProfileProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemProfileDefinition,\n props,\n );\n const { classes, name, src } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={name}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n <div className={classes.avatar}>\n <Avatar\n src={src ?? ''}\n name={name}\n size=\"x-small\"\n purpose=\"decoration\"\n />\n </div>\n <Text slot=\"label\" className={classes.name}>\n {name}\n </Text>\n </div>\n </SelectItem>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA8CA,SAAS,cAAA,CAAe,EAAE,gBAAA,EAAkB,UAAA,EAAW,EAAwB;AAC7E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,gBAAA;AAChC,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,sBAAA,EAAuB,GAAI,QAAA;AACtD,EAAA,MAAM,eAAA,GAAkB,uBAAA,CAAwB,UAAA,EAAY,SAAS,CAAA;AAErE,EAAA,uBACE,GAAA,CAAC,eAAY,SAAA,EAAW,OAAA,CAAQ,MAAO,GAAG,SAAA,EAAY,GAAG,eAAA,EACtD,QAAA,EAAA,CAAA,MAAA,KAAU;AACT,IAA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AAO,EAAA;AAAA,YACZ,IAAA;AAAA,YACA,IAAA,EAAK,SAAA;AAAA,YACL,OAAA,EAAQ;AAAA;AAAA,SACV,EACF,CAAA;AAAA,4BACC,IAAA,EAAA,EAAK,IAAA,EAAK,SAAQ,SAAA,EAAW,OAAA,CAAQ,MACnC,QAAA,EAAA,IAAA,EACH;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"SelectItem.esm.js","sources":["../../../src/components/Select/SelectItem.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 { RiCheckLine } from '@remixicon/react';\nimport { ListBoxItem, Text } from 'react-aria-components';\nimport { Avatar } from '../Avatar';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SelectItemDefinition,\n SelectItemProfileDefinition,\n SelectItemTextDefinition,\n} from './definition';\nimport type {\n SelectItemProfileProps,\n SelectItemProps,\n SelectItemTextProps,\n} from './types';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype SelectItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SelectItemDefinition,\n SelectItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SelectItemView({ definitionResult, navigation }: SelectItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children, showSelectionIndicator } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem className={classes.root} {...restProps} {...navigationProps}>\n {values => {\n const content =\n typeof children === 'function' ? children(values) : children;\n\n if (!showSelectionIndicator) {\n return content;\n }\n\n return (\n <>\n <div className={classes.indicator}>\n <RiCheckLine aria-hidden=\"true\" />\n </div>\n <div className={classes.content}>{content}</div>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\n/**\n * A low-level Select item wrapper for custom item content.\n *\n * @public\n */\nexport function SelectItem<T extends object = object>(\n props: SelectItemProps<T>,\n) {\n const definitionResult = useDefinition(SelectItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SelectItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\n/**\n * A Select item preset with a title and optional supporting content.\n *\n * @public\n */\nexport function SelectItemText<T extends object = object>(\n props: SelectItemTextProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemTextDefinition,\n props,\n );\n const { classes, title, description, leadingIcon } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={title}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n {leadingIcon && (\n <div className={classes.leadingIcon}>{leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text slot=\"label\" className={classes.title}>\n {title}\n </Text>\n {description && (\n <Text slot=\"description\" className={classes.description}>\n {description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\n/**\n * A Select item preset for a person or other named profile.\n *\n * @public\n */\nexport function SelectItemProfile<T extends object = object>(\n props: SelectItemProfileProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemProfileDefinition,\n props,\n );\n const { classes, name, src } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={name}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n <div className={classes.avatar}>\n <Avatar\n src={src ?? ''}\n name={name}\n size=\"x-small\"\n purpose=\"decoration\"\n />\n </div>\n <Text slot=\"label\" className={classes.name}>\n {name}\n </Text>\n </div>\n </SelectItem>\n );\n}\n"],"names":[],"mappings":";;;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