@primer/styled-react 1.0.0-rc.0 → 1.0.0-rc.2
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 +2 -0
- package/dist/deprecated.d.ts.map +1 -0
- package/dist/deprecated.js +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -1
- package/package.json +8 -5
- package/dist/config/vitest/browser/setup.d.ts +0 -2
- package/dist/config/vitest/browser/setup.d.ts.map +0 -1
- package/dist/src/__tests__/exports.test.d.ts +0 -2
- package/dist/src/__tests__/exports.test.d.ts.map +0 -1
- package/dist/src/deprecated.d.ts +0 -2
- package/dist/src/deprecated.d.ts.map +0 -1
- package/dist/src/experimental.d.ts +0 -2
- package/dist/src/experimental.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/utils/__tests__/createStyledComponent.browser.test.d.ts +0 -2
- package/dist/src/utils/__tests__/createStyledComponent.browser.test.d.ts.map +0 -1
- package/dist/src/utils/createStyledComponent.d.ts +0 -20
- package/dist/src/utils/createStyledComponent.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../src/deprecated.tsx"],"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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../src/experimental.tsx"],"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
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BetterSystemStyleObject, type BoxProps, type SxProp, type SubNavProps as PrimerSubNavProps, type SubNavLinkProps as PrimerSubNavLinkProps, type ToggleSwitchProps as PrimerToggleSwitchProps } from '@primer/react';
|
|
2
|
+
import type { BackgroundProps, BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, PositionProps, ShadowProps, SpaceProps, TypographyProps } from 'styled-system';
|
|
3
|
+
type StyledProps = SxProp & SpaceProps & ColorProps & TypographyProps & LayoutProps & FlexboxProps & GridProps & BackgroundProps & BorderProps & PositionProps & ShadowProps;
|
|
4
|
+
declare const StateLabel: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
variant?: "small" | "normal";
|
|
6
|
+
status: "open" | "issueOpened" | "pullOpened" | "issueClosed" | "issueClosedNotPlanned" | "pullClosed" | "pullMerged" | "draft" | "issueDraft" | "pullQueued" | "unavailable" | "closed";
|
|
7
|
+
} & SxProp & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
type SubNavProps = PrimerSubNavProps & SxProp;
|
|
9
|
+
type SubNavLinkProps = PrimerSubNavLinkProps & SxProp;
|
|
10
|
+
declare const SubNav: import("react").ForwardRefExoticComponent<Omit<SubNavProps, "ref"> & import("react").RefAttributes<HTMLElement>> & {
|
|
11
|
+
Link: import("react").ForwardRefExoticComponent<Omit<SubNavLinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
12
|
+
};
|
|
13
|
+
declare const ToggleSwitch: import("react").ForwardRefExoticComponent<PrimerToggleSwitchProps & Omit<StyledProps, keyof PrimerToggleSwitchProps> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export { StateLabel, SubNav, ToggleSwitch };
|
|
15
|
+
export { ActionList, ActionMenu, Autocomplete, Avatar, Breadcrumbs, Button, Checkbox, CheckboxGroup, CircleBadge, CounterLabel, Details, Dialog, Flash, FormControl, Header, Heading, IconButton, Label, Link, LinkButton, NavList, Overlay, PageHeader, PageLayout, Popover, ProgressBar, RadioGroup, RelativeTime, SegmentedControl, Select, Spinner, Text, Textarea, TextInput, Timeline, Token, Tooltip, Truncate, UnderlineNav, Box, sx, ThemeProvider, merge, theme, themeGet, useColorSchemeVar, useTheme, } from '@primer/react';
|
|
16
|
+
export type { BoxProps, SxProp, BetterSystemStyleObject };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAE5B,KAAK,QAAQ,EACb,KAAK,MAAM,EAIX,KAAK,WAAW,IAAI,iBAAiB,EACrC,KAAK,eAAe,IAAI,qBAAqB,EAE7C,KAAK,iBAAiB,IAAI,uBAAuB,EAClD,MAAM,eAAe,CAAA;AAEtB,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,WAAW,GAAG,MAAM,GACvB,UAAU,GACV,UAAU,GACV,eAAe,GACf,WAAW,GACX,YAAY,GACZ,SAAS,GACT,eAAe,GACf,WAAW,GACX,aAAa,GACb,WAAW,CAAA;AAIb,QAAA,MAAM,UAAU;;;4DAEd,CAAA;AAEF,KAAK,WAAW,GAAG,iBAAiB,GAAG,MAAM,CAAA;AAM7C,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,CAAA;AAMrD,QAAA,MAAM,MAAM;;CAEV,CAAA;AAIF,QAAA,MAAM,YAAY,0KAEhB,CAAA;AAEF,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAC,CAAA;AAEzC,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,MAAM,EACN,WAAW,EACX,MAAM,EACN,QAAQ,EACR,aAAa,EACb,WAAW,EACX,YAAY,EACZ,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EAGZ,GAAG,EACH,EAAE,EAGF,aAAa,EACb,KAAK,EACL,KAAK,EACL,QAAQ,EACR,iBAAiB,EACjB,QAAQ,GACT,MAAM,eAAe,CAAA;AACtB,YAAY,EAAC,QAAQ,EAAE,MAAM,EAAE,uBAAuB,EAAC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
import { Box, SubNav as SubNav$1, StateLabel as StateLabel$1, ToggleSwitch as ToggleSwitch$1 } from '@primer/react';
|
|
2
|
+
export { ActionList, ActionMenu, Autocomplete, Avatar, Box, Breadcrumbs, Button, Checkbox, CheckboxGroup, CircleBadge, CounterLabel, Details, Dialog, Flash, FormControl, Header, Heading, IconButton, Label, Link, LinkButton, NavList, Overlay, PageHeader, PageLayout, Popover, ProgressBar, RadioGroup, RelativeTime, SegmentedControl, Select, Spinner, Text, TextInput, Textarea, ThemeProvider, Timeline, Token, Tooltip, Truncate, UnderlineNav, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
7
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
8
|
+
var t = arguments[e];
|
|
9
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
10
|
+
}
|
|
11
|
+
return n;
|
|
12
|
+
}, _extends.apply(null, arguments);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
|
|
16
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
17
|
+
as: StateLabel$1,
|
|
18
|
+
ref: ref
|
|
19
|
+
}, props));
|
|
20
|
+
});
|
|
21
|
+
const SubNavImpl = /*#__PURE__*/forwardRef(function SubNav(props, ref) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
23
|
+
as: SubNav$1,
|
|
24
|
+
ref: ref
|
|
25
|
+
}, props));
|
|
26
|
+
});
|
|
27
|
+
const SubNavLink = /*#__PURE__*/forwardRef(function SubNavLink(props, ref) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
29
|
+
as: SubNav$1.Link,
|
|
30
|
+
ref: ref
|
|
31
|
+
}, props));
|
|
32
|
+
});
|
|
33
|
+
const SubNav = Object.assign(SubNavImpl, {
|
|
34
|
+
Link: SubNavLink
|
|
35
|
+
});
|
|
36
|
+
const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
|
|
37
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
38
|
+
as: ToggleSwitch$1,
|
|
39
|
+
ref: ref
|
|
40
|
+
}, props));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { StateLabel, SubNav, ToggleSwitch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/styled-react",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,25 +23,28 @@
|
|
|
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": {
|
|
30
|
+
"@babel/preset-react": "^7.27.1",
|
|
29
31
|
"@babel/preset-typescript": "^7.27.1",
|
|
30
|
-
"@primer/react": "^38.0.0-rc.
|
|
32
|
+
"@primer/react": "^38.0.0-rc.2",
|
|
31
33
|
"@rollup/plugin-babel": "^6.0.4",
|
|
32
34
|
"@types/react": "18.3.11",
|
|
33
35
|
"@types/react-dom": "18.3.1",
|
|
34
36
|
"@vitejs/plugin-react": "^4.3.3",
|
|
37
|
+
"publint": "^0.3.12",
|
|
35
38
|
"react": "18.3.1",
|
|
36
39
|
"react-dom": "18.3.1",
|
|
37
40
|
"rimraf": "^6.0.1",
|
|
38
|
-
"rollup": "4.
|
|
41
|
+
"rollup": "4.50.1",
|
|
39
42
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
40
43
|
"styled-components": "5.3.11",
|
|
41
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.9.2"
|
|
42
45
|
},
|
|
43
46
|
"peerDependencies": {
|
|
44
|
-
"@primer/react": "38.0.0-rc.
|
|
47
|
+
"@primer/react": "38.0.0-rc.2",
|
|
45
48
|
"@types/react": "18.x || 19.x",
|
|
46
49
|
"@types/react-dom": "18.x || 19.x",
|
|
47
50
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../config/vitest/browser/setup.ts"],"names":[],"mappings":"AAEA,OAAO,kCAAkC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/exports.test.ts"],"names":[],"mappings":""}
|
package/dist/src/deprecated.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../src/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAA"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { ActionList, ActionMenu, Box, type BoxProps, Breadcrumbs, Button, Flash, FormControl, Heading, IconButton, Label, Link, LinkButton, PageLayout, Text, TextInput, Truncate, sx, type SxProp, type BetterSystemStyleObject, } from '@primer/react';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,GAAG,EACH,KAAK,QAAQ,EACb,WAAW,EACX,MAAM,EACN,KAAK,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,KAAK,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,EAGR,EAAE,EACF,KAAK,MAAM,EACX,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createStyledComponent.browser.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/__tests__/createStyledComponent.browser.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|