@dbcdk/react-components 0.0.195 → 0.0.197
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/README.md +78 -10
- package/dist/client.cjs +486 -614
- package/dist/client.d.ts +176 -102
- package/dist/client.js +102 -102
- package/dist/components/color-scheme-button/ColorSchemeButton.cjs +7 -4
- package/dist/components/color-scheme-button/ColorSchemeButton.d.ts +7 -3
- package/dist/components/color-scheme-button/ColorSchemeButton.js +7 -4
- package/dist/components/forms/text-area/Textarea.cjs +2 -1
- package/dist/components/forms/text-area/Textarea.d.ts +1 -0
- package/dist/components/forms/text-area/Textarea.js +2 -1
- package/dist/components/highlighted-text/HighlightedText.cjs +6 -3
- package/dist/components/highlighted-text/HighlightedText.js +7 -4
- package/dist/components/json-viewer/JsonNode.cjs +27 -67
- package/dist/components/json-viewer/JsonNode.d.ts +10 -0
- package/dist/components/json-viewer/JsonNode.js +28 -68
- package/dist/components/json-viewer/JsonRow.cjs +85 -0
- package/dist/components/json-viewer/JsonRow.d.ts +5 -0
- package/dist/components/json-viewer/JsonRow.js +79 -0
- package/dist/components/json-viewer/JsonViewer.cjs +36 -253
- package/dist/components/json-viewer/JsonViewer.js +37 -250
- package/dist/components/json-viewer/JsonViewerShell.cjs +208 -0
- package/dist/components/json-viewer/JsonViewerShell.d.ts +25 -0
- package/dist/components/json-viewer/JsonViewerShell.js +202 -0
- package/dist/components/json-viewer/TanstackJsonViewer.cjs +127 -0
- package/dist/components/json-viewer/TanstackJsonViewer.d.ts +17 -0
- package/dist/components/json-viewer/TanstackJsonViewer.js +121 -0
- package/dist/components/json-viewer/types.d.ts +27 -0
- package/dist/components/json-viewer/useJsonViewerState.cjs +111 -0
- package/dist/components/json-viewer/useJsonViewerState.d.ts +42 -0
- package/dist/components/json-viewer/useJsonViewerState.js +108 -0
- package/dist/components/json-viewer/utils.cjs +36 -0
- package/dist/components/json-viewer/utils.d.ts +21 -1
- package/dist/components/json-viewer/utils.js +35 -1
- package/dist/components/lightbox/Lightbox.cjs +2 -2
- package/dist/components/lightbox/Lightbox.d.ts +1 -1
- package/dist/components/lightbox/Lightbox.js +1 -1
- package/dist/components/menu/Menu.cjs +3 -23
- package/dist/components/menu/Menu.js +3 -23
- package/dist/components/menu/Menu.module.css +4 -3
- package/dist/components/metric-tile/MetricTile.cjs +3 -2
- package/dist/components/metric-tile/MetricTile.js +2 -1
- package/dist/components/overlay/tooltip/Tooltip.cjs +7 -2
- package/dist/components/overlay/tooltip/Tooltip.d.ts +7 -1
- package/dist/components/overlay/tooltip/Tooltip.js +7 -2
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +7 -1
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +7 -1
- package/dist/components/page-layout/PageLayout.module.css +1 -1
- package/dist/components/table/Table.cjs +45 -16
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +47 -18
- package/dist/components/table/Table.module.css +135 -7
- package/dist/components/table/Table.types.d.ts +47 -1
- package/dist/components/table/TanstackTable.cjs +30 -2
- package/dist/components/table/TanstackTable.js +31 -3
- package/dist/components/table/components/TableBody.d.ts +1 -2
- package/dist/components/table/components/TableHeader.cjs +6 -4
- package/dist/components/table/components/TableHeader.d.ts +2 -1
- package/dist/components/table/components/TableHeader.js +6 -4
- package/dist/components/table/components/TableHeaderCell.cjs +5 -4
- package/dist/components/table/components/TableHeaderCell.d.ts +3 -1
- package/dist/components/table/components/TableHeaderCell.js +5 -4
- package/dist/components/table/components/TableRow.cjs +1 -1
- package/dist/components/table/components/TableRow.d.ts +1 -2
- package/dist/components/table/components/TableRow.js +1 -1
- package/dist/components/table/components/TableSkeletonBody.cjs +30 -0
- package/dist/components/table/components/TableSkeletonBody.d.ts +13 -0
- package/dist/components/table/components/TableSkeletonBody.js +24 -0
- package/dist/components/table/components/table-settings/TableHeaderSettings.cjs +28 -0
- package/dist/components/table/components/table-settings/TableHeaderSettings.d.ts +11 -0
- package/dist/components/table/components/table-settings/TableHeaderSettings.js +26 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +82 -32
- package/dist/components/table/components/table-settings/TableSettings.d.ts +14 -6
- package/dist/components/table/components/table-settings/TableSettings.js +84 -34
- package/dist/components/table/table.utils.cjs +2 -0
- package/dist/components/table/table.utils.d.ts +6 -0
- package/dist/components/table/table.utils.js +2 -1
- package/dist/components/table/tableSettings.utils.cjs +29 -0
- package/dist/components/table/tableSettings.utils.d.ts +9 -0
- package/dist/components/table/tableSettings.utils.js +24 -0
- package/dist/components/table/tanstackTable.utils.cjs +18 -0
- package/dist/components/table/tanstackTable.utils.js +19 -1
- package/dist/components/theme-button/ThemeButton.cjs +9 -4
- package/dist/components/theme-button/ThemeButton.d.ts +4 -2
- package/dist/components/theme-button/ThemeButton.js +9 -4
- package/dist/components/theme-script/ThemeScript.cjs +10 -4
- package/dist/components/theme-script/ThemeScript.d.ts +9 -1
- package/dist/components/theme-script/ThemeScript.js +10 -4
- package/dist/hooks/useColorScheme.cjs +19 -15
- package/dist/hooks/useColorScheme.d.ts +12 -1
- package/dist/hooks/useColorScheme.js +20 -16
- package/dist/hooks/useGetActiveTheme.cjs +4 -3
- package/dist/hooks/useGetActiveTheme.d.ts +7 -1
- package/dist/hooks/useGetActiveTheme.js +4 -3
- package/dist/hooks/useTableData.cjs +11 -7
- package/dist/hooks/useTableData.d.ts +8 -2
- package/dist/hooks/useTableData.js +11 -7
- package/dist/hooks/useTableSettings.cjs +25 -9
- package/dist/hooks/useTableSettings.d.ts +9 -6
- package/dist/hooks/useTableSettings.js +25 -9
- package/dist/hooks/useTheme.cjs +15 -15
- package/dist/hooks/useTheme.d.ts +8 -0
- package/dist/hooks/useTheme.js +15 -15
- package/dist/styles/styles.css +7 -3
- package/dist/styles/themes/dbc/colors.css +1 -1
- package/dist/styles.css +1 -476
- package/dist/tanstack-virtual.cjs +12 -0
- package/dist/tanstack-virtual.d.ts +1 -0
- package/dist/tanstack-virtual.js +1 -0
- package/package.json +13 -1
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type ViewMode
|
|
1
|
+
import type { ColumnItem, TableSettingsColumn, ViewMode } from '../components/table/Table.types';
|
|
2
|
+
export type { ViewMode } from '../components/table/Table.types';
|
|
3
3
|
export type TableSettingsState = {
|
|
4
4
|
viewMode: ViewMode;
|
|
5
5
|
visibleColumnIds: string[];
|
|
6
|
+
striped: boolean;
|
|
6
7
|
};
|
|
7
8
|
export type TableSettingsStorage = {
|
|
8
9
|
get: (key: string) => TableSettingsState | undefined;
|
|
9
10
|
set: (key: string, next: TableSettingsState) => void;
|
|
10
11
|
};
|
|
11
12
|
export declare const localStorageTableSettingsStorage: TableSettingsStorage;
|
|
12
|
-
interface UseTableSettingsOptions {
|
|
13
|
+
export interface UseTableSettingsOptions<T = unknown> {
|
|
13
14
|
storageKey: string;
|
|
14
|
-
tableColumns?:
|
|
15
|
+
tableColumns?: ReadonlyArray<ColumnItem<T> | TableSettingsColumn>;
|
|
15
16
|
defaultViewMode?: ViewMode;
|
|
16
17
|
defaultVisibleColumnIds?: string[];
|
|
18
|
+
defaultStriped?: boolean;
|
|
17
19
|
storage?: TableSettingsStorage;
|
|
18
20
|
}
|
|
19
|
-
export declare function useTableSettings({ storageKey, tableColumns, defaultViewMode, defaultVisibleColumnIds, storage, }: UseTableSettingsOptions): {
|
|
21
|
+
export declare function useTableSettings<T = unknown>({ storageKey, tableColumns, defaultViewMode, defaultVisibleColumnIds, defaultStriped, storage, }: UseTableSettingsOptions<T>): {
|
|
20
22
|
viewMode: ViewMode;
|
|
21
23
|
toggleViewMode: () => void;
|
|
22
24
|
setViewMode: (mode: ViewMode) => void;
|
|
23
25
|
visibleColumnIds: string[];
|
|
24
26
|
setVisibleColumnIds: (ids: string[]) => void;
|
|
27
|
+
striped: boolean;
|
|
28
|
+
setStriped: (nextStriped: boolean) => void;
|
|
25
29
|
};
|
|
26
|
-
export {};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMemo, useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { isSettingsColumnHidden, getSettingsColumnId } from '../components/table/tableSettings.utils';
|
|
3
4
|
import { writeLocalStorage, readLocalStorage } from '../utils/localStorage.utils';
|
|
4
5
|
|
|
5
6
|
function getDefaultVisibleIds(tableColumns) {
|
|
6
7
|
var _a;
|
|
7
|
-
return (_a = tableColumns == null ? void 0 : tableColumns.filter((c) =>
|
|
8
|
-
var _a2;
|
|
9
|
-
return !((_a2 = c.meta) == null ? void 0 : _a2.hidden);
|
|
10
|
-
}).map((c) => c.id).filter(Boolean)) != null ? _a : [];
|
|
8
|
+
return (_a = tableColumns == null ? void 0 : tableColumns.filter((c) => !isSettingsColumnHidden(c)).map(getSettingsColumnId).filter((id) => typeof id === "string" && id.length > 0)) != null ? _a : [];
|
|
11
9
|
}
|
|
12
10
|
function mergeDefaults(stored, defaults) {
|
|
13
11
|
const viewMode = (stored == null ? void 0 : stored.viewMode) === "compact" || (stored == null ? void 0 : stored.viewMode) === "wrapped" ? stored.viewMode : defaults.viewMode;
|
|
14
12
|
const visibleColumnIds = Array.isArray(stored == null ? void 0 : stored.visibleColumnIds) && stored.visibleColumnIds.length > 0 ? stored.visibleColumnIds : defaults.visibleColumnIds;
|
|
15
|
-
|
|
13
|
+
const striped = typeof (stored == null ? void 0 : stored.striped) === "boolean" ? stored.striped : defaults.striped;
|
|
14
|
+
return { viewMode, visibleColumnIds, striped };
|
|
16
15
|
}
|
|
17
16
|
const localStorageTableSettingsStorage = {
|
|
18
17
|
get: (key) => {
|
|
@@ -28,19 +27,23 @@ function useTableSettings({
|
|
|
28
27
|
tableColumns,
|
|
29
28
|
defaultViewMode = "compact",
|
|
30
29
|
defaultVisibleColumnIds,
|
|
30
|
+
defaultStriped = false,
|
|
31
31
|
storage = localStorageTableSettingsStorage
|
|
32
32
|
}) {
|
|
33
33
|
const defaults = useMemo(() => {
|
|
34
34
|
return {
|
|
35
35
|
viewMode: defaultViewMode,
|
|
36
|
-
visibleColumnIds: defaultVisibleColumnIds != null ? defaultVisibleColumnIds : getDefaultVisibleIds(tableColumns)
|
|
36
|
+
visibleColumnIds: defaultVisibleColumnIds != null ? defaultVisibleColumnIds : getDefaultVisibleIds(tableColumns),
|
|
37
|
+
striped: defaultStriped
|
|
37
38
|
};
|
|
38
|
-
}, [defaultViewMode, defaultVisibleColumnIds, tableColumns]);
|
|
39
|
+
}, [defaultViewMode, defaultVisibleColumnIds, defaultStriped, tableColumns]);
|
|
39
40
|
const [state, setState] = useState(defaults);
|
|
40
41
|
useEffect(() => {
|
|
41
42
|
const stored = storage.get(storageKey);
|
|
42
43
|
const next = mergeDefaults(stored, defaults);
|
|
43
|
-
setState(
|
|
44
|
+
setState(
|
|
45
|
+
(prev) => prev.viewMode === next.viewMode && prev.striped === next.striped && prev.visibleColumnIds.length === next.visibleColumnIds.length && prev.visibleColumnIds.every((id, index) => id === next.visibleColumnIds[index]) ? prev : next
|
|
46
|
+
);
|
|
44
47
|
}, [storageKey, storage, defaults]);
|
|
45
48
|
const persist = useCallback(
|
|
46
49
|
(next) => storage.set(storageKey, next),
|
|
@@ -75,12 +78,25 @@ function useTableSettings({
|
|
|
75
78
|
},
|
|
76
79
|
[persist]
|
|
77
80
|
);
|
|
81
|
+
const setStriped = useCallback(
|
|
82
|
+
(nextStriped) => {
|
|
83
|
+
setState((prev) => {
|
|
84
|
+
if (prev.striped === nextStriped) return prev;
|
|
85
|
+
const next = { ...prev, striped: nextStriped };
|
|
86
|
+
persist(next);
|
|
87
|
+
return next;
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
[persist]
|
|
91
|
+
);
|
|
78
92
|
return {
|
|
79
93
|
viewMode: state.viewMode,
|
|
80
94
|
toggleViewMode,
|
|
81
95
|
setViewMode,
|
|
82
96
|
visibleColumnIds: state.visibleColumnIds,
|
|
83
|
-
setVisibleColumnIds
|
|
97
|
+
setVisibleColumnIds,
|
|
98
|
+
striped: state.striped,
|
|
99
|
+
setStriped
|
|
84
100
|
};
|
|
85
101
|
}
|
|
86
102
|
|
package/dist/hooks/useTheme.cjs
CHANGED
|
@@ -7,9 +7,9 @@ var cookie_utils = require('../utils/cookie.utils');
|
|
|
7
7
|
var localStorage_utils = require('../utils/localStorage.utils');
|
|
8
8
|
var theme_constants = require('../utils/theme.constants');
|
|
9
9
|
|
|
10
|
-
function persistTheme(storageKey, id) {
|
|
11
|
-
localStorage_utils.writeLocalStorage(storageKey, id);
|
|
12
|
-
cookie_utils.writeCookie(storageKey, id);
|
|
10
|
+
function persistTheme(storageKey, id, persistence) {
|
|
11
|
+
if (persistence !== "cookie") localStorage_utils.writeLocalStorage(storageKey, id);
|
|
12
|
+
if (persistence !== "localStorage") cookie_utils.writeCookie(storageKey, id);
|
|
13
13
|
}
|
|
14
14
|
function getDomTheme() {
|
|
15
15
|
return document.documentElement.dataset.productTheme;
|
|
@@ -40,23 +40,23 @@ function getSnapshot() {
|
|
|
40
40
|
function getServerSnapshot() {
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
|
-
function resolveInitialTheme(storageKey, defaultTheme) {
|
|
43
|
+
function resolveInitialTheme(storageKey, defaultTheme, persistence) {
|
|
44
44
|
const fromDom = getDomTheme();
|
|
45
45
|
if (fromDom) return fromDom;
|
|
46
|
-
const fromCookie = cookie_utils.readCookie(storageKey);
|
|
46
|
+
const fromCookie = persistence !== "localStorage" ? cookie_utils.readCookie(storageKey) : void 0;
|
|
47
47
|
if (fromCookie) return fromCookie;
|
|
48
|
-
const fromStorage = localStorage_utils.readLocalStorage(storageKey);
|
|
48
|
+
const fromStorage = persistence !== "cookie" ? localStorage_utils.readLocalStorage(storageKey) : void 0;
|
|
49
49
|
if (fromStorage) return fromStorage;
|
|
50
50
|
return defaultTheme != null ? defaultTheme : null;
|
|
51
51
|
}
|
|
52
|
-
function ensureResolved(defaultTheme, storageKey) {
|
|
52
|
+
function ensureResolved(defaultTheme, storageKey, persistence) {
|
|
53
53
|
if (resolved) return;
|
|
54
54
|
resolved = true;
|
|
55
|
-
const value = resolveInitialTheme(storageKey, defaultTheme);
|
|
55
|
+
const value = resolveInitialTheme(storageKey, defaultTheme, persistence);
|
|
56
56
|
currentTheme = value;
|
|
57
57
|
if (value) {
|
|
58
58
|
applyTheme(value);
|
|
59
|
-
persistTheme(storageKey, value);
|
|
59
|
+
persistTheme(storageKey, value, persistence);
|
|
60
60
|
}
|
|
61
61
|
notify();
|
|
62
62
|
}
|
|
@@ -72,22 +72,22 @@ function ensureColorSchemeObserver() {
|
|
|
72
72
|
attributeFilter: ["data-theme"]
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
function switchThemeInternal(storageKey, id) {
|
|
75
|
+
function switchThemeInternal(storageKey, id, persistence) {
|
|
76
76
|
applyTheme(id);
|
|
77
|
-
persistTheme(storageKey, id);
|
|
77
|
+
persistTheme(storageKey, id, persistence);
|
|
78
78
|
currentTheme = id;
|
|
79
79
|
resolved = true;
|
|
80
80
|
notify();
|
|
81
81
|
}
|
|
82
82
|
function useTheme(options = {}) {
|
|
83
|
-
const { defaultTheme, storageKey = theme_constants.THEME_STORAGE_KEY } = options;
|
|
83
|
+
const { defaultTheme, storageKey = theme_constants.THEME_STORAGE_KEY, persistence = "both" } = options;
|
|
84
84
|
react.useEffect(() => {
|
|
85
85
|
ensureColorSchemeObserver();
|
|
86
|
-
ensureResolved(defaultTheme, storageKey);
|
|
87
|
-
}, [defaultTheme, storageKey]);
|
|
86
|
+
ensureResolved(defaultTheme, storageKey, persistence);
|
|
87
|
+
}, [defaultTheme, storageKey, persistence]);
|
|
88
88
|
const theme = react.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
89
89
|
function switchTheme(id) {
|
|
90
|
-
switchThemeInternal(storageKey, id);
|
|
90
|
+
switchThemeInternal(storageKey, id, persistence);
|
|
91
91
|
}
|
|
92
92
|
return { theme, switchTheme };
|
|
93
93
|
}
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -3,7 +3,15 @@ export type { ThemeId };
|
|
|
3
3
|
export interface UseThemeOptions {
|
|
4
4
|
/** The theme the app should fall back to when nothing is stored yet. */
|
|
5
5
|
defaultTheme?: ThemeId;
|
|
6
|
+
/**
|
|
7
|
+
* Storage key used for the selected persistence store(s). Defaults to a
|
|
8
|
+
* shared key, so apps that run on the same origin (e.g. multiple products
|
|
9
|
+
* under one domain) should each pass their own value here — otherwise
|
|
10
|
+
* they'll unintentionally read and overwrite each other's persisted theme.
|
|
11
|
+
*/
|
|
6
12
|
storageKey?: string;
|
|
13
|
+
/** Where to read and persist the theme. Defaults to both stores. */
|
|
14
|
+
persistence?: 'both' | 'cookie' | 'localStorage';
|
|
7
15
|
}
|
|
8
16
|
export declare function useTheme(options?: UseThemeOptions): {
|
|
9
17
|
theme: ThemeId | null;
|
package/dist/hooks/useTheme.js
CHANGED
|
@@ -5,9 +5,9 @@ import { readCookie, writeCookie } from '../utils/cookie.utils';
|
|
|
5
5
|
import { readLocalStorage, writeLocalStorage } from '../utils/localStorage.utils';
|
|
6
6
|
import { THEME_STORAGE_KEY } from '../utils/theme.constants';
|
|
7
7
|
|
|
8
|
-
function persistTheme(storageKey, id) {
|
|
9
|
-
writeLocalStorage(storageKey, id);
|
|
10
|
-
writeCookie(storageKey, id);
|
|
8
|
+
function persistTheme(storageKey, id, persistence) {
|
|
9
|
+
if (persistence !== "cookie") writeLocalStorage(storageKey, id);
|
|
10
|
+
if (persistence !== "localStorage") writeCookie(storageKey, id);
|
|
11
11
|
}
|
|
12
12
|
function getDomTheme() {
|
|
13
13
|
return document.documentElement.dataset.productTheme;
|
|
@@ -38,23 +38,23 @@ function getSnapshot() {
|
|
|
38
38
|
function getServerSnapshot() {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
function resolveInitialTheme(storageKey, defaultTheme) {
|
|
41
|
+
function resolveInitialTheme(storageKey, defaultTheme, persistence) {
|
|
42
42
|
const fromDom = getDomTheme();
|
|
43
43
|
if (fromDom) return fromDom;
|
|
44
|
-
const fromCookie = readCookie(storageKey);
|
|
44
|
+
const fromCookie = persistence !== "localStorage" ? readCookie(storageKey) : void 0;
|
|
45
45
|
if (fromCookie) return fromCookie;
|
|
46
|
-
const fromStorage = readLocalStorage(storageKey);
|
|
46
|
+
const fromStorage = persistence !== "cookie" ? readLocalStorage(storageKey) : void 0;
|
|
47
47
|
if (fromStorage) return fromStorage;
|
|
48
48
|
return defaultTheme != null ? defaultTheme : null;
|
|
49
49
|
}
|
|
50
|
-
function ensureResolved(defaultTheme, storageKey) {
|
|
50
|
+
function ensureResolved(defaultTheme, storageKey, persistence) {
|
|
51
51
|
if (resolved) return;
|
|
52
52
|
resolved = true;
|
|
53
|
-
const value = resolveInitialTheme(storageKey, defaultTheme);
|
|
53
|
+
const value = resolveInitialTheme(storageKey, defaultTheme, persistence);
|
|
54
54
|
currentTheme = value;
|
|
55
55
|
if (value) {
|
|
56
56
|
applyTheme(value);
|
|
57
|
-
persistTheme(storageKey, value);
|
|
57
|
+
persistTheme(storageKey, value, persistence);
|
|
58
58
|
}
|
|
59
59
|
notify();
|
|
60
60
|
}
|
|
@@ -70,22 +70,22 @@ function ensureColorSchemeObserver() {
|
|
|
70
70
|
attributeFilter: ["data-theme"]
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
function switchThemeInternal(storageKey, id) {
|
|
73
|
+
function switchThemeInternal(storageKey, id, persistence) {
|
|
74
74
|
applyTheme(id);
|
|
75
|
-
persistTheme(storageKey, id);
|
|
75
|
+
persistTheme(storageKey, id, persistence);
|
|
76
76
|
currentTheme = id;
|
|
77
77
|
resolved = true;
|
|
78
78
|
notify();
|
|
79
79
|
}
|
|
80
80
|
function useTheme(options = {}) {
|
|
81
|
-
const { defaultTheme, storageKey = THEME_STORAGE_KEY } = options;
|
|
81
|
+
const { defaultTheme, storageKey = THEME_STORAGE_KEY, persistence = "both" } = options;
|
|
82
82
|
useEffect(() => {
|
|
83
83
|
ensureColorSchemeObserver();
|
|
84
|
-
ensureResolved(defaultTheme, storageKey);
|
|
85
|
-
}, [defaultTheme, storageKey]);
|
|
84
|
+
ensureResolved(defaultTheme, storageKey, persistence);
|
|
85
|
+
}, [defaultTheme, storageKey, persistence]);
|
|
86
86
|
const theme = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
87
87
|
function switchTheme(id) {
|
|
88
|
-
switchThemeInternal(storageKey, id);
|
|
88
|
+
switchThemeInternal(storageKey, id, persistence);
|
|
89
89
|
}
|
|
90
90
|
return { theme, switchTheme };
|
|
91
91
|
}
|
package/dist/styles/styles.css
CHANGED
|
@@ -172,12 +172,16 @@ tr.dbc-table--hover:hover td:last-child {
|
|
|
172
172
|
cursor: pointer;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.dbc-table--striped tbody tr:nth-child(even)
|
|
175
|
+
.dbc-table--striped tbody tr:nth-child(even) > th,
|
|
176
|
+
.dbc-table--striped tbody tr:nth-child(even) > td {
|
|
176
177
|
background-color: var(--table-row-bg-alt);
|
|
178
|
+
border-block-end-color: transparent;
|
|
177
179
|
}
|
|
178
180
|
|
|
179
|
-
.dbc-table--striped.dbc-table--hover tbody tr:hover,
|
|
180
|
-
.dbc-table--striped
|
|
181
|
+
.dbc-table--striped.dbc-table--hover tbody tr:hover > th,
|
|
182
|
+
.dbc-table--striped.dbc-table--hover tbody tr:hover > td,
|
|
183
|
+
.dbc-table--striped tr.dbc-table--hover:hover > th,
|
|
184
|
+
.dbc-table--striped tr.dbc-table--hover:hover > td {
|
|
181
185
|
background-color: var(--table-row-bg-hover);
|
|
182
186
|
}
|
|
183
187
|
|
|
@@ -268,7 +268,7 @@ html {
|
|
|
268
268
|
--table-border-subtle: light-dark(#eef1f4, rgba(255, 255, 255, 0.08));
|
|
269
269
|
--table-divider: light-dark(#e8ebef, rgba(255, 255, 255, 0.08));
|
|
270
270
|
|
|
271
|
-
--table-header-fg: var(--color-fg-
|
|
271
|
+
--table-header-fg: var(--color-fg-muted);
|
|
272
272
|
--table-cell-fg: var(--color-fg-default);
|
|
273
273
|
|
|
274
274
|
/* ==========================================================================
|