@primer/styled-react 0.1.0 → 1.0.0-rc.1
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/deprecated.d.ts +1 -1
- package/dist/deprecated.d.ts.map +1 -1
- package/dist/deprecated.js +1 -1
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/utils/createStyledComponent.d.ts +20 -0
- package/dist/utils/createStyledComponent.d.ts.map +1 -0
- package/package.json +14 -11
- package/dist/__tests__/exports.test.d.ts +0 -2
- package/dist/__tests__/exports.test.d.ts.map +0 -1
package/dist/deprecated.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Octicon } from '@primer/react/deprecated';
|
|
1
|
+
export { Dialog, Octicon, TabNav, Tooltip } from '@primer/react/deprecated';
|
|
2
2
|
//# sourceMappingURL=deprecated.d.ts.map
|
package/dist/deprecated.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../src/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../src/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,0BAA0B,CAAA"}
|
package/dist/deprecated.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Octicon } from '@primer/react/deprecated';
|
|
1
|
+
export { Dialog, Octicon, TabNav, Tooltip } from '@primer/react/deprecated';
|
package/dist/experimental.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Dialog } from '@primer/react/experimental';
|
|
1
|
+
export { Dialog, PageHeader, Table, Tooltip, UnderlinePanels } from '@primer/react/experimental';
|
|
2
2
|
//# sourceMappingURL=experimental.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../src/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAA"}
|
|
1
|
+
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../src/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAA"}
|
package/dist/experimental.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dialog } from '@primer/react/experimental';
|
|
1
|
+
export { Dialog, PageHeader, Table, Tooltip, UnderlinePanels } from '@primer/react/experimental';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { createStyledComponent } from './utils/createStyledComponent';
|
|
2
|
+
declare const ToggleSwitch: ReturnType<typeof createStyledComponent>;
|
|
3
|
+
export { ToggleSwitch };
|
|
4
|
+
export { ActionList, ActionMenu, Autocomplete, Avatar, BranchName, Breadcrumbs, Button, Checkbox, CheckboxGroup, CircleBadge, CircleOcticon, CounterLabel, Details, Dialog, Flash, FormControl, Header, Heading, IconButton, Label, LabelGroup, Link, LinkButton, NavList, Overlay, PageHeader, PageLayout, Popover, ProgressBar, RadioGroup, RelativeTime, SegmentedControl, Select, SelectPanel, SideNav, Spinner, Stack, StateLabel, SubNav, Text, Textarea, TextInput, TextInputWithTokens, Timeline, Token, Tooltip, Truncate, UnderlineNav, Box, type BoxProps, sx, type SxProp, type BetterSystemStyleObject, } from '@primer/react';
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAA;AAEnE,QAAA,MAAM,YAAY,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAA2D,CAAA;AACtH,OAAO,EAAC,YAAY,EAAC,CAAA;AAErB,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,MAAM,EACN,QAAQ,EACR,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,UAAU,EACV,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EAGZ,GAAG,EACH,KAAK,QAAQ,EACb,EAAE,EACF,KAAK,MAAM,EACX,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { sx, ToggleSwitch as ToggleSwitch$1 } from '@primer/react';
|
|
2
|
+
export { ActionList, ActionMenu, Autocomplete, Avatar, Box, BranchName, Breadcrumbs, Button, Checkbox, CheckboxGroup, CircleBadge, CircleOcticon, CounterLabel, Details, Dialog, Flash, FormControl, Header, Heading, IconButton, Label, LabelGroup, Link, LinkButton, NavList, Overlay, PageHeader, PageLayout, Popover, ProgressBar, RadioGroup, RelativeTime, SegmentedControl, Select, SelectPanel, SideNav, Spinner, Stack, StateLabel, SubNav, Text, TextInput, TextInputWithTokens, Textarea, Timeline, Token, Tooltip, Truncate, UnderlineNav, sx } from '@primer/react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { space, color, typography, layout, flexbox, grid, background, border, position, shadow } from 'styled-system';
|
|
5
|
+
|
|
6
|
+
function createStyledComponent(Component) {
|
|
7
|
+
return styled(Component)(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const ToggleSwitch = /*#__PURE__*/createStyledComponent(ToggleSwitch$1);
|
|
11
|
+
|
|
12
|
+
export { ToggleSwitch };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SxProp } from '@primer/react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { BackgroundProps, BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, PositionProps, ShadowProps, SpaceProps, TypographyProps } from 'styled-system';
|
|
4
|
+
type StyledBoxProps = SxProp & SpaceProps & ColorProps & TypographyProps & LayoutProps & FlexboxProps & GridProps & BackgroundProps & BorderProps & PositionProps & ShadowProps;
|
|
5
|
+
/**
|
|
6
|
+
* Utility that mirrors the functionality of the `Box` component from
|
|
7
|
+
* `@primer/react`. Used to create a styled component variant of a component
|
|
8
|
+
* from `@primer/react` that no longer supports `sx` or other styled-system
|
|
9
|
+
* props.
|
|
10
|
+
*
|
|
11
|
+
* Note: make sure to include #__PURE__ when using this function to create a
|
|
12
|
+
* component. For example:
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const Link = \/*#__PURE__*\/ createStyledComponent(PrimerLink)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function createStyledComponent<P>(Component: React.ComponentType<P>): import("styled-components").StyledComponent<React.ComponentType<P>, any, StyledBoxProps, never>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=createStyledComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStyledComponent.d.ts","sourceRoot":"","sources":["../../src/utils/createStyledComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EAChB,MAAM,eAAe,CAAA;AAEtB,KAAK,cAAc,GAAG,MAAM,GAC1B,UAAU,GACV,UAAU,GACV,eAAe,GACf,WAAW,GACX,YAAY,GACZ,SAAS,GACT,eAAe,GACf,WAAW,GACX,aAAa,GACb,WAAW,CAAA;AAEb;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,mGAczE"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/styled-react",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"default": "dist/index.js"
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"./deprecated": {
|
|
11
|
-
"types": "dist/deprecated.d.ts",
|
|
12
|
-
"default": "dist/deprecated.js"
|
|
11
|
+
"types": "./dist/deprecated.d.ts",
|
|
12
|
+
"default": "./dist/deprecated.js"
|
|
13
13
|
},
|
|
14
14
|
"./experimental": {
|
|
15
|
-
"types": "dist/experimental.d.ts",
|
|
16
|
-
"default": "dist/experimental.js"
|
|
15
|
+
"types": "./dist/experimental.d.ts",
|
|
16
|
+
"default": "./dist/experimental.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
@@ -23,24 +23,27 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "script/build",
|
|
25
25
|
"clean": "rimraf dist",
|
|
26
|
+
"lint:npm": "publint --types",
|
|
26
27
|
"type-check": "tsc --noEmit"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@babel/preset-typescript": "^7.27.1",
|
|
30
|
-
"@primer/react": "^
|
|
31
|
+
"@primer/react": "^38.0.0-rc.1",
|
|
31
32
|
"@rollup/plugin-babel": "^6.0.4",
|
|
32
33
|
"@types/react": "18.3.11",
|
|
33
34
|
"@types/react-dom": "18.3.1",
|
|
35
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
36
|
+
"publint": "^0.3.12",
|
|
34
37
|
"react": "18.3.1",
|
|
35
38
|
"react-dom": "18.3.1",
|
|
36
39
|
"rimraf": "^6.0.1",
|
|
37
|
-
"rollup": "4.
|
|
40
|
+
"rollup": "4.48.0",
|
|
38
41
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
39
42
|
"styled-components": "5.3.11",
|
|
40
|
-
"typescript": "^5.
|
|
43
|
+
"typescript": "^5.9.2"
|
|
41
44
|
},
|
|
42
45
|
"peerDependencies": {
|
|
43
|
-
"@primer/react": "
|
|
46
|
+
"@primer/react": "38.0.0-rc.1",
|
|
44
47
|
"@types/react": "18.x || 19.x",
|
|
45
48
|
"@types/react-dom": "18.x || 19.x",
|
|
46
49
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/exports.test.ts"],"names":[],"mappings":""}
|