@backstage/core-components 0.14.10 → 0.14.11-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/alpha/package.json +1 -1
- package/dist/components/FavoriteToggle/FavoriteToggle.esm.js +54 -0
- package/dist/components/FavoriteToggle/FavoriteToggle.esm.js.map +1 -0
- package/dist/components/SupportButton/SupportButton.esm.js +2 -1
- package/dist/components/SupportButton/SupportButton.esm.js.map +1 -1
- package/dist/components/Table/Table.esm.js.map +1 -1
- package/dist/hooks/useSupportConfig.esm.js +1 -1
- package/dist/hooks/useSupportConfig.esm.js.map +1 -1
- package/dist/icons/icons.esm.js +7 -1
- package/dist/icons/icons.esm.js.map +1 -1
- package/dist/index.d.ts +38 -2
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/layout/ContentHeader/ContentHeader.esm.js +1 -4
- package/dist/layout/ContentHeader/ContentHeader.esm.js.map +1 -1
- package/dist/layout/ErrorPage/StackDetails.esm.js +1 -0
- package/dist/layout/ErrorPage/StackDetails.esm.js.map +1 -1
- package/dist/layout/SignInPage/SignInPage.esm.js +9 -1
- package/dist/layout/SignInPage/SignInPage.esm.js.map +1 -1
- package/package.json +9 -9
- package/testUtils/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
+
## 0.14.11-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c891b69: Add `FavoriteToggle` in `core-components` to standardise favorite marking
|
|
8
|
+
- 0944334: Removed default title set to Unknown page on `ContentHeaderTitle` component to support usage of component without title prop.
|
|
9
|
+
- f325258: Use getOptionalString for optional app.support.items[].links[].title
|
|
10
|
+
- af4c146: Support menu items should not be buttons in favour of links
|
|
11
|
+
- b537bd7: Allow custom star icons to be provided via the `star` and `unstarred` icon overrides. See how to override existing icons in the [Backstage documentation](https://backstage.io/docs/getting-started/app-custom-theme/#custom-icons).
|
|
12
|
+
- dbbd93e: Internal update to match recent React types
|
|
13
|
+
- 836127c: Updated dependency `@testing-library/react` to `^16.0.0`.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @backstage/core-plugin-api@1.9.4-next.0
|
|
16
|
+
- @backstage/theme@0.5.7-next.0
|
|
17
|
+
- @backstage/version-bridge@1.0.9-next.0
|
|
18
|
+
- @backstage/config@1.2.0
|
|
19
|
+
- @backstage/errors@1.2.4
|
|
20
|
+
|
|
21
|
+
## 0.14.11-next.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 06b8206: Added `titleComponent` prop to `SignInPage` component to allow further customization of the title using `ReactNode`
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/config@1.2.0
|
|
28
|
+
- @backstage/core-plugin-api@1.9.3
|
|
29
|
+
- @backstage/errors@1.2.4
|
|
30
|
+
- @backstage/theme@0.5.6
|
|
31
|
+
- @backstage/version-bridge@1.0.8
|
|
32
|
+
|
|
3
33
|
## 0.14.10
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/alpha/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
3
|
+
import Tooltip from '@material-ui/core/Tooltip';
|
|
4
|
+
import Typography from '@material-ui/core/Typography';
|
|
5
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
+
import { StarIcon, UnstarredIcon } from '../../icons/icons.esm.js';
|
|
7
|
+
|
|
8
|
+
const useStyles = makeStyles(
|
|
9
|
+
(theme) => ({
|
|
10
|
+
icon: {
|
|
11
|
+
color: "#f3ba37",
|
|
12
|
+
cursor: "pointer"
|
|
13
|
+
},
|
|
14
|
+
iconBorder: {
|
|
15
|
+
color: theme.palette.text.primary,
|
|
16
|
+
cursor: "pointer"
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
{ name: "BackstageFavoriteToggleIcon" }
|
|
20
|
+
);
|
|
21
|
+
function FavoriteToggleIcon(props) {
|
|
22
|
+
const { isFavorite } = props;
|
|
23
|
+
const classes = useStyles();
|
|
24
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
25
|
+
Typography,
|
|
26
|
+
{
|
|
27
|
+
component: "span",
|
|
28
|
+
className: isFavorite ? classes.icon : classes.iconBorder
|
|
29
|
+
},
|
|
30
|
+
isFavorite ? /* @__PURE__ */ React__default.createElement(StarIcon, null) : /* @__PURE__ */ React__default.createElement(UnstarredIcon, null)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function FavoriteToggle(props) {
|
|
34
|
+
const {
|
|
35
|
+
id,
|
|
36
|
+
title,
|
|
37
|
+
isFavorite: value,
|
|
38
|
+
onToggle: onChange,
|
|
39
|
+
...iconButtonProps
|
|
40
|
+
} = props;
|
|
41
|
+
return /* @__PURE__ */ React__default.createElement(Tooltip, { id, title }, /* @__PURE__ */ React__default.createElement(
|
|
42
|
+
IconButton,
|
|
43
|
+
{
|
|
44
|
+
"aria-label": title,
|
|
45
|
+
id,
|
|
46
|
+
onClick: () => onChange(!value),
|
|
47
|
+
...iconButtonProps
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ React__default.createElement(FavoriteToggleIcon, { isFavorite: value })
|
|
50
|
+
));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { FavoriteToggle, FavoriteToggleIcon };
|
|
54
|
+
//# sourceMappingURL=FavoriteToggle.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavoriteToggle.esm.js","sources":["../../../src/components/FavoriteToggle/FavoriteToggle.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 */\nimport React, { ComponentProps } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport { StarIcon, UnstarredIcon } from '../../icons';\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n icon: {\n color: '#f3ba37',\n cursor: 'pointer',\n },\n iconBorder: {\n color: theme.palette.text.primary,\n cursor: 'pointer',\n },\n }),\n { name: 'BackstageFavoriteToggleIcon' },\n);\n\n/**\n * @public\n */\nexport type FavoriteToggleIconClassKey = 'icon' | 'iconBorder';\n\n/**\n * Icon used in FavoriteToggle component.\n *\n * Can be used independently, useful when used as {@link @material-table/core#MaterialTableProps.actions} in {@link @material-table/core#MaterialTable}\n *\n * @public\n */\nexport function FavoriteToggleIcon(props: { isFavorite: boolean }) {\n const { isFavorite } = props;\n const classes = useStyles();\n\n return (\n <Typography\n component=\"span\"\n className={isFavorite ? classes.icon : classes.iconBorder}\n >\n {isFavorite ? <StarIcon /> : <UnstarredIcon />}\n </Typography>\n );\n}\n\n/**\n * Toggle encapsulating logic for marking something as favorite,\n * primarily used in various instances of entity lists and cards but can be used elsewhere.\n *\n * This component can only be used in as a controlled toggle and does not keep internal state.\n *\n * @public\n */\nexport function FavoriteToggle(\n props: ComponentProps<typeof IconButton> & {\n id: string;\n title: string;\n isFavorite: boolean;\n onToggle: (value: boolean) => void;\n },\n) {\n const {\n id,\n title,\n isFavorite: value,\n onToggle: onChange,\n ...iconButtonProps\n } = props;\n return (\n <Tooltip id={id} title={title}>\n <IconButton\n aria-label={title}\n id={id}\n onClick={() => onChange(!value)}\n {...iconButtonProps}\n >\n <FavoriteToggleIcon isFav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KAAA;AAAA,MACZ,EAAA;AAAA,MACA,OAAS,EAAA,MAAM,QAAS,CAAA,CAAC,KAAK,CAAA;AAAA,MAC7B,GAAG,eAAA;AAAA,KAAA;AAAA,oBAEJA,cAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,UAAA,EAAY,KAAO,EAAA,CAAA;AAAA,GAE3C,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -41,7 +41,7 @@ const SupportIcon = ({ icon }) => {
|
|
|
41
41
|
};
|
|
42
42
|
const SupportLink = ({ link }) => /* @__PURE__ */ React__default.createElement(Link, { to: link.url }, link.title ?? link.url);
|
|
43
43
|
const SupportListItem = ({ item }) => {
|
|
44
|
-
return /* @__PURE__ */ React__default.createElement(MenuItem,
|
|
44
|
+
return /* @__PURE__ */ React__default.createElement(MenuItem, { button: false }, /* @__PURE__ */ React__default.createElement(ListItemIcon, null, /* @__PURE__ */ React__default.createElement(SupportIcon, { icon: item.icon })), /* @__PURE__ */ React__default.createElement(
|
|
45
45
|
ListItemText,
|
|
46
46
|
{
|
|
47
47
|
primary: item.title,
|
|
@@ -127,6 +127,7 @@ function SupportButton(props) {
|
|
|
127
127
|
React__default.Children.map(children, (child, i) => /* @__PURE__ */ React__default.createElement(
|
|
128
128
|
MenuItem,
|
|
129
129
|
{
|
|
130
|
+
button: false,
|
|
130
131
|
alignItems: "flex-start",
|
|
131
132
|
key: `child-${i}`,
|
|
132
133
|
className: classes.menuItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportButton.esm.js","sources":["../../../src/components/SupportButton/SupportButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useApp } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React, { MouseEventHandler, useState } from 'react';\nimport { SupportItem, SupportItemLink, useSupportConfig } from '../../hooks';\nimport { HelpIcon } from '../../icons';\nimport { Link } from '../Link';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SupportButtonProps = {\n title?: string;\n items?: SupportItem[];\n children?: React.ReactNode;\n};\n\nexport type SupportButtonClassKey = 'popoverList';\n\nconst useStyles = makeStyles(\n {\n popoverList: {\n minWidth: 260,\n maxWidth: 400,\n },\n menuItem: {\n whiteSpace: 'normal',\n },\n },\n { name: 'BackstageSupportButton' },\n);\n\nconst SupportIcon = ({ icon }: { icon: string | undefined }) => {\n const app = useApp();\n const Icon = icon ? app.getSystemIcon(icon) ?? HelpIcon : HelpIcon;\n return <Icon />;\n};\n\nconst SupportLink = ({ link }: { link: SupportItemLink }) => (\n <Link to={link.url}>{link.title ?? link.url}</Link>\n);\n\nconst SupportListItem = ({ item }: { item: SupportItem }) => {\n return (\n <MenuItem>\n <ListItemIcon>\n <SupportIcon icon={item.icon} />\n </ListItemIcon>\n <ListItemText\n primary={item.title}\n secondary={item.links?.reduce<React.ReactNode[]>(\n (prev, link, idx) => [\n ...prev,\n idx > 0 && <br key={idx} />,\n <SupportLink link={link} key={link.url} />,\n ],\n [],\n )}\n />\n </MenuItem>\n );\n};\n\nexport function SupportButton(props: SupportButtonProps) {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const { title, items, children } = props;\n const { items: configItems } = useSupportConfig();\n\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [anchorEl, setAnchorEl] = useState<Element | null>(null);\n const classes = useStyles();\n const isSmallScreen = useMediaQuery<Theme>(theme =>\n theme.breakpoints.down('sm'),\n );\n\n const onClickHandler: MouseEventHandler = event => {\n setAnchorEl(event.currentTarget);\n setPopoverOpen(true);\n };\n\n const popoverCloseHandler = () => {\n setPopoverOpen(false);\n };\n\n return (\n <>\n <Box display=\"flex\" ml={1}>\n {isSmallScreen ? (\n <IconButton\n color=\"primary\"\n size=\"small\"\n onClick={onClickHandler}\n data-testid=\"support-button\"\n aria-label=\"Support\"\n >\n <HelpIcon />\n </IconButton>\n ) : (\n <Button\n data-testid=\"support-button\"\n aria-label=\"Support\"\n color=\"primary\"\n onClick={onClickHandler}\n startIcon={<HelpIcon />}\n >\n {t('supportButton.title')}\n </Button>\n )}\n </Box>\n <Popover\n data-testid=\"support-button-popover\"\n open={popoverOpen}\n anchorEl={anchorEl}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n onClose={popoverCloseHandler}\n >\n <MenuList\n className={classes.popoverList}\n autoFocusItem={Boolean(anchorEl)}\n >\n {title && (\n <MenuItem\n button={false}\n alignItems=\"flex-start\"\n className={classes.menuItem}\n >\n <Typography variant=\"subtitle1\">{title}</Typography>\n </MenuItem>\n )}\n {React.Children.map(children, (child, i) => (\n <MenuItem\n alignItems=\"flex-start\"\n key={`child-${i}`}\n className={classes.menuItem}\n >\n {child}\n </MenuItem>\n ))}\n {(items ?? configItems).map((item, i) => (\n <SupportListItem item={item} key={`item-${i}`} />\n ))}\n </MenuList>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={popoverCloseHandler}\n aria-label=\"Close\"\n >\n {t('supportButton.close')}\n </Button>\n </DialogActions>\n </Popover>\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,GAAA;AAAA,MACV,QAAU,EAAA,GAAA;AAAA,KACZ;AAAA,IACA,QAAU,EAAA;AAAA,MACR,UAAY,EAAA,QAAA;AAAA,KACd;AAAA,GACF;AAAA,EACA,EAAE,MAAM,wBAAyB,EAAA;AACnC,CAAA,CAAA;AAEA,MAAM,WAAc,GAAA,CAAC,EAAE,IAAA,EAAyC,KAAA;AAC9D,EAAA,MAAM,MAAM,MAAO,EAAA,CAAA;AACnB,EAAA,MAAM,OAAO,IAAO,GAAA,GAAA,CAAI,aAAc,CAAA,IAAI,KAAK,QAAW,GAAA,QAAA,CAAA;AAC1D,EAAA,oDAAQ,IAAK,EAAA,IAAA,CAAA,CAAA;AACf,CAAA,CAAA;AAEA,MAAM,WAAc,GAAA,CAAC,EAAE,IAAA,EACrB,qBAAAA,cAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAI,IAAK,CAAA,GAAA,EAAA,EAAM,IAAK,CAAA,KAAA,IAAS,KAAK,GAAI,CAAA,CAAA;AAG9C,MAAM,eAAkB,GAAA,CAAC,EAAE,IAAA,EAAkC,KAAA;AAC3D,
|
|
1
|
+
{"version":3,"file":"SupportButton.esm.js","sources":["../../../src/components/SupportButton/SupportButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useApp } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React, { MouseEventHandler, useState } from 'react';\nimport { SupportItem, SupportItemLink, useSupportConfig } from '../../hooks';\nimport { HelpIcon } from '../../icons';\nimport { Link } from '../Link';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SupportButtonProps = {\n title?: string;\n items?: SupportItem[];\n children?: React.ReactNode;\n};\n\nexport type SupportButtonClassKey = 'popoverList';\n\nconst useStyles = makeStyles(\n {\n popoverList: {\n minWidth: 260,\n maxWidth: 400,\n },\n menuItem: {\n whiteSpace: 'normal',\n },\n },\n { name: 'BackstageSupportButton' },\n);\n\nconst SupportIcon = ({ icon }: { icon: string | undefined }) => {\n const app = useApp();\n const Icon = icon ? app.getSystemIcon(icon) ?? HelpIcon : HelpIcon;\n return <Icon />;\n};\n\nconst SupportLink = ({ link }: { link: SupportItemLink }) => (\n <Link to={link.url}>{link.title ?? link.url}</Link>\n);\n\nconst SupportListItem = ({ item }: { item: SupportItem }) => {\n return (\n <MenuItem button={false}>\n <ListItemIcon>\n <SupportIcon icon={item.icon} />\n </ListItemIcon>\n <ListItemText\n primary={item.title}\n secondary={item.links?.reduce<React.ReactNode[]>(\n (prev, link, idx) => [\n ...prev,\n idx > 0 && <br key={idx} />,\n <SupportLink link={link} key={link.url} />,\n ],\n [],\n )}\n />\n </MenuItem>\n );\n};\n\nexport function SupportButton(props: SupportButtonProps) {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const { title, items, children } = props;\n const { items: configItems } = useSupportConfig();\n\n const [popoverOpen, setPopoverOpen] = useState(false);\n const [anchorEl, setAnchorEl] = useState<Element | null>(null);\n const classes = useStyles();\n const isSmallScreen = useMediaQuery<Theme>(theme =>\n theme.breakpoints.down('sm'),\n );\n\n const onClickHandler: MouseEventHandler = event => {\n setAnchorEl(event.currentTarget);\n setPopoverOpen(true);\n };\n\n const popoverCloseHandler = () => {\n setPopoverOpen(false);\n };\n\n return (\n <>\n <Box display=\"flex\" ml={1}>\n {isSmallScreen ? (\n <IconButton\n color=\"primary\"\n size=\"small\"\n onClick={onClickHandler}\n data-testid=\"support-button\"\n aria-label=\"Support\"\n >\n <HelpIcon />\n </IconButton>\n ) : (\n <Button\n data-testid=\"support-button\"\n aria-label=\"Support\"\n color=\"primary\"\n onClick={onClickHandler}\n startIcon={<HelpIcon />}\n >\n {t('supportButton.title')}\n </Button>\n )}\n </Box>\n <Popover\n data-testid=\"support-button-popover\"\n open={popoverOpen}\n anchorEl={anchorEl}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n onClose={popoverCloseHandler}\n >\n <MenuList\n className={classes.popoverList}\n autoFocusItem={Boolean(anchorEl)}\n >\n {title && (\n <MenuItem\n button={false}\n alignItems=\"flex-start\"\n className={classes.menuItem}\n >\n <Typography variant=\"subtitle1\">{title}</Typography>\n </MenuItem>\n )}\n {React.Children.map(children, (child, i) => (\n <MenuItem\n button={false}\n alignItems=\"flex-start\"\n key={`child-${i}`}\n className={classes.menuItem}\n >\n {child}\n </MenuItem>\n ))}\n {(items ?? configItems).map((item, i) => (\n <SupportListItem item={item} key={`item-${i}`} />\n ))}\n </MenuList>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={popoverCloseHandler}\n aria-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AA,CAAA,aAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,MAAQ,EAAA,KAAA;AAAA,UACR,UAAW,EAAA,YAAA;AAAA,UACX,WAAW,OAAQ,CAAA,QAAA;AAAA,SAAA;AAAA,wBAElBA,cAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,WAAA,EAAA,EAAa,KAAM,CAAA;AAAA,OACzC;AAAA,MAEDA,eAAM,QAAS,CAAA,GAAA,CAAI,QAAU,EAAA,CAAC,OAAO,CACpC,qBAAAA,cAAA,CAAA,aAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,MAAQ,EAAA,KAAA;AAAA,UACR,UAAW,EAAA,YAAA;AAAA,UACX,GAAA,EAAK,SAAS,CAAC,CAAA,CAAA;AAAA,UACf,WAAW,OAAQ,CAAA,QAAA;AAAA,SAAA;AAAA,QAElB,KAAA;AAAA,OAEJ,CAAA;AAAA,MAAA,CACC,KAAS,IAAA,WAAA,EAAa,GAAI,CAAA,CAAC,IAAM,EAAA,CAAA,qBAChCA,cAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,IAAY,EAAA,GAAA,EAAK,CAAQ,KAAA,EAAA,CAAC,IAAI,CAChD,CAAA;AAAA,KACH;AAAA,iDACC,aACC,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,SAAA;AAAA,QACN,OAAS,EAAA,mBAAA;AAAA,QACT,YAAW,EAAA,OAAA;AAAA,OAAA;AAAA,MAEV,EAAE,qBAAqB,CAAA;AAAA,KAE5B,CAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.esm.js","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 MTable, {\n Column,\n Icons,\n MaterialTableProps,\n MTableBody,\n MTableHeader,\n MTableToolbar,\n Options,\n} from '@material-table/core';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport {\n makeStyles,\n Theme,\n useTheme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport AddBox from '@material-ui/icons/AddBox';\nimport ArrowUpward from '@material-ui/icons/ArrowUpward';\nimport Check from '@material-ui/icons/Check';\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\nimport ChevronRight from '@material-ui/icons/ChevronRight';\nimport Clear from '@material-ui/icons/Clear';\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\nimport Edit from '@material-ui/icons/Edit';\nimport FilterList from '@material-ui/icons/FilterList';\nimport FirstPage from '@material-ui/icons/FirstPage';\nimport LastPage from '@material-ui/icons/LastPage';\nimport Remove from '@material-ui/icons/Remove';\nimport SaveAlt from '@material-ui/icons/SaveAlt';\nimport ViewColumn from '@material-ui/icons/ViewColumn';\nimport { isEqual, transform } from 'lodash';\nimport React, {\n forwardRef,\n MutableRefObject,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { SelectProps } from '../Select/Select';\nimport { Filter, Filters, SelectedFilters, Without } from './Filters';\nimport { TableLoadingBody } from './TableLoadingBody';\n\n// Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51\nconst tableIcons: Icons = {\n Add: forwardRef((props, ref) => <AddBox {...props} ref={ref} />),\n Check: forwardRef((props, ref) => <Check {...props} ref={ref} />),\n Clear: forwardRef((props, ref) => <Clear {...props} ref={ref} />),\n Delete: forwardRef((props, ref) => <DeleteOutline {...props} ref={ref} />),\n DetailPanel: forwardRef((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n Edit: forwardRef((props, ref) => <Edit {...props} ref={ref} />),\n Export: forwardRef((props, ref) => <SaveAlt {...props} ref={ref} />),\n Filter: forwardRef((props, ref) => <FilterList {...props} ref={ref} />),\n FirstPage: forwardRef((props, ref) => <FirstPage {...props} ref={ref} />),\n LastPage: forwardRef((props, ref) => <LastPage {...props} ref={ref} />),\n NextPage: forwardRef((props, ref) => <ChevronRight {...props} ref={ref} />),\n PreviousPage: forwardRef((props, ref) => (\n <ChevronLeft {...props} ref={ref} />\n )),\n ResetSearch: forwardRef((props, ref) => <Clear {...props} ref={ref} />),\n Search: forwardRef((props, ref) => <FilterList {...props} ref={ref} />),\n SortArrow: forwardRef((props, ref) => <ArrowUpward {...props} ref={ref} />),\n ThirdStateCheck: forwardRef((props, ref) => <Remove {...props} ref={ref} />),\n ViewColumn: forwardRef((props, ref) => <ViewColumn {...props} ref={ref} />),\n};\n\n// TODO: Material table might already have such a function internally that we can use?\nfunction extractValueByField(data: any, field: string): any | undefined {\n const path = field.split('.');\n let value = data[path[0]];\n\n for (let i = 1; i < path.length; ++i) {\n if (value === undefined) {\n return value;\n }\n\n const f = path[i];\n value = value[f];\n }\n\n return value;\n}\n\nexport type TableHeaderClassKey = 'header';\n\nconst StyledMTableHeader = withStyles(\n theme => ({\n header: {\n padding: theme.spacing(1, 2, 1, 2.5),\n borderTop: `1px solid ${theme.palette.grey.A100}`,\n borderBottom: `1px solid ${theme.palette.grey.A100}`,\n // withStyles hasn't a generic overload for theme\n fontWeight: theme.typography.fontWeightBold,\n position: 'static',\n wordBreak: 'normal',\n textTransform: 'uppercase',\n },\n }),\n { name: 'BackstageTableHeader' },\n)(MTableHeader);\n\nexport type TableToolbarClassKey = 'root' | 'title' | 'searchField';\n\nconst StyledMTableToolbar = withStyles(\n theme => ({\n root: {\n padding: theme.spacing(3, 0, 2.5, 2.5),\n },\n title: {\n '& > h6': {\n fontWeight: theme.typography.fontWeightBold,\n },\n },\n searchField: {\n paddingRight: theme.spacing(2),\n },\n }),\n { name: 'BackstageTableToolbar' },\n)(MTableToolbar);\n\n/** @public */\nexport type FiltersContainerClassKey = 'root' | 'title';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n title: {\n fontWeight: theme.typography.fontWeightBold,\n fontSize: 18,\n whiteSpace: 'nowrap',\n },\n }),\n { name: 'BackstageTableFiltersContainer' },\n);\n\nexport type TableClassKey = 'root';\n\nconst useTableStyles = makeStyles(\n () => ({\n root: {\n display: 'flex',\n alignItems: 'start',\n },\n }),\n { name: 'BackstageTable' },\n);\n\nfunction convertColumns<T extends object>(\n columns: TableColumn<T>[],\n theme: Theme,\n): TableColumn<T>[] {\n return columns.map(column => {\n const headerStyle: React.CSSProperties = column.headerStyle ?? {};\n\n let cellStyle = column.cellStyle || {};\n\n if (column.highlight) {\n headerStyle.color = theme.palette.textContrast;\n\n if (typeof cellStyle === 'object') {\n (cellStyle as React.CSSProperties).fontWeight =\n theme.typography.fontWeightBold;\n } else {\n const cellStyleFn = cellStyle as (\n data: any,\n rowData: T,\n column?: Column<T>,\n ) => React.CSSProperties;\n cellStyle = (data, rowData, rowColumn) => {\n const style = cellStyleFn(data, rowData, rowColumn);\n return { ...style, fontWeight: theme.typography.fontWeightBold };\n };\n }\n }\n\n return {\n ...column,\n headerStyle,\n cellStyle,\n };\n });\n}\n\nfunction removeDefaultValues(state: any, defaultState: any): any {\n return transform(state, (result, value, key) => {\n if (!isEqual(value, defaultState[key])) {\n result[key] = value;\n }\n });\n}\n\nconst defaultInitialState = {\n search: '',\n filtersOpen: false,\n filters: {},\n};\n\nexport interface TableColumn<T extends object = {}> extends Column<T> {\n highlight?: boolean;\n width?: string;\n}\n\nexport type TableFilter = {\n column: string;\n type: 'select' | 'multiple-select';\n};\n\nexport type TableState = {\n search?: string;\n filtersOpen?: boolean;\n filters?: SelectedFilters;\n};\n\nexport interface TableProps<T extends object = {}>\n extends MaterialTableProps<T> {\n columns: TableColumn<T>[];\n subtitle?: string;\n filters?: TableFilter[];\n initialState?: TableState;\n emptyContent?: ReactNode;\n isLoading?: boolean;\n onStateChange?: (state: TableState) => any;\n}\n\nexport interface TableOptions<T extends object = {}> extends Options<T> {}\n\nexport function TableToolbar(toolbarProps: {\n toolbarRef: MutableRefObject<any>;\n setSearch: (value: string) => void;\n onSearchChanged: (value: string) => void;\n toggleFilters: () => void;\n hasFilters: boolean;\n selectedFiltersLength: number;\n}) {\n const {\n toolbarRef,\n setSearch,\n hasFilters,\n selectedFiltersLength,\n toggleFilters,\n } = toolbarProps;\n const filtersClasses = useFilterStyles();\n const onSearchChanged = useCallback(\n (searchText: string) => {\n toolbarProps.onSearchChanged(searchText);\n setSearch(searchText);\n },\n [toolbarProps, setSearch],\n );\n\n if (hasFilters) {\n return (\n <Box className={filtersClasses.root}>\n <Box className={filtersClasses.root}>\n <IconButton onClick={toggleFilters} aria-label=\"filter list\">\n <FilterList />\n </IconButton>\n <Typography className={filtersClasses.title}>\n Filters ({selectedFiltersLength})\n </Typography>\n </Box>\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n </Box>\n );\n }\n\n return (\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n );\n}\n\n/**\n * @public\n */\nexport function Table<T extends object = {}>(props: TableProps<T>) {\n const {\n data,\n columns,\n emptyContent,\n options,\n title,\n subtitle,\n localization,\n filters,\n initialState,\n onStateChange,\n components,\n isLoading: loading,\n ...restProps\n } = props;\n const tableClasses = useTableStyles();\n\n const theme = useTheme();\n\n const calculatedInitialState = { ...defaultInitialState, ...initialState };\n\n const [filtersOpen, setFiltersOpen] = useState(\n calculatedInitialState.filtersOpen,\n );\n const toggleFilters = useCallback(\n () => setFiltersOpen(v => !v),\n [setFiltersOpen],\n );\n\n const [selectedFilters, setSelectedFilters] = useState(\n calculatedInitialState.filters,\n );\n\n const [search, setSearch] = useState(calculatedInitialState.search);\n\n useEffect(() => {\n if (onStateChange) {\n const state = removeDefaultValues(\n {\n search,\n filtersOpen,\n filters: selectedFilters,\n },\n defaultInitialState,\n );\n\n onStateChange(state);\n }\n }, [search, filtersOpen, selectedFilters, onStateChange]);\n\n const getFieldByTitle = useCallback(\n (titleValue: string | keyof T) =>\n columns.find(el => el.title === titleValue)?.field,\n [columns],\n );\n\n const tableData = useMemo(() => {\n if (typeof data === 'function' || !selectedFilters) {\n return data;\n }\n\n const selectedFiltersArray = Object.values(selectedFilters);\n if (data && selectedFiltersArray.flat().length) {\n const newData = (data as any[]).filter(\n el =>\n !!Object.entries(selectedFilters)\n .filter(([, value]) => !!(value as { length?: number }).length)\n .every(([key, filterValue]) => {\n const fieldValue = extractValueByField(\n el,\n getFieldByTitle(key) as string,\n );\n\n if (Array.isArray(fieldValue) && Array.isArray(filterValue)) {\n return fieldValue.some(v => filterValue.includes(v));\n } else if (Array.isArray(fieldValue)) {\n return fieldValue.includes(filterValue);\n } else if (Array.isArray(filterValue)) {\n return filterValue.includes(fieldValue);\n }\n\n return fieldValue === filterValue;\n }),\n );\n return newData;\n }\n return data;\n }, [data, selectedFilters, getFieldByTitle]);\n\n const selectedFiltersLength = Object.values(selectedFilters).flat().length;\n\n const hasFilters = !!filters?.length;\n const Toolbar = useCallback(\n (toolbarProps: any /* no type for this in material-table */) => {\n return (\n <TableToolbar\n setSearch={setSearch}\n hasFilters={hasFilters}\n selectedFiltersLength={selectedFiltersLength}\n toggleFilters={toggleFilters}\n {...toolbarProps}\n />\n );\n },\n [toggleFilters, hasFilters, selectedFiltersLength, setSearch],\n );\n\n const hasNoRows = typeof data !== 'function' && data.length === 0;\n const columnCount = columns.length;\n const Body = useMemo(\n () => makeBody({ hasNoRows, emptyContent, columnCount, loading }),\n [hasNoRows, emptyContent, columnCount, loading],\n );\n\n return (\n <Box className={tableClasses.root}>\n {filtersOpen && data && typeof data !== 'function' && filters?.length && (\n <Filters\n filters={constructFilters(filters, data as any[], columns)}\n selectedFilters={selectedFilters}\n onChangeFilters={setSelectedFilters}\n />\n )}\n <MTable<T>\n components={{\n Header: StyledMTableHeader,\n Body,\n Toolbar,\n ...components,\n }}\n options={options}\n columns={convertColumns(columns, theme)}\n icons={tableIcons}\n title={\n <>\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n {subtitle && (\n <Typography color=\"textSecondary\" variant=\"body1\">\n {subtitle}\n </Typography>\n )}\n </>\n }\n data={tableData}\n style={{ width: '100%' }}\n localization={{\n toolbar: { searchPlaceholder: 'Filter', searchTooltip: 'Filter' },\n ...localization,\n }}\n {...restProps}\n />\n </Box>\n );\n}\n\nTable.icons = Object.freeze(tableIcons);\n\nfunction makeBody({\n columnCount,\n emptyContent,\n hasNoRows,\n loading,\n}: {\n hasNoRows: boolean;\n emptyContent: ReactNode;\n columnCount: number;\n loading?: boolean;\n}) {\n return (bodyProps: any /* no type for this in material-table */) => {\n if (loading) {\n return <TableLoadingBody colSpan={columnCount} />;\n }\n\n if (emptyContent && hasNoRows) {\n return (\n <tbody>\n <tr>\n <td colSpan={columnCount}>{emptyContent}</td>\n </tr>\n </tbody>\n );\n }\n\n return <MTableBody {...bodyProps} />;\n };\n}\n\nfunction constructFilters<T extends object>(\n filterConfig: TableFilter[],\n dataValue: any[] | undefined,\n columns: TableColumn<T>[],\n): Filter[] {\n const extractDistinctValues = (field: string | keyof T): Set<any> => {\n const distinctValues = new Set<any>();\n const addValue = (value: any) => {\n if (value !== undefined && value !== null) {\n distinctValues.add(value);\n }\n };\n\n if (dataValue) {\n dataValue.forEach(el => {\n const value = extractValueByField(\n el,\n columns.find(c => c.title === field)?.field as string,\n );\n\n if (Array.isArray(value)) {\n (value as []).forEach(addValue);\n } else {\n addValue(value);\n }\n });\n }\n\n return distinctValues;\n };\n\n const constructSelect = (\n filter: TableFilter,\n ): Without<SelectProps, 'onChange'> => {\n return {\n placeholder: 'All results',\n label: filter.column,\n multiple: filter.type === 'multiple-select',\n items: [...extractDistinctValues(filter.column)].sort().map(value => ({\n label: value,\n value,\n })),\n };\n };\n\n return filterConfig.map(filter => ({\n type: filter.type,\n element: constructSelect(filter),\n }));\n}\n"],"names":["ChevronLeft","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,UAAoB,GAAA;AAAA,EACxB,GAAA,EAAK,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,MAAQ,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EAC/D,KAAA,EAAO,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,KAAO,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EAChE,KAAA,EAAO,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,KAAO,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EAChE,MAAA,EAAQ,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,aAAe,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EACzE,WAAA,EAAa,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAC7B,YAAc,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CACpC,CAAA;AAAA,EACD,IAAA,EAAM,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,IAAM,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EAC9D,MAAA,EAAQ,UAAW,CAAA,CAAC,KAAO,EAAA,GAAA,kDAAS,OAAS,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAAE,CAAA;AAAA,EACnE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MAAM,KAAQ,GAAA,mBAAA;AAAA,UACZ,EAAA;AAAA,UACA,QAAQ,IAAK,CAAA,CAAA,CAAA,KAAK,CAAE,CAAA,KAAA,KAAU,KAAK,CAAG,EAAA,KAAA;AAAA,SACxC,CAAA;AAEA,QAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,CAAG,EAAA;AACxB,UAAC,KAAA,CAAa,QAAQ,QAAQ,CAAA,CAAA;AAAA,SACzB,MAAA;AACL,UAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAAA,SAChB;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAEA,IAAO,OAAA,cAAA,CAAA;AAAA,GACT,CAAA;AAEA,EAAM,MAAA,eAAA,GAAkB,CACtB,MACqC,KAAA;AACrC,IAAO,OAAA;AAAA,MACL,WAAa,EAAA,aAAA;AAAA,MACb,OAAO,MAAO,CAAA,MAAA;AAAA,MACd,QAAA,EAAU,OAAO,IAAS,KAAA,iBAAA;AAAA,MAC1B,KAAA,EAAO,CAAC,GAAG,qBAAsB,CAAA,MAAA,CAAO,MAAM,CAAC,CAAE,CAAA,IAAA,EAAO,CAAA,GAAA,CAAI,CAAU,KAAA,MAAA;AAAA,QACpE,KAAO,EAAA,KAAA;AAAA,QACP,KAAA;AAAA,OACA,CAAA,CAAA;AAAA,KACJ,CAAA;AAAA,GACF,CAAA;AAEA,EAAO,OAAA,YAAA,CAAa,IAAI,CAAW,MAAA,MAAA;AAAA,IACjC,MAAM,MAAO,CAAA,IAAA;AAAA,IACb,OAAA,EAAS,gBAAgB,MAAM,CAAA;AAAA,GAC/B,CAAA,CAAA,CAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.esm.js","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 MTable, {\n Column,\n Icons,\n MaterialTableProps,\n MTableBody,\n MTableHeader,\n MTableToolbar,\n Options,\n} from '@material-table/core';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport {\n makeStyles,\n Theme,\n useTheme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport AddBox from '@material-ui/icons/AddBox';\nimport ArrowUpward from '@material-ui/icons/ArrowUpward';\nimport Check from '@material-ui/icons/Check';\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\nimport ChevronRight from '@material-ui/icons/ChevronRight';\nimport Clear from '@material-ui/icons/Clear';\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\nimport Edit from '@material-ui/icons/Edit';\nimport FilterList from '@material-ui/icons/FilterList';\nimport FirstPage from '@material-ui/icons/FirstPage';\nimport LastPage from '@material-ui/icons/LastPage';\nimport Remove from '@material-ui/icons/Remove';\nimport SaveAlt from '@material-ui/icons/SaveAlt';\nimport ViewColumn from '@material-ui/icons/ViewColumn';\nimport { isEqual, transform } from 'lodash';\nimport React, {\n forwardRef,\n MutableRefObject,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { SelectProps } from '../Select/Select';\nimport { Filter, Filters, SelectedFilters, Without } from './Filters';\nimport { TableLoadingBody } from './TableLoadingBody';\n\n// Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51\nconst tableIcons: Icons = {\n Add: forwardRef<SVGSVGElement>((props, ref) => (\n <AddBox {...props} ref={ref} />\n )),\n Check: forwardRef<SVGSVGElement>((props, ref) => (\n <Check {...props} ref={ref} />\n )),\n Clear: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Delete: forwardRef<SVGSVGElement>((props, ref) => (\n <DeleteOutline {...props} ref={ref} />\n )),\n DetailPanel: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n Edit: forwardRef<SVGSVGElement>((props, ref) => (\n <Edit {...props} ref={ref} />\n )),\n Export: forwardRef<SVGSVGElement>((props, ref) => (\n <SaveAlt {...props} ref={ref} />\n )),\n Filter: forwardRef<SVGSVGElement>((props, ref) => (\n <FilterList {...props} ref={ref} />\n )),\n FirstPage: forwardRef<SVGSVGElement>((props, ref) => (\n <FirstPage {...props} ref={ref} />\n )),\n LastPage: forwardRef<SVGSVGElement>((props, ref) => (\n <LastPage {...props} ref={ref} />\n )),\n NextPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n PreviousPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronLeft {...props} ref={ref} />\n )),\n ResetSearch: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Search: forwardRef<SVGSVGElement>((props, ref) => (\n <FilterList {...props} ref={ref} />\n )),\n SortArrow: forwardRef<SVGSVGElement>((props, ref) => (\n <ArrowUpward {...props} ref={ref} />\n )),\n ThirdStateCheck: forwardRef<SVGSVGElement>((props, ref) => (\n <Remove {...props} ref={ref} />\n )),\n ViewColumn: forwardRef<SVGSVGElement>((props, ref) => (\n <ViewColumn {...props} ref={ref} />\n )),\n};\n\n// TODO: Material table might already have such a function internally that we can use?\nfunction extractValueByField(data: any, field: string): any | undefined {\n const path = field.split('.');\n let value = data[path[0]];\n\n for (let i = 1; i < path.length; ++i) {\n if (value === undefined) {\n return value;\n }\n\n const f = path[i];\n value = value[f];\n }\n\n return value;\n}\n\nexport type TableHeaderClassKey = 'header';\n\nconst StyledMTableHeader = withStyles(\n theme => ({\n header: {\n padding: theme.spacing(1, 2, 1, 2.5),\n borderTop: `1px solid ${theme.palette.grey.A100}`,\n borderBottom: `1px solid ${theme.palette.grey.A100}`,\n // withStyles hasn't a generic overload for theme\n fontWeight: theme.typography.fontWeightBold,\n position: 'static',\n wordBreak: 'normal',\n textTransform: 'uppercase',\n },\n }),\n { name: 'BackstageTableHeader' },\n)(MTableHeader);\n\nexport type TableToolbarClassKey = 'root' | 'title' | 'searchField';\n\nconst StyledMTableToolbar = withStyles(\n theme => ({\n root: {\n padding: theme.spacing(3, 0, 2.5, 2.5),\n },\n title: {\n '& > h6': {\n fontWeight: theme.typography.fontWeightBold,\n },\n },\n searchField: {\n paddingRight: theme.spacing(2),\n },\n }),\n { name: 'BackstageTableToolbar' },\n)(MTableToolbar);\n\n/** @public */\nexport type FiltersContainerClassKey = 'root' | 'title';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n title: {\n fontWeight: theme.typography.fontWeightBold,\n fontSize: 18,\n whiteSpace: 'nowrap',\n },\n }),\n { name: 'BackstageTableFiltersContainer' },\n);\n\nexport type TableClassKey = 'root';\n\nconst useTableStyles = makeStyles(\n () => ({\n root: {\n display: 'flex',\n alignItems: 'start',\n },\n }),\n { name: 'BackstageTable' },\n);\n\nfunction convertColumns<T extends object>(\n columns: TableColumn<T>[],\n theme: Theme,\n): TableColumn<T>[] {\n return columns.map(column => {\n const headerStyle: React.CSSProperties = column.headerStyle ?? {};\n\n let cellStyle = column.cellStyle || {};\n\n if (column.highlight) {\n headerStyle.color = theme.palette.textContrast;\n\n if (typeof cellStyle === 'object') {\n (cellStyle as React.CSSProperties).fontWeight =\n theme.typography.fontWeightBold;\n } else {\n const cellStyleFn = cellStyle as (\n data: any,\n rowData: T,\n column?: Column<T>,\n ) => React.CSSProperties;\n cellStyle = (data, rowData, rowColumn) => {\n const style = cellStyleFn(data, rowData, rowColumn);\n return { ...style, fontWeight: theme.typography.fontWeightBold };\n };\n }\n }\n\n return {\n ...column,\n headerStyle,\n cellStyle,\n };\n });\n}\n\nfunction removeDefaultValues(state: any, defaultState: any): any {\n return transform(state, (result, value, key) => {\n if (!isEqual(value, defaultState[key])) {\n result[key] = value;\n }\n });\n}\n\nconst defaultInitialState = {\n search: '',\n filtersOpen: false,\n filters: {},\n};\n\nexport interface TableColumn<T extends object = {}> extends Column<T> {\n highlight?: boolean;\n width?: string;\n}\n\nexport type TableFilter = {\n column: string;\n type: 'select' | 'multiple-select';\n};\n\nexport type TableState = {\n search?: string;\n filtersOpen?: boolean;\n filters?: SelectedFilters;\n};\n\nexport interface TableProps<T extends object = {}>\n extends MaterialTableProps<T> {\n columns: TableColumn<T>[];\n subtitle?: string;\n filters?: TableFilter[];\n initialState?: TableState;\n emptyContent?: ReactNode;\n isLoading?: boolean;\n onStateChange?: (state: TableState) => any;\n}\n\nexport interface TableOptions<T extends object = {}> extends Options<T> {}\n\nexport function TableToolbar(toolbarProps: {\n toolbarRef: MutableRefObject<any>;\n setSearch: (value: string) => void;\n onSearchChanged: (value: string) => void;\n toggleFilters: () => void;\n hasFilters: boolean;\n selectedFiltersLength: number;\n}) {\n const {\n toolbarRef,\n setSearch,\n hasFilters,\n selectedFiltersLength,\n toggleFilters,\n } = toolbarProps;\n const filtersClasses = useFilterStyles();\n const onSearchChanged = useCallback(\n (searchText: string) => {\n toolbarProps.onSearchChanged(searchText);\n setSearch(searchText);\n },\n [toolbarProps, setSearch],\n );\n\n if (hasFilters) {\n return (\n <Box className={filtersClasses.root}>\n <Box className={filtersClasses.root}>\n <IconButton onClick={toggleFilters} aria-label=\"filter list\">\n <FilterList />\n </IconButton>\n <Typography className={filtersClasses.title}>\n Filters ({selectedFiltersLength})\n </Typography>\n </Box>\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n </Box>\n );\n }\n\n return (\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n );\n}\n\n/**\n * @public\n */\nexport function Table<T extends object = {}>(props: TableProps<T>) {\n const {\n data,\n columns,\n emptyContent,\n options,\n title,\n subtitle,\n localization,\n filters,\n initialState,\n onStateChange,\n components,\n isLoading: loading,\n ...restProps\n } = props;\n const tableClasses = useTableStyles();\n\n const theme = useTheme();\n\n const calculatedInitialState = { ...defaultInitialState, ...initialState };\n\n const [filtersOpen, setFiltersOpen] = useState(\n calculatedInitialState.filtersOpen,\n );\n const toggleFilters = useCallback(\n () => setFiltersOpen(v => !v),\n [setFiltersOpen],\n );\n\n const [selectedFilters, setSelectedFilters] = useState(\n calculatedInitialState.filters,\n );\n\n const [search, setSearch] = useState(calculatedInitialState.search);\n\n useEffect(() => {\n if (onStateChange) {\n const state = removeDefaultValues(\n {\n search,\n filtersOpen,\n filters: selectedFilters,\n },\n defaultInitialState,\n );\n\n onStateChange(state);\n }\n }, [search, filtersOpen, selectedFilters, onStateChange]);\n\n const getFieldByTitle = useCallback(\n (titleValue: string | keyof T) =>\n columns.find(el => el.title === titleValue)?.field,\n [columns],\n );\n\n const tableData = useMemo(() => {\n if (typeof data === 'function' || !selectedFilters) {\n return data;\n }\n\n const selectedFiltersArray = Object.values(selectedFilters);\n if (data && selectedFiltersArray.flat().length) {\n const newData = (data as any[]).filter(\n el =>\n !!Object.entries(selectedFilters)\n .filter(([, value]) => !!(value as { length?: number }).length)\n .every(([key, filterValue]) => {\n const fieldValue = extractValueByField(\n el,\n getFieldByTitle(key) as string,\n );\n\n if (Array.isArray(fieldValue) && Array.isArray(filterValue)) {\n return fieldValue.some(v => filterValue.includes(v));\n } else if (Array.isArray(fieldValue)) {\n return fieldValue.includes(filterValue);\n } else if (Array.isArray(filterValue)) {\n return filterValue.includes(fieldValue);\n }\n\n return fieldValue === filterValue;\n }),\n );\n return newData;\n }\n return data;\n }, [data, selectedFilters, getFieldByTitle]);\n\n const selectedFiltersLength = Object.values(selectedFilters).flat().length;\n\n const hasFilters = !!filters?.length;\n const Toolbar = useCallback(\n (toolbarProps: any /* no type for this in material-table */) => {\n return (\n <TableToolbar\n setSearch={setSearch}\n hasFilters={hasFilters}\n selectedFiltersLength={selectedFiltersLength}\n toggleFilters={toggleFilters}\n {...toolbarProps}\n />\n );\n },\n [toggleFilters, hasFilters, selectedFiltersLength, setSearch],\n );\n\n const hasNoRows = typeof data !== 'function' && data.length === 0;\n const columnCount = columns.length;\n const Body = useMemo(\n () => makeBody({ hasNoRows, emptyContent, columnCount, loading }),\n [hasNoRows, emptyContent, columnCount, loading],\n );\n\n return (\n <Box className={tableClasses.root}>\n {filtersOpen && data && typeof data !== 'function' && filters?.length && (\n <Filters\n filters={constructFilters(filters, data as any[], columns)}\n selectedFilters={selectedFilters}\n onChangeFilters={setSelectedFilters}\n />\n )}\n <MTable<T>\n components={{\n Header: StyledMTableHeader,\n Body,\n Toolbar,\n ...components,\n }}\n options={options}\n columns={convertColumns(columns, theme)}\n icons={tableIcons}\n title={\n <>\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n {subtitle && (\n <Typography color=\"textSecondary\" variant=\"body1\">\n {subtitle}\n </Typography>\n )}\n </>\n }\n data={tableData}\n style={{ width: '100%' }}\n localization={{\n toolbar: { searchPlaceholder: 'Filter', searchTooltip: 'Filter' },\n ...localization,\n }}\n {...restProps}\n />\n </Box>\n );\n}\n\nTable.icons = Object.freeze(tableIcons);\n\nfunction makeBody({\n columnCount,\n emptyContent,\n hasNoRows,\n loading,\n}: {\n hasNoRows: boolean;\n emptyContent: ReactNode;\n columnCount: number;\n loading?: boolean;\n}) {\n return (bodyProps: any /* no type for this in material-table */) => {\n if (loading) {\n return <TableLoadingBody colSpan={columnCount} />;\n }\n\n if (emptyContent && hasNoRows) {\n return (\n <tbody>\n <tr>\n <td colSpan={columnCount}>{emptyContent}</td>\n </tr>\n </tbody>\n );\n }\n\n return <MTableBody {...bodyProps} />;\n };\n}\n\nfunction constructFilters<T extends object>(\n filterConfig: TableFilter[],\n dataValue: any[] | undefined,\n columns: TableColumn<T>[],\n): Filter[] {\n const extractDistinctValues = (field: string | keyof T): Set<any> => {\n const distinctValues = new Set<any>();\n const addValue = (value: any) => {\n if (value !== undefined && value !== null) {\n distinctValues.add(value);\n }\n };\n\n if (dataValue) {\n dataValue.forEach(el => {\n const value = extractValueByField(\n el,\n columns.find(c => c.title === field)?.field as string,\n );\n\n if (Array.isArray(value)) {\n (value as []).forEach(addValue);\n } else {\n addValue(value);\n }\n });\n }\n\n return distinctValues;\n };\n\n const constructSelect = (\n filter: TableFilter,\n ): Without<SelectProps, 'onChange'> => {\n return {\n placeholder: 'All results',\n label: filter.column,\n multiple: filter.type === 'multiple-select',\n items: [...extractDistinctValues(filter.column)].sort().map(value => ({\n label: value,\n value,\n })),\n };\n };\n\n return filterConfig.map(filter => ({\n type: filter.type,\n element: constructSelect(filter),\n }));\n}\n"],"names":["ChevronLeft","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,UAAoB,GAAA;AAAA,EACxB,GAAA,EAAK,UAA0B,CAAA,CAAC,KAAO,EAAA,GAAA,kDACpC,MAAQ,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAC9B,CAAA;AAAA,EACD,KAAA,EAAO,UAA0B,CAAA,CAAC,KAAO,EAAA,GAAA,kDACtC,KAAO,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAC7B,CAAA;AAAA,EACD,KAAA,EAAO,UAA0B,CAAA,CAAC,KAAO,EAAA,GAAA,kDACtC,KAAO,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CAC7B,CAAA;AAAA,EACD,MAAA,EAAQ,UAA0B,CAAA,CAAC,KAAO,EAAA,GAAA,kDACvC,aAAe,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CACrC,CAAA;AAAA,EACD,WAAA,EAAa,UAA0B,CAAA,CAAC,KAAO,EAAA,GAAA,kDAC5C,YAAc,EAAA,EAAA,GAAG,KAAO,EAAA,GAAA,EAAU,CACpC,CAAA;AAAA,EACD,IAAA,EAAM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GAC/B,CAAA,CAAA,CAAA;AACJ;;;;"}
|
|
@@ -37,7 +37,7 @@ function useSupportConfig() {
|
|
|
37
37
|
links: (itemConf.getOptionalConfigArray("links") ?? []).flatMap(
|
|
38
38
|
(linkConf) => ({
|
|
39
39
|
url: linkConf.getString("url"),
|
|
40
|
-
title: linkConf.
|
|
40
|
+
title: linkConf.getOptionalString("title") ?? ""
|
|
41
41
|
})
|
|
42
42
|
)
|
|
43
43
|
}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSupportConfig.esm.js","sources":["../../src/hooks/useSupportConfig.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { useApiHolder, configApiRef } from '@backstage/core-plugin-api';\nimport { coreComponentsTranslationRef } from '../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type SupportItemLink = {\n url: string;\n title: string;\n};\n\nexport type SupportItem = {\n title: string;\n icon?: string;\n links: SupportItemLink[];\n};\n\nexport type SupportConfig = {\n url: string;\n items: SupportItem[];\n};\n\nconst useDefaultSupportConfig = () => {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n return {\n url: 'https://github.com/backstage/backstage/issues',\n items: [\n {\n title: t('supportConfig.default.title'),\n icon: 'warning',\n links: [\n {\n // TODO: Update to dedicated support page on backstage.io/docs\n title: t('supportConfig.default.linkTitle'),\n url: 'https://github.com/backstage/backstage/blob/master/app-config.yaml',\n },\n ],\n },\n ],\n };\n};\n\nexport function useSupportConfig(): SupportConfig {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportConfig = config?.getOptionalConfig('app.support');\n const defaultSupportConfig = useDefaultSupportConfig();\n\n if (!supportConfig) {\n return defaultSupportConfig;\n }\n\n return {\n url: supportConfig.getString('url'),\n items: supportConfig.getConfigArray('items').flatMap(itemConf => ({\n title: itemConf.getString('title'),\n icon: itemConf.getOptionalString('icon'),\n links: (itemConf.getOptionalConfigArray('links') ?? []).flatMap(\n linkConf => ({\n url: linkConf.getString('url'),\n title: linkConf.
|
|
1
|
+
{"version":3,"file":"useSupportConfig.esm.js","sources":["../../src/hooks/useSupportConfig.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { useApiHolder, configApiRef } from '@backstage/core-plugin-api';\nimport { coreComponentsTranslationRef } from '../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type SupportItemLink = {\n url: string;\n title: string;\n};\n\nexport type SupportItem = {\n title: string;\n icon?: string;\n links: SupportItemLink[];\n};\n\nexport type SupportConfig = {\n url: string;\n items: SupportItem[];\n};\n\nconst useDefaultSupportConfig = () => {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n return {\n url: 'https://github.com/backstage/backstage/issues',\n items: [\n {\n title: t('supportConfig.default.title'),\n icon: 'warning',\n links: [\n {\n // TODO: Update to dedicated support page on backstage.io/docs\n title: t('supportConfig.default.linkTitle'),\n url: 'https://github.com/backstage/backstage/blob/master/app-config.yaml',\n },\n ],\n },\n ],\n };\n};\n\nexport function useSupportConfig(): SupportConfig {\n const apiHolder = useApiHolder();\n const config = apiHolder.get(configApiRef);\n const supportConfig = config?.getOptionalConfig('app.support');\n const defaultSupportConfig = useDefaultSupportConfig();\n\n if (!supportConfig) {\n return defaultSupportConfig;\n }\n\n return {\n url: supportConfig.getString('url'),\n items: supportConfig.getConfigArray('items').flatMap(itemConf => ({\n title: itemConf.getString('title'),\n icon: itemConf.getOptionalString('icon'),\n links: (itemConf.getOptionalConfigArray('links') ?? []).flatMap(\n linkConf => ({\n url: linkConf.getString('url'),\n title: linkConf.getOptionalString('title') ?? '',\n }),\n ),\n })),\n };\n}\n"],"names":[],"mappings":";;;;AAoCA,MAAM,0BAA0B,MAAM;AACpC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,4BAA4B,CAAA,CAAA;AAC5D,EAAO,OAAA;AAAA,IACL,GAAK,EAAA,+CAAA;AAAA,IACL,KAAO,EAAA;AAAA,MACL;AAAA,QACE,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,QACtC,IAAM,EAAA,SAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL;AAAA;AAAA,YAEE,KAAA,EAAO,EAAE,iCAAiC,CAAA;AAAA,YAC1C,GAAK,EAAA,oEAAA;AAAA,WACP;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACF,CAAA;AACF,CAAA,CAAA;AAEO,SAAS,gBAAkC,GAAA;AAChD,EAAA,MAAM,YAAY,YAAa,EAAA,CAAA;AAC/B,EAAM,MAAA,MAAA,GAAS,SAAU,CAAA,GAAA,CAAI,YAAY,CAAA,CAAA;AACzC,EAAM,MAAA,aAAA,GAAgB,MAAQ,EAAA,iBAAA,CAAkB,aAAa,CAAA,CAAA;AAC7D,EAAA,MAAM,uBAAuB,uBAAwB,EAAA,CAAA;AAErD,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,oBAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA;AAAA,IACL,GAAA,EAAK,aAAc,CAAA,SAAA,CAAU,KAAK,CAAA;AAAA,IAClC,OAAO,aAAc,CAAA,cAAA,CAAe,OAAO,CAAA,CAAE,QAAQ,CAAa,QAAA,MAAA;AAAA,MAChE,KAAA,EAAO,QAAS,CAAA,SAAA,CAAU,OAAO,CAAA;AAAA,MACjC,IAAA,EAAM,QAAS,CAAA,iBAAA,CAAkB,MAAM,CAAA;AAAA,MACvC,QAAQ,QAAS,CAAA,sBAAA,CAAuB,OAAO,CAAA,IAAK,EAAI,EAAA,OAAA;AAAA,QACtD,CAAa,QAAA,MAAA;AAAA,UACX,GAAA,EAAK,QAAS,CAAA,SAAA,CAAU,KAAK,CAAA;AAAA,UAC7B,KAAO,EAAA,QAAA,CAAS,iBAAkB,CAAA,OAAO,CAAK,IAAA,EAAA;AAAA,SAChD,CAAA;AAAA,OACF;AAAA,KACA,CAAA,CAAA;AAAA,GACJ,CAAA;AACF;;;;"}
|
package/dist/icons/icons.esm.js
CHANGED
|
@@ -41,6 +41,12 @@ function UserIcon(props) {
|
|
|
41
41
|
function WarningIcon(props) {
|
|
42
42
|
return /* @__PURE__ */ React__default.createElement(AppIcon, { id: "warning", ...props });
|
|
43
43
|
}
|
|
44
|
+
function StarIcon(props) {
|
|
45
|
+
return /* @__PURE__ */ React__default.createElement(AppIcon, { id: "star", ...props });
|
|
46
|
+
}
|
|
47
|
+
function UnstarredIcon(props) {
|
|
48
|
+
return /* @__PURE__ */ React__default.createElement(AppIcon, { id: "unstarred", ...props });
|
|
49
|
+
}
|
|
44
50
|
|
|
45
|
-
export { AppIcon, BrokenImageIcon, CatalogIcon, ChatIcon, DashboardIcon, DocsIcon, EmailIcon, GitHubIcon, GroupIcon, HelpIcon, UserIcon, WarningIcon };
|
|
51
|
+
export { AppIcon, BrokenImageIcon, CatalogIcon, ChatIcon, DashboardIcon, DocsIcon, EmailIcon, GitHubIcon, GroupIcon, HelpIcon, StarIcon, UnstarredIcon, UserIcon, WarningIcon };
|
|
46
52
|
//# sourceMappingURL=icons.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.esm.js","sources":["../../src/icons/icons.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport MuiBrokenImageIcon from '@material-ui/icons/BrokenImage';\nimport React, { ComponentProps } from 'react';\n\n/**\n * @public\n * Props for the {@link @backstage/core-plugin-api#IconComponent} component.\n */\nexport type IconComponentProps = ComponentProps<IconComponent>;\n\n/**\n * @public\n * Props for the {@link AppIcon} component.\n */\nexport type AppIconProps = IconComponentProps & {\n // The key of the system icon to render.\n id: string;\n // An optional fallback icon component to render when the system icon is not found.\n // Default to () => null.\n Fallback?: IconComponent;\n};\n\n/**\n * @public\n * A component that renders a system icon by its id.\n */\nexport function AppIcon(props: AppIconProps) {\n const { id: key, Fallback = MuiBrokenImageIcon, ...rest } = props;\n const app = useApp();\n const Icon = app.getSystemIcon(key) ?? Fallback;\n return <Icon {...rest} />;\n}\n\n// Should match the list of overridable system icon keys in @backstage/core-app-api\n/**\n * Broken Image Icon\n * @public\n */\nexport function BrokenImageIcon(props: IconComponentProps) {\n return <AppIcon id=\"brokenImage\" {...props} />;\n}\n/** @public */\nexport function CatalogIcon(props: IconComponentProps) {\n return <AppIcon id=\"catalog\" {...props} />;\n}\n/** @public */\nexport function ChatIcon(props: IconComponentProps) {\n return <AppIcon id=\"chat\" {...props} />;\n}\n/** @public */\nexport function DashboardIcon(props: IconComponentProps) {\n return <AppIcon id=\"dashboard\" {...props} />;\n}\n/** @public */\nexport function DocsIcon(props: IconComponentProps) {\n return <AppIcon id=\"docs\" {...props} />;\n}\n/** @public */\nexport function EmailIcon(props: IconComponentProps) {\n return <AppIcon id=\"email\" {...props} />;\n}\n/** @public */\nexport function GitHubIcon(props: IconComponentProps) {\n return <AppIcon id=\"github\" {...props} />;\n}\n/** @public */\nexport function GroupIcon(props: IconComponentProps) {\n return <AppIcon id=\"group\" {...props} />;\n}\n/** @public */\nexport function HelpIcon(props: IconComponentProps) {\n return <AppIcon id=\"help\" {...props} />;\n}\n/** @public */\nexport function UserIcon(props: IconComponentProps) {\n return <AppIcon id=\"user\" {...props} />;\n}\n/** @public */\nexport function WarningIcon(props: IconComponentProps) {\n return <AppIcon id=\"warning\" {...props} />;\n}\n"],"names":["React"],"mappings":";;;;AA0CO,SAAS,QAAQ,KAAqB,EAAA;AAC3C,EAAA,MAAM,EAAE,EAAI,EAAA,GAAA,EAAK,WAAW,kBAAoB,EAAA,GAAG,MAAS,GAAA,KAAA,CAAA;AAC5D,EAAA,MAAM,MAAM,MAAO,EAAA,CAAA;AACnB,EAAA,MAAM,IAAO,GAAA,GAAA,CAAI,aAAc,CAAA,GAAG,CAAK,IAAA,QAAA,CAAA;AACvC,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,IAAM,EAAA,EAAA,GAAG,IAAM,EAAA,CAAA,CAAA;AACzB,CAAA;AAOO,SAAS,gBAAgB,KAA2B,EAAA;AACzD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,aAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;AAC9C,CAAA;AAEO,SAAS,YAAY,KAA2B,EAAA;AACrD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,SAAA,EAAW,GAAG,KAAO,EAAA,CAAA,CAAA;AAC1C,CAAA;AAEO,SAAS,SAAS,KAA2B,EAAA;AAClD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAA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D,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,SAAA,EAAW,GAAG,KAAO,EAAA,CAAA,CAAA;AAC1C;;;;"}
|
|
1
|
+
{"version":3,"file":"icons.esm.js","sources":["../../src/icons/icons.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport MuiBrokenImageIcon from '@material-ui/icons/BrokenImage';\nimport React, { ComponentProps } from 'react';\n\n/**\n * @public\n * Props for the {@link @backstage/core-plugin-api#IconComponent} component.\n */\nexport type IconComponentProps = ComponentProps<IconComponent>;\n\n/**\n * @public\n * Props for the {@link AppIcon} component.\n */\nexport type AppIconProps = IconComponentProps & {\n // The key of the system icon to render.\n id: string;\n // An optional fallback icon component to render when the system icon is not found.\n // Default to () => null.\n Fallback?: IconComponent;\n};\n\n/**\n * @public\n * A component that renders a system icon by its id.\n */\nexport function AppIcon(props: AppIconProps) {\n const { id: key, Fallback = MuiBrokenImageIcon, ...rest } = props;\n const app = useApp();\n const Icon = app.getSystemIcon(key) ?? Fallback;\n return <Icon {...rest} />;\n}\n\n// Should match the list of overridable system icon keys in @backstage/core-app-api\n/**\n * Broken Image Icon\n * @public\n */\nexport function BrokenImageIcon(props: IconComponentProps) {\n return <AppIcon id=\"brokenImage\" {...props} />;\n}\n/** @public */\nexport function CatalogIcon(props: IconComponentProps) {\n return <AppIcon id=\"catalog\" {...props} />;\n}\n/** @public */\nexport function ChatIcon(props: IconComponentProps) {\n return <AppIcon id=\"chat\" {...props} />;\n}\n/** @public */\nexport function DashboardIcon(props: IconComponentProps) {\n return <AppIcon id=\"dashboard\" {...props} />;\n}\n/** @public */\nexport function DocsIcon(props: IconComponentProps) {\n return <AppIcon id=\"docs\" {...props} />;\n}\n/** @public */\nexport function EmailIcon(props: IconComponentProps) {\n return <AppIcon id=\"email\" {...props} />;\n}\n/** @public */\nexport function GitHubIcon(props: IconComponentProps) {\n return <AppIcon id=\"github\" {...props} />;\n}\n/** @public */\nexport function GroupIcon(props: IconComponentProps) {\n return <AppIcon id=\"group\" {...props} />;\n}\n/** @public */\nexport function HelpIcon(props: IconComponentProps) {\n return <AppIcon id=\"help\" {...props} />;\n}\n/** @public */\nexport function UserIcon(props: IconComponentProps) {\n return <AppIcon id=\"user\" {...props} />;\n}\n/** @public */\nexport function WarningIcon(props: IconComponentProps) {\n return <AppIcon id=\"warning\" {...props} />;\n}\n/** @public */\nexport function StarIcon(props: IconComponentProps) {\n return <AppIcon id=\"star\" {...props} />;\n}\n/** @public */\nexport function UnstarredIcon(props: IconComponentProps) {\n return <AppIcon id=\"unstarred\" {...props} />;\n}\n"],"names":["React"],"mappings":";;;;AA0CO,SAAS,QAAQ,KAAqB,EAAA;AAC3C,EAAA,MAAM,EAAE,EAAI,EAAA,GAAA,EAAK,WAAW,kBAAoB,EAAA,GAAG,MAAS,GAAA,KAAA,CAAA;AAC5D,EAAA,MAAM,MAAM,MAAO,EAAA,CAAA;AACnB,EAAA,MAAM,IAAO,GAAA,GAAA,CAAI,aAAc,CAAA,GAAG,CAAK,IAAA,QAAA,CAAA;AACvC,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,IAAM,EAAA,EAAA,GAAG,IAAM,EAAA,CAAA,CAAA;AACzB,CAAA;AAOO,SAAS,gBAAgB,KAA2B,EAAA;AACzD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,aAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;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A,EAAQ,EAAG,EAAA,MAAA,EAAQ,GAAG,KAAO,EAAA,CAAA,CAAA;AACvC,CAAA;AAEO,SAAS,SAAS,KAA2B,EAAA;AAClD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,MAAA,EAAQ,GAAG,KAAO,EAAA,CAAA,CAAA;AACvC,CAAA;AAEO,SAAS,YAAY,KAA2B,EAAA;AACrD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,SAAA,EAAW,GAAG,KAAO,EAAA,CAAA,CAAA;AAC1C,CAAA;AAEO,SAAS,SAAS,KAA2B,EAAA;AAClD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,MAAA,EAAQ,GAAG,KAAO,EAAA,CAAA,CAAA;AACvC,CAAA;AAEO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAA,uBAAQA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,WAAA,EAAa,GAAG,KAAO,EAAA,CAAA,CAAA;AAC5C;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { CSSProperties, ElementType, ReactNode, PropsWithChildren, ComponentClass, ErrorInfo,
|
|
3
|
+
import React__default, { CSSProperties, ElementType, ReactNode, PropsWithChildren, ComponentProps, ComponentClass, ErrorInfo, ReactElement } from 'react';
|
|
4
4
|
import { ButtonProps as ButtonProps$1 } from '@material-ui/core/Button';
|
|
5
5
|
import { LinkProps as LinkProps$1 } from '@material-ui/core/Link';
|
|
6
6
|
import { LinkProps as LinkProps$2, NavLinkProps } from 'react-router-dom';
|
|
7
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
7
8
|
import CSS from 'csstype';
|
|
8
9
|
import { Options } from 'react-markdown';
|
|
9
10
|
import { TooltipProps } from '@material-ui/core/Tooltip';
|
|
@@ -688,6 +689,35 @@ type ErrorPanelProps = {
|
|
|
688
689
|
*/
|
|
689
690
|
declare function ErrorPanel(props: PropsWithChildren<ErrorPanelProps>): React__default.JSX.Element;
|
|
690
691
|
|
|
692
|
+
/**
|
|
693
|
+
* @public
|
|
694
|
+
*/
|
|
695
|
+
type FavoriteToggleIconClassKey = 'icon' | 'iconBorder';
|
|
696
|
+
/**
|
|
697
|
+
* Icon used in FavoriteToggle component.
|
|
698
|
+
*
|
|
699
|
+
* Can be used independently, useful when used as {@link @material-table/core#MaterialTableProps.actions} in {@link @material-table/core#MaterialTable}
|
|
700
|
+
*
|
|
701
|
+
* @public
|
|
702
|
+
*/
|
|
703
|
+
declare function FavoriteToggleIcon(props: {
|
|
704
|
+
isFavorite: boolean;
|
|
705
|
+
}): React__default.JSX.Element;
|
|
706
|
+
/**
|
|
707
|
+
* Toggle encapsulating logic for marking something as favorite,
|
|
708
|
+
* primarily used in various instances of entity lists and cards but can be used elsewhere.
|
|
709
|
+
*
|
|
710
|
+
* This component can only be used in as a controlled toggle and does not keep internal state.
|
|
711
|
+
*
|
|
712
|
+
* @public
|
|
713
|
+
*/
|
|
714
|
+
declare function FavoriteToggle(props: ComponentProps<typeof IconButton> & {
|
|
715
|
+
id: string;
|
|
716
|
+
title: string;
|
|
717
|
+
isFavorite: boolean;
|
|
718
|
+
onToggle: (value: boolean) => void;
|
|
719
|
+
}): React__default.JSX.Element;
|
|
720
|
+
|
|
691
721
|
type ResponseErrorPanelClassKey = 'text' | 'divider';
|
|
692
722
|
/**
|
|
693
723
|
* Renders a warning panel as the effect of a failed server request.
|
|
@@ -1281,6 +1311,10 @@ declare function HelpIcon(props: IconComponentProps): React__default.JSX.Element
|
|
|
1281
1311
|
declare function UserIcon(props: IconComponentProps): React__default.JSX.Element;
|
|
1282
1312
|
/** @public */
|
|
1283
1313
|
declare function WarningIcon(props: IconComponentProps): React__default.JSX.Element;
|
|
1314
|
+
/** @public */
|
|
1315
|
+
declare function StarIcon(props: IconComponentProps): React__default.JSX.Element;
|
|
1316
|
+
/** @public */
|
|
1317
|
+
declare function UnstarredIcon(props: IconComponentProps): React__default.JSX.Element;
|
|
1284
1318
|
|
|
1285
1319
|
/** @public */
|
|
1286
1320
|
type BackstageContentClassKey = 'root' | 'stretch' | 'noPadding';
|
|
@@ -1950,6 +1984,7 @@ type IdentityProviders = ('guest' | 'custom' | SignInProviderConfig)[];
|
|
|
1950
1984
|
type MultiSignInPageProps = SignInPageProps & {
|
|
1951
1985
|
providers: IdentityProviders;
|
|
1952
1986
|
title?: string;
|
|
1987
|
+
titleComponent?: ReactNode;
|
|
1953
1988
|
align?: 'center' | 'left';
|
|
1954
1989
|
};
|
|
1955
1990
|
type SingleSignInPageProps = SignInPageProps & {
|
|
@@ -2151,6 +2186,7 @@ type BackstageComponentsNameToClassKey = {
|
|
|
2151
2186
|
BackstageTabbedCard: TabbedCardClassKey;
|
|
2152
2187
|
BackstageTabbedCardBoldHeader: BoldHeaderClassKey;
|
|
2153
2188
|
BackstageCardTab: CardTabClassKey;
|
|
2189
|
+
BackstageFavoriteToggleIcon: FavoriteToggleIconClassKey;
|
|
2154
2190
|
};
|
|
2155
2191
|
/** @public */
|
|
2156
2192
|
type BackstageOverrides = Overrides & {
|
|
@@ -2161,4 +2197,4 @@ declare module '@backstage/theme' {
|
|
|
2161
2197
|
}
|
|
2162
2198
|
}
|
|
2163
2199
|
|
|
2164
|
-
export { AlertDisplay, type AlertDisplayProps, AppIcon, type AppIconProps, AutoLogout, type AutoLogoutProps, Avatar, type AvatarClassKey, type AvatarProps, type BackstageContentClassKey, type BackstageOverrides, type BoldHeaderClassKey, BottomLink, type BottomLinkClassKey, type BottomLinkProps, Breadcrumbs, type BreadcrumbsClickableTextClassKey, type BreadcrumbsCurrentPageClassKey, type BreadcrumbsStyledBoxClassKey, BrokenImageIcon, Button, type ButtonProps, type CardActionsTopRightClassKey, CardTab, type CardTabClassKey, CatalogIcon, ChatIcon, type ClosedDropdownClassKey, CodeSnippet, type CodeSnippetProps, Content, ContentHeader, type ContentHeaderClassKey, CopyTextButton, type CopyTextButtonProps, CreateButton, type CreateButtonProps, type CustomProviderClassKey, DashboardIcon, DependencyGraph, type DependencyGraphDefaultLabelClassKey, type DependencyGraphDefaultNodeClassKey, type DependencyGraphEdgeClassKey, type DependencyGraphNodeClassKey, type DependencyGraphProps, DependencyGraphTypes, DismissableBanner, type DismissableBannerClassKey, type DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, type EmptyStateClassKey, type EmptyStateImageClassKey, ErrorBoundary, type ErrorBoundaryProps, ErrorPage, type ErrorPageClassKey, ErrorPanel, type ErrorPanelClassKey, type ErrorPanelProps, type FeatureCalloutCircleClassKey, FeatureCalloutCircular, type FiltersContainerClassKey, Gauge, GaugeCard, type GaugeCardClassKey, type GaugeClassKey, type GaugeProps, type GaugePropsGetColor, type GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderActionMenu, type HeaderActionMenuItem, type HeaderActionMenuProps, type HeaderClassKey, HeaderIconLinkRow, type HeaderIconLinkRowClassKey, HeaderLabel, type HeaderLabelClassKey, HeaderTabs, type HeaderTabsClassKey, HelpIcon, HorizontalScrollGrid, type HorizontalScrollGridClassKey, type IconComponentProps, IconLinkVertical, type IconLinkVerticalClassKey, type IconLinkVerticalProps, type IdentityProviders, InfoCard, type InfoCardClassKey, type InfoCardVariants, ItemCard, ItemCardGrid, type ItemCardGridClassKey, type ItemCardGridProps, ItemCardHeader, type ItemCardHeaderClassKey, type ItemCardHeaderProps, Lifecycle, type LifecycleClassKey, LinearGauge, Link, LinkButton, type LinkButtonProps, type LinkProps, LogViewer, type LogViewerClassKey, type LogViewerProps, type LoginRequestListItemClassKey, MarkdownContent, type MarkdownContentClassKey, type MetadataTableCellClassKey, type MetadataTableListClassKey, type MetadataTableListItemClassKey, type MetadataTableTitleCellClassKey, type MicDropClassKey, MissingAnnotationEmptyState, type MissingAnnotationEmptyStateClassKey, MobileSidebar, type MobileSidebarProps, OAuthRequestDialog, type OAuthRequestDialogClassKey, type OpenedDropdownClassKey, OverflowTooltip, type OverflowTooltipClassKey, Page, type PageClassKey, PageWithHeader, Progress, ProxiedSignInPage, type ProxiedSignInPageProps, ResponseErrorPanel, type ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, type SelectClassKey, type SelectInputBaseClassKey, type SelectItem, type SelectedItems, Sidebar, type SidebarClassKey, LegacySidebarContext as SidebarContext, type SidebarContextType, SidebarDivider, type SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, type SidebarGroupProps, SidebarItem, type SidebarItemClassKey, type SidebarOpenState, SidebarOpenStateProvider, type SidebarOptions, SidebarPage, type SidebarPageClassKey, type SidebarPageProps, type SidebarPinState, LegacySidebarPinStateContext as SidebarPinStateContext, type SidebarPinStateContextType, SidebarPinStateProvider, type SidebarProps, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, type SidebarSpaceClassKey, SidebarSpacer, type SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, type SidebarSubmenuItemDropdownItem, type SidebarSubmenuItemProps, type SidebarSubmenuProps, SignInPage, type SignInPageClassKey, type SignInProviderConfig, SimpleStepper, type SimpleStepperFooterClassKey, SimpleStepperStep, type SimpleStepperStepClassKey, StatusAborted, type StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, type StructuredMetadataTableListClassKey, type StructuredMetadataTableNestedListClassKey, type StructuredMetadataTableProps, type SubmenuOptions, SubvalueCell, type SubvalueCellClassKey, SupportButton, type SupportButtonClassKey, type SupportConfig, type SupportItem, type SupportItemLink, type Tab, TabbedCard, type TabbedCardClassKey, TabbedLayout, Table, type TableClassKey, type TableColumn, type TableFilter, type TableFiltersClassKey, type TableHeaderClassKey, type TableOptions, type TableProps, type TableState, type TableToolbarClassKey, TrendLine, UserIcon, UserIdentity, WarningIcon, WarningPanel, type WarningPanelClassKey, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
|
|
2200
|
+
export { AlertDisplay, type AlertDisplayProps, AppIcon, type AppIconProps, AutoLogout, type AutoLogoutProps, Avatar, type AvatarClassKey, type AvatarProps, type BackstageContentClassKey, type BackstageOverrides, type BoldHeaderClassKey, BottomLink, type BottomLinkClassKey, type BottomLinkProps, Breadcrumbs, type BreadcrumbsClickableTextClassKey, type BreadcrumbsCurrentPageClassKey, type BreadcrumbsStyledBoxClassKey, BrokenImageIcon, Button, type ButtonProps, type CardActionsTopRightClassKey, CardTab, type CardTabClassKey, CatalogIcon, ChatIcon, type ClosedDropdownClassKey, CodeSnippet, type CodeSnippetProps, Content, ContentHeader, type ContentHeaderClassKey, CopyTextButton, type CopyTextButtonProps, CreateButton, type CreateButtonProps, type CustomProviderClassKey, DashboardIcon, DependencyGraph, type DependencyGraphDefaultLabelClassKey, type DependencyGraphDefaultNodeClassKey, type DependencyGraphEdgeClassKey, type DependencyGraphNodeClassKey, type DependencyGraphProps, DependencyGraphTypes, DismissableBanner, type DismissableBannerClassKey, type DismissbleBannerClassKey, DocsIcon, EmailIcon, EmptyState, type EmptyStateClassKey, type EmptyStateImageClassKey, ErrorBoundary, type ErrorBoundaryProps, ErrorPage, type ErrorPageClassKey, ErrorPanel, type ErrorPanelClassKey, type ErrorPanelProps, FavoriteToggle, FavoriteToggleIcon, type FavoriteToggleIconClassKey, type FeatureCalloutCircleClassKey, FeatureCalloutCircular, type FiltersContainerClassKey, Gauge, GaugeCard, type GaugeCardClassKey, type GaugeClassKey, type GaugeProps, type GaugePropsGetColor, type GaugePropsGetColorOptions, GitHubIcon, GroupIcon, Header, HeaderActionMenu, type HeaderActionMenuItem, type HeaderActionMenuProps, type HeaderClassKey, HeaderIconLinkRow, type HeaderIconLinkRowClassKey, HeaderLabel, type HeaderLabelClassKey, HeaderTabs, type HeaderTabsClassKey, HelpIcon, HorizontalScrollGrid, type HorizontalScrollGridClassKey, type IconComponentProps, IconLinkVertical, type IconLinkVerticalClassKey, type IconLinkVerticalProps, type IdentityProviders, InfoCard, type InfoCardClassKey, type InfoCardVariants, ItemCard, ItemCardGrid, type ItemCardGridClassKey, type ItemCardGridProps, ItemCardHeader, type ItemCardHeaderClassKey, type ItemCardHeaderProps, Lifecycle, type LifecycleClassKey, LinearGauge, Link, LinkButton, type LinkButtonProps, type LinkProps, LogViewer, type LogViewerClassKey, type LogViewerProps, type LoginRequestListItemClassKey, MarkdownContent, type MarkdownContentClassKey, type MetadataTableCellClassKey, type MetadataTableListClassKey, type MetadataTableListItemClassKey, type MetadataTableTitleCellClassKey, type MicDropClassKey, MissingAnnotationEmptyState, type MissingAnnotationEmptyStateClassKey, MobileSidebar, type MobileSidebarProps, OAuthRequestDialog, type OAuthRequestDialogClassKey, type OpenedDropdownClassKey, OverflowTooltip, type OverflowTooltipClassKey, Page, type PageClassKey, PageWithHeader, Progress, ProxiedSignInPage, type ProxiedSignInPageProps, ResponseErrorPanel, type ResponseErrorPanelClassKey, RoutedTabs, SIDEBAR_INTRO_LOCAL_STORAGE, SelectComponent as Select, type SelectClassKey, type SelectInputBaseClassKey, type SelectItem, type SelectedItems, Sidebar, type SidebarClassKey, LegacySidebarContext as SidebarContext, type SidebarContextType, SidebarDivider, type SidebarDividerClassKey, SidebarExpandButton, SidebarGroup, type SidebarGroupProps, SidebarItem, type SidebarItemClassKey, type SidebarOpenState, SidebarOpenStateProvider, type SidebarOptions, SidebarPage, type SidebarPageClassKey, type SidebarPageProps, type SidebarPinState, LegacySidebarPinStateContext as SidebarPinStateContext, type SidebarPinStateContextType, SidebarPinStateProvider, type SidebarProps, SidebarScrollWrapper, SidebarSearchField, SidebarSpace, type SidebarSpaceClassKey, SidebarSpacer, type SidebarSpacerClassKey, SidebarSubmenu, SidebarSubmenuItem, type SidebarSubmenuItemDropdownItem, type SidebarSubmenuItemProps, type SidebarSubmenuProps, SignInPage, type SignInPageClassKey, type SignInProviderConfig, SimpleStepper, type SimpleStepperFooterClassKey, SimpleStepperStep, type SimpleStepperStepClassKey, StarIcon, StatusAborted, type StatusClassKey, StatusError, StatusOK, StatusPending, StatusRunning, StatusWarning, StructuredMetadataTable, type StructuredMetadataTableListClassKey, type StructuredMetadataTableNestedListClassKey, type StructuredMetadataTableProps, type SubmenuOptions, SubvalueCell, type SubvalueCellClassKey, SupportButton, type SupportButtonClassKey, type SupportConfig, type SupportItem, type SupportItemLink, type Tab, TabbedCard, type TabbedCardClassKey, TabbedLayout, Table, type TableClassKey, type TableColumn, type TableFilter, type TableFiltersClassKey, type TableHeaderClassKey, type TableOptions, type TableProps, type TableState, type TableToolbarClassKey, TrendLine, UnstarredIcon, UserIcon, UserIdentity, WarningIcon, WarningPanel, type WarningPanelClassKey, sidebarConfig, useContent, useQueryParamState, useSidebarOpenState, useSidebarPinState, useSupportConfig };
|
package/dist/index.esm.js
CHANGED
|
@@ -11,6 +11,7 @@ export { DismissableBanner } from './components/DismissableBanner/DismissableBan
|
|
|
11
11
|
export { EmptyState } from './components/EmptyState/EmptyState.esm.js';
|
|
12
12
|
export { MissingAnnotationEmptyState } from './components/EmptyState/MissingAnnotationEmptyState.esm.js';
|
|
13
13
|
export { ErrorPanel } from './components/ErrorPanel/ErrorPanel.esm.js';
|
|
14
|
+
export { FavoriteToggle, FavoriteToggleIcon } from './components/FavoriteToggle/FavoriteToggle.esm.js';
|
|
14
15
|
export { ResponseErrorPanel } from './components/ResponseErrorPanel/ResponseErrorPanel.esm.js';
|
|
15
16
|
export { FeatureCalloutCircular } from './components/FeatureDiscovery/FeatureCalloutCircular.esm.js';
|
|
16
17
|
export { HeaderIconLinkRow } from './components/HeaderIconLinkRow/HeaderIconLinkRow.esm.js';
|
|
@@ -40,7 +41,7 @@ export { TrendLine } from './components/TrendLine/TrendLine.esm.js';
|
|
|
40
41
|
export { WarningPanel } from './components/WarningPanel/WarningPanel.esm.js';
|
|
41
42
|
export { useQueryParamState } from './hooks/useQueryParamState.esm.js';
|
|
42
43
|
export { useSupportConfig } from './hooks/useSupportConfig.esm.js';
|
|
43
|
-
export { AppIcon, BrokenImageIcon, CatalogIcon, ChatIcon, DashboardIcon, DocsIcon, EmailIcon, GitHubIcon, GroupIcon, HelpIcon, UserIcon, WarningIcon } from './icons/icons.esm.js';
|
|
44
|
+
export { AppIcon, BrokenImageIcon, CatalogIcon, ChatIcon, DashboardIcon, DocsIcon, EmailIcon, GitHubIcon, GroupIcon, HelpIcon, StarIcon, UnstarredIcon, UserIcon, WarningIcon } from './icons/icons.esm.js';
|
|
44
45
|
export { BottomLink } from './layout/BottomLink/BottomLink.esm.js';
|
|
45
46
|
export { Content } from './layout/Content/Content.esm.js';
|
|
46
47
|
export { ContentHeader } from './layout/ContentHeader/ContentHeader.esm.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -39,10 +39,7 @@ const useStyles = (props) => makeStyles(
|
|
|
39
39
|
}),
|
|
40
40
|
{ name: "BackstageContentHeader" }
|
|
41
41
|
);
|
|
42
|
-
const ContentHeaderTitle = ({
|
|
43
|
-
title = "Unknown page",
|
|
44
|
-
className
|
|
45
|
-
}) => /* @__PURE__ */ React__default.createElement(
|
|
42
|
+
const ContentHeaderTitle = ({ title, className }) => /* @__PURE__ */ React__default.createElement(
|
|
46
43
|
Typography,
|
|
47
44
|
{
|
|
48
45
|
variant: "h4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentHeader.esm.js","sources":["../../../src/layout/ContentHeader/ContentHeader.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React, { PropsWithChildren, ReactNode } from 'react';\nimport { Helmet } from 'react-helmet';\n\n/**\n * TODO: favoriteable capability\n */\n\n/** @public */\nexport type ContentHeaderClassKey =\n | 'container'\n | 'leftItemsBox'\n | 'rightItemsBox'\n | 'description'\n | 'title';\n\nconst useStyles = (props: ContentHeaderProps) =>\n makeStyles(\n theme => ({\n container: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n textAlign: props.textAlign,\n },\n leftItemsBox: {\n flex: '1 1 auto',\n minWidth: 0,\n overflow: 'visible',\n },\n rightItemsBox: {\n flex: '0 1 auto',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n marginLeft: theme.spacing(1),\n minWidth: 0,\n overflow: 'visible',\n },\n description: {},\n title: {\n display: 'inline-flex',\n marginBottom: 0,\n },\n }),\n { name: 'BackstageContentHeader' },\n );\n\ntype ContentHeaderTitleProps = {\n title?: string;\n className?: string;\n};\n\nconst ContentHeaderTitle = ({
|
|
1
|
+
{"version":3,"file":"ContentHeader.esm.js","sources":["../../../src/layout/ContentHeader/ContentHeader.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React, { PropsWithChildren, ReactNode } from 'react';\nimport { Helmet } from 'react-helmet';\n\n/**\n * TODO: favoriteable capability\n */\n\n/** @public */\nexport type ContentHeaderClassKey =\n | 'container'\n | 'leftItemsBox'\n | 'rightItemsBox'\n | 'description'\n | 'title';\n\nconst useStyles = (props: ContentHeaderProps) =>\n makeStyles(\n theme => ({\n container: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n textAlign: props.textAlign,\n },\n leftItemsBox: {\n flex: '1 1 auto',\n minWidth: 0,\n overflow: 'visible',\n },\n rightItemsBox: {\n flex: '0 1 auto',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n marginLeft: theme.spacing(1),\n minWidth: 0,\n overflow: 'visible',\n },\n description: {},\n title: {\n display: 'inline-flex',\n marginBottom: 0,\n },\n }),\n { name: 'BackstageContentHeader' },\n );\n\ntype ContentHeaderTitleProps = {\n title?: string;\n className?: string;\n};\n\nconst ContentHeaderTitle = ({ title, className }: ContentHeaderTitleProps) => (\n <Typography\n variant=\"h4\"\n component=\"h2\"\n className={className}\n data-testid=\"header-title\"\n >\n {title}\n </Typography>\n);\n\ntype ContentHeaderProps = {\n title?: ContentHeaderTitleProps['title'];\n titleComponent?: ReactNode;\n description?: string;\n textAlign?: 'left' | 'right' | 'center';\n};\n\n/**\n * A header at the top inside a {@link Content}.\n *\n * @public\n *\n */\n\nexport function ContentHeader(props: PropsWithChildren<ContentHeaderProps>) {\n const {\n description,\n title,\n titleComponent: TitleComponent = undefined,\n children,\n textAlign = 'left',\n } = props;\n const classes = useStyles({ textAlign })();\n\n const renderedTitle = TitleComponent ? (\n TitleComponent\n ) : (\n <ContentHeaderTitle title={title} className={classes.title} />\n );\n\n return (\n <>\n <Helmet title={title} />\n <Box className={classes.container}>\n <Box className={classes.leftItemsBox}>\n {renderedTitle}\n {description && (\n <Typography className={classes.description} variant=\"body2\">\n {description}\n </Typography>\n )}\n </Box>\n <Box className={classes.rightItemsBox}>{children}</Box>\n </Box>\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;;AAiCA,MAAM,SAAA,GAAY,CAAC,KACjB,KAAA,UAAA;AAAA,EACE,CAAU,KAAA,MAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAO,EAAA,MAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,QAAU,EAAA,MAAA;AAAA,MACV,cAAgB,EAAA,UAAA;AAAA,MAChB,UAAY,EAAA,QAAA;AAAA,MACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC7B,WAAW,KAAM,CAAA,SAAA;AAAA,KACnB;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,IAAM,EAAA,UAAA;AAAA,MACN,QAAU,EAAA,CAAA;AAAA,MACV,QAAU,EAAA,SAAA;AAAA,KACZ;AAAA,IACA,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,UAAA;AAAA,MACN,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,QAAU,EAAA,MAAA;AAAA,MACV,UAAY,EAAA,QAAA;AAAA,MACZ,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC3B,QAAU,EAAA,CAAA;AAAA,MACV,QAAU,EAAA,SAAA;AAAA,KACZ;AAAA,IACA,aAAa,EAAC;AAAA,IACd,KAAO,EAAA;AAAA,MACL,OAAS,E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ACjD,WACH,CAEJ,CACA,kBAAAA,cAAA,CAAA,aAAA,CAAC,OAAI,SAAW,EAAA,OAAA,CAAQ,aAAgB,EAAA,EAAA,QAAS,CACnD,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -36,6 +36,7 @@ import '../../components/DismissableBanner/DismissableBanner.esm.js';
|
|
|
36
36
|
import '../../components/EmptyState/EmptyState.esm.js';
|
|
37
37
|
import '../../components/EmptyState/MissingAnnotationEmptyState.esm.js';
|
|
38
38
|
import '../../components/ErrorPanel/ErrorPanel.esm.js';
|
|
39
|
+
import '../../components/FavoriteToggle/FavoriteToggle.esm.js';
|
|
39
40
|
import '../../components/ResponseErrorPanel/ResponseErrorPanel.esm.js';
|
|
40
41
|
import '../../components/FeatureDiscovery/FeatureCalloutCircular.esm.js';
|
|
41
42
|
import '../../components/HeaderIconLinkRow/HeaderIconLinkRow.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackDetails.esm.js","sources":["../../../src/layout/ErrorPage/StackDetails.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 */\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { useState } from 'react';\nimport { Link } from '../../components/Link';\nimport { CodeSnippet } from '../../components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { coreComponentsTranslationRef } from '../../translation';\n\ninterface IStackDetailsProps {\n stack: string;\n}\n\nconst useStyles = makeStyles(\n theme => ({\n title: {\n paddingBottom: theme.spacing(5),\n [theme.breakpoints.down('xs')]: {\n paddingBottom: theme.spacing(4),\n fontSize: theme.typography.h3.fontSize,\n },\n },\n }),\n { name: 'BackstageErrorPageStackDetails' },\n);\n\n/**\n * Error page details with stack trace\n *\n * @public\n *\n */\nexport function StackDetails(props: IStackDetailsProps) {\n const { stack } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [detailsOpen, setDetailsOpen] = useState<boolean>(false);\n\n if (!detailsOpen) {\n return (\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(true)}>\n {t('errorPage.showMoreDetails')}\n </Link>\n </Typography>\n );\n }\n\n return (\n <>\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(false)}>\n {t('errorPage.showLessDetails')}\n </Link>\n </Typography>\n <CodeSnippet\n text={stack}\n language=\"text\"\n showCopyCodeButton\n showLineNumbers\n />\n </>\n );\n}\n"],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StackDetails.esm.js","sources":["../../../src/layout/ErrorPage/StackDetails.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 */\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { useState } from 'react';\nimport { Link } from '../../components/Link';\nimport { CodeSnippet } from '../../components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { coreComponentsTranslationRef } from '../../translation';\n\ninterface IStackDetailsProps {\n stack: string;\n}\n\nconst useStyles = makeStyles(\n theme => ({\n title: {\n paddingBottom: theme.spacing(5),\n [theme.breakpoints.down('xs')]: {\n paddingBottom: theme.spacing(4),\n fontSize: theme.typography.h3.fontSize,\n },\n },\n }),\n { name: 'BackstageErrorPageStackDetails' },\n);\n\n/**\n * Error page details with stack trace\n *\n * @public\n *\n */\nexport function StackDetails(props: IStackDetailsProps) {\n const { stack } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [detailsOpen, setDetailsOpen] = useState<boolean>(false);\n\n if (!detailsOpen) {\n return (\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(true)}>\n {t('errorPage.showMoreDetails')}\n </Link>\n </Typography>\n );\n }\n\n return (\n <>\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(false)}>\n {t('errorPage.showLessDetails')}\n </Link>\n </Typography>\n <CodeSnippet\n text={stack}\n language=\"text\"\n showCopyCodeButton\n showLineNumbers\n />\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC9B,CAAC,KAAM,CAAA,WAAA,CAAY,IAAK,CAAA,IAAI,CAAC,GAAG;AAAA,QAC9B,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,QAC9B,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,EAAG,CAAA,QAAA;AAAA,OAChC;AAAA,KACF;AAAA,GACF,CAAA;AAAA,EACA,EAAE,MAAM,gCAAiC,EAAA;AAC3C,CAAA,CAAA;AAQO,SAAS,aAAa,KAA2B,EAAA;AACtD,EAAM,MAAA,EAAE,OAAU,GAAA,KAAA,CAAA;AAClB,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,4BAA4B,CAAA,CAAA;AAE5D,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAE7D,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAA,oDACG,UAAW,EAAA,EAAA,OAAA,EAAQ,MAAK,SAAW,EAAA,OAAA,CAAQ,yBACzCA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAG,GAAI,EAAA,OAAA,EAAS,MAAM,cAAe,CAAA,IAAI,KAC5C,CAAE,CAAA,2BAA2B,CAChC,CACF,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAAA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,+CACG,UAAW,EAAA,EAAA,OAAA,EAAQ,MAAK,SAAW,EAAA,OAAA,CAAQ,yBACzCA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAG,GAAI,EAAA,OAAA,EAAS,MAAM,cAAe,CAAA,KAAK,KAC7C,CAAE,CAAA,2BAA2B,CAChC,CACF,CACA,kBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,KAAA;AAAA,MACN,QAAS,EAAA,MAAA;AAAA,MACT,kBAAkB,EAAA,IAAA;AAAA,MAClB,eAAe,EAAA,IAAA;AAAA,KAAA;AAAA,GAEnB,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -20,6 +20,7 @@ const MultiSignInPage = ({
|
|
|
20
20
|
onSignInSuccess,
|
|
21
21
|
providers = [],
|
|
22
22
|
title,
|
|
23
|
+
titleComponent,
|
|
23
24
|
align = "left"
|
|
24
25
|
}) => {
|
|
25
26
|
const configApi = useApi(configApiRef);
|
|
@@ -32,7 +33,14 @@ const MultiSignInPage = ({
|
|
|
32
33
|
if (loading) {
|
|
33
34
|
return /* @__PURE__ */ React__default.createElement(Progress, null);
|
|
34
35
|
}
|
|
35
|
-
return /* @__PURE__ */ React__default.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React__default.createElement(Header, { title: configApi.getString("app.title") }), /* @__PURE__ */ React__default.createElement(Content, null,
|
|
36
|
+
return /* @__PURE__ */ React__default.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React__default.createElement(Header, { title: configApi.getString("app.title") }), /* @__PURE__ */ React__default.createElement(Content, null, (title || titleComponent) && /* @__PURE__ */ React__default.createElement(
|
|
37
|
+
ContentHeader,
|
|
38
|
+
{
|
|
39
|
+
title,
|
|
40
|
+
titleComponent,
|
|
41
|
+
textAlign: align
|
|
42
|
+
}
|
|
43
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
36
44
|
Grid,
|
|
37
45
|
{
|
|
38
46
|
container: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignInPage.esm.js","sources":["../../../src/layout/SignInPage/SignInPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackstageIdentityResponse,\n configApiRef,\n SignInPageProps,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { UserIdentity } from './UserIdentity';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, { useState } from 'react';\nimport { useMountEffect } from '@react-hookz/web';\nimport { Progress } from '../../components/Progress';\nimport { Content } from '../Content/Content';\nimport { ContentHeader } from '../ContentHeader/ContentHeader';\nimport { Header } from '../Header';\nimport { InfoCard } from '../InfoCard';\nimport { Page } from '../Page';\nimport { getSignInProviders, useSignInProviders } from './providers';\nimport { GridItem, useStyles } from './styles';\nimport { IdentityProviders, SignInProviderConfig } from './types';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype MultiSignInPageProps = SignInPageProps & {\n providers: IdentityProviders;\n title?: string;\n align?: 'center' | 'left';\n};\n\ntype SingleSignInPageProps = SignInPageProps & {\n provider: SignInProviderConfig;\n auto?: boolean;\n};\n\nexport type Props = MultiSignInPageProps | SingleSignInPageProps;\n\nexport const MultiSignInPage = ({\n onSignInSuccess,\n providers = [],\n title,\n align = 'left',\n}: MultiSignInPageProps) => {\n const configApi = useApi(configApiRef);\n const classes = useStyles();\n\n const signInProviders = getSignInProviders(providers);\n const [loading, providerElements] = useSignInProviders(\n signInProviders,\n onSignInSuccess,\n );\n\n if (loading) {\n return <Progress />;\n }\n\n return (\n <Page themeId=\"home\">\n <Header title={configApi.getString('app.title')} />\n <Content>\n {title && <ContentHeader title={title} textAlign={align} />}\n <Grid\n container\n justifyContent={align === 'center' ? align : 'flex-start'}\n spacing={2}\n component=\"ul\"\n classes={classes}\n >\n {providerElements}\n </Grid>\n </Content>\n </Page>\n );\n};\n\nexport const SingleSignInPage = ({\n provider,\n auto,\n onSignInSuccess,\n}: SingleSignInPageProps) => {\n const classes = useStyles();\n const authApi = useApi(provider.apiRef);\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [error, setError] = useState<Error>();\n\n // The SignIn component takes some time to decide whether the user is logged-in or not.\n // showLoginPage is used to prevent a glitch-like experience where the sign-in page is\n // displayed for a split second when the user is already logged-in.\n const [showLoginPage, setShowLoginPage] = useState<boolean>(false);\n\n type LoginOpts = { checkExisting?: boolean; showPopup?: boolean };\n const login = async ({ checkExisting, showPopup }: LoginOpts) => {\n try {\n let identityResponse: BackstageIdentityResponse | undefined;\n if (checkExisting) {\n // Do an initial check if any logged-in session exists\n identityResponse = await authApi.getBackstageIdentity({\n optional: true,\n });\n }\n\n // If no session exists, show the sign-in page\n if (!identityResponse && (showPopup || auto)) {\n // Unless auto is set to true, this step should not happen.\n // When user intentionally clicks the Sign In button, autoShowPopup is set to true\n setShowLoginPage(true);\n identityResponse = await authApi.getBackstageIdentity({\n instantPopup: true,\n });\n if (!identityResponse) {\n throw new Error(\n `The ${provider.title} provider is not configured to support sign-in`,\n );\n }\n }\n\n if (!identityResponse) {\n setShowLoginPage(true);\n return;\n }\n\n const profile = await authApi.getProfile();\n onSignInSuccess(\n UserIdentity.create({\n identity: identityResponse.identity,\n authApi,\n profile,\n }),\n );\n } catch (err: any) {\n // User closed the sign-in modal\n setError(err);\n setShowLoginPage(true);\n }\n };\n\n useMountEffect(() => login({ checkExisting: true }));\n\n return showLoginPage ? (\n <Page themeId=\"home\">\n <Header title={configApi.getString('app.title')} />\n <Content>\n <Grid\n container\n justifyContent=\"center\"\n spacing={2}\n component=\"ul\"\n classes={classes}\n >\n <GridItem>\n <InfoCard\n variant=\"fullHeight\"\n title={provider.title}\n actions={\n <Button\n color=\"primary\"\n variant=\"outlined\"\n onClick={() => {\n login({ showPopup: true });\n }}\n >\n {t('signIn.title')}\n </Button>\n }\n >\n <Typography variant=\"body1\">{provider.message}</Typography>\n {error && error.name !== 'PopupRejectedError' && (\n <Typography variant=\"body1\" color=\"error\">\n {error.message}\n </Typography>\n )}\n </InfoCard>\n </GridItem>\n </Grid>\n </Content>\n </Page>\n ) : (\n <Progress />\n );\n};\n\nexport function SignInPage(props: Props) {\n if ('provider' in props) {\n return <SingleSignInPage {...props} />;\n }\n\n return <MultiSignInPage {...props} />;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAqDO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,eAAA;AAAA,EACA,YAAY,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OAAQ,CAAA;AAAA,MAC7C,KAAA,IAAS,KAAM,CAAA,IAAA,KAAS,oBACvB,oBAAAA,cAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,KAAA,EAAM,OAC/B,EAAA,EAAA,KAAA,CAAM,OACT,CAAA;AAAA,KAGN,CAAA;AAAA,GAEJ,CACF,CAEA,mBAAAA,cAAA,CAAA,aAAA,CAAC,QAAS,EAAA,IAAA,CAAA,CAAA;AAEd,EAAA;AAEO,SAAS,WAAW,KAAc,EAAA;AACvC,EAAA,IAAI,cAAc,KAAO,EAAA;AACvB,IAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,gBAAkB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GACtC;AAEA,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,eAAiB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACrC;;;;"}
|
|
1
|
+
{"version":3,"file":"SignInPage.esm.js","sources":["../../../src/layout/SignInPage/SignInPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackstageIdentityResponse,\n configApiRef,\n SignInPageProps,\n useApi,\n} from '@backstage/core-plugin-api';\nimport { UserIdentity } from './UserIdentity';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport React, { ReactNode, useState } from 'react';\nimport { useMountEffect } from '@react-hookz/web';\nimport { Progress } from '../../components/Progress';\nimport { Content } from '../Content/Content';\nimport { ContentHeader } from '../ContentHeader/ContentHeader';\nimport { Header } from '../Header';\nimport { InfoCard } from '../InfoCard';\nimport { Page } from '../Page';\nimport { getSignInProviders, useSignInProviders } from './providers';\nimport { GridItem, useStyles } from './styles';\nimport { IdentityProviders, SignInProviderConfig } from './types';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype MultiSignInPageProps = SignInPageProps & {\n providers: IdentityProviders;\n title?: string;\n titleComponent?: ReactNode;\n align?: 'center' | 'left';\n};\n\ntype SingleSignInPageProps = SignInPageProps & {\n provider: SignInProviderConfig;\n auto?: boolean;\n};\n\nexport type Props = MultiSignInPageProps | SingleSignInPageProps;\n\nexport const MultiSignInPage = ({\n onSignInSuccess,\n providers = [],\n title,\n titleComponent,\n align = 'left',\n}: MultiSignInPageProps) => {\n const configApi = useApi(configApiRef);\n const classes = useStyles();\n\n const signInProviders = getSignInProviders(providers);\n const [loading, providerElements] = useSignInProviders(\n signInProviders,\n onSignInSuccess,\n );\n\n if (loading) {\n return <Progress />;\n }\n\n return (\n <Page themeId=\"home\">\n <Header title={configApi.getString('app.title')} />\n <Content>\n {(title || titleComponent) && (\n <ContentHeader\n title={title}\n titleComponent={titleComponent}\n textAlign={align}\n />\n )}\n <Grid\n container\n justifyContent={align === 'center' ? align : 'flex-start'}\n spacing={2}\n component=\"ul\"\n classes={classes}\n >\n {providerElements}\n </Grid>\n </Content>\n </Page>\n );\n};\n\nexport const SingleSignInPage = ({\n provider,\n auto,\n onSignInSuccess,\n}: SingleSignInPageProps) => {\n const classes = useStyles();\n const authApi = useApi(provider.apiRef);\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [error, setError] = useState<Error>();\n\n // The SignIn component takes some time to decide whether the user is logged-in or not.\n // showLoginPage is used to prevent a glitch-like experience where the sign-in page is\n // displayed for a split second when the user is already logged-in.\n const [showLoginPage, setShowLoginPage] = useState<boolean>(false);\n\n type LoginOpts = { checkExisting?: boolean; showPopup?: boolean };\n const login = async ({ checkExisting, showPopup }: LoginOpts) => {\n try {\n let identityResponse: BackstageIdentityResponse | undefined;\n if (checkExisting) {\n // Do an initial check if any logged-in session exists\n identityResponse = await authApi.getBackstageIdentity({\n optional: true,\n });\n }\n\n // If no session exists, show the sign-in page\n if (!identityResponse && (showPopup || auto)) {\n // Unless auto is set to true, this step should not happen.\n // When user intentionally clicks the Sign In button, autoShowPopup is set to true\n setShowLoginPage(true);\n identityResponse = await authApi.getBackstageIdentity({\n instantPopup: true,\n });\n if (!identityResponse) {\n throw new Error(\n `The ${provider.title} provider is not configured to support sign-in`,\n );\n }\n }\n\n if (!identityResponse) {\n setShowLoginPage(true);\n return;\n }\n\n const profile = await authApi.getProfile();\n onSignInSuccess(\n UserIdentity.create({\n identity: identityResponse.identity,\n authApi,\n profile,\n }),\n );\n } catch (err: any) {\n // User closed the sign-in modal\n setError(err);\n setShowLoginPage(true);\n }\n };\n\n useMountEffect(() => login({ checkExisting: true }));\n\n return showLoginPage ? (\n <Page themeId=\"home\">\n <Header title={configApi.getString('app.title')} />\n <Content>\n <Grid\n container\n justifyContent=\"center\"\n spacing={2}\n component=\"ul\"\n classes={classes}\n >\n <GridItem>\n <InfoCard\n variant=\"fullHeight\"\n title={provider.title}\n actions={\n <Button\n color=\"primary\"\n variant=\"outlined\"\n onClick={() => {\n login({ showPopup: true });\n }}\n >\n {t('signIn.title')}\n </Button>\n }\n >\n <Typography variant=\"body1\">{provider.message}</Typography>\n {error && error.name !== 'PopupRejectedError' && (\n <Typography variant=\"body1\" color=\"error\">\n {error.message}\n </Typography>\n )}\n </InfoCard>\n </GridItem>\n </Grid>\n </Content>\n </Page>\n ) : (\n <Progress />\n );\n};\n\nexport function SignInPage(props: Props) {\n if ('provider' in props) {\n return <SingleSignInPage {...props} />;\n }\n\n return <MultiSignInPage {...props} />;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;AAsDO,MAA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AAM,CAAA,CAAA;AAAA,aAC3B;AAAA,WAAA;AAAA,UAEC,EAAE,cAAc,CAAA;AAAA,SACnB;AAAA,OAAA;AAAA,sBAGDA,cAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAS,SAAS,OAAQ,CAAA;AAAA,MAC7C,KAAA,IAAS,KAAM,CAAA,IAAA,KAAS,oBACvB,oBAAAA,cAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,KAAA,EAAM,OAC/B,EAAA,EAAA,KAAA,CAAM,OACT,CAAA;AAAA,KAGN,CAAA;AAAA,GAEJ,CACF,CAEA,mBAAAA,cAAA,CAAA,aAAA,CAAC,QAAS,EAAA,IAAA,CAAA,CAAA;AAEd,EAAA;AAEO,SAAS,WAAW,KAAc,EAAA;AACvC,EAAA,IAAI,cAAc,KAAO,EAAA;AACvB,IAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,gBAAkB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GACtC;AAEA,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,eAAiB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACrC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/core-components",
|
|
3
3
|
"description": "Core components used by Backstage plugins and apps",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.11-next.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@backstage/config": "^1.2.0",
|
|
59
|
-
"@backstage/core-plugin-api": "^1.9.
|
|
59
|
+
"@backstage/core-plugin-api": "^1.9.4-next.0",
|
|
60
60
|
"@backstage/errors": "^1.2.4",
|
|
61
|
-
"@backstage/theme": "^0.5.
|
|
62
|
-
"@backstage/version-bridge": "^1.0.
|
|
61
|
+
"@backstage/theme": "^0.5.7-next.0",
|
|
62
|
+
"@backstage/version-bridge": "^1.0.9-next.0",
|
|
63
63
|
"@date-io/core": "^1.3.13",
|
|
64
64
|
"@material-table/core": "^3.1.0",
|
|
65
65
|
"@material-ui/core": "^4.12.2",
|
|
@@ -94,13 +94,13 @@
|
|
|
94
94
|
"zod": "^3.22.4"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@backstage/app-defaults": "^1.5.
|
|
98
|
-
"@backstage/cli": "^0.27.
|
|
99
|
-
"@backstage/core-app-api": "^1.14.
|
|
100
|
-
"@backstage/test-utils": "^1.
|
|
97
|
+
"@backstage/app-defaults": "^1.5.11-next.1",
|
|
98
|
+
"@backstage/cli": "^0.27.1-next.2",
|
|
99
|
+
"@backstage/core-app-api": "^1.14.3-next.0",
|
|
100
|
+
"@backstage/test-utils": "^1.6.0-next.1",
|
|
101
101
|
"@testing-library/dom": "^10.0.0",
|
|
102
102
|
"@testing-library/jest-dom": "^6.0.0",
|
|
103
|
-
"@testing-library/react": "^
|
|
103
|
+
"@testing-library/react": "^16.0.0",
|
|
104
104
|
"@testing-library/user-event": "^14.0.0",
|
|
105
105
|
"@types/ansi-regex": "^5.0.0",
|
|
106
106
|
"@types/classnames": "^2.2.9",
|