@backstage/ui 0.17.1 → 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.
- package/CHANGELOG.md +22 -0
- package/dist/analytics/useAnalytics.esm.js +5 -5
- package/dist/analytics/useAnalytics.esm.js.map +1 -1
- package/dist/components/Accordion/definition.esm.js +3 -1
- package/dist/components/Accordion/definition.esm.js.map +1 -1
- package/dist/components/Alert/definition.esm.js +3 -1
- package/dist/components/Alert/definition.esm.js.map +1 -1
- package/dist/components/Avatar/definition.esm.js +3 -1
- package/dist/components/Avatar/definition.esm.js.map +1 -1
- package/dist/components/Badge/Badge.module.css.esm.js +2 -2
- package/dist/components/Badge/definition.esm.js +3 -1
- package/dist/components/Badge/definition.esm.js.map +1 -1
- package/dist/components/Box/definition.esm.js +3 -1
- package/dist/components/Box/definition.esm.js.map +1 -1
- package/dist/components/Button/Button.module.css.esm.js +2 -2
- package/dist/components/Button/definition.esm.js +3 -1
- package/dist/components/Button/definition.esm.js.map +1 -1
- package/dist/components/ButtonIcon/definition.esm.js +3 -1
- package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.esm.js +39 -23
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.module.css.esm.js +2 -2
- package/dist/components/ButtonLink/definition.esm.js +4 -1
- package/dist/components/ButtonLink/definition.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js +2 -1
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/Card.module.css.esm.js +2 -2
- package/dist/components/Card/definition.esm.js +3 -1
- package/dist/components/Card/definition.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.esm.js +2 -2
- package/dist/components/Checkbox/definition.esm.js +3 -1
- package/dist/components/Checkbox/definition.esm.js.map +1 -1
- package/dist/components/CheckboxGroup/definition.esm.js +3 -1
- package/dist/components/CheckboxGroup/definition.esm.js.map +1 -1
- package/dist/components/Combobox/Combobox.module.css.esm.js +2 -2
- package/dist/components/Combobox/ComboboxItem.esm.js +37 -11
- package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -1
- package/dist/components/Combobox/definition.esm.js +4 -1
- package/dist/components/Combobox/definition.esm.js.map +1 -1
- package/dist/components/Container/definition.esm.js +3 -1
- package/dist/components/Container/definition.esm.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.css.esm.js +2 -2
- package/dist/components/DatePicker/definition.esm.js +3 -1
- package/dist/components/DatePicker/definition.esm.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.css.esm.js +2 -2
- package/dist/components/DateRangePicker/definition.esm.js +3 -1
- package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
- package/dist/components/Dialog/definition.esm.js +3 -1
- package/dist/components/Dialog/definition.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.module.css.esm.js +2 -2
- package/dist/components/FieldError/definition.esm.js +3 -1
- package/dist/components/FieldError/definition.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js +2 -2
- package/dist/components/FieldLabel/definition.esm.js +3 -1
- package/dist/components/FieldLabel/definition.esm.js.map +1 -1
- package/dist/components/Flex/definition.esm.js +3 -1
- package/dist/components/Flex/definition.esm.js.map +1 -1
- package/dist/components/FullPage/definition.esm.js +3 -1
- package/dist/components/FullPage/definition.esm.js.map +1 -1
- package/dist/components/Grid/definition.esm.js +3 -1
- package/dist/components/Grid/definition.esm.js.map +1 -1
- package/dist/components/Header/HeaderMetadataStatus.esm.js +3 -1
- package/dist/components/Header/HeaderMetadataStatus.esm.js.map +1 -1
- package/dist/components/Header/HeaderMetadataUsers.esm.js +3 -1
- package/dist/components/Header/HeaderMetadataUsers.esm.js.map +1 -1
- package/dist/components/Header/HeaderNav.esm.js +67 -24
- package/dist/components/Header/HeaderNav.esm.js.map +1 -1
- package/dist/components/Header/HeaderNav.module.css.esm.js +2 -2
- package/dist/components/Header/HeaderNavDefinition.esm.js +4 -1
- package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
- package/dist/components/Header/definition.esm.js +3 -1
- package/dist/components/Header/definition.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js +64 -23
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/definition.esm.js +4 -1
- package/dist/components/Link/definition.esm.js.map +1 -1
- package/dist/components/List/List.esm.js +3 -2
- package/dist/components/List/List.esm.js.map +1 -1
- package/dist/components/List/List.module.css.esm.js +2 -2
- package/dist/components/List/definition.esm.js +3 -1
- package/dist/components/List/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js +48 -14
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/Menu/Menu.module.css.esm.js +2 -2
- package/dist/components/Menu/definition.esm.js +5 -1
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/NumberField/NumberField.module.css.esm.js +2 -2
- package/dist/components/NumberField/definition.esm.js +3 -1
- package/dist/components/NumberField/definition.esm.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
- package/dist/components/PasswordField/definition.esm.js +3 -1
- package/dist/components/PasswordField/definition.esm.js.map +1 -1
- package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js +3 -1
- package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js.map +1 -1
- package/dist/components/PluginHeader/definition.esm.js +3 -1
- package/dist/components/PluginHeader/definition.esm.js.map +1 -1
- package/dist/components/Popover/definition.esm.js +3 -1
- package/dist/components/Popover/definition.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +2 -2
- package/dist/components/RadioGroup/definition.esm.js +3 -1
- package/dist/components/RadioGroup/definition.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js +23 -5
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.module.css.esm.js +2 -2
- package/dist/components/SearchAutocomplete/definition.esm.js +4 -1
- package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
- package/dist/components/SearchField/definition.esm.js +3 -1
- package/dist/components/SearchField/definition.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +2 -2
- package/dist/components/Select/SelectItem.esm.js +17 -3
- package/dist/components/Select/SelectItem.esm.js.map +1 -1
- package/dist/components/Select/definition.esm.js +4 -1
- package/dist/components/Select/definition.esm.js.map +1 -1
- package/dist/components/Skeleton/definition.esm.js +3 -1
- package/dist/components/Skeleton/definition.esm.js.map +1 -1
- package/dist/components/Slider/Slider.module.css.esm.js +2 -2
- package/dist/components/Slider/definition.esm.js +3 -1
- package/dist/components/Slider/definition.esm.js.map +1 -1
- package/dist/components/Switch/Switch.module.css.esm.js +2 -2
- package/dist/components/Switch/definition.esm.js +3 -1
- package/dist/components/Switch/definition.esm.js.map +1 -1
- package/dist/components/Table/Table.module.css.esm.js +2 -2
- package/dist/components/Table/components/Row.esm.js +9 -9
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js +5 -3
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBodySkeleton.esm.js +3 -1
- package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
- package/dist/components/Table/components/TableRoot.esm.js +3 -2
- package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
- package/dist/components/Table/definition.esm.js +3 -2
- package/dist/components/Table/definition.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +3 -1
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/TablePagination/definition.esm.js +3 -1
- package/dist/components/TablePagination/definition.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.esm.js +38 -15
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.esm.js +2 -2
- package/dist/components/Tabs/definition.esm.js +4 -1
- package/dist/components/Tabs/definition.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.esm.js +12 -12
- package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.module.css.esm.js +2 -2
- package/dist/components/TagGroup/definition.esm.js +3 -2
- package/dist/components/TagGroup/definition.esm.js.map +1 -1
- package/dist/components/Text/definition.esm.js +3 -1
- package/dist/components/Text/definition.esm.js.map +1 -1
- package/dist/components/TextAreaField/definition.esm.js +3 -1
- package/dist/components/TextAreaField/definition.esm.js.map +1 -1
- package/dist/components/TextField/TextField.module.css.esm.js +2 -2
- package/dist/components/TextField/definition.esm.js +3 -1
- package/dist/components/TextField/definition.esm.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.module.css.esm.js +2 -2
- package/dist/components/ToggleButton/definition.esm.js +3 -1
- package/dist/components/ToggleButton/definition.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js +3 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.esm.js +2 -2
- package/dist/components/Tooltip/definition.esm.js +3 -1
- package/dist/components/Tooltip/definition.esm.js.map +1 -1
- package/dist/components/VisuallyHidden/definition.esm.js +3 -1
- package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
- package/dist/css/styles.css +4 -7
- package/dist/hooks/useDefinition/useDefinition.esm.js +8 -13
- package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js +50 -0
- package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js.map +1 -0
- package/dist/index.d.ts +32 -8
- package/dist/navigation/BUIRoutingProvider.esm.js +44 -0
- package/dist/navigation/BUIRoutingProvider.esm.js.map +1 -0
- package/dist/navigation/useNavigation.esm.js +130 -0
- package/dist/navigation/useNavigation.esm.js.map +1 -0
- package/dist/navigation/useRouting.esm.js +27 -0
- package/dist/navigation/useRouting.esm.js.map +1 -0
- package/dist/provider/BUIContext.esm.js +6 -0
- package/dist/provider/BUIContext.esm.js.map +1 -0
- package/dist/provider/BUIProvider.esm.js +5 -13
- package/dist/provider/BUIProvider.esm.js.map +1 -1
- package/dist/utils/linkUtils.esm.js +6 -12
- package/dist/utils/linkUtils.esm.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Dialog/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 DialogOwnProps,\n DialogHeaderOwnProps,\n DialogBodyOwnProps,\n DialogFooterOwnProps,\n} from './types';\nimport styles from './Dialog.module.css';\n\n/**\n * Component definition for Dialog\n * @public\n */\nexport const DialogDefinition = defineComponent<DialogOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogOverlay',\n container: 'bui-Dialog',\n inner: 'bui-DialogInner',\n content: 'bui-DialogContent',\n },\n propDefs: {\n children: {},\n className: {},\n width: {},\n height: {},\n style: {},\n },\n});\n\n/**\n * Component definition for DialogHeader\n * @public\n */\nexport const DialogHeaderDefinition = defineComponent<DialogHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogHeader',\n title: 'bui-DialogHeaderTitle',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogBody\n * @public\n */\nexport const DialogBodyDefinition = defineComponent<DialogBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogFooter\n * @public\n */\nexport const DialogFooterDefinition = defineComponent<DialogFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Dialog/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 DialogOwnProps,\n DialogHeaderOwnProps,\n DialogBodyOwnProps,\n DialogFooterOwnProps,\n} from './types';\nimport styles from './Dialog.module.css';\n\n/**\n * Component definition for Dialog\n * @public\n */\nexport const DialogDefinition = defineComponent<DialogOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogOverlay',\n container: 'bui-Dialog',\n inner: 'bui-DialogInner',\n content: 'bui-DialogContent',\n },\n propDefs: {\n children: {},\n className: {},\n width: {},\n height: {},\n style: {},\n },\n});\n\n/**\n * Component definition for DialogHeader\n * @public\n */\nexport const DialogHeaderDefinition = defineComponent<DialogHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogHeader',\n title: 'bui-DialogHeaderTitle',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogBody\n * @public\n */\nexport const DialogBodyDefinition = defineComponent<DialogBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogFooter\n * @public\n */\nexport const DialogFooterDefinition = defineComponent<DialogFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,mBAAA;AAAA,IACN,SAAA,EAAW,YAAA;AAAA,IACX,KAAA,EAAO,iBAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,OAAO;AAAC;AAEZ,CAAC;AAMM,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .FieldError_bui-
|
|
4
|
-
var styles = {"bui-FieldError":"FieldError_bui-
|
|
3
|
+
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .FieldError_bui-FieldError__a5d0dd2280 {\n display: inline-block;\n color: var(--bui-fg-danger);\n font-size: var(--bui-font-size-2);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n margin-top: var(--bui-space-2);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-FieldError":"FieldError_bui-FieldError__a5d0dd2280"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 '
|
|
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 './FieldError.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldError/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 { FieldErrorOwnProps } from './types';\nimport styles from './FieldError.module.css';\n\n/**\n * Component definition for FieldError\n * @public\n */\nexport const FieldErrorDefinition = defineComponent<FieldErrorOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldError',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldError/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 { FieldErrorOwnProps } from './types';\nimport styles from './FieldError.module.css';\n\n/**\n * Component definition for FieldError\n * @public\n */\nexport const FieldErrorDefinition = defineComponent<FieldErrorOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldError',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .FieldLabel_bui-
|
|
4
|
-
var styles = {"bui-FieldLabelWrapper":"FieldLabel_bui-
|
|
3
|
+
var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .FieldLabel_bui-FieldLabelWrapper__45ced1e40f {\n display: flex;\n flex-direction: column;\n margin-bottom: var(--bui-space-3);\n gap: var(--bui-space-1);\n line-height: 1.15;\n }\n\n .FieldLabel_bui-FieldLabel__45ced1e40f {\n color: var(--bui-fg-primary);\n margin-right: auto;\n cursor: pointer;\n font-weight: var(--bui-font-weight-regular);\n font-size: var(--bui-font-size-2);\n }\n\n .FieldLabel_bui-FieldSecondaryLabel__45ced1e40f {\n color: var(--bui-fg-secondary);\n font-weight: var(--bui-font-weight-regular);\n margin-left: var(--bui-space-1);\n }\n\n .FieldLabel_bui-FieldDescription__45ced1e40f {\n font-weight: var(--bui-font-weight-regular);\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-secondary);\n margin: 0;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-FieldLabelWrapper":"FieldLabel_bui-FieldLabelWrapper__45ced1e40f","bui-FieldLabel":"FieldLabel_bui-FieldLabel__45ced1e40f","bui-FieldSecondaryLabel":"FieldLabel_bui-FieldSecondaryLabel__45ced1e40f","bui-FieldDescription":"FieldLabel_bui-FieldDescription__45ced1e40f"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 '
|
|
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 './FieldLabel.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldLabel/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 { FieldLabelOwnProps } from './types';\nimport styles from './FieldLabel.module.css';\n\n/**\n * Component definition for FieldLabel\n * @public\n */\nexport const FieldLabelDefinition = defineComponent<FieldLabelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n propDefs: {\n label: {},\n secondaryLabel: {},\n description: {},\n htmlFor: {},\n id: {},\n descriptionId: {},\n descriptionSlot: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldLabel/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 { FieldLabelOwnProps } from './types';\nimport styles from './FieldLabel.module.css';\n\n/**\n * Component definition for FieldLabel\n * @public\n */\nexport const FieldLabelDefinition = defineComponent<FieldLabelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n propDefs: {\n label: {},\n secondaryLabel: {},\n description: {},\n htmlFor: {},\n id: {},\n descriptionId: {},\n descriptionSlot: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,uBAAA;AAAA,IACN,KAAA,EAAO,gBAAA;AAAA,IACP,cAAA,EAAgB,yBAAA;AAAA,IAChB,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,SAAS,EAAC;AAAA,IACV,IAAI,EAAC;AAAA,IACL,eAAe,EAAC;AAAA,IAChB,iBAAiB,EAAC;AAAA,IAClB,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
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 './Flex.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Flex/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 { FlexOwnProps } from './types';\nimport styles from './Flex.module.css';\n\n/**\n * Component definition for Flex\n * @public\n */\nexport const FlexDefinition = defineComponent<FlexOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Flex',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'gap',\n 'align',\n 'justify',\n 'direction',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Flex/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 { FlexOwnProps } from './types';\nimport styles from './Flex.module.css';\n\n/**\n * Component definition for Flex\n * @public\n */\nexport const FlexDefinition = defineComponent<FlexOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Flex',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'gap',\n 'align',\n 'justify',\n 'direction',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC1B,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA;AAEJ,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 '
|
|
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 './FullPage.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FullPage/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { FullPageOwnProps } from './types';\nimport styles from './FullPage.module.css';\n\n/**\n * Component definition for FullPage\n * @public\n */\nexport const FullPageDefinition = defineComponent<FullPageOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FullPage',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/FullPage/definition.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { FullPageOwnProps } from './types';\nimport styles from './FullPage.module.css';\n\n/**\n * Component definition for FullPage\n * @public\n */\nexport const FullPageDefinition = defineComponent<FullPageOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FullPage',\n },\n propDefs: {\n className: {},\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,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
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 './Grid.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Grid/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 { GridOwnProps, GridItemOwnProps } from './types';\nimport styles from './Grid.module.css';\n\n/**\n * Component definition for Grid\n * @public\n */\nexport const GridDefinition = defineComponent<GridOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Grid',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'columns',\n 'gap',\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n\n/**\n * Component definition for GridItem\n * @public\n */\nexport const GridItemDefinition = defineComponent<GridItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-GridItem',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['colSpan', 'colEnd', 'colStart', 'rowSpan'],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Grid/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 { GridOwnProps, GridItemOwnProps } from './types';\nimport styles from './Grid.module.css';\n\n/**\n * Component definition for Grid\n * @public\n */\nexport const GridDefinition = defineComponent<GridOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Grid',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'columns',\n 'gap',\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'grow',\n 'shrink',\n 'basis',\n ],\n});\n\n/**\n * Component definition for GridItem\n * @public\n */\nexport const GridItemDefinition = defineComponent<GridItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-GridItem',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['colSpan', 'colEnd', 'colStart', 'rowSpan'],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC1B,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA;AAEJ,CAAC;AAMM,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,EAAA,EAAI,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC1B,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc,CAAC,SAAA,EAAW,QAAA,EAAU,YAAY,SAAS;AAC3D,CAAC;;;;"}
|
|
@@ -4,8 +4,10 @@ import 'clsx';
|
|
|
4
4
|
import '../../hooks/useBreakpoint.esm.js';
|
|
5
5
|
import '../../hooks/useBg.esm.js';
|
|
6
6
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
7
|
-
import '
|
|
7
|
+
import 'react';
|
|
8
|
+
import '../../provider/BUIContext.esm.js';
|
|
8
9
|
import 'react-router-dom';
|
|
10
|
+
import '@backstage/version-bridge';
|
|
9
11
|
import '../Text/Text.module.css.esm.js';
|
|
10
12
|
import { Link } from '../Link/Link.esm.js';
|
|
11
13
|
import '../Link/Link.module.css.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderMetadataStatus.esm.js","sources":["../../../src/components/Header/HeaderMetadataStatus.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderMetadataStatusProps } from './types';\nimport { Text } from '../Text';\nimport { Link } from '../Link';\nimport styles from './HeaderMetadataStatus.module.css';\n\n/**\n * Displays a single status indicator as a coloured dot with a label inside a\n * Header metadata value. Optionally renders the label as a link when href is provided.\n *\n * @public\n */\nexport const HeaderMetadataStatus = ({\n label,\n color,\n href,\n}: HeaderMetadataStatusProps) => {\n return (\n <div className={styles.single}>\n <span\n aria-hidden=\"true\"\n className={`${styles.dot} ${styles[`dot-${color}`]}`}\n />\n <Text variant=\"body-medium\">\n {href ? (\n <Link href={href} standalone>\n {label}\n </Link>\n ) : (\n label\n )}\n </Text>\n </div>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderMetadataStatus.esm.js","sources":["../../../src/components/Header/HeaderMetadataStatus.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderMetadataStatusProps } from './types';\nimport { Text } from '../Text';\nimport { Link } from '../Link';\nimport styles from './HeaderMetadataStatus.module.css';\n\n/**\n * Displays a single status indicator as a coloured dot with a label inside a\n * Header metadata value. Optionally renders the label as a link when href is provided.\n *\n * @public\n */\nexport const HeaderMetadataStatus = ({\n label,\n color,\n href,\n}: HeaderMetadataStatusProps) => {\n return (\n <div className={styles.single}>\n <span\n aria-hidden=\"true\"\n className={`${styles.dot} ${styles[`dot-${color}`]}`}\n />\n <Text variant=\"body-medium\">\n {href ? (\n <Link href={href} standalone>\n {label}\n </Link>\n ) : (\n label\n )}\n </Text>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAM,uBAAuB,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,KAAiC;AAC/B,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,MAAA,EACrB,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,GAAG,MAAA,CAAO,GAAG,IAAI,MAAA,CAAO,CAAA,IAAA,EAAO,KAAK,CAAA,CAAE,CAAC,CAAA;AAAA;AAAA,KACpD;AAAA,oBACA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,aAAA,EACX,QAAA,EAAA,IAAA,mBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAY,UAAA,EAAU,IAAA,EACzB,QAAA,EAAA,KAAA,EACH,CAAA,GAEA,KAAA,EAEJ;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -4,8 +4,10 @@ import 'clsx';
|
|
|
4
4
|
import '../../hooks/useBreakpoint.esm.js';
|
|
5
5
|
import '../../hooks/useBg.esm.js';
|
|
6
6
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
7
|
-
import '
|
|
7
|
+
import 'react';
|
|
8
|
+
import '../../provider/BUIContext.esm.js';
|
|
8
9
|
import 'react-router-dom';
|
|
10
|
+
import '@backstage/version-bridge';
|
|
9
11
|
import '../Avatar/Avatar.module.css.esm.js';
|
|
10
12
|
import { TooltipTrigger, Tooltip } from '../Tooltip/Tooltip.esm.js';
|
|
11
13
|
import '../Tooltip/Tooltip.module.css.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderMetadataUsers.esm.js","sources":["../../../src/components/Header/HeaderMetadataUsers.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderMetadataUser } from './types';\nimport { Avatar } from '../Avatar';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport { Text } from '../Text';\nimport { Link } from '../Link';\nimport { Pressable } from 'react-aria';\nimport styles from './HeaderMetadataUsers.module.css';\n\n/**\n * Displays a list of users as avatars inside a Header metadata value.\n * A single user shows the avatar with their name beside it.\n * Multiple users show avatars in a row with the name revealed on hover via tooltip.\n * When a user has an `href`, the avatar and name become links.\n *\n * @public\n */\nexport const HeaderMetadataUsers = ({\n users,\n}: {\n users: HeaderMetadataUser[];\n}) => {\n if (users.length === 0) return null;\n\n if (users.length === 1) {\n const user = users[0];\n if (user.href) {\n return (\n <Link\n href={user.href}\n variant=\"body-medium\"\n standalone\n className={styles.single}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n {user.name}\n </Link>\n );\n }\n\n return (\n <div className={styles.single}>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n <Text variant=\"body-medium\">{user.name}</Text>\n </div>\n );\n }\n\n return (\n <ul className={styles.stack}>\n {users.map((user, i) => (\n <li key={user.href ?? `${i}:${user.name}`}>\n <TooltipTrigger>\n {user.href ? (\n <Link\n href={user.href}\n aria-label={user.name}\n className={styles.avatarLink}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n </Link>\n ) : (\n <Pressable>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"informative\"\n />\n </Pressable>\n )}\n <Tooltip>{user.name}</Tooltip>\n </TooltipTrigger>\n </li>\n ))}\n </ul>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderMetadataUsers.esm.js","sources":["../../../src/components/Header/HeaderMetadataUsers.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderMetadataUser } from './types';\nimport { Avatar } from '../Avatar';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport { Text } from '../Text';\nimport { Link } from '../Link';\nimport { Pressable } from 'react-aria';\nimport styles from './HeaderMetadataUsers.module.css';\n\n/**\n * Displays a list of users as avatars inside a Header metadata value.\n * A single user shows the avatar with their name beside it.\n * Multiple users show avatars in a row with the name revealed on hover via tooltip.\n * When a user has an `href`, the avatar and name become links.\n *\n * @public\n */\nexport const HeaderMetadataUsers = ({\n users,\n}: {\n users: HeaderMetadataUser[];\n}) => {\n if (users.length === 0) return null;\n\n if (users.length === 1) {\n const user = users[0];\n if (user.href) {\n return (\n <Link\n href={user.href}\n variant=\"body-medium\"\n standalone\n className={styles.single}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n {user.name}\n </Link>\n );\n }\n\n return (\n <div className={styles.single}>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n <Text variant=\"body-medium\">{user.name}</Text>\n </div>\n );\n }\n\n return (\n <ul className={styles.stack}>\n {users.map((user, i) => (\n <li key={user.href ?? `${i}:${user.name}`}>\n <TooltipTrigger>\n {user.href ? (\n <Link\n href={user.href}\n aria-label={user.name}\n className={styles.avatarLink}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n </Link>\n ) : (\n <Pressable>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"informative\"\n />\n </Pressable>\n )}\n <Tooltip>{user.name}</Tooltip>\n </TooltipTrigger>\n </li>\n ))}\n </ul>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCO,MAAM,sBAAsB,CAAC;AAAA,EAClC;AACF,CAAA,KAEM;AACJ,EAAA,IAAI,KAAA,CAAM,MAAA,K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ACC,+BAAC,cAAA,EAAA,EACE,QAAA,EAAA;AAAA,IAAA,IAAA,CAAK,IAAA,mBACJ,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,cAAY,IAAA,CAAK,IAAA;AAAA,QACjB,WAAW,MAAA,CAAO,UAAA;AAAA,QAElB,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,KAAK,GAAA,IAAO,QAAA;AAAA,YACjB,MAAM,IAAA,CAAK,IAAA;AAAA,YACX,IAAA,EAAK,OAAA;AAAA,YACL,OAAA,EAAQ;AAAA;AAAA;AACV;AAAA,KACF,uBAEC,SAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,KAAK,GAAA,IAAO,QAAA;AAAA,QACjB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,IAAA,EAAK,OAAA;AAAA,QACL,OAAA,EAAQ;AAAA;AAAA,KACV,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,OAAA,EAAA,EAAS,QAAA,EAAA,IAAA,CAAK,IAAA,EAAK;AAAA,GAAA,EACtB,CAAA,EAAA,EA1BO,IAAA,CAAK,IAAA,IAAQ,CAAA,EAAG,CAAC,IAAI,IAAA,CAAK,IAAI,CAAA,CA2BvC,CACD,CAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useState, useMemo, useCallback } from 'react';
|
|
3
|
-
import { useFocusVisible, useHover, useLink } from 'react-aria';
|
|
4
|
-
import {
|
|
3
|
+
import { useFocusVisible, useHover, useLink, mergeProps } from 'react-aria';
|
|
4
|
+
import { resolvePath, matchRoutes } from 'react-router-dom';
|
|
5
5
|
import { Button } from 'react-aria-components';
|
|
6
6
|
import { RiArrowDownSLine } from '@remixicon/react';
|
|
7
7
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
@@ -9,15 +9,34 @@ import { HeaderNavDefinition, HeaderNavGroupDefinition, HeaderNavItemDefinition
|
|
|
9
9
|
import { HeaderNavIndicators } from './HeaderNavIndicators.esm.js';
|
|
10
10
|
import { MenuTrigger, Menu, MenuItem } from '../Menu/Menu.esm.js';
|
|
11
11
|
import '../Menu/definition.esm.js';
|
|
12
|
+
import { useRoutingIntegration } from '../../navigation/useRouting.esm.js';
|
|
12
13
|
|
|
13
14
|
function isTabGroup(tab) {
|
|
14
15
|
return "items" in tab;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
function HeaderNavLinkView({
|
|
18
|
+
definitionResult,
|
|
19
|
+
navigation
|
|
20
|
+
}) {
|
|
21
|
+
const { ownProps, analytics } = definitionResult;
|
|
22
|
+
const { id, label, active, registerRef, onHighlight } = ownProps;
|
|
23
|
+
const { href } = ownProps;
|
|
19
24
|
const linkRef = useRef(null);
|
|
20
|
-
|
|
25
|
+
let ariaHref = href;
|
|
26
|
+
let routerOptions;
|
|
27
|
+
if (navigation.type === "router") {
|
|
28
|
+
ariaHref = navigation.ariaHref;
|
|
29
|
+
routerOptions = navigation.routerOptions;
|
|
30
|
+
} else if (navigation.type === "native") {
|
|
31
|
+
ariaHref = navigation.ariaHref;
|
|
32
|
+
}
|
|
33
|
+
const { linkProps } = useLink(
|
|
34
|
+
{
|
|
35
|
+
href: ariaHref,
|
|
36
|
+
routerOptions
|
|
37
|
+
},
|
|
38
|
+
linkRef
|
|
39
|
+
);
|
|
21
40
|
const { hoverProps } = useHover({
|
|
22
41
|
onHoverStart: () => onHighlight(id),
|
|
23
42
|
onHoverEnd: () => onHighlight(null)
|
|
@@ -28,23 +47,45 @@ function HeaderNavLink(props) {
|
|
|
28
47
|
attributes: { to: href }
|
|
29
48
|
});
|
|
30
49
|
};
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
const { href: _href, ...anchorProps } = mergeProps(
|
|
51
|
+
linkProps,
|
|
52
|
+
hoverProps
|
|
53
|
+
);
|
|
54
|
+
const ref = (el) => {
|
|
55
|
+
linkRef.current = el;
|
|
56
|
+
registerRef(id, el);
|
|
57
|
+
};
|
|
58
|
+
const commonProps = {
|
|
59
|
+
...anchorProps,
|
|
60
|
+
ref,
|
|
61
|
+
className: ownProps.classes.root,
|
|
62
|
+
"aria-current": active ? "page" : void 0,
|
|
63
|
+
onClick: handleClick,
|
|
64
|
+
onFocus: () => onHighlight(id),
|
|
65
|
+
onBlur: () => onHighlight(null),
|
|
66
|
+
children: label
|
|
67
|
+
};
|
|
68
|
+
const browserHref = navigation.type === "native" ? navigation.browserHref : href;
|
|
69
|
+
return /* @__PURE__ */ jsx("li", { children: navigation.type === "router" ? /* @__PURE__ */ jsx(
|
|
70
|
+
navigation.Link,
|
|
71
|
+
{
|
|
72
|
+
...commonProps,
|
|
73
|
+
...navigation.routerLinkOptions,
|
|
74
|
+
to: navigation.to
|
|
75
|
+
}
|
|
76
|
+
) : /* @__PURE__ */ jsx("a", { ...commonProps, href: browserHref }) });
|
|
77
|
+
}
|
|
78
|
+
function HeaderNavLink(props) {
|
|
79
|
+
const definitionResult = useDefinition(HeaderNavItemDefinition, props);
|
|
80
|
+
const Navigation = definitionResult.navigation;
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
Navigation,
|
|
33
83
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
linkRef.current = el;
|
|
38
|
-
registerRef(id, el);
|
|
39
|
-
},
|
|
40
|
-
className: ownProps.classes.root,
|
|
41
|
-
"aria-current": active ? "page" : void 0,
|
|
42
|
-
onClick: handleClick,
|
|
43
|
-
onFocus: () => onHighlight(id),
|
|
44
|
-
onBlur: () => onHighlight(null),
|
|
45
|
-
children: label
|
|
84
|
+
props: { href: definitionResult.ownProps.href },
|
|
85
|
+
view: HeaderNavLinkView,
|
|
86
|
+
viewProps: { definitionResult }
|
|
46
87
|
}
|
|
47
|
-
)
|
|
88
|
+
);
|
|
48
89
|
}
|
|
49
90
|
function HeaderNavGroupItem(props) {
|
|
50
91
|
const { group, active, activeChildId, registerRef, onHighlight } = props;
|
|
@@ -82,8 +123,9 @@ function HeaderNavGroupItem(props) {
|
|
|
82
123
|
] }) });
|
|
83
124
|
}
|
|
84
125
|
function useAutoActiveTabId(tabs) {
|
|
85
|
-
const
|
|
86
|
-
const
|
|
126
|
+
const routing = useRoutingIntegration({ fallback: true });
|
|
127
|
+
const basePath = routing.useResolvedPath(".").pathname;
|
|
128
|
+
const { pathname } = routing.useLocation();
|
|
87
129
|
return useMemo(() => {
|
|
88
130
|
const allTabs = tabs.flatMap((tab) => isTabGroup(tab) ? tab.items : [tab]);
|
|
89
131
|
const routeObjects = allTabs.map((tab) => ({
|
|
@@ -177,7 +219,8 @@ function HeaderNavInner(props) {
|
|
|
177
219
|
);
|
|
178
220
|
}
|
|
179
221
|
function HeaderNav(props) {
|
|
180
|
-
const
|
|
222
|
+
const routing = useRoutingIntegration({ fallback: true });
|
|
223
|
+
const inRouter = routing.useInRouterContext();
|
|
181
224
|
if (props.activeTabId === void 0 && inRouter) {
|
|
182
225
|
return /* @__PURE__ */ jsx(HeaderNavAutoDetect, { tabs: props.tabs });
|
|
183
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNav.esm.js","sources":["../../../src/components/Header/HeaderNav.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { useFocusVisible, useHover, useLink } from 'react-aria';\nimport {\n matchRoutes,\n resolvePath,\n useInRouterContext,\n useLocation,\n useResolvedPath,\n} from 'react-router-dom';\nimport { Button as RAButton } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n HeaderNavDefinition,\n HeaderNavItemDefinition,\n HeaderNavGroupDefinition,\n} from './HeaderNavDefinition';\nimport { HeaderNavIndicators } from './HeaderNavIndicators';\nimport { MenuTrigger, Menu, MenuItem } from '../Menu';\nimport type {\n HeaderNavLinkProps,\n HeaderNavTabGroup,\n HeaderNavTabItem,\n} from './types';\n\nfunction isTabGroup(tab: HeaderNavTabItem): tab is HeaderNavTabGroup {\n return 'items' in tab;\n}\n\nfunction HeaderNavLink(props: HeaderNavLinkProps) {\n const { ownProps, analytics } = useDefinition(HeaderNavItemDefinition, props);\n const { id, label, href, active, registerRef, onHighlight } = ownProps;\n\n const linkRef = useRef<HTMLAnchorElement>(null);\n const { linkProps } = useLink({ href }, linkRef);\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(id),\n onHoverEnd: () => onHighlight(null),\n });\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n analytics.captureEvent('click', label, {\n attributes: { to: href },\n });\n };\n\n return (\n <li>\n <a\n {...linkProps}\n {...hoverProps}\n ref={el => {\n (\n linkRef as React.MutableRefObject<HTMLAnchorElement | null>\n ).current = el;\n registerRef(id, el);\n }}\n className={ownProps.classes.root}\n aria-current={active ? 'page' : undefined}\n onClick={handleClick}\n onFocus={() => onHighlight(id)}\n onBlur={() => onHighlight(null)}\n >\n {label}\n </a>\n </li>\n );\n}\n\ninterface HeaderNavGroupItemProps {\n group: HeaderNavTabGroup;\n active: boolean;\n activeChildId?: string;\n registerRef: (key: string, el: HTMLElement | null) => void;\n onHighlight: (key: string | null) => void;\n}\n\nfunction HeaderNavGroupItem(props: HeaderNavGroupItemProps) {\n const { group, active, activeChildId, registerRef, onHighlight } = props;\n const { ownProps } = useDefinition(HeaderNavGroupDefinition, {});\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(group.id),\n onHoverEnd: () => onHighlight(null),\n });\n\n return (\n <li>\n <MenuTrigger>\n <RAButton\n ref={el => {\n registerRef(group.id, el);\n }}\n className={ownProps.classes.root}\n aria-current={active ? 'page' : undefined}\n {...hoverProps}\n onFocus={() => onHighlight(group.id)}\n onBlur={() => onHighlight(null)}\n >\n {group.label}\n <RiArrowDownSLine size={16} />\n </RAButton>\n <Menu\n selectionMode=\"single\"\n selectedKeys={new Set(activeChildId ? [activeChildId] : [])}\n >\n {group.items.map(item => (\n <MenuItem key={item.id} id={item.id} href={item.href}>\n {item.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n </li>\n );\n}\n\ninterface HeaderNavProps {\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n}\n\nfunction useAutoActiveTabId(tabs: HeaderNavTabItem[]): string | undefined {\n const basePath = useResolvedPath('.').pathname;\n const { pathname } = useLocation();\n\n return useMemo(() => {\n const allTabs = tabs.flatMap(tab => (isTabGroup(tab) ? tab.items : [tab]));\n const routeObjects = allTabs.map(tab => ({\n path: `${resolvePath(tab.href, basePath).pathname}/*`,\n id: tab.id,\n }));\n const matches = matchRoutes(routeObjects, pathname);\n return matches?.[0]?.route.id;\n }, [tabs, basePath, pathname]);\n}\n\nfunction HeaderNavAutoDetect(props: { tabs: HeaderNavTabItem[] }) {\n const activeTabId = useAutoActiveTabId(props.tabs);\n return <HeaderNavInner tabs={props.tabs} activeTabId={activeTabId} />;\n}\n\nfunction HeaderNavInner(props: HeaderNavProps) {\n const { tabs, activeTabId } = props;\n const { ownProps } = useDefinition(HeaderNavDefinition, {\n tabs,\n activeTabId,\n });\n const { classes } = ownProps;\n\n const { isFocusVisible } = useFocusVisible();\n const navRef = useRef<HTMLElement>(null);\n const itemRefs = useRef<Map<string, HTMLElement>>(new Map());\n\n const [highlightedKey, setHighlightedKey] = useState<string | null>(null);\n\n // Resolve activeTabId to a top-level key (groups own their children's active state)\n const { activeKey, activeChildId } = useMemo(() => {\n if (!activeTabId) return { activeKey: undefined, activeChildId: undefined };\n for (const item of tabs) {\n if (isTabGroup(item)) {\n const child = item.items.find(c => c.id === activeTabId);\n if (child) {\n return { activeKey: item.id, activeChildId: child.id };\n }\n } else if (item.id === activeTabId) {\n return { activeKey: item.id, activeChildId: undefined };\n }\n }\n return { activeKey: undefined, activeChildId: undefined };\n }, [activeTabId, tabs]);\n\n const registerRef = useCallback((key: string, el: HTMLElement | null) => {\n if (el) {\n itemRefs.current.set(key, el);\n } else {\n itemRefs.current.delete(key);\n }\n }, []);\n\n return (\n <nav\n ref={navRef}\n aria-label=\"Content navigation\"\n className={classes.root}\n data-focus-visible={isFocusVisible || undefined}\n >\n <ul role=\"list\" className={classes.list}>\n {tabs.map(item =>\n isTabGroup(item) ? (\n <HeaderNavGroupItem\n key={item.id}\n group={item}\n active={activeKey === item.id}\n activeChildId={activeChildId}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ) : (\n <HeaderNavLink\n key={item.id}\n id={item.id}\n label={item.label}\n href={item.href}\n active={activeKey === item.id}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ),\n )}\n </ul>\n <HeaderNavIndicators\n navRef={navRef}\n itemRefs={itemRefs}\n activeKey={activeKey}\n highlightedKey={highlightedKey}\n classes={{ active: classes.active, hovered: classes.hovered }}\n />\n </nav>\n );\n}\n\n/** @internal */\nexport function HeaderNav(props: HeaderNavProps) {\n const inRouter = useInRouterContext();\n\n if (props.activeTabId === undefined && inRouter) {\n return <HeaderNavAutoDetect tabs={props.tabs} />;\n }\n\n return <HeaderNavInner tabs={props.tabs} activeTabId={props.activeTabId} />;\n}\n"],"names":["RAButton"],"mappings":";;;;;;;;;;;;AAyCA,SAAS,WAAW,GAAA,EAAi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IAAA,CAAK,IAAA;AAAA,cACX,MAAA,EAAQ,cAAc,IAAA,CAAK,EAAA;AAAA,cAC3B,WAAA;AAAA,cACA,WAAA,EAAa;AAAA,aAAA;AAAA,YANR,IAAA,CAAK;AAAA;AAOZ,SAEJ,EACF,CAAA;AAAA,wBACA,GAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,MAAA;AAAA,YACA,QAAA;AAAA,YACA,SAAA;AAAA,YACA,cAAA;AAAA,YACA,SAAS,EAAE,MAAA,EAAQ,QAAQ,MAAA,EAAQ,OAAA,EAAS,QAAQ,OAAA;AAAQ;AAAA;AAC9D;AAAA;AAAA,GACF;AAEJ;AAGO,SAAS,UAAU,KAAA,EAAuB;AAC/C,EAAA,MAAM,WAAW,kBAAA,EAAmB;AAEpC,EAAA,IAAI,KAAA,CAAM,WAAA,KAAgB,MAAA,IAAa,QAAA,EAAU;AAC/C,IAAA,uBAAO,GAAA,CAAC,mBAAA,EAAA,EAAoB,IAAA,EAAM,KAAA,CAAM,IAAA,EAAM,CAAA;AAAA,EAChD;AAEA,EAAA,2BAAQ,cAAA,EAAA,EAAe,IAAA,EAAM,MAAM,IAAA,EAAM,WAAA,EAAa,MAAM,WAAA,EAAa,CAAA;AAC3E;;;;"}
|
|
1
|
+
{"version":3,"file":"HeaderNav.esm.js","sources":["../../../src/components/Header/HeaderNav.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { mergeProps, useFocusVisible, useHover, useLink } from 'react-aria';\nimport {\n matchRoutes,\n resolvePath,\n type NavigateOptions,\n} from 'react-router-dom';\nimport { Button as RAButton } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n HeaderNavDefinition,\n HeaderNavItemDefinition,\n HeaderNavGroupDefinition,\n} from './HeaderNavDefinition';\nimport { HeaderNavIndicators } from './HeaderNavIndicators';\nimport { MenuTrigger, Menu, MenuItem } from '../Menu';\nimport type {\n HeaderNavLinkProps,\n HeaderNavTabGroup,\n HeaderNavTabItem,\n} from './types';\nimport { useRoutingIntegration } from '../../navigation/useRouting';\nimport type { AnchorNavigation } from '../../navigation/useNavigation';\n\nfunction isTabGroup(tab: HeaderNavTabItem): tab is HeaderNavTabGroup {\n return 'items' in tab;\n}\n\ntype HeaderNavLinkViewProps = {\n definitionResult: UseDefinitionResult<\n typeof HeaderNavItemDefinition,\n HeaderNavLinkProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction HeaderNavLinkView({\n definitionResult,\n navigation,\n}: HeaderNavLinkViewProps) {\n const { ownProps, analytics } = definitionResult;\n const { id, label, active, registerRef, onHighlight } = ownProps;\n const { href } = ownProps;\n\n const linkRef = useRef<HTMLAnchorElement>(null);\n let ariaHref = href;\n let routerOptions: NavigateOptions | undefined;\n if (navigation.type === 'router') {\n ariaHref = navigation.ariaHref;\n routerOptions = navigation.routerOptions;\n } else if (navigation.type === 'native') {\n ariaHref = navigation.ariaHref;\n }\n const { linkProps } = useLink(\n {\n href: ariaHref,\n routerOptions,\n },\n linkRef,\n );\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(id),\n onHoverEnd: () => onHighlight(null),\n });\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n analytics.captureEvent('click', label, {\n attributes: { to: href },\n });\n };\n const { href: _href, ...anchorProps } = mergeProps(\n linkProps,\n hoverProps,\n ) as React.AnchorHTMLAttributes<HTMLAnchorElement>;\n const ref = (el: HTMLAnchorElement | null) => {\n (linkRef as React.MutableRefObject<HTMLAnchorElement | null>).current = el;\n registerRef(id, el);\n };\n const commonProps = {\n ...anchorProps,\n ref,\n className: ownProps.classes.root,\n 'aria-current': active ? ('page' as const) : undefined,\n onClick: handleClick,\n onFocus: () => onHighlight(id),\n onBlur: () => onHighlight(null),\n children: label,\n };\n const browserHref =\n navigation.type === 'native' ? navigation.browserHref : href;\n\n return (\n <li>\n {navigation.type === 'router' ? (\n <navigation.Link\n {...commonProps}\n {...navigation.routerLinkOptions}\n to={navigation.to}\n />\n ) : (\n <a {...commonProps} href={browserHref} />\n )}\n </li>\n );\n}\n\nfunction HeaderNavLink(props: HeaderNavLinkProps) {\n const definitionResult = useDefinition(HeaderNavItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={{ href: definitionResult.ownProps.href }}\n view={HeaderNavLinkView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\ninterface HeaderNavGroupItemProps {\n group: HeaderNavTabGroup;\n active: boolean;\n activeChildId?: string;\n registerRef: (key: string, el: HTMLElement | null) => void;\n onHighlight: (key: string | null) => void;\n}\n\nfunction HeaderNavGroupItem(props: HeaderNavGroupItemProps) {\n const { group, active, activeChildId, registerRef, onHighlight } = props;\n const { ownProps } = useDefinition(HeaderNavGroupDefinition, {});\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(group.id),\n onHoverEnd: () => onHighlight(null),\n });\n\n return (\n <li>\n <MenuTrigger>\n <RAButton\n ref={el => {\n registerRef(group.id, el);\n }}\n className={ownProps.classes.root}\n aria-current={active ? 'page' : undefined}\n {...hoverProps}\n onFocus={() => onHighlight(group.id)}\n onBlur={() => onHighlight(null)}\n >\n {group.label}\n <RiArrowDownSLine size={16} />\n </RAButton>\n <Menu\n selectionMode=\"single\"\n selectedKeys={new Set(activeChildId ? [activeChildId] : [])}\n >\n {group.items.map(item => (\n <MenuItem key={item.id} id={item.id} href={item.href}>\n {item.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n </li>\n );\n}\n\ninterface HeaderNavProps {\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n}\n\nfunction useAutoActiveTabId(tabs: HeaderNavTabItem[]): string | undefined {\n const routing = useRoutingIntegration({ fallback: true });\n const basePath = routing.useResolvedPath('.').pathname;\n const { pathname } = routing.useLocation();\n\n return useMemo(() => {\n const allTabs = tabs.flatMap(tab => (isTabGroup(tab) ? tab.items : [tab]));\n const routeObjects = allTabs.map(tab => ({\n path: `${resolvePath(tab.href, basePath).pathname}/*`,\n id: tab.id,\n }));\n const matches = matchRoutes(routeObjects, pathname);\n return matches?.[0]?.route.id;\n }, [tabs, basePath, pathname]);\n}\n\nfunction HeaderNavAutoDetect(props: { tabs: HeaderNavTabItem[] }) {\n const activeTabId = useAutoActiveTabId(props.tabs);\n return <HeaderNavInner tabs={props.tabs} activeTabId={activeTabId} />;\n}\n\nfunction HeaderNavInner(props: HeaderNavProps) {\n const { tabs, activeTabId } = props;\n const { ownProps } = useDefinition(HeaderNavDefinition, {\n tabs,\n activeTabId,\n });\n const { classes } = ownProps;\n\n const { isFocusVisible } = useFocusVisible();\n const navRef = useRef<HTMLElement>(null);\n const itemRefs = useRef<Map<string, HTMLElement>>(new Map());\n\n const [highlightedKey, setHighlightedKey] = useState<string | null>(null);\n\n // Resolve activeTabId to a top-level key (groups own their children's active state)\n const { activeKey, activeChildId } = useMemo(() => {\n if (!activeTabId) return { activeKey: undefined, activeChildId: undefined };\n for (const item of tabs) {\n if (isTabGroup(item)) {\n const child = item.items.find(c => c.id === activeTabId);\n if (child) {\n return { activeKey: item.id, activeChildId: child.id };\n }\n } else if (item.id === activeTabId) {\n return { activeKey: item.id, activeChildId: undefined };\n }\n }\n return { activeKey: undefined, activeChildId: undefined };\n }, [activeTabId, tabs]);\n\n const registerRef = useCallback((key: string, el: HTMLElement | null) => {\n if (el) {\n itemRefs.current.set(key, el);\n } else {\n itemRefs.current.delete(key);\n }\n }, []);\n\n return (\n <nav\n ref={navRef}\n aria-label=\"Content navigation\"\n className={classes.root}\n data-focus-visible={isFocusVisible || undefined}\n >\n <ul role=\"list\" className={classes.list}>\n {tabs.map(item =>\n isTabGroup(item) ? (\n <HeaderNavGroupItem\n key={item.id}\n group={item}\n active={activeKey === item.id}\n activeChildId={activeChildId}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ) : (\n <HeaderNavLink\n key={item.id}\n id={item.id}\n label={item.label}\n href={item.href}\n active={activeKey === item.id}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ),\n )}\n </ul>\n <HeaderNavIndicators\n navRef={navRef}\n itemRefs={itemRefs}\n activeKey={activeKey}\n highlightedKey={highlightedKey}\n classes={{ active: classes.active, hovered: classes.hovered }}\n />\n </nav>\n );\n}\n\n/** @internal */\nexport function HeaderNav(props: HeaderNavProps) {\n const routing = useRoutingIntegration({ fallback: true });\n const inRouter = routing.useInRouterContext();\n\n if (props.activeTabId === undefined && inRouter) {\n return <HeaderNavAutoDetect tabs={props.tabs} />;\n }\n\n return <HeaderNavInner tabs={props.tabs} activeTabId={props.activeTabId} />;\n}\n"],"names":["RAButton"],"mappings":";;;;;;;;;;;;;AA4CA,SAAS,WAAW,GAAA,EAAiD;AACnE,EAAA,OAAO,OAAA,IAAW,GAAA;AACpB;AAUA,SAAS,iBAAA,CAAkB;AAAA,EACzB,gBAAA;AAAA,EACA;AACF,CAAA,EAA2B;AACzB,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,gBAAA;AAChC,EAAA,MAAM,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,WAAA,EAAa,aAAY,GAAI,QAAA;AACxD,EAAA,MAAM,EAAE,MAAK,GAAI,QAAA;AAEjB,EAAA,MAAM,OAAA,GAAU,OAA0B,IAAI,CAAA;AAC9C,EAAA,IAAI,QAAA,GAAW,IAAA;AACf,EAAA,IAAI,aAAA;AACJ,E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YACA,SAAS,EAAE,MAAA,EAAQ,QAAQ,MAAA,EAAQ,OAAA,EAAS,QAAQ,OAAA;AAAQ;AAAA;AAC9D;AAAA;AAAA,GACF;AAEJ;AAGO,SAAS,UAAU,KAAA,EAAuB;AAC/C,EAAA,MAAM,OAAA,GAAU,qBAAA,CAAsB,EAAE,QAAA,EAAU,MAAM,CAAA;AACxD,EAAA,MAAM,QAAA,GAAW,QAAQ,kBAAA,EAAmB;AAE5C,EAAA,IAAI,KAAA,CAAM,WAAA,KAAgB,MAAA,IAAa,QAAA,EAAU;AAC/C,IAAA,uBAAO,GAAA,CAAC,mBAAA,EAAA,EAAoB,IAAA,EAAM,KAAA,CAAM,IAAA,EAAM,CAAA;AAAA,EAChD;AAEA,EAAA,2BAAQ,cAAA,EAAA,EAAe,IAAA,EAAM,MAAM,IAAA,EAAM,WAAA,EAAa,MAAM,WAAA,EAAa,CAAA;AAC3E;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .HeaderNav_bui-
|
|
4
|
-
var styles = {"bui-HeaderNav":"HeaderNav_bui-
|
|
3
|
+
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .HeaderNav_bui-HeaderNav__e4ad50ef7c {\n position: relative;\n\n /* CSS custom properties for indicator positioning — set by HeaderNavIndicators */\n --active-tab-left: 0px;\n --active-tab-right: 0px;\n --active-tab-top: 0px;\n --active-tab-bottom: 0px;\n --active-tab-width: 0px;\n --active-tab-height: 0px;\n --active-tab-opacity: 0;\n --active-transition-duration: 0s;\n\n --hovered-tab-left: 0px;\n --hovered-tab-right: 0px;\n --hovered-tab-top: 0px;\n --hovered-tab-bottom: 0px;\n --hovered-tab-width: 0px;\n --hovered-tab-height: 0px;\n --hovered-tab-opacity: 0;\n --hovered-transition-duration: 0s;\n }\n\n .HeaderNav_bui-HeaderNavList__e4ad50ef7c {\n display: flex;\n flex-direction: row;\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .HeaderNav_bui-HeaderNavItem__e4ad50ef7c,\n .HeaderNav_bui-HeaderNavGroup__e4ad50ef7c {\n font-family: var(--bui-font-regular);\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n font-weight: var(--bui-font-weight-regular);\n color: var(--bui-fg-secondary);\n height: 36px;\n display: flex;\n gap: var(--bui-space-1);\n align-items: center;\n padding-inline: var(--bui-space-2);\n text-decoration: none;\n cursor: pointer;\n position: relative;\n z-index: 2;\n border: none;\n background: none;\n outline: none;\n }\n\n .HeaderNav_bui-HeaderNavItem__e4ad50ef7c[aria-current='page'],\n .HeaderNav_bui-HeaderNavGroup__e4ad50ef7c[aria-current='page'] {\n color: var(--bui-fg-primary);\n }\n\n .HeaderNav_bui-HeaderNavActive__e4ad50ef7c {\n pointer-events: none;\n position: absolute;\n bottom: -1px;\n left: calc(var(--active-tab-left) + var(--bui-space-2));\n width: calc(var(--active-tab-width) - var(--bui-space-4));\n height: 1px;\n background-color: var(--bui-fg-primary);\n border-radius: 4px;\n opacity: var(--active-tab-opacity);\n transition: left var(--active-transition-duration) ease-out,\n width var(--active-transition-duration) ease-out, opacity 0.15s;\n }\n\n .HeaderNav_bui-HeaderNavHovered__e4ad50ef7c {\n pointer-events: none;\n position: absolute;\n left: var(--hovered-tab-left);\n top: calc(var(--hovered-tab-top) + 4px);\n width: var(--hovered-tab-width);\n height: calc(var(--hovered-tab-height) - 8px);\n background-color: var(--bui-bg-neutral-2);\n border-radius: 4px;\n opacity: var(--hovered-tab-opacity);\n transition: left var(--hovered-transition-duration) ease-out,\n top var(--hovered-transition-duration) ease-out,\n width var(--hovered-transition-duration) ease-out,\n height var(--hovered-transition-duration) ease-out, opacity 0.15s;\n\n [data-focus-visible] & {\n outline: 2px solid var(--bui-ring);\n outline-offset: -2px;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .HeaderNav_bui-HeaderNavActive__e4ad50ef7c,\n .HeaderNav_bui-HeaderNavHovered__e4ad50ef7c {\n transition: none;\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-HeaderNav":"HeaderNav_bui-HeaderNav__e4ad50ef7c","bui-HeaderNavList":"HeaderNav_bui-HeaderNavList__e4ad50ef7c","bui-HeaderNavItem":"HeaderNav_bui-HeaderNavItem__e4ad50ef7c","bui-HeaderNavGroup":"HeaderNav_bui-HeaderNavGroup__e4ad50ef7c","bui-HeaderNavActive":"HeaderNav_bui-HeaderNavActive__e4ad50ef7c","bui-HeaderNavHovered":"HeaderNav_bui-HeaderNavHovered__e4ad50ef7c"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 '
|
|
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 './HeaderNav.module.css.esm.js';
|
|
10
12
|
|
|
@@ -29,6 +31,7 @@ const HeaderNavItemDefinition = defineComponent()({
|
|
|
29
31
|
root: "bui-HeaderNavItem"
|
|
30
32
|
},
|
|
31
33
|
analytics: true,
|
|
34
|
+
navigation: { type: "anchor" },
|
|
32
35
|
propDefs: {
|
|
33
36
|
noTrack: {},
|
|
34
37
|
id: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavDefinition.esm.js","sources":["../../../src/components/Header/HeaderNavDefinition.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 { HeaderNavTabItem, HeaderNavLinkProps } from './types';\nimport styles from './HeaderNav.module.css';\n\n/** @public */\nexport const HeaderNavDefinition = defineComponent<{\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n children?: React.ReactNode;\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNav',\n list: 'bui-HeaderNavList',\n active: 'bui-HeaderNavActive',\n hovered: 'bui-HeaderNavHovered',\n },\n propDefs: {\n tabs: {},\n activeTabId: {},\n children: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavItemDefinition = defineComponent<HeaderNavLinkProps>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavItem',\n },\n analytics: true,\n propDefs: {\n noTrack: {},\n id: {},\n label: {},\n href: {},\n active: {},\n registerRef: {},\n onHighlight: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavGroupDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavGroup',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderNavDefinition.esm.js","sources":["../../../src/components/Header/HeaderNavDefinition.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 { HeaderNavTabItem, HeaderNavLinkProps } from './types';\nimport styles from './HeaderNav.module.css';\n\n/** @public */\nexport const HeaderNavDefinition = defineComponent<{\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n children?: React.ReactNode;\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNav',\n list: 'bui-HeaderNavList',\n active: 'bui-HeaderNavActive',\n hovered: 'bui-HeaderNavHovered',\n },\n propDefs: {\n tabs: {},\n activeTabId: {},\n children: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavItemDefinition = defineComponent<HeaderNavLinkProps>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavItem',\n },\n analytics: true,\n navigation: { type: 'anchor' },\n propDefs: {\n noTrack: {},\n id: {},\n label: {},\n href: {},\n active: {},\n registerRef: {},\n onHighlight: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavGroupDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavGroup',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBO,MAAM,mBAAA,GAAsB,iBAKhC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,IAAA,EAAM,mBAAA;AAAA,IACN,MAAA,EAAQ,qBAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,uBAAA,GAA0B,iBAAoC,CAAE;AAAA,EAC3E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW,IAAA;AAAA,EACX,UAAA,EAAY,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,IAAI,EAAC;AAAA,IACL,OAAO,EAAC;AAAA,IACR,MAAM,EAAC;AAAA,IACP,QAAQ,EAAC;AAAA,IACT,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,wBAAA,GAA2B,iBAErC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
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 './Header.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Header/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 { HeaderOwnProps } from './types';\nimport styles from './Header.module.css';\n\n/**\n * Component definition for Header\n * @public\n */\nexport const HeaderDefinition = defineComponent<HeaderOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n headerTop: 'bui-HeaderTop',\n stickySentinel: 'bui-HeaderStickySentinel',\n content: 'bui-HeaderContent',\n headerBottom: 'bui-HeaderBottom',\n breadcrumbs: 'bui-HeaderBreadcrumbs',\n breadcrumbsSmall: 'bui-HeaderBreadcrumbsSmall',\n breadcrumbLink: 'bui-HeaderBreadcrumbLink',\n breadcrumbLinkSmall: 'bui-HeaderBreadcrumbLinkSmall',\n breadcrumbSeparator: 'bui-HeaderBreadcrumbSeparator',\n titleStack: 'bui-HeaderTitleStack',\n title: 'bui-HeaderTitle',\n titleSmall: 'bui-HeaderTitleSmall',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n controls: 'bui-HeaderControls',\n tags: 'bui-HeaderTags',\n tag: 'bui-HeaderTag',\n description: 'bui-HeaderDescription',\n metaRow: 'bui-HeaderMetaRow',\n metaItem: 'bui-HeaderMetaItem',\n },\n propDefs: {\n title: {},\n customActions: {},\n tabs: {},\n activeTabId: {},\n breadcrumbs: {},\n description: {},\n tags: {},\n metadata: {},\n className: {},\n sticky: {},\n },\n});\n\n/**\n * @public\n * @deprecated Use {@link HeaderDefinition} instead.\n */\nexport const HeaderPageDefinition = HeaderDefinition;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Header/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 { HeaderOwnProps } from './types';\nimport styles from './Header.module.css';\n\n/**\n * Component definition for Header\n * @public\n */\nexport const HeaderDefinition = defineComponent<HeaderOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n headerTop: 'bui-HeaderTop',\n stickySentinel: 'bui-HeaderStickySentinel',\n content: 'bui-HeaderContent',\n headerBottom: 'bui-HeaderBottom',\n breadcrumbs: 'bui-HeaderBreadcrumbs',\n breadcrumbsSmall: 'bui-HeaderBreadcrumbsSmall',\n breadcrumbLink: 'bui-HeaderBreadcrumbLink',\n breadcrumbLinkSmall: 'bui-HeaderBreadcrumbLinkSmall',\n breadcrumbSeparator: 'bui-HeaderBreadcrumbSeparator',\n titleStack: 'bui-HeaderTitleStack',\n title: 'bui-HeaderTitle',\n titleSmall: 'bui-HeaderTitleSmall',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n controls: 'bui-HeaderControls',\n tags: 'bui-HeaderTags',\n tag: 'bui-HeaderTag',\n description: 'bui-HeaderDescription',\n metaRow: 'bui-HeaderMetaRow',\n metaItem: 'bui-HeaderMetaItem',\n },\n propDefs: {\n title: {},\n customActions: {},\n tabs: {},\n activeTabId: {},\n breadcrumbs: {},\n description: {},\n tags: {},\n metadata: {},\n className: {},\n sticky: {},\n },\n});\n\n/**\n * @public\n * @deprecated Use {@link HeaderDefinition} instead.\n */\nexport const HeaderPageDefinition = HeaderDefinition;\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,SAAA,EAAW,eAAA;AAAA,IACX,cAAA,EAAgB,0BAAA;AAAA,IAChB,OAAA,EAAS,mBAAA;AAAA,IACT,YAAA,EAAc,kBAAA;AAAA,IACd,WAAA,EAAa,uBAAA;AAAA,IACb,gBAAA,EAAkB,4BAAA;AAAA,IAClB,cAAA,EAAgB,0BAAA;AAAA,IAChB,mBAAA,EAAqB,+BAAA;AAAA,IACrB,mBAAA,EAAqB,+BAAA;AAAA,IACrB,UAAA,EAAY,sBAAA;AAAA,IACZ,KAAA,EAAO,iBAAA;AAAA,IACP,UAAA,EAAY,sBAAA;AAAA,IACZ,WAAA,EAAa,uBAAA;AAAA,IACb,QAAA,EAAU,oBAAA;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,GAAA,EAAK,eAAA;AAAA,IACL,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAAS,mBAAA;AAAA,IACT,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,MAAM,EAAC;AAAA,IACP,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,QAAQ;AAAC;AAEb,CAAC;AAMM,MAAM,oBAAA,GAAuB;;;;"}
|