@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.
Files changed (40) hide show
  1. package/dist/commonStyles.d.ts +1 -0
  2. package/dist/fonts.css +4 -0
  3. package/dist/hooks/ThemeSwitch/SwitchableThemeProvider.d.ts +20 -0
  4. package/dist/hooks/ThemeSwitch/index.d.ts +3 -0
  5. package/dist/hooks/ThemeSwitch/useStorage.d.ts +9 -0
  6. package/dist/hooks/ThemeSwitch/useThemeSelector.d.ts +26 -0
  7. package/dist/hooks/useTheme.d.ts +2 -0
  8. package/dist/index.d.ts +7 -4
  9. package/dist/index.js +4514 -2883
  10. package/dist/index.umd.cjs +234 -7
  11. package/dist/normalized-styles.css +18 -8
  12. package/dist/themes/themeDark/theme/globals/body.d.ts +3 -0
  13. package/dist/themes/themeDark/theme/globals/scrollbar.d.ts +3 -0
  14. package/dist/themes/themeDark/theme.d.ts +1 -1
  15. package/dist/themes/themeDark/tokens.d.ts +1 -1
  16. package/dist/themes/themeLight/theme/globals/body.d.ts +3 -0
  17. package/dist/themes/themeLight/theme/globals/scrollbar.d.ts +3 -0
  18. package/dist/themes/themeLight/theme.d.ts +1 -1
  19. package/dist/themes/themeLight/tokens.d.ts +1 -1
  20. package/dist/themes/themeOld/components/select.d.ts +1 -1
  21. package/dist/themes/themeOld/components/semanticButton.d.ts +1 -13
  22. package/dist/themes/themeOld/globals/body.d.ts +3 -0
  23. package/dist/themes/themeOld/globals/scrollbar.d.ts +3 -0
  24. package/dist/themes/themeOld/theme.d.ts +2 -445
  25. package/dist/themes/themeOld/tokens.d.ts +2 -392
  26. package/dist/themes/types/index.d.ts +2 -0
  27. package/dist/themes/types/theme/components/index.d.ts +50 -0
  28. package/dist/themes/types/theme/components/link.types.d.ts +1 -0
  29. package/dist/themes/types/theme/components/menu.types.d.ts +5 -1
  30. package/dist/themes/types/theme/components/treeView.types.d.ts +4 -1
  31. package/dist/themes/types/theme/components/typography.types.d.ts +2 -0
  32. package/dist/themes/types/theme/globals/body.types.d.ts +7 -0
  33. package/dist/themes/types/theme/globals/index.d.ts +2 -0
  34. package/dist/themes/types/theme/globals/scrollbar.types.d.ts +10 -0
  35. package/dist/themes/types/theme/theme.types.d.ts +62 -50
  36. package/dist/themes/types/theme/tokens.types.d.ts +392 -0
  37. package/dist/utils.d.ts +7 -0
  38. package/package.json +5 -2
  39. package/dist/themes/hooks/useTheme.d.ts +0 -2
  40. 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
@@ -1 +1,5 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Source+Code+Pro:wght@400;600&display=block');
2
+
3
+ body {
4
+ font-family: 'Nunito Sans', sans-serif;
5
+ }
@@ -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,3 @@
1
+ export * from './useThemeSelector';
2
+ export * from './useStorage';
3
+ export * from './SwitchableThemeProvider';
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ import { Theme } from '../themes/types';
2
+ export declare const useTheme: () => Theme;
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/theme.types';
5
- export * from './themes/types/theme/theme.types';
6
- export * from './themes/hooks/useTheme';
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';