@primer/styled-react 0.0.0-20250930201259 → 0.0.0-20250930202124
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/ActionMenu.d.ts +2 -5
- package/dist/components/ActionMenu.d.ts.map +1 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/Token.d.ts +7 -0
- package/dist/components/Token.d.ts.map +1 -0
- package/dist/components.json +0 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -155
- package/dist/sx.d.ts +0 -3
- package/dist/sx.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/Button.d.ts +0 -13
- package/dist/components/Button.d.ts.map +0 -1
- package/dist/components/IconButton.d.ts +0 -9
- package/dist/components/IconButton.d.ts.map +0 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { ActionMenu as PrimerActionMenu, type SxProp
|
|
2
|
-
import {
|
|
1
|
+
import { ActionMenu as PrimerActionMenu, type SxProp } from '@primer/react';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
3
|
type ActionMenuOverlayProps = ComponentProps<typeof PrimerActionMenu.Overlay> & SxProp;
|
|
4
4
|
declare const ActionMenuOverlay: React.ComponentType<ActionMenuOverlayProps>;
|
|
5
|
-
export type ActionMenuButtonProps = PrimerActionMenuButtonProps & SxProp & {
|
|
6
|
-
as?: React.ElementType;
|
|
7
|
-
};
|
|
8
5
|
export declare const ActionMenu: typeof PrimerActionMenu & {
|
|
9
6
|
Button: typeof PrimerActionMenu.Button;
|
|
10
7
|
Anchor: typeof PrimerActionMenu.Anchor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../src/components/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../src/components/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,gBAAgB,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA;AAGzE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,OAAO,CAAA;AAEzC,KAAK,sBAAsB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,GAAG,MAAM,CAAA;AAEtF,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAIlE,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAAG;IACjD,MAAM,EAAE,OAAO,gBAAgB,CAAC,MAAM,CAAA;IACtC,MAAM,EAAE,OAAO,gBAAgB,CAAC,MAAM,CAAA;IACtC,OAAO,EAAE,OAAO,iBAAiB,CAAA;IACjC,OAAO,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAA;CAMxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,wBAAwB,IAAI,8BAA8B,EAChE,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/components/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,KAAK,eAAe,IAAI,qBAAqB,EAC7C,KAAK,oBAAoB,IAAI,0BAA0B,EACvD,KAAK,sBAAsB,IAAI,4BAA4B,EAC3D,KAAK,wBAAwB,IAAI,8BAA8B,EAChE,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAK,KAAK,M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OAAO,gBAAgB,CAAC,cAAc,CAAA;IACtD,WAAW,EAAE,OAAO,gBAAgB,CAAC,WAAW,CAAA;IAChD,cAAc,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAA;CACvD,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,uBAchB,CAAA;AAEF,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAE,sBAAsB,EAAE,oBAAoB,EAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TokenProps as PrimerTokenProps, type SxProp } from '@primer/react';
|
|
2
|
+
import type { ForwardRefComponent } from '../polymorphic';
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
type TokenProps = PropsWithChildren<PrimerTokenProps> & SxProp;
|
|
5
|
+
declare const Token: ForwardRefComponent<'a' | 'button' | 'span', TokenProps>;
|
|
6
|
+
export { Token, type TokenProps };
|
|
7
|
+
//# sourceMappingURL=Token.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/components.json
CHANGED
|
@@ -55,14 +55,12 @@
|
|
|
55
55
|
"BoxProps",
|
|
56
56
|
"BreadcrumbsItemProps",
|
|
57
57
|
"BreadcrumbsProps",
|
|
58
|
-
"ButtonProps",
|
|
59
58
|
"CheckboxProps",
|
|
60
59
|
"CounterLabelProps",
|
|
61
60
|
"DialogHeaderProps",
|
|
62
61
|
"DialogProps",
|
|
63
62
|
"FormControlProps",
|
|
64
63
|
"HeaderProps",
|
|
65
|
-
"IconButtonProps",
|
|
66
64
|
"LabelProps",
|
|
67
65
|
"LinkButtonProps",
|
|
68
66
|
"LinkProps",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export { ActionList } from '@primer/react';
|
|
2
2
|
export { Avatar } from '@primer/react';
|
|
3
3
|
export { Box, type BoxProps } from './components/Box';
|
|
4
|
+
export { Button } from '@primer/react';
|
|
4
5
|
export { CheckboxGroup } from '@primer/react';
|
|
5
6
|
export { Details } from '@primer/react';
|
|
7
|
+
export { IconButton } from '@primer/react';
|
|
6
8
|
export { ProgressBar } from '@primer/react';
|
|
7
9
|
export { Select } from '@primer/react';
|
|
8
10
|
export { Text } from '@primer/react';
|
|
9
11
|
export { Textarea } from '@primer/react';
|
|
10
|
-
export { TextInput
|
|
11
|
-
export { Token } from '@primer/react';
|
|
12
|
+
export { TextInput } from '@primer/react';
|
|
12
13
|
export { Tooltip } from '@primer/react';
|
|
13
|
-
export { type
|
|
14
|
+
export { type TextInputProps } from '@primer/react';
|
|
14
15
|
export { ThemeProvider } from '@primer/react';
|
|
15
16
|
export { merge } from '@primer/react';
|
|
16
17
|
export { theme } from '@primer/react';
|
|
@@ -20,7 +21,6 @@ export { useTheme } from '@primer/react';
|
|
|
20
21
|
export { ActionMenu } from './components/ActionMenu';
|
|
21
22
|
export { Autocomplete, type AutocompleteOverlayProps } from './components/Autocomplete';
|
|
22
23
|
export { Breadcrumbs, Breadcrumb, type BreadcrumbsProps, type BreadcrumbsItemProps } from './components/Breadcrumbs';
|
|
23
|
-
export { ButtonComponent as Button, type ButtonComponentProps as ButtonProps } from './components/Button';
|
|
24
24
|
export { Checkbox, type CheckboxProps } from './components/Checkbox';
|
|
25
25
|
export { CircleBadge } from './components/CircleBadge';
|
|
26
26
|
export { CounterLabel, type CounterLabelProps } from './components/CounterLabel';
|
|
@@ -29,7 +29,6 @@ export { Flash } from './components/Flash';
|
|
|
29
29
|
export { FormControl, type FormControlProps } from './components/FormControl';
|
|
30
30
|
export { Header, type HeaderProps } from './components/Header';
|
|
31
31
|
export { Heading } from './components/Heading';
|
|
32
|
-
export { IconButton, type IconButtonProps } from './components/IconButton';
|
|
33
32
|
export { Label, type LabelProps } from './components/Label';
|
|
34
33
|
export { Link, type LinkProps } from './components/Link';
|
|
35
34
|
export { LinkButton, type LinkButtonProps } from './components/LinkButton';
|
|
@@ -45,6 +44,7 @@ export { StateLabel, type StateLabelProps } from './components/StateLabel';
|
|
|
45
44
|
export { SubNav, type SubNavProps, type SubNavLinkProps } from './components/SubNav';
|
|
46
45
|
export { Timeline, type TimelineProps, type TimelineItemProps, type TimelineBadgeProps, type TimelineBodyProps, type TimelineBreakProps, } from './components/Timeline';
|
|
47
46
|
export { ToggleSwitch, type ToggleSwitchProps } from './components/ToggleSwitch';
|
|
47
|
+
export { Token, type TokenProps } from './components/Token';
|
|
48
48
|
export { Truncate, type TruncateProps } from './components/Truncate';
|
|
49
49
|
export { UnderlineNav, type UnderlineNavProps, type UnderlineNavItemProps } from './components/UnderlineNav';
|
|
50
50
|
export { sx, type SxProp } from './sx';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AACpC,OAAO,EAAC,GAAG,EAAE,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAA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EAAC,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,GACrC,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAC,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAC,MAAM,qBAAqB,CAAA;AAClF,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAC,KAAK,EAAE,KAAK,UAAU,EAAC,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAC,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAC,MAAM,2BAA2B,CAAA;AAE1G,OAAO,EAAC,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,MAAM,CAAA;AAEpC,YAAY,EAAC,uBAAuB,EAAC,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ActionMenu as ActionMenu$1, sx,
|
|
2
|
-
export { ActionList, Avatar, Box, CheckboxGroup, Details, ProgressBar, Select, Text, TextInput, Textarea, ThemeProvider,
|
|
1
|
+
import { ActionMenu as ActionMenu$1, sx, Autocomplete as Autocomplete$1, Breadcrumbs as Breadcrumbs$1, Box, Checkbox as Checkbox$1, CircleBadge as CircleBadge$1, CounterLabel as CounterLabel$1, Flash as Flash$1, FormControl as FormControl$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, PageLayout as PageLayout$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, 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';
|
|
2
|
+
export { ActionList, Avatar, Box, Button, CheckboxGroup, Details, IconButton, ProgressBar, Select, Text, TextInput, Textarea, ThemeProvider, Tooltip, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import React, { forwardRef } from 'react';
|
|
5
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
6
|
export { D as Dialog, P as PageHeader } from './PageHeader-DCDIR2C1.js';
|
|
7
|
+
import css from '@styled-system/css';
|
|
7
8
|
|
|
8
9
|
const ActionMenuOverlay = styled(ActionMenu$1.Overlay).withConfig({
|
|
9
10
|
shouldForwardProp: prop => prop !== 'sx'
|
|
@@ -11,25 +12,8 @@ const ActionMenuOverlay = styled(ActionMenu$1.Overlay).withConfig({
|
|
|
11
12
|
displayName: "ActionMenu__ActionMenuOverlay",
|
|
12
13
|
componentId: "sc-w5s60e-0"
|
|
13
14
|
})(["", ""], sx);
|
|
14
|
-
const StyledActionMenuButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
|
-
return /*#__PURE__*/jsx(Box, {
|
|
16
|
-
as: ActionMenu$1.Button,
|
|
17
|
-
ref: ref,
|
|
18
|
-
...props
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
const ActionMenuButton = /*#__PURE__*/forwardRef(({
|
|
22
|
-
as,
|
|
23
|
-
...props
|
|
24
|
-
}, ref) => /*#__PURE__*/jsx(StyledActionMenuButton, {
|
|
25
|
-
...props,
|
|
26
|
-
...(as ? {
|
|
27
|
-
forwardedAs: as
|
|
28
|
-
} : {}),
|
|
29
|
-
ref: ref
|
|
30
|
-
}));
|
|
31
15
|
const ActionMenu = Object.assign(ActionMenu$1, {
|
|
32
|
-
Button:
|
|
16
|
+
Button: ActionMenu$1.Button,
|
|
33
17
|
Anchor: ActionMenu$1.Anchor,
|
|
34
18
|
Overlay: ActionMenuOverlay,
|
|
35
19
|
Divider: ActionMenu$1.Divider
|
|
@@ -80,108 +64,6 @@ const Breadcrumbs = Object.assign(BreadcrumbsImpl, {
|
|
|
80
64
|
*/
|
|
81
65
|
const Breadcrumb = Breadcrumbs;
|
|
82
66
|
|
|
83
|
-
const StyledButtonComponent = /*#__PURE__*/forwardRef(({
|
|
84
|
-
sx,
|
|
85
|
-
...rest
|
|
86
|
-
}, ref) => {
|
|
87
|
-
const {
|
|
88
|
-
block,
|
|
89
|
-
size = 'medium',
|
|
90
|
-
leadingVisual,
|
|
91
|
-
trailingVisual,
|
|
92
|
-
trailingAction
|
|
93
|
-
} = rest;
|
|
94
|
-
let sxStyles = {};
|
|
95
|
-
const style = {};
|
|
96
|
-
if (sx !== null && Object.keys(sx || {}).length > 0) {
|
|
97
|
-
sxStyles = generateCustomSxProp({
|
|
98
|
-
block,
|
|
99
|
-
size,
|
|
100
|
-
leadingVisual,
|
|
101
|
-
trailingVisual,
|
|
102
|
-
trailingAction
|
|
103
|
-
}, sx);
|
|
104
|
-
const {
|
|
105
|
-
color
|
|
106
|
-
} = sx;
|
|
107
|
-
if (color) style['--button-color'] = color;
|
|
108
|
-
}
|
|
109
|
-
return /*#__PURE__*/jsx(Box, {
|
|
110
|
-
as: Button,
|
|
111
|
-
style: style,
|
|
112
|
-
sx: sxStyles,
|
|
113
|
-
ref: ref,
|
|
114
|
-
...rest
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
const ButtonComponent = /*#__PURE__*/forwardRef(({
|
|
118
|
-
as,
|
|
119
|
-
...props
|
|
120
|
-
}, ref) => /*#__PURE__*/jsx(StyledButtonComponent, {
|
|
121
|
-
ref: ref,
|
|
122
|
-
...props,
|
|
123
|
-
...(as ? {
|
|
124
|
-
forwardedAs: as
|
|
125
|
-
} : {})
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
|
-
// This function is used to generate a custom cssSelector for the sxProp
|
|
129
|
-
|
|
130
|
-
// The usual sx prop can like this:
|
|
131
|
-
// sx={{
|
|
132
|
-
// [`@media (max-width: 768px)`]: {
|
|
133
|
-
// '& > ul': {
|
|
134
|
-
// backgroundColor: 'deeppink',
|
|
135
|
-
// },
|
|
136
|
-
// '&:hover': {
|
|
137
|
-
// backgroundColor: 'yellow',
|
|
138
|
-
// },
|
|
139
|
-
// },
|
|
140
|
-
// '&:hover': {
|
|
141
|
-
// backgroundColor: 'yellow',
|
|
142
|
-
// },
|
|
143
|
-
// '&': {
|
|
144
|
-
// width : 320px
|
|
145
|
-
// }
|
|
146
|
-
// }}
|
|
147
|
-
//*
|
|
148
|
-
/* What we want for Button styles is this:
|
|
149
|
-
sx={{
|
|
150
|
-
// [`@media (max-width: 768px)`]: {
|
|
151
|
-
// '&[data-attribute="something"] > ul': {
|
|
152
|
-
// backgroundColor: 'deeppink',
|
|
153
|
-
// },
|
|
154
|
-
// '&[data-attribute="something"]:hover': {
|
|
155
|
-
// backgroundColor: 'yellow',
|
|
156
|
-
// },
|
|
157
|
-
// },
|
|
158
|
-
// '&[data-attribute="something"]:hover': {
|
|
159
|
-
// backgroundColor: 'yellow',
|
|
160
|
-
// },
|
|
161
|
-
// '&[data-attribute="something"]': {
|
|
162
|
-
// width : 320px
|
|
163
|
-
// }
|
|
164
|
-
// }}
|
|
165
|
-
|
|
166
|
-
// We need to make sure we append the customCSSSelector to the original class selector. i.e & - > &[data-attribute="Icon"][data-size="small"]
|
|
167
|
-
*/
|
|
168
|
-
function generateCustomSxProp(props, providedSx) {
|
|
169
|
-
// Possible data attributes: data-size, data-block, data-no-visuals
|
|
170
|
-
const size = `[data-size="${props.size}"]`;
|
|
171
|
-
const block = props.block ? `[data-block="block"]` : '';
|
|
172
|
-
const noVisuals = props.leadingVisual || props.trailingVisual || props.trailingAction ? '' : '[data-no-visuals]';
|
|
173
|
-
|
|
174
|
-
// this is a custom selector. We need to make sure we add the data attributes to the base css class (& -> &[data-attributename="value"]])
|
|
175
|
-
const cssSelector = `&${size}${block}${noVisuals}`; // &[data-size="small"][data-block="block"][data-no-visuals]
|
|
176
|
-
|
|
177
|
-
const customSxProp = {};
|
|
178
|
-
if (!providedSx) return customSxProp;else {
|
|
179
|
-
customSxProp[cssSelector] = providedSx;
|
|
180
|
-
return customSxProp;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
ButtonComponent.displayName = 'Button';
|
|
184
|
-
|
|
185
67
|
const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
|
|
186
68
|
return /*#__PURE__*/jsx(Box, {
|
|
187
69
|
as: Checkbox$1,
|
|
@@ -297,37 +179,6 @@ const Heading = styled(Heading$1).withConfig({
|
|
|
297
179
|
componentId: "sc-1vc165i-0"
|
|
298
180
|
})(["", ""], sx);
|
|
299
181
|
|
|
300
|
-
const StyledIconButton = /*#__PURE__*/forwardRef(({
|
|
301
|
-
sx,
|
|
302
|
-
...rest
|
|
303
|
-
}, ref) => {
|
|
304
|
-
let sxStyles = sx;
|
|
305
|
-
// grap the button props that have associated data attributes in the styles
|
|
306
|
-
const {
|
|
307
|
-
size = 'medium'
|
|
308
|
-
} = rest;
|
|
309
|
-
if (sx !== null && sx !== undefined && Object.keys(sx).length > 0) {
|
|
310
|
-
sxStyles = generateCustomSxProp({
|
|
311
|
-
size
|
|
312
|
-
}, sx);
|
|
313
|
-
}
|
|
314
|
-
return /*#__PURE__*/jsx(Box, {
|
|
315
|
-
sx: sxStyles,
|
|
316
|
-
as: IconButton$1,
|
|
317
|
-
ref: ref,
|
|
318
|
-
...rest
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
const IconButton = ({
|
|
322
|
-
as,
|
|
323
|
-
...props
|
|
324
|
-
}) => /*#__PURE__*/jsx(StyledIconButton, {
|
|
325
|
-
...props,
|
|
326
|
-
...(as ? {
|
|
327
|
-
forwardedAs: as
|
|
328
|
-
} : {})
|
|
329
|
-
});
|
|
330
|
-
|
|
331
182
|
const StyledLabel = /*#__PURE__*/forwardRef(function Label(props, ref) {
|
|
332
183
|
return /*#__PURE__*/jsx(Box, {
|
|
333
184
|
as: Label$1,
|
|
@@ -614,6 +465,36 @@ const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
|
|
|
614
465
|
});
|
|
615
466
|
});
|
|
616
467
|
|
|
468
|
+
const Token = /*#__PURE__*/React.forwardRef(({
|
|
469
|
+
sx: sxProp,
|
|
470
|
+
style,
|
|
471
|
+
...rest
|
|
472
|
+
}, ref) => {
|
|
473
|
+
const contextTheme = useTheme();
|
|
474
|
+
const theme$1 = contextTheme?.theme || theme;
|
|
475
|
+
|
|
476
|
+
// If no sx prop is provided, just return PrimerToken directly
|
|
477
|
+
if (!sxProp) {
|
|
478
|
+
return /*#__PURE__*/jsx(Token$1, {
|
|
479
|
+
...rest,
|
|
480
|
+
style: style,
|
|
481
|
+
ref: ref
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Convert sx to CSS styles using the theme context
|
|
486
|
+
const sxStyles = css(sxProp)(theme$1);
|
|
487
|
+
const mergedStyle = {
|
|
488
|
+
...sxStyles,
|
|
489
|
+
...style
|
|
490
|
+
};
|
|
491
|
+
return /*#__PURE__*/jsx(Token$1, {
|
|
492
|
+
...rest,
|
|
493
|
+
style: mergedStyle,
|
|
494
|
+
ref: ref
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
|
|
617
498
|
const Truncate = styled(Truncate$1).withConfig({
|
|
618
499
|
shouldForwardProp: prop => prop !== 'sx'
|
|
619
500
|
}).withConfig({
|
|
@@ -658,4 +539,4 @@ const UnderlineNav = Object.assign(UnderlineNavImpl, {
|
|
|
658
539
|
Item: UnderlineNavItem
|
|
659
540
|
});
|
|
660
541
|
|
|
661
|
-
export { ActionMenu, Autocomplete, Breadcrumb, Breadcrumbs,
|
|
542
|
+
export { ActionMenu, Autocomplete, Breadcrumb, Breadcrumbs, Checkbox, CircleBadge, CounterLabel, Flash, FormControl, Header, Heading, Label, Link, LinkButton, NavList, Overlay, PageLayout, RadioGroup, RelativeTime, SegmentedControl, Spinner, StateLabel, SubNav, Timeline, ToggleSwitch, Token, Truncate, UnderlineNav };
|
package/dist/sx.d.ts
CHANGED
package/dist/sx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../src/sx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"sx.d.ts","sourceRoot":"","sources":["../src/sx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA"}
|
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-20250930202124",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/preset-react": "^7.27.1",
|
|
32
32
|
"@babel/preset-typescript": "^7.27.1",
|
|
33
|
-
"@primer/react": "0.0.0-
|
|
33
|
+
"@primer/react": "0.0.0-20250930202124",
|
|
34
34
|
"@rollup/plugin-babel": "^6.0.4",
|
|
35
35
|
"@types/react": "18.3.11",
|
|
36
36
|
"@types/react-dom": "18.3.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": "^5.9.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@primer/react": "0.0.0-
|
|
49
|
+
"@primer/react": "0.0.0-20250930202124",
|
|
50
50
|
"@types/react": "18.x || 19.x",
|
|
51
51
|
"@types/react-dom": "18.x || 19.x",
|
|
52
52
|
"@types/react-is": "18.x || 19.x",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps as PrimerButtonProps } from '@primer/react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
|
-
import type { BetterSystemStyleObject } from '../styled-props';
|
|
4
|
-
import type { ForwardRefComponent } from '../polymorphic';
|
|
5
|
-
type ButtonComponentProps = PrimerButtonProps & SxProp & {
|
|
6
|
-
as?: React.ElementType;
|
|
7
|
-
};
|
|
8
|
-
declare const ButtonComponent: ForwardRefComponent<"button", ButtonComponentProps>;
|
|
9
|
-
export declare function generateCustomSxProp(props: Partial<Pick<PrimerButtonProps, 'size' | 'block' | 'leadingVisual' | 'trailingVisual' | 'trailingAction'>>, providedSx: BetterSystemStyleObject): {
|
|
10
|
-
[key: string]: BetterSystemStyleObject;
|
|
11
|
-
};
|
|
12
|
-
export { ButtonComponent, type ButtonComponentProps };
|
|
13
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,IAAI,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC3F,OAAO,KAAK,EAAC,MAAM,EAAsB,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,iBAAiB,CAAA;AAG5D,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAoBjF,QAAA,MAAM,eAAe,EAEf,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAA;AA0CzD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,EACjH,UAAU,EAAE,uBAAuB;;EAmBpC;AAID,OAAO,EAAC,eAAe,EAAE,KAAK,oBAAoB,EAAC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type IconButtonProps as PrimerIconButtonProps, type SxProp } from '@primer/react';
|
|
2
|
-
import { type ForwardRefComponent } from '../polymorphic';
|
|
3
|
-
type IconButtonProps = PrimerIconButtonProps & SxProp & {
|
|
4
|
-
as?: React.ElementType;
|
|
5
|
-
};
|
|
6
|
-
declare const IconButton: ForwardRefComponent<"a" | "button", IconButtonProps>;
|
|
7
|
-
export { IconButton };
|
|
8
|
-
export type { IconButtonProps };
|
|
9
|
-
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,eAAe,IAAI,qBAAqB,EAAE,KAAK,MAAM,EAAC,MAAM,eAAe,CAAA;AACxH,OAAO,EAAC,KAAK,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAKvD,KAAK,eAAe,GAAG,qBAAqB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AAahF,QAAA,MAAM,UAAU,EAEV,mBAAmB,CAAC,GAAG,GAAG,QAAQ,EAAE,eAAe,CAAC,CAAA;AAE1D,OAAO,EAAC,UAAU,EAAC,CAAA;AACnB,YAAY,EAAC,eAAe,EAAC,CAAA"}
|