@opengeoweb/theme 2.1.3 → 2.2.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.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Theme as MUITheme } from '@material-ui/core';
2
+ import { Theme as MUITheme } from '@mui/material';
3
3
  interface ThemeContextProps {
4
4
  toggleTheme?: () => void;
5
5
  isDark?: boolean;
@@ -0,0 +1,5 @@
1
+ import { ComponentsVariants, CSSInterpolation } from '@mui/material';
2
+ import { ButtonStyles, ButtonStyle } from './types';
3
+ export declare const buttonStyle: (button: ButtonStyle) => CSSInterpolation;
4
+ export declare const toggleButtonStyle: (buttonVariants: ComponentsVariants['MuiButton']) => CSSInterpolation;
5
+ export declare const buttonVariants: (buttons: ButtonStyles) => ComponentsVariants['MuiButton'];
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { GeowebColorPalette } from './types';
2
2
  export declare const colors: GeowebColorPalette;
3
- export declare const darkTheme: import("@material-ui/core").Theme;
3
+ export declare const darkTheme: import("@mui/material").Theme;
@@ -1,7 +1 @@
1
- import { AlertClassKey } from '@material-ui/lab/Alert';
2
- declare module '@material-ui/core/styles/overrides' {
3
- interface ComponentNameToClassKey {
4
- MuiAlert: AlertClassKey;
5
- }
6
- }
7
- export declare const GWTheme: import("@material-ui/core").Theme;
1
+ export declare const GWTheme: import("@mui/material").Theme;
@@ -1,3 +1,3 @@
1
1
  import { GeowebColorPalette } from './types';
2
2
  export declare const colors: GeowebColorPalette;
3
- export declare const lightTheme: import("@material-ui/core").Theme;
3
+ export declare const lightTheme: import("@mui/material").Theme;
@@ -2,6 +2,24 @@
2
2
  interface CSSProperties extends React.CSSProperties {
3
3
  rgba?: string;
4
4
  }
5
+ export declare const gwButtonVariants: readonly ["primary", "secondary", "tertiary", "flat", "tool", "boxed"];
6
+ export declare type ButtonVariant = typeof gwButtonVariants[number];
7
+ export interface ButtonStyle {
8
+ default: CSSProperties;
9
+ mouseOver: CSSProperties;
10
+ active: CSSProperties;
11
+ activeMouseOver: CSSProperties;
12
+ disabled: CSSProperties;
13
+ }
14
+ export interface ButtonStyles {
15
+ primary: ButtonStyle;
16
+ secondary: ButtonStyle;
17
+ tertiary: ButtonStyle;
18
+ flat: ButtonStyle;
19
+ tool: ButtonStyle;
20
+ boxed: ButtonStyle;
21
+ focusDefault: CSSProperties;
22
+ }
5
23
  export declare type GeowebColorPalette = {
6
24
  background: {
7
25
  surface: CSSProperties['color'];
@@ -11,15 +29,7 @@ export declare type GeowebColorPalette = {
11
29
  brand: {
12
30
  brand: CSSProperties['color'];
13
31
  };
14
- buttons: {
15
- primary: CSSProperties;
16
- primaryMouseover: CSSProperties;
17
- primaryActive: CSSProperties;
18
- flatMouseover: CSSProperties;
19
- focusDefault: CSSProperties;
20
- disabled: CSSProperties;
21
- surfaceIconDefault: CSSProperties;
22
- };
32
+ buttons: ButtonStyles;
23
33
  typographyAndIcons: {
24
34
  text: CSSProperties['color'];
25
35
  icon: CSSProperties['color'];
@@ -110,7 +120,7 @@ export declare type GeowebColorPalette = {
110
120
  export declare type Elevations = {
111
121
  [id: string]: string;
112
122
  };
113
- declare module '@material-ui/core/styles/createPalette' {
123
+ declare module '@mui/material/styles' {
114
124
  interface Palette {
115
125
  geowebColors: GeowebColorPalette;
116
126
  }
@@ -118,4 +128,14 @@ declare module '@material-ui/core/styles/createPalette' {
118
128
  geowebColors: GeowebColorPalette;
119
129
  }
120
130
  }
131
+ declare module '@mui/material/Button' {
132
+ interface ButtonPropsVariantOverrides {
133
+ primary: true;
134
+ secondary: true;
135
+ tertiary: true;
136
+ flat: true;
137
+ tool: true;
138
+ boxed: true;
139
+ }
140
+ }
121
141
  export {};
@@ -1,7 +1,7 @@
1
- import { Theme, PaletteType } from '@material-ui/core';
2
- import { Shadows } from '@material-ui/core/styles/shadows';
1
+ import { Theme, PaletteMode } from '@mui/material';
2
+ import { Shadows } from '@mui/material/styles/shadows';
3
3
  import { Elevations, GeowebColorPalette } from './types';
4
4
  export declare const hex2rgba: (hex: string, alpha?: number) => string;
5
5
  export declare const parseColors: (colors: GeowebColorPalette) => GeowebColorPalette;
6
6
  export declare const createShadows: (elevations: Elevations) => Shadows;
7
- export declare const createTheme: (paletteType: PaletteType, geowebColors: GeowebColorPalette, shadows: Shadows) => Theme;
7
+ export declare const createTheme: (paletteType: PaletteMode, geowebColors: GeowebColorPalette, shadows: Shadows) => Theme;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface BackdropDemoProps {
3
3
  isOpen?: boolean;
4
+ handleClose?: () => void;
4
5
  }
5
6
  export declare const BackdropDemo: React.FC<BackdropDemoProps>;
6
7
  export declare const Backdrop: React.FC;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export declare const ButtonDemo: React.FC;
3
+ export declare const Buttons: {
4
+ (): React.ReactElement;
5
+ storyName: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export declare const ToggleButtonDemo: React.FC;
3
+ export declare const ToggleButtons: {
4
+ (): React.ReactElement;
5
+ storyName: string;
6
+ };
@@ -8,6 +8,8 @@ export { Table } from './Table.stories';
8
8
  export { Tabs } from './Tabs.stories';
9
9
  export { Typography, TypographyGWTheme } from './Typography.stories';
10
10
  export { Tooltips } from './Tooltip.stories';
11
+ export { Buttons } from './Button.stories';
12
+ export { ToggleButtons } from './ToggleButton.stories';
11
13
  export { FormElementsGWTheme, FormElements } from './FormElements.stories';
12
14
  declare const _default: {
13
15
  title: string;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ButtonLight: () => React.ReactElement;
7
+ export declare const ButtonDark: () => React.ReactElement;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ToggleButtonLight: () => React.ReactElement;
7
+ export declare const ToggleButtonDark: () => React.ReactElement;
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@opengeoweb/theme",
3
- "version": "2.1.3",
3
+ "version": "2.2.1",
4
4
  "description": "GeoWeb Theme library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
- "main": "./theme.umd.js",
11
- "module": "./theme.esm.js",
10
+ "main": "./index.umd.js",
11
+ "module": "./index.esm.js",
12
12
  "typings": "./index.d.ts",
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
- "@material-ui/core": "^4.11.0",
16
- "@material-ui/lab": "^4.0.0-alpha.56",
17
- "react": "16.14.0",
18
- "@material-ui/icons": "^4.9.1"
15
+ "@mui/material": "^5.2.8",
16
+ "react": "^17.0.2",
17
+ "@mui/styles": "^5.2.3",
18
+ "@mui/icons-material": "^5.2.5"
19
19
  }
20
20
  }