@availity/theme-provider 0.4.48 → 0.4.49
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 +5 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +8 -10
- package/dist/index.mjs +4 -10
- package/jest.config.js +10 -0
- package/package.json +9 -9
- package/project.json +8 -9
- package/src/lib/theme-provider.stories.tsx +9 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.4.49](https://github.com/Availity/element/compare/@availity/theme-provider@0.4.48...@availity/theme-provider@0.4.49) (2024-04-19)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `theme` updated to version `0.4.48`
|
|
5
10
|
## [0.4.48](https://github.com/Availity/element/compare/@availity/theme-provider@0.4.47...@availity/theme-provider@0.4.48) (2024-04-17)
|
|
6
11
|
|
|
7
12
|
### Dependency Updates
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type ThemeProviderProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Availity theme to use */
|
|
6
|
+
theme?: 'lightTheme' | 'legacyBS';
|
|
7
|
+
};
|
|
8
|
+
declare function ThemeProvider({ children, theme }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { ThemeProvider, type ThemeProviderProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type ThemeProviderProps = {
|
|
2
4
|
children: React.ReactNode;
|
|
3
5
|
/** Availity theme to use */
|
|
4
6
|
theme?: 'lightTheme' | 'legacyBS';
|
|
5
7
|
};
|
|
6
|
-
declare function ThemeProvider({ children, theme }: ThemeProviderProps): JSX.Element;
|
|
8
|
+
declare function ThemeProvider({ children, theme }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
7
9
|
|
|
8
|
-
export { ThemeProvider, ThemeProviderProps };
|
|
10
|
+
export { ThemeProvider, type ThemeProviderProps };
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -44,16 +48,10 @@ var themes = {
|
|
|
44
48
|
legacyBS: legacyTheme
|
|
45
49
|
};
|
|
46
50
|
function ThemeProvider({ children, theme = "lightTheme" }) {
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_x_date_pickers.LocalizationProvider, {
|
|
48
|
-
|
|
49
|
-
children
|
|
50
|
-
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CssBaseline.default, {}),
|
|
53
|
-
children
|
|
54
|
-
]
|
|
55
|
-
})
|
|
56
|
-
});
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_x_date_pickers.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.ThemeProvider, { theme: themes[theme], children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CssBaseline.default, {}),
|
|
53
|
+
children
|
|
54
|
+
] }) });
|
|
57
55
|
}
|
|
58
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
57
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -12,16 +12,10 @@ var themes = {
|
|
|
12
12
|
legacyBS: legacyTheme
|
|
13
13
|
};
|
|
14
14
|
function ThemeProvider({ children, theme = "lightTheme" }) {
|
|
15
|
-
return /* @__PURE__ */ jsx(LocalizationProvider, {
|
|
16
|
-
|
|
17
|
-
children
|
|
18
|
-
|
|
19
|
-
children: [
|
|
20
|
-
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
21
|
-
children
|
|
22
|
-
]
|
|
23
|
-
})
|
|
24
|
-
});
|
|
15
|
+
return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: /* @__PURE__ */ jsxs(MuiThemeProvider, { theme: themes[theme], children: [
|
|
16
|
+
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
17
|
+
children
|
|
18
|
+
] }) });
|
|
25
19
|
}
|
|
26
20
|
export {
|
|
27
21
|
ThemeProvider
|
package/jest.config.js
CHANGED
|
@@ -4,4 +4,14 @@ module.exports = {
|
|
|
4
4
|
...global,
|
|
5
5
|
displayName: 'theme-provider',
|
|
6
6
|
coverageDirectory: '../../coverage/theme-provider',
|
|
7
|
+
/* TODO: Update to latest Jest snapshotFormat
|
|
8
|
+
* By default Nx has kept the older style of Jest Snapshot formats
|
|
9
|
+
* to prevent breaking of any existing tests with snapshots.
|
|
10
|
+
* It's recommend you update to the latest format.
|
|
11
|
+
* You can do this by removing snapshotFormat property
|
|
12
|
+
* and running tests with --update-snapshot flag.
|
|
13
|
+
* Example: From within the project directory, run "nx test --update-snapshot"
|
|
14
|
+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
|
|
15
|
+
*/
|
|
16
|
+
snapshotFormat: { escapeString: true, printBasicPrototype: true },
|
|
7
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/theme-provider",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.49",
|
|
4
4
|
"description": "Theme provider for the Element design system",
|
|
5
5
|
"browser": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@availity/theme": "0.46.
|
|
19
|
-
"@emotion/react": "^11.
|
|
20
|
-
"@emotion/styled": "^11.
|
|
21
|
-
"@mui/material": "^5.
|
|
22
|
-
"@mui/x-date-pickers": "^
|
|
23
|
-
"dayjs": "^1.11.
|
|
18
|
+
"@availity/theme": "0.46.3",
|
|
19
|
+
"@emotion/react": "^11.11.4",
|
|
20
|
+
"@emotion/styled": "^11.11.5",
|
|
21
|
+
"@mui/material": "^5.15.15",
|
|
22
|
+
"@mui/x-date-pickers": "^7.2.0",
|
|
23
|
+
"dayjs": "^1.11.10"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"react": "18.2.0",
|
|
27
27
|
"react-dom": "18.2.0",
|
|
28
|
-
"tsup": "^
|
|
29
|
-
"typescript": "~4.
|
|
28
|
+
"tsup": "^8.0.2",
|
|
29
|
+
"typescript": "~5.4.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=16.8.0"
|
package/project.json
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
"tags": [],
|
|
7
7
|
"targets": {
|
|
8
8
|
"lint": {
|
|
9
|
-
"executor": "@
|
|
9
|
+
"executor": "@nx/eslint:lint",
|
|
10
10
|
"options": {
|
|
11
11
|
"eslintConfig": ".eslintrc.json",
|
|
12
|
-
"lintFilePatterns": ["packages/theme-provider/**/*.{js,ts}"],
|
|
13
12
|
"silent": false,
|
|
14
13
|
"fix": false,
|
|
15
14
|
"cache": true,
|
|
@@ -22,20 +21,20 @@
|
|
|
22
21
|
}
|
|
23
22
|
},
|
|
24
23
|
"test": {
|
|
25
|
-
"executor": "@
|
|
26
|
-
"outputs": ["coverage/theme-provider"],
|
|
24
|
+
"executor": "@nx/jest:jest",
|
|
25
|
+
"outputs": ["{workspaceRoot}/coverage/theme-provider"],
|
|
27
26
|
"options": {
|
|
28
|
-
"jestConfig": "packages/theme-provider/jest.config.js"
|
|
29
|
-
"passWithNoTests": true
|
|
27
|
+
"jestConfig": "packages/theme-provider/jest.config.js"
|
|
30
28
|
}
|
|
31
29
|
},
|
|
32
30
|
"version": {
|
|
33
31
|
"executor": "@jscutlery/semver:version",
|
|
34
32
|
"options": {
|
|
35
33
|
"preset": "conventional",
|
|
36
|
-
"commitMessageFormat": "chore(
|
|
37
|
-
"tagPrefix": "@availity
|
|
38
|
-
"trackDeps": true
|
|
34
|
+
"commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]",
|
|
35
|
+
"tagPrefix": "@availity/{projectName}@",
|
|
36
|
+
"trackDeps": true,
|
|
37
|
+
"skipCommitTypes": ["docs"]
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import { ThemeProvider } from '
|
|
2
|
+
import { ThemeProvider } from './theme-provider';
|
|
3
3
|
|
|
4
4
|
export const Default: StoryObj<typeof ThemeProvider> = {
|
|
5
|
-
render: () =>
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
render: () => (
|
|
6
|
+
<>
|
|
7
|
+
<ThemeProvider>
|
|
8
|
+
<div>This component is inside the ThemeProvider</div>
|
|
9
|
+
</ThemeProvider>
|
|
10
|
+
<div>This component is outside the ThemeProvider</div>
|
|
11
|
+
</>
|
|
12
|
+
),
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export default {
|