@primer/styled-react 0.0.0-20251030203331 → 0.0.0-20251030203947
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,27 +1,16 @@
|
|
|
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
|
-
|
|
7
|
-
type StyledBodyProps = React.ComponentProps<'div'> & SxProp & {
|
|
8
|
-
as?: React.ElementType;
|
|
9
|
-
};
|
|
10
|
-
type StyledFooterProps = React.ComponentProps<'div'> & SxProp & {
|
|
11
|
-
as?: React.ElementType;
|
|
12
|
-
};
|
|
4
|
+
type DialogProps = PropsWithChildren<PrimerDialogProps> & SxProp;
|
|
5
|
+
type StyledBodyProps = React.ComponentProps<'div'> & SxProp;
|
|
6
|
+
type StyledFooterProps = React.ComponentProps<'div'> & SxProp;
|
|
13
7
|
declare const Dialog: import("react").ForwardRefExoticComponent<PrimerDialogProps & {
|
|
14
8
|
children?: import("react").ReactNode | undefined;
|
|
15
|
-
} & SxProp & {
|
|
16
|
-
as?: React.ElementType;
|
|
17
|
-
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
18
|
-
__SLOT__: symbol;
|
|
9
|
+
} & SxProp & import("react").RefAttributes<HTMLDivElement>> & {
|
|
19
10
|
Buttons: import("react").FC<PropsWithChildren<{
|
|
20
11
|
buttons: import("@primer/react").DialogButtonProps[];
|
|
21
12
|
}>>;
|
|
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>>;
|
|
13
|
+
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SxProp & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
14
|
Body: import("react").ForwardRefExoticComponent<Omit<StyledBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
15
|
Footer: import("react").ForwardRefExoticComponent<Omit<StyledFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
16
|
};
|
|
@@ -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,EAAC,MAAM,eAAe,CAAA;AAEnE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,EAA4C,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAEvF,KAAK,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAA;AAahE,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAA;AAO3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,MAAM,CAAA;AAM7D,QAAA,MAAM,MAAM;;;;;;;;;CAKV,CAAA;AAEF,OAAO,EAAC,MAAM,EAAC,CAAA;AACf,YAAY,EAAC,WAAW,EAAC,CAAA"}
|
|
@@ -1,86 +1,39 @@
|
|
|
1
1
|
import { Dialog as Dialog$1 } from '@primer/react';
|
|
2
|
-
import
|
|
3
|
-
import styled from 'styled-components';
|
|
2
|
+
import Box from './Box.js';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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, {
|
|
6
|
+
const DialogImpl = /*#__PURE__*/forwardRef(function Dialog(props, ref) {
|
|
7
|
+
// @ts-expect-error - PrimerDialog is not recognized as a valid component type
|
|
8
|
+
return /*#__PURE__*/jsx(Box, {
|
|
9
|
+
as: Dialog$1,
|
|
18
10
|
ref: ref,
|
|
19
|
-
...(as ? {
|
|
20
|
-
forwardedAs: as
|
|
21
|
-
} : {}),
|
|
22
11
|
...props
|
|
23
12
|
});
|
|
24
13
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
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, {
|
|
14
|
+
const DialogHeader = /*#__PURE__*/forwardRef(function DialogHeader(props, ref) {
|
|
15
|
+
return /*#__PURE__*/jsx(Box, {
|
|
16
|
+
as: Dialog$1.Header,
|
|
36
17
|
ref: ref,
|
|
37
|
-
...(as ? {
|
|
38
|
-
forwardedAs: as
|
|
39
|
-
} : {}),
|
|
40
18
|
...props
|
|
41
19
|
});
|
|
42
20
|
});
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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, {
|
|
21
|
+
const DialogBody = /*#__PURE__*/forwardRef(function DialogBody(props, ref) {
|
|
22
|
+
// @ts-expect-error - PrimerDialog.Body is not recognized as a valid component type
|
|
23
|
+
return /*#__PURE__*/jsx(Box, {
|
|
24
|
+
as: Dialog$1.Body,
|
|
54
25
|
ref: ref,
|
|
55
|
-
...(as ? {
|
|
56
|
-
forwardedAs: as
|
|
57
|
-
} : {}),
|
|
58
26
|
...props
|
|
59
27
|
});
|
|
60
28
|
});
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
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, {
|
|
29
|
+
const DialogFooter = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
|
|
30
|
+
return /*#__PURE__*/jsx(Box, {
|
|
31
|
+
as: Dialog$1.Footer,
|
|
72
32
|
ref: ref,
|
|
73
|
-
...(as ? {
|
|
74
|
-
forwardedAs: as
|
|
75
|
-
} : {}),
|
|
76
33
|
...props
|
|
77
34
|
});
|
|
78
35
|
});
|
|
79
|
-
DialogHeader.__SLOT__ = Dialog$1.Header.__SLOT__;
|
|
80
|
-
DialogBody.__SLOT__ = Dialog$1.Body.__SLOT__;
|
|
81
|
-
DialogFooter.__SLOT__ = Dialog$1.Footer.__SLOT__;
|
|
82
36
|
const Dialog = Object.assign(DialogImpl, {
|
|
83
|
-
__SLOT__: Dialog$1['__SLOT__'],
|
|
84
37
|
Buttons: Dialog$1.Buttons,
|
|
85
38
|
Header: DialogHeader,
|
|
86
39
|
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-20251030203947",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
"README.md",
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/primer/react.git"
|
|
27
|
-
},
|
|
28
24
|
"scripts": {
|
|
29
25
|
"build": "script/build",
|
|
30
26
|
"clean": "rimraf dist",
|
|
@@ -43,7 +39,7 @@
|
|
|
43
39
|
"devDependencies": {
|
|
44
40
|
"@babel/preset-react": "^7.27.1",
|
|
45
41
|
"@babel/preset-typescript": "^7.27.1",
|
|
46
|
-
"@primer/react": "0.0.0-
|
|
42
|
+
"@primer/react": "0.0.0-20251030203947",
|
|
47
43
|
"@rollup/plugin-babel": "^6.1.0",
|
|
48
44
|
"@types/react": "18.3.11",
|
|
49
45
|
"@types/react-dom": "18.3.1",
|
|
@@ -60,7 +56,7 @@
|
|
|
60
56
|
"typescript": "^5.9.2"
|
|
61
57
|
},
|
|
62
58
|
"peerDependencies": {
|
|
63
|
-
"@primer/react": "0.0.0-
|
|
59
|
+
"@primer/react": "0.0.0-20251030203947",
|
|
64
60
|
"@types/react": "18.x || 19.x",
|
|
65
61
|
"@types/react-dom": "18.x || 19.x",
|
|
66
62
|
"@types/react-is": "18.x || 19.x",
|