@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
|
@@ -5,45 +5,86 @@ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
|
5
5
|
import { useResolvedHref } from '../../hooks/useResolvedHref.esm.js';
|
|
6
6
|
import { LinkDefinition } from './definition.esm.js';
|
|
7
7
|
import { getNodeText } from '../../analytics/getNodeText.esm.js';
|
|
8
|
+
import { handleRouterLinkClick } from '../../navigation/useNavigation.esm.js';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function LinkView({
|
|
11
|
+
definitionResult,
|
|
12
|
+
navigation,
|
|
13
|
+
forwardedRef
|
|
14
|
+
}) {
|
|
15
|
+
const { ownProps, restProps, dataAttributes, analytics } = definitionResult;
|
|
14
16
|
const { classes, title, children } = ownProps;
|
|
15
17
|
const internalRef = useRef(null);
|
|
16
|
-
const linkRef =
|
|
17
|
-
|
|
18
|
+
const linkRef = forwardedRef || internalRef;
|
|
19
|
+
let resolvedLinkProps = restProps;
|
|
20
|
+
if (navigation.type === "router") {
|
|
21
|
+
resolvedLinkProps = {
|
|
22
|
+
...restProps,
|
|
23
|
+
href: navigation.ariaHref,
|
|
24
|
+
routerOptions: navigation.routerOptions
|
|
25
|
+
};
|
|
26
|
+
} else if (navigation.type === "native") {
|
|
27
|
+
resolvedLinkProps = {
|
|
28
|
+
...restProps,
|
|
29
|
+
href: navigation.ariaHref
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const { linkProps } = useLink(resolvedLinkProps, linkRef);
|
|
18
33
|
const { isFocusVisible, focusProps } = useFocusRing();
|
|
19
|
-
const
|
|
34
|
+
const fallbackHref = useResolvedHref(restProps.href);
|
|
35
|
+
const resolvedHref = navigation.type === "native" ? navigation.browserHref : fallbackHref;
|
|
20
36
|
const handleClick = (e) => {
|
|
21
37
|
linkProps.onClick?.(e);
|
|
22
38
|
const text = restProps["aria-label"] ?? getNodeText(children) ?? String(restProps.href ?? "");
|
|
23
39
|
analytics.captureEvent("click", text, {
|
|
24
40
|
attributes: { to: String(restProps.href ?? "") }
|
|
25
41
|
});
|
|
42
|
+
handleRouterLinkClick(e, navigation);
|
|
43
|
+
};
|
|
44
|
+
const { href: _href, ...interactionProps } = mergeProps(
|
|
45
|
+
linkProps,
|
|
46
|
+
focusProps
|
|
47
|
+
);
|
|
48
|
+
const {
|
|
49
|
+
href: _restHref,
|
|
50
|
+
routerOptions: _routerOptions,
|
|
51
|
+
...anchorProps
|
|
52
|
+
} = restProps;
|
|
53
|
+
const commonProps = {
|
|
54
|
+
...interactionProps,
|
|
55
|
+
...dataAttributes,
|
|
56
|
+
...anchorProps,
|
|
57
|
+
ref: linkRef,
|
|
58
|
+
title,
|
|
59
|
+
className: classes.root,
|
|
60
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
61
|
+
onClick: handleClick,
|
|
62
|
+
children
|
|
26
63
|
};
|
|
64
|
+
if (navigation.type === "router") {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
navigation.Link,
|
|
67
|
+
{
|
|
68
|
+
...commonProps,
|
|
69
|
+
...navigation.routerLinkOptions,
|
|
70
|
+
to: navigation.to
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return /* @__PURE__ */ jsx("a", { ...commonProps, href: resolvedHref });
|
|
75
|
+
}
|
|
76
|
+
const Link = forwardRef((props, ref) => {
|
|
77
|
+
const definitionResult = useDefinition(LinkDefinition, props);
|
|
78
|
+
const Navigation = definitionResult.navigation;
|
|
27
79
|
return /* @__PURE__ */ jsx(
|
|
28
|
-
|
|
80
|
+
Navigation,
|
|
29
81
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
href: resolvedHref,
|
|
34
|
-
ref: linkRef,
|
|
35
|
-
title,
|
|
36
|
-
className: classes.root,
|
|
37
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
38
|
-
onClick: handleClick,
|
|
39
|
-
children
|
|
82
|
+
props: definitionResult.restProps,
|
|
83
|
+
view: LinkView,
|
|
84
|
+
viewProps: { definitionResult, forwardedRef: ref }
|
|
40
85
|
}
|
|
41
86
|
);
|
|
42
87
|
});
|
|
43
|
-
LinkInternal.displayName = "LinkInternal";
|
|
44
|
-
const Link = forwardRef((props, ref) => {
|
|
45
|
-
return /* @__PURE__ */ jsx(LinkInternal, { ...props, ref });
|
|
46
|
-
});
|
|
47
88
|
Link.displayName = "Link";
|
|
48
89
|
|
|
49
90
|
export { Link };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.esm.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useRef } from 'react';\nimport { mergeProps, useFocusRing, useLink } from 'react-aria';\nimport type { LinkProps } from './types';\nimport {
|
|
1
|
+
{"version":3,"file":"Link.esm.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useRef } from 'react';\nimport { mergeProps, useFocusRing, useLink } from 'react-aria';\nimport type { LinkProps } from './types';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport { useResolvedHref } from '../../hooks/useResolvedHref';\nimport { LinkDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport {\n handleRouterLinkClick,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype LinkViewProps = {\n definitionResult: UseDefinitionResult<typeof LinkDefinition, LinkProps>;\n navigation: AnchorNavigation;\n forwardedRef: React.ForwardedRef<HTMLAnchorElement>;\n};\n\nfunction LinkView({\n definitionResult,\n navigation,\n forwardedRef,\n}: LinkViewProps) {\n const { ownProps, restProps, dataAttributes, analytics } = definitionResult;\n const { classes, title, children } = ownProps;\n\n const internalRef = useRef<HTMLAnchorElement>(null);\n const linkRef = (forwardedRef ||\n internalRef) as React.RefObject<HTMLAnchorElement>;\n\n let resolvedLinkProps = restProps;\n if (navigation.type === 'router') {\n resolvedLinkProps = {\n ...restProps,\n href: navigation.ariaHref,\n routerOptions: navigation.routerOptions,\n };\n } else if (navigation.type === 'native') {\n resolvedLinkProps = {\n ...restProps,\n href: navigation.ariaHref,\n };\n }\n // React Aria Components' Link filters out the native title attribute.\n // Render the anchor explicitly so truncated links retain their browser tooltip.\n const { linkProps } = useLink(resolvedLinkProps, linkRef);\n const { isFocusVisible, focusProps } = useFocusRing();\n const fallbackHref = useResolvedHref(restProps.href);\n const resolvedHref =\n navigation.type === 'native' ? navigation.browserHref : fallbackHref;\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n const text =\n restProps['aria-label'] ??\n getNodeText(children) ??\n String(restProps.href ?? '');\n analytics.captureEvent('click', text, {\n attributes: { to: String(restProps.href ?? '') },\n });\n handleRouterLinkClick(e, navigation);\n };\n\n const { href: _href, ...interactionProps } = mergeProps(\n linkProps,\n focusProps,\n ) as React.AnchorHTMLAttributes<HTMLAnchorElement>;\n const {\n href: _restHref,\n routerOptions: _routerOptions,\n ...anchorProps\n } = restProps;\n const commonProps = {\n ...interactionProps,\n ...dataAttributes,\n ...(anchorProps as React.AnchorHTMLAttributes<HTMLAnchorElement>),\n ref: linkRef,\n title,\n className: classes.root,\n 'data-focus-visible': isFocusVisible || undefined,\n onClick: handleClick,\n children,\n };\n\n if (navigation.type === 'router') {\n return (\n <navigation.Link\n {...commonProps}\n {...navigation.routerLinkOptions}\n to={navigation.to}\n />\n );\n }\n\n return <a {...commonProps} href={resolvedHref} />;\n}\n\n/**\n * A styled anchor element that supports analytics event tracking on click.\n *\n * @public\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const definitionResult = useDefinition(LinkDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={LinkView}\n viewProps={{ definitionResult, forwardedRef: ref }}\n />\n );\n});\n\nLink.displayName = 'Link';\n"],"names":[],"mappings":";;;;;;;;;AAqCA,SAAS,QAAA,CAAS;AAAA,EAChB,gBAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,gBAAA;AAC3D,EAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,QAAA,EAAS,GAAI,QAAA;AAErC,EAAA,MAAM,WAAA,GAAc,OAA0B,IAAI,CAAA;AAClD,EAAA,MAAM,UAAW,YAAA,IACf,WAAA;AAEF,EAAA,IAAI,iBAAA,GAAoB,SAAA;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../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 './Link.module.css.esm.js';
|
|
10
12
|
|
|
@@ -14,6 +16,7 @@ const LinkDefinition = defineComponent()({
|
|
|
14
16
|
root: "bui-Link"
|
|
15
17
|
},
|
|
16
18
|
analytics: true,
|
|
19
|
+
navigation: { type: "anchor" },
|
|
17
20
|
propDefs: {
|
|
18
21
|
noTrack: {},
|
|
19
22
|
variant: { dataAttribute: true, default: "body-medium" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Link/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 { LinkOwnProps } from './types';\nimport styles from './Link.module.css';\n\n/**\n * Component definition for Link\n * @public\n */\nexport const LinkDefinition = defineComponent<LinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Link',\n },\n analytics: true,\n propDefs: {\n noTrack: {},\n variant: { dataAttribute: true, default: 'body-medium' },\n weight: { dataAttribute: true, default: 'regular' },\n color: { dataAttribute: true, default: 'primary' },\n truncate: { dataAttribute: true },\n standalone: { dataAttribute: true },\n title: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Link/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 { LinkOwnProps } from './types';\nimport styles from './Link.module.css';\n\n/**\n * Component definition for Link\n * @public\n */\nexport const LinkDefinition = defineComponent<LinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Link',\n },\n analytics: true,\n navigation: { type: 'anchor' },\n propDefs: {\n noTrack: {},\n variant: { dataAttribute: true, default: 'body-medium' },\n weight: { dataAttribute: true, default: 'regular' },\n color: { dataAttribute: true, default: 'primary' },\n truncate: { dataAttribute: true },\n standalone: { dataAttribute: true },\n title: {},\n children: {},\n className: {},\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,SAAA,EAAW,IAAA;AAAA,EACX,UAAA,EAAY,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,aAAA,EAAc;AAAA,IACvD,MAAA,EAAQ,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IAClD,KAAA,EAAO,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACjD,QAAA,EAAU,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAChC,UAAA,EAAY,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAClC,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -8,6 +8,7 @@ import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
|
|
|
8
8
|
import '../ButtonIcon/ButtonIcon.module.css.esm.js';
|
|
9
9
|
import { MenuTrigger, Menu } from '../Menu/Menu.esm.js';
|
|
10
10
|
import '../Menu/definition.esm.js';
|
|
11
|
+
import { BUIRoutingProvider } from '../../navigation/BUIRoutingProvider.esm.js';
|
|
11
12
|
|
|
12
13
|
const List = (props) => {
|
|
13
14
|
const { ownProps, restProps, dataAttributes } = useDefinition(
|
|
@@ -15,7 +16,7 @@ const List = (props) => {
|
|
|
15
16
|
props
|
|
16
17
|
);
|
|
17
18
|
const { classes, items, children, renderEmptyState } = ownProps;
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
+
return /* @__PURE__ */ jsx(BUIRoutingProvider, { children: /* @__PURE__ */ jsx(
|
|
19
20
|
GridList,
|
|
20
21
|
{
|
|
21
22
|
className: classes.root,
|
|
@@ -25,7 +26,7 @@ const List = (props) => {
|
|
|
25
26
|
...restProps,
|
|
26
27
|
children
|
|
27
28
|
}
|
|
28
|
-
);
|
|
29
|
+
) });
|
|
29
30
|
};
|
|
30
31
|
const ListRow = (props) => {
|
|
31
32
|
const { ownProps, restProps, dataAttributes } = useDefinition(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.esm.js","sources":["../../../src/components/List/List.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 GridList as RAGridList,\n GridListItem as RAGridListItem,\n Text,\n} from 'react-aria-components';\nimport { RiCheckLine, RiMoreLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ListDefinition, ListRowDefinition } from './definition';\nimport type { ListProps, ListRowProps } from './types';\nimport { Box } from '../Box/Box';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { MenuTrigger, Menu } from '../Menu';\n\n/**\n * A list displays a list of interactive rows with support for keyboard\n * navigation, single or multiple selection, and row actions.\n *\n * @public\n */\nexport const List = <T extends object>(props: ListProps<T>) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ListDefinition,\n props,\n );\n const { classes, items, children, renderEmptyState } = ownProps;\n\n return (\n <RAGridList\n
|
|
1
|
+
{"version":3,"file":"List.esm.js","sources":["../../../src/components/List/List.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 GridList as RAGridList,\n GridListItem as RAGridListItem,\n Text,\n} from 'react-aria-components';\nimport { RiCheckLine, RiMoreLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ListDefinition, ListRowDefinition } from './definition';\nimport type { ListProps, ListRowProps } from './types';\nimport { Box } from '../Box/Box';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { MenuTrigger, Menu } from '../Menu';\nimport { BUIRoutingProvider } from '../../navigation/BUIRoutingProvider';\n\n/**\n * A list displays a list of interactive rows with support for keyboard\n * navigation, single or multiple selection, and row actions.\n *\n * @public\n */\nexport const List = <T extends object>(props: ListProps<T>) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ListDefinition,\n props,\n );\n const { classes, items, children, renderEmptyState } = ownProps;\n\n return (\n <BUIRoutingProvider>\n <RAGridList\n className={classes.root}\n items={items}\n renderEmptyState={renderEmptyState}\n {...dataAttributes}\n {...restProps}\n >\n {children}\n </RAGridList>\n </BUIRoutingProvider>\n );\n};\n\n/**\n * A row within a List.\n *\n * @public\n */\nexport const ListRow = (props: ListRowProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ListRowDefinition,\n props,\n );\n const { classes, children, description, icon, menuItems, customActions } =\n ownProps;\n\n const textValue = typeof children === 'string' ? children : undefined;\n\n return (\n <RAGridListItem\n textValue={textValue}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {({ isSelected }) => (\n <>\n {isSelected && (\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n )}\n {icon && (\n <Box bg=\"neutral\" className={classes.icon}>\n {icon}\n </Box>\n )}\n <div className={classes.label}>\n <span>{children}</span>\n {description && (\n <Text slot=\"description\" className={classes.description}>\n {description}\n </Text>\n )}\n </div>\n {customActions && (\n <div className={classes.actions}>{customActions}</div>\n )}\n {menuItems && (\n <div className={classes.actions}>\n <MenuTrigger>\n <ButtonIcon\n icon={<RiMoreLine />}\n size=\"small\"\n aria-label=\"More actions\"\n variant=\"tertiary\"\n />\n <Menu placement=\"bottom end\">{menuItems}</Menu>\n </MenuTrigger>\n </div>\n )}\n </>\n )}\n </RAGridListItem>\n );\n};\n"],"names":["RAGridList","RAGridListItem"],"mappings":";;;;;;;;;;;;AAoCO,MAAM,IAAA,GAAO,CAAmB,KAAA,KAAwB;AAC7D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AA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AI,SAAA,EAAW,OAAA,CAAQ,KAAA,EACtB,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,UAAM,QAAA,EAAS,CAAA;AAAA,UACf,WAAA,wBACE,IAAA,EAAA,EAAK,IAAA,EAAK,eAAc,SAAA,EAAW,OAAA,CAAQ,aACzC,QAAA,EAAA,WAAA,EACH;AAAA,SAAA,EAEJ,CAAA;AAAA,QACC,iCACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAU,QAAA,EAAA,aAAA,EAAc,CAAA;AAAA,QAEjD,6BACC,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,OAAA,CAAQ,OAAA,EACtB,+BAAC,WAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,IAAA,sBAAO,UAAA,EAAA,EAAW,CAAA;AAAA,cAClB,IAAA,EAAK,OAAA;AAAA,cACL,YAAA,EAAW,cAAA;AAAA,cACX,OAAA,EAAQ;AAAA;AAAA,WACV;AAAA,0BACA,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAU,YAAA,EAAc,QAAA,EAAA,SAAA,EAAU;AAAA,SAAA,EAC1C,CAAA,EACF;AAAA,OAAA,EAEJ;AAAA;AAAA,GAEJ;AAEJ;;;;"}
|
|
@@ -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 .List_bui-
|
|
4
|
-
var styles = {"bui-List":"List_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 .List_bui-List__d81bf3f80c {\n box-sizing: border-box;\n outline: none;\n display: flex;\n flex-direction: column;\n\n gap: var(--bui-space-3);\n\n &:has([data-selection-mode]) {\n gap: 0;\n }\n\n &[data-focus-visible] {\n outline: none;\n }\n }\n\n .List_bui-ListRow__d81bf3f80c {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--bui-space-3);\n border-radius: var(--bui-radius-2);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n line-height: 1.15;\n color: var(--bui-fg-primary);\n outline: none;\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-focus-visible] {\n outline: 2px solid var(--bui-ring);\n }\n\n &[data-selection-mode] {\n cursor: pointer;\n padding-block: var(--bui-space-2);\n padding-inline: var(--bui-space-2);\n\n &[data-selected] {\n &:has(+ [data-selected]) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n + [data-selected] {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n }\n\n &[data-hovered],\n &[data-focus-visible] {\n background-color: var(--bui-bg-neutral-1-hover);\n }\n\n &[data-pressed],\n &[data-selected],\n &[data-selected][data-hovered],\n &[data-selected][data-focus-visible],\n &[data-selected][data-pressed] {\n background-color: var(--bui-bg-neutral-1-pressed);\n }\n\n &[data-on-bg='neutral-1'] {\n &[data-hovered],\n &[data-focus-visible] {\n background-color: var(--bui-bg-neutral-2-hover);\n }\n\n &[data-pressed],\n &[data-selected],\n &[data-selected][data-hovered],\n &[data-selected][data-focus-visible],\n &[data-selected][data-pressed] {\n background-color: var(--bui-bg-neutral-2-pressed);\n }\n }\n\n &[data-on-bg='neutral-2'] {\n &[data-hovered],\n &[data-focus-visible] {\n background-color: var(--bui-bg-neutral-3-hover);\n }\n\n &[data-pressed],\n &[data-selected],\n &[data-selected][data-hovered],\n &[data-selected][data-focus-visible],\n &[data-selected][data-pressed] {\n background-color: var(--bui-bg-neutral-3-pressed);\n }\n }\n\n &[data-on-bg='neutral-3'],\n &[data-on-bg='neutral-4'] {\n &[data-hovered],\n &[data-focus-visible] {\n background-color: var(--bui-bg-neutral-4-hover);\n }\n\n &[data-pressed],\n &[data-selected],\n &[data-selected][data-hovered],\n &[data-selected][data-focus-visible],\n &[data-selected][data-pressed] {\n background-color: var(--bui-bg-neutral-4-pressed);\n }\n }\n }\n }\n\n .List_bui-ListRowCheck__d81bf3f80c {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .List_bui-ListRowIcon__d81bf3f80c {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 2rem;\n height: 2rem;\n color: var(--bui-fg-secondary);\n border-radius: var(--bui-radius-2);\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .List_bui-ListRowLabel__d81bf3f80c {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-1);\n min-width: 0;\n overflow: hidden;\n\n & > * {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n\n .List_bui-ListRowDescription__d81bf3f80c {\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n .List_bui-ListRowActions__d81bf3f80c {\n display: flex;\n align-items: center;\n gap: var(--bui-space-1);\n flex-shrink: 0;\n margin-left: auto;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-List":"List_bui-List__d81bf3f80c","bui-ListRow":"List_bui-ListRow__d81bf3f80c","bui-ListRowCheck":"List_bui-ListRowCheck__d81bf3f80c","bui-ListRowIcon":"List_bui-ListRowIcon__d81bf3f80c","bui-ListRowLabel":"List_bui-ListRowLabel__d81bf3f80c","bui-ListRowDescription":"List_bui-ListRowDescription__d81bf3f80c","bui-ListRowActions":"List_bui-ListRowActions__d81bf3f80c"};
|
|
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 './List.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/List/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 { ListOwnProps, ListRowOwnProps } from './types';\nimport styles from './List.module.css';\n\n/**\n * Component definition for List\n * @public\n */\nexport const ListDefinition = defineComponent<ListOwnProps>()({\n styles,\n classNames: {\n root: 'bui-List',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/**\n * Component definition for ListRow\n * @public\n */\nexport const ListRowDefinition = defineComponent<ListRowOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-ListRow',\n check: 'bui-ListRowCheck',\n icon: 'bui-ListRowIcon',\n label: 'bui-ListRowLabel',\n description: 'bui-ListRowDescription',\n actions: 'bui-ListRowActions',\n },\n propDefs: {\n children: {},\n description: {},\n icon: {},\n menuItems: {},\n customActions: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/List/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 { ListOwnProps, ListRowOwnProps } from './types';\nimport styles from './List.module.css';\n\n/**\n * Component definition for List\n * @public\n */\nexport const ListDefinition = defineComponent<ListOwnProps>()({\n styles,\n classNames: {\n root: 'bui-List',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/**\n * Component definition for ListRow\n * @public\n */\nexport const ListRowDefinition = defineComponent<ListRowOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-ListRow',\n check: 'bui-ListRowCheck',\n icon: 'bui-ListRowIcon',\n label: 'bui-ListRowLabel',\n description: 'bui-ListRowDescription',\n actions: 'bui-ListRowActions',\n },\n propDefs: {\n children: {},\n description: {},\n icon: {},\n menuItems: {},\n customActions: {},\n className: {},\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,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,kBAAkB,EAAC;AAAA,IACnB,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,WAAA,EAAa,wBAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,aAAa,EAAC;AAAA,IACd,MAAM,EAAC;AAAA,IACP,WAAW,EAAC;AAAA,IACZ,eAAe,EAAC;AAAA,IAChB,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Menu as Menu$1, Popover, Virtualizer, ListLayout, useFilter, Autocomplete, SearchField, Input, Button, ListBox,
|
|
2
|
+
import { Menu as Menu$1, Popover, Virtualizer, ListLayout, useFilter, Autocomplete, SearchField, Input, Button, ListBox, MenuSection as MenuSection$1, Header, Separator, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, MenuItem as MenuItem$1, ListBoxItem } from 'react-aria-components';
|
|
3
3
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
4
4
|
import { MenuDefinition, MenuAutocompleteDefinition, MenuAutocompleteListboxDefinition, MenuItemDefinition, MenuListBoxDefinition, MenuListBoxItemDefinition, MenuSectionDefinition, MenuSeparatorDefinition, MenuEmptyStateDefinition } from './definition.esm.js';
|
|
5
5
|
import { RiCloseCircleLine, RiArrowRightSLine, RiCheckLine } from '@remixicon/react';
|
|
@@ -8,6 +8,7 @@ import { getNodeText } from '../../analytics/getNodeText.esm.js';
|
|
|
8
8
|
import { Box } from '../Box/Box.esm.js';
|
|
9
9
|
import '../Box/Box.module.css.esm.js';
|
|
10
10
|
import { BgReset } from '../../hooks/useBg.esm.js';
|
|
11
|
+
import { getReactAriaAnchorProps } from '../../navigation/useNavigation.esm.js';
|
|
11
12
|
|
|
12
13
|
const rowHeight = 32;
|
|
13
14
|
const MenuEmptyState = () => {
|
|
@@ -188,23 +189,27 @@ const MenuAutocompleteListbox = (props) => {
|
|
|
188
189
|
) : listBoxContent
|
|
189
190
|
] }) }) }) });
|
|
190
191
|
};
|
|
191
|
-
const
|
|
192
|
-
const { ownProps, restProps, dataAttributes, analytics } =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
);
|
|
196
|
-
const { classes, iconStart, children, href } = ownProps;
|
|
192
|
+
const MenuItemView = ({ definitionResult, navigation }) => {
|
|
193
|
+
const { ownProps, restProps, dataAttributes, analytics } = definitionResult;
|
|
194
|
+
const { classes, iconStart, children } = ownProps;
|
|
195
|
+
const { href } = ownProps;
|
|
197
196
|
const isExternal = href && !isInternalLink(href);
|
|
197
|
+
const target = restProps.target ?? (isExternal ? "_blank" : void 0);
|
|
198
|
+
const rel = restProps.rel ?? (isExternal ? "noopener noreferrer" : void 0);
|
|
199
|
+
const navigationProps = getReactAriaAnchorProps(navigation, {
|
|
200
|
+
href,
|
|
201
|
+
routerOptions: restProps.routerOptions
|
|
202
|
+
});
|
|
198
203
|
return /* @__PURE__ */ jsxs(
|
|
199
204
|
MenuItem$1,
|
|
200
205
|
{
|
|
201
206
|
className: classes.root,
|
|
202
207
|
...dataAttributes,
|
|
203
|
-
href,
|
|
204
|
-
target: isExternal ? "_blank" : void 0,
|
|
205
|
-
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
206
208
|
textValue: typeof children === "string" ? children : void 0,
|
|
207
209
|
...restProps,
|
|
210
|
+
...navigationProps,
|
|
211
|
+
target,
|
|
212
|
+
rel,
|
|
208
213
|
onAction: () => {
|
|
209
214
|
restProps.onAction?.();
|
|
210
215
|
if (href) {
|
|
@@ -224,18 +229,35 @@ const MenuItem = (props) => {
|
|
|
224
229
|
}
|
|
225
230
|
);
|
|
226
231
|
};
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
const MenuItem = (props) => {
|
|
233
|
+
const definitionResult = useDefinition(MenuItemDefinition, props);
|
|
234
|
+
const Navigation = definitionResult.navigation;
|
|
235
|
+
return /* @__PURE__ */ jsx(
|
|
236
|
+
Navigation,
|
|
237
|
+
{
|
|
238
|
+
props: {
|
|
239
|
+
...definitionResult.restProps,
|
|
240
|
+
href: definitionResult.ownProps.href
|
|
241
|
+
},
|
|
242
|
+
view: MenuItemView,
|
|
243
|
+
viewProps: { definitionResult }
|
|
244
|
+
}
|
|
231
245
|
);
|
|
246
|
+
};
|
|
247
|
+
const MenuListBoxItemView = ({
|
|
248
|
+
definitionResult,
|
|
249
|
+
navigation
|
|
250
|
+
}) => {
|
|
251
|
+
const { ownProps, restProps } = definitionResult;
|
|
232
252
|
const { classes, children } = ownProps;
|
|
253
|
+
const navigationProps = getReactAriaAnchorProps(navigation, restProps);
|
|
233
254
|
return /* @__PURE__ */ jsx(
|
|
234
255
|
ListBoxItem,
|
|
235
256
|
{
|
|
236
257
|
textValue: typeof children === "string" ? children : void 0,
|
|
237
258
|
className: classes.root,
|
|
238
259
|
...restProps,
|
|
260
|
+
...navigationProps,
|
|
239
261
|
children: /* @__PURE__ */ jsxs("div", { className: classes.itemContent, children: [
|
|
240
262
|
/* @__PURE__ */ jsx("div", { className: classes.check, children: /* @__PURE__ */ jsx(RiCheckLine, {}) }),
|
|
241
263
|
children
|
|
@@ -243,6 +265,18 @@ const MenuListBoxItem = (props) => {
|
|
|
243
265
|
}
|
|
244
266
|
);
|
|
245
267
|
};
|
|
268
|
+
const MenuListBoxItem = (props) => {
|
|
269
|
+
const definitionResult = useDefinition(MenuListBoxItemDefinition, props);
|
|
270
|
+
const Navigation = definitionResult.navigation;
|
|
271
|
+
return /* @__PURE__ */ jsx(
|
|
272
|
+
Navigation,
|
|
273
|
+
{
|
|
274
|
+
props: definitionResult.restProps,
|
|
275
|
+
view: MenuListBoxItemView,
|
|
276
|
+
viewProps: { definitionResult }
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
246
280
|
const MenuSection = (props) => {
|
|
247
281
|
const { ownProps, restProps } = useDefinition(MenuSectionDefinition, props);
|
|
248
282
|
const { classes, children, title } = ownProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.esm.js","sources":["../../../src/components/Menu/Menu.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 MenuTrigger as RAMenuTrigger,\n Popover as RAPopover,\n MenuItem as RAMenuItem,\n Menu as RAMenu,\n MenuSection as RAMenuSection,\n Header as RAMenuHeader,\n Separator as RAMenuSeparator,\n SubmenuTrigger as RAMenuSubmenuTrigger,\n Autocomplete as RAAutocomplete,\n SearchField as RASearchField,\n Input as RAInput,\n Button as RAButton,\n ListBox as RAListBox,\n ListBoxItem as RAListBoxItem,\n useFilter,\n Virtualizer,\n ListLayout,\n} from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n MenuDefinition,\n MenuListBoxDefinition,\n MenuAutocompleteDefinition,\n MenuAutocompleteListboxDefinition,\n MenuItemDefinition,\n MenuListBoxItemDefinition,\n MenuSectionDefinition,\n MenuSeparatorDefinition,\n MenuEmptyStateDefinition,\n} from './definition';\nimport type {\n MenuTriggerProps,\n SubmenuTriggerProps,\n MenuProps,\n MenuAutocompleteProps,\n MenuItemProps,\n MenuSectionProps,\n MenuSeparatorProps,\n MenuListBoxProps,\n MenuListBoxItemProps,\n MenuAutocompleteListBoxProps,\n} from './types';\nimport {\n RiArrowRightSLine,\n RiCheckLine,\n RiCloseCircleLine,\n} from '@remixicon/react';\nimport { isInternalLink } from '../../utils/linkUtils';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n// The height will be used for virtualized menus. It should match the size set in CSS for each menu item.\nconst rowHeight = 32;\n\nconst MenuEmptyState = () => {\n const { ownProps } = useDefinition(MenuEmptyStateDefinition, {});\n\n return <div className={ownProps.classes.root}>No results found.</div>;\n};\n\n/**\n * A wrapper that connects a trigger element to a dropdown menu, controlling its open and close state.\n *\n * @public\n */\nexport const MenuTrigger = (props: MenuTriggerProps) => {\n return <RAMenuTrigger {...props} />;\n};\n\n/** @public */\nexport const SubmenuTrigger = (props: SubmenuTriggerProps) => {\n return <RAMenuSubmenuTrigger {...props} />;\n};\n\n/** @public */\nexport const Menu = (props: MenuProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuDefinition, props);\n const { classes, placement, virtualized, maxWidth, maxHeight, style } =\n ownProps;\n\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuListBox = (props: MenuListBoxProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuListBoxDefinition, props);\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n } = ownProps;\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocomplete = (props: MenuAutocompleteProps<object>) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteDefinition,\n props,\n );\n const {\n classes,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocompleteListbox = (\n props: MenuAutocompleteListBoxProps<object>,\n) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteListboxDefinition,\n props,\n );\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuItem = (props: MenuItemProps) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n MenuItemDefinition,\n props,\n );\n const { classes, iconStart, children, href } = ownProps;\n\n const isExternal = href && !isInternalLink(href);\n\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n href={href}\n target={isExternal ? '_blank' : undefined}\n rel={isExternal ? 'noopener noreferrer' : undefined}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n onAction={() => {\n restProps.onAction?.();\n if (href) {\n const text =\n restProps['aria-label'] ?? getNodeText(children) ?? String(href);\n analytics.captureEvent('click', text, {\n attributes: { to: String(href) },\n });\n }\n }}\n >\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\n </RAMenuItem>\n );\n};\n\n/** @public */\nexport const MenuListBoxItem = (props: MenuListBoxItemProps) => {\n const { ownProps, restProps } = useDefinition(\n MenuListBoxItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <RAListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n {children}\n </div>\n </RAListBoxItem>\n );\n};\n\n/** @public */\nexport const MenuSection = (props: MenuSectionProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuSectionDefinition, props);\n const { classes, children, title } = ownProps;\n\n return (\n <RAMenuSection className={classes.root} {...restProps}>\n <RAMenuHeader className={classes.header}>{title}</RAMenuHeader>\n {children}\n </RAMenuSection>\n );\n};\n\n/** @public */\nexport const MenuSeparator = (props: MenuSeparatorProps) => {\n const { ownProps, restProps } = useDefinition(MenuSeparatorDefinition, props);\n\n return <RAMenuSeparator className={ownProps.classes.root} {...restProps} />;\n};\n"],"names":["RAMenuTrigger","RAMenuSubmenuTrigger","RAMenu","RAPopover","RAListBox","RAAutocomplete","RASearchField","RAInput","RAButton","RAMenuItem","RAListBoxItem","RAMenuSection","RAMenuHeader","RAMenuSeparator"],"mappings":";;;;;;;;;;;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Q,IAAA,EAAO,GAAG,SAAA,EAAW,CAAA;AAC3E;;;;"}
|
|
1
|
+
{"version":3,"file":"Menu.esm.js","sources":["../../../src/components/Menu/Menu.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 MenuTrigger as RAMenuTrigger,\n Popover as RAPopover,\n MenuItem as RAMenuItem,\n Menu as RAMenu,\n MenuSection as RAMenuSection,\n Header as RAMenuHeader,\n Separator as RAMenuSeparator,\n SubmenuTrigger as RAMenuSubmenuTrigger,\n Autocomplete as RAAutocomplete,\n SearchField as RASearchField,\n Input as RAInput,\n Button as RAButton,\n ListBox as RAListBox,\n ListBoxItem as RAListBoxItem,\n useFilter,\n Virtualizer,\n ListLayout,\n} from 'react-aria-components';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n MenuDefinition,\n MenuListBoxDefinition,\n MenuAutocompleteDefinition,\n MenuAutocompleteListboxDefinition,\n MenuItemDefinition,\n MenuListBoxItemDefinition,\n MenuSectionDefinition,\n MenuSeparatorDefinition,\n MenuEmptyStateDefinition,\n} from './definition';\nimport type {\n MenuTriggerProps,\n SubmenuTriggerProps,\n MenuProps,\n MenuAutocompleteProps,\n MenuItemProps,\n MenuSectionProps,\n MenuSeparatorProps,\n MenuListBoxProps,\n MenuListBoxItemProps,\n MenuAutocompleteListBoxProps,\n} from './types';\nimport {\n RiArrowRightSLine,\n RiCheckLine,\n RiCloseCircleLine,\n} from '@remixicon/react';\nimport { isInternalLink } from '../../utils/linkUtils';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\n// The height will be used for virtualized menus. It should match the size set in CSS for each menu item.\nconst rowHeight = 32;\n\nconst MenuEmptyState = () => {\n const { ownProps } = useDefinition(MenuEmptyStateDefinition, {});\n\n return <div className={ownProps.classes.root}>No results found.</div>;\n};\n\n/**\n * A wrapper that connects a trigger element to a dropdown menu, controlling its open and close state.\n *\n * @public\n */\nexport const MenuTrigger = (props: MenuTriggerProps) => {\n return <RAMenuTrigger {...props} />;\n};\n\n/** @public */\nexport const SubmenuTrigger = (props: SubmenuTriggerProps) => {\n return <RAMenuSubmenuTrigger {...props} />;\n};\n\n/** @public */\nexport const Menu = (props: MenuProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuDefinition, props);\n const { classes, placement, virtualized, maxWidth, maxHeight, style } =\n ownProps;\n\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuListBox = (props: MenuListBoxProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuListBoxDefinition, props);\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n } = ownProps;\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocomplete = (props: MenuAutocompleteProps<object>) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteDefinition,\n props,\n );\n const {\n classes,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocompleteListbox = (\n props: MenuAutocompleteListBoxProps<object>,\n) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteListboxDefinition,\n props,\n );\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\ntype MenuItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof MenuItemDefinition,\n MenuItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nconst MenuItemView = ({ definitionResult, navigation }: MenuItemViewProps) => {\n const { ownProps, restProps, dataAttributes, analytics } = definitionResult;\n const { classes, iconStart, children } = ownProps;\n const { href } = ownProps;\n\n const isExternal = href && !isInternalLink(href);\n const target = restProps.target ?? (isExternal ? '_blank' : undefined);\n const rel = restProps.rel ?? (isExternal ? 'noopener noreferrer' : undefined);\n const navigationProps = getReactAriaAnchorProps(navigation, {\n href,\n routerOptions: restProps.routerOptions,\n });\n\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n {...navigationProps}\n target={target}\n rel={rel}\n onAction={() => {\n restProps.onAction?.();\n if (href) {\n const text =\n restProps['aria-label'] ?? getNodeText(children) ?? String(href);\n analytics.captureEvent('click', text, {\n attributes: { to: String(href) },\n });\n }\n }}\n >\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\n </RAMenuItem>\n );\n};\n\n/** @public */\nexport const MenuItem = (props: MenuItemProps) => {\n const definitionResult = useDefinition(MenuItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={{\n ...definitionResult.restProps,\n href: definitionResult.ownProps.href,\n }}\n view={MenuItemView}\n viewProps={{ definitionResult }}\n />\n );\n};\n\ntype MenuListBoxItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof MenuListBoxItemDefinition,\n MenuListBoxItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nconst MenuListBoxItemView = ({\n definitionResult,\n navigation,\n}: MenuListBoxItemViewProps) => {\n const { ownProps, restProps } = definitionResult;\n const { classes, children } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <RAListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n {...navigationProps}\n >\n <div className={classes.itemContent}>\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n {children}\n </div>\n </RAListBoxItem>\n );\n};\n\n/** @public */\nexport const MenuListBoxItem = (props: MenuListBoxItemProps) => {\n const definitionResult = useDefinition(MenuListBoxItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={MenuListBoxItemView}\n viewProps={{ definitionResult }}\n />\n );\n};\n\n/** @public */\nexport const MenuSection = (props: MenuSectionProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuSectionDefinition, props);\n const { classes, children, title } = ownProps;\n\n return (\n <RAMenuSection className={classes.root} {...restProps}>\n <RAMenuHeader className={classes.header}>{title}</RAMenuHeader>\n {children}\n </RAMenuSection>\n );\n};\n\n/** @public */\nexport const MenuSeparator = (props: MenuSeparatorProps) => {\n const { ownProps, restProps } = useDefinition(MenuSeparatorDefinition, props);\n\n return <RAMenuSeparator className={ownProps.classes.root} {...restProps} />;\n};\n"],"names":["RAMenuTrigger","RAMenuSubmenuTrigger","RAMenu","RAPopover","RAListBox","RAAutocomplete","RASearchField","RAInput","RAButton","RAMenuItem","RAListBoxItem","RAMenuSection","RAMenuHeader","RAMenuSeparator"],"mappings":";;;;;;;;;;;;AA6EA,MAAM,SAAA,GAAY,EAAA;AAElB,MAAM,iBAAiB,MAAM;AAC3B,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAA,EAA0B,EAAE,CAAA;AAE/D,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,MAAM,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACjE,CAAA;AAOO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,uBAAO,GAAA,CAACA,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACnC;AAGO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA+B;AAC5D,EAAA,uBAAO,GAAA,CAACC,gBAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAGO,MAAM,IAAA,GAAO,CAAC,KAAA,KAA6B;AAChD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,gBAAgB,KAAK,CAAA;AACnE,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,QAAA,EAAU,SAAA,EAAW,OAAM,GAClE,QAAA;AAEF,EAAA,IAAI,WAAA,GAAc,QAAA,KAAa,WAAA,GAAc,OAAA,GAAU,WAAA,CAAA;AAEvD,EAAA,MAAM,WAAA,mBACJ,GAAA;AAAA,IAACC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAA,CAAQ,OAAA;AAAA,MACnB,gBAAA,EAAkB,sBAAM,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA;AAAA,MACxC,OAAO,EAAE,KAAA,EAAO,WAAA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,yBAAyB,KAAK,CAAA;AAE5E,EAAA,2BAAQC,SAAA,EAAA,EAAgB,SAAA,EAAW,SAAS,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,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 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 .Menu_bui-
|
|
4
|
-
var styles = {"bui-MenuPopover":"Menu_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 .Menu_bui-MenuPopover__1069404df8 {\n --menu-border-radius: var(--bui-radius-2);\n display: flex;\n flex-direction: column;\n box-shadow: var(--bui-shadow);\n border: 1px solid var(--bui-border-1);\n border-radius: var(--menu-border-radius);\n background: var(--bui-bg-app);\n color: var(--bui-fg-primary);\n outline: none;\n transition: transform 200ms, opacity 200ms;\n /* Let React Aria handle height constraints naturally */\n min-height: 0;\n /* Remove overflow from popover since ScrollArea will handle it */\n overflow: hidden;\n\n &[data-entering],\n &[data-exiting] {\n transform: var(--origin);\n opacity: 0;\n }\n\n &[data-placement='top'] {\n --origin: translateY(8px);\n }\n\n &[data-placement='bottom'] {\n --origin: translateY(-8px);\n }\n\n &[data-placement='right'] {\n --origin: translateX(-8px);\n }\n\n &[data-placement='left'] {\n --origin: translateX(8px);\n }\n }\n\n .Menu_bui-MenuInner__1069404df8 {\n border-radius: var(--menu-border-radius);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .Menu_bui-MenuContent__1069404df8 {\n max-height: inherit;\n box-sizing: border-box;\n overflow: auto;\n min-width: 150px;\n outline: none;\n padding-block: var(--bui-space-1);\n }\n\n .Menu_bui-MenuItem__1069404df8 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 2rem;\n padding-inline: var(--bui-space-2);\n border-radius: var(--bui-radius-2);\n outline: none;\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n gap: var(--bui-space-6);\n cursor: pointer;\n margin-inline: var(--bui-space-1);\n\n &[data-focus-visible] {\n outline: 2px solid var(--bui-ring);\n outline-offset: -2px;\n }\n\n &[data-focused] {\n background: var(--bui-bg-neutral-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-open] {\n background: var(--bui-bg-neutral-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-color='danger'] {\n color: var(--bui-fg-danger);\n }\n\n &[data-color='danger'][data-focused] {\n background: var(--bui-bg-danger);\n color: var(--bui-fg-danger);\n }\n\n &[data-has-submenu] {\n & > .Menu_bui-MenuItemArrow__1069404df8 {\n display: block;\n }\n }\n }\n\n .Menu_bui-MenuItemListBox__1069404df8 {\n display: flex;\n align-items: center;\n height: 2rem;\n padding-inline: var(--bui-space-2);\n border-radius: var(--bui-radius-2);\n outline: none;\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n cursor: pointer;\n\n &[data-focus-visible] {\n outline: 2px solid var(--bui-ring);\n outline-offset: -2px;\n }\n\n &[data-hovered],\n &[data-focused] {\n background: var(--bui-bg-neutral-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-selected] .Menu_bui-MenuItemListBoxCheck__1069404df8 {\n & > svg {\n opacity: 1;\n color: var(--bui-fg-primary);\n }\n }\n }\n\n .Menu_bui-MenuItemListBoxCheck__1069404df8 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n\n & > svg {\n opacity: 0;\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu_bui-MenuItemContent__1069404df8 {\n display: flex;\n align-items: center;\n gap: var(--bui-space-2);\n\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu_bui-MenuItemArrow__1069404df8 {\n display: none;\n width: 1rem;\n height: 1rem;\n\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu_bui-MenuSection__1069404df8 {\n &:first-child .Menu_bui-MenuSectionHeader__1069404df8 {\n padding-top: 0;\n }\n }\n\n .Menu_bui-MenuSectionHeader__1069404df8 {\n height: 2rem;\n display: flex;\n align-items: center;\n padding-top: var(--bui-space-3);\n padding-left: var(--bui-space-3);\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-1);\n line-height: 1.15;\n font-weight: bold;\n letter-spacing: 0.05rem;\n text-transform: uppercase;\n }\n\n .Menu_bui-MenuSeparator__1069404df8 {\n height: 1px;\n background: var(--bui-border-1);\n margin-inline: var(--bui-space-1_5);\n margin-block: var(--bui-space-1);\n }\n\n .Menu_bui-MenuSearchField__1069404df8 {\n font-family: var(--bui-font-regular);\n width: 100%;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n border-bottom: 1px solid var(--bui-border-1);\n background-color: var(--bui-bg-neutral-1);\n height: 2rem;\n\n &[data-empty] {\n .Menu_bui-MenuSearchFieldClear__1069404df8 {\n visibility: hidden;\n }\n }\n }\n\n .Menu_bui-MenuSearchFieldInput__1069404df8 {\n flex: 1;\n display: flex;\n align-items: center;\n padding: 0;\n border: none;\n background-color: transparent;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n color: var(--bui-fg-primary);\n width: 100%;\n height: 100%;\n outline: none;\n cursor: inherit;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &:first-child {\n padding-inline: var(--bui-space-3) 0;\n }\n }\n\n .Menu_bui-MenuSearchFieldClear__1069404df8 {\n flex: 0 0 auto;\n display: grid;\n place-content: center;\n background-color: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n color: var(--bui-fg-secondary);\n transition: color 0.2s ease-in-out;\n width: 2rem;\n height: 2rem;\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu_bui-MenuEmptyState__1069404df8 {\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-2);\n color: var(--bui-fg-secondary);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-MenuPopover":"Menu_bui-MenuPopover__1069404df8","bui-MenuInner":"Menu_bui-MenuInner__1069404df8","bui-MenuContent":"Menu_bui-MenuContent__1069404df8","bui-MenuItem":"Menu_bui-MenuItem__1069404df8","bui-MenuItemArrow":"Menu_bui-MenuItemArrow__1069404df8","bui-MenuItemListBox":"Menu_bui-MenuItemListBox__1069404df8","bui-MenuItemListBoxCheck":"Menu_bui-MenuItemListBoxCheck__1069404df8","bui-MenuItemContent":"Menu_bui-MenuItemContent__1069404df8","bui-MenuSection":"Menu_bui-MenuSection__1069404df8","bui-MenuSectionHeader":"Menu_bui-MenuSectionHeader__1069404df8","bui-MenuSeparator":"Menu_bui-MenuSeparator__1069404df8","bui-MenuSearchField":"Menu_bui-MenuSearchField__1069404df8","bui-MenuSearchFieldClear":"Menu_bui-MenuSearchFieldClear__1069404df8","bui-MenuSearchFieldInput":"Menu_bui-MenuSearchFieldInput__1069404df8","bui-MenuEmptyState":"Menu_bui-MenuEmptyState__1069404df8"};
|
|
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 './Menu.module.css.esm.js';
|
|
10
12
|
|
|
@@ -65,6 +67,7 @@ const MenuItemDefinition = defineComponent()({
|
|
|
65
67
|
itemArrow: "bui-MenuItemArrow"
|
|
66
68
|
},
|
|
67
69
|
analytics: true,
|
|
70
|
+
navigation: { type: "anchor" },
|
|
68
71
|
propDefs: {
|
|
69
72
|
iconStart: {},
|
|
70
73
|
children: {},
|
|
@@ -81,6 +84,7 @@ const MenuListBoxItemDefinition = defineComponent()({
|
|
|
81
84
|
itemContent: "bui-MenuItemContent",
|
|
82
85
|
check: "bui-MenuItemListBoxCheck"
|
|
83
86
|
},
|
|
87
|
+
navigation: { type: "anchor" },
|
|
84
88
|
propDefs: {
|
|
85
89
|
children: {},
|
|
86
90
|
className: {}
|