@backstage/ui 0.12.0 → 0.13.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 +120 -0
- package/dist/components/Accordion/Accordion.esm.js +4 -2
- package/dist/components/Accordion/Accordion.esm.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.css.esm.js +2 -2
- package/dist/components/Accordion/definition.esm.js +4 -2
- package/dist/components/Accordion/definition.esm.js.map +1 -1
- package/dist/components/Alert/definition.esm.js +1 -1
- package/dist/components/Avatar/Avatar.esm.js +8 -28
- package/dist/components/Avatar/Avatar.esm.js.map +1 -1
- package/dist/components/Avatar/definition.esm.js +17 -4
- package/dist/components/Avatar/definition.esm.js.map +1 -1
- package/dist/components/Box/definition.esm.js +1 -1
- package/dist/components/Button/definition.esm.js +2 -3
- package/dist/components/Button/definition.esm.js.map +1 -1
- package/dist/components/ButtonIcon/definition.esm.js +2 -3
- package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
- package/dist/components/ButtonLink/definition.esm.js +2 -3
- package/dist/components/ButtonLink/definition.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js +1 -1
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/definition.esm.js +1 -1
- package/dist/components/Checkbox/Checkbox.esm.js +10 -17
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/Checkbox/definition.esm.js +16 -5
- package/dist/components/Checkbox/definition.esm.js.map +1 -1
- package/dist/components/Container/Container.esm.js +8 -13
- package/dist/components/Container/Container.esm.js.map +1 -1
- package/dist/components/Container/Container.module.css.esm.js +2 -2
- package/dist/components/Container/definition.esm.js +16 -2
- package/dist/components/Container/definition.esm.js.map +1 -1
- package/dist/components/Dialog/Dialog.esm.js +26 -59
- package/dist/components/Dialog/Dialog.esm.js.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
- package/dist/components/Dialog/definition.esm.js +52 -8
- package/dist/components/Dialog/definition.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.esm.js +4 -13
- package/dist/components/FieldError/FieldError.esm.js.map +1 -1
- package/dist/components/FieldError/definition.esm.js +14 -2
- package/dist/components/FieldError/definition.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.esm.js +14 -59
- package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
- package/dist/components/FieldLabel/definition.esm.js +19 -2
- package/dist/components/FieldLabel/definition.esm.js.map +1 -1
- package/dist/components/Flex/Flex.esm.js +11 -22
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/definition.esm.js +19 -13
- package/dist/components/Flex/definition.esm.js.map +1 -1
- package/dist/components/FullPage/FullPage.esm.js +4 -13
- package/dist/components/FullPage/FullPage.esm.js.map +1 -1
- package/dist/components/FullPage/definition.esm.js +14 -2
- package/dist/components/FullPage/definition.esm.js.map +1 -1
- package/dist/components/Grid/Grid.esm.js +19 -40
- package/dist/components/Grid/Grid.esm.js.map +1 -1
- package/dist/components/Grid/definition.esm.js +30 -26
- package/dist/components/Grid/definition.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js +38 -60
- package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
- package/dist/components/HeaderPage/definition.esm.js +18 -2
- package/dist/components/HeaderPage/definition.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js +6 -34
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/definition.esm.js +20 -15
- package/dist/components/Link/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js +162 -343
- 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 +113 -17
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.esm.js +17 -52
- package/dist/components/PasswordField/PasswordField.esm.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
- package/dist/components/PasswordField/definition.esm.js +28 -11
- package/dist/components/PasswordField/definition.esm.js.map +1 -1
- package/dist/components/PluginHeader/PluginHeader.esm.js +33 -46
- 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 +21 -3
- package/dist/components/PluginHeader/definition.esm.js.map +1 -1
- package/dist/components/Popover/Popover.esm.js +24 -32
- package/dist/components/Popover/Popover.esm.js.map +1 -1
- package/dist/components/Popover/Popover.module.css.esm.js +2 -2
- package/dist/components/Popover/definition.esm.js +16 -2
- package/dist/components/Popover/definition.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.esm.js +25 -44
- package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +2 -2
- package/dist/components/RadioGroup/definition.esm.js +30 -5
- package/dist/components/RadioGroup/definition.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.esm.js +25 -45
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
- package/dist/components/SearchField/definition.esm.js +20 -5
- package/dist/components/SearchField/definition.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js +14 -23
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +2 -2
- package/dist/components/Select/SelectContent.esm.js +8 -31
- package/dist/components/Select/SelectContent.esm.js.map +1 -1
- package/dist/components/Select/SelectListBox.esm.js +21 -44
- package/dist/components/Select/SelectListBox.esm.js.map +1 -1
- package/dist/components/Select/SelectTrigger.esm.js +8 -14
- package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
- package/dist/components/Select/definition.esm.js +67 -17
- package/dist/components/Select/definition.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.esm.js +9 -13
- package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
- package/dist/components/Skeleton/definition.esm.js +18 -2
- package/dist/components/Skeleton/definition.esm.js.map +1 -1
- package/dist/components/Switch/Switch.esm.js +7 -22
- package/dist/components/Switch/Switch.esm.js.map +1 -1
- package/dist/components/Switch/definition.esm.js +15 -2
- package/dist/components/Switch/definition.esm.js.map +1 -1
- package/dist/components/Table/components/Cell.esm.js +4 -17
- package/dist/components/Table/components/Cell.esm.js.map +1 -1
- package/dist/components/Table/components/CellProfile.esm.js +12 -41
- package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
- package/dist/components/Table/components/CellText.esm.js +39 -73
- package/dist/components/Table/components/CellText.esm.js.map +1 -1
- package/dist/components/Table/components/Column.esm.js +8 -36
- package/dist/components/Table/components/Column.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js +9 -19
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js +7 -0
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBody.esm.js +4 -12
- package/dist/components/Table/components/TableBody.esm.js.map +1 -1
- package/dist/components/Table/components/TableHeader.esm.js +19 -29
- package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
- package/dist/components/Table/components/TableRoot.esm.js +5 -7
- package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
- package/dist/components/Table/definition.esm.js +97 -21
- package/dist/components/Table/definition.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +24 -32
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/TablePagination/definition.esm.js +32 -2
- package/dist/components/TablePagination/definition.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.esm.js +40 -63
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/TabsIndicators.esm.js +6 -18
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/components/Tabs/definition.esm.js +62 -10
- package/dist/components/Tabs/definition.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.esm.js +36 -63
- package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
- package/dist/components/TagGroup/definition.esm.js +35 -8
- package/dist/components/TagGroup/definition.esm.js.map +1 -1
- package/dist/components/Text/Text.esm.js +6 -13
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/Text/definition.esm.js +18 -14
- package/dist/components/Text/definition.esm.js.map +1 -1
- package/dist/components/TextField/TextField.esm.js +16 -41
- package/dist/components/TextField/TextField.esm.js.map +1 -1
- package/dist/components/TextField/definition.esm.js +19 -6
- package/dist/components/TextField/definition.esm.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.esm.js +11 -23
- package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
- package/dist/components/ToggleButton/definition.esm.js +17 -4
- package/dist/components/ToggleButton/definition.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js +5 -18
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js +14 -4
- package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.esm.js +24 -30
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.esm.js +2 -2
- package/dist/components/Tooltip/definition.esm.js +16 -2
- package/dist/components/Tooltip/definition.esm.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +4 -12
- package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
- package/dist/components/VisuallyHidden/definition.esm.js +14 -2
- package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
- package/dist/css/styles.css +2 -4
- package/dist/hooks/useBg.esm.js +11 -2
- package/dist/hooks/useBg.esm.js.map +1 -1
- package/dist/hooks/useBreakpoint.esm.js +67 -27
- package/dist/hooks/useBreakpoint.esm.js.map +1 -1
- package/dist/hooks/useDefinition/helpers.esm.js +24 -1
- package/dist/hooks/useDefinition/helpers.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinition.esm.js +12 -22
- package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
- package/dist/index.d.ts +860 -273
- package/dist/index.esm.js +2 -2
- package/package.json +6 -4
- package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js +0 -94
- package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js.map +0 -1
- package/dist/hooks/useMediaQuery.esm.js +0 -47
- package/dist/hooks/useMediaQuery.esm.js.map +0 -1
- package/dist/hooks/useStyles.esm.js +0 -53
- package/dist/hooks/useStyles.esm.js.map +0 -1
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { PluginHeaderToolbar } from './PluginHeaderToolbar.esm.js';
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { Tabs, TabList, Tab } from '../Tabs/Tabs.esm.js';
|
|
4
|
-
import {
|
|
3
|
+
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
4
|
+
import '../Tabs/Tabs.module.css.esm.js';
|
|
5
5
|
import { PluginHeaderDefinition } from './definition.esm.js';
|
|
6
6
|
import { useRef } from 'react';
|
|
7
7
|
import { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect.esm.js';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import { Link } from 'react-aria-components';
|
|
9
|
+
import { RiShapesLine } from '@remixicon/react';
|
|
10
|
+
import { Text } from '../Text/Text.esm.js';
|
|
11
|
+
import '../Text/Text.module.css.esm.js';
|
|
10
12
|
|
|
11
13
|
const PluginHeader = (props) => {
|
|
12
|
-
const {
|
|
14
|
+
const { ownProps } = useDefinition(PluginHeaderDefinition, props);
|
|
13
15
|
const {
|
|
14
|
-
|
|
16
|
+
classes,
|
|
15
17
|
tabs,
|
|
16
18
|
icon,
|
|
17
19
|
title,
|
|
18
20
|
titleLink,
|
|
19
21
|
customActions,
|
|
20
22
|
onTabSelectionChange
|
|
21
|
-
} =
|
|
23
|
+
} = ownProps;
|
|
22
24
|
const hasTabs = tabs && tabs.length > 0;
|
|
23
25
|
const headerRef = useRef(null);
|
|
26
|
+
const toolbarWrapperRef = useRef(null);
|
|
27
|
+
const toolbarContentRef = useRef(null);
|
|
28
|
+
const toolbarControlsRef = useRef(null);
|
|
24
29
|
useIsomorphicLayoutEffect(() => {
|
|
25
30
|
const el = headerRef.current;
|
|
26
31
|
if (!el) return void 0;
|
|
@@ -44,44 +49,26 @@ const PluginHeader = (props) => {
|
|
|
44
49
|
document.documentElement.style.removeProperty("--bui-header-height");
|
|
45
50
|
};
|
|
46
51
|
}, []);
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
classNames.tabsWrapper,
|
|
68
|
-
styles[classNames.tabsWrapper]
|
|
69
|
-
),
|
|
70
|
-
children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
71
|
-
Tab,
|
|
72
|
-
{
|
|
73
|
-
id: tab.id,
|
|
74
|
-
href: tab.href,
|
|
75
|
-
matchStrategy: tab.matchStrategy,
|
|
76
|
-
children: tab.label
|
|
77
|
-
},
|
|
78
|
-
tab.id
|
|
79
|
-
)) }) })
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
);
|
|
52
|
+
const titleContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: classes.toolbarIcon, children: icon || /* @__PURE__ */ jsx(RiShapesLine, {}) }),
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { variant: "body-medium", children: title || "Your plugin" })
|
|
55
|
+
] });
|
|
56
|
+
return /* @__PURE__ */ jsxs("header", { ref: headerRef, className: classes.root, children: [
|
|
57
|
+
/* @__PURE__ */ jsx("div", { className: classes.toolbar, "data-has-tabs": hasTabs, children: /* @__PURE__ */ jsxs("div", { className: classes.toolbarWrapper, ref: toolbarWrapperRef, children: [
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: classes.toolbarContent, ref: toolbarContentRef, children: /* @__PURE__ */ jsx(Text, { as: "h1", variant: "body-medium", children: titleLink ? /* @__PURE__ */ jsx(Link, { className: classes.toolbarName, href: titleLink, children: titleContent }) : /* @__PURE__ */ jsx("div", { className: classes.toolbarName, children: titleContent }) }) }),
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: classes.toolbarControls, ref: toolbarControlsRef, children: customActions })
|
|
60
|
+
] }) }),
|
|
61
|
+
tabs && /* @__PURE__ */ jsx("div", { className: classes.tabs, children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
62
|
+
Tab,
|
|
63
|
+
{
|
|
64
|
+
id: tab.id,
|
|
65
|
+
href: tab.href,
|
|
66
|
+
matchStrategy: tab.matchStrategy,
|
|
67
|
+
children: tab.label
|
|
68
|
+
},
|
|
69
|
+
tab.id
|
|
70
|
+
)) }) }) })
|
|
71
|
+
] });
|
|
85
72
|
};
|
|
86
73
|
|
|
87
74
|
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 {
|
|
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 { useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { Link } from 'react-aria-components';\nimport { RiShapesLine } from '@remixicon/react';\nimport { Text } from '../Text';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a plugin header with icon, title, custom actions,\n * and navigation 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 toolbarWrapperRef = useRef<HTMLDivElement>(null);\n const toolbarContentRef = useRef<HTMLDivElement>(null);\n const toolbarControlsRef = useRef<HTMLDivElement>(null);\n\n useIsomorphicLayoutEffect(() => {\n const el = headerRef.current;\n if (!el) return undefined;\n\n const updateHeight = () => {\n const height = el.offsetHeight;\n document.documentElement.style.setProperty(\n '--bui-header-height',\n `${height}px`,\n );\n };\n\n // Set height once immediately\n updateHeight();\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 document.documentElement.style.removeProperty('--bui-header-height');\n };\n }\n\n const observer = new ResizeObserver(updateHeight);\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n document.documentElement.style.removeProperty('--bui-header-height');\n };\n }, []);\n\n const titleContent = (\n <>\n <div className={classes.toolbarIcon}>{icon || <RiShapesLine />}</div>\n <Text variant=\"body-medium\">{title || 'Your plugin'}</Text>\n </>\n );\n\n return (\n <header ref={headerRef} className={classes.root}>\n <div className={classes.toolbar} data-has-tabs={hasTabs}>\n <div className={classes.toolbarWrapper} ref={toolbarWrapperRef}>\n <div className={classes.toolbarContent} ref={toolbarContentRef}>\n <Text as=\"h1\" variant=\"body-medium\">\n {titleLink ? (\n <Link className={classes.toolbarName} href={titleLink}>\n {titleContent}\n </Link>\n ) : (\n <div className={classes.toolbarName}>{titleContent}</div>\n )}\n </Text>\n </div>\n <div className={classes.toolbarControls} ref={toolbarControlsRef}>\n {customActions}\n </div>\n </div>\n </div>\n {tabs && (\n <div className={classes.tabs}>\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </header>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAuCO,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAwB,KAAK,CAAA;AAChE,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AAEJ,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AACtC,EAAA,MAAM,SAAA,GAAY,OAAoB,IAAI,CAAA;AAC1C,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,kBAAA,GAAqB,OAAuB,IAAI,CAAA;AAEtD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,MAAM,KAAK,SAAA,CAAU,OAAA;AACrB,IAAA,IAAI,CAAC,IAAI,OAAO,MAAA;AAEhB,IAAA,MAAM,eAAe,MAAM;AACzB,MAAA,MAAM,SAAS,EAAA,CAAG,YAAA;AAClB,MAAA,QAAA,CAAS,gBAAgB,KAAA,CAAM,WAAA;AAAA,QAC7B,qBAAA;AAAA,QACA,GAAG,MAAM,CAAA,EAAA;AAAA,OACX;AAAA,IACF,CAAA;AAGA,IAAA,YAAA,EAAa;AAIb,IAAA,IAAI,OAAO,mBAAmB,WAAA,EAAa;AACzC,MAAA,OAAO,MAAM;AACX,QAAA,QAAA,CAAS,eAAA,CAAgB,KAAA,CAAM,cAAA,CAAe,qBAAqB,CAAA;AAAA,MACrE,CAAA;AAAA,IACF;AAEA,IAAA,MAAM,QAAA,GAAW,IAAI,cAAA,CAAe,YAAY,CAAA;AAChD,IAAA,QAAA,CAAS,QAAQ,EAAE,CAAA;AAEnB,IAAA,OAAO,MAAM;AACX,MAAA,QAAA,CAAS,UAAA,EAAW;AACpB,MAAA,QAAA,CAAS,eAAA,CAAgB,KAAA,CAAM,cAAA,CAAe,qBAAqB,CAAA;AAAA,IACrE,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,MAAM,+BACJ,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,SAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAA,IAAA,oBAAQ,GAAA,CAAC,gBAAa,CAAA,EAAG,CAAA;AAAA,oBAC/D,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,aAAA,EAAe,mBAAS,aAAA,EAAc;AAAA,GAAA,EACtD,CAAA;AAGF,EAAA,4BACG,QAAA,EAAA,EAAO,GAAA,EAAK,SAAA,EAAW,SAAA,EAAW,QAAQ,IAAA,EACzC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,OAAA,EAAS,eAAA,EAAe,OAAA,EAC9C,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EAAgB,GAAA,EAAK,iBAAA,EAC3C,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EAAgB,GAAA,EAAK,iBAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,IAAA,EAAK,OAAA,EAAQ,aAAA,EACnB,QAAA,EAAA,SAAA,mBACC,GAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAW,OAAA,CAAQ,WAAA,EAAa,IAAA,EAAM,SAAA,EACzC,QAAA,EAAA,YAAA,EACH,CAAA,mBAEA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,WAAA,EAAc,QAAA,EAAA,YAAA,EAAa,GAEvD,CAAA,EACF,CAAA;AAAA,0BACC,KAAA,EAAA,EAAI,SAAA,EAAW,QAAQ,eAAA,EAAiB,GAAA,EAAK,oBAC3C,QAAA,EAAA,aAAA,EACH;AAAA,KAAA,EACF,CAAA,EACF,CAAA;AAAA,IACC,IAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,QAAQ,IAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,iBAAA,EAAmB,oBAAA,EACvB,QAAA,kBAAA,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,IAAA,EAAM,IAAI,CAAA,GAAA,qBACT,GAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QAEC,IAAI,GAAA,CAAI,EAAA;AAAA,QACR,MAAM,GAAA,CAAI,IAAA;AAAA,QACV,eAAe,GAAA,CAAI,aAAA;AAAA,QAElB,QAAA,EAAA,GAAA,CAAI;AAAA,OAAA;AAAA,MALA,GAAA,CAAI;AAAA,KAOZ,CAAA,EACH,CAAA,EACF,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -1,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-PluginHeaderToolbarWrapper__56dbd6a833 {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: var(--bui-bg-neutral-1);\n padding-inline: var(--bui-space-5);\n border-bottom: 1px solid var(--bui-border-1);\n color: var(--bui-fg-primary);\n height: 52px;\n }\n\n .PluginHeader_bui-PluginHeaderToolbarContent__56dbd6a833 {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderToolbarName__56dbd6a833 {\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__56dbd6a833 {\n width: 16px;\n height: 16px;\n color: var(--bui-fg-primary);\n\n & svg {\n width: 100%;\n height: 100%;\n }\n }\n\n .PluginHeader_bui-PluginHeaderToolbarControls__56dbd6a833 {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderTabsWrapper__56dbd6a833 {\n padding-inline: var(--bui-space-3);\n border-bottom: 1px solid var(--bui-border-1);\n background-color: var(--bui-bg-neutral-1);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-PluginHeaderToolbarWrapper":"PluginHeader_bui-PluginHeaderToolbarWrapper__56dbd6a833","bui-PluginHeaderToolbarContent":"PluginHeader_bui-PluginHeaderToolbarContent__56dbd6a833","bui-PluginHeaderToolbarName":"PluginHeader_bui-PluginHeaderToolbarName__56dbd6a833","bui-PluginHeaderToolbarIcon":"PluginHeader_bui-PluginHeaderToolbarIcon__56dbd6a833","bui-PluginHeaderToolbarControls":"PluginHeader_bui-PluginHeaderToolbarControls__56dbd6a833","bui-PluginHeaderTabsWrapper":"PluginHeader_bui-PluginHeaderTabsWrapper__56dbd6a833"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import 'clsx';
|
|
3
|
+
import '../../hooks/useBreakpoint.esm.js';
|
|
4
|
+
import '../../hooks/useBg.esm.js';
|
|
5
|
+
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
+
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
7
|
+
import styles from './PluginHeader.module.css.esm.js';
|
|
8
|
+
|
|
9
|
+
const PluginHeaderDefinition = defineComponent()({
|
|
10
|
+
styles,
|
|
2
11
|
classNames: {
|
|
3
12
|
root: "bui-PluginHeader",
|
|
4
13
|
toolbar: "bui-PluginHeaderToolbar",
|
|
@@ -7,9 +16,18 @@ const PluginHeaderDefinition = {
|
|
|
7
16
|
toolbarControls: "bui-PluginHeaderToolbarControls",
|
|
8
17
|
toolbarIcon: "bui-PluginHeaderToolbarIcon",
|
|
9
18
|
toolbarName: "bui-PluginHeaderToolbarName",
|
|
10
|
-
|
|
19
|
+
tabs: "bui-PluginHeaderTabsWrapper"
|
|
20
|
+
},
|
|
21
|
+
propDefs: {
|
|
22
|
+
icon: {},
|
|
23
|
+
title: {},
|
|
24
|
+
titleLink: {},
|
|
25
|
+
customActions: {},
|
|
26
|
+
tabs: {},
|
|
27
|
+
onTabSelectionChange: {},
|
|
28
|
+
className: {}
|
|
11
29
|
}
|
|
12
|
-
};
|
|
30
|
+
});
|
|
13
31
|
|
|
14
32
|
export { PluginHeaderDefinition };
|
|
15
33
|
//# sourceMappingURL=definition.esm.js.map
|
|
@@ -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 type {
|
|
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 toolbarWrapper: 'bui-PluginHeaderToolbarWrapper',\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,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;;;;"}
|
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import { useId } from 'react-aria';
|
|
3
4
|
import { Popover as Popover$1, OverlayArrow } from 'react-aria-components';
|
|
4
|
-
import
|
|
5
|
-
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
6
6
|
import { PopoverDefinition } from './definition.esm.js';
|
|
7
|
-
import
|
|
7
|
+
import { Box } from '../Box/Box.esm.js';
|
|
8
|
+
import '../Box/Box.module.css.esm.js';
|
|
9
|
+
import { BgReset } from '../../hooks/useBg.esm.js';
|
|
8
10
|
|
|
9
11
|
const Popover = forwardRef(
|
|
10
12
|
(props, ref) => {
|
|
11
|
-
const {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: clsx(classNames.content, styles[classNames.content]),
|
|
34
|
-
children
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
] })
|
|
38
|
-
}
|
|
39
|
-
);
|
|
13
|
+
const { ownProps, restProps } = useDefinition(PopoverDefinition, props);
|
|
14
|
+
const { classes, children, hideArrow } = ownProps;
|
|
15
|
+
const svgPathId = useId();
|
|
16
|
+
return /* @__PURE__ */ jsx(Popover$1, { className: classes.root, ...restProps, ref, children: ({ trigger }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
!hideArrow && trigger !== "MenuTrigger" && trigger !== "SubmenuTrigger" && /* @__PURE__ */ jsx(OverlayArrow, { className: classes.arrow, children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
id: svgPathId,
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
d: "M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z"
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
/* @__PURE__ */ jsx("use", { href: `#${svgPathId}` }),
|
|
27
|
+
/* @__PURE__ */ jsx("use", { href: `#${svgPathId}` }),
|
|
28
|
+
/* @__PURE__ */ jsx("path", { d: "M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z" })
|
|
29
|
+
] }) }),
|
|
30
|
+
/* @__PURE__ */ jsx(BgReset, { children: /* @__PURE__ */ jsx(Box, { bg: "neutral", className: classes.content, children }) })
|
|
31
|
+
] }) });
|
|
40
32
|
}
|
|
41
33
|
);
|
|
42
34
|
Popover.displayName = "Popover";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.esm.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { OverlayArrow, Popover as AriaPopover } from 'react-aria-components';\nimport
|
|
1
|
+
{"version":3,"file":"Popover.esm.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { useId } from 'react-aria';\nimport { OverlayArrow, Popover as AriaPopover } from 'react-aria-components';\nimport { PopoverProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PopoverDefinition } from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n/**\n * A popover component built on React Aria Components that displays floating\n * content anchored to a trigger element.\n *\n * @remarks\n * The Popover component supports multiple placements (top, right, bottom, left),\n * automatic viewport-constrained scrolling, and conditional arrow rendering. It\n * automatically handles positioning, collision detection, and ARIA attributes for\n * accessibility. Content is automatically padded and scrollable when it exceeds\n * available space.\n *\n * @example\n * Basic usage with DialogTrigger:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open Popover</Button>\n * <Popover>\n * <Text>Popover content</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @example\n * With custom placement and no arrow:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <Popover placement=\"right\" hideArrow>\n * <Text>Content without arrow</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @public\n */\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(PopoverDefinition, props);\n const { classes, children, hideArrow } = ownProps;\n const svgPathId = useId();\n\n return (\n <AriaPopover className={classes.root} {...restProps} ref={ref}>\n {({ trigger }) => (\n <>\n {!hideArrow &&\n trigger !== 'MenuTrigger' &&\n trigger !== 'SubmenuTrigger' && (\n <OverlayArrow className={classes.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <defs>\n <path\n id={svgPathId}\n fillRule=\"evenodd\"\n d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\"\n />\n </defs>\n\n <use href={`#${svgPathId}`} />\n <use href={`#${svgPathId}`} />\n\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n )}\n <BgReset>\n <Box bg=\"neutral\" className={classes.content}>\n {children}\n </Box>\n </BgReset>\n </>\n )}\n </AriaPopover>\n );\n },\n);\n\nPopover.displayName = 'Popover';\n"],"names":["AriaPopover"],"mappings":";;;;;;;;;;AA4DO,MAAM,OAAA,GAAU,UAAA;AAAA,EACrB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,mBAAmB,KAAK,CAAA;AACtE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,SAAA,EAAU,GAAI,QAAA;AACzC,IAAA,MAAM,YAAY,KAAA,EAAM;AAExB,IAAA,uBACE,GAAA,CAACA,SAAA,EAAA,EAAY,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,GAAA,EAClD,QAAA,EAAA,CAAC,EAAE,OAAA,EAAQ,qBACV,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,CAAC,aACA,OAAA,KAAY,aAAA,IACZ,YAAY,gBAAA,oBACV,GAAA,CAAC,gBAAa,SAAA,EAAW,OAAA,CAAQ,OAC/B,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,OAAM,IAAA,EAAK,MAAA,EAAO,MAAK,OAAA,EAAQ,WAAA,EAAY,MAAK,MAAA,EACnD,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAI,SAAA;AAAA,YACJ,QAAA,EAAS,SAAA;AAAA,YACT,CAAA,EAAE;AAAA;AAAA,SACJ,EACF,CAAA;AAAA,wBAEA,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAC5B,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAM,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,CAAA;AAAA,wBAE5B,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,qSAAA,EAAsS;AAAA,OAAA,EAChT,CAAA,EACF,CAAA;AAAA,sBAEJ,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAG,WAAU,SAAA,EAAW,OAAA,CAAQ,OAAA,EAClC,QAAA,EACH,CAAA,EACF;AAAA,KAAA,EACF,CAAA,EAEJ,CAAA;AAAA,EAEJ;AACF;AAEA,OAAA,CAAQ,WAAA,GAAc,SAAA;;;;"}
|
|
@@ -1,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 .Popover_bui-
|
|
4
|
-
var styles = {"bui-Popover":"Popover_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 .Popover_bui-Popover__f3b0d50727 {\n --popover-border-radius: var(--bui-radius-3);\n box-shadow: var(--bui-shadow);\n border-radius: var(--popover-border-radius);\n background: var(--bui-bg-app);\n border: 1px solid var(--bui-border-1);\n forced-color-adjust: none;\n outline: none;\n max-height: inherit;\n display: flex;\n flex-direction: column;\n /* fixes FF gap */\n transform: translate3d(0, 0, 0);\n transition: transform 200ms, opacity 200ms;\n\n &[data-entering],\n &[data-exiting] {\n transform: var(--origin);\n opacity: 0;\n }\n\n &[data-placement='top'] {\n --origin: translateY(4px);\n\n &:has(.Popover_bui-PopoverArrow__f3b0d50727) {\n margin-bottom: var(--bui-space-3);\n }\n }\n\n &[data-placement='right'] {\n --origin: translateX(-4px);\n\n &:has(.Popover_bui-PopoverArrow__f3b0d50727) {\n margin-left: var(--bui-space-3);\n }\n }\n\n &[data-placement='bottom'] {\n --origin: translateY(-4px);\n\n &:has(.Popover_bui-PopoverArrow__f3b0d50727) {\n margin-top: var(--bui-space-3);\n }\n }\n\n &[data-placement='left'] {\n --origin: translateX(4px);\n\n &:has(.Popover_bui-PopoverArrow__f3b0d50727) {\n margin-right: var(--bui-space-3);\n }\n }\n }\n\n .Popover_bui-PopoverContent__f3b0d50727 {\n overflow-x: hidden;\n overflow-y: auto;\n padding: var(--bui-space-4);\n flex: 1 1 auto;\n min-height: 0;\n border-radius: var(--popover-border-radius);\n }\n\n .Popover_bui-PopoverArrow__f3b0d50727 {\n & svg {\n display: block;\n\n /* The popover is rendered overlaying the main\n popover element by 1px. This causes the borders\n to overlap, which causes minor visual artifacts\n with transparent border colors. To mitigate this,\n we split the stroke and fill across separate\n elements in order to guarantee that the stroke is\n always overlaying a consistent color. */\n use:nth-of-type(1) {\n fill: var(--bui-bg-app);\n }\n use:nth-of-type(2) {\n fill: var(--bui-bg-neutral-1);\n }\n\n path {\n fill: var(--bui-border-1);\n }\n\n /* The arrow svg overlaps the popover by 2px, so we\n need to adjust the margins accordingly. */\n --popover-arrow-overlap: -2px;\n }\n\n &[data-placement='top'] svg {\n margin-top: var(--popover-arrow-overlap);\n }\n\n &[data-placement='bottom'] svg {\n margin-bottom: var(--popover-arrow-overlap);\n transform: rotate(180deg);\n }\n\n &[data-placement='right'] svg {\n margin-right: var(--popover-arrow-overlap);\n transform: rotate(90deg);\n }\n\n &[data-placement='left'] svg {\n margin-left: var(--popover-arrow-overlap);\n transform: rotate(-90deg);\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Popover":"Popover_bui-Popover__f3b0d50727","bui-PopoverArrow":"Popover_bui-PopoverArrow__f3b0d50727","bui-PopoverContent":"Popover_bui-PopoverContent__f3b0d50727"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import 'clsx';
|
|
3
|
+
import '../../hooks/useBreakpoint.esm.js';
|
|
4
|
+
import '../../hooks/useBg.esm.js';
|
|
5
|
+
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
+
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
7
|
+
import styles from './Popover.module.css.esm.js';
|
|
8
|
+
|
|
9
|
+
const PopoverDefinition = defineComponent()({
|
|
10
|
+
styles,
|
|
2
11
|
classNames: {
|
|
3
12
|
root: "bui-Popover",
|
|
4
13
|
arrow: "bui-PopoverArrow",
|
|
5
14
|
content: "bui-PopoverContent"
|
|
15
|
+
},
|
|
16
|
+
propDefs: {
|
|
17
|
+
children: {},
|
|
18
|
+
hideArrow: {},
|
|
19
|
+
className: {}
|
|
6
20
|
}
|
|
7
|
-
};
|
|
21
|
+
});
|
|
8
22
|
|
|
9
23
|
export { PopoverDefinition };
|
|
10
24
|
//# sourceMappingURL=definition.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PopoverOwnProps } from './types';\nimport styles from './Popover.module.css';\n\n/**\n * Component definition for Popover\n * @public\n */\nexport const PopoverDefinition = defineComponent<PopoverOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Popover',\n arrow: 'bui-PopoverArrow',\n content: 'bui-PopoverContent',\n },\n propDefs: {\n children: {},\n hideArrow: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useEffect } from 'react';
|
|
3
3
|
import { RadioGroup as RadioGroup$1, Radio as Radio$1 } from 'react-aria-components';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
4
|
import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
|
|
5
|
+
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
6
|
+
import '../FieldLabel/FieldLabel.module.css.esm.js';
|
|
6
7
|
import { FieldError } from '../FieldError/FieldError.esm.js';
|
|
7
|
-
import
|
|
8
|
-
import { RadioGroupDefinition } from './definition.esm.js';
|
|
9
|
-
import styles from './RadioGroup.module.css.esm.js';
|
|
8
|
+
import '../FieldError/FieldError.module.css.esm.js';
|
|
9
|
+
import { RadioGroupDefinition, RadioDefinition } from './definition.esm.js';
|
|
10
10
|
|
|
11
11
|
const RadioGroup = forwardRef(
|
|
12
12
|
(props, ref) => {
|
|
13
|
-
const {
|
|
13
|
+
const { ownProps, restProps } = useDefinition(RadioGroupDefinition, props);
|
|
14
14
|
const {
|
|
15
|
-
|
|
15
|
+
classes,
|
|
16
16
|
label,
|
|
17
17
|
secondaryLabel,
|
|
18
18
|
description,
|
|
19
19
|
isRequired,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = cleanedProps;
|
|
20
|
+
children
|
|
21
|
+
} = ownProps;
|
|
22
|
+
const ariaLabel = restProps["aria-label"];
|
|
23
|
+
const ariaLabelledBy = restProps["aria-labelledby"];
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
27
26
|
console.warn(
|
|
@@ -30,44 +29,26 @@ const RadioGroup = forwardRef(
|
|
|
30
29
|
}
|
|
31
30
|
}, [label, ariaLabel, ariaLabelledBy]);
|
|
32
31
|
const secondaryLabelText = secondaryLabel || (isRequired ? "Required" : null);
|
|
33
|
-
return /* @__PURE__ */ jsxs(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
label,
|
|
46
|
-
secondaryLabel: secondaryLabelText,
|
|
47
|
-
description
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ jsx("div", { className: clsx(classNames.content, styles[classNames.content]), children }),
|
|
51
|
-
/* @__PURE__ */ jsx(FieldError, {})
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
);
|
|
32
|
+
return /* @__PURE__ */ jsxs(RadioGroup$1, { className: classes.root, ...restProps, ref, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
FieldLabel,
|
|
35
|
+
{
|
|
36
|
+
label,
|
|
37
|
+
secondaryLabel: secondaryLabelText,
|
|
38
|
+
description
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: classes.content, children }),
|
|
42
|
+
/* @__PURE__ */ jsx(FieldError, {})
|
|
43
|
+
] });
|
|
55
44
|
}
|
|
56
45
|
);
|
|
57
46
|
RadioGroup.displayName = "RadioGroup";
|
|
58
47
|
const Radio = forwardRef((props, ref) => {
|
|
59
|
-
const {
|
|
60
|
-
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
Radio$1,
|
|
63
|
-
{
|
|
64
|
-
className: clsx(classNames.radio, styles[classNames.radio], className),
|
|
65
|
-
...rest,
|
|
66
|
-
ref
|
|
67
|
-
}
|
|
68
|
-
);
|
|
48
|
+
const { ownProps, restProps } = useDefinition(RadioDefinition, props);
|
|
49
|
+
return /* @__PURE__ */ jsx(Radio$1, { className: ownProps.classes.root, ...restProps, ref });
|
|
69
50
|
});
|
|
70
|
-
|
|
51
|
+
Radio.displayName = "Radio";
|
|
71
52
|
|
|
72
53
|
export { Radio, RadioGroup };
|
|
73
54
|
//# sourceMappingURL=RadioGroup.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport
|
|
1
|
+
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { RadioGroupDefinition, RadioDefinition } from './definition';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/** @public */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioGroupDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n isRequired,\n children,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'RadioGroup requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaRadioGroup className={classes.root} {...restProps} ref={ref}>\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div className={classes.content}>{children}</div>\n <FieldError />\n </AriaRadioGroup>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/** @public */\nexport const Radio = forwardRef<HTMLLabelElement, RadioProps>((props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioDefinition, props);\n\n return (\n <AriaRadio className={ownProps.classes.root} {...restProps} ref={ref} />\n );\n});\n\nRadio.displayName = 'Radio';\n"],"names":["AriaRadioGroup","AriaRadio"],"mappings":";;;;;;;;;;AA6BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,QAAA;AAEJ,IAAA,MAAM,SAAA,GAAY,UAAU,YAAY,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,UAAU,iBAAiB,CAAA;AAElD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAGrC,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAE/C,IAAA,4BACGA,YAAA,EAAA,EAAe,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EACtD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,KAAA;AAAA,UACA,cAAA,EAAgB,kBAAA;AAAA,UAChB;AAAA;AAAA,OACF;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAU,QAAA,EAAS,CAAA;AAAA,0BAC1C,UAAA,EAAA,EAAW;AAAA,KAAA,EACd,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAGlB,MAAM,KAAA,GAAQ,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,iBAAiB,KAAK,CAAA;AAEpE,EAAA,uBACE,GAAA,CAACC,WAAU,SAAA,EAAW,QAAA,CAAS,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EAAU,CAAA;AAE1E,CAAC;AAED,KAAA,CAAM,WAAA,GAAc,OAAA;;;;"}
|
|
@@ -1,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 .RadioGroup_bui-
|
|
4
|
-
var styles = {"bui-RadioGroup":"RadioGroup_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 .RadioGroup_bui-RadioGroup__5d12209cff {\n display: flex;\n flex-direction: column;\n color: var(--bui-fg-primary);\n }\n\n .RadioGroup_bui-RadioGroup__5d12209cff[data-orientation='horizontal'] .RadioGroup_bui-RadioGroupContent__5d12209cff {\n flex-direction: row;\n gap: var(--bui-space-4);\n }\n\n .RadioGroup_bui-RadioGroupContent__5d12209cff {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n }\n\n .RadioGroup_bui-Radio__5d12209cff {\n display: flex;\n /* This is needed so the HiddenInput is positioned correctly */\n position: relative;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-primary);\n forced-color-adjust: none;\n cursor: pointer;\n\n &:before {\n content: '';\n display: block;\n width: 1rem;\n height: 1rem;\n box-sizing: border-box;\n border: 0.125rem solid var(--bui-border-2);\n background: var(--bui-bg-neutral-1);\n border-radius: var(--bui-radius-full);\n transition: all 200ms;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-border-2);\n }\n\n &[data-selected] {\n &:before {\n border-color: var(--bui-bg-solid);\n border-width: 0.25rem;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-bg-solid);\n }\n }\n\n &[data-focus-visible]:before {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n\n &:before {\n background: var(--bui-bg-disabled);\n }\n }\n\n &[data-invalid]:before {\n border-color: var(--bui-border-danger);\n }\n\n &[data-invalid][data-selected]:before {\n border-color: var(--bui-border-danger);\n }\n\n /* Ensure disabled state prevails over invalid state */\n &[data-disabled][data-invalid] {\n color: var(--bui-fg-disabled);\n\n &:before {\n background: var(--bui-bg-disabled);\n }\n }\n\n &[data-readonly] {\n cursor: not-allowed;\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-RadioGroup":"RadioGroup_bui-RadioGroup__5d12209cff","bui-RadioGroupContent":"RadioGroup_bui-RadioGroupContent__5d12209cff","bui-Radio":"RadioGroup_bui-Radio__5d12209cff"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import 'clsx';
|
|
3
|
+
import '../../hooks/useBreakpoint.esm.js';
|
|
4
|
+
import '../../hooks/useBg.esm.js';
|
|
5
|
+
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
+
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
7
|
+
import styles from './RadioGroup.module.css.esm.js';
|
|
8
|
+
|
|
9
|
+
const RadioGroupDefinition = defineComponent()({
|
|
10
|
+
styles,
|
|
2
11
|
classNames: {
|
|
3
12
|
root: "bui-RadioGroup",
|
|
4
|
-
content: "bui-RadioGroupContent"
|
|
5
|
-
|
|
13
|
+
content: "bui-RadioGroupContent"
|
|
14
|
+
},
|
|
15
|
+
propDefs: {
|
|
16
|
+
children: {},
|
|
17
|
+
className: {},
|
|
18
|
+
label: {},
|
|
19
|
+
secondaryLabel: {},
|
|
20
|
+
description: {},
|
|
21
|
+
isRequired: {}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const RadioDefinition = defineComponent()({
|
|
25
|
+
styles,
|
|
26
|
+
classNames: {
|
|
27
|
+
root: "bui-Radio"
|
|
28
|
+
},
|
|
29
|
+
propDefs: {
|
|
30
|
+
className: {}
|
|
6
31
|
}
|
|
7
|
-
};
|
|
32
|
+
});
|
|
8
33
|
|
|
9
|
-
export { RadioGroupDefinition };
|
|
34
|
+
export { RadioDefinition, RadioGroupDefinition };
|
|
10
35
|
//# sourceMappingURL=definition.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { RadioGroupOwnProps, RadioOwnProps } from './types';\nimport styles from './RadioGroup.module.css';\n\n/**\n * Component definition for RadioGroup\n * @public\n */\nexport const RadioGroupDefinition = defineComponent<RadioGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n },\n propDefs: {\n children: {},\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n\n/**\n * Component definition for Radio\n * @public\n */\nexport const RadioDefinition = defineComponent<RadioOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Radio',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;AAMM,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|