@backstage/ui 0.12.0-next.2 → 0.12.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 +362 -1
- package/dist/components/Accordion/Accordion.esm.js +82 -97
- 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 +54 -13
- package/dist/components/Accordion/definition.esm.js.map +1 -1
- package/dist/components/Alert/definition.esm.js +1 -3
- package/dist/components/Alert/definition.esm.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.esm.js +2 -2
- package/dist/components/Box/Box.esm.js +2 -2
- package/dist/components/Box/Box.esm.js.map +1 -1
- package/dist/components/Box/Box.module.css.esm.js +2 -2
- package/dist/components/Box/definition.esm.js +3 -3
- package/dist/components/Box/definition.esm.js.map +1 -1
- package/dist/components/Button/Button.module.css.esm.js +2 -2
- package/dist/components/Button/definition.esm.js +2 -3
- package/dist/components/Button/definition.esm.js.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js +2 -2
- package/dist/components/ButtonIcon/definition.esm.js +2 -3
- package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.module.css.esm.js +2 -2
- 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 +27 -47
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/Card.module.css.esm.js +2 -2
- package/dist/components/Card/definition.esm.js +47 -7
- package/dist/components/Card/definition.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.esm.js +2 -2
- package/dist/components/Dialog/Dialog.esm.js +1 -1
- package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
- package/dist/components/Flex/Flex.esm.js +6 -8
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/Flex.module.css.esm.js +2 -2
- package/dist/components/Flex/definition.esm.js +8 -1
- package/dist/components/Flex/definition.esm.js.map +1 -1
- package/dist/components/FullPage/FullPage.esm.js +22 -0
- package/dist/components/FullPage/FullPage.esm.js.map +1 -0
- package/dist/components/FullPage/FullPage.module.css.esm.js +8 -0
- package/dist/components/FullPage/FullPage.module.css.esm.js.map +1 -0
- package/dist/components/FullPage/definition.esm.js +8 -0
- package/dist/components/FullPage/definition.esm.js.map +1 -0
- package/dist/components/Grid/Grid.esm.js +11 -15
- package/dist/components/Grid/Grid.esm.js.map +1 -1
- package/dist/components/Grid/Grid.module.css.esm.js +2 -2
- package/dist/components/Grid/definition.esm.js +16 -2
- package/dist/components/Grid/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.module.css.esm.js +2 -2
- package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
- package/dist/components/PluginHeader/PluginHeader.esm.js +88 -0
- package/dist/components/PluginHeader/PluginHeader.esm.js.map +1 -0
- package/dist/components/PluginHeader/PluginHeader.module.css.esm.js +8 -0
- package/dist/components/PluginHeader/PluginHeader.module.css.esm.js.map +1 -0
- package/dist/components/{Header/HeaderToolbar.esm.js → PluginHeader/PluginHeaderToolbar.esm.js} +6 -6
- package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js.map +1 -0
- package/dist/components/PluginHeader/definition.esm.js +15 -0
- package/dist/components/PluginHeader/definition.esm.js.map +1 -0
- package/dist/components/Popover/Popover.module.css.esm.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +2 -2
- package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
- package/dist/components/Select/Select.module.css.esm.js +2 -2
- package/dist/components/Table/Table.module.css.esm.js +2 -2
- package/dist/components/TablePagination/TablePagination.esm.js +1 -1
- package/dist/components/TextField/TextField.module.css.esm.js +2 -2
- package/dist/components/ToggleButton/ToggleButton.esm.js +1 -4
- package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.module.css.esm.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.css.esm.js +2 -2
- package/dist/css/styles.css +11 -13
- package/dist/hooks/useBg.esm.js +36 -0
- package/dist/hooks/useBg.esm.js.map +1 -0
- package/dist/hooks/useDefinition/defineComponent.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinition.esm.js +15 -12
- package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
- package/dist/index.d.ts +303 -77
- package/dist/index.esm.js +7 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/components/Header/Header.esm.js +0 -56
- package/dist/components/Header/Header.esm.js.map +0 -1
- package/dist/components/Header/Header.module.css.esm.js +0 -8
- package/dist/components/Header/Header.module.css.esm.js.map +0 -1
- package/dist/components/Header/HeaderToolbar.esm.js.map +0 -1
- package/dist/components/Header/definition.esm.js +0 -14
- package/dist/components/Header/definition.esm.js.map +0 -1
- package/dist/hooks/useSurface.esm.js +0 -74
- package/dist/hooks/useSurface.esm.js.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { PluginHeaderToolbar } from './PluginHeaderToolbar.esm.js';
|
|
3
|
+
import { Tabs, TabList, Tab } from '../Tabs/Tabs.esm.js';
|
|
4
|
+
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import { PluginHeaderDefinition } from './definition.esm.js';
|
|
6
|
+
import { useRef } from 'react';
|
|
7
|
+
import { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect.esm.js';
|
|
8
|
+
import styles from './PluginHeader.module.css.esm.js';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
|
|
11
|
+
const PluginHeader = (props) => {
|
|
12
|
+
const { classNames, cleanedProps } = useStyles(PluginHeaderDefinition, props);
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
tabs,
|
|
16
|
+
icon,
|
|
17
|
+
title,
|
|
18
|
+
titleLink,
|
|
19
|
+
customActions,
|
|
20
|
+
onTabSelectionChange
|
|
21
|
+
} = cleanedProps;
|
|
22
|
+
const hasTabs = tabs && tabs.length > 0;
|
|
23
|
+
const headerRef = useRef(null);
|
|
24
|
+
useIsomorphicLayoutEffect(() => {
|
|
25
|
+
const el = headerRef.current;
|
|
26
|
+
if (!el) return void 0;
|
|
27
|
+
const updateHeight = () => {
|
|
28
|
+
const height = el.offsetHeight;
|
|
29
|
+
document.documentElement.style.setProperty(
|
|
30
|
+
"--bui-header-height",
|
|
31
|
+
`${height}px`
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
updateHeight();
|
|
35
|
+
if (typeof ResizeObserver === "undefined") {
|
|
36
|
+
return () => {
|
|
37
|
+
document.documentElement.style.removeProperty("--bui-header-height");
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const observer = new ResizeObserver(updateHeight);
|
|
41
|
+
observer.observe(el);
|
|
42
|
+
return () => {
|
|
43
|
+
observer.disconnect();
|
|
44
|
+
document.documentElement.style.removeProperty("--bui-header-height");
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"header",
|
|
49
|
+
{
|
|
50
|
+
ref: headerRef,
|
|
51
|
+
className: clsx(classNames.root, styles[classNames.root], className),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
PluginHeaderToolbar,
|
|
55
|
+
{
|
|
56
|
+
icon,
|
|
57
|
+
title,
|
|
58
|
+
titleLink,
|
|
59
|
+
customActions,
|
|
60
|
+
hasTabs
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
tabs && /* @__PURE__ */ jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: clsx(
|
|
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
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { PluginHeader };
|
|
88
|
+
//# sourceMappingURL=PluginHeader.esm.js.map
|
|
@@ -0,0 +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 { PluginHeaderToolbar } from './PluginHeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { PluginHeaderDefinition } from './definition';\nimport { type NavigateOptions } from 'react-router-dom';\nimport { useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport styles from './PluginHeader.module.css';\nimport clsx from 'clsx';\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 { classNames, cleanedProps } = useStyles(PluginHeaderDefinition, props);\n const {\n className,\n tabs,\n icon,\n title,\n titleLink,\n customActions,\n onTabSelectionChange,\n } = cleanedProps;\n\n const hasTabs = tabs && tabs.length > 0;\n const headerRef = useRef<HTMLElement>(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 return (\n <header\n ref={headerRef}\n className={clsx(classNames.root, styles[classNames.root], className)}\n >\n <PluginHeaderToolbar\n icon={icon}\n title={title}\n titleLink={titleLink}\n customActions={customActions}\n hasTabs={hasTabs}\n />\n {tabs && (\n <div\n className={clsx(\n classNames.tabsWrapper,\n styles[classNames.tabsWrapper],\n )}\n >\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,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,wBAAwB,KAAK,CAAA;AAC5E,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACF,GAAI,YAAA;AAEJ,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AACtC,EAAA,MAAM,SAAA,GAAY,OAAoB,IAAI,CAAA;AAE1C,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,uBACE,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,GAAA,EAAK,SAAA;AAAA,MACL,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAEnE,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,KAAA;AAAA,YACA,SAAA;AAAA,YACA,aAAA;AAAA,YACA;AAAA;AAAA,SACF;AAAA,QACC,IAAA,oBACC,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,IAAA;AAAA,cACT,UAAA,CAAW,WAAA;AAAA,cACX,MAAA,CAAO,WAAW,WAAW;AAAA,aAC/B;AAAA,YAEA,QAAA,kBAAA,GAAA,CAAC,QAAK,iBAAA,EAAmB,oBAAA,EACvB,8BAAC,OAAA,EAAA,EACE,QAAA,EAAA,IAAA,EAAM,IAAI,CAAA,GAAA,qBACT,GAAA;AAAA,cAAC,GAAA;AAAA,cAAA;AAAA,gBAEC,IAAI,GAAA,CAAI,EAAA;AAAA,gBACR,MAAM,GAAA,CAAI,IAAA;AAAA,gBACV,eAAe,GAAA,CAAI,aAAA;AAAA,gBAElB,QAAA,EAAA,GAAA,CAAI;AAAA,eAAA;AAAA,cALA,GAAA,CAAI;AAAA,aAOZ,GACH,CAAA,EACF;AAAA;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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-PluginHeader__efdec6e38f {\n display: block;\n }\n\n .PluginHeader_bui-PluginHeaderToolbar__efdec6e38f {\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0px;\n right: 0px;\n height: 16px;\n background-color: var(--bui-bg-app);\n z-index: 0;\n }\n }\n\n .PluginHeader_bui-PluginHeaderToolbarWrapper__efdec6e38f {\n position: relative;\n z-index: 1;\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__efdec6e38f {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderToolbarName__efdec6e38f {\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__efdec6e38f {\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__efdec6e38f {\n position: absolute;\n right: var(--bui-space-5);\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .PluginHeader_bui-PluginHeaderTabsWrapper__efdec6e38f {\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-PluginHeader":"PluginHeader_bui-PluginHeader__efdec6e38f","bui-PluginHeaderToolbar":"PluginHeader_bui-PluginHeaderToolbar__efdec6e38f","bui-PluginHeaderToolbarWrapper":"PluginHeader_bui-PluginHeaderToolbarWrapper__efdec6e38f","bui-PluginHeaderToolbarContent":"PluginHeader_bui-PluginHeaderToolbarContent__efdec6e38f","bui-PluginHeaderToolbarName":"PluginHeader_bui-PluginHeaderToolbarName__efdec6e38f","bui-PluginHeaderToolbarIcon":"PluginHeader_bui-PluginHeaderToolbarIcon__efdec6e38f","bui-PluginHeaderToolbarControls":"PluginHeader_bui-PluginHeaderToolbarControls__efdec6e38f","bui-PluginHeaderTabsWrapper":"PluginHeader_bui-PluginHeaderTabsWrapper__efdec6e38f"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=PluginHeader.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginHeader.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/components/{Header/HeaderToolbar.esm.js → PluginHeader/PluginHeaderToolbar.esm.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Link } from 'react-aria-components';
|
|
3
3
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PluginHeaderDefinition } from './definition.esm.js';
|
|
5
5
|
import { useRef } from 'react';
|
|
6
6
|
import { RiShapesLine } from '@remixicon/react';
|
|
7
7
|
import { Text } from '../Text/Text.esm.js';
|
|
8
|
-
import styles from './
|
|
8
|
+
import styles from './PluginHeader.module.css.esm.js';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
const { classNames, cleanedProps } = useStyles(
|
|
11
|
+
const PluginHeaderToolbar = (props) => {
|
|
12
|
+
const { classNames, cleanedProps } = useStyles(PluginHeaderDefinition, props);
|
|
13
13
|
const { className, icon, title, titleLink, customActions, hasTabs } = cleanedProps;
|
|
14
14
|
const toolbarWrapperRef = useRef(null);
|
|
15
15
|
const toolbarContentRef = useRef(null);
|
|
@@ -90,5 +90,5 @@ const HeaderToolbar = (props) => {
|
|
|
90
90
|
);
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
export {
|
|
94
|
-
//# sourceMappingURL=
|
|
93
|
+
export { PluginHeaderToolbar };
|
|
94
|
+
//# sourceMappingURL=PluginHeaderToolbar.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginHeaderToolbar.esm.js","sources":["../../../src/components/PluginHeader/PluginHeaderToolbar.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 { Link } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { PluginHeaderDefinition } from './definition';\nimport { useRef } from 'react';\nimport { RiShapesLine } from '@remixicon/react';\nimport type { PluginHeaderToolbarProps } from './types';\nimport { Text } from '../Text';\nimport styles from './PluginHeader.module.css';\nimport clsx from 'clsx';\n\n/**\n * A component that renders the toolbar section of a plugin header.\n *\n * @internal\n */\nexport const PluginHeaderToolbar = (props: PluginHeaderToolbarProps) => {\n const { classNames, cleanedProps } = useStyles(PluginHeaderDefinition, props);\n const { className, icon, title, titleLink, customActions, hasTabs } =\n cleanedProps;\n\n // Refs for collision detection\n const toolbarWrapperRef = useRef<HTMLDivElement>(null);\n const toolbarContentRef = useRef<HTMLDivElement>(null);\n const toolbarControlsRef = useRef<HTMLDivElement>(null);\n\n const titleContent = (\n <>\n <div\n className={clsx(classNames.toolbarIcon, styles[classNames.toolbarIcon])}\n >\n {icon || <RiShapesLine />}\n </div>\n <Text variant=\"body-medium\">{title || 'Your plugin'}</Text>\n </>\n );\n\n return (\n <div\n className={clsx(\n classNames.toolbar,\n styles[classNames.toolbar],\n className,\n )}\n data-has-tabs={hasTabs}\n >\n <div\n className={clsx(\n classNames.toolbarWrapper,\n styles[classNames.toolbarWrapper],\n )}\n ref={toolbarWrapperRef}\n >\n <div\n className={clsx(\n classNames.toolbarContent,\n styles[classNames.toolbarContent],\n )}\n ref={toolbarContentRef}\n >\n <Text as=\"h1\" variant=\"body-medium\">\n {titleLink ? (\n <Link\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n href={titleLink}\n >\n {titleContent}\n </Link>\n ) : (\n <div\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n >\n {titleContent}\n </div>\n )}\n </Text>\n </div>\n <div\n className={clsx(\n classNames.toolbarControls,\n styles[classNames.toolbarControls],\n )}\n ref={toolbarControlsRef}\n >\n {customActions}\n </div>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAoC;AACtE,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,wBAAwB,KAAK,CAAA;AAC5E,EAAA,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,OAAO,SAAA,EAAW,aAAA,EAAe,SAAQ,GAChE,YAAA;AAGF,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,MAAM,+BACJ,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,aAAa,MAAA,CAAO,UAAA,CAAW,WAAW,CAAC,CAAA;AAAA,QAErE,QAAA,EAAA,IAAA,wBAAS,YAAA,EAAA,EAAa;AAAA;AAAA,KACzB;AAAA,oBACA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,aAAA,EAAe,mBAAS,aAAA,EAAc;AAAA,GAAA,EACtD,CAAA;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,OAAA;AAAA,QACX,MAAA,CAAO,WAAW,OAAO,CAAA;AAAA,QACzB;AAAA,OACF;AAAA,MACA,eAAA,EAAe,OAAA;AAAA,MAEf,QAAA,kBAAA,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,CAAW,cAAA;AAAA,YACX,MAAA,CAAO,WAAW,cAAc;AAAA,WAClC;AAAA,UACA,GAAA,EAAK,iBAAA;AAAA,UAEL,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,cAAA;AAAA,kBACX,MAAA,CAAO,WAAW,cAAc;AAAA,iBAClC;AAAA,gBACA,GAAA,EAAK,iBAAA;AAAA,gBAEL,8BAAC,IAAA,EAAA,EAAK,EAAA,EAAG,IAAA,EAAK,OAAA,EAAQ,eACnB,QAAA,EAAA,SAAA,mBACC,GAAA;AAAA,kBAAC,IAAA;AAAA,kBAAA;AAAA,oBACC,SAAA,EAAW,IAAA;AAAA,sBACT,UAAA,CAAW,WAAA;AAAA,sBACX,MAAA,CAAO,WAAW,WAAW;AAAA,qBAC/B;AAAA,oBACA,IAAA,EAAM,SAAA;AAAA,oBAEL,QAAA,EAAA;AAAA;AAAA,iBACH,mBAEA,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,SAAA,EAAW,IAAA;AAAA,sBACT,UAAA,CAAW,WAAA;AAAA,sBACX,MAAA,CAAO,WAAW,WAAW;AAAA,qBAC/B;AAAA,oBAEC,QAAA,EAAA;AAAA;AAAA,iBACH,EAEJ;AAAA;AAAA,aACF;AAAA,4BACA,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,eAAA;AAAA,kBACX,MAAA,CAAO,WAAW,eAAe;AAAA,iBACnC;AAAA,gBACA,GAAA,EAAK,kBAAA;AAAA,gBAEJ,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const PluginHeaderDefinition = {
|
|
2
|
+
classNames: {
|
|
3
|
+
root: "bui-PluginHeader",
|
|
4
|
+
toolbar: "bui-PluginHeaderToolbar",
|
|
5
|
+
toolbarWrapper: "bui-PluginHeaderToolbarWrapper",
|
|
6
|
+
toolbarContent: "bui-PluginHeaderToolbarContent",
|
|
7
|
+
toolbarControls: "bui-PluginHeaderToolbarControls",
|
|
8
|
+
toolbarIcon: "bui-PluginHeaderToolbarIcon",
|
|
9
|
+
toolbarName: "bui-PluginHeaderToolbarName",
|
|
10
|
+
tabsWrapper: "bui-PluginHeaderTabsWrapper"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { PluginHeaderDefinition };
|
|
15
|
+
//# sourceMappingURL=definition.esm.js.map
|
|
@@ -0,0 +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 { ComponentDefinition } from '../../types';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = {\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 tabsWrapper: 'bui-PluginHeaderTabsWrapper',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,sBAAA,GAAyB;AAAA,EACpC,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,WAAA,EAAa;AAAA;AAEjB;;;;"}
|
|
@@ -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__d086d67b7e {\n box-shadow: var(--bui-shadow);\n border-radius: var(--bui-radius-3);\n background: var(--bui-bg-popover);\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__d086d67b7e) {\n margin-bottom: var(--bui-space-3);\n }\n }\n\n &[data-placement='right'] {\n --origin: translateX(-4px);\n\n &:has(.Popover_bui-PopoverArrow__d086d67b7e) {\n margin-left: var(--bui-space-3);\n }\n }\n\n &[data-placement='bottom'] {\n --origin: translateY(-4px);\n\n &:has(.Popover_bui-PopoverArrow__d086d67b7e) {\n margin-top: var(--bui-space-3);\n }\n }\n\n &[data-placement='left'] {\n --origin: translateX(4px);\n\n &:has(.Popover_bui-PopoverArrow__d086d67b7e) {\n margin-right: var(--bui-space-3);\n }\n }\n }\n\n .Popover_bui-PopoverContent__d086d67b7e {\n overflow-x: hidden;\n overflow-y: auto;\n padding: var(--bui-space-4);\n flex: 1 1 auto;\n min-height: 0;\n }\n\n .Popover_bui-PopoverArrow__d086d67b7e {\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 path:nth-child(1) {\n fill: var(--bui-bg-popover);\n }\n\n path:nth-child(2) {\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__d086d67b7e","bui-PopoverArrow":"Popover_bui-PopoverArrow__d086d67b7e","bui-PopoverContent":"Popover_bui-PopoverContent__d086d67b7e"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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__3998cb3970 {\n display: flex;\n flex-direction: column;\n color: var(--bui-fg-primary);\n }\n\n .RadioGroup_bui-RadioGroup__3998cb3970[data-orientation='horizontal'] .RadioGroup_bui-RadioGroupContent__3998cb3970 {\n flex-direction: row;\n gap: var(--bui-space-4);\n }\n\n .RadioGroup_bui-RadioGroupContent__3998cb3970 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n }\n\n .RadioGroup_bui-Radio__3998cb3970 {\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\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}\n";
|
|
4
|
+
var styles = {"bui-RadioGroup":"RadioGroup_bui-RadioGroup__3998cb3970","bui-RadioGroupContent":"RadioGroup_bui-RadioGroupContent__3998cb3970","bui-Radio":"RadioGroup_bui-Radio__3998cb3970"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 .SearchField_bui-
|
|
4
|
-
var styles = {"bui-SearchField":"SearchField_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 .SearchField_bui-SearchField__c8942d320f {\n display: flex;\n flex-direction: column;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex: 1;\n flex-shrink: 0;\n\n &[data-size='small'] {\n --search-field-item-height: 2rem;\n }\n\n &[data-size='medium'] {\n --search-field-item-height: 2.5rem;\n }\n\n &[data-empty] {\n .SearchField_bui-SearchFieldClear__c8942d320f {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out, width 0.3s ease-in-out,\n max-width 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n cursor: pointer;\n\n &[data-size='medium'] {\n flex-basis: 2.5rem;\n width: 2.5rem;\n max-width: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-size='small'] {\n flex-basis: 2rem;\n width: 2rem;\n max-width: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField_bui-SearchFieldInput__c8942d320f {\n &::placeholder {\n opacity: 0;\n }\n }\n\n &[data-size='small'] .SearchField_bui-SearchFieldInput__c8942d320f {\n &::placeholder {\n opacity: 0;\n }\n }\n\n .SearchField_bui-SearchFieldInputWrapper__c8942d320f {\n .SearchField_bui-SearchFieldInput__c8942d320f[data-icon] {\n padding-right: 0px;\n }\n }\n }\n\n &[data-collapsed='false'] {\n flex-basis: 200px;\n width: 200px;\n max-width: 200px;\n }\n }\n }\n\n .SearchField_bui-SearchFieldInputWrapper__c8942d320f {\n display: flex;\n align-items: center;\n border-radius: var(--bui-radius-2);\n border: 1px solid var(--bui-border-2);\n background-color: var(--bui-bg-neutral-1);\n transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n\n &[data-size='small'] {\n height: 2rem;\n }\n\n &[data-size='medium'] {\n height: 2.5rem;\n }\n\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n }\n\n .SearchField_bui-SearchFieldInputIcon__c8942d320f {\n flex: 0 0 auto;\n display: grid;\n place-content: center;\n color: var(--bui-fg-primary);\n pointer-events: none;\n width: var(--search-field-item-height);\n height: var(--search-field-item-height);\n /* To animate the icon when the input is collapsed */\n transition: opacity 0.2s ease-in-out;\n\n & svg {\n .SearchField_bui-SearchField__c8942d320f[data-size='small'] & {\n width: 1rem;\n height: 1rem;\n }\n\n .SearchField_bui-SearchField__c8942d320f[data-size='medium'] & {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n }\n\n .SearchField_bui-SearchFieldInput__c8942d320f {\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 transition: padding 0.3s ease-in-out;\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 &[data-disabled] {\n cursor: not-allowed;\n }\n\n &:first-child {\n .SearchField_bui-SearchField__c8942d320f[data-size='small'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n\n .SearchField_bui-SearchField__c8942d320f[data-size='medium'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n }\n }\n\n .SearchField_bui-SearchFieldClear__c8942d320f {\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-field-item-height);\n height: var(--search-field-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";
|
|
4
|
+
var styles = {"bui-SearchField":"SearchField_bui-SearchField__c8942d320f","bui-SearchFieldClear":"SearchField_bui-SearchFieldClear__c8942d320f","bui-SearchFieldInput":"SearchField_bui-SearchFieldInput__c8942d320f","bui-SearchFieldInputWrapper":"SearchField_bui-SearchFieldInputWrapper__c8942d320f","bui-SearchFieldInputIcon":"SearchField_bui-SearchFieldInputIcon__c8942d320f"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 .Select_bui-
|
|
4
|
-
var styles = {"bui-Select":"Select_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 .Select_bui-Select__c75960c577,\n .Select_bui-SelectPopover__c75960c577 {\n &[data-size='small'] {\n --select-item-height: 2rem;\n }\n\n &[data-size='medium'] {\n --select-item-height: 2.5rem;\n }\n }\n\n .Select_bui-SelectPopover__c75960c577 {\n min-width: var(--trigger-width);\n }\n\n .Select_bui-SelectTrigger__c75960c577 {\n box-sizing: border-box;\n border-radius: var(--bui-radius-3);\n border: 1px solid var(--bui-border-2);\n background-color: var(--bui-bg-neutral-1);\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n gap: var(--bui-space-2);\n width: 100%;\n height: var(--select-item-height);\n\n .Select_bui-Select__c75960c577[data-size='small'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n\n .Select_bui-Select__c75960c577[data-size='medium'] & {\n padding-inline: var(--bui-space-4) 0;\n }\n\n & svg {\n flex-shrink: 0;\n color: var(--bui-fg-secondary);\n\n .Select_bui-Select__c75960c577[data-size='small'] & {\n width: 1rem;\n height: 1rem;\n }\n\n .Select_bui-Select__c75960c577[data-size='medium'] & {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n .Select_bui-Select__c75960c577[data-invalid] & {\n border-color: var(--bui-fg-danger);\n\n &:focus-visible,\n &:hover {\n outline: 1px solid var(--bui-fg-danger);\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select_bui-SelectTriggerChevron__c75960c577 {\n display: grid;\n place-content: center;\n width: var(--select-item-height);\n height: var(--select-item-height);\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n .Select_bui-SelectValue__c75960c577 {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\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 text-align: left;\n\n & .Select_bui-SelectItemIndicator__c75960c577 {\n display: none;\n }\n\n &[disabled] {\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select_bui-SelectList__c75960c577:focus-visible {\n /* Remove default focus-visible outline because React Aria\n * triggers it on mouse click open of the list for some reason.\n * On keyboard use, the top item receives the focus style,\n * so it's not needed anyway. */\n outline: none;\n }\n\n .Select_bui-SelectItem__c75960c577 {\n box-sizing: border-box;\n position: relative;\n width: var(--anchor-width);\n display: grid;\n grid-template-areas: 'icon text';\n grid-template-columns: 1rem 1fr;\n align-items: center;\n min-height: var(--select-item-height);\n padding-block: var(--bui-space-1);\n padding-left: var(--bui-space-3);\n padding-right: var(--bui-space-4);\n color: var(--bui-fg-primary);\n cursor: pointer;\n user-select: none;\n font-size: var(--bui-font-size-3);\n gap: var(--bui-space-2);\n outline: none;\n\n &[data-focused]::before {\n content: '';\n position: absolute;\n inset-block: 0;\n inset-inline: var(--bui-space-1);\n border-radius: var(--bui-radius-2);\n background: var(--bui-bg-neutral-2);\n z-index: -1;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-selected] .Select_bui-SelectItemIndicator__c75960c577 {\n opacity: 1;\n }\n }\n\n .Select_bui-SelectItemIndicator__c75960c577 {\n grid-area: icon;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n }\n\n .Select_bui-SelectItemLabel__c75960c577 {\n flex: 1;\n grid-area: text;\n }\n\n .Select_bui-SelectSearchWrapper__c75960c577 {\n flex-shrink: 0;\n margin-bottom: var(--bui-space-1);\n display: flex;\n align-items: center;\n padding-inline: var(--bui-space-3) 0;\n border-bottom: 1px solid var(--bui-border-2);\n }\n\n .Select_bui-SelectSearch__c75960c577 {\n border: none;\n background-color: transparent;\n padding: 0;\n color: var(--bui-fg-primary);\n flex: 1;\n outline: none;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n height: var(--select-item-height);\n line-height: var(--select-item-height);\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n /* Hide native browser clear button */\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n }\n\n .Select_bui-SelectSearchClear__c75960c577 {\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(--select-item-height);\n height: var(--select-item-height);\n\n input:placeholder-shown + & {\n display: none;\n }\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Select_bui-SelectNoResults__c75960c577 {\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-Select":"Select_bui-Select__c75960c577","bui-SelectPopover":"Select_bui-SelectPopover__c75960c577","bui-SelectTrigger":"Select_bui-SelectTrigger__c75960c577","bui-SelectTriggerChevron":"Select_bui-SelectTriggerChevron__c75960c577","bui-SelectValue":"Select_bui-SelectValue__c75960c577","bui-SelectItemIndicator":"Select_bui-SelectItemIndicator__c75960c577","bui-SelectList":"Select_bui-SelectList__c75960c577","bui-SelectItem":"Select_bui-SelectItem__c75960c577","bui-SelectItemLabel":"Select_bui-SelectItemLabel__c75960c577","bui-SelectSearchWrapper":"Select_bui-SelectSearchWrapper__c75960c577","bui-SelectSearch":"Select_bui-SelectSearch__c75960c577","bui-SelectSearchClear":"Select_bui-SelectSearchClear__c75960c577","bui-SelectNoResults":"Select_bui-SelectNoResults__c75960c577"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 .Table_bui-
|
|
4
|
-
var styles = {"bui-Table":"Table_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 .Table_bui-Table__7b93b44f2c {\n width: 100%;\n caption-side: bottom;\n border-collapse: collapse;\n table-layout: fixed;\n transition: opacity 0.2s ease-in-out;\n\n &[data-stale='true'] {\n opacity: 0.6;\n }\n }\n\n .Table_bui-TableHeader__7b93b44f2c {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n }\n\n .Table_bui-TableHead__7b93b44f2c {\n text-align: left;\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableHeadSelection__7b93b44f2c {\n width: 40px;\n }\n\n .Table_bui-TableHeadContent__7b93b44f2c {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-1);\n }\n\n .Table_bui-TableHeadSortButton__7b93b44f2c {\n cursor: pointer;\n user-select: none;\n display: inline-flex;\n align-items: center;\n gap: var(--bui-space-1);\n opacity: 0;\n transition: opacity 0.1s ease-in-out;\n color: var(--bui-fg-secondary);\n\n .Table_bui-TableHead__7b93b44f2c:hover &,\n [data-sort-direction='ascending'] &,\n [data-sort-direction='descending'] & {\n opacity: 1;\n }\n\n & svg {\n transition: transform 0.1s ease-in-out;\n }\n [data-sort-direction='descending'] & svg {\n transform: rotate(180deg);\n }\n }\n\n .Table_bui-TableBody__7b93b44f2c {\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableRow__7b93b44f2c {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n\n &:hover {\n background-color: var(--bui-bg-tint-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-tint-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-tint-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-tint-disabled);\n }\n\n &[data-react-aria-pressable='true'] {\n cursor: pointer;\n }\n }\n\n .Table_bui-TableCell__7b93b44f2c {\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n min-width: 0;\n overflow: hidden;\n }\n\n .Table_bui-TableCellSelection__7b93b44f2c {\n width: 40px;\n }\n\n .Table_bui-TableCellContentWrapper__7b93b44f2c {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n min-width: 0;\n width: 100%;\n max-width: 100%;\n }\n\n .Table_bui-TableCellIcon__7b93b44f2c,\n .Table_bui-TableCellIcon__7b93b44f2c svg {\n display: inline-flex;\n align-items: center;\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableCellContent__7b93b44f2c {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-0_5);\n min-width: 0;\n flex: 1;\n overflow: hidden;\n max-width: 100%;\n }\n\n .Table_bui-TableCellContent__7b93b44f2c > * {\n min-width: 0;\n max-width: 100%;\n }\n\n .Table_bui-TableCellProfile__7b93b44f2c {\n display: flex;\n flex-direction: row;\n gap: var(--bui-space-2);\n align-items: center;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Table":"Table_bui-Table__7b93b44f2c","bui-TableHeader":"Table_bui-TableHeader__7b93b44f2c","bui-TableHead":"Table_bui-TableHead__7b93b44f2c","bui-TableHeadSelection":"Table_bui-TableHeadSelection__7b93b44f2c","bui-TableHeadContent":"Table_bui-TableHeadContent__7b93b44f2c","bui-TableHeadSortButton":"Table_bui-TableHeadSortButton__7b93b44f2c","bui-TableBody":"Table_bui-TableBody__7b93b44f2c","bui-TableRow":"Table_bui-TableRow__7b93b44f2c","bui-TableCell":"Table_bui-TableCell__7b93b44f2c","bui-TableCellSelection":"Table_bui-TableCellSelection__7b93b44f2c","bui-TableCellContentWrapper":"Table_bui-TableCellContentWrapper__7b93b44f2c","bui-TableCellIcon":"Table_bui-TableCellIcon__7b93b44f2c","bui-TableCellContent":"Table_bui-TableCellContent__7b93b44f2c","bui-TableCellProfile":"Table_bui-TableCellProfile__7b93b44f2c"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -4,7 +4,7 @@ import { useId } from 'react-aria';
|
|
|
4
4
|
import { Text } from '../Text/Text.esm.js';
|
|
5
5
|
import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
|
-
import '../../hooks/
|
|
7
|
+
import '../../hooks/useBg.esm.js';
|
|
8
8
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
9
9
|
import '../ButtonIcon/ButtonIcon.module.css.esm.js';
|
|
10
10
|
import { Select } from '../Select/Select.esm.js';
|
|
@@ -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 .TextField_bui-
|
|
4
|
-
var styles = {"bui-TextField":"TextField_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 .TextField_bui-TextField__69bcafe176 {\n display: flex;\n flex-direction: column;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex-shrink: 0;\n }\n\n .TextField_bui-InputWrapper__69bcafe176 {\n position: relative;\n\n &[data-size='small'] .TextField_bui-Input__69bcafe176 {\n height: 2rem;\n }\n\n &[data-size='medium'] .TextField_bui-Input__69bcafe176 {\n height: 2.5rem;\n }\n\n &[data-size='small'] .TextField_bui-Input__69bcafe176[data-icon] {\n padding-left: var(--bui-space-8);\n }\n\n &[data-size='medium'] .TextField_bui-Input__69bcafe176[data-icon] {\n padding-left: var(--bui-space-9);\n }\n }\n\n .TextField_bui-InputIcon__69bcafe176 {\n position: absolute;\n left: var(--bui-space-3);\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--bui-space-1);\n color: var(--bui-fg-primary);\n flex-shrink: 0;\n pointer-events: none;\n /* To animate the icon when the input is collapsed */\n transition: left 0.2s ease-in-out;\n\n &[data-size='small'],\n &[data-size='small'] svg {\n width: 1rem;\n height: 1rem;\n }\n\n &[data-size='medium'],\n &[data-size='medium'] svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n\n .TextField_bui-Input__69bcafe176 {\n display: flex;\n align-items: center;\n padding: 0 var(--bui-space-3);\n border-radius: var(--bui-radius-2);\n border: 1px solid var(--bui-border-2);\n background-color: var(--bui-bg-neutral-1);\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 transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n width: 100%;\n height: 100%;\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 &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-TextField":"TextField_bui-TextField__69bcafe176","bui-InputWrapper":"TextField_bui-InputWrapper__69bcafe176","bui-Input":"TextField_bui-Input__69bcafe176","bui-InputIcon":"TextField_bui-InputIcon__69bcafe176"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -5,7 +5,6 @@ import { ToggleButton as ToggleButton$1 } from 'react-aria-components';
|
|
|
5
5
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
6
6
|
import { ToggleButtonDefinition } from './definition.esm.js';
|
|
7
7
|
import styles from './ToggleButton.module.css.esm.js';
|
|
8
|
-
import { useSurface } from '../../hooks/useSurface.esm.js';
|
|
9
8
|
|
|
10
9
|
const ToggleButton = forwardRef(
|
|
11
10
|
(props, ref) => {
|
|
@@ -16,15 +15,13 @@ const ToggleButton = forwardRef(
|
|
|
16
15
|
...props
|
|
17
16
|
}
|
|
18
17
|
);
|
|
19
|
-
const { children, className, iconStart, iconEnd,
|
|
20
|
-
const { surface } = useSurface({ onSurface });
|
|
18
|
+
const { children, className, iconStart, iconEnd, ...rest } = cleanedProps;
|
|
21
19
|
return /* @__PURE__ */ jsx(
|
|
22
20
|
ToggleButton$1,
|
|
23
21
|
{
|
|
24
22
|
className: clsx(classNames.root, styles[classNames.root], className),
|
|
25
23
|
ref,
|
|
26
24
|
...dataAttributes,
|
|
27
|
-
...typeof surface === "string" ? { "data-on-surface": surface } : {},
|
|
28
25
|
...rest,
|
|
29
26
|
children: (renderProps) => {
|
|
30
27
|
const renderedChildren = typeof children === "function" ? children(renderProps) : children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.esm.js","sources":["../../../src/components/ToggleButton/ToggleButton.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { ToggleButton as AriaToggleButton } from 'react-aria-components';\nimport type { ToggleButtonProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ToggleButtonDefinition } from './definition';\nimport styles from './ToggleButton.module.css';\
|
|
1
|
+
{"version":3,"file":"ToggleButton.esm.js","sources":["../../../src/components/ToggleButton/ToggleButton.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { ToggleButton as AriaToggleButton } from 'react-aria-components';\nimport type { ToggleButtonProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ToggleButtonDefinition } from './definition';\nimport styles from './ToggleButton.module.css';\n\n/** @public */\nexport const ToggleButton = forwardRef(\n (props: ToggleButtonProps, ref: Ref<HTMLButtonElement>) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles(\n ToggleButtonDefinition,\n {\n size: 'small',\n ...props,\n },\n );\n\n const { children, className, iconStart, iconEnd, ...rest } = cleanedProps;\n\n return (\n <AriaToggleButton\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n {...dataAttributes}\n {...rest}\n >\n {renderProps => {\n // If children is a function, call it with render props; otherwise use children as-is\n const renderedChildren =\n typeof children === 'function' ? children(renderProps) : children;\n\n return (\n <span\n className={clsx(classNames.content, styles[classNames.content])}\n data-slot=\"content\"\n >\n {iconStart}\n {renderedChildren}\n {iconEnd}\n </span>\n );\n }}\n </AriaToggleButton>\n );\n },\n);\n\nToggleButton.displayName = 'ToggleButton';\n"],"names":["AriaToggleButton"],"mappings":";;;;;;;;AAyBO,MAAM,YAAA,GAAe,UAAA;AAAA,EAC1B,CAAC,OAA0B,GAAA,KAAgC;AACzD,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,SAAA;AAAA,MACnD,sBAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,OAAA;AAAA,QACN,GAAG;AAAA;AACL,KACF;AAEA,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,WAAW,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAE7D,IAAA,uBACE,GAAA;AAAA,MAACA,cAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QACnE,GAAA;AAAA,QACC,GAAG,cAAA;AAAA,QACH,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA,CAAA,WAAA,KAAe;AAEd,UAAA,MAAM,mBACJ,OAAO,QAAA,KAAa,UAAA,GAAa,QAAA,CAAS,WAAW,CAAA,GAAI,QAAA;AAE3D,UAAA,uBACE,IAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,cAC9D,WAAA,EAAU,SAAA;AAAA,cAET,QAAA,EAAA;AAAA,gBAAA,SAAA;AAAA,gBACA,gBAAA;AAAA,gBACA;AAAA;AAAA;AAAA,WACH;AAAA,QAEJ;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;AAEA,YAAA,CAAa,WAAA,GAAc,cAAA;;;;"}
|
|
@@ -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 .ToggleButtonGroup_bui-
|
|
4
|
-
var styles = {"bui-ToggleButtonGroup":"ToggleButtonGroup_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 .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9 {\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n border-radius: var(--bui-radius-2);\n overflow: hidden;\n box-shadow: inset 0 0 0 1px var(--bui-border-2);\n width: fit-content;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical'] {\n flex-direction: column;\n align-items: stretch;\n width: fit-content;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9 > .bui-ToggleButton {\n border-radius: 0;\n margin: 0;\n box-shadow: none;\n border: 0;\n }\n\n /* Horizontal radius rules (default orientation) */\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:not([data-orientation='vertical'])\n > .bui-ToggleButton {\n border-radius: 0;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:not([data-orientation='vertical'])\n > .bui-ToggleButton:first-child {\n border-radius: var(--bui-radius-2) 0 0 var(--bui-radius-2);\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:not([data-orientation='vertical'])\n > .bui-ToggleButton:last-child {\n border-radius: 0 var(--bui-radius-2) var(--bui-radius-2) 0;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:not([data-orientation='vertical'])\n > .bui-ToggleButton:only-child {\n border-radius: var(--bui-radius-2);\n }\n\n /* Horizontal dividers */\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:not([data-orientation='vertical'])\n .bui-ToggleButton\n + .bui-ToggleButton {\n border-left: 1px solid var(--bui-border-2);\n }\n\n /* Vertical dividers */\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n .bui-ToggleButton {\n width: 100%;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n .bui-ToggleButton\n + .bui-ToggleButton {\n border-top: 1px solid var(--bui-border-2);\n }\n\n /* Vertical radius rules */\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n > .bui-ToggleButton {\n border-radius: 0;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n > .bui-ToggleButton:first-child {\n border-radius: var(--bui-radius-2) var(--bui-radius-2) 0 0;\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n > .bui-ToggleButton:last-child {\n border-radius: 0 0 var(--bui-radius-2) var(--bui-radius-2);\n }\n\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9[data-orientation='vertical']\n > .bui-ToggleButton:only-child {\n border-radius: var(--bui-radius-2);\n }\n\n /* Focus ring on group surface */\n .ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9:focus-visible {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-ToggleButtonGroup":"ToggleButtonGroup_bui-ToggleButtonGroup__dea0d4d0f9"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 .Tooltip_bui-
|
|
4
|
-
var styles = {"bui-Tooltip":"Tooltip_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 .Tooltip_bui-Tooltip__fd7a4c2f9a {\n box-shadow: var(--bui-shadow);\n border-radius: 4px;\n background: var(--bui-bg-popover);\n border: 1px solid var(--bui-border-1);\n forced-color-adjust: none;\n outline: none;\n padding: var(--bui-space-2) var(--bui-space-3);\n max-width: 240px;\n /* fixes FF gap */\n transform: translate3d(0, 0, 0);\n transition: transform 200ms, opacity 200ms;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n color: var(--bui-fg-primary);\n\n &[data-entering],\n &[data-exiting] {\n transform: var(--origin);\n opacity: 0;\n }\n\n --tooltip-offset: var(--bui-space-3);\n\n &[data-placement='top'] {\n margin-bottom: var(--tooltip-offset);\n --origin: translateY(4px);\n }\n\n &[data-placement='right'] {\n margin-left: var(--tooltip-offset);\n --origin: translateX(-4px);\n }\n\n &[data-placement='bottom'] {\n margin-top: var(--tooltip-offset);\n --origin: translateY(-4px);\n }\n\n &[data-placement='left'] {\n margin-right: var(--tooltip-offset);\n --origin: translateX(4px);\n }\n }\n\n .Tooltip_bui-TooltipArrow__fd7a4c2f9a {\n & svg {\n display: block;\n\n /* The tooltip is rendered overlaying the main\n tooltip 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 path:nth-child(1) {\n fill: var(--bui-bg-popover);\n }\n\n path:nth-child(2) {\n fill: var(--bui-border-1);\n }\n\n /* The arrow svg overlaps the tooltip by 2px, so we\n need to adjust the margins accordingly. */\n --tooltip-arrow-overlap: -2px;\n }\n\n &[data-placement='top'] svg {\n margin-top: var(--tooltip-arrow-overlap);\n }\n\n &[data-placement='bottom'] svg {\n margin-bottom: var(--tooltip-arrow-overlap);\n transform: rotate(180deg);\n }\n\n &[data-placement='right'] svg {\n margin-right: var(--tooltip-arrow-overlap);\n transform: rotate(90deg);\n }\n\n &[data-placement='left'] svg {\n margin-left: var(--tooltip-arrow-overlap);\n transform: rotate(-90deg);\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Tooltip":"Tooltip_bui-Tooltip__fd7a4c2f9a","bui-TooltipArrow":"Tooltip_bui-TooltipArrow__fd7a4c2f9a"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
package/dist/css/styles.css
CHANGED
|
@@ -95,7 +95,8 @@
|
|
|
95
95
|
--bui-bg-solid-disabled: #163a66;
|
|
96
96
|
|
|
97
97
|
/* Neutral background colors */
|
|
98
|
-
--bui-bg-
|
|
98
|
+
--bui-bg-app: #f8f8f8;
|
|
99
|
+
--bui-bg-popover: #ffffff;
|
|
99
100
|
|
|
100
101
|
--bui-bg-neutral-1: #fff;
|
|
101
102
|
--bui-bg-neutral-1-hover: oklch(0% 0 0 / 12%);
|
|
@@ -141,10 +142,8 @@
|
|
|
141
142
|
--bui-fg-info: #0d74ce;
|
|
142
143
|
|
|
143
144
|
/* Border colors */
|
|
144
|
-
--bui-border:
|
|
145
|
-
--bui-border-
|
|
146
|
-
--bui-border-pressed: rgba(0, 0, 0, 0.4);
|
|
147
|
-
--bui-border-disabled: rgba(0, 0, 0, 0.1);
|
|
145
|
+
--bui-border-1: #d5d5d5;
|
|
146
|
+
--bui-border-2: #bababa;
|
|
148
147
|
--bui-border-info: #7ea9d6;
|
|
149
148
|
--bui-border-danger: #f87a7a;
|
|
150
149
|
--bui-border-warning: #e36d05;
|
|
@@ -171,7 +170,8 @@
|
|
|
171
170
|
--bui-bg-solid-disabled: #1b3d68;
|
|
172
171
|
|
|
173
172
|
/* Neutral background colors */
|
|
174
|
-
--bui-bg-
|
|
173
|
+
--bui-bg-app: #333333;
|
|
174
|
+
--bui-bg-popover: #1a1a1a;
|
|
175
175
|
|
|
176
176
|
--bui-bg-neutral-1: oklch(100% 0 0 / 10%);
|
|
177
177
|
--bui-bg-neutral-1-hover: oklch(100% 0 0 / 14%);
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
|
|
202
202
|
/* Foreground colors */
|
|
203
203
|
--bui-fg-primary: var(--bui-white);
|
|
204
|
-
--bui-fg-secondary: oklch(
|
|
205
|
-
--bui-fg-disabled: oklch(
|
|
204
|
+
--bui-fg-secondary: oklch(100% 0 0 / 50%);
|
|
205
|
+
--bui-fg-disabled: oklch(100% 0 0 / 28%);
|
|
206
206
|
--bui-fg-solid: #101821;
|
|
207
207
|
--bui-fg-solid-disabled: #6191cc;
|
|
208
208
|
|
|
@@ -217,10 +217,8 @@
|
|
|
217
217
|
--bui-fg-info: #70b8ff;
|
|
218
218
|
|
|
219
219
|
/* Border colors */
|
|
220
|
-
--bui-border:
|
|
221
|
-
--bui-border-
|
|
222
|
-
--bui-border-pressed: rgba(255, 255, 255, 0.5);
|
|
223
|
-
--bui-border-disabled: rgba(255, 255, 255, 0.2);
|
|
220
|
+
--bui-border-1: #434343;
|
|
221
|
+
--bui-border-2: #585858;
|
|
224
222
|
--bui-border-info: #7ea9d6;
|
|
225
223
|
--bui-border-danger: #f87a7a;
|
|
226
224
|
--bui-border-warning: #e36d05;
|
|
@@ -474,7 +472,7 @@ Add the correct display in Chrome and Safari.
|
|
|
474
472
|
}
|
|
475
473
|
|
|
476
474
|
body {
|
|
477
|
-
background-color: var(--bui-bg-
|
|
475
|
+
background-color: var(--bui-bg-app);
|
|
478
476
|
|
|
479
477
|
/* Text defaults */
|
|
480
478
|
color: var(--bui-fg-primary);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { createVersionedContext, createVersionedValueMap } from '@backstage/version-bridge';
|
|
4
|
+
import { useBreakpoint } from './useBreakpoint.esm.js';
|
|
5
|
+
import { resolveResponsiveValue } from './useDefinition/helpers.esm.js';
|
|
6
|
+
|
|
7
|
+
const BgContext = createVersionedContext("bg-context");
|
|
8
|
+
function incrementNeutralBg(bg) {
|
|
9
|
+
if (!bg) return "neutral-1";
|
|
10
|
+
if (bg === "neutral-1") return "neutral-2";
|
|
11
|
+
if (bg === "neutral-2") return "neutral-3";
|
|
12
|
+
if (bg === "neutral-3") return "neutral-3";
|
|
13
|
+
return bg;
|
|
14
|
+
}
|
|
15
|
+
const BgProvider = ({ bg, children }) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(BgContext.Provider, { value: createVersionedValueMap({ 1: { bg } }), children });
|
|
17
|
+
};
|
|
18
|
+
function useBgConsumer() {
|
|
19
|
+
const value = useContext(BgContext)?.atVersion(1);
|
|
20
|
+
return value ?? { bg: void 0 };
|
|
21
|
+
}
|
|
22
|
+
function useBgProvider(bg) {
|
|
23
|
+
const { breakpoint } = useBreakpoint();
|
|
24
|
+
const context = useBgConsumer();
|
|
25
|
+
if (bg === void 0) {
|
|
26
|
+
return { bg: void 0 };
|
|
27
|
+
}
|
|
28
|
+
const resolved = resolveResponsiveValue(bg, breakpoint);
|
|
29
|
+
if (resolved === "neutral-auto") {
|
|
30
|
+
return { bg: incrementNeutralBg(context.bg) };
|
|
31
|
+
}
|
|
32
|
+
return { bg: resolved };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { BgProvider, useBgConsumer, useBgProvider };
|
|
36
|
+
//# sourceMappingURL=useBg.esm.js.map
|