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

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 (153) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/analytics/useAnalytics.esm.js +5 -5
  3. package/dist/analytics/useAnalytics.esm.js.map +1 -1
  4. package/dist/components/Accordion/definition.esm.js +3 -1
  5. package/dist/components/Accordion/definition.esm.js.map +1 -1
  6. package/dist/components/Alert/definition.esm.js +3 -1
  7. package/dist/components/Alert/definition.esm.js.map +1 -1
  8. package/dist/components/Avatar/definition.esm.js +3 -1
  9. package/dist/components/Avatar/definition.esm.js.map +1 -1
  10. package/dist/components/Badge/definition.esm.js +3 -1
  11. package/dist/components/Badge/definition.esm.js.map +1 -1
  12. package/dist/components/Box/definition.esm.js +3 -1
  13. package/dist/components/Box/definition.esm.js.map +1 -1
  14. package/dist/components/Button/definition.esm.js +3 -1
  15. package/dist/components/Button/definition.esm.js.map +1 -1
  16. package/dist/components/ButtonIcon/definition.esm.js +3 -1
  17. package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
  18. package/dist/components/ButtonLink/ButtonLink.esm.js +39 -23
  19. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  20. package/dist/components/ButtonLink/definition.esm.js +4 -1
  21. package/dist/components/ButtonLink/definition.esm.js.map +1 -1
  22. package/dist/components/Card/Card.esm.js +2 -1
  23. package/dist/components/Card/Card.esm.js.map +1 -1
  24. package/dist/components/Card/definition.esm.js +3 -1
  25. package/dist/components/Card/definition.esm.js.map +1 -1
  26. package/dist/components/Checkbox/definition.esm.js +3 -1
  27. package/dist/components/Checkbox/definition.esm.js.map +1 -1
  28. package/dist/components/CheckboxGroup/definition.esm.js +3 -1
  29. package/dist/components/CheckboxGroup/definition.esm.js.map +1 -1
  30. package/dist/components/Combobox/ComboboxItem.esm.js +37 -11
  31. package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -1
  32. package/dist/components/Combobox/definition.esm.js +4 -1
  33. package/dist/components/Combobox/definition.esm.js.map +1 -1
  34. package/dist/components/Container/definition.esm.js +3 -1
  35. package/dist/components/Container/definition.esm.js.map +1 -1
  36. package/dist/components/DatePicker/definition.esm.js +3 -1
  37. package/dist/components/DatePicker/definition.esm.js.map +1 -1
  38. package/dist/components/DateRangePicker/definition.esm.js +3 -1
  39. package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
  40. package/dist/components/Dialog/definition.esm.js +3 -1
  41. package/dist/components/Dialog/definition.esm.js.map +1 -1
  42. package/dist/components/FieldError/definition.esm.js +3 -1
  43. package/dist/components/FieldError/definition.esm.js.map +1 -1
  44. package/dist/components/FieldLabel/definition.esm.js +3 -1
  45. package/dist/components/FieldLabel/definition.esm.js.map +1 -1
  46. package/dist/components/Flex/definition.esm.js +3 -1
  47. package/dist/components/Flex/definition.esm.js.map +1 -1
  48. package/dist/components/FullPage/definition.esm.js +3 -1
  49. package/dist/components/FullPage/definition.esm.js.map +1 -1
  50. package/dist/components/Grid/definition.esm.js +3 -1
  51. package/dist/components/Grid/definition.esm.js.map +1 -1
  52. package/dist/components/Header/HeaderMetadataStatus.esm.js +3 -1
  53. package/dist/components/Header/HeaderMetadataStatus.esm.js.map +1 -1
  54. package/dist/components/Header/HeaderMetadataUsers.esm.js +3 -1
  55. package/dist/components/Header/HeaderMetadataUsers.esm.js.map +1 -1
  56. package/dist/components/Header/HeaderNav.esm.js +67 -24
  57. package/dist/components/Header/HeaderNav.esm.js.map +1 -1
  58. package/dist/components/Header/HeaderNavDefinition.esm.js +4 -1
  59. package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
  60. package/dist/components/Header/definition.esm.js +3 -1
  61. package/dist/components/Header/definition.esm.js.map +1 -1
  62. package/dist/components/Link/Link.esm.js +64 -23
  63. package/dist/components/Link/Link.esm.js.map +1 -1
  64. package/dist/components/Link/definition.esm.js +4 -1
  65. package/dist/components/Link/definition.esm.js.map +1 -1
  66. package/dist/components/List/List.esm.js +3 -2
  67. package/dist/components/List/List.esm.js.map +1 -1
  68. package/dist/components/List/definition.esm.js +3 -1
  69. package/dist/components/List/definition.esm.js.map +1 -1
  70. package/dist/components/Menu/Menu.esm.js +48 -14
  71. package/dist/components/Menu/Menu.esm.js.map +1 -1
  72. package/dist/components/Menu/definition.esm.js +5 -1
  73. package/dist/components/Menu/definition.esm.js.map +1 -1
  74. package/dist/components/NumberField/definition.esm.js +3 -1
  75. package/dist/components/NumberField/definition.esm.js.map +1 -1
  76. package/dist/components/PasswordField/definition.esm.js +3 -1
  77. package/dist/components/PasswordField/definition.esm.js.map +1 -1
  78. package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js +3 -1
  79. package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js.map +1 -1
  80. package/dist/components/PluginHeader/definition.esm.js +3 -1
  81. package/dist/components/PluginHeader/definition.esm.js.map +1 -1
  82. package/dist/components/Popover/definition.esm.js +3 -1
  83. package/dist/components/Popover/definition.esm.js.map +1 -1
  84. package/dist/components/RadioGroup/definition.esm.js +3 -1
  85. package/dist/components/RadioGroup/definition.esm.js.map +1 -1
  86. package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js +23 -5
  87. package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
  88. package/dist/components/SearchAutocomplete/definition.esm.js +4 -1
  89. package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
  90. package/dist/components/SearchField/definition.esm.js +3 -1
  91. package/dist/components/SearchField/definition.esm.js.map +1 -1
  92. package/dist/components/Select/SelectItem.esm.js +17 -3
  93. package/dist/components/Select/SelectItem.esm.js.map +1 -1
  94. package/dist/components/Select/definition.esm.js +4 -1
  95. package/dist/components/Select/definition.esm.js.map +1 -1
  96. package/dist/components/Skeleton/definition.esm.js +3 -1
  97. package/dist/components/Skeleton/definition.esm.js.map +1 -1
  98. package/dist/components/Slider/definition.esm.js +3 -1
  99. package/dist/components/Slider/definition.esm.js.map +1 -1
  100. package/dist/components/Switch/definition.esm.js +3 -1
  101. package/dist/components/Switch/definition.esm.js.map +1 -1
  102. package/dist/components/Table/components/Row.esm.js +9 -9
  103. package/dist/components/Table/components/Row.esm.js.map +1 -1
  104. package/dist/components/Table/components/TableBodySkeleton.esm.js +3 -1
  105. package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
  106. package/dist/components/Table/components/TableRoot.esm.js +3 -2
  107. package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
  108. package/dist/components/Table/definition.esm.js +3 -2
  109. package/dist/components/Table/definition.esm.js.map +1 -1
  110. package/dist/components/TablePagination/TablePagination.esm.js +3 -1
  111. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  112. package/dist/components/TablePagination/definition.esm.js +3 -1
  113. package/dist/components/TablePagination/definition.esm.js.map +1 -1
  114. package/dist/components/Tabs/Tabs.esm.js +38 -15
  115. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  116. package/dist/components/Tabs/definition.esm.js +4 -1
  117. package/dist/components/Tabs/definition.esm.js.map +1 -1
  118. package/dist/components/TagGroup/TagGroup.esm.js +12 -12
  119. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  120. package/dist/components/TagGroup/definition.esm.js +3 -2
  121. package/dist/components/TagGroup/definition.esm.js.map +1 -1
  122. package/dist/components/Text/definition.esm.js +3 -1
  123. package/dist/components/Text/definition.esm.js.map +1 -1
  124. package/dist/components/TextAreaField/definition.esm.js +3 -1
  125. package/dist/components/TextAreaField/definition.esm.js.map +1 -1
  126. package/dist/components/TextField/definition.esm.js +3 -1
  127. package/dist/components/TextField/definition.esm.js.map +1 -1
  128. package/dist/components/ToggleButton/definition.esm.js +3 -1
  129. package/dist/components/ToggleButton/definition.esm.js.map +1 -1
  130. package/dist/components/ToggleButtonGroup/definition.esm.js +3 -1
  131. package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
  132. package/dist/components/Tooltip/definition.esm.js +3 -1
  133. package/dist/components/Tooltip/definition.esm.js.map +1 -1
  134. package/dist/components/VisuallyHidden/definition.esm.js +3 -1
  135. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
  136. package/dist/hooks/useDefinition/useDefinition.esm.js +8 -13
  137. package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
  138. package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js +50 -0
  139. package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js.map +1 -0
  140. package/dist/index.d.ts +32 -8
  141. package/dist/navigation/BUIRoutingProvider.esm.js +44 -0
  142. package/dist/navigation/BUIRoutingProvider.esm.js.map +1 -0
  143. package/dist/navigation/useNavigation.esm.js +130 -0
  144. package/dist/navigation/useNavigation.esm.js.map +1 -0
  145. package/dist/navigation/useRouting.esm.js +27 -0
  146. package/dist/navigation/useRouting.esm.js.map +1 -0
  147. package/dist/provider/BUIContext.esm.js +6 -0
  148. package/dist/provider/BUIContext.esm.js.map +1 -0
  149. package/dist/provider/BUIProvider.esm.js +5 -13
  150. package/dist/provider/BUIProvider.esm.js.map +1 -1
  151. package/dist/utils/linkUtils.esm.js +6 -12
  152. package/dist/utils/linkUtils.esm.js.map +1 -1
  153. package/package.json +3 -2
@@ -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 { useDefinition } from '../../hooks/useDefinition';\nimport {\n SelectItemDefinition,\n SelectItemProfileDefinition,\n SelectItemTextDefinition,\n} from './definition';\nimport type {\n SelectItemProfileProps,\n SelectItemProps,\n SelectItemTextProps,\n} from './types';\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 { ownProps, restProps } = useDefinition(SelectItemDefinition, props);\n const { classes, children, showSelectionIndicator } = ownProps;\n\n return (\n <ListBoxItem className={classes.root} {...restProps}>\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 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":";;;;;;;;AAoCO,SAAS,WACd,KAAA,EACA;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,sBAAA,EAAuB,GAAI,QAAA;AAEtD,EAAA,2BACG,WAAA,EAAA,EAAY,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACvC,QAAA,EAAA,CAAA,MAAA,KAAU;AACT,IAAA,MAAM,UACJ,OAAO,QAAA,KAAa,UAAA,GAAa,QAAA,CAAS,MAAM,CAAA,GAAI,QAAA;AAEtD,IAAA,IAAI,CAAC,sBAAA,EAAwB;AAC3B,MAAA,OAAO,OAAA;AAAA,IACT;AAEA,IAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,OAAA,CAAQ,SAAA,EACtB,8BAAC,WAAA,EAAA,EAAY,aAAA,EAAY,QAAO,CAAA,EAClC,CAAA;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAU,QAAA,EAAA,OAAA,EAAQ;AAAA,KAAA,EAC5C,CAAA;AAAA,EAEJ,CAAA,EACF,CAAA;AAEJ;AAOO,SAAS,eACd,KAAA,EACA;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA;AAAA,IAC9B,wBAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,WAAA,EAAa,aAAY,GAAI,QAAA;AAErD,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAW,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AAI,SAAA,EAAW,OAAA,CAAQ,MAAA,EACtB,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAK,GAAA,IAAO,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=\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2BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,IAAA,EAAM,GAAA,EAAI,GAAI,QAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAA,CAAQ,IAAA;AAAA,MACnB,SAAA,EAAW,IAAA;AAAA,MACX,sBAAA,EAAsB,IAAA;AAAA,MACrB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,OAAA,EACtB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,MAAA,EACtB,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,KAAK,GAAA,IAAO,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;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Select.module.css.esm.js';
10
12
 
@@ -103,6 +105,7 @@ const SelectItemDefinition = defineComponent()({
103
105
  indicator: "bui-SelectItemIndicator",
104
106
  content: "bui-SelectItemContent"
105
107
  },
108
+ navigation: { type: "anchor" },
106
109
  propDefs: {
107
110
  children: {},
108
111
  showSelectionIndicator: {},
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/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 {\n SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,SAAS,EAAC;AAAA,IACV,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,cAAc,EAAC;AAAA,IACf,QAAQ,EAAC;AAAA,IACT,SAAS,EAAC;AAAA,IACV,YAAY,EAAC;AAAA,IACb,mBAAmB,EAAC;AAAA,IACpB,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY,EAAC;AAAA,IACb,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,OAAA,EAAS,0BAAA;AAAA,MACT,KAAA,EAAO;AAAA,KACT;AAAA,IACA,EAAA,EAAI,UAAA;AAAA,IACJ,QAAA,EAAU;AAAA,MACR,MAAM;AAAC;AACT;AAEJ;AAGO,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,aAAA,EAAe,yBAAA;AAAA,MACf,OAAA,EAAS,mBAAA;AAAA,MACT,MAAA,EAAQ,kBAAA;AAAA,MACR,WAAA,EAAa;AAAA,KACf;AAAA,IACA,QAAA,EAAU;AAAA,MACR,Q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,EAAM,2BAAA;AAAA,IACN,KAAA,EAAO,qBAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,WAAW;AAAC;AAEhB,CAAC;AAGI,MAAM,2BAAA,GACX,iBAA2C,CAAE;AAAA,EAC3C,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,uBAAA;AAAA,IACN,OAAA,EAAS,uBAAA;AAAA,IACT,MAAA,EAAQ,sBAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,KAAK,EAAC;AAAA,IACN,WAAW;AAAC;AAEhB,CAAC;AAGI,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,UAAU;AAAC;AAEf;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/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 {\n SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n navigation: { type: 'anchor' },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,SAAS,EAAC;AAAA,IACV,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,cAAc,EAAC;AAAA,IACf,QAAQ,EAAC;AAAA,IACT,SAAS,EAAC;AAAA,IACV,YAAY,EAAC;AAAA,IACb,mBAAmB,EAAC;AAAA,IACpB,OAAO,E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GI,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,UAAU;AAAC;AAEf;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Skeleton.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/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 { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACrB,MAAA,EAAQ,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACtB,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IAC/C,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/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 { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACrB,MAAA,EAAQ,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACtB,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IAC/C,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Slider.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Slider/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 { SliderOwnProps } from './types';\nimport styles from './Slider.module.css';\n\n/**\n * Component definition for Slider\n * @public\n */\nexport const SliderDefinition = defineComponent<SliderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Slider',\n header: 'bui-SliderHeader',\n track: 'bui-SliderTrack',\n trackFill: 'bui-SliderTrackFill',\n thumb: 'bui-SliderThumb',\n output: 'bui-SliderOutput',\n },\n propDefs: {\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,MAAA,EAAQ,kBAAA;AAAA,IACR,KAAA,EAAO,iBAAA;AAAA,IACP,SAAA,EAAW,qBAAA;AAAA,IACX,KAAA,EAAO,iBAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Slider/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 { SliderOwnProps } from './types';\nimport styles from './Slider.module.css';\n\n/**\n * Component definition for Slider\n * @public\n */\nexport const SliderDefinition = defineComponent<SliderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Slider',\n header: 'bui-SliderHeader',\n track: 'bui-SliderTrack',\n trackFill: 'bui-SliderTrackFill',\n thumb: 'bui-SliderThumb',\n output: 'bui-SliderOutput',\n },\n propDefs: {\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,MAAA,EAAQ,kBAAA;AAAA,IACR,KAAA,EAAO,iBAAA;AAAA,IACP,SAAA,EAAW,qBAAA;AAAA,IACX,KAAA,EAAO,iBAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Switch.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Switch/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 { SwitchOwnProps } from './types';\nimport styles from './Switch.module.css';\n\n/**\n * Component definition for Switch\n * @public\n */\nexport const SwitchDefinition = defineComponent<SwitchOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n bg: 'consumer',\n propDefs: {\n label: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Switch/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 { SwitchOwnProps } from './types';\nimport styles from './Switch.module.css';\n\n/**\n * Component definition for Switch\n * @public\n */\nexport const SwitchDefinition = defineComponent<SwitchOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n bg: 'consumer',\n propDefs: {\n label: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -14,11 +14,12 @@ function Row(props) {
14
14
  RowDefinition,
15
15
  props
16
16
  );
17
- const { classes, columns, children, href } = ownProps;
18
- const isExternal = isExternalLink(href);
19
- const hasInternalHref = !!href && !isExternal;
20
- const hasExternalHref = !!href && isExternal;
21
- const hasInteraction = !!restProps.onAction || !!href;
17
+ const { classes, columns, children } = ownProps;
18
+ const rawHref = restProps.href;
19
+ const isExternal = isExternalLink(rawHref);
20
+ const hasInternalHref = !!rawHref && !isExternal;
21
+ const hasExternalHref = !!rawHref && isExternal;
22
+ const hasInteraction = !!restProps.onAction || !!rawHref;
22
23
  const effectiveTarget = hasExternalHref ? "_blank" : restProps.target;
23
24
  const effectiveRel = effectiveTarget === "_blank" ? [
24
25
  .../* @__PURE__ */ new Set([
@@ -29,9 +30,9 @@ function Row(props) {
29
30
  ].join(" ") : restProps.rel;
30
31
  const handlePress = hasInteraction ? () => {
31
32
  restProps.onAction?.();
32
- if (href) {
33
- analytics.captureEvent("click", href, {
34
- attributes: { to: String(href) }
33
+ if (rawHref) {
34
+ analytics.captureEvent("click", rawHref, {
35
+ attributes: { to: String(rawHref) }
35
36
  });
36
37
  }
37
38
  } : void 0;
@@ -43,7 +44,6 @@ function Row(props) {
43
44
  return /* @__PURE__ */ jsx(
44
45
  Row$1,
45
46
  {
46
- href,
47
47
  ...restProps,
48
48
  ...dataAttributes,
49
49
  target: effectiveTarget,
@@ -1 +1 @@
1
- {"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children, href } = ownProps;\n const isExternal = isExternalLink(href);\n const hasInternalHref = !!href && !isExternal;\n const hasExternalHref = !!href && isExternal;\n const hasInteraction = !!restProps.onAction || !!href;\n\n // Derive the effective target, defaulting to _blank for external links.\n const effectiveTarget = hasExternalHref ? '_blank' : restProps.target;\n // Always include noopener noreferrer when target=_blank, merging any\n // consumer-provided rel tokens to avoid reverse-tabnabbing risk.\n const effectiveRel =\n effectiveTarget === '_blank'\n ? [\n ...new Set([\n 'noopener',\n 'noreferrer',\n ...(restProps.rel?.split(/\\s+/).filter(Boolean) ?? []),\n ]),\n ].join(' ')\n : restProps.rel;\n\n const handlePress = hasInteraction\n ? () => {\n restProps.onAction?.();\n if (href) {\n analytics.captureEvent('click', href, {\n attributes: { to: String(href) },\n });\n }\n }\n : undefined;\n\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>\n <Flex justify=\"center\" align=\"center\">\n <Checkbox slot=\"selection\" aria-label=\"Select row\" />\n </Flex>\n </ReactAriaCell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n return (\n <ReactAriaRow\n href={href}\n {...restProps}\n {...dataAttributes}\n target={effectiveTarget}\n rel={effectiveRel}\n className={clsx(classes.root, restProps.className)}\n data-react-aria-pressable={hasInternalHref ? 'true' : undefined}\n onAction={handlePress}\n >\n {content}\n </ReactAriaRow>\n );\n}\n"],"names":["ReactAriaCell","ReactAriaRow"],"mappings":";;;;;;;;;;;AAmCO,SAAS,IAAsB,KAAA,EAAoB;AACxD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,aAAA;AAAA,IACzD,aAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,EAAS,QAAA,EAAU,MAAK,GAAI,QAAA;AAC7C,EAAA,MAAM,UAAA,GAAa,eAAe,IAAI,CAAA;AACtC,EAAA,MAAM,eAAA,GAAkB,CAAC,CAAC,IAAA,IAAQ,CAAC,UAAA;AACnC,EAAA,MAAM,eAAA,GAAkB,CAAC,CAAC,IAAA,IAAQ,UAAA;AAClC,EAAA,MAAM,iBAAiB,CAAC,CAAC,SAAA,CAAU,QAAA,IAAY,CAAC,CAAC,IAAA;AAGjD,EAAA,MAAM,eAAA,GAAkB,eAAA,GAAkB,QAAA,GAAW,SAAA,CAAU,MAAA;AAG/D,EAAA,MAAM,YAAA,GACJ,oBAAoB,QAAA,GAChB;AAAA,IACE,uBAAO,GAAA,CAAI;AAAA,MACT,UAAA;AAAA,MACA,YAAA;AAAA,MACA,GAAI,UAAU,GAAA,EAAK,KAAA,CAAM,KAAK,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA,IAAK;AAAC,KACrD;AAAA,GACH,CAAE,IAAA,CAAK,GAAG,CAAA,GACV,SAAA,CAAU,GAAA;AAEhB,EAAA,MAAM,WAAA,GAAc,iBAChB,MAAM;AACJ,IAAA,SAAA,CAAU,QAAA,IAAW;AACrB,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,SAAA,CAAU,YAAA,CAAa,SAAS,IAAA,EAAM;AAAA,QACpC,UAAA,EAAY,EAAE,EAAA,EAAI,MAAA,CAAO,IAAI,CAAA;AAAE,OAChC,CAAA;AAAA,IACH;AAAA,EACF,CAAA,GACA,MAAA;AAEJ,EAAA,IAAI,EAAE,iBAAA,EAAmB,aAAA,EAAc,GAAI,eAAA,EAAgB;AAE3D,EAAA,MAAM,0BACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,iBAAA,KAAsB,QAAA,IAAY,aAAA,KAAkB,UAAA,oBACnD,GAAA,CAACA,IAAA,EAAA,EAAc,WAAW,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM,OAAA,CAAQ,aAAa,CAAA,EAChE,8BAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,QAAA,EAAS,KAAA,EAAM,QAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,WAAA,EAAY,YAAA,EAAW,YAAA,EAAa,CAAA,EACrD,CAAA,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA,GAAA,EACxC,CAAA;AAGF,EAAA,uBACE,GAAA;AAAA,IAACC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACC,GAAG,SAAA;AAAA,MACH,GAAG,cAAA;AAAA,MACJ,MAAA,EAAQ,eAAA;AAAA,MACR,GAAA,EAAK,YAAA;AAAA,MACL,SAAA,EAAW,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM,UAAU,SAAS,CAAA;AAAA,MACjD,2BAAA,EAA2B,kBAAkB,MAAA,GAAS,MAAA;AAAA,MACtD,QAAA,EAAU,WAAA;AAAA,MAET,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children } = ownProps;\n const rawHref = restProps.href;\n const isExternal = isExternalLink(rawHref);\n const hasInternalHref = !!rawHref && !isExternal;\n const hasExternalHref = !!rawHref && isExternal;\n const hasInteraction = !!restProps.onAction || !!rawHref;\n\n // Derive the effective target, defaulting to _blank for external links.\n const effectiveTarget = hasExternalHref ? '_blank' : restProps.target;\n // Always include noopener noreferrer when target=_blank, merging any\n // consumer-provided rel tokens to avoid reverse-tabnabbing risk.\n const effectiveRel =\n effectiveTarget === '_blank'\n ? [\n ...new Set([\n 'noopener',\n 'noreferrer',\n ...(restProps.rel?.split(/\\s+/).filter(Boolean) ?? []),\n ]),\n ].join(' ')\n : restProps.rel;\n\n const handlePress = hasInteraction\n ? () => {\n restProps.onAction?.();\n if (rawHref) {\n analytics.captureEvent('click', rawHref, {\n attributes: { to: String(rawHref) },\n });\n }\n }\n : undefined;\n\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>\n <Flex justify=\"center\" align=\"center\">\n <Checkbox slot=\"selection\" aria-label=\"Select row\" />\n </Flex>\n </ReactAriaCell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n return (\n <ReactAriaRow\n {...restProps}\n {...dataAttributes}\n target={effectiveTarget}\n rel={effectiveRel}\n className={clsx(classes.root, restProps.className)}\n data-react-aria-pressable={hasInternalHref ? 'true' : undefined}\n onAction={handlePress}\n >\n {content}\n </ReactAriaRow>\n );\n}\n"],"names":["ReactAriaCell","ReactAriaRow"],"mappings":";;;;;;;;;;;AAmCO,SAAS,IAAsB,KAAA,EAAoB;AACxD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,aAAA;AAAA,IACzD,aAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AACvC,EAAA,MAAM,UAAU,SAAA,CAAU,IAAA;AAC1B,EAAA,MAAM,UAAA,GAAa,eAAe,OAAO,CAAA;AACzC,EAAA,MAAM,eAAA,GAAkB,CAAC,CAAC,OAAA,IAAW,CAAC,UAAA;AACtC,EAAA,MAAM,eAAA,GAAkB,CAAC,CAAC,OAAA,IAAW,UAAA;AACrC,EAAA,MAAM,iBAAiB,CAAC,CAAC,SAAA,CAAU,QAAA,IAAY,CAAC,CAAC,OAAA;AAGjD,EAAA,MAAM,eAAA,GAAkB,eAAA,GAAkB,QAAA,GAAW,SAAA,CAAU,MAAA;AAG/D,EAAA,MAAM,YAAA,GACJ,oBAAoB,QAAA,GAChB;AAAA,IACE,uBAAO,GAAA,CAAI;AAAA,MACT,UAAA;AAAA,MACA,YAAA;AAAA,MACA,GAAI,UAAU,GAAA,EAAK,KAAA,CAAM,KAAK,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA,IAAK;AAAC,KACrD;AAAA,GACH,CAAE,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AAAA,MACtD,QAAA,EAAU,WAAA;AAAA,MAET,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
@@ -7,8 +7,10 @@ import 'clsx';
7
7
  import '../../../hooks/useBreakpoint.esm.js';
8
8
  import '../../../hooks/useBg.esm.js';
9
9
  import '../../../hooks/useDefinition/helpers.esm.js';
10
- import '../../../analytics/useAnalytics.esm.js';
10
+ import 'react';
11
+ import '../../../provider/BUIContext.esm.js';
11
12
  import 'react-router-dom';
13
+ import '@backstage/version-bridge';
12
14
  import '../../Skeleton/Skeleton.module.css.esm.js';
13
15
 
14
16
  const SKELETON_ROW_COUNT = 5;
@@ -1 +1 @@
1
- {"version":3,"file":"TableBodySkeleton.esm.js","sources":["../../../../src/components/Table/components/TableBodySkeleton.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 { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Cell } from './Cell';\nimport { Skeleton } from '../../Skeleton';\n\nconst SKELETON_ROW_COUNT = 5;\nconst SKELETON_WIDTHS = ['75%', '50%', '60%', '45%', '70%'];\n\nconst skeletonItems = Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => ({\n id: `skeleton-${i}`,\n index: i,\n}));\n\n/**\n * A table body that renders animated skeleton rows as a loading placeholder.\n *\n * @remarks\n * Accepts any column array whose items have an `id` property, making it\n * compatible with both `ColumnConfig` and custom column types.\n *\n * @public\n */\nexport function TableBodySkeleton<T extends { id: string }>({\n columns,\n}: {\n columns: readonly T[];\n}) {\n return (\n <TableBody items={skeletonItems} dependencies={[columns]}>\n {item => {\n const rowIndex = item.index;\n return (\n <Row id={item.id} columns={columns}>\n {column => (\n <Cell key={column.id} aria-hidden=\"true\">\n <Skeleton\n width={\n SKELETON_WIDTHS[\n (rowIndex + columns.indexOf(column)) %\n SKELETON_WIDTHS.length\n ]\n }\n />\n </Cell>\n )}\n </Row>\n );\n }}\n </TableBody>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqBA,MAAM,kBAAA,GAAqB,CAAA;AAC3B,MAAM,kBAAkB,CAAC,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,OAAO,KAAK,CAAA;AAE1D,MAAM,aAAA,GAAgB,MAAM,IAAA,CAAK,EAAE,QAAQ,kBAAA,EAAmB,EAAG,CAAC,CAAA,EAAG,CAAA,MAAO;AAAA,EAC1E,EAAA,EAAI,YAAY,CAAC,CAAA,CAAA;AAAA,EACjB,KAAA,EAAO;AACT,CAAA,CAAE,CAAA;AAWK,SAAS,iBAAA,CAA4C;AAAA,EAC1D;AACF,CAAA,EAEG;AACD,EAAA,uBACE,GAAA,CAAC,aAAU,KAAA,EAAO,aAAA,EAAe,cAAc,CAAC,OAAO,GACpD,QAAA,EAAA,CAAA,IAAA,KAAQ;AACP,IAAA,MAAM,WAAW,IAAA,CAAK,KAAA;AACtB,IAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,IAAA,CAAK,EAAA,EAAI,SACf,QAAA,EAAA,CAAA,MAAA,qBACC,GAAA,CAAC,IAAA,EAAA,EAAqB,aAAA,EAAY,MAAA,EAChC,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,KAAA,EACE,iBACG,QAAA,GAAW,OAAA,CAAQ,QAAQ,MAAM,CAAA,IAChC,gBAAgB,MACpB;AAAA;AAAA,KAEJ,EAAA,EARS,MAAA,CAAO,EASlB,CAAA,EAEJ,CAAA;AAAA,EAEJ,CAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TableBodySkeleton.esm.js","sources":["../../../../src/components/Table/components/TableBodySkeleton.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 { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Cell } from './Cell';\nimport { Skeleton } from '../../Skeleton';\n\nconst SKELETON_ROW_COUNT = 5;\nconst SKELETON_WIDTHS = ['75%', '50%', '60%', '45%', '70%'];\n\nconst skeletonItems = Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => ({\n id: `skeleton-${i}`,\n index: i,\n}));\n\n/**\n * A table body that renders animated skeleton rows as a loading placeholder.\n *\n * @remarks\n * Accepts any column array whose items have an `id` property, making it\n * compatible with both `ColumnConfig` and custom column types.\n *\n * @public\n */\nexport function TableBodySkeleton<T extends { id: string }>({\n columns,\n}: {\n columns: readonly T[];\n}) {\n return (\n <TableBody items={skeletonItems} dependencies={[columns]}>\n {item => {\n const rowIndex = item.index;\n return (\n <Row id={item.id} columns={columns}>\n {column => (\n <Cell key={column.id} aria-hidden=\"true\">\n <Skeleton\n width={\n SKELETON_WIDTHS[\n (rowIndex + columns.indexOf(column)) %\n SKELETON_WIDTHS.length\n ]\n }\n />\n </Cell>\n )}\n </Row>\n );\n }}\n </TableBody>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,kBAAA,GAAqB,CAAA;AAC3B,MAAM,kBAAkB,CAAC,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,OAAO,KAAK,CAAA;AAE1D,MAAM,aAAA,GAAgB,MAAM,IAAA,CAAK,EAAE,QAAQ,kBAAA,EAAmB,EAAG,CAAC,CAAA,EAAG,CAAA,MAAO;AAAA,EAC1E,EAAA,EAAI,YAAY,CAAC,CAAA,CAAA;AAAA,EACjB,KAAA,EAAO;AACT,CAAA,CAAE,CAAA;AAWK,SAAS,iBAAA,CAA4C;AAAA,EAC1D;AACF,CAAA,EAEG;AACD,EAAA,uBACE,GAAA,CAAC,aAAU,KAAA,EAAO,aAAA,EAAe,cAAc,CAAC,OAAO,GACpD,QAAA,EAAA,CAAA,IAAA,KAAQ;AACP,IAAA,MAAM,WAAW,IAAA,CAAK,KAAA;AACtB,IAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,IAAA,CAAK,EAAA,EAAI,SACf,QAAA,EAAA,CAAA,MAAA,qBACC,GAAA,CAAC,IAAA,EAAA,EAAqB,aAAA,EAAY,MAAA,EAChC,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,KAAA,EACE,iBACG,QAAA,GAAW,OAAA,CAAQ,QAAQ,MAAM,CAAA,IAChC,gBAAgB,MACpB;AAAA;AAAA,KAEJ,EAAA,EARS,MAAA,CAAO,EASlB,CAAA,EAEJ,CAAA;AAAA,EAEJ,CAAA,EACF,CAAA;AAEJ;;;;"}
@@ -2,6 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { useDefinition } from '../../../hooks/useDefinition/useDefinition.esm.js';
3
3
  import { TableDefinition } from '../definition.esm.js';
4
4
  import { Table } from 'react-aria-components';
5
+ import { BUIRoutingProvider } from '../../../navigation/BUIRoutingProvider.esm.js';
5
6
 
6
7
  const TableRoot = (props) => {
7
8
  const { ownProps, restProps, dataAttributes } = useDefinition(
@@ -13,7 +14,7 @@ const TableRoot = (props) => {
13
14
  isPending: props.isPending || props.loading ? true : props.isPending ?? props.loading
14
15
  }
15
16
  );
16
- return /* @__PURE__ */ jsx(
17
+ return /* @__PURE__ */ jsx(BUIRoutingProvider, { children: /* @__PURE__ */ jsx(
17
18
  Table,
18
19
  {
19
20
  className: ownProps.classes.root,
@@ -22,7 +23,7 @@ const TableRoot = (props) => {
22
23
  ...dataAttributes,
23
24
  ...restProps
24
25
  }
25
- );
26
+ ) });
26
27
  };
27
28
 
28
29
  export { TableRoot };
@@ -1 +1 @@
1
- {"version":3,"file":"TableRoot.esm.js","sources":["../../../../src/components/Table/components/TableRoot.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 { useDefinition } from '../../../hooks/useDefinition';\nimport { TableDefinition } from '../definition';\nimport { Table as ReactAriaTable } from 'react-aria-components';\nimport { TableRootProps } from '../types';\n\n/**\n * The low-level table root element for building custom table layouts from atomic components.\n * For most use cases, prefer the `Table` convenience wrapper.\n *\n * @public\n */\nexport const TableRoot = (props: TableRootProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n TableDefinition,\n // Merge deprecated `loading` into `isPending` so data attributes and\n // internal logic only need to check a single prop.\n {\n ...props,\n isPending:\n props.isPending || props.loading\n ? true\n : props.isPending ?? props.loading,\n },\n );\n\n return (\n <ReactAriaTable\n className={ownProps.classes.root}\n aria-label=\"Data table\"\n aria-busy={ownProps.stale || ownProps.isPending}\n {...dataAttributes}\n {...restProps}\n />\n );\n};\n"],"names":["ReactAriaTable"],"mappings":";;;;;AA2BO,MAAM,SAAA,GAAY,CAAC,KAAA,KAA0B;AAClD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,IAC9C,eAAA;AAAA;AAAA;AAAA,IAGA;AAAA,MACE,GAAG,KAAA;AAAA,MACH,SAAA,EACE,MAAM,SAAA,IAAa,KAAA,CAAM,UACrB,IAAA,GACA,KAAA,CAAM,aAAa,KAAA,CAAM;AAAA;AACjC,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAACA,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,SAAS,OAAA,CAAQ,IAAA;AAAA,MAC5B,YAAA,EAAW,YAAA;AAAA,MACX,WAAA,EAAW,QAAA,CAAS,KAAA,IAAS,QAAA,CAAS,SAAA;AAAA,MACrC,GAAG,cAAA;AAAA,MACH,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"TableRoot.esm.js","sources":["../../../../src/components/Table/components/TableRoot.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 { useDefinition } from '../../../hooks/useDefinition';\nimport { TableDefinition } from '../definition';\nimport { Table as ReactAriaTable } from 'react-aria-components';\nimport { TableRootProps } from '../types';\nimport { BUIRoutingProvider } from '../../../navigation/BUIRoutingProvider';\n\n/**\n * The low-level table root element for building custom table layouts from atomic components.\n * For most use cases, prefer the `Table` convenience wrapper.\n *\n * @public\n */\nexport const TableRoot = (props: TableRootProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n TableDefinition,\n // Merge deprecated `loading` into `isPending` so data attributes and\n // internal logic only need to check a single prop.\n {\n ...props,\n isPending:\n props.isPending || props.loading\n ? true\n : props.isPending ?? props.loading,\n },\n );\n\n return (\n <BUIRoutingProvider>\n <ReactAriaTable\n className={ownProps.classes.root}\n aria-label=\"Data table\"\n aria-busy={ownProps.stale || ownProps.isPending}\n {...dataAttributes}\n {...restProps}\n />\n </BUIRoutingProvider>\n );\n};\n"],"names":["ReactAriaTable"],"mappings":";;;;;;AA4BO,MAAM,SAAA,GAAY,CAAC,KAAA,KAA0B;AAClD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,IAC9C,eAAA;AAAA;AAAA;AAAA,IAGA;AAAA,MACE,GAAG,KAAA;AAAA,MACH,SAAA,EACE,MAAM,SAAA,IAAa,KAAA,CAAM,UACrB,IAAA,GACA,KAAA,CAAM,aAAa,KAAA,CAAM;AAAA;AACjC,GACF;AAEA,EAAA,2BACG,kBAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,IAACA,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,SAAS,OAAA,CAAQ,IAAA;AAAA,MAC5B,YAAA,EAAW,YAAA;AAAA,MACX,WAAA,EAAW,QAAA,CAAS,KAAA,IAAS,QAAA,CAAS,SAAA;AAAA,MACrC,GAAG,cAAA;AAAA,MACH,GAAG;AAAA;AAAA,GACN,EACF,CAAA;AAEJ;;;;"}
@@ -3,8 +3,10 @@ import 'clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './Table.module.css.esm.js';
10
12
 
@@ -60,7 +62,6 @@ const RowDefinition = defineComponent()({
60
62
  propDefs: {
61
63
  columns: {},
62
64
  children: {},
63
- href: {},
64
65
  noTrack: {}
65
66
  }
66
67
  });
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Table/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 {\n TableRootOwnProps,\n TableHeaderOwnProps,\n TableBodyOwnProps,\n RowOwnProps,\n ColumnOwnProps,\n CellOwnProps,\n CellTextOwnProps,\n CellProfileOwnProps,\n} from './types';\nimport styles from './Table.module.css';\n\n/** @internal */\nexport const TableWrapperDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-TableWrapper',\n resizableContainer: 'bui-TableResizableContainer',\n scrollContainer: 'bui-TableScrollContainer',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for Table\n * @public\n */\nexport const TableDefinition = defineComponent<TableRootOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Table',\n },\n propDefs: {\n stale: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n },\n});\n\n/**\n * Component definition for TableHeader\n * @internal\n */\nexport const TableHeaderDefinition = defineComponent<TableHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHeader',\n headSelection: 'bui-TableHeadSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n },\n});\n\n/**\n * Component definition for TableBody\n * @internal\n */\nexport const TableBodyDefinition = defineComponent<TableBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableBody',\n },\n propDefs: {},\n});\n\n/**\n * Component definition for Row\n * @internal\n */\nexport const RowDefinition = defineComponent<RowOwnProps>()({\n styles,\n analytics: true,\n bg: 'consumer',\n classNames: {\n root: 'bui-TableRow',\n cell: 'bui-TableCell',\n cellSelection: 'bui-TableCellSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n href: {},\n noTrack: {},\n },\n});\n\n/**\n * Component definition for Column\n * @internal\n */\nexport const ColumnDefinition = defineComponent<ColumnOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHead',\n headContent: 'bui-TableHeadContent',\n headLabel: 'bui-TableHeadLabel',\n headSortButton: 'bui-TableHeadSortButton',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for Cell\n * @internal\n */\nexport const CellDefinition = defineComponent<CellOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for CellText\n * @internal\n */\nexport const CellTextDefinition = defineComponent<CellTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n },\n propDefs: {\n title: {},\n description: {},\n color: { default: 'primary' },\n leadingIcon: {},\n href: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CellProfile\n * @internal\n */\nexport const CellProfileDefinition = defineComponent<CellProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n },\n propDefs: {\n src: {},\n name: {},\n href: {},\n description: {},\n color: { default: 'primary' },\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AA8BO,MAAM,sBAAA,GAAyB,iBAEnC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,eAAA,GAA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AAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,WAAA,EAAa,sBAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,KAAA,EAAO,EAAE,OAAA,EAAS,SAAA,EAAU;AAAA,IAC5B,aAAa,EAAC;AAAA,IACd,MAAM,EAAC;AAAA,IACP,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAK,EAAC;AAAA,IACN,MAAM,EAAC;AAAA,IACP,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,KAAA,EAAO,EAAE,OAAA,EAAS,SAAA,EAAU;AAAA,IAC5B,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Table/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 {\n TableRootOwnProps,\n TableHeaderOwnProps,\n TableBodyOwnProps,\n RowOwnProps,\n ColumnOwnProps,\n CellOwnProps,\n CellTextOwnProps,\n CellProfileOwnProps,\n} from './types';\nimport styles from './Table.module.css';\n\n/** @internal */\nexport const TableWrapperDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-TableWrapper',\n resizableContainer: 'bui-TableResizableContainer',\n scrollContainer: 'bui-TableScrollContainer',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for Table\n * @public\n */\nexport const TableDefinition = defineComponent<TableRootOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Table',\n },\n propDefs: {\n stale: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n },\n});\n\n/**\n * Component definition for TableHeader\n * @internal\n */\nexport const TableHeaderDefinition = defineComponent<TableHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHeader',\n headSelection: 'bui-TableHeadSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n },\n});\n\n/**\n * Component definition for TableBody\n * @internal\n */\nexport const TableBodyDefinition = defineComponent<TableBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableBody',\n },\n propDefs: {},\n});\n\n/**\n * Component definition for Row\n * @internal\n */\nexport const RowDefinition = defineComponent<RowOwnProps>()({\n styles,\n analytics: true,\n bg: 'consumer',\n classNames: {\n root: 'bui-TableRow',\n cell: 'bui-TableCell',\n cellSelection: 'bui-TableCellSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n noTrack: {},\n },\n});\n\n/**\n * Component definition for Column\n * @internal\n */\nexport const ColumnDefinition = defineComponent<ColumnOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHead',\n headContent: 'bui-TableHeadContent',\n headLabel: 'bui-TableHeadLabel',\n headSortButton: 'bui-TableHeadSortButton',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for Cell\n * @internal\n */\nexport const CellDefinition = defineComponent<CellOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for CellText\n * @internal\n */\nexport const CellTextDefinition = defineComponent<CellTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n },\n propDefs: {\n title: {},\n description: {},\n color: { default: 'primary' },\n leadingIcon: {},\n href: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CellProfile\n * @internal\n */\nexport const CellProfileDefinition = defineComponent<CellProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n },\n propDefs: {\n src: {},\n name: {},\n href: {},\n description: {},\n color: { default: 'primary' },\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AA8BO,MAAM,sBAAA,GAAyB,iBAEnC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,eAAA,EAAiB;AAAA,GACnB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,eAAA,GAAkB,iBAAmC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EA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AAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,WAAA,EAAa,sBAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,KAAA,EAAO,EAAE,OAAA,EAAS,SAAA,EAAU;AAAA,IAC5B,aAAa,EAAC;AAAA,IACd,MAAM,EAAC;AAAA,IACP,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,KAAK,EAAC;AAAA,IACN,MAAM,EAAC;AAAA,IACP,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,KAAA,EAAO,EAAE,OAAA,EAAS,SAAA,EAAU;AAAA,IAC5B,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -11,8 +11,10 @@ import 'react-aria-components';
11
11
  import '../Avatar/Avatar.esm.js';
12
12
  import '../Avatar/Avatar.module.css.esm.js';
13
13
  import '../Select/Select.module.css.esm.js';
14
- import { TablePaginationDefinition } from './definition.esm.js';
15
14
  import { useMemo } from 'react';
15
+ import 'react-router-dom';
16
+ import '@backstage/version-bridge';
17
+ import { TablePaginationDefinition } from './definition.esm.js';
16
18
 
17
19
  function getOptionValue(option) {
18
20
  return typeof option === "number" ? option : option.value;
@@ -1 +1 @@
1
- {"version":3,"file":"TablePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 { useId } from 'react-aria';\nimport { Text } from '../Text';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Select } from '../Select';\nimport type { TablePaginationProps, PageSizeOption } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TablePaginationDefinition } from './definition';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\nimport { useMemo } from 'react';\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\nfunction isNumberArray(\n options: number[] | PageSizeOption[],\n): options is number[] {\n return options.length > 0 && typeof options[0] === 'number';\n}\n\nfunction normalizePageSizeOptions(\n options: number[] | PageSizeOption[],\n): PageSizeOption[] {\n if (isNumberArray(options)) {\n return options.map(value => ({\n label: `Show ${value} results`,\n value,\n }));\n }\n return options;\n}\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { ownProps } = useDefinition(TablePaginationDefinition, props);\n const {\n classes,\n pageSize,\n pageSizeOptions,\n offset,\n totalCount,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n } = ownProps;\n\n const labelId = useId();\n const normalizedOptions = useMemo(\n () => normalizePageSizeOptions(pageSizeOptions),\n [pageSizeOptions],\n );\n\n const effectivePageSize = useMemo(() => {\n const isValid = pageSizeOptions.some(\n opt => getOptionValue(opt) === pageSize,\n );\n if (isValid) {\n return pageSize;\n }\n const firstValue = getOptionValue(pageSizeOptions[0]);\n console.warn(\n `TablePagination: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\n }, [pageSize, pageSizeOptions]);\n\n const hasItems = totalCount !== undefined && totalCount !== 0;\n\n const showLabel = hasItems && showPaginationLabel !== false;\n\n let label = `${totalCount} items`;\n if (getLabel) {\n label = getLabel({ pageSize: effectivePageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + effectivePageSize, totalCount ?? 0);\n label = `${fromCount} - ${toCount} of ${totalCount}`;\n }\n\n return (\n <div className={classes.root}>\n <div className={classes.left}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n aria-label=\"Select table page size\"\n options={normalizedOptions.map(opt => ({\n label: opt.label,\n value: String(opt.value),\n }))}\n defaultValue={effectivePageSize.toString()}\n onChange={value => {\n const newPageSize = Number(value);\n onPageSizeChange?.(newPageSize);\n }}\n className={classes.select}\n />\n )}\n </div>\n <div className={classes.right}>\n {showLabel && (\n <Text as=\"p\" variant=\"body-medium\" id={labelId}>\n {label}\n </Text>\n )}\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onPreviousPage}\n isDisabled={!hasPreviousPage}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onNextPage}\n isDisabled={!hasNextPage}\n icon={<RiArrowRightSLine />}\n aria-label=\"Next table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BA,SAAS,eAAe,MAAA,EAAyC;AAC/D,EAAA,OAAO,OAAO,MAAA,KAAW,QAAA,GAAW,MAAA,GAAS,MAAA,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ePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 { useId } from 'react-aria';\nimport { Text } from '../Text';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Select } from '../Select';\nimport type { TablePaginationProps, PageSizeOption } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TablePaginationDefinition } from './definition';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\nimport { useMemo } from 'react';\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\nfunction isNumberArray(\n options: number[] | PageSizeOption[],\n): options is number[] {\n return options.length > 0 && typeof options[0] === 'number';\n}\n\nfunction normalizePageSizeOptions(\n options: number[] | PageSizeOption[],\n): PageSizeOption[] {\n if (isNumberArray(options)) {\n return options.map(value => ({\n label: `Show ${value} results`,\n value,\n }));\n }\n return options;\n}\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { ownProps } = useDefinition(TablePaginationDefinition, props);\n const {\n classes,\n pageSize,\n pageSizeOptions,\n offset,\n totalCount,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n } = ownProps;\n\n const labelId = useId();\n const normalizedOptions = useMemo(\n () => normalizePageSizeOptions(pageSizeOptions),\n [pageSizeOptions],\n );\n\n const effectivePageSize = useMemo(() => {\n const isValid = pageSizeOptions.some(\n opt => getOptionValue(opt) === pageSize,\n );\n if (isValid) {\n return pageSize;\n }\n const firstValue = getOptionValue(pageSizeOptions[0]);\n console.warn(\n `TablePagination: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\n }, [pageSize, pageSizeOptions]);\n\n const hasItems = totalCount !== undefined && totalCount !== 0;\n\n const showLabel = hasItems && showPaginationLabel !== false;\n\n let label = `${totalCount} items`;\n if (getLabel) {\n label = getLabel({ pageSize: effectivePageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + effectivePageSize, totalCount ?? 0);\n label = `${fromCount} - ${toCount} of ${totalCount}`;\n }\n\n return (\n <div className={classes.root}>\n <div className={classes.left}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n aria-label=\"Select table page size\"\n options={normalizedOptions.map(opt => ({\n label: opt.label,\n value: String(opt.value),\n }))}\n defaultValue={effectivePageSize.toString()}\n onChange={value => {\n const newPageSize = Number(value);\n onPageSizeChange?.(newPageSize);\n }}\n className={classes.select}\n />\n )}\n </div>\n <div className={classes.right}>\n {showLabel && (\n <Text as=\"p\" variant=\"body-medium\" id={labelId}>\n {label}\n </Text>\n )}\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onPreviousPage}\n isDisabled={!hasPreviousPage}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onNextPage}\n isDisabled={!hasNextPage}\n icon={<RiArrowRightSLine />}\n aria-label=\"Next table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,SAAS,eAAe,MAAA,EAAyC;AAC/D,EAAA,OAAO,OAAO,MAAA,KAAW,QAAA,GAAW,MAAA,GAAS,MAAA,CAA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clsx';
3
3
  import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
- import '../../analytics/useAnalytics.esm.js';
6
+ import 'react';
7
+ import '../../provider/BUIContext.esm.js';
7
8
  import 'react-router-dom';
9
+ import '@backstage/version-bridge';
8
10
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
9
11
  import styles from './TablePagination.module.css.esm.js';
10
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TablePagination/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 { TablePaginationOwnProps, PageSizeOption } from './types';\nimport styles from './TablePagination.module.css';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS: PageSizeOption[] = [\n { label: 'Show 5 results', value: 5 },\n { label: 'Show 10 results', value: 10 },\n { label: 'Show 20 results', value: 20 },\n { label: 'Show 30 results', value: 30 },\n { label: 'Show 40 results', value: 40 },\n { label: 'Show 50 results', value: 50 },\n];\n\n/**\n * Component definition for TablePagination\n * @public\n */\nexport const TablePaginationDefinition =\n defineComponent<TablePaginationOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TablePagination',\n left: 'bui-TablePaginationLeft',\n right: 'bui-TablePaginationRight',\n select: 'bui-TablePaginationSelect',\n },\n propDefs: {\n pageSize: {},\n pageSizeOptions: { default: DEFAULT_PAGE_SIZE_OPTIONS },\n offset: {},\n totalCount: {},\n hasNextPage: {},\n hasPreviousPage: {},\n onNextPage: {},\n onPreviousPage: {},\n onPageSizeChange: {},\n showPageSizeOptions: { default: true },\n getLabel: {},\n showPaginationLabel: { default: true },\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;AAoBA,MAAM,yBAAA,GAA8C;AAAA,EAClD,EAAE,KAAA,EAAO,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAE;AAAA,EACpC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA;AACrC,CAAA;AAMO,MAAM,yBAAA,GACX,iBAAyC,CAAE;AAAA,EACzC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,yBAAA;AAAA,IACN,KAAA,EAAO,0BAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,eAAA,EAAiB,EAAE,OAAA,EAAS,yBAAA,EAA0B;AAAA,IACtD,QAAQ,EAAC;AAAA,IACT,YAAY,EAAC;AAAA,IACb,aAAa,EAAC;AAAA,IACd,iBAAiB,EAAC;AAAA,IAClB,YAAY,EAAC;AAAA,IACb,gBAAgB,EAAC;AAAA,IACjB,kBAAkB,EAAC;AAAA,IACnB,mBAAA,EAAqB,EAAE,OAAA,EAAS,IAAA,EAAK;AAAA,IACrC,UAAU,EAAC;AAAA,IACX,mBAAA,EAAqB,EAAE,OAAA,EAAS,IAAA;AAAK;AAEzC,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TablePagination/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 { TablePaginationOwnProps, PageSizeOption } from './types';\nimport styles from './TablePagination.module.css';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS: PageSizeOption[] = [\n { label: 'Show 5 results', value: 5 },\n { label: 'Show 10 results', value: 10 },\n { label: 'Show 20 results', value: 20 },\n { label: 'Show 30 results', value: 30 },\n { label: 'Show 40 results', value: 40 },\n { label: 'Show 50 results', value: 50 },\n];\n\n/**\n * Component definition for TablePagination\n * @public\n */\nexport const TablePaginationDefinition =\n defineComponent<TablePaginationOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TablePagination',\n left: 'bui-TablePaginationLeft',\n right: 'bui-TablePaginationRight',\n select: 'bui-TablePaginationSelect',\n },\n propDefs: {\n pageSize: {},\n pageSizeOptions: { default: DEFAULT_PAGE_SIZE_OPTIONS },\n offset: {},\n totalCount: {},\n hasNextPage: {},\n hasPreviousPage: {},\n onNextPage: {},\n onPreviousPage: {},\n onPageSizeChange: {},\n showPageSizeOptions: { default: true },\n getLabel: {},\n showPaginationLabel: { default: true },\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,MAAM,yBAAA,GAA8C;AAAA,EAClD,EAAE,KAAA,EAAO,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAE;AAAA,EACpC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA,EAAG;AAAA,EACtC,EAAE,KAAA,EAAO,iBAAA,EAAmB,KAAA,EAAO,EAAA;AACrC,CAAA;AAMO,MAAM,yBAAA,GACX,iBAAyC,CAAE;AAAA,EACzC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,yBAAA;AAAA,IACN,KAAA,EAAO,0BAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,eAAA,EAAiB,EAAE,OAAA,EAAS,yBAAA,EAA0B;AAAA,IACtD,QAAQ,EAAC;AAAA,IACT,YAAY,EAAC;AAAA,IACb,aAAa,EAAC;AAAA,IACd,iBAAiB,EAAC;AAAA,IAClB,YAAY,EAAC;AAAA,IACb,gBAAgB,EAAC;AAAA,IACjB,kBAAkB,EAAC;AAAA,IACnB,mBAAA,EAAqB,EAAE,OAAA,EAAS,IAAA,EAAK;AAAA,IACrC,UAAU,EAAC;AAAA,IACX,mBAAA,EAAqB,EAAE,OAAA,EAAS,IAAA;AAAK;AAEzC,CAAC;;;;"}
@@ -1,12 +1,12 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { createContext, Children, isValidElement, cloneElement, useRef, useState, useMemo, useCallback, useContext, useEffect } from 'react';
3
- import { useLocation } from 'react-router-dom';
4
3
  import { TabsIndicators } from './TabsIndicators.esm.js';
5
- import { Tab as Tab$1, TabList as TabList$1, TabPanel as TabPanel$1, Tabs as Tabs$1 } from 'react-aria-components';
4
+ import { TabList as TabList$1, TabPanel as TabPanel$1, Tabs as Tabs$1, Tab as Tab$1 } from 'react-aria-components';
6
5
  import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
7
6
  import { TabDefinition, TabListDefinition, TabPanelDefinition, TabsDefinition } from './definition.esm.js';
8
- import { isInternalLink } from '../../utils/linkUtils.esm.js';
9
7
  import { getNodeText } from '../../analytics/getNodeText.esm.js';
8
+ import { useRoutingIntegration } from '../../navigation/useRouting.esm.js';
9
+ import { getReactAriaAnchorProps } from '../../navigation/useNavigation.esm.js';
10
10
 
11
11
  const TabsContext = createContext(void 0);
12
12
  const useTabsContext = () => {
@@ -163,7 +163,9 @@ function RoutedTabEffects({
163
163
  matchStrategy = "exact"
164
164
  }) {
165
165
  const selectionCtx = useContext(TabSelectionContext);
166
- const location = useLocation();
166
+ const routing = useRoutingIntegration({ fallback: true });
167
+ const location = routing.useLocation();
168
+ const resolvedPath = routing.useResolvedPath(href);
167
169
  useEffect(() => {
168
170
  if (selectionCtx) {
169
171
  selectionCtx.registerRoutedTab(id);
@@ -171,8 +173,12 @@ function RoutedTabEffects({
171
173
  }
172
174
  return void 0;
173
175
  }, [id, selectionCtx]);
174
- const isActive = isTabActive(href, location.pathname, matchStrategy);
175
- const segmentCount = hrefPathname(href).split("/").filter(Boolean).length;
176
+ const isActive = isTabActive(
177
+ resolvedPath.pathname,
178
+ location.pathname,
179
+ matchStrategy
180
+ );
181
+ const segmentCount = resolvedPath.pathname.split("/").filter(Boolean).length;
176
182
  useEffect(() => {
177
183
  if (isActive && selectionCtx) {
178
184
  selectionCtx.registerActiveTab(id, segmentCount);
@@ -182,13 +188,15 @@ function RoutedTabEffects({
182
188
  }, [isActive, id, segmentCount, selectionCtx]);
183
189
  return null;
184
190
  }
185
- const Tab = (props) => {
186
- const { ownProps, restProps, analytics } = useDefinition(
187
- TabDefinition,
188
- props
189
- );
190
- const { classes, matchStrategy, href, id } = ownProps;
191
+ const TabView = ({ definitionResult, navigation }) => {
192
+ const { ownProps, restProps, analytics } = definitionResult;
193
+ const { classes, matchStrategy, id } = ownProps;
194
+ const { href } = ownProps;
191
195
  const { setTabRef } = useTabsContext();
196
+ const navigationProps = getReactAriaAnchorProps(navigation, {
197
+ href,
198
+ routerOptions: restProps.routerOptions
199
+ });
192
200
  const handlePress = () => {
193
201
  if (href) {
194
202
  const text = restProps["aria-label"] ?? getNodeText(restProps.children) ?? String(href);
@@ -198,7 +206,7 @@ const Tab = (props) => {
198
206
  }
199
207
  };
200
208
  return /* @__PURE__ */ jsxs(Fragment, { children: [
201
- isInternalLink(href) && /* @__PURE__ */ jsx(
209
+ navigation.canMatchRoute && href && /* @__PURE__ */ jsx(
202
210
  RoutedTabEffects,
203
211
  {
204
212
  id,
@@ -212,8 +220,8 @@ const Tab = (props) => {
212
220
  id,
213
221
  className: classes.root,
214
222
  ref: (el) => setTabRef(id, el),
215
- href,
216
223
  ...restProps,
224
+ ...navigationProps,
217
225
  onPress: (e) => {
218
226
  restProps.onPress?.(e);
219
227
  handlePress();
@@ -222,6 +230,21 @@ const Tab = (props) => {
222
230
  )
223
231
  ] });
224
232
  };
233
+ const Tab = (props) => {
234
+ const definitionResult = useDefinition(TabDefinition, props);
235
+ const Navigation = definitionResult.navigation;
236
+ return /* @__PURE__ */ jsx(
237
+ Navigation,
238
+ {
239
+ props: {
240
+ ...definitionResult.restProps,
241
+ href: definitionResult.ownProps.href
242
+ },
243
+ view: TabView,
244
+ viewProps: { definitionResult }
245
+ }
246
+ );
247
+ };
225
248
  const TabPanel = (props) => {
226
249
  const { ownProps, restProps } = useDefinition(TabPanelDefinition, props);
227
250
  return /* @__PURE__ */ jsx(TabPanel$1, { className: ownProps.classes.root, ...restProps });