@primer/styled-react 0.0.0-20251030204841 → 0.0.0-20251030205248
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/dist/components/Dialog.d.ts +16 -5
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.js +62 -15
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/theme-get.d.ts +2 -0
- package/dist/theme-get.d.ts.map +1 -0
- package/dist/theme-get.js +10 -0
- package/package.json +19 -5
- package/dist/components/FeatureFlaggedTheming.d.ts +0 -9
- package/dist/components/FeatureFlaggedTheming.d.ts.map +0 -1
- package/dist/components/FeatureFlaggedTheming.js +0 -54
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import type { DialogProps as PrimerDialogProps } from '@primer/react';
|
|
2
2
|
import type { SxProp } from '../sx';
|
|
3
3
|
import { type PropsWithChildren } from 'react';
|
|
4
|
-
type DialogProps = PropsWithChildren<PrimerDialogProps> & SxProp
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type DialogProps = PropsWithChildren<PrimerDialogProps> & SxProp & {
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
};
|
|
7
|
+
type StyledBodyProps = React.ComponentProps<'div'> & SxProp & {
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
};
|
|
10
|
+
type StyledFooterProps = React.ComponentProps<'div'> & SxProp & {
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
};
|
|
7
13
|
declare const Dialog: import("react").ForwardRefExoticComponent<PrimerDialogProps & {
|
|
8
14
|
children?: import("react").ReactNode | undefined;
|
|
9
|
-
} & SxProp &
|
|
15
|
+
} & SxProp & {
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
18
|
+
__SLOT__: symbol;
|
|
10
19
|
Buttons: import("react").FC<PropsWithChildren<{
|
|
11
20
|
buttons: import("@primer/react").DialogButtonProps[];
|
|
12
21
|
}>>;
|
|
13
|
-
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SxProp &
|
|
22
|
+
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SxProp & {
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
25
|
Body: import("react").ForwardRefExoticComponent<Omit<StyledBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
26
|
Footer: import("react").ForwardRefExoticComponent<Omit<StyledFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,IAAI,iBAAiB,EAAa,MAAM,eAAe,CAAA;AAC/E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AAGjC,OAAO,EAA4C,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAEvF,KAAK,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAwB3F,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAYtF,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAgBxF,QAAA,MAAM,MAAM;;;SApD6D,KAAK,CAAC,WAAW;;;;;;;aAYhB,KAAK,CAAC,WAAW;;;;CA8CzF,CAAA;AAEF,OAAO,EAAC,MAAM,EAAC,CAAA;AACf,YAAY,EAAC,WAAW,EAAC,CAAA"}
|
|
@@ -1,39 +1,86 @@
|
|
|
1
1
|
import { Dialog as Dialog$1 } from '@primer/react';
|
|
2
|
-
import
|
|
2
|
+
import sx from '../sx.js';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const StyledDialog = styled(Dialog$1).withConfig({
|
|
8
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
9
|
+
}).withConfig({
|
|
10
|
+
displayName: "Dialog__StyledDialog",
|
|
11
|
+
componentId: "sc-19zph8h-0"
|
|
12
|
+
})(["", ""], sx);
|
|
13
|
+
const DialogImpl = /*#__PURE__*/forwardRef(function Dialog({
|
|
14
|
+
as,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
return /*#__PURE__*/jsx(StyledDialog, {
|
|
10
18
|
ref: ref,
|
|
19
|
+
...(as ? {
|
|
20
|
+
forwardedAs: as
|
|
21
|
+
} : {}),
|
|
11
22
|
...props
|
|
12
23
|
});
|
|
13
24
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
const StyledDialogHeader = styled(Dialog$1.Header).withConfig({
|
|
26
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
27
|
+
}).withConfig({
|
|
28
|
+
displayName: "Dialog__StyledDialogHeader",
|
|
29
|
+
componentId: "sc-19zph8h-1"
|
|
30
|
+
})(["", ""], sx);
|
|
31
|
+
const DialogHeader = /*#__PURE__*/forwardRef(function DialogHeader({
|
|
32
|
+
as,
|
|
33
|
+
...props
|
|
34
|
+
}, ref) {
|
|
35
|
+
return /*#__PURE__*/jsx(StyledDialogHeader, {
|
|
17
36
|
ref: ref,
|
|
37
|
+
...(as ? {
|
|
38
|
+
forwardedAs: as
|
|
39
|
+
} : {}),
|
|
18
40
|
...props
|
|
19
41
|
});
|
|
20
42
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
const StyledDialogBody = styled(Dialog$1.Body).withConfig({
|
|
44
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
45
|
+
}).withConfig({
|
|
46
|
+
displayName: "Dialog__StyledDialogBody",
|
|
47
|
+
componentId: "sc-19zph8h-2"
|
|
48
|
+
})(["", ""], sx);
|
|
49
|
+
const DialogBody = /*#__PURE__*/forwardRef(function DialogBody({
|
|
50
|
+
as,
|
|
51
|
+
...props
|
|
52
|
+
}, ref) {
|
|
53
|
+
return /*#__PURE__*/jsx(StyledDialogBody, {
|
|
25
54
|
ref: ref,
|
|
55
|
+
...(as ? {
|
|
56
|
+
forwardedAs: as
|
|
57
|
+
} : {}),
|
|
26
58
|
...props
|
|
27
59
|
});
|
|
28
60
|
});
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
const StyledDialogFooter = styled(Dialog$1.Footer).withConfig({
|
|
62
|
+
shouldForwardProp: prop => prop !== 'sx'
|
|
63
|
+
}).withConfig({
|
|
64
|
+
displayName: "Dialog__StyledDialogFooter",
|
|
65
|
+
componentId: "sc-19zph8h-3"
|
|
66
|
+
})(["", ""], sx);
|
|
67
|
+
const DialogFooter = /*#__PURE__*/forwardRef(function DialogFooter({
|
|
68
|
+
as,
|
|
69
|
+
...props
|
|
70
|
+
}, ref) {
|
|
71
|
+
return /*#__PURE__*/jsx(StyledDialogFooter, {
|
|
32
72
|
ref: ref,
|
|
73
|
+
...(as ? {
|
|
74
|
+
forwardedAs: as
|
|
75
|
+
} : {}),
|
|
33
76
|
...props
|
|
34
77
|
});
|
|
35
78
|
});
|
|
79
|
+
DialogHeader.__SLOT__ = Dialog$1.Header.__SLOT__;
|
|
80
|
+
DialogBody.__SLOT__ = Dialog$1.Body.__SLOT__;
|
|
81
|
+
DialogFooter.__SLOT__ = Dialog$1.Footer.__SLOT__;
|
|
36
82
|
const Dialog = Object.assign(DialogImpl, {
|
|
83
|
+
__SLOT__: Dialog$1['__SLOT__'],
|
|
37
84
|
Buttons: Dialog$1.Buttons,
|
|
38
85
|
Header: DialogHeader,
|
|
39
86
|
Body: DialogBody,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { Box, type BoxProps } from './components/Box';
|
|
2
2
|
export { Details } from '@primer/react';
|
|
3
3
|
export { ProgressBar } from '@primer/react';
|
|
4
|
-
export { ThemeProvider, useTheme, useColorSchemeVar,
|
|
4
|
+
export { ThemeProvider, useTheme, useColorSchemeVar, type ThemeProviderProps } from './components/ThemeProvider';
|
|
5
|
+
export { BaseStyles, type BaseStylesProps } from './components/BaseStyles';
|
|
5
6
|
export { theme } from '@primer/react';
|
|
6
|
-
export { themeGet } from '
|
|
7
|
+
export { get as themeGet } from './theme-get';
|
|
7
8
|
export { ActionList, type ActionListProps, type ActionListItemProps, type ActionListLinkItemProps, type ActionListGroupProps, type ActionListDividerProps, type ActionListLeadingVisualProps, type ActionListTrailingVisualProps, type ActionListTrailingActionProps, } from './components/ActionList';
|
|
8
9
|
export { ActionMenu } from './components/ActionMenu';
|
|
9
10
|
export { Autocomplete, type AutocompleteOverlayProps } from './components/Autocomplete';
|
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,EAAC,GAAG,EAAE,KAAK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C,MAAM,2BAA2B,CAAA;AAE1G,OAAO,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,MAAM,CAAA;AAE3C,OAAO,EAAC,KAAK,uBAAuB,EAAC,MAAM,MAAM,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { default as Box } from './components/Box.js';
|
|
3
|
-
export { Details, ProgressBar, theme
|
|
4
|
-
export {
|
|
3
|
+
export { Details, ProgressBar, theme } from '@primer/react';
|
|
4
|
+
export { ThemeProvider, useColorSchemeVar, useTheme } from './components/ThemeProvider.js';
|
|
5
|
+
export { BaseStyles } from './components/BaseStyles.js';
|
|
6
|
+
export { get as themeGet } from './theme-get.js';
|
|
5
7
|
export { ActionList } from './components/ActionList.js';
|
|
6
8
|
export { ActionMenu } from './components/ActionMenu.js';
|
|
7
9
|
export { Autocomplete } from './components/Autocomplete.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-get.d.ts","sourceRoot":"","sources":["../src/theme-get.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,wBAAsC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { themeGet } from '@styled-system/theme-get';
|
|
2
|
+
import * as styledSystem from 'styled-system';
|
|
3
|
+
import { theme } from '@primer/react';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
get: getKey
|
|
7
|
+
} = styledSystem;
|
|
8
|
+
const get = key => themeGet(key, getKey(theme, key));
|
|
9
|
+
|
|
10
|
+
export { get };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/styled-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20251030205248",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,32 +21,46 @@
|
|
|
21
21
|
"README.md",
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/primer/react.git"
|
|
27
|
+
},
|
|
24
28
|
"scripts": {
|
|
25
29
|
"build": "script/build",
|
|
26
30
|
"clean": "rimraf dist",
|
|
27
31
|
"lint:npm": "publint --types",
|
|
28
32
|
"type-check": "tsc --noEmit"
|
|
29
33
|
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@styled-system/css": "^5.1.5",
|
|
36
|
+
"@styled-system/props": "^5.1.5",
|
|
37
|
+
"@styled-system/theme-get": "^5.1.2",
|
|
38
|
+
"@types/styled-system": "^5.1.23",
|
|
39
|
+
"@types/styled-system__css": "^5.0.16",
|
|
40
|
+
"@types/styled-system__theme-get": "^5.0.1",
|
|
41
|
+
"styled-system": "^5.1.5"
|
|
42
|
+
},
|
|
30
43
|
"devDependencies": {
|
|
31
44
|
"@babel/preset-react": "^7.27.1",
|
|
32
45
|
"@babel/preset-typescript": "^7.27.1",
|
|
33
|
-
"@primer/react": "0.0.0-
|
|
34
|
-
"@rollup/plugin-babel": "^6.0
|
|
46
|
+
"@primer/react": "0.0.0-20251030205248",
|
|
47
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
35
48
|
"@types/react": "18.3.11",
|
|
36
49
|
"@types/react-dom": "18.3.1",
|
|
50
|
+
"@types/styled-components": "^5.1.26",
|
|
37
51
|
"@vitejs/plugin-react": "^4.3.3",
|
|
38
52
|
"babel-plugin-styled-components": "2.1.4",
|
|
39
53
|
"publint": "^0.3.12",
|
|
40
54
|
"react": "18.3.1",
|
|
41
55
|
"react-dom": "18.3.1",
|
|
42
56
|
"rimraf": "^6.0.1",
|
|
43
|
-
"rollup": "4.
|
|
57
|
+
"rollup": "4.52.5",
|
|
44
58
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
45
59
|
"styled-components": "5.3.11",
|
|
46
60
|
"typescript": "^5.9.2"
|
|
47
61
|
},
|
|
48
62
|
"peerDependencies": {
|
|
49
|
-
"@primer/react": "0.0.0-
|
|
63
|
+
"@primer/react": "0.0.0-20251030205248",
|
|
50
64
|
"@types/react": "18.x || 19.x",
|
|
51
65
|
"@types/react-dom": "18.x || 19.x",
|
|
52
66
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useTheme as primerReactUseTheme, useColorSchemeVar as primerReactUseColorSchemeVar } from '@primer/react';
|
|
2
|
-
import { type ThemeProviderProps } from './ThemeProvider';
|
|
3
|
-
import { type BaseStylesProps } from './BaseStyles';
|
|
4
|
-
export declare const ThemeProvider: React.FC<React.PropsWithChildren<ThemeProviderProps>>;
|
|
5
|
-
export declare const BaseStyles: React.FC<React.PropsWithChildren<BaseStylesProps>>;
|
|
6
|
-
export declare const useTheme: typeof primerReactUseTheme;
|
|
7
|
-
export declare const useColorSchemeVar: typeof primerReactUseColorSchemeVar;
|
|
8
|
-
export type { ThemeProviderProps, BaseStylesProps };
|
|
9
|
-
//# sourceMappingURL=FeatureFlaggedTheming.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureFlaggedTheming.d.ts","sourceRoot":"","sources":["../../src/components/FeatureFlaggedTheming.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,IAAI,mBAAmB,EAC/B,iBAAiB,IAAI,4BAA4B,EAClD,MAAM,eAAe,CAAA;AACtB,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAsC,KAAK,eAAe,EAAC,MAAM,cAAc,CAAA;AAGtF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAO/E,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAOzE,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,OAAO,mBAM7B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,OAAO,4BAMtC,CAAA;AAED,YAAY,EAAC,kBAAkB,EAAE,eAAe,EAAC,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider as ThemeProvider$2, useTheme as useTheme$2, useColorSchemeVar as useColorSchemeVar$2, BaseStyles as BaseStyles$2 } from '@primer/react';
|
|
2
|
-
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, useColorSchemeVar as useColorSchemeVar$1 } from './ThemeProvider.js';
|
|
3
|
-
import { BaseStyles as BaseStyles$1 } from './BaseStyles.js';
|
|
4
|
-
import { useFeatureFlag } from '@primer/react/experimental';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
const ThemeProvider = ({
|
|
8
|
-
children,
|
|
9
|
-
...props
|
|
10
|
-
}) => {
|
|
11
|
-
const enabled = useFeatureFlag('primer_react_use_styled_react_theming');
|
|
12
|
-
if (enabled) {
|
|
13
|
-
return /*#__PURE__*/jsx(ThemeProvider$1, {
|
|
14
|
-
...props,
|
|
15
|
-
children: children
|
|
16
|
-
});
|
|
17
|
-
} else {
|
|
18
|
-
return /*#__PURE__*/jsx(ThemeProvider$2, {
|
|
19
|
-
...props,
|
|
20
|
-
children: children
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const BaseStyles = ({
|
|
25
|
-
children,
|
|
26
|
-
...props
|
|
27
|
-
}) => {
|
|
28
|
-
const enabled = useFeatureFlag('primer_react_use_styled_react_theming');
|
|
29
|
-
if (enabled) {
|
|
30
|
-
return /*#__PURE__*/jsx(BaseStyles$1, {
|
|
31
|
-
...props,
|
|
32
|
-
children: children
|
|
33
|
-
});
|
|
34
|
-
} else {
|
|
35
|
-
return /*#__PURE__*/jsx(BaseStyles$2, {
|
|
36
|
-
...props,
|
|
37
|
-
children: children
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const useTheme = () => {
|
|
42
|
-
const enabled = useFeatureFlag('primer_react_use_styled_react_theming');
|
|
43
|
-
const styledReactResults = useTheme$1();
|
|
44
|
-
const primerReactResults = useTheme$2();
|
|
45
|
-
return enabled ? styledReactResults : primerReactResults;
|
|
46
|
-
};
|
|
47
|
-
const useColorSchemeVar = (values, fallback) => {
|
|
48
|
-
const enabled = useFeatureFlag('primer_react_use_styled_react_theming');
|
|
49
|
-
const styledReactResults = useColorSchemeVar$1(values, fallback);
|
|
50
|
-
const primerReactResults = useColorSchemeVar$2(values, fallback);
|
|
51
|
-
return enabled ? styledReactResults : primerReactResults;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { BaseStyles, ThemeProvider, useColorSchemeVar, useTheme };
|