@redis-ui/styles 11.0.2 → 12.3.1
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/commonStyles.d.ts +1 -0
- package/dist/fonts.css +4 -0
- package/dist/hooks/ThemeSwitch/SwitchableThemeProvider.d.ts +20 -0
- package/dist/hooks/ThemeSwitch/index.d.ts +3 -0
- package/dist/hooks/ThemeSwitch/useStorage.d.ts +9 -0
- package/dist/hooks/ThemeSwitch/useThemeSelector.d.ts +26 -0
- package/dist/hooks/useTheme.d.ts +2 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4514 -2883
- package/dist/index.umd.cjs +234 -7
- package/dist/normalized-styles.css +18 -8
- package/dist/themes/themeDark/theme/globals/body.d.ts +3 -0
- package/dist/themes/themeDark/theme/globals/scrollbar.d.ts +3 -0
- package/dist/themes/themeDark/theme.d.ts +1 -1
- package/dist/themes/themeDark/tokens.d.ts +1 -1
- package/dist/themes/themeLight/theme/globals/body.d.ts +3 -0
- package/dist/themes/themeLight/theme/globals/scrollbar.d.ts +3 -0
- package/dist/themes/themeLight/theme.d.ts +1 -1
- package/dist/themes/themeLight/tokens.d.ts +1 -1
- package/dist/themes/themeOld/components/select.d.ts +1 -1
- package/dist/themes/themeOld/components/semanticButton.d.ts +1 -13
- package/dist/themes/themeOld/globals/body.d.ts +3 -0
- package/dist/themes/themeOld/globals/scrollbar.d.ts +3 -0
- package/dist/themes/themeOld/theme.d.ts +2 -445
- package/dist/themes/themeOld/tokens.d.ts +2 -392
- package/dist/themes/types/index.d.ts +2 -0
- package/dist/themes/types/theme/components/index.d.ts +50 -0
- package/dist/themes/types/theme/components/link.types.d.ts +1 -0
- package/dist/themes/types/theme/components/menu.types.d.ts +5 -1
- package/dist/themes/types/theme/components/treeView.types.d.ts +4 -1
- package/dist/themes/types/theme/components/typography.types.d.ts +2 -0
- package/dist/themes/types/theme/globals/body.types.d.ts +7 -0
- package/dist/themes/types/theme/globals/index.d.ts +2 -0
- package/dist/themes/types/theme/globals/scrollbar.types.d.ts +10 -0
- package/dist/themes/types/theme/theme.types.d.ts +62 -50
- package/dist/themes/types/theme/tokens.types.d.ts +392 -0
- package/dist/utils.d.ts +7 -0
- package/package.json +5 -2
- package/dist/themes/hooks/useTheme.d.ts +0 -2
- package/dist/themes/types/theme.types.d.ts +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CommonStyles: import("styled-components").GlobalStyleComponent<import("styled-components").ThemeProps<any>, import("styled-components").DefaultTheme>;
|
package/dist/fonts.css
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Theme } from '../../themes/types';
|
|
3
|
+
import { UseThemeSelectorParams } from './useThemeSelector';
|
|
4
|
+
import { UseStorageParams } from './useStorage';
|
|
5
|
+
export interface ThemeSwitchContextParams extends Pick<UseThemeSelectorParams, 'systemThemeName' | 'lightThemeName' | 'darkThemeName'> {
|
|
6
|
+
selectedTheme: string;
|
|
7
|
+
setSelectedTheme: (themeName: string) => void;
|
|
8
|
+
}
|
|
9
|
+
interface ThemeSwitchProviderProps extends ThemeSwitchContextParams {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const ThemeSwitchProvider: ({ children, selectedTheme, setSelectedTheme, lightThemeName, darkThemeName, systemThemeName }: ThemeSwitchProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const useThemeSwitchContext: () => ThemeSwitchContextParams;
|
|
14
|
+
interface SwitchableThemeProviderProps extends Pick<UseThemeSelectorParams, 'systemThemeName' | 'initialThemeName'>, Pick<UseStorageParams, 'storageKey'> {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
lightTheme: Theme;
|
|
17
|
+
darkTheme: Theme;
|
|
18
|
+
}
|
|
19
|
+
export declare const SwitchableThemeProvider: ({ children, lightTheme, darkTheme, systemThemeName, initialThemeName, storageKey }: SwitchableThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type UseStorageParams = {
|
|
2
|
+
storageKey: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const useStorage: ({ value, ...params }: UseStorageParams) => {
|
|
7
|
+
readFromStorage: () => string;
|
|
8
|
+
saveToStorage: (newValue: string) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type UseThemeSelectorParams = {
|
|
2
|
+
/**
|
|
3
|
+
* One of valid theme names, defined in other parameters: light/dark/system.
|
|
4
|
+
*/
|
|
5
|
+
initialThemeName?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Name of the light theme
|
|
8
|
+
*/
|
|
9
|
+
lightThemeName: string;
|
|
10
|
+
/**
|
|
11
|
+
* Name of the dark theme
|
|
12
|
+
*/
|
|
13
|
+
darkThemeName: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional name of the system theme.
|
|
16
|
+
* This can be any string, just to define the value for the storage and theme identifier.
|
|
17
|
+
* If it is defined, then it can be used as initialThemeName and can be selected by user.
|
|
18
|
+
* If system theme is selected, the current browser theme will be monitored and applied to the app.
|
|
19
|
+
*/
|
|
20
|
+
systemThemeName?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const useThemeSelector: (params: UseThemeSelectorParams) => {
|
|
23
|
+
setSelectedTheme: (newSelection: string) => boolean;
|
|
24
|
+
selectedTheme: string;
|
|
25
|
+
currentTheme: string;
|
|
26
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export { theme } from './themes/themeOld/theme';
|
|
1
|
+
export { theme as themeOld } from './themes/themeOld/theme';
|
|
2
|
+
export { theme } from './themes/themeLight/theme';
|
|
2
3
|
export { theme as themeLight } from './themes/themeLight/theme';
|
|
3
4
|
export { theme as themeDark } from './themes/themeDark/theme';
|
|
4
|
-
export * from './themes/types
|
|
5
|
-
export * from './themes/types/theme/
|
|
6
|
-
export * from './
|
|
5
|
+
export * from './themes/types';
|
|
6
|
+
export * from './themes/types/theme/components';
|
|
7
|
+
export * from './hooks/useTheme';
|
|
7
8
|
export * from './utils';
|
|
8
9
|
export * from './focus-indicator';
|
|
10
|
+
export * from './hooks/ThemeSwitch';
|
|
11
|
+
export * from './commonStyles';
|