@red-hat-developer-hub/backstage-plugin-dynamic-home-page 1.10.6 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +93 -1
  3. package/dist/alpha/components/CustomizableGridLayout.esm.js +60 -0
  4. package/dist/alpha/components/CustomizableGridLayout.esm.js.map +1 -0
  5. package/dist/alpha/components/HomePageLayout.esm.js +25 -0
  6. package/dist/alpha/components/HomePageLayout.esm.js.map +1 -0
  7. package/dist/alpha/components/ReadOnlyGirdLayout.esm.js +137 -0
  8. package/dist/alpha/components/ReadOnlyGirdLayout.esm.js.map +1 -0
  9. package/dist/alpha/extensions/apis.esm.js +19 -0
  10. package/dist/alpha/extensions/apis.esm.js.map +1 -0
  11. package/dist/alpha/extensions/homePageCards.esm.js +117 -0
  12. package/dist/alpha/extensions/homePageCards.esm.js.map +1 -0
  13. package/dist/alpha/extensions/homePageLayoutExtension.esm.js +57 -0
  14. package/dist/alpha/extensions/homePageLayoutExtension.esm.js.map +1 -0
  15. package/dist/alpha/utils.esm.js +6 -0
  16. package/dist/alpha/utils.esm.js.map +1 -0
  17. package/dist/alpha.d.ts +77 -0
  18. package/dist/alpha.esm.js +39 -0
  19. package/dist/alpha.esm.js.map +1 -0
  20. package/dist/components/EntitySection/EntityCard.esm.js +6 -1
  21. package/dist/components/EntitySection/EntityCard.esm.js.map +1 -1
  22. package/dist/components/EntitySection/EntitySection.esm.js +149 -99
  23. package/dist/components/EntitySection/EntitySection.esm.js.map +1 -1
  24. package/dist/components/OnboardingSection/OnboardingCard.esm.js +3 -0
  25. package/dist/components/OnboardingSection/OnboardingCard.esm.js.map +1 -1
  26. package/dist/components/OnboardingSection/OnboardingSection.esm.js +33 -17
  27. package/dist/components/OnboardingSection/OnboardingSection.esm.js.map +1 -1
  28. package/dist/components/TemplateSection/TemplateSection.esm.js +87 -47
  29. package/dist/components/TemplateSection/TemplateSection.esm.js.map +1 -1
  30. package/dist/hooks/useContainerQuery.esm.js +43 -0
  31. package/dist/hooks/useContainerQuery.esm.js.map +1 -0
  32. package/dist/index.d.ts +1 -57
  33. package/dist/index.esm.js +0 -2
  34. package/dist/index.esm.js.map +1 -1
  35. package/dist/translations/index.esm.js.map +1 -1
  36. package/dist/translations/ref.esm.js.map +1 -1
  37. package/dist/utils/GridItem.esm.js +31 -0
  38. package/dist/utils/GridItem.esm.js.map +1 -0
  39. package/package.json +35 -16
@@ -0,0 +1,77 @@
1
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
+
3
+ /**
4
+ * Translation ref for the Dynamic Home Page plugin.
5
+ * Defines all translation keys used in the plugin.
6
+ *
7
+ * @public
8
+ */
9
+ declare const homepageTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"plugin.homepage", {
10
+ readonly "header.local": string;
11
+ readonly "header.welcome": string;
12
+ readonly "header.welcomePersonalized": string;
13
+ readonly "search.placeholder": string;
14
+ readonly "homePage.empty": string;
15
+ readonly "quickAccess.title": string;
16
+ readonly "quickAccess.error": string;
17
+ readonly "quickAccess.fetchError": string;
18
+ readonly "featuredDocs.learnMore": string;
19
+ readonly "templates.title": string;
20
+ readonly "templates.error": string;
21
+ readonly "templates.empty": string;
22
+ readonly "templates.fetchError": string;
23
+ readonly "templates.emptyDescription": string;
24
+ readonly "templates.register": string;
25
+ readonly "templates.viewAll": string;
26
+ readonly "onboarding.guest": string;
27
+ readonly "onboarding.greeting.goodMorning": string;
28
+ readonly "onboarding.greeting.goodAfternoon": string;
29
+ readonly "onboarding.greeting.goodEvening": string;
30
+ readonly "onboarding.getStarted.title": string;
31
+ readonly "onboarding.getStarted.description": string;
32
+ readonly "onboarding.getStarted.buttonText": string;
33
+ readonly "onboarding.getStarted.ariaLabel": string;
34
+ readonly "onboarding.explore.title": string;
35
+ readonly "onboarding.explore.description": string;
36
+ readonly "onboarding.explore.buttonText": string;
37
+ readonly "onboarding.explore.ariaLabel": string;
38
+ readonly "onboarding.learn.title": string;
39
+ readonly "onboarding.learn.description": string;
40
+ readonly "onboarding.learn.buttonText": string;
41
+ readonly "onboarding.learn.ariaLabel": string;
42
+ readonly "entities.title": string;
43
+ readonly "entities.error": string;
44
+ readonly "entities.description": string;
45
+ readonly "entities.close": string;
46
+ readonly "entities.empty": string;
47
+ readonly "entities.fetchError": string;
48
+ readonly "entities.emptyDescription": string;
49
+ readonly "entities.register": string;
50
+ readonly "entities.viewAll": string;
51
+ }>;
52
+
53
+ /**
54
+ * Translation resource for the Dynamic Home Page plugin (en, de, es, fr, it, ja).
55
+ *
56
+ * @public
57
+ */
58
+ declare const homepageTranslations: _backstage_frontend_plugin_api.TranslationResource<"plugin.homepage">;
59
+
60
+ /**
61
+ * Frontend module for the Dynamic Home Page plugin (New Frontend System).
62
+ *
63
+ * Extends the `home` plugin with a custom layout and RHDH widgets: Onboarding,
64
+ * Entity Catalog, Templates, Quick Access, Search, Recently Visited, Top Visited, etc.
65
+ * Add to your app's `createApp({ features: [..., homePageDevModule] })`.
66
+ *
67
+ * @alpha
68
+ */
69
+ declare const homePageModule: _backstage_frontend_plugin_api.FrontendModule;
70
+ /**
71
+ * Translation module for the Dynamic Home Page plugin.
72
+ *
73
+ * @alpha
74
+ */
75
+ declare const homepageTranslationsModule: _backstage_frontend_plugin_api.FrontendModule;
76
+
77
+ export { homePageModule, homepageTranslationRef, homepageTranslations, homepageTranslationsModule };
@@ -0,0 +1,39 @@
1
+ import { TranslationBlueprint } from '@backstage/plugin-app-react';
2
+ import { createFrontendModule } from '@backstage/frontend-plugin-api';
3
+ import { onboardingSectionWidget, entitySectionWidget, templateSectionWidget, quickAccessCardWidget, featuredDocsCardWidget, searchBarWidget, TopVisitedWidget, RecentlyVisitedWidget, catalogStarredWidget, disableToolkit } from './alpha/extensions/homePageCards.esm.js';
4
+ import { homepageTranslations } from './translations/index.esm.js';
5
+ import { homePageLayoutExtension } from './alpha/extensions/homePageLayoutExtension.esm.js';
6
+ import { quickAccessApi } from './alpha/extensions/apis.esm.js';
7
+ export { homepageTranslationRef } from './translations/ref.esm.js';
8
+
9
+ const homePageModule = createFrontendModule({
10
+ pluginId: "home",
11
+ extensions: [
12
+ homePageLayoutExtension,
13
+ onboardingSectionWidget,
14
+ entitySectionWidget,
15
+ templateSectionWidget,
16
+ quickAccessApi,
17
+ quickAccessCardWidget,
18
+ featuredDocsCardWidget,
19
+ searchBarWidget,
20
+ TopVisitedWidget,
21
+ RecentlyVisitedWidget,
22
+ catalogStarredWidget,
23
+ disableToolkit
24
+ ]
25
+ });
26
+ const homepageTranslationsModule = createFrontendModule({
27
+ pluginId: "app",
28
+ extensions: [
29
+ TranslationBlueprint.make({
30
+ name: "homepage-translations",
31
+ params: {
32
+ resource: homepageTranslations
33
+ }
34
+ })
35
+ ]
36
+ });
37
+
38
+ export { homePageModule, homepageTranslations, homepageTranslationsModule };
39
+ //# sourceMappingURL=alpha.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"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 { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport { createFrontendModule } from '@backstage/frontend-plugin-api';\nimport {\n catalogStarredWidget,\n disableToolkit,\n entitySectionWidget,\n featuredDocsCardWidget,\n onboardingSectionWidget,\n quickAccessCardWidget,\n RecentlyVisitedWidget,\n searchBarWidget,\n templateSectionWidget,\n TopVisitedWidget,\n} from './extensions/homePageCards';\nimport { homepageTranslations } from '../translations';\n\nimport { homePageLayoutExtension } from './extensions/homePageLayoutExtension';\nimport { quickAccessApi } from './extensions/apis';\n\n/**\n * Frontend module for the Dynamic Home Page plugin (New Frontend System).\n *\n * Extends the `home` plugin with a custom layout and RHDH widgets: Onboarding,\n * Entity Catalog, Templates, Quick Access, Search, Recently Visited, Top Visited, etc.\n * Add to your app's `createApp({ features: [..., homePageDevModule] })`.\n *\n * @alpha\n */\nexport const homePageModule = createFrontendModule({\n pluginId: 'home',\n extensions: [\n homePageLayoutExtension,\n onboardingSectionWidget,\n entitySectionWidget,\n templateSectionWidget,\n quickAccessApi,\n quickAccessCardWidget,\n featuredDocsCardWidget,\n searchBarWidget,\n TopVisitedWidget,\n RecentlyVisitedWidget,\n catalogStarredWidget,\n disableToolkit,\n ],\n});\n\n/**\n * Translation module for the Dynamic Home Page plugin.\n *\n * @alpha\n */\nexport const homepageTranslationsModule = createFrontendModule({\n pluginId: 'app',\n extensions: [\n TranslationBlueprint.make({\n name: 'homepage-translations',\n params: {\n resource: homepageTranslations,\n },\n }),\n ],\n});\n\n/**\n *\n * @alpha\n */\nexport { homepageTranslationRef, homepageTranslations } from '../translations';\n"],"names":[],"mappings":";;;;;;;;AA4CO,MAAM,iBAAiB,oBAAqB,CAAA;AAAA,EACjD,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,uBAAA;AAAA,IACA,uBAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,IACA,cAAA;AAAA,IACA,qBAAA;AAAA,IACA,sBAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,qBAAA;AAAA,IACA,oBAAA;AAAA,IACA;AAAA;AAEJ,CAAC;AAOM,MAAM,6BAA6B,oBAAqB,CAAA;AAAA,EAC7D,QAAU,EAAA,KAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,qBAAqB,IAAK,CAAA;AAAA,MACxB,IAAM,EAAA,uBAAA;AAAA,MACN,MAAQ,EAAA;AAAA,QACN,QAAU,EAAA;AAAA;AACZ,KACD;AAAA;AAEL,CAAC;;;;"}
@@ -19,14 +19,19 @@ const EntityCard = ({
19
19
  {
20
20
  elevation: 0,
21
21
  sx: {
22
+ height: "100%",
22
23
  border: (theme) => `1px solid ${theme.palette.grey[400]}`,
23
24
  overflow: "auto",
24
- maxHeight: "100%"
25
+ display: "flex",
26
+ flexDirection: "column"
25
27
  },
26
28
  children: /* @__PURE__ */ jsxs(
27
29
  CardContent,
28
30
  {
29
31
  sx: {
32
+ flex: 1,
33
+ display: "flex",
34
+ flexDirection: "column",
30
35
  pb: 2,
31
36
  "&:last-child": {
32
37
  pb: 2
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCard.esm.js","sources":["../../../src/components/EntitySection/EntityCard.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 { FC } from 'react';\n\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { MarkdownContent } from '@backstage/core-components';\n\nimport CardContent from '@mui/material/CardContent';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\n\nimport TagList from './TagList';\n\ninterface EntityCardProps {\n title: string;\n version?: string;\n description: string;\n tags: string[];\n kind: string;\n entity: Entity;\n}\n\nconst EntityCard: FC<EntityCardProps> = ({\n title,\n description,\n tags,\n kind,\n entity,\n}) => {\n return (\n <Card\n elevation={0}\n sx={{\n border: theme => `1px solid ${theme.palette.grey[400]}`,\n overflow: 'auto',\n maxHeight: '100%',\n }}\n >\n <CardContent\n sx={{\n pb: 2,\n '&:last-child': {\n pb: 2,\n },\n backgroundColor: 'transparent',\n }}\n >\n <Box sx={{ overflow: 'hidden' }}>\n <EntityRefLink\n entityRef={entity}\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n fontSize: '0.875rem',\n fontWeight: '500',\n textDecoration: 'underline',\n }}\n >\n {title}\n </EntityRefLink>\n </Box>\n <Box\n sx={{\n pt: 2,\n height: '175px',\n overflow: 'hidden',\n }}\n >\n <Typography\n variant=\"body2\"\n paragraph\n sx={{\n display: '-webkit-box',\n WebkitLineClamp: 8,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n '& p': {\n margin: 'auto',\n },\n }}\n >\n <MarkdownContent content={description} />\n </Typography>\n </Box>\n <TagList kind={kind} tags={tags} />\n </CardContent>\n </Card>\n );\n};\n\nexport default EntityCard;\n"],"names":[],"mappings":";;;;;;;;;AAqCA,MAAM,aAAkC,CAAC;AAAA,EACvC,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EACE,uBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,CAAA;AAAA,MACX,EAAI,EAAA;AAAA,QACF,QAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAAA,QACrD,QAAU,EAAA,MAAA;AAAA,QACV,SAAW,EAAA;AAAA,OACb;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,EAAI,EAAA,CAAA;AAAA,YACJ,cAAgB,EAAA;AAAA,cACd,EAAI,EAAA;AAAA,aACN;AAAA,YACA,eAAiB,EAAA;AAAA,W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EAAY,IAAY,EAAA;AAAA;AAAA;AAAA;AACnC;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityCard.esm.js","sources":["../../../src/components/EntitySection/EntityCard.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 { FC } from 'react';\n\nimport { EntityRefLink } from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { MarkdownContent } from '@backstage/core-components';\n\nimport CardContent from '@mui/material/CardContent';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\n\nimport TagList from './TagList';\n\ninterface EntityCardProps {\n title: string;\n version?: string;\n description: string;\n tags: string[];\n kind: string;\n entity: Entity;\n}\n\nconst EntityCard: FC<EntityCardProps> = ({\n title,\n description,\n tags,\n kind,\n entity,\n}) => {\n return (\n <Card\n elevation={0}\n sx={{\n height: '100%',\n border: theme => `1px solid ${theme.palette.grey[400]}`,\n overflow: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <CardContent\n sx={{\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n pb: 2,\n '&:last-child': {\n pb: 2,\n },\n backgroundColor: 'transparent',\n }}\n >\n <Box sx={{ overflow: 'hidden' }}>\n <EntityRefLink\n entityRef={entity}\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n fontSize: '0.875rem',\n fontWeight: '500',\n textDecoration: 'underline',\n }}\n >\n {title}\n </EntityRefLink>\n </Box>\n <Box\n sx={{\n pt: 2,\n height: '175px',\n overflow: 'hidden',\n }}\n >\n <Typography\n variant=\"body2\"\n paragraph\n sx={{\n display: '-webkit-box',\n WebkitLineClamp: 8,\n WebkitBoxOrient: 'vertical',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n '& p': {\n margin: 'auto',\n },\n }}\n >\n <MarkdownContent content={description} />\n </Typography>\n </Box>\n <TagList kind={kind} tags={tags} />\n </CardContent>\n </Card>\n );\n};\n\nexport default EntityCard;\n"],"names":[],"mappings":";;;;;;;;;AAqCA,MAAM,aAAkC,CAAC;AAAA,EACvC,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EACE,uBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,CAAA;AAAA,MACX,EAAI,EAAA;AAAA,QACF,MAAQ,EAAA,MAAA;AAAA,QACR,QAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAAA,QACrD,QAAU,EAAA,MAAA;AAAA,QACV,OAAS,EAAA,MAAA;AAAA,QACT,aAAe,EAAA;AAAA,OACjB;AAAA,MAEA,QAAA,kBAAA,IAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,IAAM,EAAA,CAAA;AAAA,YACN,OAAS,EAAA,MAAA;AAAA,YACT,aAAe,EAAA,QAAA;AAAA,YACf,EAAI,EAAA,CAAA;AAAA,YACJ,cAAgB,EAAA;AAAA,cACd,EAAI,EAAA;AAAA,aACN;AAAA,YACA,eAAiB,EAAA;AAAA,WACnB;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,QAAA,EAAU,UACnB,EAAA,QAAA,kBAAA,GAAA;AA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ect, Fragment } from 'react';
2
+ import { useState, useRef, useEffect, useCallback, Fragment } from 'react';
3
3
  import { Link, WarningPanel, CodeSnippet } from '@backstage/core-components';
4
4
  import { useUserProfile } from '@backstage/plugin-user-settings';
5
5
  import Grid from '@mui/material/Grid';
@@ -12,7 +12,6 @@ import CloseIcon from '@mui/icons-material/Close';
12
12
  import CircularProgress from '@mui/material/CircularProgress';
13
13
  import CardContent from '@mui/material/CardContent';
14
14
  import { styled, useTheme } from '@mui/material/styles';
15
- import useMediaQuery from '@mui/material/useMediaQuery';
16
15
  import EntityCard from './EntityCard.esm.js';
17
16
  import { ViewMoreLink } from './ViewMoreLink.esm.js';
18
17
  import HomePageEntityIllustration from '../../images/homepage-entities-1.svg';
@@ -20,6 +19,8 @@ import { useEntities } from '../../hooks/useEntities.esm.js';
20
19
  import { hasEntityIllustrationUserDismissed, addDismissedEntityIllustrationUsers } from '../../utils/utils.esm.js';
21
20
  import { useTranslation } from '../../hooks/useTranslation.esm.js';
22
21
  import { Trans } from '../Trans.esm.js';
22
+ import { containerGridItemSx } from '../../utils/GridItem.esm.js';
23
+ import { useContainerQuery } from '../../hooks/useContainerQuery.esm.js';
23
24
 
24
25
  const StyledLink = styled(Link)(({ theme }) => ({
25
26
  textDecoration: "none",
@@ -36,26 +37,31 @@ const EntitySection = () => {
36
37
  const [isRemoveFirstCard, setIsRemoveFirstCard] = useState(false);
37
38
  const [showDiscoveryCard, setShowDiscoveryCard] = useState(true);
38
39
  const [imgLoaded, setImgLoaded] = useState(false);
39
- const [isMediumBreakpoint, setIsMediumBreakpoint] = useState(false);
40
- const isMd = useMediaQuery(theme.breakpoints.only("md"));
41
- useEffect(() => {
42
- if (isMd) {
43
- setIsMediumBreakpoint(true);
44
- } else {
45
- setIsMediumBreakpoint(false);
46
- }
47
- }, [isMd]);
40
+ const containerRef = useRef(null);
41
+ const containerSize = useContainerQuery(containerRef);
42
+ const entityCardCount = containerSize === "xs" || containerSize === "sm" ? 2 : 4;
43
+ const illustrationWidthMap = {
44
+ md: 180,
45
+ lg: 220,
46
+ xl: 266
47
+ };
48
+ const illustrationWidth = illustrationWidthMap[containerSize] ?? 266;
49
+ const visibleEntitiesCount = (() => {
50
+ const isWide = containerSize === "xl" || containerSize === "lg" || containerSize === "md";
51
+ if (!isWide) return entityCardCount;
52
+ return isRemoveFirstCard ? entityCardCount : entityCardCount - 2;
53
+ })();
48
54
  useEffect(() => {
49
55
  const isUserDismissedEntityIllustration = hasEntityIllustrationUserDismissed(displayName);
50
56
  setIsRemoveFirstCard(isUserDismissedEntityIllustration);
51
57
  }, [displayName]);
52
- const handleClose = () => {
58
+ const handleClose = useCallback(() => {
53
59
  setShowDiscoveryCard(false);
54
60
  setTimeout(() => {
55
61
  addDismissedEntityIllustrationUsers(displayName);
56
62
  setIsRemoveFirstCard(true);
57
63
  }, 500);
58
- };
64
+ }, [displayName]);
59
65
  const { data, error, isLoading } = useEntities({
60
66
  kind: ["Component", "API", "Resource", "System"]
61
67
  });
@@ -83,14 +89,13 @@ const EntitySection = () => {
83
89
  }
84
90
  ) });
85
91
  } else {
86
- let entityCardCount = 2;
87
- if (isMediumBreakpoint) entityCardCount = 3;
88
92
  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: [
89
- !isRemoveFirstCard && !profileLoading && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 6, lg: 5, children: /* @__PURE__ */ jsxs(
93
+ !isRemoveFirstCard && !profileLoading && containerSize !== "xs" && containerSize !== "sm" && /* @__PURE__ */ jsx(Grid, { item: true, sx: containerGridItemSx({ md: 4 }), children: /* @__PURE__ */ jsx(
90
94
  Card,
91
95
  {
92
96
  elevation: 0,
93
97
  sx: {
98
+ height: "100%",
94
99
  border: `1px solid ${theme.palette.grey[400]}`,
95
100
  display: "flex",
96
101
  flexDirection: "row",
@@ -100,57 +105,74 @@ const EntitySection = () => {
100
105
  opacity: showDiscoveryCard ? 1 : 0,
101
106
  transform: showDiscoveryCard ? "translateX(0)" : "translateX(-50px)"
102
107
  },
103
- children: [
104
- !imgLoaded && /* @__PURE__ */ jsx(
105
- Skeleton,
106
- {
107
- variant: "rectangular",
108
- height: 300,
109
- sx: {
110
- borderRadius: 3,
111
- width: "clamp(140px, 14vw, 266px)"
112
- }
113
- }
114
- ),
115
- /* @__PURE__ */ jsx(
116
- Box,
117
- {
118
- component: "img",
119
- src: HomePageEntityIllustration,
120
- onLoad: () => setImgLoaded(true),
121
- alt: "",
122
- height: 300,
123
- sx: {
124
- width: "clamp(140px, 14vw, 266px)"
125
- }
126
- }
127
- ),
128
- /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
129
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("entities.description") }) }),
130
- entities?.length > 0 && /* @__PURE__ */ jsx(
131
- IconButton,
132
- {
133
- onClick: handleClose,
134
- "aria-label": t("entities.close"),
135
- style: {
136
- position: "absolute",
137
- top: "8px",
138
- right: "8px"
139
- },
140
- children: /* @__PURE__ */ jsx(CloseIcon, { style: { width: "16px", height: "16px" } })
141
- }
142
- )
143
- ] })
144
- ]
108
+ children: /* @__PURE__ */ jsxs(
109
+ Box,
110
+ {
111
+ sx: {
112
+ display: "flex",
113
+ flexDirection: "row",
114
+ alignItems: "center"
115
+ },
116
+ children: [
117
+ !imgLoaded && /* @__PURE__ */ jsx(
118
+ Skeleton,
119
+ {
120
+ variant: "rectangular",
121
+ height: 300,
122
+ sx: {
123
+ borderRadius: 3,
124
+ width: illustrationWidth
125
+ }
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx(
129
+ Box,
130
+ {
131
+ component: "img",
132
+ src: HomePageEntityIllustration,
133
+ onLoad: () => setImgLoaded(true),
134
+ alt: "",
135
+ height: 300,
136
+ sx: {
137
+ width: illustrationWidth
138
+ }
139
+ }
140
+ ),
141
+ /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
142
+ /* @__PURE__ */ jsx(Box, { sx: { p: 2 }, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", paragraph: true, children: t("entities.description") }) }),
143
+ entities?.length > 0 && /* @__PURE__ */ jsx(
144
+ IconButton,
145
+ {
146
+ onClick: handleClose,
147
+ "aria-label": t("entities.close"),
148
+ style: {
149
+ position: "absolute",
150
+ top: "8px",
151
+ right: "8px"
152
+ },
153
+ children: /* @__PURE__ */ jsx(
154
+ CloseIcon,
155
+ {
156
+ style: { width: "16px", height: "16px" }
157
+ }
158
+ )
159
+ }
160
+ )
161
+ ] })
162
+ ]
163
+ }
164
+ )
145
165
  }
146
- ) }, "entities illustration"),
147
- entities?.slice(0, isRemoveFirstCard ? 4 : entityCardCount).map((item) => /* @__PURE__ */ jsx(
166
+ ) }),
167
+ entities?.slice(0, visibleEntitiesCount).map((item) => /* @__PURE__ */ jsx(
148
168
  Grid,
149
169
  {
150
170
  item: true,
151
- xs: 12,
152
- md: 6,
153
- lg: isRemoveFirstCard ? 3 : 3.5,
171
+ sx: containerGridItemSx({
172
+ xs: 12,
173
+ sm: 6,
174
+ md: isRemoveFirstCard ? 3 : 4
175
+ }),
154
176
  children: /* @__PURE__ */ jsx(
155
177
  EntityCard,
156
178
  {
@@ -165,36 +187,47 @@ const EntitySection = () => {
165
187
  },
166
188
  item.metadata.name
167
189
  )),
168
- entities?.length === 0 && /* @__PURE__ */ jsx(Grid, { item: true, md: isRemoveFirstCard ? 12 : 7, children: /* @__PURE__ */ jsx(
169
- Box,
190
+ entities?.length === 0 && /* @__PURE__ */ jsx(
191
+ Grid,
170
192
  {
171
- sx: {
172
- display: "flex",
173
- alignItems: "center",
174
- justifyContent: "center",
175
- minHeight: 300,
176
- border: (muiTheme) => `1px solid ${muiTheme.palette.grey[400]}`,
177
- borderRadius: 3,
178
- overflow: "hidden"
179
- },
180
- children: /* @__PURE__ */ jsxs(CardContent, { children: [
181
- /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "1.125rem", fontWeight: 500 }, children: t("entities.empty") }),
182
- /* @__PURE__ */ jsx(
183
- Typography,
184
- {
185
- sx: {
186
- fontSize: "0.875rem",
187
- fontWeight: 400,
188
- mt: "20px",
189
- mb: "16px"
190
- },
191
- children: t("entities.emptyDescription")
192
- }
193
- ),
194
- /* @__PURE__ */ jsx(StyledLink, { to: "/catalog-import", underline: "none", children: t("entities.register") })
195
- ] })
193
+ item: true,
194
+ sx: containerGridItemSx({
195
+ sm: 12,
196
+ md: isRemoveFirstCard ? 12 : 8
197
+ }),
198
+ children: /* @__PURE__ */ jsx(
199
+ Box,
200
+ {
201
+ sx: {
202
+ height: "100%",
203
+ minHeight: 300,
204
+ display: "flex",
205
+ alignItems: "center",
206
+ justifyContent: "center",
207
+ border: (muiTheme) => `1px solid ${muiTheme.palette.grey[400]}`,
208
+ borderRadius: 3,
209
+ overflow: "hidden"
210
+ },
211
+ children: /* @__PURE__ */ jsxs(CardContent, { children: [
212
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "1.125rem", fontWeight: 500 }, children: t("entities.empty") }),
213
+ /* @__PURE__ */ jsx(
214
+ Typography,
215
+ {
216
+ sx: {
217
+ fontSize: "0.875rem",
218
+ fontWeight: 400,
219
+ mt: "20px",
220
+ mb: "16px"
221
+ },
222
+ children: t("entities.emptyDescription")
223
+ }
224
+ ),
225
+ /* @__PURE__ */ jsx(StyledLink, { to: "/catalog-import", underline: "none", children: t("entities.register") })
226
+ ] })
227
+ }
228
+ )
196
229
  }
197
- ) })
230
+ )
198
231
  ] }) }) });
199
232
  }
200
233
  return /* @__PURE__ */ jsxs(
@@ -204,7 +237,9 @@ const EntitySection = () => {
204
237
  sx: {
205
238
  padding: "24px",
206
239
  border: (muitheme) => `1px solid ${muitheme.palette.grey[300]}`,
207
- overflow: "auto"
240
+ containerType: "inline-size",
241
+ display: "flex",
242
+ flexDirection: "column"
208
243
  },
209
244
  children: [
210
245
  /* @__PURE__ */ jsx(
@@ -215,19 +250,34 @@ const EntitySection = () => {
215
250
  display: "flex",
216
251
  alignItems: "center",
217
252
  fontWeight: "500",
218
- fontSize: "1.5rem"
253
+ fontSize: "1.5rem",
254
+ flexShrink: 0
219
255
  },
220
256
  children: t("entities.title")
221
257
  }
222
258
  ),
223
- content,
224
- entities?.length > 0 && /* @__PURE__ */ jsx(Box, { sx: { pt: 2 }, children: /* @__PURE__ */ jsx(ViewMoreLink, { to: "/catalog", children: /* @__PURE__ */ jsx(
225
- Trans,
259
+ /* @__PURE__ */ jsxs(
260
+ Box,
226
261
  {
227
- message: "entities.viewAll",
228
- params: { count: data?.totalItems?.toString() || "" }
262
+ ref: containerRef,
263
+ sx: {
264
+ flex: 1,
265
+ minHeight: 0,
266
+ overflowY: "auto",
267
+ mt: 1
268
+ },
269
+ children: [
270
+ content,
271
+ entities?.length > 0 && /* @__PURE__ */ jsx(Box, { sx: { pt: 2 }, children: /* @__PURE__ */ jsx(ViewMoreLink, { to: "/catalog", children: /* @__PURE__ */ jsx(
272
+ Trans,
273
+ {
274
+ message: "entities.viewAll",
275
+ params: { count: data?.totalItems?.toString() || "" }
276
+ }
277
+ ) }) })
278
+ ]
229
279
  }
230
- ) }) })
280
+ )
231
281
  ]
232
282
  }
233
283
  );
@@ -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 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';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { Trans } from '../Trans';\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 { t } = useTranslation();\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={t('entities.fetchError')}>\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? t('entities.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 {t('entities.description')}\n </Typography>\n </Box>\n {entities?.length > 0 && (\n <IconButton\n onClick={handleClose}\n aria-label={t('entities.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={item.metadata.title ?? 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 {t('entities.empty')}\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n {t('entities.emptyDescription')}\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n {t('entities.register')}\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 {t('entities.title')}\n </Typography>\n {content}\n {entities?.length > 0 && (\n <Box sx={{ pt: 2 }}>\n <ViewMoreLink to=\"/catalog\">\n <Trans\n message=\"entities.viewAll\"\n params={{ count: data?.totalItems?.toString() || '' }}\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AA,CAAA,YAAA,EAAA,EAAa,IAAG,UACf,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,kBAAA;AAAA,YACR,QAAQ,EAAE,KAAA,EAAO,MAAM,UAAY,EAAA,QAAA,MAAc,EAAG;AAAA;AAAA,WAExD,CACF,EAAA;AAAA;AAAA;AAAA,GAEJ;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, useRef, useCallback } 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';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { Trans } from '../Trans';\nimport { containerGridItemSx } from '../../utils/GridItem';\nimport {\n useContainerQuery,\n type ContainerSize,\n} from '../../hooks/useContainerQuery';\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 { t } = useTranslation();\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\n const containerRef = useRef<HTMLDivElement>(null);\n const containerSize = useContainerQuery(containerRef);\n\n const entityCardCount =\n containerSize === 'xs' || containerSize === 'sm' ? 2 : 4;\n\n const illustrationWidthMap: Partial<Record<ContainerSize, number>> = {\n md: 180,\n lg: 220,\n xl: 266,\n };\n const illustrationWidth = illustrationWidthMap[containerSize] ?? 266;\n\n const visibleEntitiesCount = (() => {\n const isWide =\n containerSize === 'xl' ||\n containerSize === 'lg' ||\n containerSize === 'md';\n\n if (!isWide) return entityCardCount;\n\n return isRemoveFirstCard ? entityCardCount : entityCardCount - 2;\n })();\n\n useEffect(() => {\n const isUserDismissedEntityIllustration =\n hasEntityIllustrationUserDismissed(displayName);\n setIsRemoveFirstCard(isUserDismissedEntityIllustration);\n }, [displayName]);\n\n const handleClose = useCallback(() => {\n setShowDiscoveryCard(false);\n setTimeout(() => {\n addDismissedEntityIllustrationUsers(displayName);\n setIsRemoveFirstCard(true);\n }, 500);\n }, [displayName]);\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={t('entities.fetchError')}>\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? t('entities.error')}\n />\n </WarningPanel>\n );\n } else {\n content = (\n <Box sx={{ padding: '8px 8px 8px 0' }}>\n <Fragment>\n <Grid container spacing={1} alignItems=\"stretch\">\n {/* hiding discovery card on small containers */}\n {!isRemoveFirstCard &&\n !profileLoading &&\n containerSize !== 'xs' &&\n containerSize !== 'sm' && (\n <Grid item sx={containerGridItemSx({ md: 4 })}>\n <Card\n elevation={0}\n sx={{\n height: '100%',\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 <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n }}\n >\n {!imgLoaded && (\n <Skeleton\n variant=\"rectangular\"\n height={300}\n sx={{\n borderRadius: 3,\n width: illustrationWidth,\n }}\n />\n )}\n <Box\n component=\"img\"\n src={HomePageEntityIllustration}\n onLoad={() => setImgLoaded(true)}\n alt=\"\"\n height={300}\n sx={{\n width: illustrationWidth,\n }}\n />\n <Box sx={{ p: 2 }}>\n <Box sx={{ p: 2 }}>\n <Typography variant=\"body2\" paragraph>\n {t('entities.description')}\n </Typography>\n </Box>\n {entities?.length > 0 && (\n <IconButton\n onClick={handleClose}\n aria-label={t('entities.close')}\n style={{\n position: 'absolute',\n top: '8px',\n right: '8px',\n }}\n >\n <CloseIcon\n style={{ width: '16px', height: '16px' }}\n />\n </IconButton>\n )}\n </Box>\n </Box>\n </Card>\n </Grid>\n )}\n {entities?.slice(0, visibleEntitiesCount).map((item: any) => (\n <Grid\n item\n sx={containerGridItemSx({\n xs: 12,\n sm: 6,\n md: isRemoveFirstCard ? 3 : 4,\n })}\n key={item.metadata.name}\n >\n <EntityCard\n entity={item}\n title={item.metadata.title ?? 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\n item\n sx={containerGridItemSx({\n sm: 12,\n md: isRemoveFirstCard ? 12 : 8,\n })}\n >\n <Box\n sx={{\n height: '100%',\n minHeight: 300,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\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 {t('entities.empty')}\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n {t('entities.emptyDescription')}\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n {t('entities.register')}\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 containerType: 'inline-size',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <Typography\n variant=\"h3\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n fontWeight: '500',\n fontSize: '1.5rem',\n flexShrink: 0,\n }}\n >\n {t('entities.title')}\n </Typography>\n <Box\n ref={containerRef}\n sx={{\n flex: 1,\n minHeight: 0,\n overflowY: 'auto',\n mt: 1,\n }}\n >\n {content}\n {entities?.length > 0 && (\n <Box sx={{ pt: 2 }}>\n <ViewMoreLink to=\"/catalog\">\n <Trans\n message=\"entities.viewAll\"\n params={{ count: data?.totalItems?.toString() || '' }}\n />\n </ViewMoreLink>\n </Box>\n )}\n </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MAAc,EAAG;AAAA;AAAA,iBAExD,CACF,EAAA;AAAA;AAAA;AAAA;AAEJ;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -18,6 +18,7 @@ const OnboardingCard = ({
18
18
  /* @__PURE__ */ jsx(
19
19
  Typography,
20
20
  {
21
+ variant: "h3",
21
22
  sx: {
22
23
  fontSize: "1.75rem",
23
24
  fontWeight: 500,
@@ -55,6 +56,8 @@ const OnboardingCard = ({
55
56
  target,
56
57
  "aria-label": ariaLabel,
57
58
  sx: {
59
+ width: 220,
60
+ minWidth: 220,
58
61
  padding: (theme) => theme.spacing(1, 1.5),
59
62
  fontSize: "16px",
60
63
  "& .v5-MuiButton-endIcon": {