@primer/styled-react 1.0.7 → 1.0.8-rc.2a752ecd6
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useTheme as primerUseTheme } from '@primer/react';
|
|
3
|
+
import { useColorSchemeVar } from './ThemeProvider';
|
|
4
|
+
import type { ThemeProviderProps as StyledThemeProviderProps } from './ThemeProvider';
|
|
5
|
+
import type { BaseStylesProps as StyledBaseStylesProps } from './BaseStyles';
|
|
6
|
+
export type ThemeProviderProps = StyledThemeProviderProps;
|
|
7
|
+
export type BaseStylesProps = StyledBaseStylesProps;
|
|
8
|
+
export declare const ThemeProvider: React.FC<React.PropsWithChildren<ThemeProviderProps>>;
|
|
9
|
+
export declare function useTheme(): ReturnType<typeof primerUseTheme>;
|
|
10
|
+
export { useColorSchemeVar };
|
|
11
|
+
export declare function BaseStyles(props: BaseStylesProps): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=FeatureFlaggedTheming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureFlaggedTheming.d.ts","sourceRoot":"","sources":["../../src/components/FeatureFlaggedTheming.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,QAAQ,IAAI,cAAc,EAE3B,MAAM,eAAe,CAAA;AAMtB,OAAO,EAAmE,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AACnH,OAAO,KAAK,EAAC,kBAAkB,IAAI,wBAAwB,EAAC,MAAM,iBAAiB,CAAA;AAEnF,OAAO,KAAK,EAAC,eAAe,IAAI,qBAAqB,EAAC,MAAM,cAAc,CAAA;AAE1E,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAEzD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAA;AAEnD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAM/E,CAAA;AAED,wBAAgB,QAAQ,IAAI,UAAU,CAAC,OAAO,cAAc,CAAC,CAQ5D;AAED,OAAO,EAAC,iBAAiB,EAAC,CAAA;AAE1B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAMhD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseStyles as BaseStyles$1, ThemeProvider as ThemeProvider$1, useTheme as useTheme$2 } from '@primer/react';
|
|
2
|
+
import { useFeatureFlag } from '@primer/react/experimental';
|
|
3
|
+
import { ThemeProvider as ThemeProvider$2, useTheme as useTheme$1 } from './ThemeProvider.js';
|
|
4
|
+
export { useColorSchemeVar } from './ThemeProvider.js';
|
|
5
|
+
import { BaseStyles as BaseStyles$2 } from './BaseStyles.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const ThemeProvider = ({
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
const enabled = useFeatureFlag('primer_react_styled_react_use_primer_theme_providers');
|
|
13
|
+
if (enabled) {
|
|
14
|
+
return /*#__PURE__*/jsx(ThemeProvider$1, {
|
|
15
|
+
...props,
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/jsx(ThemeProvider$2, {
|
|
20
|
+
...props,
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
function useTheme() {
|
|
25
|
+
const enabled = useFeatureFlag('primer_react_styled_react_use_primer_theme_providers');
|
|
26
|
+
const styledTheme = useTheme$1();
|
|
27
|
+
const primerTheme = useTheme$2();
|
|
28
|
+
if (enabled) {
|
|
29
|
+
return primerTheme;
|
|
30
|
+
}
|
|
31
|
+
return styledTheme;
|
|
32
|
+
}
|
|
33
|
+
function BaseStyles(props) {
|
|
34
|
+
const enabled = useFeatureFlag('primer_react_styled_react_use_primer_theme_providers');
|
|
35
|
+
if (enabled) {
|
|
36
|
+
return /*#__PURE__*/jsx(BaseStyles$1, {
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/jsx(BaseStyles$2, {
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { BaseStyles, ThemeProvider, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ useColorSchemeVar,
|
|
|
29
29
|
* @deprecated Theming in JavaScript is no longer supported. Prefer using
|
|
30
30
|
* `@primer/primitives` and CSS Modules instead.
|
|
31
31
|
*/
|
|
32
|
-
type ThemeProviderProps, } from './components/
|
|
32
|
+
type ThemeProviderProps, } from './components/FeatureFlaggedTheming';
|
|
33
33
|
export {
|
|
34
34
|
/**
|
|
35
35
|
* @deprecated Usage of the `sx` prop with this component is no longer
|
|
@@ -40,7 +40,7 @@ BaseStyles,
|
|
|
40
40
|
* @deprecated Usage of the `sx` prop with this component is no longer
|
|
41
41
|
* supported. Use the component from `@primer/react` with CSS Modules instead.
|
|
42
42
|
*/
|
|
43
|
-
type BaseStylesProps, } from './components/
|
|
43
|
+
type BaseStylesProps, } from './components/FeatureFlaggedTheming';
|
|
44
44
|
export {
|
|
45
45
|
/**
|
|
46
46
|
* @deprecated Theming in JavaScript is no longer supported. Prefer using
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO;AACL;;;GAGG;AACH,GAAG;AAEH;;;GAGG;AACH,KAAK,QAAQ,GACd,MAAM,kBAAkB,CAAA;AAGzB,OAAO;AACL;;;GAGG;AACH,aAAa;AAEb;;;GAGG;AACH,QAAQ;AAER;;;GAGG;AACH,iBAAiB;AAEjB;;;GAGG;AACH,KAAK,k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M,sBAAsB,CAAA;AAE7B,OAAO;AACL;;;GAGG;AACH,UAAU;AAEV;;;GAGG;AACH,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAA;AAEhC,OAAO;AACL;;;GAGG;AACH,KAAK;AAEL;;;GAGG;AACH,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA;AAE3B,OAAO;AACL;;;GAGG;AACH,IAAI;AAEJ;;;GAGG;AACH,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAA;AAE1B,OAAO;AACL;;;GAGG;AACH,OAAO;AAEP;;;GAGG;AACH,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO;AACL;;;GAGG;AACH,IAAI;AAEJ;;;GAGG;AACH,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAA;AAE1B,OAAO;AACL;;;GAGG;AACH,SAAS;AAET;;;GAGG;AACH,KAAK,cAAc;AAEnB;;;GAGG;AACH,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAA;AAE/B,OAAO;AACL;;;GAGG;AACH,YAAY;AAEZ;;;GAGG;AACH,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAA;AAElC,OAAO;AACL;;;GAGG;AACH,YAAY;AAEZ;;;GAGG;AACH,KAAK,iBAAiB;AAEtB;;;GAGG;AACH,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAA;AAElC,OAAO;AACL;;;GAGG;AACH,KAAK;AAEL;;;GAGG;AACH,EAAE;AAEF;;;GAGG;AACH,KAAK,MAAM,GACZ,MAAM,MAAM,CAAA;AAEb,OAAO;AACL;;;GAGG;AACH,KAAK,uBAAuB,GAC7B,MAAM,MAAM,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { Box } from './components/Box.js';
|
|
3
|
-
export {
|
|
4
|
-
export { BaseStyles } from './components/BaseStyles.js';
|
|
3
|
+
export { BaseStyles, ThemeProvider, useTheme } from './components/FeatureFlaggedTheming.js';
|
|
5
4
|
export { theme } from '@primer/react';
|
|
6
5
|
export { get as themeGet } from './theme-get.js';
|
|
7
6
|
export { ActionList } from './components/ActionList.js';
|
|
@@ -19,3 +18,4 @@ export { ToggleSwitch } from './components/ToggleSwitch.js';
|
|
|
19
18
|
export { UnderlineNav } from './components/UnderlineNav.js';
|
|
20
19
|
export { sx } from './sx.js';
|
|
21
20
|
export { default as merge } from 'deepmerge';
|
|
21
|
+
export { useColorSchemeVar } from './components/ThemeProvider.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/styled-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8-rc.2a752ecd6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@babel/preset-react": "^7.28.5",
|
|
50
50
|
"@babel/preset-typescript": "^7.28.5",
|
|
51
51
|
"@primer/primitives": "10.x || 11.x",
|
|
52
|
-
"@primer/react": "^38.22.
|
|
52
|
+
"@primer/react": "^38.22.1",
|
|
53
53
|
"@rollup/plugin-babel": "^6.1.0",
|
|
54
54
|
"@storybook/react-vite": "^10.3.3",
|
|
55
55
|
"@types/react": "18.3.11",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"rollup": "4.59.0",
|
|
68
68
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
69
69
|
"styled-components": "5.3.11",
|
|
70
|
-
"typescript": "^
|
|
70
|
+
"typescript": "^6.0.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@primer/react": "*",
|