@primer/styled-react 1.0.0-rc.5 → 1.0.0-rc.6

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.
@@ -0,0 +1,152 @@
1
+ import { Dialog as Dialog$1, Box, PageHeader as PageHeader$1, sx, Tooltip as Tooltip$1 } from '@primer/react';
2
+ import React, { forwardRef } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+ import styled from 'styled-components';
5
+
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,
10
+ ref: ref,
11
+ ...props
12
+ });
13
+ });
14
+ const DialogHeader = /*#__PURE__*/forwardRef(function DialogHeader(props, ref) {
15
+ return /*#__PURE__*/jsx(Box, {
16
+ as: Dialog$1.Header,
17
+ ref: ref,
18
+ ...props
19
+ });
20
+ });
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,
25
+ ref: ref,
26
+ ...props
27
+ });
28
+ });
29
+ const DialogFooter = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
30
+ return /*#__PURE__*/jsx(Box, {
31
+ as: Dialog$1.Footer,
32
+ ref: ref,
33
+ ...props
34
+ });
35
+ });
36
+ const Dialog = Object.assign(DialogImpl, {
37
+ Buttons: Dialog$1.Buttons,
38
+ Header: DialogHeader,
39
+ Body: DialogBody,
40
+ Footer: DialogFooter
41
+ });
42
+
43
+ const StyledPageHeader = styled(PageHeader$1).withConfig({
44
+ shouldForwardProp: prop => prop !== 'sx'
45
+ }).withConfig({
46
+ displayName: "PageHeader__StyledPageHeader",
47
+ componentId: "sc-1g9symn-0"
48
+ })(["", ""], sx);
49
+ const PageHeaderImpl = /*#__PURE__*/React.forwardRef(({
50
+ as,
51
+ ...props
52
+ }, ref) => /*#__PURE__*/jsx(StyledPageHeader, {
53
+ ...props,
54
+ ...(as ? {
55
+ forwardedAs: as
56
+ } : {}),
57
+ ref: ref
58
+ }));
59
+ function PageHeaderActions({
60
+ sx,
61
+ ...rest
62
+ }) {
63
+ const style = {};
64
+ if (sx) {
65
+ // @ts-ignore sx has height attribute
66
+ const {
67
+ height
68
+ } = sx;
69
+ if (height) {
70
+ style['--custom-height'] = height;
71
+ }
72
+ }
73
+
74
+ // @ts-expect-error type mismatch between Box usage here and PrimerPageHeader.Actions
75
+ return /*#__PURE__*/jsx(Box, {
76
+ ...rest,
77
+ as: PageHeader$1.Actions,
78
+ style: style,
79
+ sx: sx
80
+ });
81
+ }
82
+ function StyledPageHeaderTitle({
83
+ sx,
84
+ ...rest
85
+ }) {
86
+ const style = {};
87
+ if (sx) {
88
+ // @ts-ignore sx can have color attribute
89
+ const {
90
+ fontSize,
91
+ lineHeight,
92
+ fontWeight
93
+ } = sx;
94
+ if (fontSize) {
95
+ style['--custom-font-size'] = fontSize;
96
+ }
97
+ if (lineHeight) {
98
+ style['--custom-line-height'] = lineHeight;
99
+ }
100
+ if (fontWeight) {
101
+ style['--custom-font-weight'] = fontWeight;
102
+ }
103
+ }
104
+
105
+ // @ts-expect-error type mismatch between Box usage here and PrimerPageHeader.Title
106
+ return /*#__PURE__*/jsx(Box, {
107
+ ...rest,
108
+ as: PageHeader$1.Title,
109
+ style: style,
110
+ sx: sx
111
+ });
112
+ }
113
+ const PageHeaderTitle = ({
114
+ as,
115
+ ...props
116
+ }) => /*#__PURE__*/jsx(StyledPageHeaderTitle, {
117
+ ...props,
118
+ ...(as ? {
119
+ forwardedAs: as
120
+ } : {})
121
+ });
122
+ const PageHeaderTitleArea = styled(PageHeader$1.TitleArea).withConfig({
123
+ shouldForwardProp: prop => prop !== 'sx'
124
+ }).withConfig({
125
+ displayName: "PageHeader__PageHeaderTitleArea",
126
+ componentId: "sc-1g9symn-1"
127
+ })(["", ""], sx);
128
+ const PageHeader = Object.assign(PageHeaderImpl, {
129
+ Actions: PageHeaderActions,
130
+ ContextArea: PageHeader$1.ContextArea,
131
+ ParentLink: PageHeader$1.ParentLink,
132
+ ContextBar: PageHeader$1.ContextBar,
133
+ TitleArea: PageHeaderTitleArea,
134
+ ContextAreaActions: PageHeader$1.ContextAreaActions,
135
+ LeadingAction: PageHeader$1.LeadingAction,
136
+ Breadcrumbs: PageHeader$1.Breadcrumbs,
137
+ LeadingVisual: PageHeader$1.LeadingVisual,
138
+ Title: PageHeaderTitle,
139
+ TrailingVisual: PageHeader$1.TrailingVisual,
140
+ Description: PageHeader$1.Description,
141
+ TrailingAction: PageHeader$1.TrailingAction
142
+ });
143
+
144
+ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
145
+ return /*#__PURE__*/jsx(Box, {
146
+ as: Tooltip$1,
147
+ ref: ref,
148
+ ...props
149
+ });
150
+ });
151
+
152
+ export { Dialog as D, PageHeader as P, Tooltip as T };
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { ActionList as PrimerActionList, type ActionListProps as PrimerActionListProps, type ActionListItemProps as PrimerActionListItemProps, type ActionListLinkItemProps as PrimerActionListLinkItemProps, type ActionListGroupProps as PrimerActionListGroupProps, type ActionListDividerProps as PrimerActionListDividerProps, type ActionListLeadingVisualProps as PrimerActionListLeadingVisualProps, type ActionListTrailingVisualProps as PrimerActionListTrailingVisualProps } from '@primer/react';
3
+ import { type SxProp } from '../sx';
4
+ import type { ForwardRefComponent } from '../polymorphic';
5
+ type PrimerActionListTrailingActionProps = React.ComponentProps<typeof PrimerActionList.TrailingAction>;
6
+ export type ActionListProps<As extends React.ElementType = 'ul'> = PrimerActionListProps<As> & SxProp;
7
+ export type ActionListItemProps = React.PropsWithChildren<PrimerActionListItemProps & SxProp>;
8
+ export type ActionListLinkItemProps = React.PropsWithChildren<PrimerActionListLinkItemProps & SxProp>;
9
+ export type ActionListGroupProps = React.PropsWithChildren<PrimerActionListGroupProps & SxProp>;
10
+ export type ActionListDividerProps = React.PropsWithChildren<PrimerActionListDividerProps & SxProp>;
11
+ export type ActionListLeadingVisualProps = React.PropsWithChildren<PrimerActionListLeadingVisualProps & SxProp>;
12
+ export type ActionListTrailingVisualProps = React.PropsWithChildren<PrimerActionListTrailingVisualProps & SxProp>;
13
+ export type ActionListTrailingActionProps = React.PropsWithChildren<PrimerActionListTrailingActionProps & SxProp>;
14
+ declare const ActionListImpl: React.ForwardRefExoticComponent<Omit<ActionListProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
15
+ declare const ActionListLinkItem: ForwardRefComponent<'a', ActionListLinkItemProps>;
16
+ type TrailingActionElements = 'button' | 'a';
17
+ declare const ActionListTrailingAction: ForwardRefComponent<TrailingActionElements, ActionListTrailingActionProps>;
18
+ declare const ActionListItem: ForwardRefComponent<"li", ActionListItemProps>;
19
+ declare const ActionListGroup: React.ComponentType<ActionListGroupProps>;
20
+ declare const ActionListDivider: React.ComponentType<ActionListDividerProps>;
21
+ declare const ActionListLeadingVisual: React.ComponentType<ActionListLeadingVisualProps>;
22
+ declare const ActionListTrailingVisual: React.ComponentType<ActionListTrailingVisualProps>;
23
+ export declare const ActionList: typeof ActionListImpl & {
24
+ Item: typeof ActionListItem;
25
+ LinkItem: typeof ActionListLinkItem;
26
+ Group: typeof ActionListGroup;
27
+ GroupHeading: typeof PrimerActionList.GroupHeading;
28
+ Divider: typeof ActionListDivider;
29
+ Description: typeof PrimerActionList.Description;
30
+ LeadingVisual: typeof ActionListLeadingVisual;
31
+ TrailingVisual: typeof ActionListTrailingVisual;
32
+ Heading: typeof PrimerActionList.Heading;
33
+ TrailingAction: typeof ActionListTrailingAction;
34
+ };
35
+ export {};
36
+ //# sourceMappingURL=ActionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../src/components/ActionList.tsx"],"names":[],"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 @@
1
+ import { Table as PrimerDataTable, type TableContainerProps } from '@primer/react/experimental';
2
+ import { type SxProp } from '../sx';
3
+ import type React from 'react';
4
+ type DataTableContainerProps<As extends React.ElementType = 'div'> = TableContainerProps<As> & SxProp;
5
+ declare function DataTableContainer<As extends React.ElementType = 'div'>({ as, ...rest }: DataTableContainerProps<As>): React.JSX.Element;
6
+ declare const Table: typeof PrimerDataTable & {
7
+ Container: typeof DataTableContainer;
8
+ };
9
+ export type { TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableHeaderProps, TableCellProps, TableTitleProps, TableSubtitleProps, TableActionsProps, } from '@primer/react/experimental';
10
+ export { Table, type DataTableContainerProps };
11
+ //# sourceMappingURL=DataTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../src/components/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,eAAe,EAAE,KAAK,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,uBAAuB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,mBAAmB,CAAC,EAAE,CAAC,GAAG,MAAM,CAAA;AAYrG,iBAAS,kBAAkB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,EAAC,EAAE,EAAE,GAAG,IAAI,EAAC,EAAE,uBAAuB,CAAC,EAAE,CAAC,qBAE3G;AAED,QAAA,MAAM,KAAK,EAAE,OAAO,eAAe,GAAG;IACpC,SAAS,EAAE,OAAO,kBAAkB,CAAA;CAIpC,CAAA;AAEF,YAAY,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAC,KAAK,EAAE,KAAK,uBAAuB,EAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/components/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,IAAI,gBAAgB,EAA4B,MAAM,eAAe,CAAA;AAC5F,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAEjC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,KAAK,UAAU,GAAG,gBAAgB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAMtE,QAAA,MAAM,KAAK,EAEL,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAE7C,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,CAAA"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../src/components/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,IAAI,gBAAgB,EAAuB,MAAM,eAAe,CAAA;AACvF,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAErC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAGvD,KAAK,UAAU,GAAG,gBAAgB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAQtE,QAAA,MAAM,KAAK,EAEL,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAE7C,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import type { PageLayoutProps as PrimerPageLayoutProps, PageLayoutContentProps as PrimerPageLayoutContentProps, PageLayoutPaneProps as PrimerPageLayoutPaneProps } from '@primer/react';
3
+ import { type SxProp } from '../sx';
4
+ type PageLayoutProps = PropsWithChildren<PrimerPageLayoutProps> & SxProp;
5
+ declare const PageLayout: React.ForwardRefExoticComponent<PrimerPageLayoutProps & {
6
+ children?: React.ReactNode | undefined;
7
+ } & SxProp & React.RefAttributes<HTMLDivElement>> & {
8
+ Content: React.ForwardRefExoticComponent<PrimerPageLayoutContentProps & {
9
+ children?: React.ReactNode | undefined;
10
+ } & SxProp & React.RefAttributes<HTMLDivElement>>;
11
+ Header: React.FC<React.PropsWithChildren<import("@primer/react").PageLayoutHeaderProps>>;
12
+ Pane: React.ForwardRefExoticComponent<PrimerPageLayoutPaneProps & {
13
+ children?: React.ReactNode | undefined;
14
+ } & SxProp & React.RefAttributes<HTMLDivElement>>;
15
+ Footer: React.FC<React.PropsWithChildren<import("@primer/react").PageLayoutFooterProps>>;
16
+ };
17
+ export { PageLayout, type PageLayoutProps };
18
+ //# sourceMappingURL=PageLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/components/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAEnD,OAAO,KAAK,EACV,eAAe,IAAI,qBAAqB,EACxC,sBAAsB,IAAI,4BAA4B,EACtD,mBAAmB,IAAI,yBAAyB,EACjD,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAMrC,KAAK,eAAe,GAAG,iBAAiB,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAA;AAmBxE,QAAA,MAAM,UAAU;;;;;;;;;;;CAKd,CAAA;AAEF,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,CAAA"}
@@ -1,6 +1,5 @@
1
- import { type SpinnerProps as PrimerSpinnerProps } from '@primer/react';
2
- import React from 'react';
3
- import type { SxProp } from '../sx';
1
+ import { Spinner as PrimerSpinner, type SpinnerProps as PrimerSpinnerProps } from '@primer/react';
2
+ import { type SxProp } from '../sx';
4
3
  export type SpinnerProps = PrimerSpinnerProps & SxProp;
5
- export declare function Spinner(props: SpinnerProps): React.JSX.Element;
4
+ export declare const Spinner: import("styled-components").StyledComponent<typeof PrimerSpinner, any, SpinnerProps, never>;
6
5
  //# sourceMappingURL=Spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,eAAe,CAAA;AACpG,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AAEjC,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,MAAM,CAAA;AAEtD,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,qBAE1C"}
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/components/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,aAAa,EAAE,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AAGrC,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,MAAM,CAAA;AAEtD,eAAO,MAAM,OAAO,6FAInB,CAAA"}
@@ -1,7 +1,8 @@
1
- import { type TokenProps as PrimerTokenProps, type SxProp } from '@primer/react';
1
+ import { type TokenProps as PrimerTokenProps } from '@primer/react';
2
+ import { type SxProp } from '../sx';
2
3
  import type { ForwardRefComponent } from '../polymorphic';
3
4
  import type { PropsWithChildren } from 'react';
4
5
  type TokenProps = PropsWithChildren<PrimerTokenProps> & SxProp;
5
- declare const Token: ForwardRefComponent<'a' | 'button' | 'span', TokenProps>;
6
+ declare const Token: ForwardRefComponent<"a" | "button" | "span", TokenProps>;
6
7
  export { Token, type TokenProps };
7
8
  //# sourceMappingURL=Token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/components/Token.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,IAAI,gBAAgB,EACnC,KAAK,MAAM,EAIZ,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAE5C,KAAK,UAAU,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAA;AAE9D,QAAA,MAAM,KAAK,EAAE,mBAAmB,CAAC,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,UAAU,CAgBP,CAAA;AAE7D,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,CAAA"}
1
+ {"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/components/Token.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,UAAU,IAAI,gBAAgB,EAAuB,MAAM,eAAe,CAAA;AACvF,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AACvD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAG5C,KAAK,UAAU,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAA;AAQ9D,QAAA,MAAM,KAAK,EAEL,mBAAmB,CAAC,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,UAAU,CAAC,CAAA;AAE9D,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ import { type ActionListProps as PrimerActionListProps, type ActionListItemProps as PrimerActionListItemProps, type ActionListGroupProps as PrimerActionListGroupProps } from '@primer/react/deprecated';
3
+ import { type SxProp } from '../../sx';
4
+ import type { ActionListDividerProps } from '@primer/react';
5
+ type ActionListProps = PropsWithChildren<PrimerActionListProps & SxProp>;
6
+ type ActionListItemProps = PropsWithChildren<PrimerActionListItemProps & SxProp & {
7
+ as?: React.ElementType;
8
+ }>;
9
+ type ActionListGroupProps = PropsWithChildren<PrimerActionListGroupProps & SxProp>;
10
+ declare function ActionListGroup(props: ActionListGroupProps): import("react").JSX.Element;
11
+ declare function ActionListDivider(props: ActionListDividerProps): import("react").JSX.Element;
12
+ declare const ActionList: import("react").ForwardRefExoticComponent<ActionListProps & import("react").RefAttributes<HTMLDivElement>> & {
13
+ Item: import("react").ForwardRefExoticComponent<PrimerActionListItemProps & SxProp & {
14
+ as?: React.ElementType;
15
+ } & {
16
+ children?: import("react").ReactNode | undefined;
17
+ } & import("react").RefAttributes<HTMLLIElement>>;
18
+ Group: typeof ActionListGroup;
19
+ Divider: typeof ActionListDivider;
20
+ };
21
+ export type { ActionListProps, ActionListItemProps, ActionListGroupProps };
22
+ export { ActionList };
23
+ //# sourceMappingURL=ActionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/ActionList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAA;AACxD,OAAO,EAEL,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,UAAU,CAAA;AAGxC,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAA;AAEzD,KAAK,eAAe,GAAG,iBAAiB,CAAC,qBAAqB,GAAG,MAAM,CAAC,CAAA;AAExE,KAAK,mBAAmB,GAAG,iBAAiB,CAAC,yBAAyB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAC,CAAA;AAC3G,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,0BAA0B,GAAG,MAAM,CAAC,CAAA;AAgBlF,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAEnD;AAED,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAEvD;AAED,QAAA,MAAM,UAAU;;aAzBwE,KAAK,CAAC,WAAW;;;;;;CA6BvG,CAAA;AAEF,YAAY,EAAC,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAC,CAAA;AACxE,OAAO,EAAC,UAAU,EAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { DialogProps as PrimerDialogProps, DialogHeaderProps as PrimerDialogHeaderProps } from '@primer/react/deprecated';
2
+ import type { SxProp } from '../../sx';
3
+ import type { ForwardRefComponent } from '../../polymorphic';
4
+ type DialogProps = PrimerDialogProps & SxProp;
5
+ type DialogHeaderProps = PrimerDialogHeaderProps & SxProp;
6
+ declare const Dialog: ForwardRefComponent<"div", DialogProps> & {
7
+ Header: ForwardRefComponent<"div", DialogHeaderProps>;
8
+ };
9
+ export { Dialog };
10
+ export type { DialogProps, DialogHeaderProps };
11
+ //# sourceMappingURL=DialogV1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogV1.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/DialogV1.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,IAAI,iBAAiB,EAChC,iBAAiB,IAAI,uBAAuB,EAC7C,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAEpC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAE1D,KAAK,WAAW,GAAG,iBAAiB,GAAG,MAAM,CAAA;AAU7C,KAAK,iBAAiB,GAAG,uBAAuB,GAAG,MAAM,CAAA;AAUzD,QAAA,MAAM,MAAM;;CAEV,CAAA;AAEF,OAAO,EAAC,MAAM,EAAC,CAAA;AACf,YAAY,EAAC,WAAW,EAAE,iBAAiB,EAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { type OcticonProps as PrimerOcticonProps } from '@primer/react/deprecated';
2
+ import { type SxProp } from '../../sx';
3
+ /**
4
+ * @deprecated Use the icon component directly from `@primer/octicons-react` instead
5
+ */
6
+ export type OcticonProps = PrimerOcticonProps & SxProp & {
7
+ color?: string;
8
+ };
9
+ declare const Octicon: import("react").ForwardRefExoticComponent<{
10
+ icon: React.ElementType;
11
+ as?: React.ElementType;
12
+ } & import("@primer/octicons-react").IconProps & SxProp & {
13
+ color?: string;
14
+ } & import("react").RefAttributes<unknown>>;
15
+ export default Octicon;
16
+ export { Octicon };
17
+ //# sourceMappingURL=Octicon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Octicon.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/Octicon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAE1G,OAAO,EAAC,KAAK,MAAM,EAAK,MAAM,UAAU,CAAA;AAGxC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,MAAM,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAazE,QAAA,MAAM,OAAO;;;;YAbqD,MAAM;2CAetE,CAAA;AAEF,eAAe,OAAO,CAAA;AACtB,OAAO,EAAC,OAAO,EAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { TabNavProps as PrimerTabNavProps, TabNavLinkProps as PrimerTabNavLinkProps } from '@primer/react/deprecated';
2
+ import { type SxProp } from '../../sx';
3
+ type TabNavProps = PrimerTabNavProps & SxProp;
4
+ type TabNavLinkProps = PrimerTabNavLinkProps & SxProp;
5
+ declare const TabNav: (({ as, ...props }: TabNavProps) => import("react").JSX.Element) & {
6
+ Link: import("react").ForwardRefExoticComponent<Omit<TabNavLinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
7
+ };
8
+ export { TabNav, type TabNavProps, type TabNavLinkProps };
9
+ //# sourceMappingURL=TabNav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabNav.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/TabNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,IAAI,iBAAiB,EAAE,eAAe,IAAI,qBAAqB,EAAC,MAAM,0BAA0B,CAAA;AACxH,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,UAAU,CAAA;AAIxC,KAAK,WAAW,GAAG,iBAAiB,GAAG,MAAM,CAAA;AAC7C,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,CAAA;AAsBrD,QAAA,MAAM,MAAM,sBAdwB,WAAW;;CAgB7C,CAAA;AAEF,OAAO,EAAC,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { type TooltipProps as PrimerTooltipProps } from '@primer/react/deprecated';
2
+ import { type SxProp } from '../../sx';
3
+ import { type PropsWithChildren } from 'react';
4
+ type TooltipProps = PropsWithChildren<PrimerTooltipProps & SxProp & {
5
+ as?: React.ElementType;
6
+ }>;
7
+ declare const TooltipImpl: import("react").ForwardRefExoticComponent<Omit<TooltipProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
8
+ declare const Tooltip: typeof TooltipImpl & {
9
+ alignments: string[];
10
+ directions: string[];
11
+ };
12
+ export { Tooltip, type TooltipProps };
13
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/deprecated/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,YAAY,IAAI,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAE1G,OAAO,EAAK,KAAK,MAAM,EAAC,MAAM,UAAU,CAAA;AACxC,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAI5C,KAAK,YAAY,GAAG,iBAAiB,CAAC,kBAAkB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAC,CAAA;AAQ7F,QAAA,MAAM,WAAW,uHAEf,CAAA;AAEF,QAAA,MAAM,OAAO,EAAkB,OAAO,WAAW,GAAG;IAClD,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAMD,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,CAAA"}
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
- import { ActionMenu as ActionMenu$1, sx, Autocomplete as Autocomplete$1, Box, Avatar as Avatar$1, Breadcrumbs as Breadcrumbs$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CircleBadge as CircleBadge$1, CounterLabel as CounterLabel$1, Flash as Flash$1, Header as Header$1, Heading as Heading$1, Label as Label$1, Link as Link$1, LinkButton as LinkButton$1, NavList as NavList$1, Overlay as Overlay$1, RadioGroup as RadioGroup$1, RelativeTime as RelativeTime$1, SegmentedControl as SegmentedControl$1, Spinner as Spinner$1, StateLabel as StateLabel$1, SubNav as SubNav$1, Text as Text$1, Timeline as Timeline$1, ToggleSwitch as ToggleSwitch$1, useTheme, theme, Token as Token$1, Truncate as Truncate$1, UnderlineNav as UnderlineNav$1 } from '@primer/react';
1
+ import { ActionMenu as ActionMenu$1, sx, Autocomplete as Autocomplete$1, Box, Avatar as Avatar$1, Breadcrumbs as Breadcrumbs$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CircleBadge as CircleBadge$1, CounterLabel as CounterLabel$1, Flash as Flash$1, Header as Header$1, Heading as Heading$1, Label as Label$1, Link as Link$1, LinkButton as LinkButton$1, NavList as NavList$1, Overlay as Overlay$1, RadioGroup as RadioGroup$1, RelativeTime as RelativeTime$1, SegmentedControl as SegmentedControl$1, Spinner as Spinner$1, StateLabel as StateLabel$1, SubNav as SubNav$1, Text as Text$1, Timeline as Timeline$1, ToggleSwitch as ToggleSwitch$1, Token as Token$1, Truncate as Truncate$1, UnderlineNav as UnderlineNav$1 } from '@primer/react';
2
2
  export { ActionList, Box, Button, Details, FormControl, IconButton, PageLayout, ProgressBar, Select, TextInput, Textarea, ThemeProvider, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
3
3
  import styled from 'styled-components';
4
- import React, { forwardRef } from 'react';
4
+ import { forwardRef } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
  export { D as Dialog, P as PageHeader } from './PageHeader-DCDIR2C1.js';
7
7
  export { T as Tooltip } from './Tooltip-YuSlJ5b_.js';
8
- import css from '@styled-system/css';
9
8
  import '@primer/react/deprecated';
10
9
 
11
10
  const ActionMenuOverlay = styled(ActionMenu$1.Overlay).withConfig({
@@ -190,13 +189,12 @@ const Heading = styled(Heading$1).withConfig({
190
189
  componentId: "sc-1vc165i-0"
191
190
  })(["", ""], sx);
192
191
 
193
- const StyledLabel = /*#__PURE__*/forwardRef(function Label(props, ref) {
194
- return /*#__PURE__*/jsx(Box, {
195
- as: Label$1,
196
- ref: ref,
197
- ...props
198
- });
199
- });
192
+ const StyledLabel = styled(Label$1).withConfig({
193
+ shouldForwardProp: prop => prop !== 'sx'
194
+ }).withConfig({
195
+ displayName: "Label__StyledLabel",
196
+ componentId: "sc-1cpass9-0"
197
+ })(["", ""], sx);
200
198
  const Label = /*#__PURE__*/forwardRef(({
201
199
  as,
202
200
  ...props
@@ -345,12 +343,12 @@ const SegmentedControl = Object.assign(SegmentedControlImpl, {
345
343
  IconButton: SegmentedControlIconButton
346
344
  });
347
345
 
348
- function Spinner(props) {
349
- return /*#__PURE__*/jsx(Box, {
350
- as: Spinner$1,
351
- ...props
352
- });
353
- }
346
+ const Spinner = styled(Spinner$1).withConfig({
347
+ shouldForwardProp: prop => prop !== 'sx'
348
+ }).withConfig({
349
+ displayName: "Spinner",
350
+ componentId: "sc-jbw2a0-0"
351
+ })(["", ""], sx);
354
352
 
355
353
  const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
356
354
  return /*#__PURE__*/jsx(Box, {
@@ -447,32 +445,21 @@ const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
447
445
  });
448
446
  });
449
447
 
450
- const Token = /*#__PURE__*/React.forwardRef(({
451
- sx: sxProp,
452
- style,
453
- ...rest
448
+ const StyledToken = styled(Token$1).withConfig({
449
+ shouldForwardProp: prop => prop !== 'sx'
450
+ }).withConfig({
451
+ displayName: "Token__StyledToken",
452
+ componentId: "sc-ldn0r8-0"
453
+ })(["", ""], sx);
454
+ const Token = /*#__PURE__*/forwardRef(({
455
+ as,
456
+ ...props
454
457
  }, ref) => {
455
- const contextTheme = useTheme();
456
- const theme$1 = contextTheme.theme || theme;
457
-
458
- // If no sx prop is provided, just return PrimerToken directly
459
- if (!sxProp) {
460
- return /*#__PURE__*/jsx(Token$1, {
461
- ...rest,
462
- style: style,
463
- ref: ref
464
- });
465
- }
466
-
467
- // Convert sx to CSS styles using the theme context
468
- const sxStyles = css(sxProp)(theme$1);
469
- const mergedStyle = {
470
- ...sxStyles,
471
- ...style
472
- };
473
- return /*#__PURE__*/jsx(Token$1, {
474
- ...rest,
475
- style: mergedStyle,
458
+ return /*#__PURE__*/jsx(StyledToken, {
459
+ ...props,
460
+ ...(as ? {
461
+ forwardedAs: as
462
+ } : {}),
476
463
  ref: ref
477
464
  });
478
465
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/styled-react",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {