@red-hat-developer-hub/backstage-plugin-dynamic-home-page 1.4.2 → 1.5.2

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/app-config.dynamic.yaml +21 -21
  3. package/dist/components/CustomizableGrid.esm.js +7 -6
  4. package/dist/components/CustomizableGrid.esm.js.map +1 -1
  5. package/dist/components/CustomizableHomePage.esm.js +12 -8
  6. package/dist/components/CustomizableHomePage.esm.js.map +1 -1
  7. package/dist/components/DynamicCustomizableHomePage.esm.js +2 -2
  8. package/dist/components/DynamicCustomizableHomePage.esm.js.map +1 -1
  9. package/dist/components/DynamicHomePage.esm.js +2 -2
  10. package/dist/components/DynamicHomePage.esm.js.map +1 -1
  11. package/dist/components/EntitySection/EntityCard.esm.js +60 -58
  12. package/dist/components/EntitySection/EntityCard.esm.js.map +1 -1
  13. package/dist/components/EntitySection/EntitySection.esm.js +152 -122
  14. package/dist/components/EntitySection/EntitySection.esm.js.map +1 -1
  15. package/dist/components/EntitySection/TagList.esm.js +45 -43
  16. package/dist/components/EntitySection/TagList.esm.js.map +1 -1
  17. package/dist/components/EntitySection/ViewMoreLink.esm.js +2 -2
  18. package/dist/components/EntitySection/ViewMoreLink.esm.js.map +1 -1
  19. package/dist/components/FeaturedDocsCard.esm.js +2 -2
  20. package/dist/components/FeaturedDocsCard.esm.js.map +1 -1
  21. package/dist/components/Header.esm.js +18 -15
  22. package/dist/components/Header.esm.js.map +1 -1
  23. package/dist/components/Headline.esm.js +2 -2
  24. package/dist/components/Headline.esm.js.map +1 -1
  25. package/dist/components/HomePage.esm.js +12 -8
  26. package/dist/components/HomePage.esm.js.map +1 -1
  27. package/dist/components/LocalClock.esm.js +9 -8
  28. package/dist/components/LocalClock.esm.js.map +1 -1
  29. package/dist/components/Markdown.esm.js +12 -9
  30. package/dist/components/Markdown.esm.js.map +1 -1
  31. package/dist/components/MarkdownCard.esm.js +2 -2
  32. package/dist/components/MarkdownCard.esm.js.map +1 -1
  33. package/dist/components/OnboardingSection/OnboardingCard.esm.js +50 -44
  34. package/dist/components/OnboardingSection/OnboardingCard.esm.js.map +1 -1
  35. package/dist/components/OnboardingSection/OnboardingSection.esm.js +69 -67
  36. package/dist/components/OnboardingSection/OnboardingSection.esm.js.map +1 -1
  37. package/dist/components/Placeholder.esm.js +2 -2
  38. package/dist/components/Placeholder.esm.js.map +1 -1
  39. package/dist/components/QuickAccessCard.esm.js +14 -14
  40. package/dist/components/QuickAccessCard.esm.js.map +1 -1
  41. package/dist/components/ReadOnlyGrid.esm.js +18 -14
  42. package/dist/components/ReadOnlyGrid.esm.js.map +1 -1
  43. package/dist/components/SearchBar.esm.js +3 -2
  44. package/dist/components/SearchBar.esm.js.map +1 -1
  45. package/dist/components/TemplateSection/TemplateCard.esm.js +66 -64
  46. package/dist/components/TemplateSection/TemplateCard.esm.js.map +1 -1
  47. package/dist/components/TemplateSection/TemplateSection.esm.js +77 -67
  48. package/dist/components/TemplateSection/TemplateSection.esm.js.map +1 -1
  49. package/dist/components/TemplateSection/ViewMoreLink.esm.js +2 -2
  50. package/dist/components/TemplateSection/ViewMoreLink.esm.js.map +1 -1
  51. package/dist/components/VisitListener.esm.js +4 -3
  52. package/dist/components/VisitListener.esm.js.map +1 -1
  53. package/dist/components/WorldClock.esm.js +3 -3
  54. package/dist/components/WorldClock.esm.js.map +1 -1
  55. package/dist/hooks/useGreeting.esm.js +3 -3
  56. package/dist/hooks/useGreeting.esm.js.map +1 -1
  57. package/dist/index.d.ts +59 -20
  58. package/dist/plugin.esm.js.map +1 -1
  59. package/package.json +24 -24
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useEffect, Fragment } from 'react';
2
3
  import { Link, WarningPanel, CodeSnippet } from '@backstage/core-components';
3
4
  import { useUserProfile } from '@backstage/plugin-user-settings';
4
5
  import Grid from '@mui/material/Grid';
@@ -11,6 +12,7 @@ import CloseIcon from '@mui/icons-material/Close';
11
12
  import CircularProgress from '@mui/material/CircularProgress';
12
13
  import CardContent from '@mui/material/CardContent';
13
14
  import { styled, useTheme } from '@mui/material/styles';
15
+ import useMediaQuery from '@mui/material/useMediaQuery';
14
16
  import EntityCard from './EntityCard.esm.js';
15
17
  import { ViewMoreLink } from './ViewMoreLink.esm.js';
16
18
  import HomePageEntityIllustration from '../../images/homepage-entities-1.svg';
@@ -28,10 +30,19 @@ const StyledLink = styled(Link)(({ theme }) => ({
28
30
  const EntitySection = () => {
29
31
  const theme = useTheme();
30
32
  const { displayName, loading: profileLoading } = useUserProfile();
31
- const [isRemoveFirstCard, setIsRemoveFirstCard] = React.useState(false);
32
- const [showDiscoveryCard, setShowDiscoveryCard] = React.useState(true);
33
- const [imgLoaded, setImgLoaded] = React.useState(false);
34
- React.useEffect(() => {
33
+ const [isRemoveFirstCard, setIsRemoveFirstCard] = useState(false);
34
+ const [showDiscoveryCard, setShowDiscoveryCard] = useState(true);
35
+ const [imgLoaded, setImgLoaded] = useState(false);
36
+ const [isMediumBreakpoint, setIsMediumBreakpoint] = useState(false);
37
+ const isMd = useMediaQuery(theme.breakpoints.only("md"));
38
+ useEffect(() => {
39
+ if (isMd) {
40
+ setIsMediumBreakpoint(true);
41
+ } else {
42
+ setIsMediumBreakpoint(false);
43
+ }
44
+ }, [isMd]);
45
+ useEffect(() => {
35
46
  const isUserDismissedEntityIllustration = hasEntityIllustrationUserDismissed(displayName);
36
47
  setIsRemoveFirstCard(isUserDismissedEntityIllustration);
37
48
  }, [displayName]);
@@ -48,7 +59,7 @@ const EntitySection = () => {
48
59
  const entities = data?.items ?? [];
49
60
  let content;
50
61
  if (isLoading) {
51
- content = /* @__PURE__ */ React.createElement(
62
+ content = /* @__PURE__ */ jsx(
52
63
  Box,
53
64
  {
54
65
  sx: {
@@ -56,145 +67,164 @@ const EntitySection = () => {
56
67
  display: "flex",
57
68
  alignItems: "center",
58
69
  justifyContent: "center"
59
- }
60
- },
61
- /* @__PURE__ */ React.createElement(CircularProgress, null)
70
+ },
71
+ children: /* @__PURE__ */ jsx(CircularProgress, {})
72
+ }
62
73
  );
63
74
  } else if (!data) {
64
- content = /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: "Could not fetch data." }, /* @__PURE__ */ React.createElement(
75
+ content = /* @__PURE__ */ jsx(WarningPanel, { severity: "error", title: "Could not fetch data.", children: /* @__PURE__ */ jsx(
65
76
  CodeSnippet,
66
77
  {
67
78
  language: "text",
68
79
  text: error?.toString() ?? "Unknown error"
69
80
  }
70
- ));
81
+ ) });
71
82
  } else {
72
- content = /* @__PURE__ */ React.createElement(Box, { sx: { padding: "8px 8px 8px 0" } }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 1, alignItems: "stretch" }, !isRemoveFirstCard && !profileLoading && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, md: 5, key: "entities illustration" }, /* @__PURE__ */ React.createElement(
73
- Card,
74
- {
75
- elevation: 0,
76
- sx: {
77
- border: `1px solid ${theme.palette.grey[400]}`,
78
- display: "flex",
79
- flexDirection: "row",
80
- alignItems: "center",
81
- position: "relative",
82
- transition: "opacity 0.5s ease-out, transform 0.5s ease-in-out",
83
- opacity: showDiscoveryCard ? 1 : 0,
84
- transform: showDiscoveryCard ? "translateX(0)" : "translateX(-50px)"
85
- }
86
- },
87
- !imgLoaded && /* @__PURE__ */ React.createElement(
88
- Skeleton,
83
+ let entityCardCount = 2;
84
+ if (isMediumBreakpoint) entityCardCount = 3;
85
+ content = /* @__PURE__ */ jsx(Box, { sx: { padding: "8px 8px 8px 0" }, children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, alignItems: "stretch", children: [
86
+ !isRemoveFirstCard && !profileLoading && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, lg: 5, children: /* @__PURE__ */ jsxs(
87
+ Card,
89
88
  {
90
- variant: "rectangular",
91
- height: 300,
89
+ elevation: 0,
92
90
  sx: {
93
- borderRadius: 3,
94
- width: "clamp(140px, 14vw, 266px)"
95
- }
96
- }
97
- ),
98
- /* @__PURE__ */ React.createElement(
99
- Box,
100
- {
101
- component: "img",
102
- src: HomePageEntityIllustration,
103
- onLoad: () => setImgLoaded(true),
104
- alt: "",
105
- height: 300,
106
- sx: {
107
- width: "clamp(140px, 14vw, 266px)"
108
- }
91
+ border: `1px solid ${theme.palette.grey[400]}`,
92
+ display: "flex",
93
+ flexDirection: "row",
94
+ alignItems: "center",
95
+ position: "relative",
96
+ transition: "opacity 0.5s ease-out, transform 0.5s ease-in-out",
97
+ opacity: showDiscoveryCard ? 1 : 0,
98
+ transform: showDiscoveryCard ? "translateX(0)" : "translateX(-50px)"
99
+ },
100
+ children: [
101
+ !imgLoaded && /* @__PURE__ */ jsx(
102
+ Skeleton,
103
+ {
104
+ variant: "rectangular",
105
+ height: 300,
106
+ sx: {
107
+ borderRadius: 3,
108
+ width: "clamp(140px, 14vw, 266px)"
109
+ }
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ Box,
114
+ {
115
+ component: "img",
116
+ src: HomePageEntityIllustration,
117
+ onLoad: () => setImgLoaded(true),
118
+ alt: "",
119
+ height: 300,
120
+ sx: {
121
+ width: "clamp(140px, 14vw, 266px)"
122
+ }
123
+ }
124
+ ),
125
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
126
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: "Browse the Systems, Components, Resources, and APIs that are available in your organization." }) }),
127
+ entities?.length > 0 && /* @__PURE__ */ jsx(
128
+ IconButton,
129
+ {
130
+ onClick: handleClose,
131
+ "aria-label": "close",
132
+ style: {
133
+ position: "absolute",
134
+ top: "8px",
135
+ right: "8px"
136
+ },
137
+ children: /* @__PURE__ */ jsx(CloseIcon, { style: { width: "16px", height: "16px" } })
138
+ }
139
+ )
140
+ ] })
141
+ ]
109
142
  }
110
- ),
111
- /* @__PURE__ */ React.createElement(Box, { sx: { p: 2 } }, /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", paragraph: true }, "Browse the Systems, Components, Resources, and APIs that are available in your organization.")), entities?.length > 0 && /* @__PURE__ */ React.createElement(
112
- IconButton,
143
+ ) }, "entities illustration"),
144
+ entities?.slice(0, isRemoveFirstCard ? 4 : entityCardCount).map((item) => /* @__PURE__ */ jsx(
145
+ Grid,
113
146
  {
114
- onClick: handleClose,
115
- "aria-label": "close",
116
- style: {
117
- position: "absolute",
118
- top: "8px",
119
- right: "8px"
120
- }
147
+ item: true,
148
+ xs: 12,
149
+ md: 6,
150
+ lg: isRemoveFirstCard ? 3 : 3.5,
151
+ children: /* @__PURE__ */ jsx(
152
+ EntityCard,
153
+ {
154
+ entity: item,
155
+ title: item.spec?.profile?.displayName ?? item.metadata.name,
156
+ version: "latest",
157
+ description: item.metadata.description ?? "",
158
+ tags: item.metadata?.tags ?? [],
159
+ kind: item.kind
160
+ }
161
+ )
121
162
  },
122
- /* @__PURE__ */ React.createElement(CloseIcon, { style: { width: "16px", height: "16px" } })
123
- ))
124
- )), entities?.slice(0, isRemoveFirstCard ? 4 : 2).map((item) => /* @__PURE__ */ React.createElement(
125
- Grid,
126
- {
127
- item: true,
128
- xs: 12,
129
- md: isRemoveFirstCard ? 3 : 3.5,
130
- key: item.metadata.name
131
- },
132
- /* @__PURE__ */ React.createElement(
133
- EntityCard,
134
- {
135
- entity: item,
136
- title: item.spec?.profile?.displayName ?? item.metadata.name,
137
- version: "latest",
138
- description: item.metadata.description ?? "",
139
- tags: item.metadata?.tags ?? [],
140
- kind: item.kind
141
- }
142
- )
143
- )), entities?.length === 0 && /* @__PURE__ */ React.createElement(Grid, { item: true, md: isRemoveFirstCard ? 12 : 7 }, /* @__PURE__ */ React.createElement(
144
- Box,
145
- {
146
- sx: {
147
- display: "flex",
148
- alignItems: "center",
149
- justifyContent: "center",
150
- minHeight: 300,
151
- border: (muiTheme) => `1px solid ${muiTheme.palette.grey[400]}`,
152
- borderRadius: 3,
153
- overflow: "hidden"
154
- }
155
- },
156
- /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Typography, { sx: { fontSize: "1.125rem", fontWeight: 500 } }, "No software catalog added yet"), /* @__PURE__ */ React.createElement(
157
- Typography,
163
+ item.metadata.name
164
+ )),
165
+ entities?.length === 0 && /* @__PURE__ */ jsx(Grid, { item: true, md: isRemoveFirstCard ? 12 : 7, children: /* @__PURE__ */ jsx(
166
+ Box,
158
167
  {
159
168
  sx: {
160
- fontSize: "0.875rem",
161
- fontWeight: 400,
162
- mt: "20px",
163
- mb: "16px"
164
- }
165
- },
166
- "Once software catalogs are added, this space will showcase relevant content tailored to your experience."
167
- ), /* @__PURE__ */ React.createElement(StyledLink, { to: "/catalog-import", underline: "none" }, "Register a component"))
168
- ))), /* @__PURE__ */ React.createElement(Box, { sx: { pt: 2 } }, entities?.length > 0 && /* @__PURE__ */ React.createElement(ViewMoreLink, { to: "/catalog" }, "View all ", data?.totalItems ? data?.totalItems : "", " catalog entities"))));
169
+ display: "flex",
170
+ alignItems: "center",
171
+ justifyContent: "center",
172
+ minHeight: 300,
173
+ border: (muiTheme) => `1px solid ${muiTheme.palette.grey[400]}`,
174
+ borderRadius: 3,
175
+ overflow: "hidden"
176
+ },
177
+ children: /* @__PURE__ */ jsxs(CardContent, { children: [
178
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "1.125rem", fontWeight: 500 }, children: "No software catalog added yet" }),
179
+ /* @__PURE__ */ jsx(
180
+ Typography,
181
+ {
182
+ sx: {
183
+ fontSize: "0.875rem",
184
+ fontWeight: 400,
185
+ mt: "20px",
186
+ mb: "16px"
187
+ },
188
+ children: "Once software catalogs are added, this space will showcase relevant content tailored to your experience."
189
+ }
190
+ ),
191
+ /* @__PURE__ */ jsx(StyledLink, { to: "/catalog-import", underline: "none", children: "Register a component" })
192
+ ] })
193
+ }
194
+ ) })
195
+ ] }) }) });
169
196
  }
170
- return /* @__PURE__ */ React.createElement(
197
+ return /* @__PURE__ */ jsxs(
171
198
  Card,
172
199
  {
173
200
  elevation: 0,
174
201
  sx: {
175
202
  padding: "24px",
176
203
  border: (muitheme) => `1px solid ${muitheme.palette.grey[300]}`,
177
- overflow: "auto",
178
- "$::-webkit-scrollbar": {
179
- display: "none"
180
- },
181
- scrollbarWidth: "none"
182
- }
183
- },
184
- /* @__PURE__ */ React.createElement(
185
- Typography,
186
- {
187
- variant: "h3",
188
- sx: {
189
- display: "flex",
190
- alignItems: "center",
191
- fontWeight: "500",
192
- fontSize: "1.5rem"
193
- }
204
+ overflow: "auto"
194
205
  },
195
- "Explore Your Software Catalog"
196
- ),
197
- content
206
+ children: [
207
+ /* @__PURE__ */ jsx(
208
+ Typography,
209
+ {
210
+ variant: "h3",
211
+ sx: {
212
+ display: "flex",
213
+ alignItems: "center",
214
+ fontWeight: "500",
215
+ fontSize: "1.5rem"
216
+ },
217
+ children: "Explore Your Software Catalog"
218
+ }
219
+ ),
220
+ content,
221
+ entities?.length > 0 && /* @__PURE__ */ jsx(Box, { sx: { pt: 2 }, children: /* @__PURE__ */ jsxs(ViewMoreLink, { to: "/catalog", children: [
222
+ "View all ",
223
+ data?.totalItems ? data?.totalItems : "",
224
+ " catalog entities"
225
+ ] }) })
226
+ ]
227
+ }
198
228
  );
199
229
  };
200
230
 
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySection.esm.js","sources":["../../../src/components/EntitySection/EntitySection.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 from 'react';\n\nimport {\n CodeSnippet,\n WarningPanel,\n Link as BackstageLink,\n} from '@backstage/core-components';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\n\nimport Grid from '@mui/material/Grid';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport IconButton from '@mui/material/IconButton';\nimport Skeleton from '@mui/material/Skeleton';\nimport Typography from '@mui/material/Typography';\nimport CloseIcon from '@mui/icons-material/Close';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport CardContent from '@mui/material/CardContent';\nimport { useTheme, styled } from '@mui/material/styles';\n\nimport EntityCard from './EntityCard';\nimport { ViewMoreLink } from './ViewMoreLink';\nimport HomePageEntityIllustration from '../../images/homepage-entities-1.svg';\nimport { useEntities } from '../../hooks/useEntities';\nimport {\n addDismissedEntityIllustrationUsers,\n hasEntityIllustrationUserDismissed,\n} from '../../utils/utils';\n\nconst StyledLink = styled(BackstageLink)(({ theme }) => ({\n textDecoration: 'none',\n padding: theme.spacing(1, 1.5),\n fontSize: '16px',\n display: 'inline-flex',\n border: `1px solid ${theme.palette.primary.main}`,\n borderRadius: 4,\n}));\n\nexport const EntitySection = () => {\n const theme = useTheme();\n const { displayName, loading: profileLoading } = useUserProfile();\n const [isRemoveFirstCard, setIsRemoveFirstCard] = React.useState(false);\n const [showDiscoveryCard, setShowDiscoveryCard] = React.useState(true);\n const [imgLoaded, setImgLoaded] = React.useState(false);\n\n React.useEffect(() => {\n const isUserDismissedEntityIllustration =\n hasEntityIllustrationUserDismissed(displayName);\n setIsRemoveFirstCard(isUserDismissedEntityIllustration);\n }, [displayName]);\n\n const handleClose = () => {\n setShowDiscoveryCard(false);\n setTimeout(() => {\n addDismissedEntityIllustrationUsers(displayName);\n setIsRemoveFirstCard(true);\n }, 500);\n };\n\n const { data, error, isLoading } = useEntities({\n kind: ['Component', 'API', 'Resource', 'System'],\n });\n\n const entities = data?.items ?? [];\n\n let content: React.ReactNode;\n\n if (isLoading) {\n content = (\n <Box\n sx={{\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress />\n </Box>\n );\n } else if (!data) {\n content = (\n <WarningPanel severity=\"error\" title=\"Could not fetch data.\">\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? 'Unknown error'}\n />\n </WarningPanel>\n );\n } else {\n content = (\n <Box sx={{ padding: '8px 8px 8px 0' }}>\n <React.Fragment>\n <Grid container spacing={1} alignItems=\"stretch\">\n {!isRemoveFirstCard && !profileLoading && (\n <Grid item xs={12} md={5} key=\"entities illustration\">\n <Card\n elevation={0}\n sx={{\n border: `1px solid ${theme.palette.grey[400]}`,\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n position: 'relative',\n transition:\n 'opacity 0.5s ease-out, transform 0.5s ease-in-out',\n opacity: showDiscoveryCard ? 1 : 0,\n transform: showDiscoveryCard\n ? 'translateX(0)'\n : 'translateX(-50px)',\n }}\n >\n {!imgLoaded && (\n <Skeleton\n variant=\"rectangular\"\n height={300}\n sx={{\n borderRadius: 3,\n width: 'clamp(140px, 14vw, 266px)',\n }}\n />\n )}\n <Box\n component=\"img\"\n src={HomePageEntityIllustration}\n onLoad={() => setImgLoaded(true)}\n alt=\"\"\n height={300}\n sx={{\n width: 'clamp(140px, 14vw, 266px)',\n }}\n />\n <Box sx={{ p: 2 }}>\n <Box>\n <Typography variant=\"body2\" paragraph>\n Browse the Systems, Components, Resources, and APIs that\n are available in your organization.\n </Typography>\n </Box>\n {entities?.length > 0 && (\n <IconButton\n onClick={handleClose}\n aria-label=\"close\"\n style={{\n position: 'absolute',\n top: '8px',\n right: '8px',\n }}\n >\n <CloseIcon style={{ width: '16px', height: '16px' }} />\n </IconButton>\n )}\n </Box>\n </Card>\n </Grid>\n )}\n {entities?.slice(0, isRemoveFirstCard ? 4 : 2).map((item: any) => (\n <Grid\n item\n xs={12}\n md={isRemoveFirstCard ? 3 : 3.5}\n key={item.metadata.name}\n >\n <EntityCard\n entity={item}\n title={item.spec?.profile?.displayName ?? item.metadata.name}\n version=\"latest\"\n description={item.metadata.description ?? ''}\n tags={item.metadata?.tags ?? []}\n kind={item.kind}\n />\n </Grid>\n ))}\n {entities?.length === 0 && (\n <Grid item md={isRemoveFirstCard ? 12 : 7}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: 300,\n border: muiTheme =>\n `1px solid ${muiTheme.palette.grey[400]}`,\n borderRadius: 3,\n overflow: 'hidden',\n }}\n >\n <CardContent>\n <Typography sx={{ fontSize: '1.125rem', fontWeight: 500 }}>\n No software catalog added yet\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n Once software catalogs are added, this space will showcase\n relevant content tailored to your experience.\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n Register a component\n </StyledLink>\n </CardContent>\n </Box>\n </Grid>\n )}\n </Grid>\n <Box sx={{ pt: 2 }}>\n {entities?.length > 0 && (\n <ViewMoreLink to=\"/catalog\">\n View all {data?.totalItems ? data?.totalItems : ''} catalog\n entities\n </ViewMoreLink>\n )}\n </Box>\n </React.Fragment>\n </Box>\n );\n }\n\n return (\n <Card\n elevation={0}\n sx={{\n padding: '24px',\n border: muitheme => `1px solid ${muitheme.palette.grey[300]}`,\n overflow: 'auto',\n '$::-webkit-scrollbar': {\n display: 'none',\n },\n scrollbarWidth: 'none',\n }}\n >\n <Typography\n variant=\"h3\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n fontWeight: '500',\n fontSize: '1.5rem',\n }}\n >\n Explore Your Software Catalog\n </Typography>\n {content}\n </Card>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CA,MAAM,aAAa,MAAO,CAAAA,IAAa,EAAE,CAAC,EAAE,OAAa,MAAA;A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BAAA,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,CAAA;AAAA,MACX,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,QAAQ,CAAY,QAAA,KAAA,CAAA,UAAA,EAAa,SAAS,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAAA,QAC3D,QAAU,EAAA,MAAA;AAAA,QACV,sBAAwB,EAAA;AAAA,UACtB,OAAS,EAAA;AAAA,SACX;AAAA,QACA,cAAgB,EAAA;AAAA;AAClB,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,IAAA;AAAA,QACR,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA,QAAA;AAAA,UACZ,UAAY,EAAA,KAAA;AAAA,UACZ,QAAU,EAAA;AAAA;AACZ,OAAA;AAAA,MACD;AAAA,KAED;AAAA,IACC;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"EntitySection.esm.js","sources":["../../../src/components/EntitySection/EntitySection.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type { ReactNode } from 'react';\n\nimport { useState, useEffect, Fragment } from 'react';\n\nimport {\n CodeSnippet,\n WarningPanel,\n Link as BackstageLink,\n} from '@backstage/core-components';\nimport { useUserProfile } from '@backstage/plugin-user-settings';\n\nimport Grid from '@mui/material/Grid';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport IconButton from '@mui/material/IconButton';\nimport Skeleton from '@mui/material/Skeleton';\nimport Typography from '@mui/material/Typography';\nimport CloseIcon from '@mui/icons-material/Close';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport CardContent from '@mui/material/CardContent';\nimport { useTheme, styled } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport EntityCard from './EntityCard';\nimport { ViewMoreLink } from './ViewMoreLink';\nimport HomePageEntityIllustration from '../../images/homepage-entities-1.svg';\nimport { useEntities } from '../../hooks/useEntities';\nimport {\n addDismissedEntityIllustrationUsers,\n hasEntityIllustrationUserDismissed,\n} from '../../utils/utils';\n\nconst StyledLink = styled(BackstageLink)(({ theme }) => ({\n textDecoration: 'none',\n padding: theme.spacing(1, 1.5),\n fontSize: '16px',\n display: 'inline-flex',\n border: `1px solid ${theme.palette.primary.main}`,\n borderRadius: 4,\n}));\n\nexport const EntitySection = () => {\n const theme = useTheme();\n const { displayName, loading: profileLoading } = useUserProfile();\n const [isRemoveFirstCard, setIsRemoveFirstCard] = useState(false);\n const [showDiscoveryCard, setShowDiscoveryCard] = useState(true);\n const [imgLoaded, setImgLoaded] = useState(false);\n const [isMediumBreakpoint, setIsMediumBreakpoint] = useState(false);\n\n const isMd = useMediaQuery(theme.breakpoints.only('md'));\n\n useEffect(() => {\n if (isMd) {\n setIsMediumBreakpoint(true);\n } else {\n setIsMediumBreakpoint(false);\n }\n }, [isMd]);\n\n useEffect(() => {\n const isUserDismissedEntityIllustration =\n hasEntityIllustrationUserDismissed(displayName);\n setIsRemoveFirstCard(isUserDismissedEntityIllustration);\n }, [displayName]);\n\n const handleClose = () => {\n setShowDiscoveryCard(false);\n setTimeout(() => {\n addDismissedEntityIllustrationUsers(displayName);\n setIsRemoveFirstCard(true);\n }, 500);\n };\n\n const { data, error, isLoading } = useEntities({\n kind: ['Component', 'API', 'Resource', 'System'],\n });\n\n const entities = data?.items ?? [];\n\n let content: ReactNode;\n\n if (isLoading) {\n content = (\n <Box\n sx={{\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress />\n </Box>\n );\n } else if (!data) {\n content = (\n <WarningPanel severity=\"error\" title=\"Could not fetch data.\">\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? 'Unknown error'}\n />\n </WarningPanel>\n );\n } else {\n let entityCardCount = 2;\n if (isMediumBreakpoint) entityCardCount = 3;\n\n content = (\n <Box sx={{ padding: '8px 8px 8px 0' }}>\n <Fragment>\n <Grid container spacing={1} alignItems=\"stretch\">\n {!isRemoveFirstCard && !profileLoading && (\n <Grid item xs={12} md={6} lg={5} key=\"entities illustration\">\n <Card\n elevation={0}\n sx={{\n border: `1px solid ${theme.palette.grey[400]}`,\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n position: 'relative',\n transition:\n 'opacity 0.5s ease-out, transform 0.5s ease-in-out',\n opacity: showDiscoveryCard ? 1 : 0,\n transform: showDiscoveryCard\n ? 'translateX(0)'\n : 'translateX(-50px)',\n }}\n >\n {!imgLoaded && (\n <Skeleton\n variant=\"rectangular\"\n height={300}\n sx={{\n borderRadius: 3,\n width: 'clamp(140px, 14vw, 266px)',\n }}\n />\n )}\n <Box\n component=\"img\"\n src={HomePageEntityIllustration}\n onLoad={() => setImgLoaded(true)}\n alt=\"\"\n height={300}\n sx={{\n width: 'clamp(140px, 14vw, 266px)',\n }}\n />\n <Box sx={{ p: 2 }}>\n <Box>\n <Typography variant=\"body2\" paragraph>\n Browse the Systems, Components, Resources, and APIs that\n are available in your organization.\n </Typography>\n </Box>\n {entities?.length > 0 && (\n <IconButton\n onClick={handleClose}\n aria-label=\"close\"\n style={{\n position: 'absolute',\n top: '8px',\n right: '8px',\n }}\n >\n <CloseIcon style={{ width: '16px', height: '16px' }} />\n </IconButton>\n )}\n </Box>\n </Card>\n </Grid>\n )}\n {entities\n ?.slice(0, isRemoveFirstCard ? 4 : entityCardCount)\n .map((item: any) => (\n <Grid\n item\n xs={12}\n md={6}\n lg={isRemoveFirstCard ? 3 : 3.5}\n key={item.metadata.name}\n >\n <EntityCard\n entity={item}\n title={\n item.spec?.profile?.displayName ?? item.metadata.name\n }\n version=\"latest\"\n description={item.metadata.description ?? ''}\n tags={item.metadata?.tags ?? []}\n kind={item.kind}\n />\n </Grid>\n ))}\n {entities?.length === 0 && (\n <Grid item md={isRemoveFirstCard ? 12 : 7}>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: 300,\n border: muiTheme =>\n `1px solid ${muiTheme.palette.grey[400]}`,\n borderRadius: 3,\n overflow: 'hidden',\n }}\n >\n <CardContent>\n <Typography sx={{ fontSize: '1.125rem', fontWeight: 500 }}>\n No software catalog added yet\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n Once software catalogs are added, this space will showcase\n relevant content tailored to your experience.\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n Register a component\n </StyledLink>\n </CardContent>\n </Box>\n </Grid>\n )}\n </Grid>\n </Fragment>\n </Box>\n );\n }\n\n return (\n <Card\n elevation={0}\n sx={{\n padding: '24px',\n border: muitheme => `1px solid ${muitheme.palette.grey[300]}`,\n overflow: 'auto',\n }}\n >\n <Typography\n variant=\"h3\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n fontWeight: '500',\n fontSize: '1.5rem',\n }}\n >\n Explore Your Software Catalog\n </Typography>\n {content}\n {entities?.length > 0 && (\n <Box sx={{ pt: 2 }}>\n <ViewMoreLink to=\"/catalog\">\n View all {data?.totalItems ? data?.totalItems : ''} catalog entities\n </ViewMoreLink>\n </Box>\n )}\n </Card>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,aAAa,MAAO,CAAAA,IAAa,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EACvD,cAAgB,EAAA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,EAAA,sBAAA,EAAA;AAAA,WACF,EAAA;AAAA;AAAA,OAEJ,EAAA;AAAA,KAAA,EAEJ,GACF,CACF,EAAA,CAAA;AAAA;AAIJ,EACE,uBAAA,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,CAAA;AAAA,MACX,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,QAAQ,CAAY,QAAA,KAAA,CAAA,UAAA,EAAa,SAAS,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAAA,QAC3D,QAAU,EAAA;AAAA,OACZ;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,IAAA;AAAA,YACR,EAAI,EAAA;AAAA,cACF,OAAS,EAAA,MAAA;AAAA,cACT,UAAY,EAAA,QAAA;AAAA,cACZ,UAAY,EAAA,KAAA;AAAA,cACZ,QAAU,EAAA;AAAA,aACZ;AAAA,YACD,QAAA,EAAA;AAAA;AAAA,SAED;AAAA,QACC,OAAA;AAAA,QACA,QAAU,EAAA,MAAA,GAAS,CAClB,oBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,CAAE,EAAA,EACf,QAAC,kBAAA,IAAA,CAAA,YAAA,EAAA,EAAa,IAAG,UAAW,EAAA,QAAA,EAAA;AAAA,UAAA,WAAA;AAAA,UAChB,IAAA,EAAM,UAAa,GAAA,IAAA,EAAM,UAAa,GAAA,EAAA;AAAA,UAAG;AAAA,SAAA,EACrD,CACF,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import Box from '@mui/material/Box';
3
3
  import Chip from '@mui/material/Chip';
4
4
  import Typography from '@mui/material/Typography';
@@ -6,7 +6,7 @@ import { KINDS } from '../../utils/constants.esm.js';
6
6
 
7
7
  const TagList = ({ tags, kind }) => {
8
8
  const hiddenCount = tags.length - 3;
9
- return /* @__PURE__ */ React.createElement(
9
+ return /* @__PURE__ */ jsxs(
10
10
  Box,
11
11
  {
12
12
  sx: {
@@ -16,51 +16,53 @@ const TagList = ({ tags, kind }) => {
16
16
  flexWrap: "wrap",
17
17
  alignItems: "flex-end",
18
18
  gap: 0.5
19
- }
20
- },
21
- /* @__PURE__ */ React.createElement(
22
- Chip,
23
- {
24
- key: kind,
25
- label: /* @__PURE__ */ React.createElement(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 } }, kind),
26
- sx: {
27
- backgroundColor: KINDS[kind.toLocaleUpperCase()]?.fill,
28
- color: "black"
29
- },
30
- variant: "filled",
31
- size: "small"
32
- }
33
- ),
34
- tags.slice(0, 2).map((tag) => /* @__PURE__ */ React.createElement(
35
- Chip,
36
- {
37
- key: tag,
38
- label: /* @__PURE__ */ React.createElement(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 } }, tag),
39
- variant: "outlined",
40
- size: "small"
41
- }
42
- )),
43
- hiddenCount > 0 && /* @__PURE__ */ React.createElement(
44
- Chip,
45
- {
46
- label: /* @__PURE__ */ React.createElement(
47
- Typography,
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ jsx(
22
+ Chip,
48
23
  {
24
+ label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: kind }),
49
25
  sx: {
50
- fontSize: "0.8rem",
51
- fontWeight: 400,
52
- color: (theme) => `${theme.palette.mode === "light" ? "#0066CC" : "#1FA7F8"}`
53
- }
26
+ backgroundColor: KINDS[kind.toLocaleUpperCase()]?.fill,
27
+ color: "black"
28
+ },
29
+ variant: "filled",
30
+ size: "small"
54
31
  },
55
- `${hiddenCount} more`
32
+ kind
56
33
  ),
57
- variant: "outlined",
58
- size: "small",
59
- sx: {
60
- border: "none"
61
- }
62
- }
63
- )
34
+ tags.slice(0, 2).map((tag) => /* @__PURE__ */ jsx(
35
+ Chip,
36
+ {
37
+ label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: tag }),
38
+ variant: "outlined",
39
+ size: "small"
40
+ },
41
+ tag
42
+ )),
43
+ hiddenCount > 0 && /* @__PURE__ */ jsx(
44
+ Chip,
45
+ {
46
+ label: /* @__PURE__ */ jsx(
47
+ Typography,
48
+ {
49
+ sx: {
50
+ fontSize: "0.8rem",
51
+ fontWeight: 400,
52
+ color: (theme) => `${theme.palette.mode === "light" ? "#0066CC" : "#1FA7F8"}`
53
+ },
54
+ children: `${hiddenCount} more`
55
+ }
56
+ ),
57
+ variant: "outlined",
58
+ size: "small",
59
+ sx: {
60
+ border: "none"
61
+ }
62
+ }
63
+ )
64
+ ]
65
+ }
64
66
  );
65
67
  };
66
68
 
@@ -1 +1 @@
1
- {"version":3,"file":"TagList.esm.js","sources":["../../../src/components/EntitySection/TagList.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 from 'react';\n\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport { KINDS } from '../../utils/constants';\n\ntype KindKeys = keyof typeof KINDS;\n\ninterface TagListProps {\n tags: string[];\n kind: string;\n}\n\nconst TagList: React.FC<TagListProps> = ({ tags, kind }) => {\n const hiddenCount = tags.length - 3;\n return (\n <Box\n sx={{\n height: '72px',\n overflow: 'hidden',\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n gap: 0.5,\n }}\n >\n <Chip\n key={kind}\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {kind}\n </Typography>\n }\n sx={{\n backgroundColor: KINDS[kind.toLocaleUpperCase() as KindKeys]?.fill,\n color: 'black',\n }}\n variant=\"filled\"\n size=\"small\"\n />\n {tags.slice(0, 2).map(tag => (\n <Chip\n key={tag}\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {tag}\n </Typography>\n }\n variant=\"outlined\"\n size=\"small\"\n />\n ))}\n\n {hiddenCount > 0 && (\n <Chip\n label={\n <Typography\n sx={{\n fontSize: '0.8rem',\n fontWeight: 400,\n color: theme =>\n `${theme.palette.mode === 'light' ? '#0066CC' : '#1FA7F8'}`,\n }}\n >\n {`${hiddenCount} more`}\n </Typography>\n }\n variant=\"outlined\"\n size=\"small\"\n sx={{\n border: 'none',\n }}\n />\n )}\n </Box>\n );\n};\n\nexport default TagList;\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,OAAkC,GAAA,CAAC,EAAE,IAAA,EAAM,MAAW,KAAA;AAC1D,EAAM,MAAA,WAAA,GAAc,KAAK,MAAS,GAAA,CAAA;AAClC,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,MAAQ,EAAA,MAAA;AAAA,QACR,QAAU,EAAA,QAAA;AAAA,QACV,OAAS,EAAA,MAAA;AAAA,QACT,QAAU,EAAA,MAAA;AAAA,QACV,UAAY,EAAA,UAAA;AAAA,QACZ,GAAK,EAAA;AAAA;AACP,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,GAAK,EAAA,IAAA;AAAA,QACL,KAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,EAAI,EAAA,EAAE,UAAU,QAAU,EAAA,UAAA,EAAY,GAAI,EAAA,EAAA,EACnD,IACH,C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Red Hat, Inc.\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 type { FC } from 'react';\n\nimport Box from '@mui/material/Box';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport { KINDS } from '../../utils/constants';\n\ntype KindKeys = keyof typeof KINDS;\n\ninterface TagListProps {\n tags: string[];\n kind: string;\n}\n\nconst TagList: FC<TagListProps> = ({ tags, kind }) => {\n const hiddenCount = tags.length - 3;\n return (\n <Box\n sx={{\n height: '72px',\n overflow: 'hidden',\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n gap: 0.5,\n }}\n >\n <Chip\n key={kind}\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {kind}\n </Typography>\n }\n sx={{\n backgroundColor: KINDS[kind.toLocaleUpperCase() as KindKeys]?.fill,\n color: 'black',\n }}\n variant=\"filled\"\n size=\"small\"\n />\n {tags.slice(0, 2).map(tag => (\n <Chip\n key={tag}\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {tag}\n </Typography>\n }\n variant=\"outlined\"\n size=\"small\"\n />\n ))}\n\n {hiddenCount > 0 && (\n <Chip\n label={\n <Typography\n sx={{\n fontSize: '0.8rem',\n fontWeight: 400,\n color: theme =>\n `${theme.palette.mode === 'light' ? '#0066CC' : '#1FA7F8'}`,\n }}\n >\n {`${hiddenCount} more`}\n </Typography>\n }\n variant=\"outlined\"\n size=\"small\"\n sx={{\n border: 'none',\n }}\n />\n )}\n </Box>\n );\n};\n\nexport default TagList;\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,OAA4B,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AAA;AAAA,YACC,KACE,kBAAA,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,EAAI,EAAA;AAAA,kBACF,QAAU,EAAA,QAAA;AAAA,kBACV,UAAY,EAAA,GAAA;AAAA,kBACZ,KAAA,EAAO,WACL,CAAG,EAAA,KAAA,CAAM,QAAQ,IAAS,KAAA,OAAA,GAAU,YAAY,SAAS,CAAA;AAAA,iBAC7D;AAAA,gBAEC,aAAG,WAAW,CAAA,KAAA;AAAA;AAAA,aACjB;AAAA,YAEF,OAAQ,EAAA,UAAA;AAAA,YACR,IAAK,EAAA,OAAA;AAAA,YACL,EAAI,EAAA;AAAA,cACF,MAAQ,EAAA;AAAA;AACV;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { Link } from '@backstage/core-components';
3
3
  import Typography from '@mui/material/Typography';
4
4
 
5
5
  const ViewMoreLink = ({ to, children }) => {
6
- return /* @__PURE__ */ React.createElement(Link, { to, underline: "always", style: { textUnderlineOffset: "4px" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", sx: { fontWeight: 500 } }, children));
6
+ return /* @__PURE__ */ jsx(Link, { to, underline: "always", style: { textUnderlineOffset: "4px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontWeight: 500 }, children }) });
7
7
  };
8
8
 
9
9
  export { ViewMoreLink };
@@ -1 +1 @@
1
- {"version":3,"file":"ViewMoreLink.esm.js","sources":["../../../src/components/EntitySection/ViewMoreLink.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 from 'react';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport Typography from '@mui/material/Typography';\n\ninterface ViewMoreLinkProps extends LinkProps {\n to: string;\n children: string | React.ReactNode;\n}\n\nexport const ViewMoreLink: React.FC<ViewMoreLinkProps> = ({ to, children }) => {\n return (\n <Link to={to} underline=\"always\" style={{ textUnderlineOffset: '4px' }}>\n <Typography variant=\"body2\" sx={{ fontWeight: 500 }}>\n {children}\n </Typography>\n </Link>\n );\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,YAA4C,GAAA,CAAC,EAAE,EAAA,EAAI,UAAe,KAAA;AAC7E,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAQ,EAAA,SAAA,EAAU,UAAS,KAAO,EAAA,EAAE,qBAAqB,KAAM,EAAA,EAAA,sCAClE,UAAW,EAAA,EAAA,OAAA,EAAQ,SAAQ,EAAI,EAAA,EAAE,YAAY,GAAI,EAAA,EAAA,EAC/C,QACH,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ViewMoreLink.esm.js","sources":["../../../src/components/EntitySection/ViewMoreLink.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type { ReactNode, FC } from 'react';\nimport { Link, LinkProps } from '@backstage/core-components';\nimport Typography from '@mui/material/Typography';\n\ninterface ViewMoreLinkProps extends LinkProps {\n to: string;\n children: string | ReactNode;\n}\n\nexport const ViewMoreLink: FC<ViewMoreLinkProps> = ({ to, children }) => {\n return (\n <Link to={to} underline=\"always\" style={{ textUnderlineOffset: '4px' }}>\n <Typography variant=\"body2\" sx={{ fontWeight: 500 }}>\n {children}\n </Typography>\n </Link>\n );\n};\n"],"names":[],"mappings":";;;;AAwBO,MAAM,YAAsC,GAAA,CAAC,EAAE,EAAA,EAAI,UAAe,KAAA;AACvE,EACE,uBAAA,GAAA,CAAC,QAAK,EAAQ,EAAA,SAAA,EAAU,UAAS,KAAO,EAAA,EAAE,qBAAqB,KAAM,EAAA,EACnE,8BAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,SAAQ,EAAI,EAAA,EAAE,YAAY,GAAI,EAAA,EAC/C,UACH,CACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { FeaturedDocsCard as FeaturedDocsCard$1 } from '@backstage/plugin-home';
3
3
 
4
4
  const FeaturedDocsCard = (props) => {
5
- return /* @__PURE__ */ React.createElement(FeaturedDocsCard$1, { subLinkText: " Learn more", ...props });
5
+ return /* @__PURE__ */ jsx(FeaturedDocsCard$1, { subLinkText: " Learn more", ...props });
6
6
  };
7
7
 
8
8
  export { FeaturedDocsCard };
@@ -1 +1 @@
1
- {"version":3,"file":"FeaturedDocsCard.esm.js","sources":["../../src/components/FeaturedDocsCard.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport {\n FeaturedDocsCard as PluginHomeFeaturedDocsCard,\n FeaturedDocsCardProps,\n} from '@backstage/plugin-home';\n\n/**\n * Overrides `FeaturedDocsCard` from the home plugin, but overrides the\n * `subLinkText` prop to be \" Learn more\" instead of \"LEARN MORE\".\n *\n * 1. To fix the all uppercase that is used in home plugin\n * 2. To add a small missing gap between the title and the button\n */\nexport const FeaturedDocsCard = (props: FeaturedDocsCardProps) => {\n return <PluginHomeFeaturedDocsCard subLinkText=\" Learn more\" {...props} />;\n};\n"],"names":["PluginHomeFeaturedDocsCard"],"mappings":";;;AA8Ba,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAAA,kBAAA,EAAA,EAA2B,WAAY,EAAA,aAAA,EAAe,GAAG,KAAO,EAAA,CAAA;AAC1E;;;;"}
1
+ {"version":3,"file":"FeaturedDocsCard.esm.js","sources":["../../src/components/FeaturedDocsCard.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 FeaturedDocsCard as PluginHomeFeaturedDocsCard,\n FeaturedDocsCardProps,\n} from '@backstage/plugin-home';\n\n/**\n * Overrides `FeaturedDocsCard` from the home plugin, but overrides the\n * `subLinkText` prop to be \" Learn more\" instead of \"LEARN MORE\".\n *\n * 1. To fix the all uppercase that is used in home plugin\n * 2. To add a small missing gap between the title and the button\n */\nexport const FeaturedDocsCard = (props: FeaturedDocsCardProps) => {\n return <PluginHomeFeaturedDocsCard subLinkText=\" Learn more\" {...props} />;\n};\n"],"names":["PluginHomeFeaturedDocsCard"],"mappings":";;;AA4Ba,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAA,uBAAQ,GAAA,CAAAA,kBAAA,EAAA,EAA2B,WAAY,EAAA,aAAA,EAAe,GAAG,KAAO,EAAA,CAAA;AAC1E;;;;"}