blue-chestnut-solar-expert 0.0.32 → 0.0.34
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/dist/cjs/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/eraser-icon_16.cjs.entry.js +118 -62
- package/dist/cjs/eraser-icon_16.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-elxiOP_I.js → index-C3Kp1xqq.js} +5 -28
- package/dist/cjs/index-C3Kp1xqq.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loading-widget.cjs.entry.js +1 -1
- package/dist/cjs/solar-calculator.cjs.entry.js +1 -1
- package/dist/cjs/stencil-library.cjs.js +2 -2
- package/dist/collection/components/map-draw/map-draw.js +7 -7
- package/dist/collection/components/map-draw/map-draw.js.map +1 -1
- package/dist/collection/components/solar-expert/solar-expert.js +12 -5
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
- package/dist/collection/components/solar-system-form/solar-system-form.js +35 -25
- package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -1
- package/dist/collection/config.js +31 -0
- package/dist/collection/config.js.map +1 -1
- package/dist/collection/utils/theme.js +34 -26
- package/dist/collection/utils/theme.js.map +1 -1
- package/dist/components/index.js +4 -22
- package/dist/components/index.js.map +1 -1
- package/dist/components/map-draw.js +1 -1
- package/dist/components/{p-r9wMCtI3.js → p-ClYOM_0b.js} +10 -10
- package/dist/components/{p-r9wMCtI3.js.map → p-ClYOM_0b.js.map} +1 -1
- package/dist/components/{p-ao6bHDbv.js → p-CrzEBN9H.js} +69 -28
- package/dist/components/p-CrzEBN9H.js.map +1 -0
- package/dist/components/solar-expert.js +47 -33
- package/dist/components/solar-expert.js.map +1 -1
- package/dist/components/solar-system-form.js +1 -1
- package/dist/esm/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.js.map +1 -1
- package/dist/esm/eraser-icon_16.entry.js +118 -62
- package/dist/esm/eraser-icon_16.entry.js.map +1 -1
- package/dist/esm/{index-yVbXII2Q.js → index-DNOniOEj.js} +5 -28
- package/dist/esm/index-DNOniOEj.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loading-widget.entry.js +1 -1
- package/dist/esm/solar-calculator.entry.js +1 -1
- package/dist/esm/stencil-library.js +3 -3
- package/dist/stencil-library/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.esm.js.map +1 -1
- package/dist/stencil-library/{p-825501e2.entry.js → p-1e4e5fe9.entry.js} +2 -2
- package/dist/stencil-library/{p-2a83d5d6.entry.js → p-6cbb411b.entry.js} +2 -2
- package/dist/stencil-library/p-958f0a27.entry.js +2 -0
- package/dist/stencil-library/p-958f0a27.entry.js.map +1 -0
- package/dist/stencil-library/p-DNOniOEj.js +3 -0
- package/dist/stencil-library/p-DNOniOEj.js.map +1 -0
- package/dist/stencil-library/stencil-library.esm.js +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/utils/theme.d.ts +7 -0
- package/package.json +2 -1
- package/dist/cjs/index-elxiOP_I.js.map +0 -1
- package/dist/components/p-ao6bHDbv.js.map +0 -1
- package/dist/esm/index-yVbXII2Q.js.map +0 -1
- package/dist/stencil-library/p-141320bb.entry.js +0 -2
- package/dist/stencil-library/p-141320bb.entry.js.map +0 -1
- package/dist/stencil-library/p-yVbXII2Q.js +0 -3
- package/dist/stencil-library/p-yVbXII2Q.js.map +0 -1
- /package/dist/stencil-library/{p-825501e2.entry.js.map → p-1e4e5fe9.entry.js.map} +0 -0
- /package/dist/stencil-library/{p-2a83d5d6.entry.js.map → p-6cbb411b.entry.js.map} +0 -0
|
@@ -18,4 +18,35 @@ export const DEFAULT_SOLAR_PANEL_TYPE = {
|
|
|
18
18
|
efficiency: 0.224,
|
|
19
19
|
price: 77.68,
|
|
20
20
|
};
|
|
21
|
+
export const DEFAULT_COLOR_SCHEME = {
|
|
22
|
+
primary: "hsl(41 51% 90%)",
|
|
23
|
+
primaryForeground: "hsl(0 0% 0%)",
|
|
24
|
+
secondary: "hsl(28 100% 8%)",
|
|
25
|
+
secondaryForeground: "hsl(0 0% 100%)",
|
|
26
|
+
tertiary: "hsl(28 100% 29%)",
|
|
27
|
+
tertiaryForeground: "hsl(0 0% 100%)",
|
|
28
|
+
muted: "hsl(0 0% 100%)",
|
|
29
|
+
mutedForeground: "hsl(0 0% 0%)",
|
|
30
|
+
error: "hsl(0 100% 50%)",
|
|
31
|
+
errorForeground: "hsl(0 0% 100%)",
|
|
32
|
+
// Surface colors
|
|
33
|
+
surface: "hsl(0 0% 88%)", // gray-200
|
|
34
|
+
surfaceHover: "hsl(0 0% 82%)", // gray-300
|
|
35
|
+
surfaceActive: "hsl(0 0% 64%)", // gray-400
|
|
36
|
+
// Text colors
|
|
37
|
+
textMuted: "hsl(0 0% 45%)", // gray-600
|
|
38
|
+
textSecondary: "hsl(0 0% 55%)", // gray-500
|
|
39
|
+
textPlaceholder: "hsl(0 0% 73%)", // gray-400
|
|
40
|
+
// Border colors
|
|
41
|
+
border: "hsl(0 0% 82%)", // gray-300
|
|
42
|
+
borderLight: "hsl(0 0% 93%)", // gray-200
|
|
43
|
+
// Status colors
|
|
44
|
+
success: "hsl(142 76% 36%)", // green-600
|
|
45
|
+
info: "hsl(221 83% 53%)", // blue-500
|
|
46
|
+
// Interactive colors
|
|
47
|
+
hover: "hsl(0 0% 88%)", // gray-200
|
|
48
|
+
hoverDark: "hsl(28 100% 8%)", // darker secondary for hover
|
|
49
|
+
overlay: "rgba(0, 0, 0, 0.24)", // #0000003c
|
|
50
|
+
tooltip: "hsl(0 0% 13%)", // gray-800
|
|
51
|
+
};
|
|
21
52
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC1D,aAAa,EAAE,SAAS;IACxB,eAAe,EAAE,SAAS;IAC1B,oBAAoB,EAAE,SAAS;IAC/B,sBAAsB,EAAE,0BAA0B;IAClD,oBAAoB,EAAE,yBAAyB;IAC/C,2BAA2B,EAAE,0BAA0B;IACvD,yBAAyB,EAAE,yBAAyB;IACpD,gCAAgC,EAAE,0BAA0B;IAC5D,4BAA4B,EAAE,yBAAyB;IACvD,mCAAmC,EAAE,0BAA0B;IAC/D,cAAc,EAAE,qBAAqB;CACxC,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACpD,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,KAAK;CACf,CAAA","sourcesContent":["import { SolarPanelType } from \"./utils/solar\";\r\n\r\nexport interface SolarExpertConfig {\r\n openRoofColor: string;\r\n closedRoofColor: string;\r\n openObstructionColor: string;\r\n closedObstructionColor: string;\r\n roofPolygonFillColor: string;\r\n obstructionPolygonFillColor: string;\r\n roofPolygonHoverFillColor: string;\r\n obstructionPolygonHoverFillColor: string;\r\n roofPolygonSelectedFillColor: string;\r\n obstructionPolygonSelectedFillColor: string;\r\n highlightColor: string;\r\n}\r\n\r\nexport const DEFAULT_SOLAR_EXPERT_CONFIG: SolarExpertConfig = {\r\n openRoofColor: \"#d6eeff\",\r\n closedRoofColor: \"#ffffff\",\r\n openObstructionColor: \"#f57242\",\r\n closedObstructionColor: \"rgba(255, 132, 107, 0.8)\",\r\n roofPolygonFillColor: \"rgba(92, 187, 255, 0.5)\",\r\n obstructionPolygonFillColor: \"rgba(255, 132, 107, 0.5)\",\r\n roofPolygonHoverFillColor: \"rgba(92, 187, 255, 0.8)\",\r\n obstructionPolygonHoverFillColor: \"rgba(255, 132, 107, 0.8)\",\r\n roofPolygonSelectedFillColor: \"rgba(92, 187, 255, 0.7)\",\r\n obstructionPolygonSelectedFillColor: \"rgba(255, 132, 107, 0.7)\",\r\n highlightColor: \"rgba(0, 89, 255, 1)\",\r\n}\r\n\r\nexport const DEFAULT_SOLAR_PANEL_TYPE: SolarPanelType = {\r\n widthMeters: 1.134,\r\n heightMeters: 1.762,\r\n kWattPeak: 0.455,\r\n efficiency: 0.224,\r\n price: 77.68,\r\n}\r\n\r\nexport interface ColorScheme {\r\n primary: string;\r\n primaryForeground: string;\r\n secondary: string;\r\n secondaryForeground: string;\r\n tertiary: string;\r\n tertiaryForeground: string;\r\n muted: string;\r\n mutedForeground: string;\r\n error: string;\r\n errorForeground: string;\r\n // Surface colors\r\n surface: string;\r\n surfaceHover: string;\r\n surfaceActive: string;\r\n // Text colors\r\n textMuted: string;\r\n textSecondary: string;\r\n textPlaceholder: string;\r\n // Border colors\r\n border: string;\r\n borderLight: string;\r\n // Status colors\r\n success: string;\r\n info: string;\r\n // Interactive colors\r\n hover: string;\r\n hoverDark: string;\r\n overlay: string;\r\n tooltip: string;\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC1D,aAAa,EAAE,SAAS;IACxB,eAAe,EAAE,SAAS;IAC1B,oBAAoB,EAAE,SAAS;IAC/B,sBAAsB,EAAE,0BAA0B;IAClD,oBAAoB,EAAE,yBAAyB;IAC/C,2BAA2B,EAAE,0BAA0B;IACvD,yBAAyB,EAAE,yBAAyB;IACpD,gCAAgC,EAAE,0BAA0B;IAC5D,4BAA4B,EAAE,yBAAyB;IACvD,mCAAmC,EAAE,0BAA0B;IAC/D,cAAc,EAAE,qBAAqB;CACxC,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACpD,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;IACnB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,KAAK;CACf,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC7C,OAAO,EAAE,iBAAiB;IAC1B,iBAAiB,EAAE,cAAc;IACjC,SAAS,EAAE,iBAAiB;IAC5B,mBAAmB,EAAE,gBAAgB;IACrC,QAAQ,EAAE,kBAAkB;IAC5B,kBAAkB,EAAE,gBAAgB;IACpC,KAAK,EAAE,gBAAgB;IACvB,eAAe,EAAE,cAAc;IAC/B,KAAK,EAAE,iBAAiB;IACxB,eAAe,EAAE,gBAAgB;IAEjC,iBAAiB;IACjB,OAAO,EAAE,eAAe,EAAS,WAAW;IAC5C,YAAY,EAAE,eAAe,EAAI,WAAW;IAC5C,aAAa,EAAE,eAAe,EAAG,WAAW;IAE5C,cAAc;IACd,SAAS,EAAE,eAAe,EAAO,WAAW;IAC5C,aAAa,EAAE,eAAe,EAAG,WAAW;IAC5C,eAAe,EAAE,eAAe,EAAE,WAAW;IAE7C,gBAAgB;IAChB,MAAM,EAAE,eAAe,EAAU,WAAW;IAC5C,WAAW,EAAE,eAAe,EAAK,WAAW;IAE5C,gBAAgB;IAChB,OAAO,EAAE,kBAAkB,EAAM,YAAY;IAC7C,IAAI,EAAE,kBAAkB,EAAS,WAAW;IAE5C,qBAAqB;IACrB,KAAK,EAAE,eAAe,EAAW,WAAW;IAC5C,SAAS,EAAE,iBAAiB,EAAK,6BAA6B;IAC9D,OAAO,EAAE,qBAAqB,EAAG,YAAY;IAC7C,OAAO,EAAE,eAAe,EAAS,WAAW;CAC/C,CAAA","sourcesContent":["import { SolarPanelType } from \"./utils/solar\";\r\n\r\nexport interface SolarExpertConfig {\r\n openRoofColor: string;\r\n closedRoofColor: string;\r\n openObstructionColor: string;\r\n closedObstructionColor: string;\r\n roofPolygonFillColor: string;\r\n obstructionPolygonFillColor: string;\r\n roofPolygonHoverFillColor: string;\r\n obstructionPolygonHoverFillColor: string;\r\n roofPolygonSelectedFillColor: string;\r\n obstructionPolygonSelectedFillColor: string;\r\n highlightColor: string;\r\n}\r\n\r\nexport const DEFAULT_SOLAR_EXPERT_CONFIG: SolarExpertConfig = {\r\n openRoofColor: \"#d6eeff\",\r\n closedRoofColor: \"#ffffff\",\r\n openObstructionColor: \"#f57242\",\r\n closedObstructionColor: \"rgba(255, 132, 107, 0.8)\",\r\n roofPolygonFillColor: \"rgba(92, 187, 255, 0.5)\",\r\n obstructionPolygonFillColor: \"rgba(255, 132, 107, 0.5)\",\r\n roofPolygonHoverFillColor: \"rgba(92, 187, 255, 0.8)\",\r\n obstructionPolygonHoverFillColor: \"rgba(255, 132, 107, 0.8)\",\r\n roofPolygonSelectedFillColor: \"rgba(92, 187, 255, 0.7)\",\r\n obstructionPolygonSelectedFillColor: \"rgba(255, 132, 107, 0.7)\",\r\n highlightColor: \"rgba(0, 89, 255, 1)\",\r\n}\r\n\r\nexport const DEFAULT_SOLAR_PANEL_TYPE: SolarPanelType = {\r\n widthMeters: 1.134,\r\n heightMeters: 1.762,\r\n kWattPeak: 0.455,\r\n efficiency: 0.224,\r\n price: 77.68,\r\n}\r\n\r\nexport const DEFAULT_COLOR_SCHEME: ColorScheme = {\r\n primary: \"hsl(41 51% 90%)\",\r\n primaryForeground: \"hsl(0 0% 0%)\",\r\n secondary: \"hsl(28 100% 8%)\",\r\n secondaryForeground: \"hsl(0 0% 100%)\",\r\n tertiary: \"hsl(28 100% 29%)\",\r\n tertiaryForeground: \"hsl(0 0% 100%)\",\r\n muted: \"hsl(0 0% 100%)\",\r\n mutedForeground: \"hsl(0 0% 0%)\",\r\n error: \"hsl(0 100% 50%)\",\r\n errorForeground: \"hsl(0 0% 100%)\",\r\n \r\n // Surface colors\r\n surface: \"hsl(0 0% 88%)\", // gray-200\r\n surfaceHover: \"hsl(0 0% 82%)\", // gray-300\r\n surfaceActive: \"hsl(0 0% 64%)\", // gray-400\r\n \r\n // Text colors\r\n textMuted: \"hsl(0 0% 45%)\", // gray-600\r\n textSecondary: \"hsl(0 0% 55%)\", // gray-500\r\n textPlaceholder: \"hsl(0 0% 73%)\", // gray-400\r\n \r\n // Border colors\r\n border: \"hsl(0 0% 82%)\", // gray-300\r\n borderLight: \"hsl(0 0% 93%)\", // gray-200\r\n \r\n // Status colors\r\n success: \"hsl(142 76% 36%)\", // green-600\r\n info: \"hsl(221 83% 53%)\", // blue-500\r\n \r\n // Interactive colors\r\n hover: \"hsl(0 0% 88%)\", // gray-200\r\n hoverDark: \"hsl(28 100% 8%)\", // darker secondary for hover\r\n overlay: \"rgba(0, 0, 0, 0.24)\", // #0000003c\r\n tooltip: \"hsl(0 0% 13%)\", // gray-800\r\n}\r\n\r\nexport interface ColorScheme {\r\n primary: string;\r\n primaryForeground: string;\r\n secondary: string;\r\n secondaryForeground: string;\r\n tertiary: string;\r\n tertiaryForeground: string;\r\n muted: string;\r\n mutedForeground: string;\r\n error: string;\r\n errorForeground: string;\r\n // Surface colors\r\n surface: string;\r\n surfaceHover: string;\r\n surfaceActive: string;\r\n // Text colors\r\n textMuted: string;\r\n textSecondary: string;\r\n textPlaceholder: string;\r\n // Border colors\r\n border: string;\r\n borderLight: string;\r\n // Status colors\r\n success: string;\r\n info: string;\r\n // Interactive colors\r\n hover: string;\r\n hoverDark: string;\r\n overlay: string;\r\n tooltip: string;\r\n}\r\n\r\n"]}
|
|
@@ -6,84 +6,92 @@
|
|
|
6
6
|
* @param colorScheme - The color scheme object containing theme colors
|
|
7
7
|
*/
|
|
8
8
|
export function applyThemeGlobally(colorScheme) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
applyThemeToElement(document.documentElement, colorScheme);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Applies a color scheme theme to a specific element (useful for Shadow DOM).
|
|
13
|
+
*
|
|
14
|
+
* @param element - The element to apply the theme to (e.g., Shadow DOM host)
|
|
15
|
+
* @param colorScheme - The color scheme object containing theme colors
|
|
16
|
+
*/
|
|
17
|
+
export function applyThemeToElement(element, colorScheme) {
|
|
18
|
+
// Set CSS custom properties on the specified element
|
|
11
19
|
if (colorScheme.primary) {
|
|
12
|
-
|
|
20
|
+
element.style.setProperty('--color-primary', colorScheme.primary);
|
|
13
21
|
}
|
|
14
22
|
if (colorScheme.primaryForeground) {
|
|
15
|
-
|
|
23
|
+
element.style.setProperty('--color-primary-foreground', colorScheme.primaryForeground);
|
|
16
24
|
}
|
|
17
25
|
if (colorScheme.secondary) {
|
|
18
|
-
|
|
26
|
+
element.style.setProperty('--color-secondary', colorScheme.secondary);
|
|
19
27
|
}
|
|
20
28
|
if (colorScheme.secondaryForeground) {
|
|
21
|
-
|
|
29
|
+
element.style.setProperty('--color-secondary-foreground', colorScheme.secondaryForeground);
|
|
22
30
|
}
|
|
23
31
|
if (colorScheme.tertiary) {
|
|
24
|
-
|
|
32
|
+
element.style.setProperty('--color-tertiary', colorScheme.tertiary);
|
|
25
33
|
}
|
|
26
34
|
if (colorScheme.tertiaryForeground) {
|
|
27
|
-
|
|
35
|
+
element.style.setProperty('--color-tertiary-foreground', colorScheme.tertiaryForeground);
|
|
28
36
|
}
|
|
29
37
|
if (colorScheme.muted) {
|
|
30
|
-
|
|
38
|
+
element.style.setProperty('--color-muted', colorScheme.muted);
|
|
31
39
|
}
|
|
32
40
|
if (colorScheme.mutedForeground) {
|
|
33
|
-
|
|
41
|
+
element.style.setProperty('--color-muted-foreground', colorScheme.mutedForeground);
|
|
34
42
|
}
|
|
35
43
|
if (colorScheme.error) {
|
|
36
|
-
|
|
44
|
+
element.style.setProperty('--color-error', colorScheme.error);
|
|
37
45
|
}
|
|
38
46
|
if (colorScheme.errorForeground) {
|
|
39
|
-
|
|
47
|
+
element.style.setProperty('--color-error-foreground', colorScheme.errorForeground);
|
|
40
48
|
}
|
|
41
49
|
// Surface colors
|
|
42
50
|
if (colorScheme.surface) {
|
|
43
|
-
|
|
51
|
+
element.style.setProperty('--color-surface', colorScheme.surface);
|
|
44
52
|
}
|
|
45
53
|
if (colorScheme.surfaceHover) {
|
|
46
|
-
|
|
54
|
+
element.style.setProperty('--color-surface-hover', colorScheme.surfaceHover);
|
|
47
55
|
}
|
|
48
56
|
if (colorScheme.surfaceActive) {
|
|
49
|
-
|
|
57
|
+
element.style.setProperty('--color-surface-active', colorScheme.surfaceActive);
|
|
50
58
|
}
|
|
51
59
|
// Text colors
|
|
52
60
|
if (colorScheme.textMuted) {
|
|
53
|
-
|
|
61
|
+
element.style.setProperty('--color-text-muted', colorScheme.textMuted);
|
|
54
62
|
}
|
|
55
63
|
if (colorScheme.textSecondary) {
|
|
56
|
-
|
|
64
|
+
element.style.setProperty('--color-text-secondary', colorScheme.textSecondary);
|
|
57
65
|
}
|
|
58
66
|
if (colorScheme.textPlaceholder) {
|
|
59
|
-
|
|
67
|
+
element.style.setProperty('--color-text-placeholder', colorScheme.textPlaceholder);
|
|
60
68
|
}
|
|
61
69
|
// Border colors
|
|
62
70
|
if (colorScheme.border) {
|
|
63
|
-
|
|
71
|
+
element.style.setProperty('--color-border', colorScheme.border);
|
|
64
72
|
}
|
|
65
73
|
if (colorScheme.borderLight) {
|
|
66
|
-
|
|
74
|
+
element.style.setProperty('--color-border-light', colorScheme.borderLight);
|
|
67
75
|
}
|
|
68
76
|
// Status colors
|
|
69
77
|
if (colorScheme.success) {
|
|
70
|
-
|
|
78
|
+
element.style.setProperty('--color-success', colorScheme.success);
|
|
71
79
|
}
|
|
72
80
|
if (colorScheme.info) {
|
|
73
|
-
|
|
81
|
+
element.style.setProperty('--color-info', colorScheme.info);
|
|
74
82
|
}
|
|
75
83
|
// Interactive colors
|
|
76
84
|
if (colorScheme.hover) {
|
|
77
|
-
|
|
85
|
+
element.style.setProperty('--color-hover', colorScheme.hover);
|
|
78
86
|
}
|
|
79
87
|
if (colorScheme.hoverDark) {
|
|
80
|
-
|
|
88
|
+
element.style.setProperty('--color-hover-dark', colorScheme.hoverDark);
|
|
81
89
|
}
|
|
82
90
|
if (colorScheme.overlay) {
|
|
83
|
-
|
|
91
|
+
element.style.setProperty('--color-overlay', colorScheme.overlay);
|
|
84
92
|
}
|
|
85
93
|
if (colorScheme.tooltip) {
|
|
86
|
-
|
|
94
|
+
element.style.setProperty('--color-tooltip', colorScheme.tooltip);
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAiC;IAChE,
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAiC;IAChE,mBAAmB,CAAC,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAoB,EAAE,WAAiC;IACvF,qDAAqD;IACrD,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,4BAA4B,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,W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CAAC,KAAK,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;AACL,CAAC","sourcesContent":["import { ColorScheme } from \"../config\";\r\n\r\n/**\r\n * Applies a color scheme theme globally to the document root.\r\n * Since all components use global CSS (shadow: false), this will automatically \r\n * update the theme for all components.\r\n * \r\n * @param colorScheme - The color scheme object containing theme colors\r\n */\r\nexport function applyThemeGlobally(colorScheme: Partial<ColorScheme>): void {\r\n applyThemeToElement(document.documentElement, colorScheme);\r\n}\r\n\r\n/**\r\n * Applies a color scheme theme to a specific element (useful for Shadow DOM).\r\n * \r\n * @param element - The element to apply the theme to (e.g., Shadow DOM host)\r\n * @param colorScheme - The color scheme object containing theme colors\r\n */\r\nexport function applyThemeToElement(element: HTMLElement, colorScheme: Partial<ColorScheme>): void {\r\n // Set CSS custom properties on the specified element\r\n if (colorScheme.primary) {\r\n element.style.setProperty('--color-primary', colorScheme.primary);\r\n }\r\n if (colorScheme.primaryForeground) {\r\n element.style.setProperty('--color-primary-foreground', colorScheme.primaryForeground);\r\n }\r\n if (colorScheme.secondary) {\r\n element.style.setProperty('--color-secondary', colorScheme.secondary);\r\n }\r\n if (colorScheme.secondaryForeground) {\r\n element.style.setProperty('--color-secondary-foreground', colorScheme.secondaryForeground);\r\n }\r\n if (colorScheme.tertiary) {\r\n element.style.setProperty('--color-tertiary', colorScheme.tertiary);\r\n }\r\n if (colorScheme.tertiaryForeground) {\r\n element.style.setProperty('--color-tertiary-foreground', colorScheme.tertiaryForeground);\r\n }\r\n if (colorScheme.muted) {\r\n element.style.setProperty('--color-muted', colorScheme.muted);\r\n }\r\n if (colorScheme.mutedForeground) { \r\n element.style.setProperty('--color-muted-foreground', colorScheme.mutedForeground);\r\n }\r\n if (colorScheme.error) {\r\n element.style.setProperty('--color-error', colorScheme.error);\r\n }\r\n if (colorScheme.errorForeground) {\r\n element.style.setProperty('--color-error-foreground', colorScheme.errorForeground);\r\n }\r\n \r\n // Surface colors\r\n if (colorScheme.surface) {\r\n element.style.setProperty('--color-surface', colorScheme.surface);\r\n }\r\n if (colorScheme.surfaceHover) {\r\n element.style.setProperty('--color-surface-hover', colorScheme.surfaceHover);\r\n }\r\n if (colorScheme.surfaceActive) {\r\n element.style.setProperty('--color-surface-active', colorScheme.surfaceActive);\r\n }\r\n \r\n // Text colors\r\n if (colorScheme.textMuted) {\r\n element.style.setProperty('--color-text-muted', colorScheme.textMuted);\r\n }\r\n if (colorScheme.textSecondary) {\r\n element.style.setProperty('--color-text-secondary', colorScheme.textSecondary);\r\n }\r\n if (colorScheme.textPlaceholder) {\r\n element.style.setProperty('--color-text-placeholder', colorScheme.textPlaceholder);\r\n }\r\n \r\n // Border colors\r\n if (colorScheme.border) {\r\n element.style.setProperty('--color-border', colorScheme.border);\r\n }\r\n if (colorScheme.borderLight) {\r\n element.style.setProperty('--color-border-light', colorScheme.borderLight);\r\n }\r\n \r\n // Status colors\r\n if (colorScheme.success) {\r\n element.style.setProperty('--color-success', colorScheme.success);\r\n }\r\n if (colorScheme.info) {\r\n element.style.setProperty('--color-info', colorScheme.info);\r\n }\r\n \r\n // Interactive colors\r\n if (colorScheme.hover) {\r\n element.style.setProperty('--color-hover', colorScheme.hover);\r\n }\r\n if (colorScheme.hoverDark) {\r\n element.style.setProperty('--color-hover-dark', colorScheme.hoverDark);\r\n }\r\n if (colorScheme.overlay) {\r\n element.style.setProperty('--color-overlay', colorScheme.overlay);\r\n }\r\n if (colorScheme.tooltip) {\r\n element.style.setProperty('--color-tooltip', colorScheme.tooltip);\r\n }\r\n}"]}
|
package/dist/components/index.js
CHANGED
|
@@ -456,15 +456,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
456
456
|
var attachStyles = (hostRef) => {
|
|
457
457
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
458
458
|
const elm = hostRef.$hostElement$;
|
|
459
|
-
const flags = cmpMeta.$flags$;
|
|
460
459
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
461
|
-
|
|
462
|
-
elm.
|
|
460
|
+
addStyle(
|
|
461
|
+
elm.getRootNode(),
|
|
463
462
|
cmpMeta);
|
|
464
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
465
|
-
elm["s-sc"] = scopeId2;
|
|
466
|
-
elm.classList.add(scopeId2 + "-h");
|
|
467
|
-
}
|
|
468
463
|
endAttachStyles();
|
|
469
464
|
};
|
|
470
465
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
@@ -660,9 +655,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
660
655
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
661
656
|
let containerElm = parentElm;
|
|
662
657
|
let childNode;
|
|
663
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
664
|
-
containerElm = containerElm.shadowRoot;
|
|
665
|
-
}
|
|
666
658
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
667
659
|
if (vnodes[startIdx]) {
|
|
668
660
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -841,7 +833,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
841
833
|
rootVnode.$tag$ = null;
|
|
842
834
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
843
835
|
hostRef.$vnode$ = rootVnode;
|
|
844
|
-
rootVnode.$elm$ = oldVNode.$elm$ = hostElm
|
|
836
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm;
|
|
845
837
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
846
838
|
};
|
|
847
839
|
|
|
@@ -1275,17 +1267,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1275
1267
|
},
|
|
1276
1268
|
__attachShadow() {
|
|
1277
1269
|
{
|
|
1278
|
-
|
|
1279
|
-
{
|
|
1280
|
-
this.attachShadow({ mode: "open" });
|
|
1281
|
-
}
|
|
1282
|
-
} else {
|
|
1283
|
-
if (this.shadowRoot.mode !== "open") {
|
|
1284
|
-
throw new Error(
|
|
1285
|
-
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
1286
|
-
);
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1270
|
+
this.shadowRoot = this;
|
|
1289
1271
|
}
|
|
1290
1272
|
}
|
|
1291
1273
|
});
|