@dbcdk/react-components 0.0.173 → 0.0.175
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/client.cjs +14 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/components/app-header/AppHeader.module.css +2 -2
- package/dist/components/button/Button.d.ts +3 -1
- package/dist/components/button/Button.module.css +26 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.cjs +78 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.d.ts +8 -0
- package/dist/components/color-scheme-button/ColorSchemeButton.js +75 -0
- package/dist/components/filter-field/FilterField.module.css +2 -2
- package/dist/components/forms/file-upload/FileUpload.module.css +3 -3
- package/dist/components/forms/form-select/FormSelect.d.ts +1 -1
- package/dist/components/forms/form-select/FormSelect.module.css +20 -1
- package/dist/components/forms/input/Input.cjs +1 -1
- package/dist/components/forms/input/Input.d.ts +1 -1
- package/dist/components/forms/input/Input.js +1 -1
- package/dist/components/forms/input/Input.module.css +40 -8
- package/dist/components/forms/text-area/Textarea.module.css +2 -1
- package/dist/components/forms/typeahead/Typeahead.cjs +1 -0
- package/dist/components/forms/typeahead/Typeahead.js +1 -0
- package/dist/components/hyperlink/Hyperlink.cjs +2 -1
- package/dist/components/hyperlink/Hyperlink.d.ts +2 -1
- package/dist/components/hyperlink/Hyperlink.js +2 -1
- package/dist/components/hyperlink/Hyperlink.module.css +16 -0
- package/dist/components/nav-bar/NavBar.cjs +1 -0
- package/dist/components/nav-bar/NavBar.js +1 -0
- package/dist/components/nav-bar/NavBar.module.css +10 -10
- package/dist/components/page-layout/PageLayout.module.css +1 -1
- package/dist/components/popover/Popover.cjs +4 -2
- package/dist/components/popover/Popover.d.ts +2 -0
- package/dist/components/popover/Popover.js +4 -2
- package/dist/components/popover/Popover.module.css +5 -0
- package/dist/components/theme-button/ThemeButton.cjs +30 -23
- package/dist/components/theme-button/ThemeButton.d.ts +9 -3
- package/dist/components/theme-button/ThemeButton.js +31 -24
- package/dist/components/theme-script/ThemeScript.cjs +50 -12
- package/dist/components/theme-script/ThemeScript.d.ts +35 -12
- package/dist/components/theme-script/ThemeScript.js +51 -13
- package/dist/hooks/useColorScheme.cjs +74 -0
- package/dist/hooks/useColorScheme.d.ts +6 -0
- package/dist/hooks/useColorScheme.js +72 -0
- package/dist/hooks/useTheme.cjs +116 -50
- package/dist/hooks/useTheme.d.ts +17 -5
- package/dist/hooks/useTheme.js +117 -51
- package/dist/index.cjs +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles/themes/dbc/colors.css +14 -2
- package/dist/styles/themes/filmstriben/theme.css +108 -0
- package/dist/styles/themes/types.cjs +8 -0
- package/dist/styles/themes/types.d.ts +24 -16
- package/dist/styles/themes/types.js +6 -0
- package/dist/themes/filmstriben.css +4 -0
- package/dist/utils/color-scheme.constants.cjs +11 -0
- package/dist/utils/color-scheme.constants.d.ts +4 -0
- package/dist/utils/color-scheme.constants.js +7 -0
- package/dist/utils/theme.constants.cjs +3 -7
- package/dist/utils/theme.constants.d.ts +2 -4
- package/dist/utils/theme.constants.js +3 -6
- package/package.json +1 -1
- package/dist/styles/themes/filmstriben-budget/theme.css +0 -22
- package/dist/themes/filmstriben-budget.css +0 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* Filmstriben theme entrypoint.
|
|
2
|
+
*
|
|
3
|
+
* Usage in the consuming app:
|
|
4
|
+
* - Simplest: import the convenience bundle instead of this file directly —
|
|
5
|
+
* @import '@dbcdk/react-components/themes/filmstriben.css';
|
|
6
|
+
* (bundles dbc/base.css + dbc/colors.css + this file + the shared index.css)
|
|
7
|
+
* - Or, for runtime theme switching (see useTheme/ThemeScript), import
|
|
8
|
+
* dbc's base + colors as your permanent foundation, then load this
|
|
9
|
+
* file — just the delta below — only when this theme is actually active:
|
|
10
|
+
* @import '@dbcdk/react-components/styles/themes/dbc/base.css';
|
|
11
|
+
* @import '@dbcdk/react-components/styles/themes/dbc/colors.css';
|
|
12
|
+
* @import '@dbcdk/react-components/styles/themes/filmstriben/theme.css';
|
|
13
|
+
*
|
|
14
|
+
* This file deliberately does NOT import dbc/colors.css itself (unlike a
|
|
15
|
+
* typical single-theme entrypoint) and scopes every override behind
|
|
16
|
+
* [data-product-theme='filmstriben'] instead of a bare :root — both are what
|
|
17
|
+
* let it be safely loaded *alongside* dbc's palette and toggled at runtime by
|
|
18
|
+
* flipping that attribute, without re-declaring or clobbering the whole dbc
|
|
19
|
+
* palette a second time.
|
|
20
|
+
*
|
|
21
|
+
* Uses a split brand strategy:
|
|
22
|
+
* - light theme: semantic UI primary stays on blue for contrast and clarity
|
|
23
|
+
* - dark theme: the real Filmstriben yellow, which has enough contrast there
|
|
24
|
+
*
|
|
25
|
+
* Navbar/header identity still uses the raw yellow directly because it always
|
|
26
|
+
* sits on its own guaranteed dark background.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
:root[data-product-theme='filmstriben'] {
|
|
30
|
+
--filmstriben-yellow: #ffc107;
|
|
31
|
+
--filmstriben-black: #212529;
|
|
32
|
+
|
|
33
|
+
/* Navbar — fixed dark bar regardless of light/dark color-scheme */
|
|
34
|
+
--color-navbar-bg: var(--filmstriben-black);
|
|
35
|
+
--color-navbar-fg: #ffffff;
|
|
36
|
+
--color-navbar-fg-muted: rgba(255, 255, 255, 0.9);
|
|
37
|
+
/* Softer than full navbar-fg at rest — header components escalate to full
|
|
38
|
+
strength on hover/focus (see Button/Input/FormSelect's .header variant) */
|
|
39
|
+
--color-navbar-border: color-mix(in srgb, var(--color-navbar-fg) 25%, transparent);
|
|
40
|
+
/* Active nav-link accent — the raw vivid yellow is safe here specifically
|
|
41
|
+
because it always sits on this fixed dark bar, unlike --color-brand
|
|
42
|
+
(which follows light-dark() for the page's own background) */
|
|
43
|
+
--color-navbar-brand: var(--filmstriben-yellow);
|
|
44
|
+
|
|
45
|
+
/* Logo lockup — sits on the light page surface (via --color-logo-bg's
|
|
46
|
+
tint) or the dark navbar, never as flat text on a plain white bg, so
|
|
47
|
+
the raw vivid yellow is safe here unlike a general --color-brand value */
|
|
48
|
+
--color-logo: var(--filmstriben-yellow);
|
|
49
|
+
--color-logo-bg: color-mix(in srgb, var(--color-logo) 10%, var(--color-bg-surface));
|
|
50
|
+
--color-logo-fg: var(--filmstriben-black);
|
|
51
|
+
|
|
52
|
+
/* Light-theme UI primary stays semantic and high-contrast; Filmstriben's
|
|
53
|
+
real yellow remains available for identity-bearing accents instead. */
|
|
54
|
+
--color-brand: var(--dbc-blue-500);
|
|
55
|
+
--color-brand-hover: var(--dbc-blue-600);
|
|
56
|
+
--color-brand-strong: var(--dbc-blue-600);
|
|
57
|
+
--color-fg-on-brand: #ffffff;
|
|
58
|
+
--color-border-selected: var(--color-brand);
|
|
59
|
+
--color-field-focus: var(--dbc-blue-500);
|
|
60
|
+
--color-focus-ring: var(--dbc-blue-300);
|
|
61
|
+
--focus-ring: 0 0 0 3px rgba(12, 62, 227, 0.25);
|
|
62
|
+
--color-link: var(--dbc-blue-500);
|
|
63
|
+
--color-link-hover: var(--dbc-blue-600);
|
|
64
|
+
--color-bg-selected: var(--dbc-blue-100);
|
|
65
|
+
--color-bg-selected-hover: var(--dbc-blue-150);
|
|
66
|
+
--color-chart-primary: color-mix(in srgb, var(--color-brand) 75%, rgb(255 255 255 / 0));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:root[data-product-theme='filmstriben'][data-theme='dark'] {
|
|
70
|
+
/* Dark surfaces tuned to the navbar's grey-black identity instead of dbc's cooler blue darks. */
|
|
71
|
+
--filmstriben-surface-page: #212529;
|
|
72
|
+
--filmstriben-surface-subtle: #2a2f34;
|
|
73
|
+
--filmstriben-surface-strong: #161a1d;
|
|
74
|
+
--filmstriben-surface-hover: #343a40;
|
|
75
|
+
--filmstriben-surface-inverse: #34393f;
|
|
76
|
+
--filmstriben-table-row-alt: #1c2024;
|
|
77
|
+
--filmstriben-yellow-hover: #ffca2c;
|
|
78
|
+
--filmstriben-yellow-strong: #ffcd39;
|
|
79
|
+
--filmstriben-yellow-soft: #4a3a06;
|
|
80
|
+
--filmstriben-yellow-soft-hover: #5b4707;
|
|
81
|
+
|
|
82
|
+
--color-bg-page: var(--filmstriben-surface-page);
|
|
83
|
+
--color-bg-surface: var(--filmstriben-surface-page);
|
|
84
|
+
--color-bg-surface-subtle: var(--filmstriben-surface-subtle);
|
|
85
|
+
--color-bg-surface-strong: var(--filmstriben-surface-strong);
|
|
86
|
+
--color-bg-inverse: var(--filmstriben-surface-inverse);
|
|
87
|
+
--color-bg-toolbar: var(--filmstriben-surface-subtle);
|
|
88
|
+
--color-bg-toolbar-hover: var(--filmstriben-surface-hover);
|
|
89
|
+
|
|
90
|
+
--table-header-bg: var(--filmstriben-surface-subtle);
|
|
91
|
+
--table-row-bg: var(--filmstriben-surface-page);
|
|
92
|
+
--table-row-bg-alt: var(--filmstriben-table-row-alt);
|
|
93
|
+
--table-row-bg-hover: var(--filmstriben-surface-subtle);
|
|
94
|
+
|
|
95
|
+
/* In dark mode the Filmstriben yellow has enough contrast to become the primary brand color. */
|
|
96
|
+
--color-brand: var(--filmstriben-yellow);
|
|
97
|
+
--color-brand-hover: var(--filmstriben-yellow-hover);
|
|
98
|
+
--color-brand-strong: var(--filmstriben-yellow-strong);
|
|
99
|
+
--color-fg-on-brand: var(--filmstriben-black);
|
|
100
|
+
--color-border-selected: var(--color-brand);
|
|
101
|
+
--color-field-focus: var(--dbc-blue-300);
|
|
102
|
+
--color-focus-ring: var(--filmstriben-yellow);
|
|
103
|
+
--focus-ring: 0 0 0 3px color-mix(in srgb, var(--filmstriben-yellow) 35%, transparent);
|
|
104
|
+
|
|
105
|
+
--color-bg-selected: var(--filmstriben-yellow-soft);
|
|
106
|
+
--color-bg-selected-hover: var(--filmstriben-yellow-soft-hover);
|
|
107
|
+
--color-chart-primary: color-mix(in srgb, var(--color-brand) 75%, rgb(255 255 255 / 0));
|
|
108
|
+
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Every product theme this library ships (folders under
|
|
3
|
+
* `src/styles/themes/`). A closed set on purpose, mirroring `ColorScheme`
|
|
4
|
+
* (`'light' | 'dark' | 'system'`) for the color-scheme axis: the library
|
|
5
|
+
* owns which themes exist and what they're called, so consuming apps never
|
|
6
|
+
* need to invent their own labels or types for them — just pass ids.
|
|
7
|
+
* TypeScript-only enforcement; add an id here (and to `THEME_LABELS`)
|
|
8
|
+
* whenever a new theme folder is added.
|
|
9
|
+
*/
|
|
10
|
+
export declare const THEME_IDS: readonly ["dbc", "filmstriben"];
|
|
11
|
+
export type ThemeId = (typeof THEME_IDS)[number];
|
|
12
|
+
export declare const THEME_LABELS: Record<ThemeId, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Per-theme override for where to fetch its CSS from at runtime. Only
|
|
15
|
+
* needed for a theme whose CSS isn't already loaded some other way by the
|
|
16
|
+
* app — omit an id (or leave its value `''`/unset) for a theme that's
|
|
17
|
+
* already bundled statically alongside whatever the app already imports.
|
|
18
|
+
*
|
|
19
|
+
* This is the only piece of theme data `ThemeScript`/`useTheme` actually
|
|
20
|
+
* need at runtime (which id to inject a `<link>` for, and its URL) — they
|
|
21
|
+
* don't need the full enumerated id list or labels, only whichever UI
|
|
22
|
+
* renders the switcher (`ThemeButton`/`ThemeMenuSection`) does.
|
|
23
|
+
*/
|
|
24
|
+
export type ThemeHrefs = Partial<Record<ThemeId, string>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const COLOR_SCHEMES = ["light", "dark", "system"];
|
|
4
|
+
const COLOR_SCHEME_STORAGE_KEY = "dbc_theme";
|
|
5
|
+
function isColorScheme(x) {
|
|
6
|
+
return !!x && COLOR_SCHEMES.includes(x);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
exports.COLOR_SCHEMES = COLOR_SCHEMES;
|
|
10
|
+
exports.COLOR_SCHEME_STORAGE_KEY = COLOR_SCHEME_STORAGE_KEY;
|
|
11
|
+
exports.isColorScheme = isColorScheme;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const COLOR_SCHEMES: readonly ["light", "dark", "system"];
|
|
2
|
+
export type ColorScheme = (typeof COLOR_SCHEMES)[number];
|
|
3
|
+
export declare const COLOR_SCHEME_STORAGE_KEY = "dbc_theme";
|
|
4
|
+
export declare function isColorScheme(x: string | null | undefined): x is ColorScheme;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
function isThemeVariant(x) {
|
|
6
|
-
return !!x && THEME_VARIANTS.includes(x);
|
|
7
|
-
}
|
|
3
|
+
const THEME_STORAGE_KEY = "dbc_product_theme";
|
|
4
|
+
const THEME_LINK_ID = "dbc-theme-link";
|
|
8
5
|
|
|
6
|
+
exports.THEME_LINK_ID = THEME_LINK_ID;
|
|
9
7
|
exports.THEME_STORAGE_KEY = THEME_STORAGE_KEY;
|
|
10
|
-
exports.THEME_VARIANTS = THEME_VARIANTS;
|
|
11
|
-
exports.isThemeVariant = isThemeVariant;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export
|
|
3
|
-
export declare const THEME_STORAGE_KEY = "dbc_theme";
|
|
4
|
-
export declare function isThemeVariant(x: string | null | undefined): x is ThemeVariant;
|
|
1
|
+
export declare const THEME_STORAGE_KEY = "dbc_product_theme";
|
|
2
|
+
export declare const THEME_LINK_ID = "dbc-theme-link";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
function isThemeVariant(x) {
|
|
4
|
-
return !!x && THEME_VARIANTS.includes(x);
|
|
5
|
-
}
|
|
1
|
+
const THEME_STORAGE_KEY = "dbc_product_theme";
|
|
2
|
+
const THEME_LINK_ID = "dbc-theme-link";
|
|
6
3
|
|
|
7
|
-
export {
|
|
4
|
+
export { THEME_LINK_ID, THEME_STORAGE_KEY };
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* Filmstriben Budget theme entrypoint.
|
|
2
|
-
*
|
|
3
|
-
* Usage in the consuming app — only two imports needed:
|
|
4
|
-
* @import '@dbcdk/react-components/styles/themes/dbc/base.css';
|
|
5
|
-
* @import '@dbcdk/react-components/styles/themes/filmstriben-budget/theme.css';
|
|
6
|
-
*
|
|
7
|
-
* Pulls in the shared DBC color layer, then overrides only the
|
|
8
|
-
* --color-logo-* tokens. --color-brand and every other semantic/app color
|
|
9
|
-
* stay on the shared DBC palette — buttons, links, focus rings, selected
|
|
10
|
-
* states, charts, and warnings are unaffected.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
@import '../dbc/colors.css';
|
|
14
|
-
|
|
15
|
-
:root {
|
|
16
|
-
--filmstriben-yellow: #ffc107;
|
|
17
|
-
--filmstriben-black: #212529;
|
|
18
|
-
|
|
19
|
-
--color-logo: var(--filmstriben-yellow);
|
|
20
|
-
--color-logo-bg: color-mix(in srgb, var(--color-logo) 10%, var(--color-bg-surface));
|
|
21
|
-
--color-logo-fg: var(--filmstriben-black);
|
|
22
|
-
}
|