@gravionlabs/helix-shell 22.1.21 → 22.1.23
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.
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, InjectionToken, ViewEncapsulation, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, untracked } from "@angular/core";
|
|
3
3
|
import * as i1 from "@angular/common";
|
|
4
|
-
import { CommonModule, DOCUMENT, NgClass, SlicePipe
|
|
4
|
+
import { CommonModule, DOCUMENT, NgClass, SlicePipe } from "@angular/common";
|
|
5
5
|
import * as i1$1 from "@angular/forms";
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
7
7
|
import * as i2 from "@angular/router";
|
|
8
8
|
import { ActivatedRoute, NavigationEnd, Router, RouterModule } from "@angular/router";
|
|
9
|
+
import { HX_PRIMARY_COLORS, HX_SURFACES, HX_SURFACE_NAMES, HxBreadcrumb, HxButton, HxCheckbox, HxDivider, HxInput, HxPassword, HxSelectButton, HxTheme, HxTooltip } from "@gravionlabs/helix-ui";
|
|
9
10
|
import { patchState, signalStore, withComputed, withHooks, withMethods, withState } from "@ngrx/signals";
|
|
10
11
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
11
12
|
import { Subject, filter, takeUntil } from "rxjs";
|
|
12
|
-
import { HxBreadcrumb, HxButton, HxCheckbox, HxDivider, HxInput, HxPassword, HxSelectButton, HxTooltip } from "@gravionlabs/helix-ui";
|
|
13
|
-
import { HelixConfig } from "@gravionlabs/helix-core/config";
|
|
14
|
-
import { $t, updatePreset, updateSurfacePalette } from "@gravionlabs/helix-core/themes";
|
|
15
|
-
import { auraPreset } from "@gravionlabs/helix-core/themes/aura";
|
|
16
|
-
import { helixPreset } from "@gravionlabs/helix-core/themes/helix";
|
|
17
|
-
import { laraPreset } from "@gravionlabs/helix-core/themes/lara";
|
|
18
|
-
import { noraPreset } from "@gravionlabs/helix-core/themes/nora";
|
|
19
13
|
var HelixFormField = class HelixFormField {
|
|
20
14
|
label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
|
|
21
15
|
control = input(null, ...ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []);
|
|
@@ -408,10 +402,6 @@ function writeCollapsed(collapsed) {
|
|
|
408
402
|
} catch {}
|
|
409
403
|
}
|
|
410
404
|
const initialState = {
|
|
411
|
-
preset: "Helix",
|
|
412
|
-
primary: null,
|
|
413
|
-
surface: null,
|
|
414
|
-
darkTheme: false,
|
|
415
405
|
menuMode: "static",
|
|
416
406
|
staticMenuDesktopInactive: false,
|
|
417
407
|
overlayMenuActive: false,
|
|
@@ -423,15 +413,18 @@ const initialState = {
|
|
|
423
413
|
desktop: true,
|
|
424
414
|
expandedKeys: []
|
|
425
415
|
};
|
|
426
|
-
const LayoutStore = signalStore({ providedIn: "root" }, withState(initialState), withComputed((store) => ({
|
|
427
|
-
|
|
416
|
+
const LayoutStore = signalStore({ providedIn: "root" }, withState(initialState), withComputed((store, theme = inject(HxTheme)) => ({
|
|
417
|
+
darkTheme: computed(() => theme.dark()),
|
|
418
|
+
primary: computed(() => theme.primary()),
|
|
419
|
+
surface: computed(() => theme.surface()),
|
|
420
|
+
isDarkTheme: computed(() => theme.dark()),
|
|
428
421
|
isOverlay: computed(() => store.menuMode() === "overlay"),
|
|
429
422
|
isStatic: computed(() => store.menuMode() === "static"),
|
|
430
423
|
isSidebarActive: computed(() => store.overlayMenuActive() || store.mobileMenuActive()),
|
|
431
424
|
isCollapsed: computed(() => store.sidebarCollapsed() && store.desktop())
|
|
432
|
-
})), withMethods((store) => ({
|
|
425
|
+
})), withMethods((store, theme = inject(HxTheme)) => ({
|
|
433
426
|
toggleDarkMode() {
|
|
434
|
-
|
|
427
|
+
theme.toggleDark();
|
|
435
428
|
},
|
|
436
429
|
setMenuMode(menuMode) {
|
|
437
430
|
patchState(store, { menuMode });
|
|
@@ -478,14 +471,11 @@ const LayoutStore = signalStore({ providedIn: "root" }, withState(initialState),
|
|
|
478
471
|
updateConfig(config) {
|
|
479
472
|
patchState(store, config);
|
|
480
473
|
},
|
|
481
|
-
setPreset(preset) {
|
|
482
|
-
patchState(store, { preset });
|
|
483
|
-
},
|
|
484
474
|
setPrimary(primary) {
|
|
485
|
-
|
|
475
|
+
theme.setPrimary(primary);
|
|
486
476
|
},
|
|
487
477
|
setSurface(surface) {
|
|
488
|
-
|
|
478
|
+
theme.setSurface(surface);
|
|
489
479
|
},
|
|
490
480
|
isDesktop() {
|
|
491
481
|
return window.innerWidth > 991;
|
|
@@ -509,16 +499,6 @@ const LayoutStore = signalStore({ providedIn: "root" }, withState(initialState),
|
|
|
509
499
|
window.addEventListener("resize", onResize);
|
|
510
500
|
inject(DestroyRef).onDestroy(() => window.removeEventListener("resize", onResize));
|
|
511
501
|
}
|
|
512
|
-
effect(() => {
|
|
513
|
-
const isDark = store.darkTheme();
|
|
514
|
-
const supportsViewTransition = "startViewTransition" in document;
|
|
515
|
-
const applyDarkMode = () => {
|
|
516
|
-
if (isDark) document.documentElement.classList.add("app-dark");
|
|
517
|
-
else document.documentElement.classList.remove("app-dark");
|
|
518
|
-
};
|
|
519
|
-
if (supportsViewTransition) document.startViewTransition(() => applyDarkMode());
|
|
520
|
-
else applyDarkMode();
|
|
521
|
-
});
|
|
522
502
|
} }));
|
|
523
503
|
function isPathActive(activePath, itemPath) {
|
|
524
504
|
if (!itemPath || !activePath.startsWith(itemPath)) return false;
|
|
@@ -1707,18 +1687,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1707
1687
|
}]
|
|
1708
1688
|
}
|
|
1709
1689
|
});
|
|
1710
|
-
const presets = {
|
|
1711
|
-
Helix: helixPreset,
|
|
1712
|
-
Aura: auraPreset,
|
|
1713
|
-
Lara: laraPreset,
|
|
1714
|
-
Nora: noraPreset
|
|
1715
|
-
};
|
|
1716
1690
|
var HelixConfigurator = class HelixConfigurator {
|
|
1717
1691
|
router = inject(Router);
|
|
1718
|
-
primeng = inject(HelixConfig);
|
|
1719
1692
|
store = inject(LayoutStore);
|
|
1720
|
-
platformId = inject(PLATFORM_ID);
|
|
1721
|
-
presetOptions = Object.keys(presets);
|
|
1722
1693
|
showMenuModeButton = signal(!this.router.url.includes("auth"), ...ngDevMode ? [{ debugName: "showMenuModeButton" }] : /* istanbul ignore next */ []);
|
|
1723
1694
|
menuModeOptions = [{
|
|
1724
1695
|
label: "Static",
|
|
@@ -1727,349 +1698,23 @@ var HelixConfigurator = class HelixConfigurator {
|
|
|
1727
1698
|
label: "Overlay",
|
|
1728
1699
|
value: "overlay"
|
|
1729
1700
|
}];
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
300: "#cbd5e1",
|
|
1739
|
-
400: "#94a3b8",
|
|
1740
|
-
500: "#64748b",
|
|
1741
|
-
600: "#475569",
|
|
1742
|
-
700: "#334155",
|
|
1743
|
-
800: "#1e293b",
|
|
1744
|
-
900: "#0f172a",
|
|
1745
|
-
950: "#020617"
|
|
1746
|
-
}
|
|
1747
|
-
},
|
|
1748
|
-
{
|
|
1749
|
-
name: "gray",
|
|
1750
|
-
palette: {
|
|
1751
|
-
0: "#ffffff",
|
|
1752
|
-
50: "#f9fafb",
|
|
1753
|
-
100: "#f3f4f6",
|
|
1754
|
-
200: "#e5e7eb",
|
|
1755
|
-
300: "#d1d5db",
|
|
1756
|
-
400: "#9ca3af",
|
|
1757
|
-
500: "#6b7280",
|
|
1758
|
-
600: "#4b5563",
|
|
1759
|
-
700: "#374151",
|
|
1760
|
-
800: "#1f2937",
|
|
1761
|
-
900: "#111827",
|
|
1762
|
-
950: "#030712"
|
|
1763
|
-
}
|
|
1764
|
-
},
|
|
1765
|
-
{
|
|
1766
|
-
name: "zinc",
|
|
1767
|
-
palette: {
|
|
1768
|
-
0: "#ffffff",
|
|
1769
|
-
50: "#fafafa",
|
|
1770
|
-
100: "#f4f4f5",
|
|
1771
|
-
200: "#e4e4e7",
|
|
1772
|
-
300: "#d4d4d8",
|
|
1773
|
-
400: "#a1a1aa",
|
|
1774
|
-
500: "#71717a",
|
|
1775
|
-
600: "#52525b",
|
|
1776
|
-
700: "#3f3f46",
|
|
1777
|
-
800: "#27272a",
|
|
1778
|
-
900: "#18181b",
|
|
1779
|
-
950: "#09090b"
|
|
1780
|
-
}
|
|
1781
|
-
},
|
|
1782
|
-
{
|
|
1783
|
-
name: "neutral",
|
|
1784
|
-
palette: {
|
|
1785
|
-
0: "#ffffff",
|
|
1786
|
-
50: "#fafafa",
|
|
1787
|
-
100: "#f5f5f5",
|
|
1788
|
-
200: "#e5e5e5",
|
|
1789
|
-
300: "#d4d4d4",
|
|
1790
|
-
400: "#a3a3a3",
|
|
1791
|
-
500: "#737373",
|
|
1792
|
-
600: "#525252",
|
|
1793
|
-
700: "#404040",
|
|
1794
|
-
800: "#262626",
|
|
1795
|
-
900: "#171717",
|
|
1796
|
-
950: "#0a0a0a"
|
|
1797
|
-
}
|
|
1798
|
-
},
|
|
1799
|
-
{
|
|
1800
|
-
name: "stone",
|
|
1801
|
-
palette: {
|
|
1802
|
-
0: "#ffffff",
|
|
1803
|
-
50: "#fafaf9",
|
|
1804
|
-
100: "#f5f5f4",
|
|
1805
|
-
200: "#e7e5e4",
|
|
1806
|
-
300: "#d6d3d1",
|
|
1807
|
-
400: "#a8a29e",
|
|
1808
|
-
500: "#78716c",
|
|
1809
|
-
600: "#57534e",
|
|
1810
|
-
700: "#44403c",
|
|
1811
|
-
800: "#292524",
|
|
1812
|
-
900: "#1c1917",
|
|
1813
|
-
950: "#0c0a09"
|
|
1814
|
-
}
|
|
1815
|
-
},
|
|
1816
|
-
{
|
|
1817
|
-
name: "soho",
|
|
1818
|
-
palette: {
|
|
1819
|
-
0: "#ffffff",
|
|
1820
|
-
50: "#ececec",
|
|
1821
|
-
100: "#dedfdf",
|
|
1822
|
-
200: "#c4c4c6",
|
|
1823
|
-
300: "#adaeb0",
|
|
1824
|
-
400: "#97979b",
|
|
1825
|
-
500: "#7f8084",
|
|
1826
|
-
600: "#6a6b70",
|
|
1827
|
-
700: "#55565b",
|
|
1828
|
-
800: "#3f4046",
|
|
1829
|
-
900: "#2c2c34",
|
|
1830
|
-
950: "#16161d"
|
|
1831
|
-
}
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
name: "viva",
|
|
1835
|
-
palette: {
|
|
1836
|
-
0: "#ffffff",
|
|
1837
|
-
50: "#f3f3f3",
|
|
1838
|
-
100: "#e7e7e8",
|
|
1839
|
-
200: "#cfd0d0",
|
|
1840
|
-
300: "#b7b8b9",
|
|
1841
|
-
400: "#9fa1a1",
|
|
1842
|
-
500: "#87898a",
|
|
1843
|
-
600: "#6e7173",
|
|
1844
|
-
700: "#565a5b",
|
|
1845
|
-
800: "#3e4244",
|
|
1846
|
-
900: "#262b2c",
|
|
1847
|
-
950: "#0e1315"
|
|
1848
|
-
}
|
|
1849
|
-
},
|
|
1850
|
-
{
|
|
1851
|
-
name: "ocean",
|
|
1852
|
-
palette: {
|
|
1853
|
-
0: "#ffffff",
|
|
1854
|
-
50: "#fbfcfc",
|
|
1855
|
-
100: "#F7F9F8",
|
|
1856
|
-
200: "#EFF3F2",
|
|
1857
|
-
300: "#DADEDD",
|
|
1858
|
-
400: "#B1B7B6",
|
|
1859
|
-
500: "#828787",
|
|
1860
|
-
600: "#5F7274",
|
|
1861
|
-
700: "#415B61",
|
|
1862
|
-
800: "#29444E",
|
|
1863
|
-
900: "#183240",
|
|
1864
|
-
950: "#0c1920"
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
];
|
|
1701
|
+
primaryColors = ["noir", ...HX_PRIMARY_COLORS.filter((name) => name !== "noir")].map((name) => ({
|
|
1702
|
+
name,
|
|
1703
|
+
swatch: name === "noir" ? "var(--text-color)" : `var(--h-${name}-500)`
|
|
1704
|
+
}));
|
|
1705
|
+
surfaces = HX_SURFACE_NAMES.map((name) => ({
|
|
1706
|
+
name,
|
|
1707
|
+
swatch: HX_SURFACES[name][500]
|
|
1708
|
+
}));
|
|
1868
1709
|
selectedPrimaryColor = computed(() => this.store.primary(), ...ngDevMode ? [{ debugName: "selectedPrimaryColor" }] : /* istanbul ignore next */ []);
|
|
1869
|
-
activePrimaryColor = computed(() => this.store.primary() ??
|
|
1710
|
+
activePrimaryColor = computed(() => this.store.primary() ?? "indigo", ...ngDevMode ? [{ debugName: "activePrimaryColor" }] : /* istanbul ignore next */ []);
|
|
1870
1711
|
selectedSurfaceColor = computed(() => this.store.surface(), ...ngDevMode ? [{ debugName: "selectedSurfaceColor" }] : /* istanbul ignore next */ []);
|
|
1871
|
-
selectedPreset = computed(() => this.store.preset(), ...ngDevMode ? [{ debugName: "selectedPreset" }] : /* istanbul ignore next */ []);
|
|
1872
1712
|
menuMode = computed(() => this.store.menuMode(), ...ngDevMode ? [{ debugName: "menuMode" }] : /* istanbul ignore next */ []);
|
|
1873
|
-
primaryColors = computed(() => {
|
|
1874
|
-
const presetPalette = presets[this.store.preset()].primitive;
|
|
1875
|
-
const colors = [
|
|
1876
|
-
"emerald",
|
|
1877
|
-
"green",
|
|
1878
|
-
"lime",
|
|
1879
|
-
"orange",
|
|
1880
|
-
"amber",
|
|
1881
|
-
"yellow",
|
|
1882
|
-
"teal",
|
|
1883
|
-
"cyan",
|
|
1884
|
-
"sky",
|
|
1885
|
-
"blue",
|
|
1886
|
-
"indigo",
|
|
1887
|
-
"violet",
|
|
1888
|
-
"purple",
|
|
1889
|
-
"fuchsia",
|
|
1890
|
-
"pink",
|
|
1891
|
-
"rose"
|
|
1892
|
-
];
|
|
1893
|
-
const palettes = [{
|
|
1894
|
-
name: "noir",
|
|
1895
|
-
palette: {}
|
|
1896
|
-
}];
|
|
1897
|
-
colors.forEach((color) => {
|
|
1898
|
-
palettes.push({
|
|
1899
|
-
name: color,
|
|
1900
|
-
palette: presetPalette?.[color]
|
|
1901
|
-
});
|
|
1902
|
-
});
|
|
1903
|
-
return palettes;
|
|
1904
|
-
}, ...ngDevMode ? [{ debugName: "primaryColors" }] : /* istanbul ignore next */ []);
|
|
1905
|
-
ngOnInit() {
|
|
1906
|
-
if (isPlatformBrowser(this.platformId)) this.onPresetChange(this.store.preset());
|
|
1907
|
-
}
|
|
1908
|
-
getPresetExt() {
|
|
1909
|
-
if (this.selectedPrimaryColor() === null) return {};
|
|
1910
|
-
const color = this.primaryColors().find((c) => c.name === this.selectedPrimaryColor()) || {};
|
|
1911
|
-
const preset = this.store.preset();
|
|
1912
|
-
if (color.name === "noir") return { semantic: {
|
|
1913
|
-
primary: {
|
|
1914
|
-
50: "{surface.50}",
|
|
1915
|
-
100: "{surface.100}",
|
|
1916
|
-
200: "{surface.200}",
|
|
1917
|
-
300: "{surface.300}",
|
|
1918
|
-
400: "{surface.400}",
|
|
1919
|
-
500: "{surface.500}",
|
|
1920
|
-
600: "{surface.600}",
|
|
1921
|
-
700: "{surface.700}",
|
|
1922
|
-
800: "{surface.800}",
|
|
1923
|
-
900: "{surface.900}",
|
|
1924
|
-
950: "{surface.950}"
|
|
1925
|
-
},
|
|
1926
|
-
colorScheme: {
|
|
1927
|
-
light: {
|
|
1928
|
-
primary: {
|
|
1929
|
-
color: "{primary.950}",
|
|
1930
|
-
contrastColor: "#ffffff",
|
|
1931
|
-
hoverColor: "{primary.800}",
|
|
1932
|
-
activeColor: "{primary.700}"
|
|
1933
|
-
},
|
|
1934
|
-
highlight: {
|
|
1935
|
-
background: "{primary.950}",
|
|
1936
|
-
focusBackground: "{primary.700}",
|
|
1937
|
-
color: "#ffffff",
|
|
1938
|
-
focusColor: "#ffffff"
|
|
1939
|
-
}
|
|
1940
|
-
},
|
|
1941
|
-
dark: {
|
|
1942
|
-
primary: {
|
|
1943
|
-
color: "{primary.50}",
|
|
1944
|
-
contrastColor: "{primary.950}",
|
|
1945
|
-
hoverColor: "{primary.200}",
|
|
1946
|
-
activeColor: "{primary.300}"
|
|
1947
|
-
},
|
|
1948
|
-
highlight: {
|
|
1949
|
-
background: "{primary.50}",
|
|
1950
|
-
focusBackground: "{primary.300}",
|
|
1951
|
-
color: "{primary.950}",
|
|
1952
|
-
focusColor: "{primary.950}"
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
} };
|
|
1957
|
-
else if (preset === "Helix") return { semantic: {
|
|
1958
|
-
primary: color.palette,
|
|
1959
|
-
colorScheme: {
|
|
1960
|
-
light: {
|
|
1961
|
-
primary: {
|
|
1962
|
-
color: "{primary.600}",
|
|
1963
|
-
contrastColor: "#ffffff",
|
|
1964
|
-
hoverColor: "{primary.700}",
|
|
1965
|
-
activeColor: "{primary.800}"
|
|
1966
|
-
},
|
|
1967
|
-
highlight: {
|
|
1968
|
-
background: "{primary.50}",
|
|
1969
|
-
focusBackground: "{primary.100}",
|
|
1970
|
-
color: "{primary.700}",
|
|
1971
|
-
focusColor: "{primary.800}"
|
|
1972
|
-
}
|
|
1973
|
-
},
|
|
1974
|
-
dark: {
|
|
1975
|
-
primary: {
|
|
1976
|
-
color: "{primary.400}",
|
|
1977
|
-
contrastColor: "{surface.950}",
|
|
1978
|
-
hoverColor: "{primary.300}",
|
|
1979
|
-
activeColor: "{primary.200}"
|
|
1980
|
-
},
|
|
1981
|
-
highlight: {
|
|
1982
|
-
background: "color-mix(in srgb, {primary.400}, transparent 84%)",
|
|
1983
|
-
focusBackground: "color-mix(in srgb, {primary.400}, transparent 76%)",
|
|
1984
|
-
color: "rgba(255,255,255,.87)",
|
|
1985
|
-
focusColor: "rgba(255,255,255,.87)"
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
} };
|
|
1990
|
-
else if (preset === "Nora") return { semantic: {
|
|
1991
|
-
primary: color.palette,
|
|
1992
|
-
colorScheme: {
|
|
1993
|
-
light: {
|
|
1994
|
-
primary: {
|
|
1995
|
-
color: "{primary.600}",
|
|
1996
|
-
contrastColor: "#ffffff",
|
|
1997
|
-
hoverColor: "{primary.700}",
|
|
1998
|
-
activeColor: "{primary.800}"
|
|
1999
|
-
},
|
|
2000
|
-
highlight: {
|
|
2001
|
-
background: "{primary.600}",
|
|
2002
|
-
focusBackground: "{primary.700}",
|
|
2003
|
-
color: "#ffffff",
|
|
2004
|
-
focusColor: "#ffffff"
|
|
2005
|
-
}
|
|
2006
|
-
},
|
|
2007
|
-
dark: {
|
|
2008
|
-
primary: {
|
|
2009
|
-
color: "{primary.500}",
|
|
2010
|
-
contrastColor: "{surface.900}",
|
|
2011
|
-
hoverColor: "{primary.400}",
|
|
2012
|
-
activeColor: "{primary.300}"
|
|
2013
|
-
},
|
|
2014
|
-
highlight: {
|
|
2015
|
-
background: "{primary.500}",
|
|
2016
|
-
focusBackground: "{primary.400}",
|
|
2017
|
-
color: "{surface.900}",
|
|
2018
|
-
focusColor: "{surface.900}"
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
} };
|
|
2023
|
-
else return { semantic: {
|
|
2024
|
-
primary: color.palette,
|
|
2025
|
-
colorScheme: {
|
|
2026
|
-
light: {
|
|
2027
|
-
primary: {
|
|
2028
|
-
color: "{primary.500}",
|
|
2029
|
-
contrastColor: "#ffffff",
|
|
2030
|
-
hoverColor: "{primary.600}",
|
|
2031
|
-
activeColor: "{primary.700}"
|
|
2032
|
-
},
|
|
2033
|
-
highlight: {
|
|
2034
|
-
background: "{primary.50}",
|
|
2035
|
-
focusBackground: "{primary.100}",
|
|
2036
|
-
color: "{primary.700}",
|
|
2037
|
-
focusColor: "{primary.800}"
|
|
2038
|
-
}
|
|
2039
|
-
},
|
|
2040
|
-
dark: {
|
|
2041
|
-
primary: {
|
|
2042
|
-
color: "{primary.400}",
|
|
2043
|
-
contrastColor: "{surface.900}",
|
|
2044
|
-
hoverColor: "{primary.300}",
|
|
2045
|
-
activeColor: "{primary.200}"
|
|
2046
|
-
},
|
|
2047
|
-
highlight: {
|
|
2048
|
-
background: "color-mix(in srgb, {primary.400}, transparent 84%)",
|
|
2049
|
-
focusBackground: "color-mix(in srgb, {primary.400}, transparent 76%)",
|
|
2050
|
-
color: "rgba(255,255,255,.87)",
|
|
2051
|
-
focusColor: "rgba(255,255,255,.87)"
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
} };
|
|
2056
|
-
}
|
|
2057
1713
|
updateColors(event, type, color) {
|
|
2058
1714
|
if (type === "primary") this.store.setPrimary(color.name);
|
|
2059
|
-
else
|
|
2060
|
-
this.applyTheme(type, color);
|
|
1715
|
+
else this.store.setSurface(color.name);
|
|
2061
1716
|
event.stopPropagation();
|
|
2062
1717
|
}
|
|
2063
|
-
applyTheme(type, color) {
|
|
2064
|
-
if (type === "primary") updatePreset(this.getPresetExt());
|
|
2065
|
-
else if (type === "surface") updateSurfacePalette(color.palette);
|
|
2066
|
-
}
|
|
2067
|
-
onPresetChange(event) {
|
|
2068
|
-
this.store.setPreset(event);
|
|
2069
|
-
const preset = presets[event];
|
|
2070
|
-
const surfacePalette = this.surfaces.find((s) => s.name === this.selectedSurfaceColor())?.palette;
|
|
2071
|
-
$t().preset(preset).preset(this.getPresetExt()).surfacePalette(surfacePalette).use({ useDefaultOptions: true });
|
|
2072
|
-
}
|
|
2073
1718
|
onMenuModeChange(event) {
|
|
2074
1719
|
this.store.setMenuMode(event);
|
|
2075
1720
|
}
|
|
@@ -2089,7 +1734,7 @@ var HelixConfigurator = class HelixConfigurator {
|
|
|
2089
1734
|
selector: "helix-configurator",
|
|
2090
1735
|
host: { classAttribute: "hidden absolute top-13 right-0 w-72 p-4 bg-surface-0 dark:bg-surface-900 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)]" },
|
|
2091
1736
|
ngImport: i0,
|
|
2092
|
-
template: "<div class=\"flex flex-col gap-4\">\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Primary</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (primaryColor of primaryColors
|
|
1737
|
+
template: "<div class=\"flex flex-col gap-4\">\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Primary</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (primaryColor of primaryColors; track primaryColor.name) {\n <button\n type=\"button\"\n [title]=\"primaryColor.name\"\n (click)=\"updateColors($event, 'primary', primaryColor)\"\n [ngClass]=\"{ 'outline outline-primary': primaryColor.name === activePrimaryColor() }\"\n class=\"cursor-pointer w-5 h-5 rounded-full flex shrink-0 items-center justify-center outline-offset-1 shadow\"\n [style.background-color]=\"primaryColor.swatch\"\n ></button>\n }\n </div>\n </div>\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Surface</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (surface of surfaces; track surface.name) {\n <button\n type=\"button\"\n [title]=\"surface.name\"\n (click)=\"updateColors($event, 'surface', surface)\"\n class=\"cursor-pointer w-5 h-5 rounded-full flex shrink-0 items-center justify-center p-0 outline-offset-1\"\n [ngClass]=\"{\n 'outline outline-primary': selectedSurfaceColor()\n ? selectedSurfaceColor() === surface.name\n : store.darkTheme()\n ? surface.name === 'zinc'\n : surface.name === 'slate',\n }\"\n [style.background-color]=\"surface.swatch\"\n ></button>\n }\n </div>\n </div>\n @if (showMenuModeButton()) {\n <div class=\"flex flex-col gap-2\">\n <span id=\"helix-config-menu-mode\" class=\"text-sm text-muted-color font-semibold\">Menu Mode</span>\n <hx-select-button\n ariaLabelledby=\"helix-config-menu-mode\"\n [ngModel]=\"menuMode()\"\n (ngModelChange)=\"onMenuModeChange($event)\"\n [options]=\"menuModeOptions\"\n [allowEmpty]=\"false\"\n size=\"small\"\n />\n </div>\n }\n</div>\n",
|
|
2093
1738
|
styles: [""],
|
|
2094
1739
|
dependencies: [
|
|
2095
1740
|
{
|
|
@@ -2166,7 +1811,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2166
1811
|
],
|
|
2167
1812
|
changeDetection: ChangeDetectionStrategy.Eager,
|
|
2168
1813
|
host: { class: "hidden absolute top-13 right-0 w-72 p-4 bg-surface-0 dark:bg-surface-900 border border-surface rounded-border origin-top shadow-[0px_3px_5px_rgba(0,0,0,0.02),0px_0px_2px_rgba(0,0,0,0.05),0px_1px_4px_rgba(0,0,0,0.08)]" },
|
|
2169
|
-
template: "<div class=\"flex flex-col gap-4\">\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Primary</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (primaryColor of primaryColors
|
|
1814
|
+
template: "<div class=\"flex flex-col gap-4\">\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Primary</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (primaryColor of primaryColors; track primaryColor.name) {\n <button\n type=\"button\"\n [title]=\"primaryColor.name\"\n (click)=\"updateColors($event, 'primary', primaryColor)\"\n [ngClass]=\"{ 'outline outline-primary': primaryColor.name === activePrimaryColor() }\"\n class=\"cursor-pointer w-5 h-5 rounded-full flex shrink-0 items-center justify-center outline-offset-1 shadow\"\n [style.background-color]=\"primaryColor.swatch\"\n ></button>\n }\n </div>\n </div>\n <div>\n <span class=\"text-sm text-muted-color font-semibold\">Surface</span>\n <div class=\"pt-2 flex gap-2 flex-wrap justify-start\">\n @for (surface of surfaces; track surface.name) {\n <button\n type=\"button\"\n [title]=\"surface.name\"\n (click)=\"updateColors($event, 'surface', surface)\"\n class=\"cursor-pointer w-5 h-5 rounded-full flex shrink-0 items-center justify-center p-0 outline-offset-1\"\n [ngClass]=\"{\n 'outline outline-primary': selectedSurfaceColor()\n ? selectedSurfaceColor() === surface.name\n : store.darkTheme()\n ? surface.name === 'zinc'\n : surface.name === 'slate',\n }\"\n [style.background-color]=\"surface.swatch\"\n ></button>\n }\n </div>\n </div>\n @if (showMenuModeButton()) {\n <div class=\"flex flex-col gap-2\">\n <span id=\"helix-config-menu-mode\" class=\"text-sm text-muted-color font-semibold\">Menu Mode</span>\n <hx-select-button\n ariaLabelledby=\"helix-config-menu-mode\"\n [ngModel]=\"menuMode()\"\n (ngModelChange)=\"onMenuModeChange($event)\"\n [options]=\"menuModeOptions\"\n [allowEmpty]=\"false\"\n size=\"small\"\n />\n </div>\n }\n</div>\n"
|
|
2170
1815
|
}]
|
|
2171
1816
|
}]
|
|
2172
1817
|
});
|