@primer/styled-react 0.0.0-20251030181155 → 0.0.0-20251030181423
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/package.json +33 -37
|
@@ -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,4 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@primer/styled-react",
|
|
3
|
+
"version": "0.0.0-20251030181423",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./deprecated": {
|
|
11
|
+
"types": "./dist/deprecated.d.ts",
|
|
12
|
+
"default": "./dist/deprecated.js"
|
|
13
|
+
},
|
|
14
|
+
"./experimental": {
|
|
15
|
+
"types": "./dist/experimental.d.ts",
|
|
16
|
+
"default": "./dist/experimental.js"
|
|
17
|
+
},
|
|
18
|
+
"./components.json": "./dist/components.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"README.md",
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "script/build",
|
|
26
|
+
"clean": "rimraf dist",
|
|
27
|
+
"lint:npm": "publint --types",
|
|
28
|
+
"type-check": "tsc --noEmit"
|
|
29
|
+
},
|
|
2
30
|
"dependencies": {
|
|
3
31
|
"@styled-system/css": "^5.1.5",
|
|
4
32
|
"@styled-system/props": "^5.1.5",
|
|
@@ -11,8 +39,8 @@
|
|
|
11
39
|
"devDependencies": {
|
|
12
40
|
"@babel/preset-react": "^7.27.1",
|
|
13
41
|
"@babel/preset-typescript": "^7.27.1",
|
|
14
|
-
"@primer/react": "0.0.0-
|
|
15
|
-
"@rollup/plugin-babel": "^6.0
|
|
42
|
+
"@primer/react": "0.0.0-20251030181423",
|
|
43
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
16
44
|
"@types/react": "18.3.11",
|
|
17
45
|
"@types/react-dom": "18.3.1",
|
|
18
46
|
"@types/styled-components": "^5.1.26",
|
|
@@ -22,33 +50,13 @@
|
|
|
22
50
|
"react": "18.3.1",
|
|
23
51
|
"react-dom": "18.3.1",
|
|
24
52
|
"rimraf": "^6.0.1",
|
|
25
|
-
"rollup": "4.
|
|
53
|
+
"rollup": "4.52.5",
|
|
26
54
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
27
55
|
"styled-components": "5.3.11",
|
|
28
56
|
"typescript": "^5.9.2"
|
|
29
57
|
},
|
|
30
|
-
"exports": {
|
|
31
|
-
".": {
|
|
32
|
-
"default": "./dist/index.js",
|
|
33
|
-
"types": "./dist/index.d.ts"
|
|
34
|
-
},
|
|
35
|
-
"./components.json": "./dist/components.json",
|
|
36
|
-
"./deprecated": {
|
|
37
|
-
"default": "./dist/deprecated.js",
|
|
38
|
-
"types": "./dist/deprecated.d.ts"
|
|
39
|
-
},
|
|
40
|
-
"./experimental": {
|
|
41
|
-
"default": "./dist/experimental.js",
|
|
42
|
-
"types": "./dist/experimental.d.ts"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"files": [
|
|
46
|
-
"README.md",
|
|
47
|
-
"dist"
|
|
48
|
-
],
|
|
49
|
-
"name": "@primer/styled-react",
|
|
50
58
|
"peerDependencies": {
|
|
51
|
-
"@primer/react": "0.0.0-
|
|
59
|
+
"@primer/react": "0.0.0-20251030181423",
|
|
52
60
|
"@types/react": "18.x || 19.x",
|
|
53
61
|
"@types/react-dom": "18.x || 19.x",
|
|
54
62
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -71,17 +79,5 @@
|
|
|
71
79
|
"@types/styled-components": {
|
|
72
80
|
"optional": true
|
|
73
81
|
}
|
|
74
|
-
}
|
|
75
|
-
"repository": {
|
|
76
|
-
"type": "git",
|
|
77
|
-
"url": "git+https://github.com/primer/react.git"
|
|
78
|
-
},
|
|
79
|
-
"scripts": {
|
|
80
|
-
"build": "script/build",
|
|
81
|
-
"clean": "rimraf dist",
|
|
82
|
-
"lint:npm": "publint --types",
|
|
83
|
-
"type-check": "tsc --noEmit"
|
|
84
|
-
},
|
|
85
|
-
"type": "module",
|
|
86
|
-
"version": "0.0.0-20251030181155"
|
|
82
|
+
}
|
|
87
83
|
}
|