@red-hat-developer-hub/backstage-plugin-dynamic-home-page 1.10.3 → 1.10.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-dynamic-home-page
2
2
 
3
+ ## 1.10.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 802696c: UI polish and tag interaction improvements on Home page
8
+
9
+ ## 1.10.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 2f39369: Fix inconsistent usage of resource kind chip on template homepage
14
+
3
15
  ## 1.10.3
4
16
 
5
17
  ### Patch Changes
@@ -1,4 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Link } from '@backstage/core-components';
2
3
  import Box from '@mui/material/Box';
3
4
  import Chip from '@mui/material/Chip';
4
5
  import Typography from '@mui/material/Typography';
@@ -6,40 +7,66 @@ import { KINDS } from '../../utils/constants.esm.js';
6
7
 
7
8
  const TagList = ({ tags, kind }) => {
8
9
  const hiddenCount = tags.length - 3;
10
+ const params = new URLSearchParams({
11
+ "filters[kind]": kind,
12
+ "filters[user]": "all"
13
+ });
14
+ const catalogKindLink = `/catalog?${params.toString()}`;
9
15
  return /* @__PURE__ */ jsxs(
10
16
  Box,
11
17
  {
12
18
  sx: {
13
- height: "72px",
19
+ height: "77px",
20
+ pt: 2,
14
21
  overflow: "hidden",
15
22
  display: "flex",
16
23
  flexWrap: "wrap",
17
24
  alignItems: "flex-end",
18
- gap: 0.5
25
+ rowGap: 0.5,
26
+ columnGap: 0.5
19
27
  },
20
28
  children: [
21
- /* @__PURE__ */ jsx(
29
+ /* @__PURE__ */ jsx(Link, { to: catalogKindLink, children: /* @__PURE__ */ jsx(
22
30
  Chip,
23
31
  {
24
32
  label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: kind }),
25
33
  sx: {
26
34
  backgroundColor: KINDS[kind.toLocaleUpperCase()]?.fill,
27
- color: "black"
35
+ color: "black",
36
+ m: 0,
37
+ border: "1px solid transparent",
38
+ "&:hover": {
39
+ borderColor: KINDS[kind.toLocaleUpperCase()]?.borderColor
40
+ }
28
41
  },
29
42
  variant: "filled",
30
43
  size: "small"
31
44
  },
32
45
  kind
33
- ),
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
- )),
46
+ ) }),
47
+ tags.slice(0, 2).map((tag) => {
48
+ const tagParams = new URLSearchParams({
49
+ "filters[kind]": kind,
50
+ "filters[tags]": tag,
51
+ "filters[user]": "all"
52
+ });
53
+ const catalogLink = `/catalog?${tagParams.toString()}`;
54
+ return /* @__PURE__ */ jsx(Link, { to: catalogLink, children: /* @__PURE__ */ jsx(
55
+ Chip,
56
+ {
57
+ label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: tag }),
58
+ sx: {
59
+ m: 0,
60
+ "&:hover": {
61
+ borderColor: "#9e9e9e"
62
+ }
63
+ },
64
+ variant: "outlined",
65
+ size: "small"
66
+ },
67
+ tag
68
+ ) }, tag);
69
+ }),
43
70
  hiddenCount > 0 && /* @__PURE__ */ jsx(
44
71
  Chip,
45
72
  {
@@ -49,7 +76,7 @@ const TagList = ({ tags, kind }) => {
49
76
  sx: {
50
77
  fontSize: "0.8rem",
51
78
  fontWeight: 400,
52
- color: (theme) => `${theme.palette.mode === "light" ? "#0066CC" : "#1FA7F8"}`
79
+ color: (theme) => theme.palette.text.secondary
53
80
  },
54
81
  children: `${hiddenCount} more`
55
82
  }
@@ -57,7 +84,8 @@ const TagList = ({ tags, kind }) => {
57
84
  variant: "outlined",
58
85
  size: "small",
59
86
  sx: {
60
- border: "none"
87
+ border: "none",
88
+ m: 0
61
89
  }
62
90
  }
63
91
  )
@@ -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 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 }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A;AAAA,YACR,IAAK,EAAA;AAAA,WAAA;AAAA,UAPA;AAAA,SASR,CAAA;AAAA,QAEA,cAAc,CACb,oBAAA,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;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
+ {"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 type { FC } from 'react';\n\nimport { Link } from '@backstage/core-components';\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\n const params = new URLSearchParams({\n 'filters[kind]': kind,\n 'filters[user]': 'all',\n });\n const catalogKindLink = `/catalog?${params.toString()}`;\n\n return (\n <Box\n sx={{\n height: '77px',\n pt: 2,\n overflow: 'hidden',\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'flex-end',\n rowGap: 0.5,\n columnGap: 0.5,\n }}\n >\n <Link to={catalogKindLink}>\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 m: 0,\n border: '1px solid transparent',\n '&:hover': {\n borderColor:\n KINDS[kind.toLocaleUpperCase() as KindKeys]?.borderColor,\n },\n }}\n variant=\"filled\"\n size=\"small\"\n />\n </Link>\n {tags.slice(0, 2).map(tag => {\n const tagParams = new URLSearchParams({\n 'filters[kind]': kind,\n 'filters[tags]': tag,\n 'filters[user]': 'all',\n });\n const catalogLink = `/catalog?${tagParams.toString()}`;\n\n return (\n <Link key={tag} to={catalogLink}>\n <Chip\n key={tag}\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {tag}\n </Typography>\n }\n sx={{\n m: 0,\n '&:hover': {\n borderColor: '#9e9e9e',\n },\n }}\n variant=\"outlined\"\n size=\"small\"\n />\n </Link>\n );\n })}\n\n {hiddenCount > 0 && (\n <Chip\n label={\n <Typography\n sx={{\n fontSize: '0.8rem',\n fontWeight: 400,\n color: theme => theme.palette.text.secondary,\n }}\n >\n {`${hiddenCount} more`}\n </Typography>\n }\n variant=\"outlined\"\n size=\"small\"\n sx={{\n border: 'none',\n m: 0,\n }}\n />\n )}\n </Box>\n );\n};\n\nexport default TagList;\n"],"names":[],"mappings":";;;;;;;AA+BA,MAAM,OAA4B,GAAA,CAAC,EAAE,IAAA,EAAM,MAAW,KAAA;AACpD,EAAM,MAAA,WAAA,GAAc,KAAK,MAAS,GAAA,CAAA;AAElC,EAA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AAA,YACL,EAAI,EAAA;AAAA,cACF,MAAQ,EAAA,MAAA;AAAA,cACR,CAAG,EAAA;AAAA;AACL;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -10,8 +10,15 @@ const TemplateCard = ({
10
10
  link,
11
11
  title,
12
12
  description,
13
- kind
13
+ kind,
14
+ type
14
15
  }) => {
16
+ const params = new URLSearchParams({
17
+ "filters[kind]": kind,
18
+ "filters[type]": type,
19
+ "filters[user]": "all"
20
+ });
21
+ const catalogLink = `/catalog?${params.toString()}`;
15
22
  return /* @__PURE__ */ jsx(
16
23
  Card,
17
24
  {
@@ -32,14 +39,6 @@ const TemplateCard = ({
32
39
  backgroundColor: "transparent"
33
40
  },
34
41
  children: [
35
- /* @__PURE__ */ jsx(Box, { sx: { padding: "8px 0" }, children: /* @__PURE__ */ jsx(
36
- Chip,
37
- {
38
- label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: kind }),
39
- size: "small"
40
- },
41
- kind
42
- ) }),
43
42
  /* @__PURE__ */ jsx(Box, { sx: { margin: "8px 0", height: "21px", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
44
43
  Link,
45
44
  {
@@ -84,7 +83,21 @@ const TemplateCard = ({
84
83
  }
85
84
  )
86
85
  }
87
- )
86
+ ),
87
+ /* @__PURE__ */ jsx(Box, { sx: { pt: 2 }, children: type && /* @__PURE__ */ jsx(Link, { to: catalogLink, children: /* @__PURE__ */ jsx(
88
+ Chip,
89
+ {
90
+ label: /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.8rem", fontWeight: 400 }, children: type }),
91
+ sx: {
92
+ border: "1px solid transparent",
93
+ "&:hover": {
94
+ borderColor: "#9e9e9e"
95
+ }
96
+ },
97
+ size: "small"
98
+ },
99
+ type
100
+ ) }) })
88
101
  ]
89
102
  }
90
103
  )
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateCard.esm.js","sources":["../../../src/components/TemplateSection/TemplateCard.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 { Link } from '@backstage/core-components';\nimport { MarkdownContent } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport CardContent from '@mui/material/CardContent';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport Card from '@mui/material/Card';\n\ninterface TemplateCardProps {\n link: string;\n title: string;\n description: string;\n kind: string;\n}\n\nconst TemplateCard: FC<TemplateCardProps> = ({\n link,\n title,\n description,\n kind,\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={{ padding: '8px 0' }}>\n <Chip\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {kind}\n </Typography>\n }\n key={kind}\n size=\"small\"\n />\n </Box>\n <Box sx={{ margin: '8px 0', height: '21px', overflow: 'hidden' }}>\n <Link\n to={link}\n underline=\"always\"\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n fontSize: '0.9rem',\n fontWeight: '500',\n }}\n >\n {title}\n </Link>\n </Box>\n <Box\n sx={{\n padding: '8px 0',\n height: '90px',\n overflow: 'hidden',\n }}\n >\n <Typography\n variant=\"body2\"\n paragraph\n sx={{\n display: '-webkit-box',\n WebkitLineClamp: 4,\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 </CardContent>\n </Card>\n );\n};\n\nexport default TemplateCard;\n"],"names":[],"mappings":";;;;;;;;AAiCA,MAAM,eAAsC,CAAC;AAAA,EAC3C,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;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,WACnB;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,OAAA,EAAS,SAClB,EAAA,QAAA,kBAAA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,KAAA,kBACG,GAAA,CAAA,UAAA,EAAA,EAAW,EAAI,EAAA,EAAE,UAAU,QAAU,EAAA,UAAA,EAAY,GAAI,EAAA,EACnD,QACH,EAAA,IAAA,EAAA,CAAA;AAAA,gBAGF,IAAK,EAAA;AAAA,eAAA;AAAA,cADA;AAAA,aAGT,EAAA,CAAA;AAAA,4BACA,GAAA,CAAC,GAAI,EAAA,EAAA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","sources":["../../../src/components/TemplateSection/TemplateCard.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 { Link } from '@backstage/core-components';\nimport { MarkdownContent } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport CardContent from '@mui/material/CardContent';\nimport Chip from '@mui/material/Chip';\nimport Typography from '@mui/material/Typography';\nimport Card from '@mui/material/Card';\n\ninterface TemplateCardProps {\n link: string;\n title: string;\n description: string;\n kind: string;\n type: string;\n}\n\nconst TemplateCard: FC<TemplateCardProps> = ({\n link,\n title,\n description,\n kind,\n type,\n}) => {\n const params = new URLSearchParams({\n 'filters[kind]': kind,\n 'filters[type]': type,\n 'filters[user]': 'all',\n });\n\n const catalogLink = `/catalog?${params.toString()}`;\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={{ margin: '8px 0', height: '21px', overflow: 'hidden' }}>\n <Link\n to={link}\n underline=\"always\"\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 1,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n fontSize: '0.9rem',\n fontWeight: '500',\n }}\n >\n {title}\n </Link>\n </Box>\n <Box\n sx={{\n padding: '8px 0',\n height: '90px',\n overflow: 'hidden',\n }}\n >\n <Typography\n variant=\"body2\"\n paragraph\n sx={{\n display: '-webkit-box',\n WebkitLineClamp: 4,\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 <Box sx={{ pt: 2 }}>\n {type && (\n <Link to={catalogLink}>\n <Chip\n label={\n <Typography sx={{ fontSize: '0.8rem', fontWeight: 400 }}>\n {type}\n </Typography>\n }\n key={type}\n sx={{\n border: '1px solid transparent',\n '&:hover': {\n borderColor: '#9e9e9e',\n },\n }}\n size=\"small\"\n />\n </Link>\n )}\n </Box>\n </CardContent>\n </Card>\n );\n};\n\nexport default TemplateCard;\n"],"names":[],"mappings":";;;;;;;;AAkCA,MAAM,eAAsC,CAAC;AAAA,EAC3C,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EAAM,MAAA,MAAA,GAAS,IAAI,eAAgB,CAAA;AAAA,IACjC,eAAiB,EAAA,IAAA;AAAA,IACjB,eAAiB,EAAA,IAAA;AAAA,IACjB,eAAiB,EAAA;AAAA,GAClB,CAAA;AAED,EAAA,MAAM,WAAc,GAAA,CAAA,SAAA,EAAY,MAAO,CAAA,QAAA,EAAU,CAAA,CAAA;AAEjD,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;AA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A,OAAA,EAAS,WAAa,EAAA;AAAA;AAAA;AACzC;AAAA,aACF;AAAA,4BACA,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,CAAE,EAAA,EACd,QACC,EAAA,IAAA,oBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAI,WACR,EAAA,QAAA,kBAAA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,KAAA,kBACG,GAAA,CAAA,UAAA,EAAA,EAAW,EAAI,EAAA,EAAE,UAAU,QAAU,EAAA,UAAA,EAAY,GAAI,EAAA,EACnD,QACH,EAAA,IAAA,EAAA,CAAA;AAAA,gBAGF,EAAI,EAAA;AAAA,kBACF,MAAQ,EAAA,uBAAA;AAAA,kBACR,SAAW,EAAA;AAAA,oBACT,WAAa,EAAA;AAAA;AACf,iBACF;AAAA,gBACA,IAAK,EAAA;AAAA,eAAA;AAAA,cAPA;AAAA,eAST,CAEJ,EAAA;AAAA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -64,7 +64,8 @@ const TemplateSection = () => {
64
64
  link: `/create/templates/${item.metadata.namespace}/${item.metadata.name}`,
65
65
  title: item.metadata.title,
66
66
  description: item.metadata.description,
67
- kind: "Template"
67
+ kind: item.kind,
68
+ type: item.spec.type
68
69
  }
69
70
  ) }, item.title)),
70
71
  templates?.items.length === 0 && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 12, children: /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateSection.esm.js","sources":["../../../src/components/TemplateSection/TemplateSection.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 { Fragment } from 'react';\n\nimport {\n CodeSnippet,\n WarningPanel,\n Link as BackstageLink,\n} from '@backstage/core-components';\n\nimport Grid from '@mui/material/Grid';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport CardContent from '@mui/material/CardContent';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport TemplateCard from './TemplateCard';\nimport { useEntities } from '../../hooks/useEntities';\nimport { ViewMoreLink } from './ViewMoreLink';\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 TemplateSection = () => {\n const { t } = useTranslation();\n const {\n data: templates,\n error,\n isLoading,\n } = useEntities({ kind: 'Template' });\n\n const params = new URLSearchParams({\n 'filters[kind]': 'template',\n limit: '20',\n });\n const catalogTemplatesLink = `/catalog?${params.toString()}`;\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 (!templates) {\n content = (\n <WarningPanel severity=\"error\" title={t('templates.fetchError')}>\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? t('templates.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 {templates?.items.map((item: any) => (\n <Grid item xs={12} md={6} lg={3} key={item.title}>\n <TemplateCard\n link={`/create/templates/${item.metadata.namespace}/${item.metadata.name}`}\n title={item.metadata.title}\n description={item.metadata.description}\n kind=\"Template\"\n />\n </Grid>\n ))}\n {templates?.items.length === 0 && (\n <Grid item xs={12} md={12}>\n <Box\n sx={{\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 sx={{\n margin: '1rem',\n }}\n >\n <Typography sx={{ fontSize: '1.125rem', fontWeight: 500 }}>\n {t('templates.empty')}\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n {t('templates.emptyDescription')}\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n {t('templates.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('templates.title')}\n </Typography>\n {content}\n {templates?.items && templates?.items.length > 0 && (\n <Box sx={{ pt: 2 }}>\n <ViewMoreLink to={catalogTemplatesLink} underline=\"always\">\n <Trans\n message=\"templates.viewAll\"\n params={{ count: templates?.totalItems?.toString() || '' }}\n />\n </ViewMoreLink>\n </Box>\n )}\n </Card>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAM,aAAa,MAAO,CAAAA,IAAa,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EACvD,cAAgB,EAAA,MAAA;AAAA,EAChB,OAAS,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,GAAG,CAAA;AAAA,EAC7B,QAAU,EAAA,MAAA;AAA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A;AAAA,cACF,OAAS,EAAA,MAAA;AAAA,cACT,UAAY,EAAA,QAAA;AAAA,cACZ,UAAY,EAAA,KAAA;AAAA,cACZ,QAAU,EAAA;AAAA,aACZ;AAAA,YAEC,YAAE,iBAAiB;AAAA;AAAA,SACtB;AAAA,QACC,OAAA;AAAA,QACA,WAAW,KAAS,IAAA,SAAA,EAAW,MAAM,MAAS,GAAA,CAAA,wBAC5C,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,GACb,EAAA,QAAA,kBAAA,GAAA,CAAC,gBAAa,EAAI,EAAA,oBAAA,EAAsB,WAAU,QAChD,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,mBAAA;AAAA,YACR,QAAQ,EAAE,KAAA,EAAO,WAAW,UAAY,EAAA,QAAA,MAAc,EAAG;AAAA;AAAA,WAE7D,CACF,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"TemplateSection.esm.js","sources":["../../../src/components/TemplateSection/TemplateSection.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 { Fragment } from 'react';\n\nimport {\n CodeSnippet,\n WarningPanel,\n Link as BackstageLink,\n} from '@backstage/core-components';\n\nimport Grid from '@mui/material/Grid';\nimport Box from '@mui/material/Box';\nimport Card from '@mui/material/Card';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport CardContent from '@mui/material/CardContent';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nimport TemplateCard from './TemplateCard';\nimport { useEntities } from '../../hooks/useEntities';\nimport { ViewMoreLink } from './ViewMoreLink';\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 TemplateSection = () => {\n const { t } = useTranslation();\n const {\n data: templates,\n error,\n isLoading,\n } = useEntities({ kind: 'Template' });\n\n const params = new URLSearchParams({\n 'filters[kind]': 'template',\n limit: '20',\n });\n const catalogTemplatesLink = `/catalog?${params.toString()}`;\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 (!templates) {\n content = (\n <WarningPanel severity=\"error\" title={t('templates.fetchError')}>\n <CodeSnippet\n language=\"text\"\n text={error?.toString() ?? t('templates.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 {templates?.items.map((item: any) => (\n <Grid item xs={12} md={6} lg={3} key={item.title}>\n <TemplateCard\n link={`/create/templates/${item.metadata.namespace}/${item.metadata.name}`}\n title={item.metadata.title}\n description={item.metadata.description}\n kind={item.kind}\n type={item.spec.type}\n />\n </Grid>\n ))}\n {templates?.items.length === 0 && (\n <Grid item xs={12} md={12}>\n <Box\n sx={{\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 sx={{\n margin: '1rem',\n }}\n >\n <Typography sx={{ fontSize: '1.125rem', fontWeight: 500 }}>\n {t('templates.empty')}\n </Typography>\n <Typography\n sx={{\n fontSize: '0.875rem',\n fontWeight: 400,\n mt: '20px',\n mb: '16px',\n }}\n >\n {t('templates.emptyDescription')}\n </Typography>\n <StyledLink to=\"/catalog-import\" underline=\"none\">\n {t('templates.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('templates.title')}\n </Typography>\n {content}\n {templates?.items && templates?.items.length > 0 && (\n <Box sx={{ pt: 2 }}>\n <ViewMoreLink to={catalogTemplatesLink} underline=\"always\">\n <Trans\n message=\"templates.viewAll\"\n params={{ count: templates?.totalItems?.toString() || '' }}\n />\n </ViewMoreLink>\n </Box>\n )}\n </Card>\n );\n};\n"],"names":["BackstageLink"],"mappings":";;;;;;;;;;;;;;;;AAuCA,MAAM,aAAa,MAAO,CAAAA,IAAa,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EACvD,cAAgB,EAAA,MAAA;AAAA,EAChB,OAAS,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,GAAG,CAAA;AAAA,EAC7B,QAAU,EAAA,MAAA;AAAA,EACV,OAAS,EAAA,aAAA;AAAA,EACT,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,QAAQ,IAAI,CAAA,CAAA;AAAA,EAC/C,YAAc,EAAA;AAChB,CAAE,CAAA,CAAA;AAEK,MAAM,kBAAkB,MAAM;AACnC,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAM,MAAA;AAAA,IACJ,IAAM,EAAA,SAAA;AAAA,IACN,KAAA;AAA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GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,EAAA,EAAI,GACb,EAAA,QAAA,kBAAA,GAAA,CAAC,gBAAa,EAAI,EAAA,oBAAA,EAAsB,WAAU,QAChD,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,mBAAA;AAAA,YACR,QAAQ,EAAE,KAAA,EAAO,WAAW,UAAY,EAAA,QAAA,MAAc,EAAG;AAAA;AAAA,WAE7D,CACF,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -33,19 +33,23 @@ const getLearningItems = (t) => [
33
33
  const KINDS = {
34
34
  COMPONENT: {
35
35
  label: "Component",
36
- fill: "#FFE082"
36
+ fill: "#FFE082",
37
+ borderColor: "#FFCA28"
37
38
  },
38
39
  API: {
39
40
  label: "API",
40
- fill: "#FFAB91"
41
+ fill: "#FFAB91",
42
+ borderColor: "#FF8A65"
41
43
  },
42
44
  RESOURCE: {
43
45
  label: "Resource",
44
- fill: "#FFD180"
46
+ fill: "#FFD180",
47
+ borderColor: "#FFB74D"
45
48
  },
46
49
  SYSTEM: {
47
50
  label: "System",
48
- fill: "#FF9E80"
51
+ fill: "#FF9E80",
52
+ borderColor: "#FF7043"
49
53
  }
50
54
  };
51
55
 
@@ -1 +1 @@
1
- {"version":3,"file":"constants.esm.js","sources":["../../src/utils/constants.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 OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\n\nimport { LearningSectionItem } from '../types';\nimport { homepageTranslationRef } from '../translations';\n\nexport const getLearningItems = (\n t: TranslationFunction<typeof homepageTranslationRef.T>,\n): LearningSectionItem[] => [\n {\n title: t('onboarding.getStarted.title'),\n description: t('onboarding.getStarted.description'),\n buttonText: t('onboarding.getStarted.buttonText'),\n buttonLink:\n 'https://docs.redhat.com/en/documentation/red_hat_developer_hub/',\n target: '_blank',\n ariaLabel: t('onboarding.getStarted.ariaLabel'),\n endIcon: OpenInNewIcon,\n },\n {\n title: t('onboarding.explore.title'),\n description: t('onboarding.explore.description'),\n buttonText: t('onboarding.explore.buttonText'),\n buttonLink: '/catalog',\n target: undefined,\n ariaLabel: t('onboarding.explore.ariaLabel'),\n endIcon: ArrowForwardIcon,\n },\n {\n title: t('onboarding.learn.title'),\n description: t('onboarding.learn.description'),\n buttonText: t('onboarding.learn.buttonText'),\n buttonLink: '/learning-paths',\n target: undefined,\n ariaLabel: t('onboarding.learn.ariaLabel'),\n endIcon: ArrowForwardIcon,\n },\n];\n\n// Keep the original for backwards compatibility or fallback\nexport const LEARNING_SECTION_ITEMS: LearningSectionItem[] = [\n {\n title: 'Get started',\n description: 'Learn about Red Hat Developer Hub.',\n buttonText: 'Read documentation',\n buttonLink:\n 'https://docs.redhat.com/en/documentation/red_hat_developer_hub/',\n target: '_blank',\n ariaLabel: 'Read documentation (opens in a new tab)',\n endIcon: OpenInNewIcon,\n },\n {\n title: 'Explore',\n description: 'Explore components, APIs and templates.',\n buttonText: 'Go to Catalog',\n buttonLink: '/catalog',\n target: undefined,\n ariaLabel: 'Go to Catalog',\n endIcon: ArrowForwardIcon,\n },\n {\n title: 'Learn',\n description: 'Explore and develop new skills.',\n buttonText: 'Go to Learning Paths',\n buttonLink: '/learning-paths',\n target: undefined,\n ariaLabel: 'Go to Learning Paths',\n endIcon: ArrowForwardIcon,\n },\n];\n\n// Backstage technical terms should not be translated\n// Keep as English domain-specific vocabulary\nexport const KINDS = {\n COMPONENT: {\n label: 'Component',\n fill: '#FFE082',\n },\n API: {\n label: 'API',\n fill: '#FFAB91',\n },\n RESOURCE: {\n label: 'Resource',\n fill: '#FFD180',\n },\n SYSTEM: {\n label: 'System',\n fill: '#FF9E80',\n },\n};\n"],"names":[],"mappings":";;;AAuBa,MAAA,gBAAA,GAAmB,CAC9B,CAC0B,KAAA;AAAA,EAC1B;AAAA,IACE,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,IACtC,WAAA,EAAa,EAAE,mCAAmC,CAAA;AAAA,IAClD,UAAA,EAAY,EAAE,kCAAkC,CAAA;AAAA,IAChD,UACE,EAAA,iEAAA;AAAA,IACF,MAAQ,EAAA,QAAA;AAAA,IACR,SAAA,EAAW,EAAE,iCAAiC,CAAA;AAAA,IAC9C,OAAS,EAAA;AAAA,GACX;AAAA,EACA;AAAA,IACE,KAAA,EAAO,EAAE,0BAA0B,CAAA;AAAA,IACnC,WAAA,EAAa,EAAE,gCAAgC,CAAA;AAAA,IAC/C,UAAA,EAAY,EAAE,+BAA+B,CAAA;AAAA,IAC7C,UAAY,EAAA,UAAA;AAAA,IACZ,MAAQ,EAAA,SAAA;AAAA,IACR,SAAA,EAAW,EAAE,8BAA8B,CAAA;AAAA,IAC3C,OAAS,EAAA;AAAA,GACX;AAAA,EACA;AAAA,IACE,KAAA,EAAO,EAAE,wBAAwB,CAAA;AAAA,IACjC,WAAA,EAAa,EAAE,8BAA8B,CAAA;AAAA,IAC7C,UAAA,EAAY,EAAE,6BAA6B,CAAA;AAAA,IAC3C,UAAY,EAAA,iBAAA;AAAA,IACZ,MAAQ,EAAA,SAAA;AAAA,IACR,SAAA,EAAW,EAAE,4BAA4B,CAAA;AAAA,IACzC,OAAS,EAAA;AAAA;AAEb;AAoCO,MAAM,KAAQ,GAAA;AAAA,EACnB,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,WAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,GAAK,EAAA;AAAA,IACH,KAAO,EAAA,KAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,UAAA;AAAA,IACP,IAAM,EAAA;AAAA,GACR;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,QAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV;;;;"}
1
+ {"version":3,"file":"constants.esm.js","sources":["../../src/utils/constants.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 OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\n\nimport { LearningSectionItem } from '../types';\nimport { homepageTranslationRef } from '../translations';\n\nexport const getLearningItems = (\n t: TranslationFunction<typeof homepageTranslationRef.T>,\n): LearningSectionItem[] => [\n {\n title: t('onboarding.getStarted.title'),\n description: t('onboarding.getStarted.description'),\n buttonText: t('onboarding.getStarted.buttonText'),\n buttonLink:\n 'https://docs.redhat.com/en/documentation/red_hat_developer_hub/',\n target: '_blank',\n ariaLabel: t('onboarding.getStarted.ariaLabel'),\n endIcon: OpenInNewIcon,\n },\n {\n title: t('onboarding.explore.title'),\n description: t('onboarding.explore.description'),\n buttonText: t('onboarding.explore.buttonText'),\n buttonLink: '/catalog',\n target: undefined,\n ariaLabel: t('onboarding.explore.ariaLabel'),\n endIcon: ArrowForwardIcon,\n },\n {\n title: t('onboarding.learn.title'),\n description: t('onboarding.learn.description'),\n buttonText: t('onboarding.learn.buttonText'),\n buttonLink: '/learning-paths',\n target: undefined,\n ariaLabel: t('onboarding.learn.ariaLabel'),\n endIcon: ArrowForwardIcon,\n },\n];\n\n// Keep the original for backwards compatibility or fallback\nexport const LEARNING_SECTION_ITEMS: LearningSectionItem[] = [\n {\n title: 'Get started',\n description: 'Learn about Red Hat Developer Hub.',\n buttonText: 'Read documentation',\n buttonLink:\n 'https://docs.redhat.com/en/documentation/red_hat_developer_hub/',\n target: '_blank',\n ariaLabel: 'Read documentation (opens in a new tab)',\n endIcon: OpenInNewIcon,\n },\n {\n title: 'Explore',\n description: 'Explore components, APIs and templates.',\n buttonText: 'Go to Catalog',\n buttonLink: '/catalog',\n target: undefined,\n ariaLabel: 'Go to Catalog',\n endIcon: ArrowForwardIcon,\n },\n {\n title: 'Learn',\n description: 'Explore and develop new skills.',\n buttonText: 'Go to Learning Paths',\n buttonLink: '/learning-paths',\n target: undefined,\n ariaLabel: 'Go to Learning Paths',\n endIcon: ArrowForwardIcon,\n },\n];\n\n// Backstage technical terms should not be translated\n// Keep as English domain-specific vocabulary\nexport const KINDS = {\n COMPONENT: {\n label: 'Component',\n fill: '#FFE082',\n borderColor: '#FFCA28',\n },\n API: {\n label: 'API',\n fill: '#FFAB91',\n borderColor: '#FF8A65',\n },\n RESOURCE: {\n label: 'Resource',\n fill: '#FFD180',\n borderColor: '#FFB74D',\n },\n SYSTEM: {\n label: 'System',\n fill: '#FF9E80',\n borderColor: '#FF7043',\n },\n};\n"],"names":[],"mappings":";;;AAuBa,MAAA,gBAAA,GAAmB,CAC9B,CAC0B,KAAA;AAAA,EAC1B;AAAA,IACE,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,IACtC,WAAA,EAAa,EAAE,mCAAmC,CAAA;AAAA,IAClD,UAAA,EAAY,EAAE,kCAAkC,CAAA;AAAA,IAChD,UACE,EAAA,iEAAA;AAAA,IACF,MAAQ,EAAA,QAAA;AAAA,IACR,SAAA,EAA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
3
+ "version": "1.10.5",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",