@sp-days-framework/docusaurus-frontpage-collection 1.0.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.
- package/LICENSE +21 -0
- package/README.md +339 -0
- package/lib/components/Block/index.d.ts +22 -0
- package/lib/components/Block/index.d.ts.map +1 -0
- package/lib/components/Block/index.js +32 -0
- package/lib/components/Block/index.js.map +1 -0
- package/lib/components/Block/styles.module.css +26 -0
- package/lib/components/Columns/index.d.ts +68 -0
- package/lib/components/Columns/index.d.ts.map +1 -0
- package/lib/components/Columns/index.js +119 -0
- package/lib/components/Columns/index.js.map +1 -0
- package/lib/components/Columns/styles.module.css +196 -0
- package/lib/components/CourseFeature/index.d.ts +99 -0
- package/lib/components/CourseFeature/index.d.ts.map +1 -0
- package/lib/components/CourseFeature/index.js +188 -0
- package/lib/components/CourseFeature/index.js.map +1 -0
- package/lib/components/CourseFeature/styles.module.css +204 -0
- package/lib/components/FancyHeader/index.d.ts +24 -0
- package/lib/components/FancyHeader/index.d.ts.map +1 -0
- package/lib/components/FancyHeader/index.js +32 -0
- package/lib/components/FancyHeader/index.js.map +1 -0
- package/lib/components/FancyHeader/styles.module.css +23 -0
- package/lib/components/GetStarted/index.d.ts +99 -0
- package/lib/components/GetStarted/index.d.ts.map +1 -0
- package/lib/components/GetStarted/index.js +127 -0
- package/lib/components/GetStarted/index.js.map +1 -0
- package/lib/components/GetStarted/styles.module.css +174 -0
- package/lib/components/HeroBanner/DotCrossGrid.d.ts +25 -0
- package/lib/components/HeroBanner/DotCrossGrid.d.ts.map +1 -0
- package/lib/components/HeroBanner/DotCrossGrid.js +283 -0
- package/lib/components/HeroBanner/DotCrossGrid.js.map +1 -0
- package/lib/components/HeroBanner/DotCrossGrid.module.css +9 -0
- package/lib/components/HeroBanner/index.d.ts +42 -0
- package/lib/components/HeroBanner/index.d.ts.map +1 -0
- package/lib/components/HeroBanner/index.js +116 -0
- package/lib/components/HeroBanner/index.js.map +1 -0
- package/lib/components/HeroBanner/styles.module.css +204 -0
- package/lib/components/IconContainer/index.d.ts +76 -0
- package/lib/components/IconContainer/index.d.ts.map +1 -0
- package/lib/components/IconContainer/index.js +119 -0
- package/lib/components/IconContainer/index.js.map +1 -0
- package/lib/components/IconContainer/styles.module.css +147 -0
- package/lib/components/Iconify/index.d.ts +56 -0
- package/lib/components/Iconify/index.d.ts.map +1 -0
- package/lib/components/Iconify/index.js +88 -0
- package/lib/components/Iconify/index.js.map +1 -0
- package/lib/components/Iconify/styles.module.css +30 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +73 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/IconifyIcon.d.ts +17 -0
- package/lib/utils/IconifyIcon.d.ts.map +1 -0
- package/lib/utils/IconifyIcon.js +26 -0
- package/lib/utils/IconifyIcon.js.map +1 -0
- package/lib/utils/InlineSvg.d.ts +29 -0
- package/lib/utils/InlineSvg.d.ts.map +1 -0
- package/lib/utils/InlineSvg.js +90 -0
- package/lib/utils/InlineSvg.js.map +1 -0
- package/lib/utils/ThemedIcon.d.ts +61 -0
- package/lib/utils/ThemedIcon.d.ts.map +1 -0
- package/lib/utils/ThemedIcon.js +128 -0
- package/lib/utils/ThemedIcon.js.map +1 -0
- package/lib/utils/constants.d.ts +23 -0
- package/lib/utils/constants.d.ts.map +1 -0
- package/lib/utils/constants.js +36 -0
- package/lib/utils/constants.js.map +1 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/logger.d.ts +21 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +38 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/types.d.ts +129 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +6 -0
- package/lib/utils/types.js.map +1 -0
- package/package.json +73 -0
package/lib/index.js.map
ADDED
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AEpB,4DAAqF;AAA5E,8IAAA,OAAO,OAAgC;AAMhD,oBAAoB;AACpB,gDAA+C;AAAtC,kGAAA,OAAO,OAAA;AAChB,gDAAiE;AAAxD,0HAAA,OAAO,OAAkB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconifyIconProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* IconifyIcon Component
|
|
5
|
+
*
|
|
6
|
+
* A wrapper around @iconify/react Icon component with sensible defaults.
|
|
7
|
+
* Supports rendering any icon from Iconify's vast collection.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <IconifyIcon icon="mdi-light:home" color="#1976d2" width={24} height={24} />
|
|
12
|
+
* <IconifyIcon icon="simple-icons:github" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const IconifyIcon: React.FC<IconifyIconProps>;
|
|
16
|
+
export default IconifyIcon;
|
|
17
|
+
//# sourceMappingURL=IconifyIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconifyIcon.d.ts","sourceRoot":"","sources":["../../src/utils/IconifyIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkBlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IconifyIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_2 = require("@iconify/react");
|
|
9
|
+
/**
|
|
10
|
+
* IconifyIcon Component
|
|
11
|
+
*
|
|
12
|
+
* A wrapper around @iconify/react Icon component with sensible defaults.
|
|
13
|
+
* Supports rendering any icon from Iconify's vast collection.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <IconifyIcon icon="mdi-light:home" color="#1976d2" width={24} height={24} />
|
|
18
|
+
* <IconifyIcon icon="simple-icons:github" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const IconifyIcon = ({ icon, color, width = 24, height = 24, className, style, }) => {
|
|
22
|
+
return (react_1.default.createElement(react_2.Icon, { icon: icon, color: color, width: width, height: height, className: className, style: style }));
|
|
23
|
+
};
|
|
24
|
+
exports.IconifyIcon = IconifyIcon;
|
|
25
|
+
exports.default = exports.IconifyIcon;
|
|
26
|
+
//# sourceMappingURL=IconifyIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconifyIcon.js","sourceRoot":"","sources":["../../src/utils/IconifyIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,0CAAsC;AAGtC;;;;;;;;;;;GAWG;AACI,MAAM,WAAW,GAA+B,CAAC,EACtD,IAAI,EACJ,KAAK,EACL,KAAK,GAAG,EAAE,EACV,MAAM,GAAG,EAAE,EACX,SAAS,EACT,KAAK,GACN,EAAE,EAAE;IACH,OAAO,CACL,8BAAC,YAAI,IACH,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,WAAW,eAkBtB;AAEF,kBAAe,mBAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface InlineSvgProps {
|
|
3
|
+
/** Path to the SVG file */
|
|
4
|
+
src: string;
|
|
5
|
+
/** Alt text for accessibility */
|
|
6
|
+
alt?: string;
|
|
7
|
+
/** Additional CSS class */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Additional inline styles */
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* InlineSvg Component
|
|
14
|
+
*
|
|
15
|
+
* Fetches an SVG file and renders it inline as HTML.
|
|
16
|
+
* This allows CSS color properties (like currentColor) to work properly.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <InlineSvg
|
|
21
|
+
* src="/img/icon.svg"
|
|
22
|
+
* alt="My Icon"
|
|
23
|
+
* className="my-icon"
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const InlineSvg: React.FC<InlineSvgProps>;
|
|
28
|
+
export default InlineSvg;
|
|
29
|
+
//# sourceMappingURL=InlineSvg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineSvg.d.ts","sourceRoot":"","sources":["../../src/utils/InlineSvg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA2D9C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.InlineSvg = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const logger_1 = require("./logger");
|
|
39
|
+
/**
|
|
40
|
+
* InlineSvg Component
|
|
41
|
+
*
|
|
42
|
+
* Fetches an SVG file and renders it inline as HTML.
|
|
43
|
+
* This allows CSS color properties (like currentColor) to work properly.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <InlineSvg
|
|
48
|
+
* src="/img/icon.svg"
|
|
49
|
+
* alt="My Icon"
|
|
50
|
+
* className="my-icon"
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
const InlineSvg = ({ src, alt = '', className, style, }) => {
|
|
55
|
+
const [svgContent, setSvgContent] = (0, react_1.useState)('');
|
|
56
|
+
const [error, setError] = (0, react_1.useState)(false);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
const fetchSvg = async () => {
|
|
59
|
+
try {
|
|
60
|
+
const response = await fetch(src);
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
throw new Error(`Failed to fetch SVG: ${response.statusText}`);
|
|
63
|
+
}
|
|
64
|
+
const text = await response.text();
|
|
65
|
+
// Basic validation: check if it's actually SVG content
|
|
66
|
+
if (!text.trim().startsWith('<svg')) {
|
|
67
|
+
throw new Error('Fetched content is not a valid SVG');
|
|
68
|
+
}
|
|
69
|
+
setSvgContent(text);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
(0, logger_1.logWarn)(`Failed to load inline SVG from "${src}": ${err instanceof Error ? err.message : 'Unknown error'}`);
|
|
73
|
+
setError(true);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
fetchSvg();
|
|
77
|
+
}, [src]);
|
|
78
|
+
if (error) {
|
|
79
|
+
// Fallback to regular img tag if SVG fetch fails
|
|
80
|
+
return (react_1.default.createElement("img", { src: src, alt: alt, className: className, style: style }));
|
|
81
|
+
}
|
|
82
|
+
if (!svgContent) {
|
|
83
|
+
// Loading state - render empty div with same dimensions
|
|
84
|
+
return react_1.default.createElement("div", { className: className, style: style });
|
|
85
|
+
}
|
|
86
|
+
return (react_1.default.createElement("div", { className: className, style: style, dangerouslySetInnerHTML: { __html: svgContent }, role: "img", "aria-label": alt }));
|
|
87
|
+
};
|
|
88
|
+
exports.InlineSvg = InlineSvg;
|
|
89
|
+
exports.default = exports.InlineSvg;
|
|
90
|
+
//# sourceMappingURL=InlineSvg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineSvg.js","sourceRoot":"","sources":["../../src/utils/InlineSvg.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmD;AACnD,qCAAmC;AAanC;;;;;;;;;;;;;;GAcG;AACI,MAAM,SAAS,GAA6B,CAAC,EAClD,GAAG,EACH,GAAG,GAAG,EAAE,EACR,SAAS,EACT,KAAK,GACN,EAAE,EAAE;IACH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACzD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAEnD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;YAC1B,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;gBACjE,CAAC;gBACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAEnC,uDAAuD;gBACvD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;oBACpC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBACxD,CAAC;gBAED,aAAa,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAA,gBAAO,EAAC,mCAAmC,GAAG,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;gBAC5G,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,EAAE,CAAC;IACb,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,IAAI,KAAK,EAAE,CAAC;QACV,iDAAiD;QACjD,OAAO,CACL,uCACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,wDAAwD;QACxD,OAAO,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;IACrD,CAAC;IAED,OAAO,CACL,uCACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,uBAAuB,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAC/C,IAAI,EAAC,KAAK,gBACE,GAAG,GACf,CACH,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,SAAS,aA2DpB;AAEF,kBAAe,iBAAS,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ThemedIconProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ThemedIcon Component
|
|
5
|
+
*
|
|
6
|
+
* A flexible icon component that supports:
|
|
7
|
+
* - Iconify icons with theme-aware colors and hover states
|
|
8
|
+
* - Custom SVG files (inline rendering with color support via currentColor)
|
|
9
|
+
* - Custom images (PNG/JPEG with theme variants, no color override)
|
|
10
|
+
* - Auto-detection of theme mode
|
|
11
|
+
* - Validation and fallback rendering
|
|
12
|
+
*
|
|
13
|
+
* Priority: iconify > customSvg > customImage
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Using Iconify icon (string shorthand)
|
|
18
|
+
* <ThemedIcon iconify="mdi:check-circle" />
|
|
19
|
+
*
|
|
20
|
+
* // Using Iconify with custom config
|
|
21
|
+
* <ThemedIcon
|
|
22
|
+
* iconify={{
|
|
23
|
+
* icon: "mdi:home",
|
|
24
|
+
* width: 32,
|
|
25
|
+
* height: 32,
|
|
26
|
+
* colors: {
|
|
27
|
+
* light: "#1976d2",
|
|
28
|
+
* lightHover: "#115293",
|
|
29
|
+
* dark: "#90caf9",
|
|
30
|
+
* darkHover: "#b3d9ff"
|
|
31
|
+
* }
|
|
32
|
+
* }}
|
|
33
|
+
* supportsHover={true}
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* // Using custom SVG (inline, supports currentColor)
|
|
37
|
+
* <ThemedIcon customSvg="/img/icon.svg" />
|
|
38
|
+
*
|
|
39
|
+
* // Using custom SVG with theme variants
|
|
40
|
+
* <ThemedIcon
|
|
41
|
+
* customSvg={{
|
|
42
|
+
* light: "/img/icon-light.svg",
|
|
43
|
+
* dark: "/img/icon-dark.svg"
|
|
44
|
+
* }}
|
|
45
|
+
* />
|
|
46
|
+
*
|
|
47
|
+
* // Using custom image (no color override)
|
|
48
|
+
* <ThemedIcon customImage="/img/icon.png" />
|
|
49
|
+
*
|
|
50
|
+
* // Using custom image with theme variants
|
|
51
|
+
* <ThemedIcon
|
|
52
|
+
* customImage={{
|
|
53
|
+
* light: "/img/icon-light.png",
|
|
54
|
+
* dark: "/img/icon-dark.png"
|
|
55
|
+
* }}
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const ThemedIcon: React.FC<ThemedIconProps>;
|
|
60
|
+
export default ThemedIcon;
|
|
61
|
+
//# sourceMappingURL=ThemedIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemedIcon.d.ts","sourceRoot":"","sources":["../../src/utils/ThemedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAkC,MAAM,SAAS,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmHhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ThemedIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
9
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
10
|
+
const IconifyIcon_1 = require("./IconifyIcon");
|
|
11
|
+
const InlineSvg_1 = require("./InlineSvg");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const logger_1 = require("./logger");
|
|
14
|
+
/**
|
|
15
|
+
* ThemedIcon Component
|
|
16
|
+
*
|
|
17
|
+
* A flexible icon component that supports:
|
|
18
|
+
* - Iconify icons with theme-aware colors and hover states
|
|
19
|
+
* - Custom SVG files (inline rendering with color support via currentColor)
|
|
20
|
+
* - Custom images (PNG/JPEG with theme variants, no color override)
|
|
21
|
+
* - Auto-detection of theme mode
|
|
22
|
+
* - Validation and fallback rendering
|
|
23
|
+
*
|
|
24
|
+
* Priority: iconify > customSvg > customImage
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* // Using Iconify icon (string shorthand)
|
|
29
|
+
* <ThemedIcon iconify="mdi:check-circle" />
|
|
30
|
+
*
|
|
31
|
+
* // Using Iconify with custom config
|
|
32
|
+
* <ThemedIcon
|
|
33
|
+
* iconify={{
|
|
34
|
+
* icon: "mdi:home",
|
|
35
|
+
* width: 32,
|
|
36
|
+
* height: 32,
|
|
37
|
+
* colors: {
|
|
38
|
+
* light: "#1976d2",
|
|
39
|
+
* lightHover: "#115293",
|
|
40
|
+
* dark: "#90caf9",
|
|
41
|
+
* darkHover: "#b3d9ff"
|
|
42
|
+
* }
|
|
43
|
+
* }}
|
|
44
|
+
* supportsHover={true}
|
|
45
|
+
* />
|
|
46
|
+
*
|
|
47
|
+
* // Using custom SVG (inline, supports currentColor)
|
|
48
|
+
* <ThemedIcon customSvg="/img/icon.svg" />
|
|
49
|
+
*
|
|
50
|
+
* // Using custom SVG with theme variants
|
|
51
|
+
* <ThemedIcon
|
|
52
|
+
* customSvg={{
|
|
53
|
+
* light: "/img/icon-light.svg",
|
|
54
|
+
* dark: "/img/icon-dark.svg"
|
|
55
|
+
* }}
|
|
56
|
+
* />
|
|
57
|
+
*
|
|
58
|
+
* // Using custom image (no color override)
|
|
59
|
+
* <ThemedIcon customImage="/img/icon.png" />
|
|
60
|
+
*
|
|
61
|
+
* // Using custom image with theme variants
|
|
62
|
+
* <ThemedIcon
|
|
63
|
+
* customImage={{
|
|
64
|
+
* light: "/img/icon-light.png",
|
|
65
|
+
* dark: "/img/icon-dark.png"
|
|
66
|
+
* }}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
const ThemedIcon = ({ iconify, customSvg, customImage, alt = '', className, style, disableAnimation = false, supportsHover = false, }) => {
|
|
71
|
+
const isBrowser = (0, useIsBrowser_1.default)();
|
|
72
|
+
const { colorMode } = (0, theme_common_1.useColorMode)();
|
|
73
|
+
const isDarkTheme = isBrowser ? colorMode === 'dark' : false;
|
|
74
|
+
// Validation: Check mutual exclusivity and priority
|
|
75
|
+
const providedProps = [iconify, customSvg, customImage].filter(Boolean);
|
|
76
|
+
if (providedProps.length > 1) {
|
|
77
|
+
(0, logger_1.logWarn)('Multiple icon props provided (iconify, customSvg, customImage). Using priority: iconify > customSvg > customImage.');
|
|
78
|
+
}
|
|
79
|
+
else if (providedProps.length === 0) {
|
|
80
|
+
(0, logger_1.logWarn)('No icon props provided (iconify, customSvg, customImage). Rendering fallback image-not-found icon.');
|
|
81
|
+
return (react_1.default.createElement("div", { className: className, style: style, dangerouslySetInnerHTML: { __html: constants_1.IMAGE_NOT_FOUND_SVG } }));
|
|
82
|
+
}
|
|
83
|
+
// Priority 1: Iconify icon
|
|
84
|
+
if (iconify) {
|
|
85
|
+
// Normalize iconify to IconifyConfig
|
|
86
|
+
const iconifyConfig = typeof iconify === 'string'
|
|
87
|
+
? { icon: iconify }
|
|
88
|
+
: iconify;
|
|
89
|
+
// Build color configuration
|
|
90
|
+
const colors = iconifyConfig.colors || {};
|
|
91
|
+
const lightColor = colors.light || constants_1.DEFAULT_ICON_COLORS.light;
|
|
92
|
+
const lightHoverColor = colors.lightHover || constants_1.DEFAULT_ICON_COLORS.lightHover;
|
|
93
|
+
const darkColor = colors.dark || colors.light || constants_1.DEFAULT_ICON_COLORS.light;
|
|
94
|
+
const darkHoverColor = colors.darkHover || colors.lightHover || constants_1.DEFAULT_ICON_COLORS.lightHover;
|
|
95
|
+
// Determine current color (non-hover)
|
|
96
|
+
const currentColor = isDarkTheme ? darkColor : lightColor;
|
|
97
|
+
// If hover is supported, wrap in div with CSS custom properties
|
|
98
|
+
if (supportsHover) {
|
|
99
|
+
const cssVars = {
|
|
100
|
+
'--icon-color': isDarkTheme ? darkColor : lightColor,
|
|
101
|
+
'--icon-color-hover': isDarkTheme ? darkHoverColor : lightHoverColor,
|
|
102
|
+
};
|
|
103
|
+
return (react_1.default.createElement("div", { className: `${className || ''} ${disableAnimation ? 'disable-animation' : ''}`.trim(), style: { ...cssVars, ...style } },
|
|
104
|
+
react_1.default.createElement(IconifyIcon_1.IconifyIcon, { icon: iconifyConfig.icon, color: "currentColor", width: iconifyConfig.width, height: iconifyConfig.height })));
|
|
105
|
+
}
|
|
106
|
+
// No hover support - just render the icon directly
|
|
107
|
+
return (react_1.default.createElement(IconifyIcon_1.IconifyIcon, { icon: iconifyConfig.icon, color: currentColor, width: iconifyConfig.width, height: iconifyConfig.height, className: className, style: style }));
|
|
108
|
+
}
|
|
109
|
+
// Priority 2: Custom SVG (inline rendering with color support)
|
|
110
|
+
if (customSvg) {
|
|
111
|
+
const svgSrc = typeof customSvg === 'string'
|
|
112
|
+
? customSvg
|
|
113
|
+
: (isDarkTheme ? customSvg.dark : customSvg.light);
|
|
114
|
+
return (react_1.default.createElement(InlineSvg_1.InlineSvg, { src: svgSrc, alt: alt, className: className, style: style }));
|
|
115
|
+
}
|
|
116
|
+
// Priority 3: Custom Image (img tag, no color override)
|
|
117
|
+
if (customImage) {
|
|
118
|
+
const imageSrc = typeof customImage === 'string'
|
|
119
|
+
? customImage
|
|
120
|
+
: (isDarkTheme ? customImage.dark : customImage.light);
|
|
121
|
+
return (react_1.default.createElement("img", { src: imageSrc, alt: alt, className: className, style: style }));
|
|
122
|
+
}
|
|
123
|
+
// Should never reach here due to validation above
|
|
124
|
+
return null;
|
|
125
|
+
};
|
|
126
|
+
exports.ThemedIcon = ThemedIcon;
|
|
127
|
+
exports.default = exports.ThemedIcon;
|
|
128
|
+
//# sourceMappingURL=ThemedIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemedIcon.js","sourceRoot":"","sources":["../../src/utils/ThemedIcon.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4EAAoD;AACpD,2DAAwD;AACxD,+CAA4C;AAC5C,2CAAwC;AACxC,2CAAuE;AACvE,qCAAmC;AAGnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CACH,CAAC;IACJ,CAAC;IAED,+DAA+D;IAC/D,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,OAAO,SAAS,KAAK,QAAQ;YAC1C,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAErD,OAAO,CACL,8BAAC,qBAAS,IACR,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;IAED,wDAAwD;IACxD,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,QAAQ,GAAG,OAAO,WAAW,KAAK,QAAQ;YAC9C,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzD,OAAO,CACL,uCACE,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;IACJ,CAAC;IAED,kDAAkD;IAClD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnHW,QAAA,UAAU,cAmHrB;AAEF,kBAAe,kBAAU,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for the component collection
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Fallback SVG for when icon configuration is invalid
|
|
6
|
+
* (e.g., both iconify and customIcon provided, or neither)
|
|
7
|
+
*/
|
|
8
|
+
export declare const IMAGE_NOT_FOUND_SVG: string;
|
|
9
|
+
/**
|
|
10
|
+
* Default icon color configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_ICON_COLORS: {
|
|
13
|
+
readonly light: "var(--ifm-color-emphasis-600)";
|
|
14
|
+
readonly lightHover: "var(--ifm-color-primary)";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Default title color configuration (same as icon colors)
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_TITLE_COLORS: {
|
|
20
|
+
readonly light: "var(--ifm-color-emphasis-600)";
|
|
21
|
+
readonly lightHover: "var(--ifm-color-primary)";
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAQxB,CAAC;AAET;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAItB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;CAIvB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared constants for the component collection
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_TITLE_COLORS = exports.DEFAULT_ICON_COLORS = exports.IMAGE_NOT_FOUND_SVG = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Fallback SVG for when icon configuration is invalid
|
|
9
|
+
* (e.g., both iconify and customIcon provided, or neither)
|
|
10
|
+
*/
|
|
11
|
+
exports.IMAGE_NOT_FOUND_SVG = `
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="color: var(--ifm-color-warning)">
|
|
13
|
+
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">
|
|
14
|
+
<path d="M15.5 8a.5.5 0 0 0 0-1m0 1a.5.5 0 0 1 0-1m0 1V7M2 2l20 20"/>
|
|
15
|
+
<path d="M17.3 21.3c-1.281.2-2.97.2-5.3.2c-4.23 0-6.345 0-7.747-1.198q-.3-.256-.555-.555C2.5 18.345 2.5 16.23 2.5 12c0-2.33 0-4.019.2-5.3m17.335 13.335q.14-.138.267-.288C21.5 18.345 21.5 16.23 21.5 12s0-6.345-1.198-7.747q-.256-.3-.555-.555C18.345 2.5 16.23 2.5 12 2.5s-6.345 0-7.747 1.198q-.15.128-.289.266"/>
|
|
16
|
+
<path d="m3 16l4.5-4.5M21 16l-2.47-2.47a1.81 1.81 0 0 0-2.56 0l-1.22 1.22"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
19
|
+
`.trim();
|
|
20
|
+
/**
|
|
21
|
+
* Default icon color configuration
|
|
22
|
+
*/
|
|
23
|
+
exports.DEFAULT_ICON_COLORS = {
|
|
24
|
+
light: "var(--ifm-color-emphasis-600)",
|
|
25
|
+
lightHover: "var(--ifm-color-primary)",
|
|
26
|
+
// dark and darkHover default to light values if not specified
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Default title color configuration (same as icon colors)
|
|
30
|
+
*/
|
|
31
|
+
exports.DEFAULT_TITLE_COLORS = {
|
|
32
|
+
light: "var(--ifm-color-emphasis-600)",
|
|
33
|
+
lightHover: "var(--ifm-color-primary)",
|
|
34
|
+
// dark and darkHover default to light values if not specified
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;;GAGG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;CAQlC,CAAC,IAAI,EAAE,CAAC;AAET;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,KAAK,EAAE,+BAA+B;IACtC,UAAU,EAAE,0BAA0B;IACtC,8DAA8D;CACtD,CAAC;AAEX;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,KAAK,EAAE,+BAA+B;IACtC,UAAU,EAAE,0BAA0B;IACtC,8DAA8D;CACtD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility exports for the component collection
|
|
3
|
+
*/
|
|
4
|
+
export { IconifyIcon } from "./IconifyIcon";
|
|
5
|
+
export { ThemedIcon } from "./ThemedIcon";
|
|
6
|
+
export { logWarn, logError, logInfo } from "./logger";
|
|
7
|
+
export { IMAGE_NOT_FOUND_SVG, DEFAULT_ICON_COLORS, DEFAULT_TITLE_COLORS, } from "./constants";
|
|
8
|
+
export type { IconifyConfig, CustomSvgConfig, CustomImageConfig, IconColorConfig, TitleColorConfig, IconifyImageColorConfig, IconifyIconProps, ThemedIconProps, } from "./types";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utility exports for the component collection
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_TITLE_COLORS = exports.DEFAULT_ICON_COLORS = exports.IMAGE_NOT_FOUND_SVG = exports.logInfo = exports.logError = exports.logWarn = exports.ThemedIcon = exports.IconifyIcon = void 0;
|
|
7
|
+
var IconifyIcon_1 = require("./IconifyIcon");
|
|
8
|
+
Object.defineProperty(exports, "IconifyIcon", { enumerable: true, get: function () { return IconifyIcon_1.IconifyIcon; } });
|
|
9
|
+
var ThemedIcon_1 = require("./ThemedIcon");
|
|
10
|
+
Object.defineProperty(exports, "ThemedIcon", { enumerable: true, get: function () { return ThemedIcon_1.ThemedIcon; } });
|
|
11
|
+
var logger_1 = require("./logger");
|
|
12
|
+
Object.defineProperty(exports, "logWarn", { enumerable: true, get: function () { return logger_1.logWarn; } });
|
|
13
|
+
Object.defineProperty(exports, "logError", { enumerable: true, get: function () { return logger_1.logError; } });
|
|
14
|
+
Object.defineProperty(exports, "logInfo", { enumerable: true, get: function () { return logger_1.logInfo; } });
|
|
15
|
+
var constants_1 = require("./constants");
|
|
16
|
+
Object.defineProperty(exports, "IMAGE_NOT_FOUND_SVG", { enumerable: true, get: function () { return constants_1.IMAGE_NOT_FOUND_SVG; } });
|
|
17
|
+
Object.defineProperty(exports, "DEFAULT_ICON_COLORS", { enumerable: true, get: function () { return constants_1.DEFAULT_ICON_COLORS; } });
|
|
18
|
+
Object.defineProperty(exports, "DEFAULT_TITLE_COLORS", { enumerable: true, get: function () { return constants_1.DEFAULT_TITLE_COLORS; } });
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,mCAAsD;AAA7C,iGAAA,OAAO,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAAE,iGAAA,OAAO,OAAA;AACnC,yCAIqB;AAHnB,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AACnB,iHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Collection Logger
|
|
3
|
+
* Browser-compatible logger for consistent runtime warnings and errors
|
|
4
|
+
* (This runs in the browser, not Node.js build time)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Log warning message to browser console
|
|
8
|
+
* Format: [Frontpage] [WARN] message
|
|
9
|
+
*/
|
|
10
|
+
export declare function logWarn(message: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Log error message to browser console
|
|
13
|
+
* Format: [Frontpage] [ERROR] message
|
|
14
|
+
*/
|
|
15
|
+
export declare function logError(message: string, error?: any): void;
|
|
16
|
+
/**
|
|
17
|
+
* Log info message to browser console (for development)
|
|
18
|
+
* Format: [Frontpage] [INFO] message
|
|
19
|
+
*/
|
|
20
|
+
export declare function logInfo(message: string): void;
|
|
21
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI,CAK3D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI7C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Component Collection Logger
|
|
4
|
+
* Browser-compatible logger for consistent runtime warnings and errors
|
|
5
|
+
* (This runs in the browser, not Node.js build time)
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.logWarn = logWarn;
|
|
9
|
+
exports.logError = logError;
|
|
10
|
+
exports.logInfo = logInfo;
|
|
11
|
+
const COMPONENT_PREFIX = "[Frontpage]";
|
|
12
|
+
/**
|
|
13
|
+
* Log warning message to browser console
|
|
14
|
+
* Format: [Frontpage] [WARN] message
|
|
15
|
+
*/
|
|
16
|
+
function logWarn(message) {
|
|
17
|
+
console.warn(`${COMPONENT_PREFIX} [WARN]`, message);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Log error message to browser console
|
|
21
|
+
* Format: [Frontpage] [ERROR] message
|
|
22
|
+
*/
|
|
23
|
+
function logError(message, error) {
|
|
24
|
+
console.error(`${COMPONENT_PREFIX} [ERROR]`, message);
|
|
25
|
+
if (error) {
|
|
26
|
+
console.error(error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Log info message to browser console (for development)
|
|
31
|
+
* Format: [Frontpage] [INFO] message
|
|
32
|
+
*/
|
|
33
|
+
function logInfo(message) {
|
|
34
|
+
if (process.env.NODE_ENV === "development") {
|
|
35
|
+
console.info(`${COMPONENT_PREFIX} [INFO]`, message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAQH,0BAEC;AAMD,4BAKC;AAMD,0BAIC;AA7BD,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,OAAO,CAAC,IAAI,CAAC,GAAG,gBAAgB,SAAS,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,KAAW;IACnD,OAAO,CAAC,KAAK,CAAC,GAAG,gBAAgB,UAAU,EAAE,OAAO,CAAC,CAAC;IACtD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,GAAG,gBAAgB,SAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|