@chtc/web-components 0.0.0-3 → 0.0.0-31

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 (91) hide show
  1. package/README.md +17 -3
  2. package/dist/Article/Article.d.ts +6 -0
  3. package/dist/Article/Article.d.ts.map +1 -0
  4. package/dist/Article/Article.js +20 -0
  5. package/dist/Article/Article.js.map +1 -0
  6. package/dist/Article/index.d.ts +2 -0
  7. package/dist/Article/index.d.ts.map +1 -0
  8. package/dist/Article/index.js +2 -0
  9. package/dist/Article/index.js.map +1 -0
  10. package/dist/ArticleCard/ArticleCard.d.ts +4 -0
  11. package/dist/ArticleCard/ArticleCard.d.ts.map +1 -0
  12. package/dist/ArticleCard/ArticleCard.js +15 -0
  13. package/dist/ArticleCard/ArticleCard.js.map +1 -0
  14. package/dist/ArticleCard/index.d.ts +2 -0
  15. package/dist/ArticleCard/index.d.ts.map +1 -0
  16. package/dist/ArticleCard/index.js +2 -0
  17. package/dist/ArticleCard/index.js.map +1 -0
  18. package/dist/ColorBar/ColorBar.d.ts +25 -0
  19. package/dist/ColorBar/ColorBar.d.ts.map +1 -0
  20. package/dist/ColorBar/ColorBar.js +72 -0
  21. package/dist/ColorBar/ColorBar.js.map +1 -0
  22. package/dist/ColorBar/index.d.ts +2 -0
  23. package/dist/ColorBar/index.d.ts.map +1 -0
  24. package/dist/ColorBar/index.js +2 -0
  25. package/dist/ColorBar/index.js.map +1 -0
  26. package/dist/HorizontalArticleCard/HorizontalArticleCard.d.ts +4 -0
  27. package/dist/HorizontalArticleCard/HorizontalArticleCard.d.ts.map +1 -0
  28. package/dist/HorizontalArticleCard/HorizontalArticleCard.js +11 -0
  29. package/dist/HorizontalArticleCard/HorizontalArticleCard.js.map +1 -0
  30. package/dist/HorizontalArticleCard/index.d.ts +2 -0
  31. package/dist/HorizontalArticleCard/index.d.ts.map +1 -0
  32. package/dist/HorizontalArticleCard/index.js +2 -0
  33. package/dist/HorizontalArticleCard/index.js.map +1 -0
  34. package/dist/PieChart/PieChart.d.ts +4 -0
  35. package/dist/PieChart/PieChart.d.ts.map +1 -0
  36. package/dist/PieChart/PieChart.js +154 -0
  37. package/dist/PieChart/PieChart.js.map +1 -0
  38. package/dist/PieChart/index.d.ts +2 -0
  39. package/dist/PieChart/index.d.ts.map +1 -0
  40. package/dist/PieChart/index.js +2 -0
  41. package/dist/PieChart/index.js.map +1 -0
  42. package/dist/Table/Table.d.ts +4 -0
  43. package/dist/Table/Table.d.ts.map +1 -0
  44. package/dist/Table/Table.js +76 -0
  45. package/dist/Table/Table.js.map +1 -0
  46. package/dist/Table/index.d.ts +2 -0
  47. package/dist/Table/index.d.ts.map +1 -0
  48. package/dist/Table/index.js +2 -0
  49. package/dist/Table/index.js.map +1 -0
  50. package/dist/TopStyledBlock/TopStyledBlock.d.ts +10 -0
  51. package/dist/TopStyledBlock/TopStyledBlock.d.ts.map +1 -0
  52. package/dist/TopStyledBlock/TopStyledBlock.js +10 -0
  53. package/dist/TopStyledBlock/TopStyledBlock.js.map +1 -0
  54. package/dist/TopStyledBlock/index.d.ts +2 -0
  55. package/dist/TopStyledBlock/index.d.ts.map +1 -0
  56. package/dist/TopStyledBlock/index.js +2 -0
  57. package/dist/TopStyledBlock/index.js.map +1 -0
  58. package/dist/index.d.ts +9 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +9 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/types.d.ts +114 -0
  63. package/dist/types.d.ts.map +1 -0
  64. package/dist/types.js +2 -0
  65. package/dist/types.js.map +1 -0
  66. package/dist/utils/filterArticles.d.ts +4 -0
  67. package/dist/utils/filterArticles.d.ts.map +1 -0
  68. package/dist/utils/filterArticles.js +5 -0
  69. package/dist/utils/filterArticles.js.map +1 -0
  70. package/dist/utils/getArticle.d.ts +4 -0
  71. package/dist/utils/getArticle.d.ts.map +1 -0
  72. package/dist/utils/getArticle.js +43 -0
  73. package/dist/utils/getArticle.js.map +1 -0
  74. package/dist/utils/getArticles.d.ts +36 -0
  75. package/dist/utils/getArticles.d.ts.map +1 -0
  76. package/dist/utils/getArticles.js +44 -0
  77. package/dist/utils/getArticles.js.map +1 -0
  78. package/dist/utils/index.d.ts +4 -0
  79. package/dist/utils/index.d.ts.map +1 -0
  80. package/dist/utils/index.js +4 -0
  81. package/dist/utils/index.js.map +1 -0
  82. package/package.json +26 -17
  83. package/src/index.ts +0 -1
  84. package/src/layout/Header/BurgerMenu.tsx +0 -101
  85. package/src/layout/Header/DesktopMenu.tsx +0 -50
  86. package/src/layout/Header/Header.tsx +0 -54
  87. package/src/layout/Header/HeaderDropdown.tsx +0 -71
  88. package/src/layout/Header/HeaderItem.tsx +0 -110
  89. package/src/layout/Header/ImageIcon.tsx +0 -1
  90. package/src/layout/Header/index.ts +0 -25
  91. package/src/layout/index.ts +0 -1
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ export interface TopStyledBlockProps {
3
+ children: ReactNode;
4
+ width?: string;
5
+ offset?: string;
6
+ height?: string;
7
+ }
8
+ declare const TopStyledBlock: React.FC<TopStyledBlockProps>;
9
+ export default TopStyledBlock;
10
+ //# sourceMappingURL=TopStyledBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TopStyledBlock.d.ts","sourceRoot":"","sources":["../../src/TopStyledBlock/TopStyledBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgBjD,CAAA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from "@mui/material";
3
+ const TopStyledBlock = ({ children, width, offset, height }) => {
4
+ width = width ? width : "5rem";
5
+ height = height ? height : "1rem";
6
+ offset = offset ? offset : "-2rem";
7
+ return (_jsxs(Box, { display: "flex", flexDirection: "column", children: [_jsx(Box, { height: 0, children: _jsx(Box, { bgcolor: "primary.main", width: width, height: height, mt: offset, borderRadius: 2 }) }), _jsx(Box, { children: children })] }));
8
+ };
9
+ export default TopStyledBlock;
10
+ //# sourceMappingURL=TopStyledBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TopStyledBlock.js","sourceRoot":"","sources":["../../src/TopStyledBlock/TopStyledBlock.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AASlC,MAAM,cAAc,GAAkC,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAC,EAAE,EAAE;IAE3F,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9B,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IACjC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;IAElC,OAAO,CACL,MAAC,GAAG,IAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,aAC5C,KAAC,GAAG,IAAC,MAAM,EAAE,CAAC,YACb,KAAC,GAAG,IAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAQ,GAC1F,EACN,KAAC,GAAG,cACF,QAAQ,GACJ,IACD,CACP,CAAA;AACF,CAAC,CAAA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './TopStyledBlock';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TopStyledBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './TopStyledBlock';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TopStyledBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { default as ArticleCard } from "./ArticleCard";
2
+ export { default as HorizontalArticleCard } from "./HorizontalArticleCard";
3
+ export { default as TopStyledBlock } from "./TopStyledBlock";
4
+ export { default as Article } from "./Article";
5
+ export { default as PieChart } from "./PieChart";
6
+ export { default as Table } from "./Table";
7
+ export { default as ColorBar } from "./ColorBar";
8
+ export * from './utils';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { default as ArticleCard } from "./ArticleCard";
2
+ export { default as HorizontalArticleCard } from "./HorizontalArticleCard";
3
+ export { default as TopStyledBlock } from "./TopStyledBlock";
4
+ export { default as Article } from "./Article";
5
+ export { default as PieChart } from "./PieChart";
6
+ export { default as Table } from "./Table";
7
+ export { default as ColorBar } from "./ColorBar";
8
+ export * from './utils';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { SxProps } from "@mui/material";
2
+ import { ReactElement } from "react";
3
+ /**
4
+ * Article Types
5
+ */
6
+ export interface ArticleCardProps {
7
+ href: string;
8
+ article: BackendArticle;
9
+ }
10
+ export type website = "htcondor" | "path" | "osg" | "chtc" | "pelican";
11
+ export type tag = "chtc_featured_article";
12
+ export type article_type = "news" | "user";
13
+ export interface Image {
14
+ path: string;
15
+ alt: string;
16
+ }
17
+ export interface Article {
18
+ content: string;
19
+ title: string;
20
+ author: string;
21
+ date: Date;
22
+ publish_on: website[];
23
+ type: article_type;
24
+ tag: tag;
25
+ image: Image;
26
+ excerpt: string;
27
+ banner_src: string;
28
+ banner_alt: string;
29
+ }
30
+ export interface BackendArticle extends Article {
31
+ slug: string[];
32
+ path: string;
33
+ }
34
+ /**
35
+ * Pie Chart Types
36
+ */
37
+ export interface PieChartData {
38
+ showLegend?: boolean;
39
+ bgColor?: string;
40
+ textColor?: string;
41
+ sortData?: boolean;
42
+ axisLabel: string;
43
+ data: {
44
+ label: string;
45
+ value: number;
46
+ }[];
47
+ }
48
+ /**
49
+ * Table Types
50
+ */
51
+ export interface TableProps {
52
+ /**
53
+ * The headers of the table.
54
+ */
55
+ headers: string[];
56
+ /**
57
+ * The data of the table.
58
+ *
59
+ * Each element in the array is a row, and each row contains cells of strings
60
+ * or numbers.
61
+ */
62
+ data: (string | number)[][];
63
+ /**
64
+ * The footer data that appears at the bottom of the table.
65
+ *
66
+ * This data is not sorted or paginated, and can include normal React elements.
67
+ */
68
+ footerData?: (string | number | ReactElement)[];
69
+ /**
70
+ * A function that takes in a cell, the column header, the column index, and
71
+ * the row index and returns the inner component of the cell to render.
72
+ *
73
+ * If the footer is not a React element, it will also be passed to this
74
+ * function.
75
+ */
76
+ cellRenderer?: (cell: string | number, columnHeader: string, column: number, row: number) => React.ReactNode;
77
+ containerSx?: SxProps;
78
+ tableSx?: SxProps;
79
+ headSx?: SxProps;
80
+ headRowSx?: SxProps;
81
+ headCellSx?: SxProps;
82
+ footerSx?: SxProps;
83
+ footerRowSx?: SxProps;
84
+ footerCellSx?: SxProps;
85
+ bodySx?: SxProps;
86
+ bodyRowSx?: SxProps;
87
+ bodyCellSx?: SxProps;
88
+ /**
89
+ * Whether or not the table is sortable. False by default.
90
+ */
91
+ sortable?: boolean;
92
+ /**
93
+ * Sort direction of the table. Ascending by default.
94
+ */
95
+ defaultSortDirection?: "asc" | "desc";
96
+ /**
97
+ * The default column to sort by. The first column by default.
98
+ */
99
+ defaultSortColumn?: string;
100
+ /**
101
+ * Whether or not the table is paginated. False by default.
102
+ */
103
+ pagination?: boolean;
104
+ /**
105
+ * The number of rows per page. 10 by default.
106
+ */
107
+ pageSize?: number;
108
+ /**
109
+ * The options for the number of rows per page. No options (empty array) by
110
+ * default.
111
+ */
112
+ rowsPerPageOptions?: number[];
113
+ }
114
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;AACtE,MAAM,MAAM,GAAG,GAAG,uBAAuB,CAAA;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAG3C,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,O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AE3B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { article_type, BackendArticle, website } from "../types";
2
+ export declare function filterArticles(articles: BackendArticle[], publish_on: website, type: article_type): BackendArticle[];
3
+ export default filterArticles;
4
+ //# sourceMappingURL=filterArticles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterArticles.d.ts","sourceRoot":"","sources":["../../src/utils/filterArticles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAC,MAAM,UAAU,CAAC;AAE/D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc,EAAE,CAEpH;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,5 @@
1
+ export function filterArticles(articles, publish_on, type) {
2
+ return articles.filter((x) => (x === null || x === void 0 ? void 0 : x.publish_on) && x.publish_on.includes(publish_on) && x.type == type);
3
+ }
4
+ export default filterArticles;
5
+ //# sourceMappingURL=filterArticles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterArticles.js","sourceRoot":"","sources":["../../src/utils/filterArticles.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,cAAc,CAAC,QAA0B,EAAE,UAAmB,EAAE,IAAkB;IACjG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAiB,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,UAAU,KAAI,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAA;AACpH,CAAC;AAED,eAAe,cAAc,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { BackendArticle } from "../types";
2
+ export declare function getArticle(organization: string, repo: string, path: string, branch: string): Promise<BackendArticle>;
3
+ export default getArticle;
4
+ //# sourceMappingURL=getArticle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getArticle.d.ts","sourceRoot":"","sources":["../../src/utils/getArticle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAsB,MAAM,UAAU,CAAC;AAI7D,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAmB1H;AAYD,eAAe,UAAU,CAAA"}
@@ -0,0 +1,43 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import matter from "gray-matter";
11
+ import { getRawFile } from "./getArticles";
12
+ export function getArticle(organization, repo, path, branch) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15
+ const text = yield getRawFile(organization, repo, path, branch);
16
+ const frontMatter = matter(text);
17
+ return {
18
+ path: path,
19
+ slug: getSlug(path),
20
+ date: getDate(path),
21
+ content: frontMatter.content,
22
+ title: (_a = frontMatter.data) === null || _a === void 0 ? void 0 : _a.title,
23
+ author: (_b = frontMatter.data) === null || _b === void 0 ? void 0 : _b.author,
24
+ publish_on: (_c = frontMatter.data) === null || _c === void 0 ? void 0 : _c.publish_on,
25
+ type: (_d = frontMatter.data) === null || _d === void 0 ? void 0 : _d.type,
26
+ tag: (_e = frontMatter.data) === null || _e === void 0 ? void 0 : _e.tag,
27
+ image: (_f = frontMatter.data) === null || _f === void 0 ? void 0 : _f.image,
28
+ excerpt: (_g = frontMatter.data) === null || _g === void 0 ? void 0 : _g.excerpt,
29
+ banner_src: (_h = frontMatter.data) === null || _h === void 0 ? void 0 : _h.banner_src,
30
+ banner_alt: (_j = frontMatter.data) === null || _j === void 0 ? void 0 : _j.banner_alt
31
+ };
32
+ });
33
+ }
34
+ function getSlug(path) {
35
+ const splitSlug = path.slice(0, -3).split("-");
36
+ return [splitSlug[0], splitSlug[1], splitSlug[2], splitSlug.slice(3).join("-")];
37
+ }
38
+ function getDate(path) {
39
+ const splitSlug = path.slice(0, -3).split("-");
40
+ return new Date(Date.parse(splitSlug.slice(0, 3).join("-")));
41
+ }
42
+ export default getArticle;
43
+ //# sourceMappingURL=getArticle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getArticle.js","sourceRoot":"","sources":["../../src/utils/getArticle.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAgB,UAAU,CAAC,YAAoB,EAAE,IAAY,EAAE,IAAY,EAAE,MAAc;;;QAChG,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QAC/D,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;QAEhC,OAAO;YACN,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,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,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC7D,CAAC;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { BackendArticle } from "../types";
2
+ export declare function getArticles(organization: string, repo: string, branch: string): Promise<BackendArticle[]>;
3
+ export declare function getTree(organization: string, repo: string, branch: string): Promise<GitTree>;
4
+ export declare function getPaths(tree: GitTree): string[];
5
+ export declare function getRawFile(organization: string, repo: string, path: string, branch: string): Promise<string>;
6
+ export interface GitHubReleaseData {
7
+ tag_name: string;
8
+ target_commitish: string;
9
+ body: string;
10
+ }
11
+ export interface ReleasePageProps {
12
+ releaseData: GitHubReleaseData;
13
+ }
14
+ export interface GithubMilestoneData {
15
+ title: string;
16
+ state: "open" | "closed";
17
+ created_at: string;
18
+ updated_at: string;
19
+ closed_at: string;
20
+ due_on: string;
21
+ }
22
+ interface GitTreeItem {
23
+ path: string;
24
+ mode: string;
25
+ type: string;
26
+ sha: string;
27
+ size: number;
28
+ url: string;
29
+ }
30
+ interface GitTree {
31
+ sha: string;
32
+ url: string;
33
+ tree: GitTreeItem[];
34
+ }
35
+ export default getArticles;
36
+ //# sourceMappingURL=getArticles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getArticles.d.ts","sourceRoot":"","sources":["../../src/utils/getArticles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AAQxC,wBAAsB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAU/G;AAED,wBAAsB,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKlG;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAI,MAAM,EAAE,CAEjD;AAED,wBAAsB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlH;AAED,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAChC,WAAW,EAAE,iBAAiB,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,UAAU,WAAW;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,UAAU,OAAO;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,EAAE,CAAC;CACpB;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,44 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import getArticle from "./getArticle";
11
+ function isArticle(path) {
12
+ const regex = /\d\d\d\d-\d\d?-\d\d?-.*?\.md/g;
13
+ return path.search(regex) != -1;
14
+ }
15
+ export function getArticles(organization, repo, branch) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const tree = yield getTree(organization, repo, branch);
18
+ const paths = getPaths(tree);
19
+ // Filter out the non-article paths and pull down and parse the remote files
20
+ return Promise.all(paths
21
+ .filter((path) => isArticle(path))
22
+ .map((path) => __awaiter(this, void 0, void 0, function* () { return yield getArticle(organization, repo, path, branch); })));
23
+ });
24
+ }
25
+ export function getTree(organization, repo, branch) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const url = `https://api.github.com/repos/${organization}/${repo}/git/trees/${branch}?recursive=1`;
28
+ const res = yield fetch(url);
29
+ const json = yield res.json();
30
+ return json;
31
+ });
32
+ }
33
+ export function getPaths(tree) {
34
+ return tree.tree.map((item) => item['path']);
35
+ }
36
+ export function getRawFile(organization, repo, path, branch) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const url = new URL(`https://raw.githubusercontent.com/${organization}/${repo}/${branch}/${path}`);
39
+ const res = yield fetch(url, { headers: { "Accept": "application/vnd.github.raw" } });
40
+ return yield res.text();
41
+ });
42
+ }
43
+ export default getArticles;
44
+ //# sourceMappingURL=getArticles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getArticles.js","sourceRoot":"","sources":["../../src/utils/getArticles.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,SAAS,SAAS,CAAC,IAAY;IAC9B,MAAM,KAAK,GAAG,+BAA+B,CAAA;IAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;AAChC,CAAC;AAED,MAAM,UAAgB,WAAW,CAAC,YAAoB,EAAE,IAAY,EAAE,MAAc;;QACnF,MAAM,IAA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CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;CAAA;AAoCD,eAAe,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { default as getArticles } from './getArticles';
2
+ export { default as filterArticles } from './filterArticles';
3
+ export { default as getArticle } from './getArticle';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as getArticles } from './getArticles';
2
+ export { default as filterArticles } from './filterArticles';
3
+ export { default as getArticle } from './getArticle';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,36 +1,38 @@
1
1
  {
2
2
  "name": "@chtc/web-components",
3
- "version": "0.0.0-3",
3
+ "version": "0.0.0-31",
4
4
  "description": "PATh Web Components",
5
- "main": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
6
7
  "scripts": {
7
8
  "test": "jest --coverage --json --outputFile=.github/tests/test-summary.json",
8
- "build": "tsc",
9
+ "build": "tsc --build src",
9
10
  "storybook": "storybook dev -p 6006",
10
11
  "build-storybook": "storybook build",
11
- "publish": "npm publish --access public",
12
- "publish:increment": "npm version prerelease --no-git-tag-version && npm publish --access public"
12
+ "publish:current": "npm publish --omit=dev --access public",
13
+ "publish:increment": "npm version prerelease --no-git-tag-version && npm publish --omit=dev --access public"
13
14
  },
14
15
  "files": [
15
- "src"
16
+ "dist"
16
17
  ],
17
18
  "author": "",
18
19
  "license": "Apache-2.0",
19
20
  "devDependencies": {
20
21
  "@babel/preset-typescript": "^7.23.3",
21
- "@chromatic-com/storybook": "^1.6.1",
22
- "@storybook/addon-essentials": "^8.1.11",
23
- "@storybook/addon-interactions": "^8.1.11",
24
- "@storybook/addon-links": "^8.1.11",
25
- "@storybook/addon-onboarding": "^8.1.11",
26
- "@storybook/blocks": "^8.1.11",
27
- "@storybook/nextjs": "^8.1.11",
28
- "@storybook/react": "^8.1.11",
29
- "@storybook/test": "^8.1.11",
22
+ "@chromatic-com/storybook": "^3.2.3",
23
+ "@storybook/addon-essentials": "^8.4.7",
24
+ "@storybook/addon-interactions": "^8.4.7",
25
+ "@storybook/addon-links": "^8.4.7",
26
+ "@storybook/addon-onboarding": "^8.4.7",
27
+ "@storybook/addon-themes": "^8.4.7",
28
+ "@storybook/blocks": "^8.4.7",
29
+ "@storybook/nextjs": "^8.4.7",
30
+ "@storybook/react": "^8.4.7",
31
+ "@storybook/test": "^8.4.7",
30
32
  "@types/jest": "^29.5.8",
31
33
  "jest": "^29.7.0",
32
34
  "jest-environment-jsdom": "^29.7.0",
33
- "storybook": "^8.1.11",
35
+ "storybook": "^8.4.7",
34
36
  "ts-jest": "^29.1.1",
35
37
  "typescript": "^5.2.2"
36
38
  },
@@ -38,6 +40,13 @@
38
40
  "@emotion/react": "^11.11.4",
39
41
  "@emotion/styled": "^11.11.5",
40
42
  "@mui/icons-material": "^5.16.0",
41
- "@mui/material": "^5.16.0"
43
+ "@mui/material": "^5.14.19",
44
+ "gray-matter": "^4.0.3",
45
+ "chart.js": "^4.4.7",
46
+ "colorjs.io": "^0.5.2",
47
+ "react-chartjs-2": "^5.3.0",
48
+ "react-markdown": "^9.0.1",
49
+ "react-wrap-balancer": "^1.1.1",
50
+ "rehype-raw": "^7.0.0"
42
51
  }
43
52
  }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './layout'
@@ -1,101 +0,0 @@
1
- 'use client';
2
- import React, {useState} from "react";
3
- import {Box,Typography, IconButton, Drawer, Divider, List, ListSubheader} from "@mui/material";
4
- import MenuIcon from '@mui/icons-material/Menu';
5
- import {
6
- Home, GitHub, Description, Groups, Email, Help, Group, Info, Grade, Newspaper, Close, Terminal, CalendarMonth, FileDownload
7
- } from "@mui/icons-material";
8
- import { HeaderDropdown, HeaderLink, HeaderMainLink } from "./HeaderDropdown";
9
- import { HeaderLinkItem, HeaderMenuProps } from "./index";
10
-
11
- export const BurgerMenu = ({menuItems} : {menuItems: (Omit<HeaderMenuProps, "setAnchor" | "anchorEl"> | HeaderLinkItem)[]}) => {
12
- const [openDrawer, setOpenDrawer] = useState(false);
13
-
14
- const handleDrawer = () => {
15
- setOpenDrawer(!openDrawer);
16
- };
17
-
18
- return (
19
- <Box ml={"auto"}>
20
- <IconButton
21
- aria-label="menu"
22
- onClick={handleDrawer}
23
- >
24
- <MenuIcon/>
25
- </IconButton>
26
- <Drawer anchor={"right"} open={openDrawer} onClose={handleDrawer}
27
- sx={{
28
- "& .MuiDrawer-paper": {
29
- boxSizing: "border-box",
30
- width: "100%",
31
- "@media (min-width: 576px)": {
32
- width: "30rem",
33
- }
34
- },
35
- boxShadow: "0px 0px 10px rgba(0, 0, 0, 0.25)",
36
- backdropFilter: "blur(2px)",
37
- WebkitBackdropFilter: "blur(2px)",
38
- backgroundColor: "rgba(255, 255, 255, 0.5)",
39
- }}
40
- >
41
- <List
42
- sx={{margin: "1rem" }}
43
- component="nav"
44
- aria-labelledby="nested-list-subheader"
45
- subheader={
46
- <ListSubheader component="div" id="nested-list-subheader">
47
- <Box style={{display: "flex", flexDirection:"row", justifyContent:"start" }}>
48
- <img src={PelicanLogo} alt={"Pelican Logo"} height={48}/>
49
- <Typography variant={"h5"} pl={1} my={"auto"}>Pelican Platform</Typography>
50
- <IconButton
51
- sx={{ml: "auto"}}
52
- edge="start"
53
- color="inherit"
54
- aria-label="menu"
55
- onClick={handleDrawer}
56
- >
57
- <Close sx={{fontSize:"2rem"}}/>
58
- </IconButton>
59
- </Box>
60
- </ListSubheader>
61
- }
62
- >
63
- <Divider sx={{my:2}}/>
64
- {menuItems.map((item) => {
65
- if ('menuItems' in item) {
66
- // This is a dropdown item
67
- return (
68
- <HeaderDropdown key={item.value} value={item.value} icon={item.icon}>
69
- {item.menuItems.map((subItem) => (
70
- <HeaderLink
71
- key={item.value}
72
- value={subItem.value}
73
- href={subItem.href}
74
- icon={subItem.icon}
75
- target={subItem?.target}
76
- onClick={handleDrawer}
77
- />
78
- ))}
79
- </HeaderDropdown>
80
- );
81
- } else {
82
- // This is a main link item
83
- return (
84
- <HeaderMainLink
85
- key={item.value}
86
- value={item.value}
87
- href={item.href}
88
- icon={item.icon}
89
- target={item.target}
90
- onClick={handleDrawer}
91
- />
92
- );
93
- }
94
- })}
95
- </List>
96
- </Drawer>
97
- </Box>
98
- );
99
- }
100
-
101
- export default BurgerMenu;
@@ -1,50 +0,0 @@
1
- 'use client'
2
-
3
- import {useState, ReactNode, useRef, ComponentType} from "react";
4
- import {Box, Button, Grid, IconButton, Menu, MenuItem, Tooltip, IconProps} from "@mui/material"
5
-
6
- import {HeaderItem} from "./HeaderItem";
7
-
8
- import type {HeaderLinkItem, MenuProps} from "./index.d";
9
-
10
- export const DesktopMenu = ({menuItems} : {menuItems: MenuProps[]}) => {
11
-
12
- const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
13
-
14
- return (
15
- <>
16
- <Box display={"flex"} mb={.5}>
17
- {menuItems.filter(x => "type" in x ? x?.type != "icon" : true).map((item) => (
18
- <HeaderItem
19
- key={item.value}
20
- {...item}
21
- anchorEl={anchorEl}
22
- setAnchor={(element) => {
23
- setAnchorEl((anchorEl) => {
24
- if(element == null) {
25
- return element
26
- }
27
- if(anchorEl?.id == element.id) {
28
- return null
29
- }
30
- return element
31
- })
32
- }}
33
- />
34
- ))}
35
- </Box>
36
- <Box marginLeft={"auto"}>
37
- <Grid container spacing={1}>
38
- {menuItems.filter(x => "type" in x ? x?.type == "icon" : false).map((item) => (
39
- <Grid key={item.value} item>
40
- <HeaderIconLink
41
- {...item as HeaderLinkItem}
42
- />
43
- </Grid>
44
- ))}
45
- </Grid>
46
- </Box>
47
- </>
48
- )
49
- }
50
-