@primer/styled-react 0.0.0-20251030203243 → 0.0.0-20251030203331
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.
|
@@ -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/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-20251030203331",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,6 +21,10 @@
|
|
|
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",
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
"devDependencies": {
|
|
40
44
|
"@babel/preset-react": "^7.27.1",
|
|
41
45
|
"@babel/preset-typescript": "^7.27.1",
|
|
42
|
-
"@primer/react": "0.0.0-
|
|
46
|
+
"@primer/react": "0.0.0-20251030203331",
|
|
43
47
|
"@rollup/plugin-babel": "^6.1.0",
|
|
44
48
|
"@types/react": "18.3.11",
|
|
45
49
|
"@types/react-dom": "18.3.1",
|
|
@@ -56,7 +60,7 @@
|
|
|
56
60
|
"typescript": "^5.9.2"
|
|
57
61
|
},
|
|
58
62
|
"peerDependencies": {
|
|
59
|
-
"@primer/react": "0.0.0-
|
|
63
|
+
"@primer/react": "0.0.0-20251030203331",
|
|
60
64
|
"@types/react": "18.x || 19.x",
|
|
61
65
|
"@types/react-dom": "18.x || 19.x",
|
|
62
66
|
"@types/react-is": "18.x || 19.x",
|