@availity/theme-provider 0.4.83 → 0.4.84
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/CHANGELOG.md +10 -0
- package/dist/index.js +13 -5
- package/dist/index.mjs +13 -5
- package/package.json +2 -2
- package/src/lib/theme-provider.tsx +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.4.84](https://github.com/Availity/element/compare/@availity/theme-provider@0.4.83...@availity/theme-provider@0.4.84) (2024-10-18)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `theme` updated to version `0.4.83`
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **mui-datepicker:** accessible dialog name and other updates ([6c530fe](https://github.com/Availity/element/commit/6c530fecf1051f32d72d4c113f29c86619299119))
|
|
14
|
+
|
|
5
15
|
## [0.4.83](https://github.com/Availity/element/compare/@availity/theme-provider@0.4.82...@availity/theme-provider@0.4.83) (2024-10-18)
|
|
6
16
|
|
|
7
17
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,8 @@ var import_theme = require("@availity/theme");
|
|
|
39
39
|
var import_styles = require("@mui/material/styles");
|
|
40
40
|
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"));
|
|
41
41
|
var import_AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
|
|
42
|
-
var
|
|
42
|
+
var import_locales = require("@mui/x-date-pickers/locales");
|
|
43
|
+
var import_LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
43
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
45
|
var lightTheme = (0, import_styles.createTheme)(import_theme.lightTheme);
|
|
45
46
|
var legacyTheme = (0, import_styles.createTheme)(import_theme.legacyTheme);
|
|
@@ -48,10 +49,17 @@ var themes = {
|
|
|
48
49
|
legacyBS: legacyTheme
|
|
49
50
|
};
|
|
50
51
|
function ThemeProvider({ children, theme = "lightTheme" }) {
|
|
51
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
import_LocalizationProvider.LocalizationProvider,
|
|
54
|
+
{
|
|
55
|
+
dateAdapter: import_AdapterDayjs.AdapterDayjs,
|
|
56
|
+
localeText: import_locales.enUS.components.MuiLocalizationProvider.defaultProps.localeText,
|
|
57
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.ThemeProvider, { theme: themes[theme], children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CssBaseline.default, {}),
|
|
59
|
+
children
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
55
63
|
}
|
|
56
64
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57
65
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,8 @@ import { lightTheme as lightThemeOptions, legacyTheme as legacyThemeOptions } fr
|
|
|
3
3
|
import { ThemeProvider as MuiThemeProvider, createTheme } from "@mui/material/styles";
|
|
4
4
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
5
5
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
6
|
-
import {
|
|
6
|
+
import { enUS as enUSDate } from "@mui/x-date-pickers/locales";
|
|
7
|
+
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
var lightTheme = createTheme(lightThemeOptions);
|
|
9
10
|
var legacyTheme = createTheme(legacyThemeOptions);
|
|
@@ -12,10 +13,17 @@ var themes = {
|
|
|
12
13
|
legacyBS: legacyTheme
|
|
13
14
|
};
|
|
14
15
|
function ThemeProvider({ children, theme = "lightTheme" }) {
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
LocalizationProvider,
|
|
18
|
+
{
|
|
19
|
+
dateAdapter: AdapterDayjs,
|
|
20
|
+
localeText: enUSDate.components.MuiLocalizationProvider.defaultProps.localeText,
|
|
21
|
+
children: /* @__PURE__ */ jsxs(MuiThemeProvider, { theme: themes[theme], children: [
|
|
22
|
+
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
23
|
+
children
|
|
24
|
+
] })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
19
27
|
}
|
|
20
28
|
export {
|
|
21
29
|
ThemeProvider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/theme-provider",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.84",
|
|
4
4
|
"description": "Theme provider for the Element design system",
|
|
5
5
|
"browser": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@availity/theme": "0.61.
|
|
18
|
+
"@availity/theme": "0.61.2",
|
|
19
19
|
"@emotion/react": "^11.11.4",
|
|
20
20
|
"@emotion/styled": "^11.11.5",
|
|
21
21
|
"@mui/material": "^5.15.15",
|
|
@@ -3,7 +3,8 @@ import { ThemeProvider as MuiThemeProvider, createTheme } from '@mui/material/st
|
|
|
3
3
|
import type { Theme, ThemeOptions } from '@mui/material/styles';
|
|
4
4
|
import CssBaseline from '@mui/material/CssBaseline';
|
|
5
5
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
6
|
-
import {
|
|
6
|
+
import { enUS as enUSDate } from '@mui/x-date-pickers/locales';
|
|
7
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
7
8
|
|
|
8
9
|
const lightTheme = createTheme(lightThemeOptions as ThemeOptions);
|
|
9
10
|
const legacyTheme = createTheme(legacyThemeOptions as ThemeOptions);
|
|
@@ -13,6 +14,7 @@ export type ThemeProviderProps = {
|
|
|
13
14
|
/** Availity theme to use */
|
|
14
15
|
theme?: 'lightTheme' | 'legacyBS';
|
|
15
16
|
};
|
|
17
|
+
|
|
16
18
|
const themes: Record<string, Theme> = {
|
|
17
19
|
lightTheme: lightTheme,
|
|
18
20
|
legacyBS: legacyTheme,
|
|
@@ -20,7 +22,10 @@ const themes: Record<string, Theme> = {
|
|
|
20
22
|
|
|
21
23
|
export function ThemeProvider({ children, theme = 'lightTheme' }: ThemeProviderProps) {
|
|
22
24
|
return (
|
|
23
|
-
<LocalizationProvider
|
|
25
|
+
<LocalizationProvider
|
|
26
|
+
dateAdapter={AdapterDayjs}
|
|
27
|
+
localeText={enUSDate.components.MuiLocalizationProvider.defaultProps.localeText}
|
|
28
|
+
>
|
|
24
29
|
<MuiThemeProvider theme={themes[theme]}>
|
|
25
30
|
<CssBaseline />
|
|
26
31
|
{children}
|