@backstage/ui 0.7.2-next.1 → 0.8.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 +38 -0
- package/css/styles.css +6411 -8180
- package/dist/components/Avatar/Avatar.esm.js +21 -7
- package/dist/components/Avatar/Avatar.esm.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.esm.js +8 -0
- package/dist/components/Avatar/Avatar.module.css.esm.js.map +1 -0
- package/dist/components/Box/Box.esm.js +20 -23
- package/dist/components/Box/Box.esm.js.map +1 -1
- package/dist/components/Box/Box.module.css.esm.js +8 -0
- package/dist/components/Box/Box.module.css.esm.js.map +1 -0
- package/dist/components/Button/Button.esm.js +10 -19
- package/dist/components/Button/Button.esm.js.map +1 -1
- package/dist/components/Button/Button.module.css.esm.js +8 -0
- package/dist/components/Button/Button.module.css.esm.js.map +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.esm.js +14 -12
- package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js +8 -0
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js.map +1 -0
- package/dist/components/ButtonLink/ButtonLink.esm.js +43 -17
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js +46 -28
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/Card.module.css.esm.js +8 -0
- package/dist/components/Card/Card.module.css.esm.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.esm.js +14 -49
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.esm.js +8 -0
- package/dist/components/Checkbox/Checkbox.module.css.esm.js.map +1 -0
- package/dist/components/Collapsible/Collapsible.esm.js +14 -9
- package/dist/components/Collapsible/Collapsible.esm.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.css.esm.js +8 -0
- package/dist/components/Collapsible/Collapsible.module.css.esm.js.map +1 -0
- package/dist/components/Container/Container.esm.js +22 -25
- package/dist/components/Container/Container.esm.js.map +1 -1
- package/dist/components/Container/Container.module.css.esm.js +8 -0
- package/dist/components/Container/Container.module.css.esm.js.map +1 -0
- package/dist/components/Dialog/Dialog.esm.js +103 -0
- package/dist/components/Dialog/Dialog.esm.js.map +1 -0
- package/dist/components/Dialog/Dialog.module.css.esm.js +8 -0
- package/dist/components/Dialog/Dialog.module.css.esm.js.map +1 -0
- package/dist/components/FieldError/FieldError.esm.js +5 -2
- package/dist/components/FieldError/FieldError.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.module.css.esm.js +8 -0
- package/dist/components/FieldError/FieldError.module.css.esm.js.map +1 -0
- package/dist/components/FieldLabel/FieldLabel.esm.js +50 -13
- package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js +8 -0
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js.map +1 -0
- package/dist/components/Flex/Flex.esm.js +22 -18
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/Flex.module.css.esm.js +8 -0
- package/dist/components/Flex/Flex.module.css.esm.js.map +1 -0
- package/dist/components/Grid/Grid.esm.js +41 -29
- package/dist/components/Grid/Grid.esm.js.map +1 -1
- package/dist/components/Grid/Grid.module.css.esm.js +8 -0
- package/dist/components/Grid/Grid.module.css.esm.js.map +1 -0
- package/dist/components/Header/Header.esm.js +22 -11
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Header/Header.module.css.esm.js +8 -0
- package/dist/components/Header/Header.module.css.esm.js.map +1 -0
- package/dist/components/Header/HeaderToolbar.esm.js +71 -7
- package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js +51 -31
- package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.module.css.esm.js +8 -0
- package/dist/components/HeaderPage/HeaderPage.module.css.esm.js.map +1 -0
- package/dist/components/Link/Link.esm.js +26 -15
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/Link.module.css.esm.js +8 -0
- package/dist/components/Link/Link.module.css.esm.js.map +1 -0
- package/dist/components/Menu/Menu.esm.js +380 -106
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/Menu/Menu.module.css.esm.js +8 -0
- package/dist/components/Menu/Menu.module.css.esm.js.map +1 -0
- package/dist/components/Popover/Popover.module.css.esm.js +8 -0
- package/dist/components/Popover/Popover.module.css.esm.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.esm.js +6 -5
- package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +8 -0
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js.map +1 -0
- package/dist/components/SearchField/SearchField.esm.js +44 -23
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +8 -0
- package/dist/components/SearchField/SearchField.module.css.esm.js.map +1 -0
- package/dist/components/Select/Select.esm.js +60 -25
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +8 -0
- package/dist/components/Select/Select.module.css.esm.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.esm.js +12 -4
- package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.esm.js +8 -0
- package/dist/components/Skeleton/Skeleton.module.css.esm.js.map +1 -0
- package/dist/components/Switch/Switch.esm.js +22 -6
- package/dist/components/Switch/Switch.esm.js.map +1 -1
- package/dist/components/Switch/Switch.module.css.esm.js +8 -0
- package/dist/components/Switch/Switch.module.css.esm.js.map +1 -0
- package/dist/components/Table/Table.module.css.esm.js +8 -0
- package/dist/components/Table/Table.module.css.esm.js.map +1 -0
- package/dist/components/Table/components/Cell.esm.js +44 -17
- package/dist/components/Table/components/Cell.esm.js.map +1 -1
- package/dist/components/Table/components/CellProfile.esm.js +71 -26
- package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
- package/dist/components/Table/components/Column.esm.js +39 -9
- package/dist/components/Table/components/Column.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js +19 -11
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js +8 -3
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBody.esm.js +13 -2
- package/dist/components/Table/components/TableBody.esm.js.map +1 -1
- package/dist/components/Table/components/TableHeader.esm.js +20 -10
- package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +80 -63
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.module.css.esm.js +8 -0
- package/dist/components/TablePagination/TablePagination.module.css.esm.js.map +1 -0
- package/dist/components/Tabs/Tabs.esm.js +64 -32
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.esm.js +8 -0
- package/dist/components/Tabs/Tabs.module.css.esm.js.map +1 -0
- package/dist/components/Tabs/TabsIndicators.esm.js +14 -2
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.esm.js +35 -19
- package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.module.css.esm.js +8 -0
- package/dist/components/TagGroup/TagGroup.module.css.esm.js.map +1 -0
- package/dist/components/Text/Text.esm.js +10 -19
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/Text/Text.module.css.esm.js +8 -0
- package/dist/components/Text/Text.module.css.esm.js.map +1 -0
- package/dist/components/TextField/TextField.esm.js +29 -16
- package/dist/components/TextField/TextField.esm.js.map +1 -1
- package/dist/components/TextField/TextField.module.css.esm.js +8 -0
- package/dist/components/TextField/TextField.module.css.esm.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.esm.js +19 -7
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.esm.js +8 -0
- package/dist/components/Tooltip/Tooltip.module.css.esm.js.map +1 -0
- package/dist/hooks/useStyles.esm.js +65 -9
- package/dist/hooks/useStyles.esm.js.map +1 -1
- package/dist/index.d.ts +149 -434
- package/dist/index.esm.js +1 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/utils/componentDefinitions.esm.js +113 -16
- package/dist/utils/componentDefinitions.esm.js.map +1 -1
- package/dist/utils/utilityClassMap.esm.js +189 -0
- package/dist/utils/utilityClassMap.esm.js.map +1 -0
- package/package.json +3 -3
- package/dist/components/Box/Box.props.esm.js +0 -7
- package/dist/components/Box/Box.props.esm.js.map +0 -1
- package/dist/components/Flex/Flex.props.esm.js +0 -31
- package/dist/components/Flex/Flex.props.esm.js.map +0 -1
- package/dist/components/Grid/Grid.props.esm.js +0 -58
- package/dist/components/Grid/Grid.props.esm.js.map +0 -1
- package/dist/components/Icon/Icon.esm.js +0 -29
- package/dist/components/Icon/Icon.esm.js.map +0 -1
- package/dist/components/Icon/context.esm.js +0 -10
- package/dist/components/Icon/context.esm.js.map +0 -1
- package/dist/components/Icon/icons.esm.js +0 -63
- package/dist/components/Icon/icons.esm.js.map +0 -1
- package/dist/components/Icon/provider.esm.js +0 -12
- package/dist/components/Icon/provider.esm.js.map +0 -1
- package/dist/components/ScrollArea/ScrollArea.esm.js +0 -63
- package/dist/components/ScrollArea/ScrollArea.esm.js.map +0 -1
- package/dist/props/display.props.esm.js +0 -12
- package/dist/props/display.props.esm.js.map +0 -1
- package/dist/props/gap-props.esm.js +0 -15
- package/dist/props/gap-props.esm.js.map +0 -1
- package/dist/props/height.props.esm.js +0 -23
- package/dist/props/height.props.esm.js.map +0 -1
- package/dist/props/margin.props.esm.js +0 -54
- package/dist/props/margin.props.esm.js.map +0 -1
- package/dist/props/padding.props.esm.js +0 -54
- package/dist/props/padding.props.esm.js.map +0 -1
- package/dist/props/position.props.esm.js +0 -18
- package/dist/props/position.props.esm.js.map +0 -1
- package/dist/props/prop-def.esm.js +0 -4
- package/dist/props/prop-def.esm.js.map +0 -1
- package/dist/props/spacing.props.esm.js +0 -28
- package/dist/props/spacing.props.esm.js.map +0 -1
- package/dist/props/width.props.esm.js +0 -23
- package/dist/props/width.props.esm.js.map +0 -1
- package/dist/utils/extractProps.esm.js +0 -49
- package/dist/utils/extractProps.esm.js.map +0 -1
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import { flexPropDefs } from './Flex.props.esm.js';
|
|
4
|
-
import { extractProps } from '../../utils/extractProps.esm.js';
|
|
5
|
-
import { gapPropDefs } from '../../props/gap-props.esm.js';
|
|
6
|
-
import { spacingPropDefs } from '../../props/spacing.props.esm.js';
|
|
7
4
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import styles from './Flex.module.css.esm.js';
|
|
8
6
|
|
|
9
7
|
const Flex = forwardRef((props, ref) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const { classNames, utilityClasses, style, cleanedProps } = useStyles(
|
|
9
|
+
"Flex",
|
|
10
|
+
{ gap: "4", ...props }
|
|
11
|
+
);
|
|
12
|
+
const { className, ...rest } = cleanedProps;
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: clsx(
|
|
18
|
+
classNames.root,
|
|
19
|
+
utilityClasses,
|
|
20
|
+
styles[classNames.root],
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}
|
|
26
|
+
);
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
export { Flex };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.esm.js","sources":["../../../src/components/Flex/Flex.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 {
|
|
1
|
+
{"version":3,"file":"Flex.esm.js","sources":["../../../src/components/Flex/Flex.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 } from 'react';\nimport { FlexProps } from './types';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Flex.module.css';\n\n/** @public */\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>((props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n 'Flex',\n { gap: '4', ...props },\n );\n\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.root,\n utilityClasses,\n styles[classNames.root],\n className,\n )}\n style={style}\n {...rest}\n />\n );\n});\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,IAC1D,MAAA;AAAA,IACA,EAAE,GAAA,EAAK,GAAA,EAAK,GAAG,KAAA;AAAM,GACvB;AAEA,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,IAAA;AAAA,QACX,cAAA;AAAA,QACA,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,QACtB;AAAA,OACF;AAAA,MACA,KAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;;;;"}
|
|
@@ -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 components {\n .Flex-module_bui-Flex__3kax7 {\n display: flex;\n\n /* This helps when using `truncate` on text inside a flex container */\n min-width: 0;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Flex":"Flex-module_bui-Flex__3kax7"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Flex.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flex.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { extractProps } from '../../utils/extractProps.esm.js';
|
|
4
|
-
import { gridPropDefs, gridItemPropDefs } from './Grid.props.esm.js';
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
|
-
import { spacingPropDefs } from '../../props/spacing.props.esm.js';
|
|
7
4
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import styles from './Grid.module.css.esm.js';
|
|
8
6
|
|
|
9
7
|
const GridRoot = forwardRef((props, ref) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const { classNames, utilityClasses, style, cleanedProps } = useStyles(
|
|
9
|
+
"Grid",
|
|
10
|
+
{ columns: "auto", gap: "4", ...props }
|
|
11
|
+
);
|
|
12
|
+
const { className, ...rest } = cleanedProps;
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: clsx(
|
|
18
|
+
classNames.root,
|
|
19
|
+
utilityClasses,
|
|
20
|
+
styles[classNames.root],
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
style,
|
|
24
|
+
...rest
|
|
25
|
+
}
|
|
26
|
+
);
|
|
23
27
|
});
|
|
24
28
|
const GridItem = forwardRef((props, ref) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const { className,
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const { classNames, utilityClasses, style, cleanedProps } = useStyles(
|
|
30
|
+
"GridItem",
|
|
31
|
+
props
|
|
32
|
+
);
|
|
33
|
+
const { className, ...rest } = cleanedProps;
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: clsx(
|
|
39
|
+
classNames.root,
|
|
40
|
+
utilityClasses,
|
|
41
|
+
styles[classNames.root],
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
style,
|
|
45
|
+
...rest
|
|
46
|
+
}
|
|
47
|
+
);
|
|
36
48
|
});
|
|
37
49
|
const Grid = {
|
|
38
50
|
Root: GridRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.esm.js","sources":["../../../src/components/Grid/Grid.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 {
|
|
1
|
+
{"version":3,"file":"Grid.esm.js","sources":["../../../src/components/Grid/Grid.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 } from 'react';\nimport clsx from 'clsx';\nimport type { GridItemProps, GridProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Grid.module.css';\n\nconst GridRoot = forwardRef<HTMLDivElement, GridProps>((props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n 'Grid',\n { columns: 'auto', gap: '4', ...props },\n );\n\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.root,\n utilityClasses,\n styles[classNames.root],\n className,\n )}\n style={style}\n {...rest}\n />\n );\n});\n\nconst GridItem = forwardRef<HTMLDivElement, GridItemProps>((props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n 'GridItem',\n props,\n );\n\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.root,\n utilityClasses,\n styles[classNames.root],\n className,\n )}\n style={style}\n {...rest}\n />\n );\n});\n\n/** @public */\nexport const Grid = {\n Root: GridRoot,\n Item: GridItem,\n};\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,QAAA,GAAW,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACrE,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,IAC1D,MAAA;AAAA,IACA,EAAE,OAAA,EAAS,MAAA,EAAQ,GAAA,EAAK,GAAA,EAAK,GAAG,KAAA;AAAM,GACxC;AAEA,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,IAAA;AAAA,QACX,cAAA;AAAA,QACA,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,QACtB;AAAA,OACF;AAAA,MACA,KAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC,CAAA;AAED,MAAM,QAAA,GAAW,UAAA,CAA0C,CAAC,KAAA,EAAO,GAAA,KAAQ;AACzE,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,IAC1D,UAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,IAAA;AAAA,QACX,cAAA;AAAA,QACA,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,QACtB;AAAA,OACF;AAAA,MACA,KAAA;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC,CAAA;AAGM,MAAM,IAAA,GAAO;AAAA,EAClB,IAAA,EAAM,QAAA;AAAA,EACN,IAAA,EAAM;AACR;;;;"}
|
|
@@ -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 components {\n .Grid-module_bui-Grid__3vX0y {\n display: grid;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Grid":"Grid-module_bui-Grid__3vX0y"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Grid.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -2,10 +2,12 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { HeaderToolbar } from './HeaderToolbar.esm.js';
|
|
3
3
|
import { Tabs, TabList, Tab } from '../Tabs/Tabs.esm.js';
|
|
4
4
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import styles from './Header.module.css.esm.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
5
7
|
|
|
6
8
|
const Header = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
const {
|
|
9
|
+
const { classNames, cleanedProps } = useStyles("Header", props);
|
|
10
|
+
const { tabs, icon, title, titleLink, customActions, onTabSelectionChange } = cleanedProps;
|
|
9
11
|
const hasTabs = tabs && tabs.length > 0;
|
|
10
12
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
13
|
/* @__PURE__ */ jsx(
|
|
@@ -18,16 +20,25 @@ const Header = (props) => {
|
|
|
18
20
|
hasTabs
|
|
19
21
|
}
|
|
20
22
|
),
|
|
21
|
-
tabs && /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
23
|
+
tabs && /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
23
25
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
className: clsx(
|
|
27
|
+
classNames.tabsWrapper,
|
|
28
|
+
styles[classNames.tabsWrapper]
|
|
29
|
+
),
|
|
30
|
+
children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
|
|
31
|
+
Tab,
|
|
32
|
+
{
|
|
33
|
+
id: tab.id,
|
|
34
|
+
href: tab.href,
|
|
35
|
+
matchStrategy: tab.matchStrategy,
|
|
36
|
+
children: tab.label
|
|
37
|
+
},
|
|
38
|
+
tab.id
|
|
39
|
+
)) }) })
|
|
40
|
+
}
|
|
41
|
+
)
|
|
31
42
|
] });
|
|
32
43
|
};
|
|
33
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.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 { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const { tabs, icon, title, titleLink, customActions, onTabSelectionChange } =\n
|
|
1
|
+
{"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.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 { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\nimport styles from './Header.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 toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const { tabs, icon, title, titleLink, customActions, onTabSelectionChange } =\n cleanedProps;\n\n const hasTabs = tabs && tabs.length > 0;\n\n return (\n <>\n <HeaderToolbar\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 </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAmCO,MAAM,MAAA,GAAS,CAAC,KAAA,KAAuB;AAC5C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAM,OAAO,SAAA,EAAW,aAAA,EAAe,sBAAqB,GACxE,YAAA;AAEF,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AAEtC,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,KAAA;AAAA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IACC,IAAA,oBACC,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,WAAA;AAAA,UACX,MAAA,CAAO,WAAW,WAAW;AAAA,SAC/B;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,QAAK,iBAAA,EAAmB,oBAAA,EACvB,8BAAC,OAAA,EAAA,EACE,QAAA,EAAA,IAAA,EAAM,IAAI,CAAA,GAAA,qBACT,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YAEC,IAAI,GAAA,CAAI,EAAA;AAAA,YACR,MAAM,GAAA,CAAI,IAAA;AAAA,YACV,eAAe,GAAA,CAAI,aAAA;AAAA,YAElB,QAAA,EAAA,GAAA,CAAI;AAAA,WAAA;AAAA,UALA,GAAA,CAAI;AAAA,SAOZ,GACH,CAAA,EACF;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;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 components {\n .Header-module_bui-HeaderToolbar__1HcPN {\n margin-bottom: var(--bui-space-6);\n\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);\n z-index: 0;\n }\n\n &[data-has-tabs='true'] {\n margin-bottom: 0;\n }\n }\n\n .Header-module_bui-HeaderToolbarWrapper__1WJwf {\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-surface-1);\n padding-inline: var(--bui-space-5);\n border-bottom: 1px solid var(--bui-border);\n color: var(--bui-fg-primary);\n height: 52px;\n }\n\n .Header-module_bui-HeaderToolbarContent__8b9nS {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .Header-module_bui-HeaderToolbarName__2E-_b {\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 .Header-module_bui-HeaderToolbarIcon__1JjN5 {\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 .Header-module_bui-HeaderToolbarControls__1EtQC {\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 .Header-module_bui-HeaderTabsWrapper__19BXF {\n margin-bottom: var(--bui-space-4);\n padding-inline: var(--bui-space-3);\n border-bottom: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-HeaderToolbar":"Header-module_bui-HeaderToolbar__1HcPN","bui-HeaderToolbarWrapper":"Header-module_bui-HeaderToolbarWrapper__1WJwf","bui-HeaderToolbarContent":"Header-module_bui-HeaderToolbarContent__8b9nS","bui-HeaderToolbarName":"Header-module_bui-HeaderToolbarName__2E-_b","bui-HeaderToolbarIcon":"Header-module_bui-HeaderToolbarIcon__1JjN5","bui-HeaderToolbarControls":"Header-module_bui-HeaderToolbarControls__1EtQC","bui-HeaderTabsWrapper":"Header-module_bui-HeaderTabsWrapper__19BXF"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Header.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -5,22 +5,86 @@ import { useRef } from 'react';
|
|
|
5
5
|
import { RiShapesLine } from '@remixicon/react';
|
|
6
6
|
import { Text } from '../Text/Text.esm.js';
|
|
7
7
|
import { useNavigate, useHref } from 'react-router-dom';
|
|
8
|
+
import styles from './Header.module.css.esm.js';
|
|
9
|
+
import clsx from 'clsx';
|
|
8
10
|
|
|
9
11
|
const HeaderToolbar = (props) => {
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
12
|
+
const { classNames, cleanedProps } = useStyles("Header", props);
|
|
13
|
+
const { icon, title, titleLink, customActions, hasTabs } = cleanedProps;
|
|
12
14
|
let navigate = useNavigate();
|
|
13
15
|
const toolbarWrapperRef = useRef(null);
|
|
14
16
|
const toolbarContentRef = useRef(null);
|
|
15
17
|
const toolbarControlsRef = useRef(null);
|
|
16
18
|
const titleContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: clsx(classNames.toolbarIcon, styles[classNames.toolbarIcon]),
|
|
23
|
+
children: icon || /* @__PURE__ */ jsx(RiShapesLine, {})
|
|
24
|
+
}
|
|
25
|
+
),
|
|
18
26
|
/* @__PURE__ */ jsx(Text, { variant: "body-medium", children: title || "Your plugin" })
|
|
19
27
|
] });
|
|
20
|
-
return /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children: /* @__PURE__ */ jsx(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
return /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children: /* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: clsx(classNames.toolbar, styles[classNames.toolbar]),
|
|
32
|
+
"data-has-tabs": hasTabs,
|
|
33
|
+
children: /* @__PURE__ */ jsxs(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: clsx(
|
|
37
|
+
classNames.toolbarWrapper,
|
|
38
|
+
styles[classNames.toolbarWrapper]
|
|
39
|
+
),
|
|
40
|
+
ref: toolbarWrapperRef,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: clsx(
|
|
46
|
+
classNames.toolbarContent,
|
|
47
|
+
styles[classNames.toolbarContent]
|
|
48
|
+
),
|
|
49
|
+
ref: toolbarContentRef,
|
|
50
|
+
children: /* @__PURE__ */ jsx(Text, { as: "h1", variant: "body-medium", children: titleLink ? /* @__PURE__ */ jsx(
|
|
51
|
+
Link,
|
|
52
|
+
{
|
|
53
|
+
className: clsx(
|
|
54
|
+
classNames.toolbarName,
|
|
55
|
+
styles[classNames.toolbarName]
|
|
56
|
+
),
|
|
57
|
+
href: titleLink,
|
|
58
|
+
children: titleContent
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: clsx(
|
|
64
|
+
classNames.toolbarName,
|
|
65
|
+
styles[classNames.toolbarName]
|
|
66
|
+
),
|
|
67
|
+
children: titleContent
|
|
68
|
+
}
|
|
69
|
+
) })
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: clsx(
|
|
76
|
+
classNames.toolbarControls,
|
|
77
|
+
styles[classNames.toolbarControls]
|
|
78
|
+
),
|
|
79
|
+
ref: toolbarControlsRef,
|
|
80
|
+
children: customActions
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
24
88
|
};
|
|
25
89
|
|
|
26
90
|
export { HeaderToolbar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderToolbar.esm.js","sources":["../../../src/components/Header/HeaderToolbar.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, RouterProvider } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useRef } from 'react';\nimport { RiShapesLine } from '@remixicon/react';\nimport type { HeaderToolbarProps } from './types';\nimport { Text } from '../Text';\nimport { useNavigate, useHref } from 'react-router-dom';\n\n/**\n * A component that renders a toolbar.\n *\n * @internal\n */\nexport const HeaderToolbar = (props: HeaderToolbarProps) => {\n const {
|
|
1
|
+
{"version":3,"file":"HeaderToolbar.esm.js","sources":["../../../src/components/Header/HeaderToolbar.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, RouterProvider } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useRef } from 'react';\nimport { RiShapesLine } from '@remixicon/react';\nimport type { HeaderToolbarProps } from './types';\nimport { Text } from '../Text';\nimport { useNavigate, useHref } from 'react-router-dom';\nimport styles from './Header.module.css';\nimport clsx from 'clsx';\n\n/**\n * A component that renders a toolbar.\n *\n * @internal\n */\nexport const HeaderToolbar = (props: HeaderToolbarProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const { icon, title, titleLink, customActions, hasTabs } = cleanedProps;\n let navigate = useNavigate();\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 <RouterProvider navigate={navigate} useHref={useHref}>\n <div\n className={clsx(classNames.toolbar, styles[classNames.toolbar])}\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 </RouterProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,SAAA,EAAW,aAAA,EAAe,SAAQ,GAAI,YAAA;AAC3D,EAAA,IAAI,WAAW,WAAA,EAAY;AAG3B,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,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EAClC,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,MAC9D,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,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -5,42 +5,62 @@ import { Tabs, TabList, Tab } from '../Tabs/Tabs.esm.js';
|
|
|
5
5
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
6
6
|
import { Container } from '../Container/Container.esm.js';
|
|
7
7
|
import { Link } from '../Link/Link.esm.js';
|
|
8
|
+
import styles from './HeaderPage.module.css.esm.js';
|
|
9
|
+
import clsx from 'clsx';
|
|
8
10
|
|
|
9
11
|
const HeaderPage = (props) => {
|
|
10
|
-
const {
|
|
11
|
-
const {
|
|
12
|
-
return /* @__PURE__ */ jsxs(Container, { className: classNames.root, children: [
|
|
13
|
-
/* @__PURE__ */ jsxs("div", { className: classNames.content, children: [
|
|
14
|
-
/* @__PURE__ */ jsxs(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
variant: "title-small",
|
|
21
|
-
weight: "bold",
|
|
22
|
-
color: "secondary",
|
|
23
|
-
truncate: true,
|
|
24
|
-
style: { maxWidth: "240px" },
|
|
25
|
-
children: breadcrumb.label
|
|
26
|
-
}
|
|
12
|
+
const { classNames, cleanedProps } = useStyles("HeaderPage", props);
|
|
13
|
+
const { title, tabs, customActions, breadcrumbs } = cleanedProps;
|
|
14
|
+
return /* @__PURE__ */ jsxs(Container, { className: clsx(classNames.root, styles[classNames.root]), children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(classNames.content, styles[classNames.content]), children: [
|
|
16
|
+
/* @__PURE__ */ jsxs(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: clsx(
|
|
20
|
+
classNames.breadcrumbs,
|
|
21
|
+
styles[classNames.breadcrumbs]
|
|
27
22
|
),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
children: [
|
|
24
|
+
breadcrumbs && breadcrumbs.map((breadcrumb) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
Link,
|
|
27
|
+
{
|
|
28
|
+
href: breadcrumb.href,
|
|
29
|
+
variant: "title-small",
|
|
30
|
+
weight: "bold",
|
|
31
|
+
color: "secondary",
|
|
32
|
+
truncate: true,
|
|
33
|
+
style: { maxWidth: "240px" },
|
|
34
|
+
children: breadcrumb.label
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ jsx(RiArrowRightSLine, { size: 16, color: "var(--bui-fg-secondary)" })
|
|
38
|
+
] }, breadcrumb.label)),
|
|
39
|
+
/* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", as: "h2", children: title })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: clsx(classNames.controls, styles[classNames.controls]), children: customActions })
|
|
33
44
|
] }),
|
|
34
|
-
tabs && /* @__PURE__ */ jsx(
|
|
35
|
-
|
|
45
|
+
tabs && /* @__PURE__ */ jsx(
|
|
46
|
+
"div",
|
|
36
47
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
className: clsx(
|
|
49
|
+
classNames.tabsWrapper,
|
|
50
|
+
styles[classNames.tabsWrapper]
|
|
51
|
+
),
|
|
52
|
+
children: /* @__PURE__ */ jsx(Tabs, { children: /* @__PURE__ */ jsx(TabList, { children: tabs.map((tab) => /* @__PURE__ */ jsx(
|
|
53
|
+
Tab,
|
|
54
|
+
{
|
|
55
|
+
id: tab.id,
|
|
56
|
+
href: tab.href,
|
|
57
|
+
matchStrategy: tab.matchStrategy,
|
|
58
|
+
children: tab.label
|
|
59
|
+
},
|
|
60
|
+
tab.id
|
|
61
|
+
)) }) })
|
|
62
|
+
}
|
|
63
|
+
)
|
|
44
64
|
] });
|
|
45
65
|
};
|
|
46
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderPage.esm.js","sources":["../../../src/components/HeaderPage/HeaderPage.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 { HeaderPageProps } from './types';\nimport { Text } from '../Text';\nimport { RiArrowRightSLine } from '@remixicon/react';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { Container } from '../Container';\nimport { Link } from '../Link';\nimport { Fragment } from 'react/jsx-runtime';\n\n/**\n * A component that renders a header page.\n *\n * @public\n */\nexport const HeaderPage = (props: HeaderPageProps) => {\n const {
|
|
1
|
+
{"version":3,"file":"HeaderPage.esm.js","sources":["../../../src/components/HeaderPage/HeaderPage.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 { HeaderPageProps } from './types';\nimport { Text } from '../Text';\nimport { RiArrowRightSLine } from '@remixicon/react';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { Container } from '../Container';\nimport { Link } from '../Link';\nimport { Fragment } from 'react/jsx-runtime';\nimport styles from './HeaderPage.module.css';\nimport clsx from 'clsx';\n\n/**\n * A component that renders a header page.\n *\n * @public\n */\nexport const HeaderPage = (props: HeaderPageProps) => {\n const { classNames, cleanedProps } = useStyles('HeaderPage', props);\n const { title, tabs, customActions, breadcrumbs } = cleanedProps;\n\n return (\n <Container className={clsx(classNames.root, styles[classNames.root])}>\n <div className={clsx(classNames.content, styles[classNames.content])}>\n <div\n className={clsx(\n classNames.breadcrumbs,\n styles[classNames.breadcrumbs],\n )}\n >\n {breadcrumbs &&\n breadcrumbs.map(breadcrumb => (\n <Fragment key={breadcrumb.label}>\n <Link\n href={breadcrumb.href}\n variant=\"title-small\"\n weight=\"bold\"\n color=\"secondary\"\n truncate\n style={{ maxWidth: '240px' }}\n >\n {breadcrumb.label}\n </Link>\n <RiArrowRightSLine size={16} color=\"var(--bui-fg-secondary)\" />\n </Fragment>\n ))}\n <Text variant=\"title-small\" weight=\"bold\" as=\"h2\">\n {title}\n </Text>\n </div>\n <div className={clsx(classNames.controls, styles[classNames.controls])}>\n {customActions}\n </div>\n </div>\n {tabs && (\n <div\n className={clsx(\n classNames.tabsWrapper,\n styles[classNames.tabsWrapper],\n )}\n >\n <Tabs>\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 </Container>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAgCO,MAAM,UAAA,GAAa,CAAC,KAAA,KAA2B;AACpD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,cAAc,KAAK,CAAA;AAClE,EAAA,MAAM,EAAE,KAAA,EAAO,IAAA,EAAM,aAAA,EAAe,aAAY,GAAI,YAAA;AAEpD,EAAA,uBACE,IAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA,EACjE,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA,EACjE,QAAA,EAAA;AAAA,sBAAA,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,CAAW,WAAA;AAAA,YACX,MAAA,CAAO,WAAW,WAAW;AAAA,WAC/B;AAAA,UAEC,QAAA,EAAA;AAAA,YAAA,WAAA,IACC,WAAA,CAAY,GAAA,CAAI,CAAA,UAAA,qBACd,IAAA,CAAC,QAAA,EAAA,EACC,QAAA,EAAA;AAAA,8BAAA,GAAA;AAAA,gBAAC,IAAA;AAAA,gBAAA;AAAA,kBACC,MAAM,UAAA,CAAW,IAAA;AAAA,kBACjB,OAAA,EAAQ,aAAA;AAAA,kBACR,MAAA,EAAO,MAAA;AAAA,kBACP,KAAA,EAAM,WAAA;AAAA,kBACN,QAAA,EAAQ,IAAA;AAAA,kBACR,KAAA,EAAO,EAAE,QAAA,EAAU,OAAA,EAAQ;AAAA,kBAE1B,QAAA,EAAA,UAAA,CAAW;AAAA;AAAA,eACd;AAAA,8BACA,GAAA,CAAC,iBAAA,EAAA,EAAkB,IAAA,EAAM,EAAA,EAAI,OAAM,yBAAA,EAA0B;AAAA,aAAA,EAAA,EAXhD,UAAA,CAAW,KAY1B,CACD,CAAA;AAAA,4BACH,GAAA,CAAC,QAAK,OAAA,EAAQ,aAAA,EAAc,QAAO,MAAA,EAAO,EAAA,EAAG,MAC1C,QAAA,EAAA,KAAA,EACH;AAAA;AAAA;AAAA,OACF;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,QAAA,EAAU,MAAA,CAAO,UAAA,CAAW,QAAQ,CAAC,CAAA,EAClE,QAAA,EAAA,aAAA,EACH;AAAA,KAAA,EACF,CAAA;AAAA,IACC,IAAA,oBACC,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,WAAA;AAAA,UACX,MAAA,CAAO,WAAW,WAAW;AAAA,SAC/B;AAAA,QAEA,8BAAC,IAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,OAAA,EAAA,EACE,QAAA,EAAA,IAAA,CAAK,IAAI,CAAA,GAAA,qBACR,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YAEC,IAAI,GAAA,CAAI,EAAA;AAAA,YACR,MAAM,GAAA,CAAI,IAAA;AAAA,YACV,eAAe,GAAA,CAAI,aAAA;AAAA,YAElB,QAAA,EAAA,GAAA,CAAI;AAAA,WAAA;AAAA,UALA,GAAA,CAAI;AAAA,SAOZ,GACH,CAAA,EACF;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;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 components {\n .HeaderPage-module_bui-HeaderPage__1V9A4 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-1);\n margin-top: var(--bui-space-6);\n margin-bottom: var(--bui-space-6);\n }\n\n .HeaderPage-module_bui-HeaderPageContent__ImRWi {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n\n .HeaderPage-module_bui-HeaderPageTabsWrapper__1Fcx4 {\n margin-left: -8px;\n }\n\n .HeaderPage-module_bui-HeaderPageControls__2tefX {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n .HeaderPage-module_bui-HeaderPageBreadcrumbs__wUkYx {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-HeaderPage":"HeaderPage-module_bui-HeaderPage__1V9A4","bui-HeaderPageContent":"HeaderPage-module_bui-HeaderPageContent__ImRWi","bui-HeaderPageTabsWrapper":"HeaderPage-module_bui-HeaderPageTabsWrapper__1Fcx4","bui-HeaderPageControls":"HeaderPage-module_bui-HeaderPageControls__2tefX","bui-HeaderPageBreadcrumbs":"HeaderPage-module_bui-HeaderPageBreadcrumbs__wUkYx"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=HeaderPage.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderPage.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -5,31 +5,36 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
6
6
|
import { useNavigate, useHref } from 'react-router-dom';
|
|
7
7
|
import { isExternalLink } from '../../utils/isExternalLink.esm.js';
|
|
8
|
+
import stylesLink from './Link.module.css.esm.js';
|
|
9
|
+
import stylesText from '../Text/Text.module.css.esm.js';
|
|
8
10
|
|
|
9
11
|
const Link = forwardRef((props, ref) => {
|
|
10
12
|
const navigate = useNavigate();
|
|
13
|
+
const { classNames: classNamesLink } = useStyles("Link", props);
|
|
11
14
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const { classNames: linkClassNames } = useStyles("Link");
|
|
21
|
-
const { classNames: textClassNames, dataAttributes: textDataAttributes } = useStyles("Text", {
|
|
22
|
-
variant,
|
|
23
|
-
weight,
|
|
24
|
-
color
|
|
15
|
+
classNames: classNamesText,
|
|
16
|
+
dataAttributes: textDataAttributes,
|
|
17
|
+
cleanedProps
|
|
18
|
+
} = useStyles("Text", {
|
|
19
|
+
variant: "body",
|
|
20
|
+
weight: "regular",
|
|
21
|
+
color: "primary",
|
|
22
|
+
...props
|
|
25
23
|
});
|
|
24
|
+
const { className, variant, weight, color, truncate, href, ...restProps } = cleanedProps;
|
|
26
25
|
const isExternal = isExternalLink(href);
|
|
27
26
|
if (isExternal) {
|
|
28
27
|
return /* @__PURE__ */ jsx(
|
|
29
28
|
Link$1,
|
|
30
29
|
{
|
|
31
30
|
ref,
|
|
32
|
-
className: clsx(
|
|
31
|
+
className: clsx(
|
|
32
|
+
classNamesText.root,
|
|
33
|
+
classNamesLink.root,
|
|
34
|
+
stylesText[classNamesText.root],
|
|
35
|
+
stylesLink[classNamesLink.root],
|
|
36
|
+
className
|
|
37
|
+
),
|
|
33
38
|
"data-truncate": truncate,
|
|
34
39
|
href,
|
|
35
40
|
...textDataAttributes,
|
|
@@ -41,7 +46,13 @@ const Link = forwardRef((props, ref) => {
|
|
|
41
46
|
Link$1,
|
|
42
47
|
{
|
|
43
48
|
ref,
|
|
44
|
-
className: clsx(
|
|
49
|
+
className: clsx(
|
|
50
|
+
classNamesText.root,
|
|
51
|
+
classNamesLink.root,
|
|
52
|
+
stylesText[classNamesText.root],
|
|
53
|
+
stylesLink[classNamesLink.root],
|
|
54
|
+
className
|
|
55
|
+
),
|
|
45
56
|
"data-truncate": truncate,
|
|
46
57
|
...textDataAttributes,
|
|
47
58
|
href,
|