@primer/styled-react 0.0.0-20251007221310 → 0.0.0-20251007221437

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.
Files changed (89) hide show
  1. package/dist/{Tooltip-DIHgr01r.js → PageHeader-BYlYLcfB.js} +11 -77
  2. package/dist/components/Header.d.ts.map +1 -1
  3. package/dist/components/PageHeader.d.ts +14 -18
  4. package/dist/components/PageHeader.d.ts.map +1 -1
  5. package/dist/components.json +1 -59
  6. package/dist/deprecated.d.ts +1 -5
  7. package/dist/deprecated.d.ts.map +1 -1
  8. package/dist/deprecated.js +1 -179
  9. package/dist/experimental.d.ts +1 -4
  10. package/dist/experimental.d.ts.map +1 -1
  11. package/dist/experimental.js +5 -55
  12. package/dist/index.d.ts +81 -50
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +37 -480
  15. package/package.json +3 -3
  16. package/dist/components/ActionList.d.ts +0 -36
  17. package/dist/components/ActionList.d.ts.map +0 -1
  18. package/dist/components/ActionMenu.d.ts +0 -12
  19. package/dist/components/ActionMenu.d.ts.map +0 -1
  20. package/dist/components/Autocomplete.d.ts +0 -15
  21. package/dist/components/Autocomplete.d.ts.map +0 -1
  22. package/dist/components/Avatar.d.ts +0 -13
  23. package/dist/components/Avatar.d.ts.map +0 -1
  24. package/dist/components/Breadcrumbs.d.ts +0 -18
  25. package/dist/components/Breadcrumbs.d.ts.map +0 -1
  26. package/dist/components/Checkbox.d.ts +0 -5
  27. package/dist/components/Checkbox.d.ts.map +0 -1
  28. package/dist/components/CheckboxGroup.d.ts +0 -22
  29. package/dist/components/CheckboxGroup.d.ts.map +0 -1
  30. package/dist/components/CircleBadge.d.ts +0 -7
  31. package/dist/components/CircleBadge.d.ts.map +0 -1
  32. package/dist/components/CounterLabel.d.ts +0 -10
  33. package/dist/components/CounterLabel.d.ts.map +0 -1
  34. package/dist/components/DataTable.d.ts +0 -11
  35. package/dist/components/DataTable.d.ts.map +0 -1
  36. package/dist/components/Dialog.d.ts +0 -19
  37. package/dist/components/Dialog.d.ts.map +0 -1
  38. package/dist/components/Heading.d.ts +0 -8
  39. package/dist/components/Heading.d.ts.map +0 -1
  40. package/dist/components/Label.d.ts +0 -9
  41. package/dist/components/Label.d.ts.map +0 -1
  42. package/dist/components/Link.d.ts +0 -7
  43. package/dist/components/Link.d.ts.map +0 -1
  44. package/dist/components/NavList.d.ts +0 -33
  45. package/dist/components/NavList.d.ts.map +0 -1
  46. package/dist/components/Overlay.d.ts +0 -7
  47. package/dist/components/Overlay.d.ts.map +0 -1
  48. package/dist/components/PageLayout.d.ts +0 -18
  49. package/dist/components/PageLayout.d.ts.map +0 -1
  50. package/dist/components/RadioGroup.d.ts +0 -22
  51. package/dist/components/RadioGroup.d.ts.map +0 -1
  52. package/dist/components/RelativeTime.d.ts +0 -6
  53. package/dist/components/RelativeTime.d.ts.map +0 -1
  54. package/dist/components/SegmentedControl.d.ts +0 -12
  55. package/dist/components/SegmentedControl.d.ts.map +0 -1
  56. package/dist/components/Spinner.d.ts +0 -6
  57. package/dist/components/Spinner.d.ts.map +0 -1
  58. package/dist/components/StateLabel.d.ts +0 -9
  59. package/dist/components/StateLabel.d.ts.map +0 -1
  60. package/dist/components/SubNav.d.ts +0 -9
  61. package/dist/components/SubNav.d.ts.map +0 -1
  62. package/dist/components/Text.d.ts +0 -7
  63. package/dist/components/Text.d.ts.map +0 -1
  64. package/dist/components/Timeline.d.ts +0 -26
  65. package/dist/components/Timeline.d.ts.map +0 -1
  66. package/dist/components/ToggleSwitch.d.ts +0 -6
  67. package/dist/components/ToggleSwitch.d.ts.map +0 -1
  68. package/dist/components/Token.d.ts +0 -7
  69. package/dist/components/Token.d.ts.map +0 -1
  70. package/dist/components/Tooltip.d.ts +0 -6
  71. package/dist/components/Tooltip.d.ts.map +0 -1
  72. package/dist/components/Truncate.d.ts +0 -7
  73. package/dist/components/Truncate.d.ts.map +0 -1
  74. package/dist/components/UnderlineNav.d.ts +0 -11
  75. package/dist/components/UnderlineNav.d.ts.map +0 -1
  76. package/dist/components/UnderlinePanels.d.ts +0 -12
  77. package/dist/components/UnderlinePanels.d.ts.map +0 -1
  78. package/dist/components/deprecated/ActionList.d.ts +0 -23
  79. package/dist/components/deprecated/ActionList.d.ts.map +0 -1
  80. package/dist/components/deprecated/DialogV1.d.ts +0 -11
  81. package/dist/components/deprecated/DialogV1.d.ts.map +0 -1
  82. package/dist/components/deprecated/Octicon.d.ts +0 -17
  83. package/dist/components/deprecated/Octicon.d.ts.map +0 -1
  84. package/dist/components/deprecated/TabNav.d.ts +0 -9
  85. package/dist/components/deprecated/TabNav.d.ts.map +0 -1
  86. package/dist/components/deprecated/Tooltip.d.ts +0 -13
  87. package/dist/components/deprecated/Tooltip.d.ts.map +0 -1
  88. package/dist/styled-props.d.ts +0 -5
  89. package/dist/styled-props.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,255 +1,24 @@
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
- import React, { forwardRef } from 'react';
1
+ import { LinkButton as LinkButton$1, sx, Box, Header as Header$1, Flash as Flash$1, Truncate as Truncate$1, UnderlineNav as UnderlineNav$1, RadioGroup as RadioGroup$1, SegmentedControl as SegmentedControl$1, SubNav as SubNav$1, Timeline as Timeline$1, Checkbox as Checkbox$1, CounterLabel as CounterLabel$1, RelativeTime as RelativeTime$1, Spinner as Spinner$1, StateLabel as StateLabel$1, ToggleSwitch as ToggleSwitch$1 } from '@primer/react';
2
+ export { ActionList, ActionMenu, Autocomplete, Avatar, Box, Breadcrumbs, Button, CheckboxGroup, CircleBadge, Details, Dialog, FormControl, Heading, IconButton, Label, Link, NavList, Overlay, PageLayout, Select, Text, TextInput, Textarea, ThemeProvider, Token, Tooltip, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
3
+ import { forwardRef } from 'react';
4
4
  import styled from 'styled-components';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- export { D as Dialog, P as PageHeader, T as Tooltip } from './Tooltip-DIHgr01r.js';
7
- import css from '@styled-system/css';
6
+ export { P as PageHeader } from './PageHeader-BYlYLcfB.js';
8
7
 
9
- const StyledActionList = styled(ActionList$1).withConfig({
10
- shouldForwardProp: prop => prop !== 'sx'
11
- }).withConfig({
12
- displayName: "ActionList__StyledActionList",
13
- componentId: "sc-hw2362-0"
14
- })(["", ""], sx);
15
- const ActionListImpl = /*#__PURE__*/React.forwardRef(function ActionListImpl({
16
- as,
17
- ...rest
18
- }, ref) {
19
- return /*#__PURE__*/jsx(StyledActionList, {
20
- ref: ref,
21
- ...rest,
22
- ...(as ? {
23
- forwardedAs: as
24
- } : {})
25
- });
26
- });
27
- const ActionListLinkItem = styled(ActionList$1.LinkItem).withConfig({
28
- shouldForwardProp: prop => prop !== 'sx'
29
- }).withConfig({
30
- displayName: "ActionList__ActionListLinkItem",
31
- componentId: "sc-hw2362-1"
32
- })(["", ""], sx);
33
- const StyledActionListTrailingAction = styled(ActionList$1.TrailingAction).withConfig({
34
- shouldForwardProp: prop => prop !== 'sx'
35
- }).withConfig({
36
- displayName: "ActionList__StyledActionListTrailingAction",
37
- componentId: "sc-hw2362-2"
38
- })(["", ""], sx);
39
- const ActionListTrailingAction = /*#__PURE__*/React.forwardRef((props, ref) => {
40
- const {
41
- as,
42
- ...rest
43
- } = props;
44
- return /*#__PURE__*/jsx(StyledActionListTrailingAction, {
45
- ...rest,
46
- ...(as ? {
47
- forwardedAs: as
48
- } : {}),
49
- ref: ref
50
- });
51
- });
52
- const StyledActionListItem = styled(ActionList$1.Item).withConfig({
53
- shouldForwardProp: prop => prop !== 'sx'
54
- }).withConfig({
55
- displayName: "ActionList__StyledActionListItem",
56
- componentId: "sc-hw2362-3"
57
- })(["", ""], sx);
58
- const ActionListItem = /*#__PURE__*/React.forwardRef(({
59
- children,
60
- as,
61
- ...props
62
- }, ref) => /*#__PURE__*/jsx(StyledActionListItem, {
63
- ref: ref,
64
- ...props,
65
- ...(as ? {
66
- forwardedAs: as
67
- } : {}),
68
- children: children
69
- }));
70
- const ActionListGroup = styled(ActionList$1.Group).withConfig({
71
- shouldForwardProp: prop => prop !== 'sx'
72
- }).withConfig({
73
- displayName: "ActionList__ActionListGroup",
74
- componentId: "sc-hw2362-4"
75
- })(["", ""], sx);
76
- const ActionListDivider = styled(ActionList$1.Divider).withConfig({
77
- shouldForwardProp: prop => prop !== 'sx'
78
- }).withConfig({
79
- displayName: "ActionList__ActionListDivider",
80
- componentId: "sc-hw2362-5"
81
- })(["", ""], sx);
82
- const ActionListLeadingVisual = styled(ActionList$1.LeadingVisual).withConfig({
83
- shouldForwardProp: prop => prop !== 'sx'
84
- }).withConfig({
85
- displayName: "ActionList__ActionListLeadingVisual",
86
- componentId: "sc-hw2362-6"
87
- })(["", ""], sx);
88
- const ActionListTrailingVisual = styled(ActionList$1.TrailingVisual).withConfig({
89
- shouldForwardProp: prop => prop !== 'sx'
90
- }).withConfig({
91
- displayName: "ActionList__ActionListTrailingVisual",
92
- componentId: "sc-hw2362-7"
93
- })(["", ""], sx);
94
- const ActionList = Object.assign(ActionListImpl, {
95
- Item: ActionListItem,
96
- LinkItem: ActionListLinkItem,
97
- Group: ActionListGroup,
98
- GroupHeading: ActionList$1.GroupHeading,
99
- Divider: ActionListDivider,
100
- Description: ActionList$1.Description,
101
- LeadingVisual: ActionListLeadingVisual,
102
- TrailingVisual: ActionListTrailingVisual,
103
- Heading: ActionList$1.Heading,
104
- TrailingAction: ActionListTrailingAction
105
- });
106
-
107
- const ActionMenuOverlay = styled(ActionMenu$1.Overlay).withConfig({
108
- shouldForwardProp: prop => prop !== 'sx'
109
- }).withConfig({
110
- displayName: "ActionMenu__ActionMenuOverlay",
111
- componentId: "sc-w5s60e-0"
112
- })(["", ""], sx);
113
- const ActionMenu = Object.assign(ActionMenu$1, {
114
- Button: ActionMenu$1.Button,
115
- Anchor: ActionMenu$1.Anchor,
116
- Overlay: ActionMenuOverlay,
117
- Divider: ActionMenu$1.Divider
118
- });
119
-
120
- const AutocompleteOverlay = styled(Autocomplete$1.Overlay).withConfig({
121
- shouldForwardProp: prop => prop !== 'sx'
122
- }).withConfig({
123
- displayName: "Autocomplete__AutocompleteOverlay",
124
- componentId: "sc-j8ax2e-0"
125
- })(["", ""], sx);
126
- const Autocomplete = Object.assign(Autocomplete$1, {
127
- Context: Autocomplete$1.Context,
128
- Input: Autocomplete$1.Input,
129
- Menu: Autocomplete$1.Menu,
130
- Overlay: AutocompleteOverlay
131
- });
132
-
133
- const Avatar = /*#__PURE__*/forwardRef(function Avatar(props, ref) {
134
- return /*#__PURE__*/jsx(Box, {
135
- as: Avatar$1,
136
- ref: ref,
137
- ...props
138
- });
139
- });
140
-
141
- const BreadcrumbsImpl = styled(Breadcrumbs$1).withConfig({
142
- shouldForwardProp: prop => prop !== 'sx'
143
- }).withConfig({
144
- displayName: "Breadcrumbs__BreadcrumbsImpl",
145
- componentId: "sc-1qj8pw-0"
146
- })(["", ""], sx);
147
- const StyledBreadcrumbsItem = styled(Breadcrumbs$1.Item).withConfig({
148
- shouldForwardProp: prop => prop !== 'sx'
149
- }).withConfig({
150
- displayName: "Breadcrumbs__StyledBreadcrumbsItem",
151
- componentId: "sc-1qj8pw-1"
152
- })(["", ""], sx);
153
- function BreadcrumbsItem({
154
- as,
155
- ...props
156
- }) {
157
- return /*#__PURE__*/jsx(StyledBreadcrumbsItem, {
158
- ...props,
159
- ...(as ? {
160
- forwardedAs: as
161
- } : {})
162
- });
163
- }
164
- const Breadcrumbs = Object.assign(BreadcrumbsImpl, {
165
- Item: BreadcrumbsItem
166
- });
167
-
168
- /**
169
- * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
170
- */
171
- const Breadcrumb = Breadcrumbs;
172
-
173
- const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
174
- return /*#__PURE__*/jsx(Box, {
175
- as: Checkbox$1,
176
- ref: ref,
177
- ...props
178
- });
179
- });
180
-
181
- const CheckboxGroupImpl = props => {
182
- return /*#__PURE__*/jsx(Box, {
183
- as: CheckboxGroup$1,
184
- ...props
185
- });
186
- };
187
-
188
- // Define local types based on the internal component props
189
-
190
- const CheckboxOrRadioGroupLabel$1 = props => {
191
- return /*#__PURE__*/jsx(Box, {
192
- as: CheckboxGroup$1.Label,
193
- ...props
194
- });
195
- };
196
- const CheckboxOrRadioGroupCaption$1 = props => {
197
- return /*#__PURE__*/jsx(Box, {
198
- as: CheckboxGroup$1.Caption,
199
- ...props
200
- });
201
- };
202
- const CheckboxOrRadioGroupValidation$1 = props => {
203
- return /*#__PURE__*/jsx(Box, {
204
- as: CheckboxGroup$1.Validation,
205
- ...props
206
- });
207
- };
208
- const CheckboxGroup = Object.assign(CheckboxGroupImpl, {
209
- Label: CheckboxOrRadioGroupLabel$1,
210
- Caption: CheckboxOrRadioGroupCaption$1,
211
- Validation: CheckboxOrRadioGroupValidation$1
212
- });
213
-
214
- const CircleBadge = styled(CircleBadge$1).withConfig({
215
- shouldForwardProp: prop => prop !== 'sx'
216
- }).withConfig({
217
- displayName: "CircleBadge",
218
- componentId: "sc-1u7lp3v-0"
219
- })(["", ""], sx);
220
-
221
- const CounterLabel = /*#__PURE__*/forwardRef(function CounterLabel(props, ref) {
222
- return /*#__PURE__*/jsx(Box, {
223
- as: CounterLabel$1,
224
- ref: ref,
225
- ...props
226
- });
227
- });
228
-
229
- const Flash = styled(Flash$1).withConfig({
8
+ const LinkButton = styled(LinkButton$1).withConfig({
230
9
  shouldForwardProp: prop => prop !== 'sx'
231
10
  }).withConfig({
232
- displayName: "Flash",
233
- componentId: "sc-413izo-0"
11
+ displayName: "LinkButton",
12
+ componentId: "sc-1v6zkmg-0"
234
13
  })(["", ""], sx);
235
14
 
236
- const StyledHeader = /*#__PURE__*/forwardRef(function Header(props, ref) {
15
+ const HeaderImpl = /*#__PURE__*/forwardRef(function Header(props, ref) {
237
16
  return /*#__PURE__*/jsx(Box, {
238
17
  as: Header$1,
239
18
  ref: ref,
240
19
  ...props
241
20
  });
242
21
  });
243
- const HeaderImpl = /*#__PURE__*/forwardRef(({
244
- as,
245
- ...props
246
- }, ref) => /*#__PURE__*/jsx(StyledHeader, {
247
- ...props,
248
- ...(as ? {
249
- forwardedAs: as
250
- } : {}),
251
- ref: ref
252
- }));
253
22
  const HeaderItem = /*#__PURE__*/forwardRef(function HeaderItem(props, ref) {
254
23
  return /*#__PURE__*/jsx(Box, {
255
24
  as: Header$1.Item,
@@ -257,172 +26,38 @@ const HeaderItem = /*#__PURE__*/forwardRef(function HeaderItem(props, ref) {
257
26
  ...props
258
27
  });
259
28
  });
260
- const StyledHeaderLink = /*#__PURE__*/forwardRef(function HeaderLink(props, ref) {
29
+ const HeaderLink = /*#__PURE__*/forwardRef(function HeaderLink(props, ref) {
261
30
  return /*#__PURE__*/jsx(Box, {
262
31
  as: Header$1.Link,
263
32
  ref: ref,
264
33
  ...props
265
34
  });
266
35
  });
267
- const HeaderLink = /*#__PURE__*/forwardRef(({
268
- as,
269
- ...props
270
- }, ref) => /*#__PURE__*/jsx(StyledHeaderLink, {
271
- ...props,
272
- ...(as ? {
273
- forwardedAs: as
274
- } : {}),
275
- ref: ref
276
- }));
277
36
  const Header = Object.assign(HeaderImpl, {
278
37
  Item: HeaderItem,
279
38
  Link: HeaderLink
280
39
  });
281
40
 
282
- const Heading = styled(Heading$1).withConfig({
283
- shouldForwardProp: prop => prop !== 'sx'
284
- }).withConfig({
285
- displayName: "Heading",
286
- componentId: "sc-1vc165i-0"
287
- })(["", ""], sx);
288
-
289
- const StyledLabel = /*#__PURE__*/forwardRef(function Label(props, ref) {
290
- return /*#__PURE__*/jsx(Box, {
291
- as: Label$1,
292
- ref: ref,
293
- ...props
294
- });
295
- });
296
- const Label = /*#__PURE__*/forwardRef(({
297
- as,
298
- ...props
299
- }, ref) => {
300
- return /*#__PURE__*/jsx(StyledLabel, {
301
- ...props,
302
- ...(as ? {
303
- forwardedAs: as
304
- } : {}),
305
- ref: ref
306
- });
307
- });
308
-
309
- const StyledLink = styled(Link$1).withConfig({
310
- shouldForwardProp: prop => prop !== 'sx'
311
- }).withConfig({
312
- displayName: "Link__StyledLink",
313
- componentId: "sc-1syctfj-0"
314
- })(["", ""], sx);
315
- const Link = /*#__PURE__*/forwardRef(({
316
- as,
317
- ...props
318
- }, ref) => {
319
- return /*#__PURE__*/jsx(StyledLink, {
320
- ...props,
321
- ...(as ? {
322
- forwardedAs: as
323
- } : {}),
324
- ref: ref
325
- });
326
- });
327
-
328
- const LinkButton = styled(LinkButton$1).withConfig({
41
+ const Flash = styled(Flash$1).withConfig({
329
42
  shouldForwardProp: prop => prop !== 'sx'
330
43
  }).withConfig({
331
- displayName: "LinkButton",
332
- componentId: "sc-1v6zkmg-0"
44
+ displayName: "Flash",
45
+ componentId: "sc-413izo-0"
333
46
  })(["", ""], sx);
334
47
 
335
- const NavListImpl = /*#__PURE__*/forwardRef(function NavList(props, ref) {
336
- return /*#__PURE__*/jsx(Box, {
337
- as: NavList$1,
338
- ref: ref,
339
- ...props
340
- });
341
- });
342
- const NavListItem = /*#__PURE__*/forwardRef(function NavListItem(props, ref) {
343
- // @ts-expect-error - PrimerNavList.Item is not recognized as a valid component type
344
- return /*#__PURE__*/jsx(Box, {
345
- as: NavList$1.Item,
346
- ref: ref,
347
- ...props
348
- });
349
- });
350
- const NavListGroup = /*#__PURE__*/forwardRef(function NavListGroup(props, ref) {
351
- // @ts-expect-error - PrimerNavList.Group is not recognized as a valid component type
352
- return /*#__PURE__*/jsx(Box, {
353
- as: NavList$1.Group,
354
- ref: ref,
355
- ...props
356
- });
357
- });
358
- const NavListGroupHeading = /*#__PURE__*/forwardRef(function NavListGroupHeading(props, ref) {
359
- // @ts-expect-error - PrimerNavList.GroupHeading is not recognized as a valid component type
48
+ function Spinner(props) {
360
49
  return /*#__PURE__*/jsx(Box, {
361
- as: NavList$1.GroupHeading,
362
- ref: ref,
50
+ as: Spinner$1,
363
51
  ...props
364
52
  });
365
- });
366
- const NavListLeadingVisual = /*#__PURE__*/forwardRef(function NavListLeadingVisual(props, ref) {
367
- // @ts-expect-error - PrimerNavList.LeadingVisual is not recognized as a valid component type
53
+ }
54
+ function RelativeTime(props) {
55
+ // @ts-expect-error the types for Box are not correctly inferred here
368
56
  return /*#__PURE__*/jsx(Box, {
369
- as: NavList$1.LeadingVisual,
370
- ref: ref,
371
- ...props
372
- });
373
- });
374
- const NavList = Object.assign(NavListImpl, {
375
- Item: NavListItem,
376
- Group: NavListGroup,
377
- GroupHeading: NavListGroupHeading,
378
- LeadingVisual: NavListLeadingVisual,
379
- SubNav: NavList$1.SubNav,
380
- Divider: NavList$1.Divider,
381
- TrailingVisual: NavList$1.TrailingVisual,
382
- TrailingAction: NavList$1.TrailingAction,
383
- GroupExpand: NavList$1.GroupExpand
384
- });
385
-
386
- const Overlay = styled(Overlay$1).withConfig({
387
- shouldForwardProp: prop => prop !== 'sx'
388
- }).withConfig({
389
- displayName: "Overlay",
390
- componentId: "sc-tjbd74-0"
391
- })(["", ""], sx);
392
-
393
- const Wrapper = styled.div.withConfig({
394
- displayName: "PageLayout__Wrapper",
395
- componentId: "sc-pjybtc-0"
396
- })(["", ""], sx);
397
- const PageLayoutImpl = /*#__PURE__*/React.forwardRef((props, ref) => {
398
- // @ts-expect-error - PrimerPageLayout is not recognized as a valid component type
399
- return /*#__PURE__*/jsx(Wrapper, {
400
- as: PageLayout$1,
401
- ref: ref,
402
- ...props
403
- });
404
- });
405
- const PageLayoutContent = /*#__PURE__*/React.forwardRef((props, ref) => {
406
- return /*#__PURE__*/jsx(Wrapper, {
407
- as: PageLayout$1.Content,
408
- ref: ref,
409
- ...props
410
- });
411
- });
412
- const PageLayoutPane = /*#__PURE__*/React.forwardRef((props, ref) => {
413
- return /*#__PURE__*/jsx(Wrapper, {
414
- as: PageLayout$1.Pane,
415
- ref: ref,
57
+ as: RelativeTime$1,
416
58
  ...props
417
59
  });
418
- });
419
- const PageLayout = Object.assign(PageLayoutImpl, {
420
- Content: PageLayoutContent,
421
- Header: PageLayout$1.Header,
422
- Pane: PageLayoutPane,
423
- Footer: PageLayout$1.Footer
424
- });
425
-
60
+ }
426
61
  const RadioGroupImpl = props => {
427
62
  return /*#__PURE__*/jsx(Box, {
428
63
  as: RadioGroup$1,
@@ -455,15 +90,6 @@ const RadioGroup = Object.assign(RadioGroupImpl, {
455
90
  Caption: CheckboxOrRadioGroupCaption,
456
91
  Validation: CheckboxOrRadioGroupValidation
457
92
  });
458
-
459
- function RelativeTime(props) {
460
- // @ts-expect-error the types for Box are not correctly inferred here
461
- return /*#__PURE__*/jsx(Box, {
462
- as: RelativeTime$1,
463
- ...props
464
- });
465
- }
466
-
467
93
  const SegmentedControlButton = props => {
468
94
  return /*#__PURE__*/jsx(Box, {
469
95
  as: SegmentedControl$1.Button,
@@ -486,14 +112,20 @@ const SegmentedControl = Object.assign(SegmentedControlImpl, {
486
112
  Button: SegmentedControlButton,
487
113
  IconButton: SegmentedControlIconButton
488
114
  });
489
-
490
- function Spinner(props) {
115
+ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
491
116
  return /*#__PURE__*/jsx(Box, {
492
- as: Spinner$1,
117
+ as: Checkbox$1,
118
+ ref: ref,
493
119
  ...props
494
120
  });
495
- }
496
-
121
+ });
122
+ const CounterLabel = /*#__PURE__*/forwardRef(function CounterLabel(props, ref) {
123
+ return /*#__PURE__*/jsx(Box, {
124
+ as: CounterLabel$1,
125
+ ref: ref,
126
+ ...props
127
+ });
128
+ });
497
129
  const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
498
130
  return /*#__PURE__*/jsx(Box, {
499
131
  as: StateLabel$1,
@@ -501,7 +133,6 @@ const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
501
133
  ...props
502
134
  });
503
135
  });
504
-
505
136
  const SubNavImpl = /*#__PURE__*/forwardRef(function SubNav(props, ref) {
506
137
  return /*#__PURE__*/jsx(Box, {
507
138
  as: SubNav$1,
@@ -519,27 +150,6 @@ const SubNavLink = /*#__PURE__*/forwardRef(function SubNavLink(props, ref) {
519
150
  const SubNav = Object.assign(SubNavImpl, {
520
151
  Link: SubNavLink
521
152
  });
522
-
523
- const StyledText = styled(Text$1).withConfig({
524
- shouldForwardProp: prop => prop !== 'sx'
525
- }).withConfig({
526
- displayName: "Text__StyledText",
527
- componentId: "sc-1klmep6-0"
528
- })(["", ""], sx);
529
- const Text = /*#__PURE__*/forwardRef(({
530
- as,
531
- ...props
532
- }, ref) => {
533
- return /*#__PURE__*/jsx(StyledText, {
534
- ...props,
535
- ...(as ? {
536
- forwardedAs: as
537
- } : {}),
538
- ref: ref
539
- });
540
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
541
- });
542
-
543
153
  const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
544
154
  return /*#__PURE__*/jsx(Box, {
545
155
  as: Timeline$1,
@@ -580,7 +190,6 @@ const Timeline = Object.assign(TimelineImpl, {
580
190
  Body: TimelineBody,
581
191
  Break: TimelineBreak
582
192
  });
583
-
584
193
  const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
585
194
  return /*#__PURE__*/jsx(Box, {
586
195
  as: ToggleSwitch$1,
@@ -588,79 +197,27 @@ const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
588
197
  ...props
589
198
  });
590
199
  });
591
-
592
- const Token = /*#__PURE__*/React.forwardRef(({
593
- sx: sxProp,
594
- style,
595
- ...rest
596
- }, ref) => {
597
- const contextTheme = useTheme();
598
- const theme$1 = contextTheme.theme || theme;
599
-
600
- // If no sx prop is provided, just return PrimerToken directly
601
- if (!sxProp) {
602
- return /*#__PURE__*/jsx(Token$1, {
603
- ...rest,
604
- style: style,
605
- ref: ref
606
- });
607
- }
608
-
609
- // Convert sx to CSS styles using the theme context
610
- const sxStyles = css(sxProp)(theme$1);
611
- const mergedStyle = {
612
- ...sxStyles,
613
- ...style
614
- };
615
- return /*#__PURE__*/jsx(Token$1, {
616
- ...rest,
617
- style: mergedStyle,
618
- ref: ref
619
- });
620
- });
621
-
622
200
  const Truncate = styled(Truncate$1).withConfig({
623
201
  shouldForwardProp: prop => prop !== 'sx'
624
202
  }).withConfig({
625
- displayName: "Truncate",
626
- componentId: "sc-x3i4it-0"
203
+ displayName: "src__Truncate",
204
+ componentId: "sc-1hfjsa7-0"
627
205
  })(["", ""], sx);
628
-
629
- const StyledUnderlineNav = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
206
+ const UnderlineNavImpl = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
630
207
  return /*#__PURE__*/jsx(Box, {
631
208
  as: UnderlineNav$1,
632
209
  ref: ref,
633
210
  ...props
634
211
  });
635
212
  });
636
- const UnderlineNavImpl = /*#__PURE__*/forwardRef(({
637
- as,
638
- ...props
639
- }, ref) => /*#__PURE__*/jsx(StyledUnderlineNav, {
640
- ...props,
641
- ...(as ? {
642
- forwardedAs: as
643
- } : {}),
644
- ref: ref
645
- }));
646
- const StyledUnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
213
+ const UnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
647
214
  shouldForwardProp: prop => prop !== 'sx'
648
215
  }).withConfig({
649
- displayName: "UnderlineNav__StyledUnderlineNavItem",
650
- componentId: "sc-dx6br2-0"
216
+ displayName: "src__UnderlineNavItem",
217
+ componentId: "sc-1hfjsa7-1"
651
218
  })(["", ""], sx);
652
- const UnderlineNavItem = /*#__PURE__*/forwardRef(({
653
- as,
654
- ...props
655
- }, ref) => /*#__PURE__*/jsx(StyledUnderlineNavItem, {
656
- ...props,
657
- ...(as ? {
658
- forwardedAs: as
659
- } : {}),
660
- ref: ref
661
- }));
662
219
  const UnderlineNav = Object.assign(UnderlineNavImpl, {
663
220
  Item: UnderlineNavItem
664
221
  });
665
222
 
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 };
223
+ export { Checkbox, CounterLabel, Flash, Header, LinkButton, RadioGroup, RelativeTime, SegmentedControl, Spinner, StateLabel, SubNav, Timeline, ToggleSwitch, Truncate, UnderlineNav };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/styled-react",
3
- "version": "0.0.0-20251007221310",
3
+ "version": "0.0.0-20251007221437",
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-20251007221310",
33
+ "@primer/react": "0.0.0-20251007221437",
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-20251007221310",
49
+ "@primer/react": "0.0.0-20251007221437",
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,36 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../src/components/ActionList.tsx"],"names":[],"mappings":"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"}