@primer/styled-react 0.0.0-20251007205211 → 0.0.0-20251007211642
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/PageHeader.d.ts.map +1 -1
- package/dist/components.json +0 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -169
- 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
- package/dist/components/TextInput.d.ts +0 -20
- package/dist/components/TextInput.d.ts.map +0 -1
|
@@ -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,MAAM,EAAC,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,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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"}
|
package/dist/components.json
CHANGED
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"BoxProps",
|
|
65
65
|
"BreadcrumbsItemProps",
|
|
66
66
|
"BreadcrumbsProps",
|
|
67
|
-
"ButtonProps",
|
|
68
67
|
"CheckboxGroupProps",
|
|
69
68
|
"CheckboxProps",
|
|
70
69
|
"CounterLabelProps",
|
|
@@ -72,7 +71,6 @@
|
|
|
72
71
|
"DialogHeaderProps",
|
|
73
72
|
"DialogProps",
|
|
74
73
|
"HeaderProps",
|
|
75
|
-
"IconButtonProps",
|
|
76
74
|
"LabelProps",
|
|
77
75
|
"LinkButtonProps",
|
|
78
76
|
"LinkProps",
|
|
@@ -103,7 +101,6 @@
|
|
|
103
101
|
"TableTitleProps",
|
|
104
102
|
"TabNavLinkProps",
|
|
105
103
|
"TabNavProps",
|
|
106
|
-
"TextInputActionProps",
|
|
107
104
|
"TextInputProps",
|
|
108
105
|
"TextProps",
|
|
109
106
|
"TimelineBadgeProps",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export { Box, type BoxProps } from './components/Box';
|
|
2
|
+
export { Button } from '@primer/react';
|
|
2
3
|
export { Details } from '@primer/react';
|
|
3
4
|
export { FormControl } from '@primer/react';
|
|
5
|
+
export { IconButton } from '@primer/react';
|
|
4
6
|
export { ProgressBar } from '@primer/react';
|
|
5
7
|
export { Select } from '@primer/react';
|
|
6
8
|
export { Textarea } from '@primer/react';
|
|
9
|
+
export { TextInput } from '@primer/react';
|
|
10
|
+
export { type TextInputProps } from '@primer/react';
|
|
7
11
|
export { ThemeProvider } from '@primer/react';
|
|
8
12
|
export { merge } from '@primer/react';
|
|
9
13
|
export { theme } from '@primer/react';
|
|
@@ -15,7 +19,6 @@ export { ActionMenu } from './components/ActionMenu';
|
|
|
15
19
|
export { Autocomplete, type AutocompleteOverlayProps } from './components/Autocomplete';
|
|
16
20
|
export { Avatar, type AvatarProps } from './components/Avatar';
|
|
17
21
|
export { Breadcrumbs, Breadcrumb, type BreadcrumbsProps, type BreadcrumbsItemProps } from './components/Breadcrumbs';
|
|
18
|
-
export { ButtonComponent as Button, type ButtonComponentProps as ButtonProps } from './components/Button';
|
|
19
22
|
export { Checkbox, type CheckboxProps } from './components/Checkbox';
|
|
20
23
|
export { CheckboxGroup, type CheckboxGroupProps } from './components/CheckboxGroup';
|
|
21
24
|
export { CircleBadge } from './components/CircleBadge';
|
|
@@ -24,7 +27,6 @@ export { Dialog, type DialogProps } from './components/Dialog';
|
|
|
24
27
|
export { Flash } from './components/Flash';
|
|
25
28
|
export { Header, type HeaderProps } from './components/Header';
|
|
26
29
|
export { Heading } from './components/Heading';
|
|
27
|
-
export { IconButton, type IconButtonProps } from './components/IconButton';
|
|
28
30
|
export { Label, type LabelProps } from './components/Label';
|
|
29
31
|
export { Link, type LinkProps } from './components/Link';
|
|
30
32
|
export { LinkButton, type LinkButtonProps } from './components/LinkButton';
|
|
@@ -39,7 +41,6 @@ export { Spinner, type SpinnerProps } from './components/Spinner';
|
|
|
39
41
|
export { StateLabel, type StateLabelProps } from './components/StateLabel';
|
|
40
42
|
export { SubNav, type SubNavProps, type SubNavLinkProps } from './components/SubNav';
|
|
41
43
|
export { Text, type TextProps } from './components/Text';
|
|
42
|
-
export { TextInput, type TextInputProps, type TextInputActionProps } from './components/TextInput';
|
|
43
44
|
export { Timeline, type TimelineProps, type TimelineItemProps, type TimelineBadgeProps, type TimelineBodyProps, type TimelineBreakProps, } from './components/Timeline';
|
|
44
45
|
export { ToggleSwitch, type ToggleSwitchProps } from './components/ToggleSwitch';
|
|
45
46
|
export { Tooltip, type TooltipProps } from './components/Tooltip';
|
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,GAAG,EAAE,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AACpC,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAA;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AACtC,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AACvC,OAAO,EAAC,KAAK,cAAc,EAAC,MAAM,eAAe,CAAA;AAGjD,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AACnC,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AACnC,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AACtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe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,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,5 +1,5 @@
|
|
|
1
|
-
import { ActionList as ActionList$1, sx, ActionMenu as ActionMenu$1, Autocomplete as Autocomplete$1, Box, Avatar as Avatar$1, Breadcrumbs as Breadcrumbs$1,
|
|
2
|
-
export { Box, Details, FormControl, ProgressBar, Select, Textarea, ThemeProvider, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
|
|
1
|
+
import { ActionList as ActionList$1, sx, ActionMenu as ActionMenu$1, 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, 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, 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';
|
|
2
|
+
export { Box, Button, Details, FormControl, IconButton, ProgressBar, Select, TextInput, Textarea, ThemeProvider, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -170,108 +170,6 @@ const Breadcrumbs = Object.assign(BreadcrumbsImpl, {
|
|
|
170
170
|
*/
|
|
171
171
|
const Breadcrumb = Breadcrumbs;
|
|
172
172
|
|
|
173
|
-
const StyledButtonComponent = /*#__PURE__*/forwardRef(({
|
|
174
|
-
sx,
|
|
175
|
-
...rest
|
|
176
|
-
}, ref) => {
|
|
177
|
-
const {
|
|
178
|
-
block,
|
|
179
|
-
size = 'medium',
|
|
180
|
-
leadingVisual,
|
|
181
|
-
trailingVisual,
|
|
182
|
-
trailingAction
|
|
183
|
-
} = rest;
|
|
184
|
-
let sxStyles = {};
|
|
185
|
-
const style = {};
|
|
186
|
-
if (sx !== null && Object.keys(sx || {}).length > 0) {
|
|
187
|
-
sxStyles = generateCustomSxProp({
|
|
188
|
-
block,
|
|
189
|
-
size,
|
|
190
|
-
leadingVisual,
|
|
191
|
-
trailingVisual,
|
|
192
|
-
trailingAction
|
|
193
|
-
}, sx);
|
|
194
|
-
const {
|
|
195
|
-
color
|
|
196
|
-
} = sx;
|
|
197
|
-
if (color) style['--button-color'] = color;
|
|
198
|
-
}
|
|
199
|
-
return /*#__PURE__*/jsx(Box, {
|
|
200
|
-
as: Button,
|
|
201
|
-
style: style,
|
|
202
|
-
sx: sxStyles,
|
|
203
|
-
ref: ref,
|
|
204
|
-
...rest
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
const ButtonComponent = /*#__PURE__*/forwardRef(({
|
|
208
|
-
as,
|
|
209
|
-
...props
|
|
210
|
-
}, ref) => /*#__PURE__*/jsx(StyledButtonComponent, {
|
|
211
|
-
ref: ref,
|
|
212
|
-
...props,
|
|
213
|
-
...(as ? {
|
|
214
|
-
forwardedAs: as
|
|
215
|
-
} : {})
|
|
216
|
-
}));
|
|
217
|
-
|
|
218
|
-
// This function is used to generate a custom cssSelector for the sxProp
|
|
219
|
-
|
|
220
|
-
// The usual sx prop can like this:
|
|
221
|
-
// sx={{
|
|
222
|
-
// [`@media (max-width: 768px)`]: {
|
|
223
|
-
// '& > ul': {
|
|
224
|
-
// backgroundColor: 'deeppink',
|
|
225
|
-
// },
|
|
226
|
-
// '&:hover': {
|
|
227
|
-
// backgroundColor: 'yellow',
|
|
228
|
-
// },
|
|
229
|
-
// },
|
|
230
|
-
// '&:hover': {
|
|
231
|
-
// backgroundColor: 'yellow',
|
|
232
|
-
// },
|
|
233
|
-
// '&': {
|
|
234
|
-
// width : 320px
|
|
235
|
-
// }
|
|
236
|
-
// }}
|
|
237
|
-
//*
|
|
238
|
-
/* What we want for Button styles is this:
|
|
239
|
-
sx={{
|
|
240
|
-
// [`@media (max-width: 768px)`]: {
|
|
241
|
-
// '&[data-attribute="something"] > ul': {
|
|
242
|
-
// backgroundColor: 'deeppink',
|
|
243
|
-
// },
|
|
244
|
-
// '&[data-attribute="something"]:hover': {
|
|
245
|
-
// backgroundColor: 'yellow',
|
|
246
|
-
// },
|
|
247
|
-
// },
|
|
248
|
-
// '&[data-attribute="something"]:hover': {
|
|
249
|
-
// backgroundColor: 'yellow',
|
|
250
|
-
// },
|
|
251
|
-
// '&[data-attribute="something"]': {
|
|
252
|
-
// width : 320px
|
|
253
|
-
// }
|
|
254
|
-
// }}
|
|
255
|
-
|
|
256
|
-
// We need to make sure we append the customCSSSelector to the original class selector. i.e & - > &[data-attribute="Icon"][data-size="small"]
|
|
257
|
-
*/
|
|
258
|
-
function generateCustomSxProp(props, providedSx) {
|
|
259
|
-
// Possible data attributes: data-size, data-block, data-no-visuals
|
|
260
|
-
const size = `[data-size="${props.size}"]`;
|
|
261
|
-
const block = props.block ? `[data-block="block"]` : '';
|
|
262
|
-
const noVisuals = props.leadingVisual || props.trailingVisual || props.trailingAction ? '' : '[data-no-visuals]';
|
|
263
|
-
|
|
264
|
-
// this is a custom selector. We need to make sure we add the data attributes to the base css class (& -> &[data-attributename="value"]])
|
|
265
|
-
const cssSelector = `&${size}${block}${noVisuals}`; // &[data-size="small"][data-block="block"][data-no-visuals]
|
|
266
|
-
|
|
267
|
-
const customSxProp = {};
|
|
268
|
-
if (!providedSx) return customSxProp;else {
|
|
269
|
-
customSxProp[cssSelector] = providedSx;
|
|
270
|
-
return customSxProp;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
ButtonComponent.displayName = 'Button';
|
|
274
|
-
|
|
275
173
|
const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
|
|
276
174
|
return /*#__PURE__*/jsx(Box, {
|
|
277
175
|
as: Checkbox$1,
|
|
@@ -388,38 +286,6 @@ const Heading = styled(Heading$1).withConfig({
|
|
|
388
286
|
componentId: "sc-1vc165i-0"
|
|
389
287
|
})(["", ""], sx);
|
|
390
288
|
|
|
391
|
-
const StyledIconButton = /*#__PURE__*/forwardRef(({
|
|
392
|
-
sx,
|
|
393
|
-
...rest
|
|
394
|
-
}, ref) => {
|
|
395
|
-
let sxStyles = sx;
|
|
396
|
-
// grap the button props that have associated data attributes in the styles
|
|
397
|
-
const {
|
|
398
|
-
size = 'medium'
|
|
399
|
-
} = rest;
|
|
400
|
-
if (sx !== null && sx !== undefined && Object.keys(sx).length > 0) {
|
|
401
|
-
sxStyles = generateCustomSxProp({
|
|
402
|
-
size
|
|
403
|
-
}, sx);
|
|
404
|
-
}
|
|
405
|
-
return /*#__PURE__*/jsx(Box, {
|
|
406
|
-
sx: sxStyles,
|
|
407
|
-
as: IconButton$1,
|
|
408
|
-
ref: ref,
|
|
409
|
-
...rest
|
|
410
|
-
});
|
|
411
|
-
});
|
|
412
|
-
const IconButton = /*#__PURE__*/forwardRef(({
|
|
413
|
-
as,
|
|
414
|
-
...props
|
|
415
|
-
}, ref) => /*#__PURE__*/jsx(StyledIconButton, {
|
|
416
|
-
...props,
|
|
417
|
-
...(as ? {
|
|
418
|
-
forwardedAs: as
|
|
419
|
-
} : {}),
|
|
420
|
-
ref: ref
|
|
421
|
-
}));
|
|
422
|
-
|
|
423
289
|
const StyledLabel = /*#__PURE__*/forwardRef(function Label(props, ref) {
|
|
424
290
|
return /*#__PURE__*/jsx(Box, {
|
|
425
291
|
as: Label$1,
|
|
@@ -674,38 +540,6 @@ const Text = /*#__PURE__*/forwardRef(({
|
|
|
674
540
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
675
541
|
});
|
|
676
542
|
|
|
677
|
-
const StyledTextInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
678
|
-
return /*#__PURE__*/jsx(Box, {
|
|
679
|
-
as: TextInput$1,
|
|
680
|
-
ref: ref,
|
|
681
|
-
...props
|
|
682
|
-
});
|
|
683
|
-
});
|
|
684
|
-
const TextInputImpl = /*#__PURE__*/forwardRef(({
|
|
685
|
-
as,
|
|
686
|
-
...props
|
|
687
|
-
}, ref) => {
|
|
688
|
-
return /*#__PURE__*/jsx(StyledTextInput, {
|
|
689
|
-
ref: ref,
|
|
690
|
-
...props,
|
|
691
|
-
...(as ? {
|
|
692
|
-
forwardedAs: as
|
|
693
|
-
} : {})
|
|
694
|
-
});
|
|
695
|
-
});
|
|
696
|
-
const TextInputAction = /*#__PURE__*/forwardRef((props, ref) => {
|
|
697
|
-
return /*#__PURE__*/jsx(Box, {
|
|
698
|
-
as: TextInput$1.Action,
|
|
699
|
-
ref: ref,
|
|
700
|
-
...props
|
|
701
|
-
});
|
|
702
|
-
});
|
|
703
|
-
const TextInput = Object.assign(TextInputImpl, {
|
|
704
|
-
Action: TextInputAction
|
|
705
|
-
});
|
|
706
|
-
TextInputAction.displayName = 'TextInputAction';
|
|
707
|
-
TextInputImpl.displayName = 'TextInput';
|
|
708
|
-
|
|
709
543
|
const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
|
|
710
544
|
return /*#__PURE__*/jsx(Box, {
|
|
711
545
|
as: Timeline$1,
|
|
@@ -829,4 +663,4 @@ const UnderlineNav = Object.assign(UnderlineNavImpl, {
|
|
|
829
663
|
Item: UnderlineNavItem
|
|
830
664
|
});
|
|
831
665
|
|
|
832
|
-
export { ActionList, ActionMenu, Autocomplete, Avatar, Breadcrumb, Breadcrumbs,
|
|
666
|
+
export { ActionList, ActionMenu, Autocomplete, Avatar, Breadcrumb, Breadcrumbs, Checkbox, CheckboxGroup, CircleBadge, CounterLabel, Flash, Header, Heading, Label, Link, LinkButton, NavList, Overlay, PageLayout, RadioGroup, RelativeTime, SegmentedControl, Spinner, StateLabel, SubNav, Text, 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-20251007211642",
|
|
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-20251007211642",
|
|
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-20251007211642",
|
|
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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type TextInputProps as PrimerTextInputProps, type TextInputActionProps as PrimerTextInputActionProps } from '@primer/react';
|
|
2
|
-
import type { SxProp } from '../sx';
|
|
3
|
-
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
-
export type TextInputProps = PrimerTextInputProps & SxProp & {
|
|
5
|
-
as?: React.ElementType;
|
|
6
|
-
};
|
|
7
|
-
export type TextInputActionProps = PrimerTextInputActionProps & SxProp;
|
|
8
|
-
declare const TextInputAction: ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "size" | "aria-label" | "tooltipDirection"> & {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
"aria-label"?: string;
|
|
11
|
-
tooltipDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
|
|
12
|
-
icon?: React.FunctionComponent<React.PropsWithChildren<import("@primer/octicons-react").IconProps>>;
|
|
13
|
-
variant?: import("@primer/react").ButtonProps["variant"];
|
|
14
|
-
} & SxProp & RefAttributes<HTMLButtonElement>>;
|
|
15
|
-
type TextInputComposite = ForwardRefExoticComponent<TextInputProps & RefAttributes<HTMLInputElement>> & {
|
|
16
|
-
Action: typeof TextInputAction;
|
|
17
|
-
};
|
|
18
|
-
export declare const TextInput: TextInputComposite;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,IAAI,oBAAoB,EAC3C,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAC,yBAAyB,EAAE,aAAa,EAAC,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,MAAM,GAAG;IAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;CAAC,CAAA;AACrF,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG,MAAM,CAAA;AAUtE,QAAA,MAAM,eAAe;;;;;;8CAEnB,CAAA;AAEF,KAAK,kBAAkB,GAAG,yBAAyB,CAAC,cAAc,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC,GAAG;IACtG,MAAM,EAAE,OAAO,eAAe,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,kBAEtB,CAAA"}
|