@sproutsocial/seeds-react-theme-provider 1.0.0

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/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@sproutsocial/seeds-react-theme-provider",
3
+ "version": "1.0.0",
4
+ "description": "Seeds React Theme Provider",
5
+ "author": "Sprout Social, Inc.",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.mjs",
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "tsup"
12
+ },
13
+ "dependencies": {
14
+ "@sproutsocial/seeds-react-utilities": "*"
15
+ },
16
+ "devDependencies": {
17
+ "@types/styled-components": "^5.1.26",
18
+ "@sproutsocial/eslint-config-seeds": "*",
19
+ "@sproutsocial/seeds-react-theme": "*",
20
+ "react": "^17.0.2",
21
+ "styled-components": "^5.2.3",
22
+ "tsup": "^8.0.1",
23
+ "typescript": "^5.1.6"
24
+ },
25
+ "peerDependencies": {
26
+ "styled-components": "^5.2.3"
27
+ },
28
+ "engines": {
29
+ "node": ">=18"
30
+ }
31
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { ThemeProvider as BaseThemeProvider } from "styled-components";
3
+ import { theme } from "@sproutsocial/seeds-react-theme";
4
+ import { TypeSproutTheme, TypeTheme } from "@sproutsocial/seeds-react-theme";
5
+
6
+ // We can append additional themes types here
7
+ type TypeAllThemes = TypeTheme | TypeSproutTheme;
8
+
9
+ type TypeProps = {
10
+ readonly theme?: TypeAllThemes;
11
+ readonly children?: React.ReactNode;
12
+ };
13
+
14
+ const ThemeProvider = (props: TypeProps) => (
15
+ <BaseThemeProvider {...props} theme={props.theme || theme} />
16
+ );
17
+
18
+ export default ThemeProvider;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "@sproutsocial/seeds-tsconfig/react-library.json",
3
+ "compilerOptions": {
4
+ "noImplicitAny": false,
5
+ "noUncheckedIndexedAccess": false,
6
+ "baseUrl": ".",
7
+ "paths": {
8
+ "@src": ["src"],
9
+ "@src*": ["src*"]
10
+ }
11
+ },
12
+ "include": ["src/**/*"],
13
+ "exclude": ["node_modules", "dist"]
14
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.tsx"],
5
+ format: ["cjs", "esm"],
6
+ dts: true,
7
+ target: "es2020",
8
+ external: ["react"],
9
+ });