@availity/theme-provider 0.1.0 → 0.1.2
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 +9 -4
- package/dist/index.d.ts +9 -0
- package/dist/index.js +56 -0
- package/dist/index.mjs +23 -0
- package/package.json +4 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.1.2](https://github.com/Availity/element/compare/@availity/theme-provider@0.1.1...@availity/theme-provider@0.1.2) (2023-02-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* update exports ([af3f9f6](https://github.com/Availity/element/commit/af3f9f6715132b020bf96881dbc70906738bcda7))
|
|
11
|
+
|
|
12
|
+
## [0.1.1](https://github.com/Availity/element/compare/@availity/theme-provider@0.1.0...@availity/theme-provider@0.1.1) (2023-02-22)
|
|
13
|
+
|
|
5
14
|
## 0.1.0 (2023-02-21)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -15,7 +24,3 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
|
|
|
15
24
|
### Features
|
|
16
25
|
|
|
17
26
|
* **theme-provider:** create component ([c532d6e](https://github.com/Availity/element/commit/c532d6e21c29f428c05a3b2159c18d95555dbbbb))
|
|
18
|
-
|
|
19
|
-
# Changelog
|
|
20
|
-
|
|
21
|
-
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
theme?: Theme;
|
|
6
|
+
}
|
|
7
|
+
declare function ThemeProvider({ children, theme }: ThemeProviderProps): JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { ThemeProvider, ThemeProviderProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// src/index.ts
|
|
27
|
+
var src_exports = {};
|
|
28
|
+
__export(src_exports, {
|
|
29
|
+
ThemeProvider: () => ThemeProvider
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(src_exports);
|
|
32
|
+
|
|
33
|
+
// src/lib/theme-provider.tsx
|
|
34
|
+
var import_theme = require("@availity/theme");
|
|
35
|
+
var import_styles = require("@mui/material/styles");
|
|
36
|
+
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"));
|
|
37
|
+
var import_AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
38
|
+
var import_x_date_pickers = require("@mui/x-date-pickers");
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var defaultTheme = (0, import_styles.createTheme)(import_theme.lightTheme);
|
|
41
|
+
function ThemeProvider({ children, theme = defaultTheme }) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_x_date_pickers.LocalizationProvider, {
|
|
43
|
+
dateAdapter: import_AdapterDateFns.AdapterDateFns,
|
|
44
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.ThemeProvider, {
|
|
45
|
+
theme,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CssBaseline.default, {}),
|
|
48
|
+
children
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
ThemeProvider
|
|
56
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/lib/theme-provider.tsx
|
|
2
|
+
import { lightTheme } from "@availity/theme";
|
|
3
|
+
import { ThemeProvider as MuiThemeProvider, createTheme } from "@mui/material/styles";
|
|
4
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
5
|
+
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
6
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var defaultTheme = createTheme(lightTheme);
|
|
9
|
+
function ThemeProvider({ children, theme = defaultTheme }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(LocalizationProvider, {
|
|
11
|
+
dateAdapter: AdapterDateFns,
|
|
12
|
+
children: /* @__PURE__ */ jsxs(MuiThemeProvider, {
|
|
13
|
+
theme,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
16
|
+
children
|
|
17
|
+
]
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
ThemeProvider
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/theme-provider",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Theme provider for the Element design system",
|
|
5
|
+
"browser": "./dist/index.js",
|
|
5
6
|
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
6
8
|
"types": "./dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./dist/index.mjs",
|
|
10
|
-
"require": "./dist/index.js"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
9
|
"scripts": {
|
|
14
10
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
15
11
|
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
16
12
|
"clean": "rm -rf dist",
|
|
17
13
|
"clean:nm": "rm -rf node_modules",
|
|
18
|
-
"bundlesize": "bundlesize",
|
|
19
14
|
"publish": "yarn npm publish --tolerate-republish --access public",
|
|
20
15
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
21
16
|
},
|
|
22
17
|
"dependencies": {
|
|
23
|
-
"@availity/theme": "0.1.
|
|
18
|
+
"@availity/theme": "0.1.2",
|
|
24
19
|
"@emotion/react": "^11.10.5",
|
|
25
20
|
"@emotion/styled": "^11.10.5",
|
|
26
21
|
"@mui/material": "^5.11.6",
|