@deadragdoll/reactnu 0.1.77 → 0.1.79
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/index.cjs +83 -12
- package/dist/index.js +83 -12
- package/dist/theme/themes.d.ts +5 -0
- package/docs/NuThemeProvider.md +5 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10577,6 +10577,9 @@ var phosphorTheme = {
|
|
|
10577
10577
|
var midnightTheme = {
|
|
10578
10578
|
name: "midnight",
|
|
10579
10579
|
label: "Midnight Slate",
|
|
10580
|
+
desktopPatternMode: "coarse-dots",
|
|
10581
|
+
fontFamily: '"Courier New", Courier, monospace',
|
|
10582
|
+
fontSize: 15,
|
|
10580
10583
|
tokens: {
|
|
10581
10584
|
desktopBackground: "#1b2430",
|
|
10582
10585
|
desktopPattern: "rgb(156 177 201 / 0.24)",
|
|
@@ -10586,10 +10589,10 @@ var midnightTheme = {
|
|
|
10586
10589
|
chromeBackground: "#36547d",
|
|
10587
10590
|
panelBackground: "#192c43",
|
|
10588
10591
|
panelInsetBackground: "#111e2e",
|
|
10589
|
-
titleBackground: "#
|
|
10590
|
-
menuBackground: "#
|
|
10591
|
-
titleText: "#
|
|
10592
|
-
textPrimary: "#
|
|
10592
|
+
titleBackground: "#1b3550",
|
|
10593
|
+
menuBackground: "#1a2337",
|
|
10594
|
+
titleText: "#a8cbff",
|
|
10595
|
+
textPrimary: "#b3d2ff",
|
|
10593
10596
|
textMuted: "#65a8ec",
|
|
10594
10597
|
textInverse: "#b7caf0",
|
|
10595
10598
|
mainMenuText: "#b7caf0",
|
|
@@ -10598,7 +10601,7 @@ var midnightTheme = {
|
|
|
10598
10601
|
buttonFace: "#5074af",
|
|
10599
10602
|
buttonFaceAlt: "#3c5372",
|
|
10600
10603
|
buttonDanger: "#4e0e15",
|
|
10601
|
-
buttonSuccess: "#
|
|
10604
|
+
buttonSuccess: "#275214",
|
|
10602
10605
|
buttonText: "#ffffff",
|
|
10603
10606
|
fieldBackground: "#09111c",
|
|
10604
10607
|
fieldText: "#627b9d",
|
|
@@ -10610,6 +10613,66 @@ var midnightTheme = {
|
|
|
10610
10613
|
focusColor: "#af532c",
|
|
10611
10614
|
windowInactiveOverlay: "rgb(7 12 20 / 0.3)",
|
|
10612
10615
|
windowModalBackdrop: "rgb(7 12 20 / 0.48)"
|
|
10616
|
+
},
|
|
10617
|
+
visualTokens: {
|
|
10618
|
+
"--nu-glyph-cell-size": "1em",
|
|
10619
|
+
"--nu-content-inset": "1em 1ch",
|
|
10620
|
+
"--nu-control-height": "1.2em",
|
|
10621
|
+
"--nu-space-xs": "0.25rem",
|
|
10622
|
+
"--nu-space-sm": "0.5rem",
|
|
10623
|
+
"--nu-space-md": "0.75rem",
|
|
10624
|
+
"--nu-space-lg": "1rem",
|
|
10625
|
+
"--nu-space-xl": "1.5rem",
|
|
10626
|
+
"--nu-radius-none": "0",
|
|
10627
|
+
"--nu-window-title-height": "calc(1em + 10px)",
|
|
10628
|
+
"--nu-window-status-height": "1.35rem",
|
|
10629
|
+
"--nu-window-title-controls-width": "7.8ch",
|
|
10630
|
+
"--nu-window-title-icon-width": "1em",
|
|
10631
|
+
"--nu-frame-thickness": "1px",
|
|
10632
|
+
"--nu-rule-thickness": "1px",
|
|
10633
|
+
"--nu-window-shadow-offset-x": "1ch",
|
|
10634
|
+
"--nu-window-shadow-offset-y": "1em",
|
|
10635
|
+
"--nu-button-shadow-x": "1ch",
|
|
10636
|
+
"--nu-button-shadow-y": "calc(var(--nu-control-height) / 2)",
|
|
10637
|
+
"--nu-button-shadow-offset-x": "var(--nu-button-shadow-x)",
|
|
10638
|
+
"--nu-button-shadow-offset-y": "calc(var(--nu-control-height) / 2)",
|
|
10639
|
+
"--nu-button-press-depth-x": "0.18em",
|
|
10640
|
+
"--nu-button-press-depth-y": "0.1em",
|
|
10641
|
+
"--nu-app-bar-height": "2.1rem",
|
|
10642
|
+
"--nu-app-bar-padding": "0.2rem 0.35rem",
|
|
10643
|
+
"--nu-toolbar-background": "#1b3550",
|
|
10644
|
+
"--nu-toolbar-inset": "1ch",
|
|
10645
|
+
"--nu-toolbar-border-color": "var(--nu-border-dark)",
|
|
10646
|
+
"--nu-toolbar-border-style": "none",
|
|
10647
|
+
"--nu-toolbar-border-width": "var(--nu-rule-thickness)",
|
|
10648
|
+
"--nu-toolbar-separator-color": "#6184bd",
|
|
10649
|
+
"--nu-toolbar-separator-style": "solid",
|
|
10650
|
+
"--nu-toolbar-separator-width": "var(--nu-rule-thickness)",
|
|
10651
|
+
"--nu-menu-divider-color": "#3d5a8a",
|
|
10652
|
+
"--nu-menu-divider-style": "solid",
|
|
10653
|
+
"--nu-menu-divider-width": "var(--nu-rule-thickness)",
|
|
10654
|
+
"--nu-window-shadow-bg": "rgb(0 0 0 / 0.38)",
|
|
10655
|
+
"--nu-window-inactive-border": "color-mix(in srgb, var(--nu-border-light) 78%, var(--nu-border-dark))",
|
|
10656
|
+
"--nu-scrollbar-track": "transparent",
|
|
10657
|
+
"--nu-scrollbar-thumb": "var(--nu-color-button-face)",
|
|
10658
|
+
"--nu-scrollbar-button-bg": "var(--nu-color-button-face)",
|
|
10659
|
+
"--nu-scrollbar-button-size": "0.875rem",
|
|
10660
|
+
"--nu-icon-grid-icon-background": "transparent",
|
|
10661
|
+
"--nu-icon-grid-icon-border-color": "transparent",
|
|
10662
|
+
"--nu-icon-grid-icon-border-style": "solid",
|
|
10663
|
+
"--nu-icon-grid-icon-opacity": "1",
|
|
10664
|
+
"--nu-icon-grid-icon-selected-background": "var(--nu-color-title-bg)",
|
|
10665
|
+
"--nu-icon-grid-icon-inactive-selected-background": "color-mix(in srgb, var(--nu-icon-grid-icon-selected-background) 65%, var(--nu-color-app-bg-alt))",
|
|
10666
|
+
"--nu-icon-grid-icon-selected-border-color": "transparent",
|
|
10667
|
+
"--nu-icon-grid-icon-selected-border-style": "none",
|
|
10668
|
+
"--nu-icon-grid-icon-selected-opacity": "1",
|
|
10669
|
+
"--nu-icon-grid-icon-focus-background": "#153051",
|
|
10670
|
+
"--nu-icon-grid-icon-focus-border-color": "#5672bd",
|
|
10671
|
+
"--nu-icon-grid-icon-focus-border-style": "solid",
|
|
10672
|
+
"--nu-icon-grid-icon-focus-opacity": "1",
|
|
10673
|
+
"--nu-icon-grid-icon-disabled-opacity": "0.6",
|
|
10674
|
+
"--nu-icon-grid-icon-drag-opacity": "0.35",
|
|
10675
|
+
"--nu-icon-grid-icon-drag-preview-opacity": "0.85"
|
|
10613
10676
|
}
|
|
10614
10677
|
};
|
|
10615
10678
|
var grayscaleTheme = {
|
|
@@ -10698,7 +10761,8 @@ function getNuThemeStyle(theme) {
|
|
|
10698
10761
|
"--nu-panel-shadow-color": theme.tokens.panelShadowColor,
|
|
10699
10762
|
"--nu-focus-color": theme.tokens.focusColor ?? theme.tokens.borderAccent,
|
|
10700
10763
|
"--nu-window-inactive-overlay": theme.tokens.windowInactiveOverlay,
|
|
10701
|
-
"--nu-window-modal-backdrop": theme.tokens.windowModalBackdrop
|
|
10764
|
+
"--nu-window-modal-backdrop": theme.tokens.windowModalBackdrop,
|
|
10765
|
+
...theme.visualTokens
|
|
10702
10766
|
};
|
|
10703
10767
|
}
|
|
10704
10768
|
function getNuDesktopPatternStyle(mode) {
|
|
@@ -10754,9 +10818,9 @@ function NuThemeProvider({
|
|
|
10754
10818
|
children,
|
|
10755
10819
|
className,
|
|
10756
10820
|
crtGlitch = false,
|
|
10757
|
-
defaultDesktopPatternMode
|
|
10758
|
-
defaultFontFamily
|
|
10759
|
-
defaultFontSize
|
|
10821
|
+
defaultDesktopPatternMode,
|
|
10822
|
+
defaultFontFamily,
|
|
10823
|
+
defaultFontSize,
|
|
10760
10824
|
defaultTheme = "classic",
|
|
10761
10825
|
desktopPatternMode,
|
|
10762
10826
|
fontFamily,
|
|
@@ -10769,10 +10833,17 @@ function NuThemeProvider({
|
|
|
10769
10833
|
theme
|
|
10770
10834
|
}) {
|
|
10771
10835
|
const generatedId = (0, import_react49.useId)();
|
|
10836
|
+
const defaultThemeDefinition = resolveNuTheme(theme ?? defaultTheme);
|
|
10772
10837
|
const [internalTheme, setInternalTheme] = (0, import_react49.useState)(defaultTheme);
|
|
10773
|
-
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = (0, import_react49.useState)(
|
|
10774
|
-
|
|
10775
|
-
|
|
10838
|
+
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = (0, import_react49.useState)(
|
|
10839
|
+
() => defaultDesktopPatternMode ?? defaultThemeDefinition.desktopPatternMode ?? "dot-grid"
|
|
10840
|
+
);
|
|
10841
|
+
const [internalFontFamily, setInternalFontFamily] = (0, import_react49.useState)(
|
|
10842
|
+
() => defaultFontFamily ?? defaultThemeDefinition.fontFamily ?? '"IBM Plex Mono", "Cascadia Mono", "Consolas", monospace'
|
|
10843
|
+
);
|
|
10844
|
+
const [internalFontSize, setInternalFontSize] = (0, import_react49.useState)(
|
|
10845
|
+
() => defaultFontSize ?? defaultThemeDefinition.fontSize ?? 16
|
|
10846
|
+
);
|
|
10776
10847
|
const currentTheme = theme ?? internalTheme;
|
|
10777
10848
|
const resolvedDesktopPatternMode = desktopPatternMode ?? internalDesktopPatternMode;
|
|
10778
10849
|
const resolvedFontFamily = fontFamily ?? internalFontFamily;
|
package/dist/index.js
CHANGED
|
@@ -10626,6 +10626,9 @@ var phosphorTheme = {
|
|
|
10626
10626
|
var midnightTheme = {
|
|
10627
10627
|
name: "midnight",
|
|
10628
10628
|
label: "Midnight Slate",
|
|
10629
|
+
desktopPatternMode: "coarse-dots",
|
|
10630
|
+
fontFamily: '"Courier New", Courier, monospace',
|
|
10631
|
+
fontSize: 15,
|
|
10629
10632
|
tokens: {
|
|
10630
10633
|
desktopBackground: "#1b2430",
|
|
10631
10634
|
desktopPattern: "rgb(156 177 201 / 0.24)",
|
|
@@ -10635,10 +10638,10 @@ var midnightTheme = {
|
|
|
10635
10638
|
chromeBackground: "#36547d",
|
|
10636
10639
|
panelBackground: "#192c43",
|
|
10637
10640
|
panelInsetBackground: "#111e2e",
|
|
10638
|
-
titleBackground: "#
|
|
10639
|
-
menuBackground: "#
|
|
10640
|
-
titleText: "#
|
|
10641
|
-
textPrimary: "#
|
|
10641
|
+
titleBackground: "#1b3550",
|
|
10642
|
+
menuBackground: "#1a2337",
|
|
10643
|
+
titleText: "#a8cbff",
|
|
10644
|
+
textPrimary: "#b3d2ff",
|
|
10642
10645
|
textMuted: "#65a8ec",
|
|
10643
10646
|
textInverse: "#b7caf0",
|
|
10644
10647
|
mainMenuText: "#b7caf0",
|
|
@@ -10647,7 +10650,7 @@ var midnightTheme = {
|
|
|
10647
10650
|
buttonFace: "#5074af",
|
|
10648
10651
|
buttonFaceAlt: "#3c5372",
|
|
10649
10652
|
buttonDanger: "#4e0e15",
|
|
10650
|
-
buttonSuccess: "#
|
|
10653
|
+
buttonSuccess: "#275214",
|
|
10651
10654
|
buttonText: "#ffffff",
|
|
10652
10655
|
fieldBackground: "#09111c",
|
|
10653
10656
|
fieldText: "#627b9d",
|
|
@@ -10659,6 +10662,66 @@ var midnightTheme = {
|
|
|
10659
10662
|
focusColor: "#af532c",
|
|
10660
10663
|
windowInactiveOverlay: "rgb(7 12 20 / 0.3)",
|
|
10661
10664
|
windowModalBackdrop: "rgb(7 12 20 / 0.48)"
|
|
10665
|
+
},
|
|
10666
|
+
visualTokens: {
|
|
10667
|
+
"--nu-glyph-cell-size": "1em",
|
|
10668
|
+
"--nu-content-inset": "1em 1ch",
|
|
10669
|
+
"--nu-control-height": "1.2em",
|
|
10670
|
+
"--nu-space-xs": "0.25rem",
|
|
10671
|
+
"--nu-space-sm": "0.5rem",
|
|
10672
|
+
"--nu-space-md": "0.75rem",
|
|
10673
|
+
"--nu-space-lg": "1rem",
|
|
10674
|
+
"--nu-space-xl": "1.5rem",
|
|
10675
|
+
"--nu-radius-none": "0",
|
|
10676
|
+
"--nu-window-title-height": "calc(1em + 10px)",
|
|
10677
|
+
"--nu-window-status-height": "1.35rem",
|
|
10678
|
+
"--nu-window-title-controls-width": "7.8ch",
|
|
10679
|
+
"--nu-window-title-icon-width": "1em",
|
|
10680
|
+
"--nu-frame-thickness": "1px",
|
|
10681
|
+
"--nu-rule-thickness": "1px",
|
|
10682
|
+
"--nu-window-shadow-offset-x": "1ch",
|
|
10683
|
+
"--nu-window-shadow-offset-y": "1em",
|
|
10684
|
+
"--nu-button-shadow-x": "1ch",
|
|
10685
|
+
"--nu-button-shadow-y": "calc(var(--nu-control-height) / 2)",
|
|
10686
|
+
"--nu-button-shadow-offset-x": "var(--nu-button-shadow-x)",
|
|
10687
|
+
"--nu-button-shadow-offset-y": "calc(var(--nu-control-height) / 2)",
|
|
10688
|
+
"--nu-button-press-depth-x": "0.18em",
|
|
10689
|
+
"--nu-button-press-depth-y": "0.1em",
|
|
10690
|
+
"--nu-app-bar-height": "2.1rem",
|
|
10691
|
+
"--nu-app-bar-padding": "0.2rem 0.35rem",
|
|
10692
|
+
"--nu-toolbar-background": "#1b3550",
|
|
10693
|
+
"--nu-toolbar-inset": "1ch",
|
|
10694
|
+
"--nu-toolbar-border-color": "var(--nu-border-dark)",
|
|
10695
|
+
"--nu-toolbar-border-style": "none",
|
|
10696
|
+
"--nu-toolbar-border-width": "var(--nu-rule-thickness)",
|
|
10697
|
+
"--nu-toolbar-separator-color": "#6184bd",
|
|
10698
|
+
"--nu-toolbar-separator-style": "solid",
|
|
10699
|
+
"--nu-toolbar-separator-width": "var(--nu-rule-thickness)",
|
|
10700
|
+
"--nu-menu-divider-color": "#3d5a8a",
|
|
10701
|
+
"--nu-menu-divider-style": "solid",
|
|
10702
|
+
"--nu-menu-divider-width": "var(--nu-rule-thickness)",
|
|
10703
|
+
"--nu-window-shadow-bg": "rgb(0 0 0 / 0.38)",
|
|
10704
|
+
"--nu-window-inactive-border": "color-mix(in srgb, var(--nu-border-light) 78%, var(--nu-border-dark))",
|
|
10705
|
+
"--nu-scrollbar-track": "transparent",
|
|
10706
|
+
"--nu-scrollbar-thumb": "var(--nu-color-button-face)",
|
|
10707
|
+
"--nu-scrollbar-button-bg": "var(--nu-color-button-face)",
|
|
10708
|
+
"--nu-scrollbar-button-size": "0.875rem",
|
|
10709
|
+
"--nu-icon-grid-icon-background": "transparent",
|
|
10710
|
+
"--nu-icon-grid-icon-border-color": "transparent",
|
|
10711
|
+
"--nu-icon-grid-icon-border-style": "solid",
|
|
10712
|
+
"--nu-icon-grid-icon-opacity": "1",
|
|
10713
|
+
"--nu-icon-grid-icon-selected-background": "var(--nu-color-title-bg)",
|
|
10714
|
+
"--nu-icon-grid-icon-inactive-selected-background": "color-mix(in srgb, var(--nu-icon-grid-icon-selected-background) 65%, var(--nu-color-app-bg-alt))",
|
|
10715
|
+
"--nu-icon-grid-icon-selected-border-color": "transparent",
|
|
10716
|
+
"--nu-icon-grid-icon-selected-border-style": "none",
|
|
10717
|
+
"--nu-icon-grid-icon-selected-opacity": "1",
|
|
10718
|
+
"--nu-icon-grid-icon-focus-background": "#153051",
|
|
10719
|
+
"--nu-icon-grid-icon-focus-border-color": "#5672bd",
|
|
10720
|
+
"--nu-icon-grid-icon-focus-border-style": "solid",
|
|
10721
|
+
"--nu-icon-grid-icon-focus-opacity": "1",
|
|
10722
|
+
"--nu-icon-grid-icon-disabled-opacity": "0.6",
|
|
10723
|
+
"--nu-icon-grid-icon-drag-opacity": "0.35",
|
|
10724
|
+
"--nu-icon-grid-icon-drag-preview-opacity": "0.85"
|
|
10662
10725
|
}
|
|
10663
10726
|
};
|
|
10664
10727
|
var grayscaleTheme = {
|
|
@@ -10747,7 +10810,8 @@ function getNuThemeStyle(theme) {
|
|
|
10747
10810
|
"--nu-panel-shadow-color": theme.tokens.panelShadowColor,
|
|
10748
10811
|
"--nu-focus-color": theme.tokens.focusColor ?? theme.tokens.borderAccent,
|
|
10749
10812
|
"--nu-window-inactive-overlay": theme.tokens.windowInactiveOverlay,
|
|
10750
|
-
"--nu-window-modal-backdrop": theme.tokens.windowModalBackdrop
|
|
10813
|
+
"--nu-window-modal-backdrop": theme.tokens.windowModalBackdrop,
|
|
10814
|
+
...theme.visualTokens
|
|
10751
10815
|
};
|
|
10752
10816
|
}
|
|
10753
10817
|
function getNuDesktopPatternStyle(mode) {
|
|
@@ -10803,9 +10867,9 @@ function NuThemeProvider({
|
|
|
10803
10867
|
children,
|
|
10804
10868
|
className,
|
|
10805
10869
|
crtGlitch = false,
|
|
10806
|
-
defaultDesktopPatternMode
|
|
10807
|
-
defaultFontFamily
|
|
10808
|
-
defaultFontSize
|
|
10870
|
+
defaultDesktopPatternMode,
|
|
10871
|
+
defaultFontFamily,
|
|
10872
|
+
defaultFontSize,
|
|
10809
10873
|
defaultTheme = "classic",
|
|
10810
10874
|
desktopPatternMode,
|
|
10811
10875
|
fontFamily,
|
|
@@ -10818,10 +10882,17 @@ function NuThemeProvider({
|
|
|
10818
10882
|
theme
|
|
10819
10883
|
}) {
|
|
10820
10884
|
const generatedId = useId18();
|
|
10885
|
+
const defaultThemeDefinition = resolveNuTheme(theme ?? defaultTheme);
|
|
10821
10886
|
const [internalTheme, setInternalTheme] = useState32(defaultTheme);
|
|
10822
|
-
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = useState32(
|
|
10823
|
-
|
|
10824
|
-
|
|
10887
|
+
const [internalDesktopPatternMode, setInternalDesktopPatternMode] = useState32(
|
|
10888
|
+
() => defaultDesktopPatternMode ?? defaultThemeDefinition.desktopPatternMode ?? "dot-grid"
|
|
10889
|
+
);
|
|
10890
|
+
const [internalFontFamily, setInternalFontFamily] = useState32(
|
|
10891
|
+
() => defaultFontFamily ?? defaultThemeDefinition.fontFamily ?? '"IBM Plex Mono", "Cascadia Mono", "Consolas", monospace'
|
|
10892
|
+
);
|
|
10893
|
+
const [internalFontSize, setInternalFontSize] = useState32(
|
|
10894
|
+
() => defaultFontSize ?? defaultThemeDefinition.fontSize ?? 16
|
|
10895
|
+
);
|
|
10825
10896
|
const currentTheme = theme ?? internalTheme;
|
|
10826
10897
|
const resolvedDesktopPatternMode = desktopPatternMode ?? internalDesktopPatternMode;
|
|
10827
10898
|
const resolvedFontFamily = fontFamily ?? internalFontFamily;
|
package/dist/theme/themes.d.ts
CHANGED
|
@@ -34,10 +34,15 @@ export type NuThemeTokens = {
|
|
|
34
34
|
windowInactiveOverlay: string;
|
|
35
35
|
windowModalBackdrop: string;
|
|
36
36
|
};
|
|
37
|
+
export type NuThemeVisualTokens = Record<`--nu-${string}`, string>;
|
|
37
38
|
export type NuThemeDefinition = {
|
|
39
|
+
desktopPatternMode?: NuDesktopPatternMode;
|
|
40
|
+
fontFamily?: string;
|
|
41
|
+
fontSize?: number;
|
|
38
42
|
name: string;
|
|
39
43
|
label: string;
|
|
40
44
|
tokens: NuThemeTokens;
|
|
45
|
+
visualTokens?: NuThemeVisualTokens;
|
|
41
46
|
};
|
|
42
47
|
export declare const nuThemes: {
|
|
43
48
|
readonly classic: NuThemeDefinition;
|
package/docs/NuThemeProvider.md
CHANGED
|
@@ -63,7 +63,11 @@ Supported props:
|
|
|
63
63
|
|
|
64
64
|
- Built-in themes are `classic` (default), `amber`, `phosphor`, `midnight`, and
|
|
65
65
|
`grayscale`.
|
|
66
|
-
-
|
|
66
|
+
- Built-in themes may also define default desktop pattern, typography, and
|
|
67
|
+
visual CSS-token overrides. Explicit provider props still take precedence.
|
|
68
|
+
- `midnight` is a dark slate-blue palette with blue chrome, a burnt-orange
|
|
69
|
+
focus accent, coarse dots, and dedicated window, toolbar, menu, and icon-grid
|
|
70
|
+
chrome tokens.
|
|
67
71
|
- `grayscale` is a high-contrast monochrome monitor palette. Semantic button variants use brightness rather than hue.
|
|
68
72
|
- Theme tokens drive desktop, windowing, controls, selection, and inactive overlays.
|
|
69
73
|
- Provider typography affects preview content, managed windows, dialogs, menus, and popup portals rendered inside the theme scope.
|