@backstage/ui 0.13.0 → 0.14.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js +2 -2
- package/dist/components/Header/Header.esm.js +3 -13
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Header/HeaderNav.esm.js +163 -0
- package/dist/components/Header/HeaderNav.esm.js.map +1 -0
- package/dist/components/Header/HeaderNav.module.css.esm.js +8 -0
- package/dist/components/Header/HeaderNav.module.css.esm.js.map +1 -0
- package/dist/components/Header/HeaderNavDefinition.esm.js +47 -0
- package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -0
- package/dist/components/Header/HeaderNavIndicators.esm.js +92 -0
- package/dist/components/Header/HeaderNavIndicators.esm.js.map +1 -0
- package/dist/components/Header/definition.esm.js +1 -0
- package/dist/components/Header/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js +14 -37
- 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 +0 -2
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/PluginHeader/PluginHeader.esm.js +22 -15
- package/dist/components/PluginHeader/PluginHeader.esm.js.map +1 -1
- package/dist/components/PluginHeader/PluginHeader.module.css.esm.js +2 -2
- package/dist/components/PluginHeader/definition.esm.js +0 -1
- package/dist/components/PluginHeader/definition.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js +1 -1
- 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 +1 -0
- package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.esm.js +2 -2
- package/dist/index.d.ts +81 -6
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -6
|
@@ -194,56 +194,33 @@ const MenuItem = (props) => {
|
|
|
194
194
|
props
|
|
195
195
|
);
|
|
196
196
|
const { classes, iconStart, children, href } = ownProps;
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const text = restProps["aria-label"] ?? getNodeText(children) ?? String(href);
|
|
200
|
-
analytics.captureEvent("click", text, {
|
|
201
|
-
attributes: { to: String(href) }
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
if (href && !isInternalLink(href)) {
|
|
206
|
-
return /* @__PURE__ */ jsx(
|
|
207
|
-
MenuItem$1,
|
|
208
|
-
{
|
|
209
|
-
className: classes.root,
|
|
210
|
-
...dataAttributes,
|
|
211
|
-
textValue: typeof children === "string" ? children : void 0,
|
|
212
|
-
...restProps,
|
|
213
|
-
onAction: () => {
|
|
214
|
-
restProps.onAction?.();
|
|
215
|
-
handleAction();
|
|
216
|
-
window.open(href, "_blank", "noopener,noreferrer");
|
|
217
|
-
},
|
|
218
|
-
children: /* @__PURE__ */ jsxs("div", { className: classes.itemWrapper, children: [
|
|
219
|
-
/* @__PURE__ */ jsxs("div", { className: classes.itemContent, children: [
|
|
220
|
-
iconStart,
|
|
221
|
-
children
|
|
222
|
-
] }),
|
|
223
|
-
/* @__PURE__ */ jsx("div", { className: classes.itemArrow, children: /* @__PURE__ */ jsx(RiArrowRightSLine, {}) })
|
|
224
|
-
] })
|
|
225
|
-
}
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
return /* @__PURE__ */ jsx(
|
|
197
|
+
const isExternal = href && !isInternalLink(href);
|
|
198
|
+
return /* @__PURE__ */ jsxs(
|
|
229
199
|
MenuItem$1,
|
|
230
200
|
{
|
|
231
201
|
className: classes.root,
|
|
232
202
|
...dataAttributes,
|
|
233
203
|
href,
|
|
204
|
+
target: isExternal ? "_blank" : void 0,
|
|
205
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
234
206
|
textValue: typeof children === "string" ? children : void 0,
|
|
235
207
|
...restProps,
|
|
236
208
|
onAction: () => {
|
|
237
209
|
restProps.onAction?.();
|
|
238
|
-
|
|
210
|
+
if (href) {
|
|
211
|
+
const text = restProps["aria-label"] ?? getNodeText(children) ?? String(href);
|
|
212
|
+
analytics.captureEvent("click", text, {
|
|
213
|
+
attributes: { to: String(href) }
|
|
214
|
+
});
|
|
215
|
+
}
|
|
239
216
|
},
|
|
240
|
-
children:
|
|
217
|
+
children: [
|
|
241
218
|
/* @__PURE__ */ jsxs("div", { className: classes.itemContent, children: [
|
|
242
219
|
iconStart,
|
|
243
220
|
children
|
|
244
221
|
] }),
|
|
245
222
|
/* @__PURE__ */ jsx("div", { className: classes.itemArrow, children: /* @__PURE__ */ jsx(RiArrowRightSLine, {}) })
|
|
246
|
-
]
|
|
223
|
+
]
|
|
247
224
|
}
|
|
248
225
|
);
|
|
249
226
|
};
|
|
@@ -259,10 +236,10 @@ const MenuListBoxItem = (props) => {
|
|
|
259
236
|
textValue: typeof children === "string" ? children : void 0,
|
|
260
237
|
className: classes.root,
|
|
261
238
|
...restProps,
|
|
262
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ jsxs("div", { className: classes.itemContent, children: [
|
|
263
240
|
/* @__PURE__ */ jsx("div", { className: classes.check, children: /* @__PURE__ */ jsx(RiCheckLine, {}) }),
|
|
264
241
|
children
|
|
265
|
-
] })
|
|
242
|
+
] })
|
|
266
243
|
}
|
|
267
244
|
);
|
|
268
245
|
};
|
|
@@ -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/** @public */\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 handleAction = () => {\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 // External links open in new tab via window.open instead of client-side routing\n if (href && !isInternalLink(href)) {\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n onAction={() => {\n restProps.onAction?.();\n handleAction();\n window.open(href, '_blank', 'noopener,noreferrer');\n }}\n >\n <div className={classes.itemWrapper}>\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\n </div>\n </RAMenuItem>\n );\n }\n\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n href={href}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n onAction={() => {\n restProps.onAction?.();\n handleAction();\n }}\n >\n <div className={classes.itemWrapper}>\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\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.itemWrapper}>\n <div className={classes.itemContent}>\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n {children}\n </div>\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":";;;;;;;;;;;AAsEA,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;AAGO,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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,MAAA,EAAS,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IAC/C;AAAA,GAAA,EACH,CAAA;AAEJ;AAGO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,yBAAyB,KAAK,CAAA;AAE5E,EAAA,2BAAQC,SAAA,EAAA,EAAgB,SAAA,EAAW,SAAS,OAAA,CAAQ,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 { 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/** @public */\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":";;;;;;;;;;;AAsEA,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;AAGO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,uBAAO,GAAA,CAACA,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACnC;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A,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAI,SAAA,EAAW,OAAA,CAAQ,KAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,eAAY,CAAA,EACf,CAAA;AAAA,QACC;AAAA,OAAA,EACH;AAAA;AAAA,GACF;AAEJ;AAGO,MAAM,WAAA,GAAc,CAAC,KAAA,KAAoC;AAC9D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,uBAAuB,KAAK,CAAA;AAC1E,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,KAAA,EAAM,GAAI,QAAA;AAErC,EAAA,4BACGC,aAAA,EAAA,EAAc,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAC1C,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACC,MAAA,EAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAS,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IAC/C;AAAA,GAAA,EACH,CAAA;AAEJ;AAGO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,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__1811272318 {\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__1811272318 {\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__1811272318 {\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__1811272318 {\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 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__1811272318 {\n display: block;\n }\n }\n }\n\n .Menu_bui-MenuItemListBox__1811272318 {\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 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__1811272318 {\n & > svg {\n opacity: 1;\n color: var(--bui-fg-primary);\n }\n }\n }\n\n .Menu_bui-MenuItemListBoxCheck__1811272318 {\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__1811272318 {\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__1811272318 {\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__1811272318 {\n &:first-child .Menu_bui-MenuSectionHeader__1811272318 {\n padding-top: 0;\n }\n }\n\n .Menu_bui-MenuSectionHeader__1811272318 {\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 font-weight: bold;\n letter-spacing: 0.05rem;\n text-transform: uppercase;\n }\n\n .Menu_bui-MenuSeparator__1811272318 {\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__1811272318 {\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__1811272318 {\n visibility: hidden;\n }\n }\n }\n\n .Menu_bui-MenuSearchFieldInput__1811272318 {\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 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__1811272318 {\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__1811272318 {\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 }\n}\n";
|
|
4
|
+
var styles = {"bui-MenuPopover":"Menu_bui-MenuPopover__1811272318","bui-MenuInner":"Menu_bui-MenuInner__1811272318","bui-MenuContent":"Menu_bui-MenuContent__1811272318","bui-MenuItem":"Menu_bui-MenuItem__1811272318","bui-MenuItemArrow":"Menu_bui-MenuItemArrow__1811272318","bui-MenuItemListBox":"Menu_bui-MenuItemListBox__1811272318","bui-MenuItemListBoxCheck":"Menu_bui-MenuItemListBoxCheck__1811272318","bui-MenuItemContent":"Menu_bui-MenuItemContent__1811272318","bui-MenuSection":"Menu_bui-MenuSection__1811272318","bui-MenuSectionHeader":"Menu_bui-MenuSectionHeader__1811272318","bui-MenuSeparator":"Menu_bui-MenuSeparator__1811272318","bui-MenuSearchField":"Menu_bui-MenuSearchField__1811272318","bui-MenuSearchFieldClear":"Menu_bui-MenuSearchFieldClear__1811272318","bui-MenuSearchFieldInput":"Menu_bui-MenuSearchFieldInput__1811272318","bui-MenuEmptyState":"Menu_bui-MenuEmptyState__1811272318"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -60,7 +60,6 @@ const MenuItemDefinition = defineComponent()({
|
|
|
60
60
|
styles,
|
|
61
61
|
classNames: {
|
|
62
62
|
root: "bui-MenuItem",
|
|
63
|
-
itemWrapper: "bui-MenuItemWrapper",
|
|
64
63
|
itemContent: "bui-MenuItemContent",
|
|
65
64
|
itemArrow: "bui-MenuItemArrow"
|
|
66
65
|
},
|
|
@@ -78,7 +77,6 @@ const MenuListBoxItemDefinition = defineComponent()({
|
|
|
78
77
|
styles,
|
|
79
78
|
classNames: {
|
|
80
79
|
root: "bui-MenuItemListBox",
|
|
81
|
-
itemWrapper: "bui-MenuItemWrapper",
|
|
82
80
|
itemContent: "bui-MenuItemContent",
|
|
83
81
|
check: "bui-MenuItemListBoxCheck"
|
|
84
82
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Menu/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 MenuOwnProps,\n MenuListBoxOwnProps,\n MenuAutocompleteOwnProps,\n MenuAutocompleteListBoxOwnProps,\n MenuItemOwnProps,\n MenuListBoxItemOwnProps,\n MenuSectionOwnProps,\n MenuSeparatorOwnProps,\n} from './types';\nimport styles from './Menu.module.css';\n\n// Shared classNames for all popover-based menu variants\nconst menuPopoverClassNames = {\n root: 'bui-MenuPopover',\n inner: 'bui-MenuInner',\n content: 'bui-MenuContent',\n} as const;\n\n// Shared classNames for autocomplete menu variants\nconst menuAutocompleteClassNames = {\n ...menuPopoverClassNames,\n searchField: 'bui-MenuSearchField',\n searchFieldInput: 'bui-MenuSearchFieldInput',\n searchFieldClear: 'bui-MenuSearchFieldClear',\n} as const;\n\n// Shared propDefs for all popover-based menu variants\nconst menuPopoverPropDefs = {\n placement: { default: 'bottom start' },\n virtualized: { default: false },\n maxWidth: {},\n maxHeight: {},\n style: {},\n className: {},\n} as const;\n\n/**\n * Component definition for Menu\n * @public\n */\nexport const MenuDefinition = defineComponent<MenuOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: menuPopoverPropDefs,\n});\n\n/** @internal */\nexport const MenuListBoxDefinition = defineComponent<MenuListBoxOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n selectionMode: { default: 'single' },\n },\n});\n\n/** @internal */\nexport const MenuAutocompleteDefinition =\n defineComponent<MenuAutocompleteOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n },\n });\n\n/** @internal */\nexport const MenuAutocompleteListboxDefinition =\n defineComponent<MenuAutocompleteListBoxOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n selectionMode: { default: 'single' },\n },\n });\n\n/** @internal */\nexport const MenuItemDefinition = defineComponent<MenuItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItem',\n
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Menu/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 MenuOwnProps,\n MenuListBoxOwnProps,\n MenuAutocompleteOwnProps,\n MenuAutocompleteListBoxOwnProps,\n MenuItemOwnProps,\n MenuListBoxItemOwnProps,\n MenuSectionOwnProps,\n MenuSeparatorOwnProps,\n} from './types';\nimport styles from './Menu.module.css';\n\n// Shared classNames for all popover-based menu variants\nconst menuPopoverClassNames = {\n root: 'bui-MenuPopover',\n inner: 'bui-MenuInner',\n content: 'bui-MenuContent',\n} as const;\n\n// Shared classNames for autocomplete menu variants\nconst menuAutocompleteClassNames = {\n ...menuPopoverClassNames,\n searchField: 'bui-MenuSearchField',\n searchFieldInput: 'bui-MenuSearchFieldInput',\n searchFieldClear: 'bui-MenuSearchFieldClear',\n} as const;\n\n// Shared propDefs for all popover-based menu variants\nconst menuPopoverPropDefs = {\n placement: { default: 'bottom start' },\n virtualized: { default: false },\n maxWidth: {},\n maxHeight: {},\n style: {},\n className: {},\n} as const;\n\n/**\n * Component definition for Menu\n * @public\n */\nexport const MenuDefinition = defineComponent<MenuOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: menuPopoverPropDefs,\n});\n\n/** @internal */\nexport const MenuListBoxDefinition = defineComponent<MenuListBoxOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n selectionMode: { default: 'single' },\n },\n});\n\n/** @internal */\nexport const MenuAutocompleteDefinition =\n defineComponent<MenuAutocompleteOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n },\n });\n\n/** @internal */\nexport const MenuAutocompleteListboxDefinition =\n defineComponent<MenuAutocompleteListBoxOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n selectionMode: { default: 'single' },\n },\n });\n\n/** @internal */\nexport const MenuItemDefinition = defineComponent<MenuItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItem',\n itemContent: 'bui-MenuItemContent',\n itemArrow: 'bui-MenuItemArrow',\n },\n analytics: true,\n propDefs: {\n iconStart: {},\n children: {},\n color: { dataAttribute: true, default: 'primary' },\n href: {},\n noTrack: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuListBoxItemDefinition =\n defineComponent<MenuListBoxItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItemListBox',\n itemContent: 'bui-MenuItemContent',\n check: 'bui-MenuItemListBoxCheck',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n\n/** @internal */\nexport const MenuSectionDefinition = defineComponent<MenuSectionOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuSection',\n header: 'bui-MenuSectionHeader',\n },\n propDefs: {\n title: {},\n children: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuSeparatorDefinition = defineComponent<MenuSeparatorOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-MenuSeparator',\n },\n propDefs: {\n className: {},\n },\n },\n);\n\n/** @internal */\nexport const MenuEmptyStateDefinition = defineComponent<{}>()({\n styles,\n classNames: {\n root: 'bui-MenuEmptyState',\n },\n propDefs: {},\n});\n"],"names":[],"mappings":";;;;;;;;;AA8BA,MAAM,qBAAA,GAAwB;AAAA,EAC5B,IAAA,EAAM,iBAAA;AAAA,EACN,KAAA,EAAO,eAAA;AAAA,EACP,OAAA,EAAS;AACX,CAAA;AAGA,MAAM,0BAAA,GAA6B;AAAA,EACjC,GAAG,qBAAA;AAAA,EACH,WAAA,EAAa,qBAAA;AAAA,EACb,gBAAA,EAAkB,0BAAA;AAAA,EAClB,gBAAA,EAAkB;AACpB,CAAA;AAGA,MAAM,mBAAA,GAAsB;AAAA,EAC1B,SAAA,EAAW,EAAE,OAAA,EAAS,cAAA,EAAe;AAAA,EACrC,WAAA,EAAa,EAAE,OAAA,EAAS,KAAA,EAAM;AAAA,EAC9B,UAAU,EAAC;AAAA,EACX,WAAW,EAAC;AAAA,EACZ,OAAO,EAAC;AAAA,EACR,WAAW;AACb,CAAA;AAMO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY,qBAAA;AAAA,EACZ,QAAA,EAAU;AACZ,CAAC;AAGM,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY,qBAAA;AAAA,EACZ,QAAA,EAAU;AAAA,IACR,GAAG,m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AAAA,IACV,IAAA,EAAM,iBAAA;AAAA,IACN,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,KACR;AAAA,IACA,QAAA,EAAU;AAAA,MACR,WAAW;AAAC;AACd;AAEJ;AAGO,MAAM,wBAAA,GAA2B,iBAAoB,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,UAAU;AACZ,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Tabs, TabList, Tab } from '../Tabs/Tabs.esm.js';
|
|
3
3
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
4
4
|
import '../Tabs/Tabs.module.css.esm.js';
|
|
@@ -7,10 +7,12 @@ import { useRef, useMemo, Children } from 'react';
|
|
|
7
7
|
import { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect.esm.js';
|
|
8
8
|
import { Box } from '../Box/Box.esm.js';
|
|
9
9
|
import '../Box/Box.module.css.esm.js';
|
|
10
|
-
import { Link } from '
|
|
10
|
+
import { Link } from '../Link/Link.esm.js';
|
|
11
|
+
import '../Link/Link.module.css.esm.js';
|
|
11
12
|
import { RiShapesLine } from '@remixicon/react';
|
|
12
13
|
import { Text } from '../Text/Text.esm.js';
|
|
13
14
|
import '../Text/Text.module.css.esm.js';
|
|
15
|
+
import { BgReset } from '../../hooks/useBg.esm.js';
|
|
14
16
|
|
|
15
17
|
const PluginHeader = (props) => {
|
|
16
18
|
const { ownProps } = useDefinition(PluginHeaderDefinition, props);
|
|
@@ -25,9 +27,6 @@ const PluginHeader = (props) => {
|
|
|
25
27
|
} = ownProps;
|
|
26
28
|
const hasTabs = tabs && tabs.length > 0;
|
|
27
29
|
const headerRef = useRef(null);
|
|
28
|
-
const toolbarWrapperRef = useRef(null);
|
|
29
|
-
const toolbarContentRef = useRef(null);
|
|
30
|
-
const toolbarControlsRef = useRef(null);
|
|
31
30
|
const animationFrameRef = useRef(void 0);
|
|
32
31
|
const lastAppliedHeightRef = useRef(void 0);
|
|
33
32
|
const actionChildren = useMemo(() => {
|
|
@@ -81,15 +80,23 @@ const PluginHeader = (props) => {
|
|
|
81
80
|
document.documentElement.style.removeProperty("--bui-header-height");
|
|
82
81
|
};
|
|
83
82
|
}, []);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
const titleText = title || "Your plugin";
|
|
84
|
+
return /* @__PURE__ */ jsx(BgReset, { children: /* @__PURE__ */ jsxs("header", { ref: headerRef, className: classes.root, children: [
|
|
85
|
+
/* @__PURE__ */ jsxs(Box, { bg: "neutral", className: classes.toolbar, "data-has-tabs": hasTabs, children: [
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: classes.toolbarContent, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Box,
|
|
89
|
+
{
|
|
90
|
+
bg: "neutral",
|
|
91
|
+
className: classes.toolbarIcon,
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
children: icon || /* @__PURE__ */ jsx(RiShapesLine, {})
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx("h1", { className: classes.toolbarName, children: titleLink ? /* @__PURE__ */ jsx(Link, { href: titleLink, standalone: true, variant: "body-medium", children: titleText }) : /* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", children: titleText }) })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx("div", { className: classes.toolbarControls, children: actionChildren })
|
|
99
|
+
] }),
|
|
93
100
|
tabs && /* @__PURE__ */ jsx(Box, { bg: "neutral", className: classes.tabs, children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
94
101
|
Tab,
|
|
95
102
|
{
|
|
@@ -100,7 +107,7 @@ const PluginHeader = (props) => {
|
|
|
100
107
|
},
|
|
101
108
|
tab.id
|
|
102
109
|
)) }) }) })
|
|
103
|
-
] });
|
|
110
|
+
] }) });
|
|
104
111
|
};
|
|
105
112
|
|
|
106
113
|
export { PluginHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginHeader.esm.js","sources":["../../../src/components/PluginHeader/PluginHeader.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PluginHeaderProps } from './types';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PluginHeaderDefinition } from './definition';\nimport { type NavigateOptions } from 'react-router-dom';\nimport { Children, useMemo, useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { Box } from '../Box';\nimport { Link } from '
|
|
1
|
+
{"version":3,"file":"PluginHeader.esm.js","sources":["../../../src/components/PluginHeader/PluginHeader.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PluginHeaderProps } from './types';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PluginHeaderDefinition } from './definition';\nimport { type NavigateOptions } from 'react-router-dom';\nimport { Children, useMemo, useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { Box } from '../Box';\nimport { Link } from '../Link';\nimport { RiShapesLine } from '@remixicon/react';\nimport { Text } from '../Text';\nimport { BgReset } from '../../hooks/useBg';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * Renders a plugin header with icon, title, custom actions, and optional tabs.\n * Always participates in the background context system so descendants (e.g. buttons)\n * get the correct `data-on-bg` styling inside the toolbar and tabs.\n *\n * @public\n */\nexport const PluginHeader = (props: PluginHeaderProps) => {\n const { ownProps } = useDefinition(PluginHeaderDefinition, props);\n const {\n classes,\n tabs,\n icon,\n title,\n titleLink,\n customActions,\n onTabSelectionChange,\n } = ownProps;\n\n const hasTabs = tabs && tabs.length > 0;\n const headerRef = useRef<HTMLElement>(null);\n const animationFrameRef = useRef<number | undefined>(undefined);\n const lastAppliedHeightRef = useRef<number | undefined>(undefined);\n\n const actionChildren = useMemo(() => {\n return Children.toArray(customActions);\n }, [customActions]);\n\n useIsomorphicLayoutEffect(() => {\n const el = headerRef.current;\n if (!el) {\n return undefined;\n }\n\n const cancelScheduledUpdate = () => {\n if (animationFrameRef.current === undefined) {\n return;\n }\n\n cancelAnimationFrame(animationFrameRef.current);\n animationFrameRef.current = undefined;\n };\n\n const applyHeight = (height: number) => {\n if (lastAppliedHeightRef.current === height) {\n return;\n }\n\n lastAppliedHeightRef.current = height;\n document.documentElement.style.setProperty(\n '--bui-header-height',\n `${height}px`,\n );\n };\n\n const scheduleHeightUpdate = () => {\n cancelScheduledUpdate();\n animationFrameRef.current = requestAnimationFrame(() => {\n animationFrameRef.current = undefined;\n applyHeight(el.offsetHeight);\n });\n };\n\n // Set height once immediately so the initial layout is correct.\n applyHeight(el.offsetHeight);\n\n // Observe for resize changes if ResizeObserver is available\n // (not present in Jest/jsdom by default)\n if (typeof ResizeObserver === 'undefined') {\n return () => {\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }\n\n const observer = new ResizeObserver(() => {\n scheduleHeightUpdate();\n });\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n cancelScheduledUpdate();\n lastAppliedHeightRef.current = undefined;\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }, []);\n\n const titleText = title || 'Your plugin';\n\n return (\n <BgReset>\n <header ref={headerRef} className={classes.root}>\n <Box bg=\"neutral\" className={classes.toolbar} data-has-tabs={hasTabs}>\n <div className={classes.toolbarContent}>\n <Box\n bg=\"neutral\"\n className={classes.toolbarIcon}\n aria-hidden=\"true\"\n >\n {icon || <RiShapesLine />}\n </Box>\n <h1 className={classes.toolbarName}>\n {titleLink ? (\n <Link href={titleLink} standalone variant=\"body-medium\">\n {titleText}\n </Link>\n ) : (\n <Text as=\"span\" variant=\"body-medium\">\n {titleText}\n </Text>\n )}\n </h1>\n </div>\n <div className={classes.toolbarControls}>{actionChildren}</div>\n </Box>\n {tabs && (\n <Box bg=\"neutral\" className={classes.tabs}>\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </Tab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AC,GAAA;AAAA,MAAA;AAAA,QAEC,IAAI,GAAA,CAAI,EAAA;AAAA,QACR,MAAM,GAAA,CAAI,IAAA;AAAA,QACV,eAAe,GAAA,CAAI,aAAA;AAAA,QAElB,QAAA,EAAA,GAAA,CAAI;AAAA,OAAA;AAAA,MALA,GAAA,CAAI;AAAA,KAOZ,CAAA,EACH,CAAA,EACF,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA,EACF,CAAA;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 .PluginHeader_bui-
|
|
4
|
-
var styles = {"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 .PluginHeader_bui-PluginHeaderToolbar__a74579b2ac {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding-inline: var(--bui-space-5);\n color: var(--bui-fg-primary);\n height: 52px;\n border-bottom: 1px solid var(--bui-border-1);\n }\n\n .PluginHeader_bui-PluginHeaderToolbarContent__a74579b2ac {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderToolbarName__a74579b2ac {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-regular);\n flex-shrink: 0;\n }\n\n .PluginHeader_bui-PluginHeaderToolbarIcon__a74579b2ac {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 2rem;\n height: 2rem;\n border-radius: var(--bui-radius-2);\n color: var(--bui-fg-primary);\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .PluginHeader_bui-PluginHeaderToolbarControls__a74579b2ac {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderTabsWrapper__a74579b2ac {\n padding-inline: var(--bui-space-3);\n border-bottom: 1px solid var(--bui-border-1);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-PluginHeaderToolbar":"PluginHeader_bui-PluginHeaderToolbar__a74579b2ac","bui-PluginHeaderToolbarContent":"PluginHeader_bui-PluginHeaderToolbarContent__a74579b2ac","bui-PluginHeaderToolbarName":"PluginHeader_bui-PluginHeaderToolbarName__a74579b2ac","bui-PluginHeaderToolbarIcon":"PluginHeader_bui-PluginHeaderToolbarIcon__a74579b2ac","bui-PluginHeaderToolbarControls":"PluginHeader_bui-PluginHeaderToolbarControls__a74579b2ac","bui-PluginHeaderTabsWrapper":"PluginHeader_bui-PluginHeaderTabsWrapper__a74579b2ac"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -12,7 +12,6 @@ const PluginHeaderDefinition = defineComponent()({
|
|
|
12
12
|
classNames: {
|
|
13
13
|
root: "bui-PluginHeader",
|
|
14
14
|
toolbar: "bui-PluginHeaderToolbar",
|
|
15
|
-
toolbarWrapper: "bui-PluginHeaderToolbarWrapper",
|
|
16
15
|
toolbarContent: "bui-PluginHeaderToolbarContent",
|
|
17
16
|
toolbarControls: "bui-PluginHeaderToolbarControls",
|
|
18
17
|
toolbarIcon: "bui-PluginHeaderToolbarIcon",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n toolbarContent: 'bui-PluginHeaderToolbarContent',\n toolbarControls: 'bui-PluginHeaderToolbarControls',\n toolbarIcon: 'bui-PluginHeaderToolbarIcon',\n toolbarName: 'bui-PluginHeaderToolbarName',\n tabs: 'bui-PluginHeaderTabsWrapper',\n },\n propDefs: {\n icon: {},\n title: {},\n titleLink: {},\n customActions: {},\n tabs: {},\n onTabSelectionChange: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS,yBAAA;AAAA,IACT,cAAA,EAAgB,gCAAA;AAAA,IAChB,eAAA,EAAiB,iCAAA;AAAA,IACjB,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,sBAAsB,EAAC;AAAA,IACvB,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -88,7 +88,7 @@ function SearchAutocomplete(props) {
|
|
|
88
88
|
{
|
|
89
89
|
ref: triggerRef,
|
|
90
90
|
className: classes.root,
|
|
91
|
-
|
|
91
|
+
...dataAttributes,
|
|
92
92
|
style,
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(RiSearch2Line, {}) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Children, useRef } from 'react';\nimport { useInteractOutside } from '@react-aria/interactions';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/** @public */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n data-size={dataAttributes['data-size']}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\n/** @public */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const { ownProps, restProps } = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,YAAY,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACvE,CAAA;AAGO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,4BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA,GAAmB,cA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AC9B,gCAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Children, useRef } from 'react';\nimport { useInteractOutside } from '@react-aria/interactions';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/** @public */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n {...dataAttributes}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\n/** @public */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const { ownProps, restProps } = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,O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AGlC,UAAU,MAAM;AACd,kBAAA,YAAA,CAAa,KAAA,EAAM;AAAA,gBACrB,CAAA;AAAA,gBAEC;AAAA;AAAA,eAEL,CAAA,EACF;AAAA;AAAA,SACF;AAAA,4BACC,cAAA,EAAA,EAAe,WAAA,EAAU,QAAA,EAAS,aAAA,EAAY,QAC5C,QAAA,EAAA,WAAA,EACH;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;AAGO,SAAS,uBAAuB,KAAA,EAAoC;AACzE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA;AAAA,IAC9B,gCAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;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 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 .SearchAutocomplete_bui-
|
|
4
|
-
var styles = {"bui-SearchAutocomplete":"SearchAutocomplete_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 .SearchAutocomplete_bui-SearchAutocomplete__579de55517 {\n display: flex;\n align-items: center;\n border-radius: var(--bui-radius-2);\n background-color: var(--bui-bg-neutral-1);\n transition: box-shadow 0.2s ease-in-out;\n font-family: var(--bui-font-regular);\n\n &:has([data-focused]) {\n box-shadow: inset 0 0 0 1px var(--bui-ring);\n }\n\n &[data-size='small'] {\n --search-autocomplete-item-height: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] {\n --search-autocomplete-item-height: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-on-bg='neutral-1'] {\n background-color: var(--bui-bg-neutral-2);\n }\n\n &[data-on-bg='neutral-2'] {\n background-color: var(--bui-bg-neutral-3);\n }\n\n &[data-on-bg='neutral-3'] {\n background-color: var(--bui-bg-neutral-4);\n }\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteSearchField__579de55517 {\n display: flex;\n align-items: center;\n flex: 1;\n\n & > div {\n display: flex;\n align-items: center;\n flex: 1;\n }\n\n & svg {\n flex: 0 0 auto;\n color: var(--bui-fg-primary);\n margin-inline-start: var(--bui-space-2);\n\n .SearchAutocomplete_bui-SearchAutocomplete__579de55517[data-size='small'] & {\n width: 1rem;\n height: 1rem;\n }\n\n .SearchAutocomplete_bui-SearchAutocomplete__579de55517[data-size='medium'] & {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteInput__579de55517 {\n flex: 1;\n display: flex;\n align-items: center;\n padding: 0;\n padding-inline: var(--bui-space-2);\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 color: var(--bui-fg-primary);\n width: 100%;\n height: 100%;\n outline: none;\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\n .SearchAutocomplete_bui-SearchAutocompleteClear__579de55517 {\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: var(--search-autocomplete-item-height);\n height: var(--search-autocomplete-item-height);\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .SearchAutocomplete_bui-SearchAutocompletePopover__579de55517 {\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 min-height: 0;\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\n .SearchAutocomplete_bui-SearchAutocompleteInner__579de55517 {\n border-radius: var(--menu-border-radius);\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteListBox__579de55517 {\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 &[data-stale] {\n opacity: 0.6;\n }\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteItem__579de55517 {\n padding-inline: var(--bui-space-1);\n display: block;\n\n &:focus-visible {\n outline: none;\n }\n\n &[data-focus-visible] {\n outline: 2px solid var(--bui-ring);\n outline-offset: -2px;\n }\n\n &[data-focused] .SearchAutocomplete_bui-SearchAutocompleteItemContent__579de55517,\n &[data-hovered] .SearchAutocomplete_bui-SearchAutocompleteItemContent__579de55517 {\n background: var(--bui-bg-neutral-2);\n color: var(--bui-fg-primary);\n }\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteItemContent__579de55517 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-1);\n min-height: 2rem;\n padding-inline: var(--bui-space-2);\n padding-block: var(--bui-space-2);\n border-radius: var(--bui-radius-2);\n outline: none;\n cursor: default;\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-3);\n }\n\n .SearchAutocomplete_bui-SearchAutocompleteLoadingState__579de55517,\n .SearchAutocomplete_bui-SearchAutocompleteEmptyState__579de55517 {\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 }\n}\n";
|
|
4
|
+
var styles = {"bui-SearchAutocomplete":"SearchAutocomplete_bui-SearchAutocomplete__579de55517","bui-SearchAutocompleteSearchField":"SearchAutocomplete_bui-SearchAutocompleteSearchField__579de55517","bui-SearchAutocompleteInput":"SearchAutocomplete_bui-SearchAutocompleteInput__579de55517","bui-SearchAutocompleteClear":"SearchAutocomplete_bui-SearchAutocompleteClear__579de55517","bui-SearchAutocompletePopover":"SearchAutocomplete_bui-SearchAutocompletePopover__579de55517","bui-SearchAutocompleteInner":"SearchAutocomplete_bui-SearchAutocompleteInner__579de55517","bui-SearchAutocompleteListBox":"SearchAutocomplete_bui-SearchAutocompleteListBox__579de55517","bui-SearchAutocompleteItem":"SearchAutocomplete_bui-SearchAutocompleteItem__579de55517","bui-SearchAutocompleteItemContent":"SearchAutocomplete_bui-SearchAutocompleteItemContent__579de55517","bui-SearchAutocompleteLoadingState":"SearchAutocomplete_bui-SearchAutocompleteLoadingState__579de55517","bui-SearchAutocompleteEmptyState":"SearchAutocomplete_bui-SearchAutocompleteEmptyState__579de55517"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;AA2BO,MAAM,4BAAA,GACX,iBAA4C,CAAE;AAAA,EAC5C,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,mCAAA;AAAA,IACb,gBAAA,EAAkB,6BAAA;AAAA,IAClB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,OAAA,EAAS,+BAAA;AAAA,IACT,KAAA,EAAO,6BAAA;AAAA,IACP,OAAA,EAAS,+BAAA;AAAA,IACT,YAAA,EAAc,oCAAA;AAAA,IACd,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAc,EAAC;AAAA,IACf,mBAAmB,EAAC;AAAA,IACpB,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,YAAY,EAAC;AAAA,IACb,eAAe,EAAC;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,kBAAkB,EAAC;AAAA,IACnB,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;AAGI,MAAM,gCAAA,GACX,iBAAgD,CAAE;AAAA,EAChD,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,4BAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;AA2BO,MAAM,4BAAA,GACX,iBAA4C,CAAE;AAAA,EAC5C,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,mCAAA;AAAA,IACb,gBAAA,EAAkB,6BAAA;AAAA,IAClB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,OAAA,EAAS,+BAAA;AAAA,IACT,KAAA,EAAO,6BAAA;AAAA,IACP,OAAA,EAAS,+BAAA;AAAA,IACT,YAAA,EAAc,oCAAA;AAAA,IACd,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAc,EAAC;AAAA,IACf,mBAAmB,EAAC;AAAA,IACpB,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,YAAY,EAAC;AAAA,IACb,eAAe,EAAC;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,kBAAkB,EAAC;AAAA,IACnB,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;AAGI,MAAM,gCAAA,GACX,iBAAgD,CAAE;AAAA,EAChD,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,4BAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|