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

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 (97) hide show
  1. package/dist/{PageHeader-BYlYLcfB.js → Tooltip-DIHgr01r.js} +77 -11
  2. package/dist/components/ActionList.d.ts +36 -0
  3. package/dist/components/ActionList.d.ts.map +1 -0
  4. package/dist/components/ActionMenu.d.ts +12 -0
  5. package/dist/components/ActionMenu.d.ts.map +1 -0
  6. package/dist/components/Autocomplete.d.ts +15 -0
  7. package/dist/components/Autocomplete.d.ts.map +1 -0
  8. package/dist/components/Avatar.d.ts +13 -0
  9. package/dist/components/Avatar.d.ts.map +1 -0
  10. package/dist/components/Breadcrumbs.d.ts +18 -0
  11. package/dist/components/Breadcrumbs.d.ts.map +1 -0
  12. package/dist/components/Button.d.ts +13 -0
  13. package/dist/components/Button.d.ts.map +1 -0
  14. package/dist/components/Checkbox.d.ts +5 -0
  15. package/dist/components/Checkbox.d.ts.map +1 -0
  16. package/dist/components/CheckboxGroup.d.ts +22 -0
  17. package/dist/components/CheckboxGroup.d.ts.map +1 -0
  18. package/dist/components/CircleBadge.d.ts +7 -0
  19. package/dist/components/CircleBadge.d.ts.map +1 -0
  20. package/dist/components/CounterLabel.d.ts +10 -0
  21. package/dist/components/CounterLabel.d.ts.map +1 -0
  22. package/dist/components/DataTable.d.ts +11 -0
  23. package/dist/components/DataTable.d.ts.map +1 -0
  24. package/dist/components/Dialog.d.ts +19 -0
  25. package/dist/components/Dialog.d.ts.map +1 -0
  26. package/dist/components/Header.d.ts.map +1 -1
  27. package/dist/components/Heading.d.ts +8 -0
  28. package/dist/components/Heading.d.ts.map +1 -0
  29. package/dist/components/IconButton.d.ts +9 -0
  30. package/dist/components/IconButton.d.ts.map +1 -0
  31. package/dist/components/Label.d.ts +9 -0
  32. package/dist/components/Label.d.ts.map +1 -0
  33. package/dist/components/Link.d.ts +7 -0
  34. package/dist/components/Link.d.ts.map +1 -0
  35. package/dist/components/NavList.d.ts +33 -0
  36. package/dist/components/NavList.d.ts.map +1 -0
  37. package/dist/components/Overlay.d.ts +7 -0
  38. package/dist/components/Overlay.d.ts.map +1 -0
  39. package/dist/components/PageHeader.d.ts +18 -14
  40. package/dist/components/PageHeader.d.ts.map +1 -1
  41. package/dist/components/PageLayout.d.ts +18 -0
  42. package/dist/components/PageLayout.d.ts.map +1 -0
  43. package/dist/components/RadioGroup.d.ts +22 -0
  44. package/dist/components/RadioGroup.d.ts.map +1 -0
  45. package/dist/components/RelativeTime.d.ts +6 -0
  46. package/dist/components/RelativeTime.d.ts.map +1 -0
  47. package/dist/components/SegmentedControl.d.ts +12 -0
  48. package/dist/components/SegmentedControl.d.ts.map +1 -0
  49. package/dist/components/Spinner.d.ts +6 -0
  50. package/dist/components/Spinner.d.ts.map +1 -0
  51. package/dist/components/StateLabel.d.ts +9 -0
  52. package/dist/components/StateLabel.d.ts.map +1 -0
  53. package/dist/components/SubNav.d.ts +9 -0
  54. package/dist/components/SubNav.d.ts.map +1 -0
  55. package/dist/components/Text.d.ts +7 -0
  56. package/dist/components/Text.d.ts.map +1 -0
  57. package/dist/components/TextInput.d.ts +20 -0
  58. package/dist/components/TextInput.d.ts.map +1 -0
  59. package/dist/components/Timeline.d.ts +26 -0
  60. package/dist/components/Timeline.d.ts.map +1 -0
  61. package/dist/components/ToggleSwitch.d.ts +6 -0
  62. package/dist/components/ToggleSwitch.d.ts.map +1 -0
  63. package/dist/components/Token.d.ts +7 -0
  64. package/dist/components/Token.d.ts.map +1 -0
  65. package/dist/components/Tooltip.d.ts +6 -0
  66. package/dist/components/Tooltip.d.ts.map +1 -0
  67. package/dist/components/Truncate.d.ts +7 -0
  68. package/dist/components/Truncate.d.ts.map +1 -0
  69. package/dist/components/UnderlineNav.d.ts +11 -0
  70. package/dist/components/UnderlineNav.d.ts.map +1 -0
  71. package/dist/components/UnderlinePanels.d.ts +12 -0
  72. package/dist/components/UnderlinePanels.d.ts.map +1 -0
  73. package/dist/components/deprecated/ActionList.d.ts +23 -0
  74. package/dist/components/deprecated/ActionList.d.ts.map +1 -0
  75. package/dist/components/deprecated/DialogV1.d.ts +11 -0
  76. package/dist/components/deprecated/DialogV1.d.ts.map +1 -0
  77. package/dist/components/deprecated/Octicon.d.ts +17 -0
  78. package/dist/components/deprecated/Octicon.d.ts.map +1 -0
  79. package/dist/components/deprecated/TabNav.d.ts +9 -0
  80. package/dist/components/deprecated/TabNav.d.ts.map +1 -0
  81. package/dist/components/deprecated/Tooltip.d.ts +13 -0
  82. package/dist/components/deprecated/Tooltip.d.ts.map +1 -0
  83. package/dist/components.json +62 -1
  84. package/dist/deprecated.d.ts +5 -1
  85. package/dist/deprecated.d.ts.map +1 -1
  86. package/dist/deprecated.js +179 -1
  87. package/dist/experimental.d.ts +4 -1
  88. package/dist/experimental.d.ts.map +1 -1
  89. package/dist/experimental.js +55 -5
  90. package/dist/index.d.ts +49 -81
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +646 -37
  93. package/dist/styled-props.d.ts +5 -0
  94. package/dist/styled-props.d.ts.map +1 -0
  95. package/dist/sx.d.ts +3 -0
  96. package/dist/sx.d.ts.map +1 -1
  97. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,24 +1,357 @@
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';
1
+ import { ActionList as ActionList$1, sx, ActionMenu as ActionMenu$1, Autocomplete as Autocomplete$1, Box, Avatar as Avatar$1, Breadcrumbs as Breadcrumbs$1, Button, 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, IconButton as IconButton$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, TextInput as TextInput$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, Details, FormControl, ProgressBar, Select, Textarea, ThemeProvider, merge, sx, theme, themeGet, useColorSchemeVar, useTheme } from '@primer/react';
3
+ import React, { forwardRef } from 'react';
4
4
  import styled from 'styled-components';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- export { P as PageHeader } from './PageHeader-BYlYLcfB.js';
6
+ export { D as Dialog, P as PageHeader, T as Tooltip } from './Tooltip-DIHgr01r.js';
7
+ import css from '@styled-system/css';
7
8
 
8
- const LinkButton = styled(LinkButton$1).withConfig({
9
+ const StyledActionList = styled(ActionList$1).withConfig({
9
10
  shouldForwardProp: prop => prop !== 'sx'
10
11
  }).withConfig({
11
- displayName: "LinkButton",
12
- componentId: "sc-1v6zkmg-0"
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 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
+ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
276
+ return /*#__PURE__*/jsx(Box, {
277
+ as: Checkbox$1,
278
+ ref: ref,
279
+ ...props
280
+ });
281
+ });
282
+
283
+ const CheckboxGroupImpl = props => {
284
+ return /*#__PURE__*/jsx(Box, {
285
+ as: CheckboxGroup$1,
286
+ ...props
287
+ });
288
+ };
289
+
290
+ // Define local types based on the internal component props
291
+
292
+ const CheckboxOrRadioGroupLabel$1 = props => {
293
+ return /*#__PURE__*/jsx(Box, {
294
+ as: CheckboxGroup$1.Label,
295
+ ...props
296
+ });
297
+ };
298
+ const CheckboxOrRadioGroupCaption$1 = props => {
299
+ return /*#__PURE__*/jsx(Box, {
300
+ as: CheckboxGroup$1.Caption,
301
+ ...props
302
+ });
303
+ };
304
+ const CheckboxOrRadioGroupValidation$1 = props => {
305
+ return /*#__PURE__*/jsx(Box, {
306
+ as: CheckboxGroup$1.Validation,
307
+ ...props
308
+ });
309
+ };
310
+ const CheckboxGroup = Object.assign(CheckboxGroupImpl, {
311
+ Label: CheckboxOrRadioGroupLabel$1,
312
+ Caption: CheckboxOrRadioGroupCaption$1,
313
+ Validation: CheckboxOrRadioGroupValidation$1
314
+ });
315
+
316
+ const CircleBadge = styled(CircleBadge$1).withConfig({
317
+ shouldForwardProp: prop => prop !== 'sx'
318
+ }).withConfig({
319
+ displayName: "CircleBadge",
320
+ componentId: "sc-1u7lp3v-0"
13
321
  })(["", ""], sx);
14
322
 
15
- const HeaderImpl = /*#__PURE__*/forwardRef(function Header(props, ref) {
323
+ const CounterLabel = /*#__PURE__*/forwardRef(function CounterLabel(props, ref) {
324
+ return /*#__PURE__*/jsx(Box, {
325
+ as: CounterLabel$1,
326
+ ref: ref,
327
+ ...props
328
+ });
329
+ });
330
+
331
+ const Flash = styled(Flash$1).withConfig({
332
+ shouldForwardProp: prop => prop !== 'sx'
333
+ }).withConfig({
334
+ displayName: "Flash",
335
+ componentId: "sc-413izo-0"
336
+ })(["", ""], sx);
337
+
338
+ const StyledHeader = /*#__PURE__*/forwardRef(function Header(props, ref) {
16
339
  return /*#__PURE__*/jsx(Box, {
17
340
  as: Header$1,
18
341
  ref: ref,
19
342
  ...props
20
343
  });
21
344
  });
345
+ const HeaderImpl = /*#__PURE__*/forwardRef(({
346
+ as,
347
+ ...props
348
+ }, ref) => /*#__PURE__*/jsx(StyledHeader, {
349
+ ...props,
350
+ ...(as ? {
351
+ forwardedAs: as
352
+ } : {}),
353
+ ref: ref
354
+ }));
22
355
  const HeaderItem = /*#__PURE__*/forwardRef(function HeaderItem(props, ref) {
23
356
  return /*#__PURE__*/jsx(Box, {
24
357
  as: Header$1.Item,
@@ -26,38 +359,204 @@ const HeaderItem = /*#__PURE__*/forwardRef(function HeaderItem(props, ref) {
26
359
  ...props
27
360
  });
28
361
  });
29
- const HeaderLink = /*#__PURE__*/forwardRef(function HeaderLink(props, ref) {
362
+ const StyledHeaderLink = /*#__PURE__*/forwardRef(function HeaderLink(props, ref) {
30
363
  return /*#__PURE__*/jsx(Box, {
31
364
  as: Header$1.Link,
32
365
  ref: ref,
33
366
  ...props
34
367
  });
35
368
  });
369
+ const HeaderLink = /*#__PURE__*/forwardRef(({
370
+ as,
371
+ ...props
372
+ }, ref) => /*#__PURE__*/jsx(StyledHeaderLink, {
373
+ ...props,
374
+ ...(as ? {
375
+ forwardedAs: as
376
+ } : {}),
377
+ ref: ref
378
+ }));
36
379
  const Header = Object.assign(HeaderImpl, {
37
380
  Item: HeaderItem,
38
381
  Link: HeaderLink
39
382
  });
40
383
 
41
- const Flash = styled(Flash$1).withConfig({
384
+ const Heading = styled(Heading$1).withConfig({
42
385
  shouldForwardProp: prop => prop !== 'sx'
43
386
  }).withConfig({
44
- displayName: "Flash",
45
- componentId: "sc-413izo-0"
387
+ displayName: "Heading",
388
+ componentId: "sc-1vc165i-0"
46
389
  })(["", ""], sx);
47
390
 
48
- function Spinner(props) {
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
+ }
49
405
  return /*#__PURE__*/jsx(Box, {
50
- as: Spinner$1,
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
+ const StyledLabel = /*#__PURE__*/forwardRef(function Label(props, ref) {
424
+ return /*#__PURE__*/jsx(Box, {
425
+ as: Label$1,
426
+ ref: ref,
51
427
  ...props
52
428
  });
53
- }
54
- function RelativeTime(props) {
55
- // @ts-expect-error the types for Box are not correctly inferred here
429
+ });
430
+ const Label = /*#__PURE__*/forwardRef(({
431
+ as,
432
+ ...props
433
+ }, ref) => {
434
+ return /*#__PURE__*/jsx(StyledLabel, {
435
+ ...props,
436
+ ...(as ? {
437
+ forwardedAs: as
438
+ } : {}),
439
+ ref: ref
440
+ });
441
+ });
442
+
443
+ const StyledLink = styled(Link$1).withConfig({
444
+ shouldForwardProp: prop => prop !== 'sx'
445
+ }).withConfig({
446
+ displayName: "Link__StyledLink",
447
+ componentId: "sc-1syctfj-0"
448
+ })(["", ""], sx);
449
+ const Link = /*#__PURE__*/forwardRef(({
450
+ as,
451
+ ...props
452
+ }, ref) => {
453
+ return /*#__PURE__*/jsx(StyledLink, {
454
+ ...props,
455
+ ...(as ? {
456
+ forwardedAs: as
457
+ } : {}),
458
+ ref: ref
459
+ });
460
+ });
461
+
462
+ const LinkButton = styled(LinkButton$1).withConfig({
463
+ shouldForwardProp: prop => prop !== 'sx'
464
+ }).withConfig({
465
+ displayName: "LinkButton",
466
+ componentId: "sc-1v6zkmg-0"
467
+ })(["", ""], sx);
468
+
469
+ const NavListImpl = /*#__PURE__*/forwardRef(function NavList(props, ref) {
56
470
  return /*#__PURE__*/jsx(Box, {
57
- as: RelativeTime$1,
471
+ as: NavList$1,
472
+ ref: ref,
58
473
  ...props
59
474
  });
60
- }
475
+ });
476
+ const NavListItem = /*#__PURE__*/forwardRef(function NavListItem(props, ref) {
477
+ // @ts-expect-error - PrimerNavList.Item is not recognized as a valid component type
478
+ return /*#__PURE__*/jsx(Box, {
479
+ as: NavList$1.Item,
480
+ ref: ref,
481
+ ...props
482
+ });
483
+ });
484
+ const NavListGroup = /*#__PURE__*/forwardRef(function NavListGroup(props, ref) {
485
+ // @ts-expect-error - PrimerNavList.Group is not recognized as a valid component type
486
+ return /*#__PURE__*/jsx(Box, {
487
+ as: NavList$1.Group,
488
+ ref: ref,
489
+ ...props
490
+ });
491
+ });
492
+ const NavListGroupHeading = /*#__PURE__*/forwardRef(function NavListGroupHeading(props, ref) {
493
+ // @ts-expect-error - PrimerNavList.GroupHeading is not recognized as a valid component type
494
+ return /*#__PURE__*/jsx(Box, {
495
+ as: NavList$1.GroupHeading,
496
+ ref: ref,
497
+ ...props
498
+ });
499
+ });
500
+ const NavListLeadingVisual = /*#__PURE__*/forwardRef(function NavListLeadingVisual(props, ref) {
501
+ // @ts-expect-error - PrimerNavList.LeadingVisual is not recognized as a valid component type
502
+ return /*#__PURE__*/jsx(Box, {
503
+ as: NavList$1.LeadingVisual,
504
+ ref: ref,
505
+ ...props
506
+ });
507
+ });
508
+ const NavList = Object.assign(NavListImpl, {
509
+ Item: NavListItem,
510
+ Group: NavListGroup,
511
+ GroupHeading: NavListGroupHeading,
512
+ LeadingVisual: NavListLeadingVisual,
513
+ SubNav: NavList$1.SubNav,
514
+ Divider: NavList$1.Divider,
515
+ TrailingVisual: NavList$1.TrailingVisual,
516
+ TrailingAction: NavList$1.TrailingAction,
517
+ GroupExpand: NavList$1.GroupExpand
518
+ });
519
+
520
+ const Overlay = styled(Overlay$1).withConfig({
521
+ shouldForwardProp: prop => prop !== 'sx'
522
+ }).withConfig({
523
+ displayName: "Overlay",
524
+ componentId: "sc-tjbd74-0"
525
+ })(["", ""], sx);
526
+
527
+ const Wrapper = styled.div.withConfig({
528
+ displayName: "PageLayout__Wrapper",
529
+ componentId: "sc-pjybtc-0"
530
+ })(["", ""], sx);
531
+ const PageLayoutImpl = /*#__PURE__*/React.forwardRef((props, ref) => {
532
+ // @ts-expect-error - PrimerPageLayout is not recognized as a valid component type
533
+ return /*#__PURE__*/jsx(Wrapper, {
534
+ as: PageLayout$1,
535
+ ref: ref,
536
+ ...props
537
+ });
538
+ });
539
+ const PageLayoutContent = /*#__PURE__*/React.forwardRef((props, ref) => {
540
+ return /*#__PURE__*/jsx(Wrapper, {
541
+ as: PageLayout$1.Content,
542
+ ref: ref,
543
+ ...props
544
+ });
545
+ });
546
+ const PageLayoutPane = /*#__PURE__*/React.forwardRef((props, ref) => {
547
+ return /*#__PURE__*/jsx(Wrapper, {
548
+ as: PageLayout$1.Pane,
549
+ ref: ref,
550
+ ...props
551
+ });
552
+ });
553
+ const PageLayout = Object.assign(PageLayoutImpl, {
554
+ Content: PageLayoutContent,
555
+ Header: PageLayout$1.Header,
556
+ Pane: PageLayoutPane,
557
+ Footer: PageLayout$1.Footer
558
+ });
559
+
61
560
  const RadioGroupImpl = props => {
62
561
  return /*#__PURE__*/jsx(Box, {
63
562
  as: RadioGroup$1,
@@ -90,6 +589,15 @@ const RadioGroup = Object.assign(RadioGroupImpl, {
90
589
  Caption: CheckboxOrRadioGroupCaption,
91
590
  Validation: CheckboxOrRadioGroupValidation
92
591
  });
592
+
593
+ function RelativeTime(props) {
594
+ // @ts-expect-error the types for Box are not correctly inferred here
595
+ return /*#__PURE__*/jsx(Box, {
596
+ as: RelativeTime$1,
597
+ ...props
598
+ });
599
+ }
600
+
93
601
  const SegmentedControlButton = props => {
94
602
  return /*#__PURE__*/jsx(Box, {
95
603
  as: SegmentedControl$1.Button,
@@ -112,20 +620,14 @@ const SegmentedControl = Object.assign(SegmentedControlImpl, {
112
620
  Button: SegmentedControlButton,
113
621
  IconButton: SegmentedControlIconButton
114
622
  });
115
- const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, ref) {
116
- return /*#__PURE__*/jsx(Box, {
117
- as: Checkbox$1,
118
- ref: ref,
119
- ...props
120
- });
121
- });
122
- const CounterLabel = /*#__PURE__*/forwardRef(function CounterLabel(props, ref) {
623
+
624
+ function Spinner(props) {
123
625
  return /*#__PURE__*/jsx(Box, {
124
- as: CounterLabel$1,
125
- ref: ref,
626
+ as: Spinner$1,
126
627
  ...props
127
628
  });
128
- });
629
+ }
630
+
129
631
  const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
130
632
  return /*#__PURE__*/jsx(Box, {
131
633
  as: StateLabel$1,
@@ -133,6 +635,7 @@ const StateLabel = /*#__PURE__*/forwardRef(function StateLabel(props, ref) {
133
635
  ...props
134
636
  });
135
637
  });
638
+
136
639
  const SubNavImpl = /*#__PURE__*/forwardRef(function SubNav(props, ref) {
137
640
  return /*#__PURE__*/jsx(Box, {
138
641
  as: SubNav$1,
@@ -150,6 +653,59 @@ const SubNavLink = /*#__PURE__*/forwardRef(function SubNavLink(props, ref) {
150
653
  const SubNav = Object.assign(SubNavImpl, {
151
654
  Link: SubNavLink
152
655
  });
656
+
657
+ const StyledText = styled(Text$1).withConfig({
658
+ shouldForwardProp: prop => prop !== 'sx'
659
+ }).withConfig({
660
+ displayName: "Text__StyledText",
661
+ componentId: "sc-1klmep6-0"
662
+ })(["", ""], sx);
663
+ const Text = /*#__PURE__*/forwardRef(({
664
+ as,
665
+ ...props
666
+ }, ref) => {
667
+ return /*#__PURE__*/jsx(StyledText, {
668
+ ...props,
669
+ ...(as ? {
670
+ forwardedAs: as
671
+ } : {}),
672
+ ref: ref
673
+ });
674
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
675
+ });
676
+
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
+
153
709
  const TimelineImpl = /*#__PURE__*/forwardRef(function Timeline(props, ref) {
154
710
  return /*#__PURE__*/jsx(Box, {
155
711
  as: Timeline$1,
@@ -190,6 +746,7 @@ const Timeline = Object.assign(TimelineImpl, {
190
746
  Body: TimelineBody,
191
747
  Break: TimelineBreak
192
748
  });
749
+
193
750
  const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
194
751
  return /*#__PURE__*/jsx(Box, {
195
752
  as: ToggleSwitch$1,
@@ -197,27 +754,79 @@ const ToggleSwitch = /*#__PURE__*/forwardRef(function ToggleSwitch(props, ref) {
197
754
  ...props
198
755
  });
199
756
  });
757
+
758
+ const Token = /*#__PURE__*/React.forwardRef(({
759
+ sx: sxProp,
760
+ style,
761
+ ...rest
762
+ }, ref) => {
763
+ const contextTheme = useTheme();
764
+ const theme$1 = contextTheme.theme || theme;
765
+
766
+ // If no sx prop is provided, just return PrimerToken directly
767
+ if (!sxProp) {
768
+ return /*#__PURE__*/jsx(Token$1, {
769
+ ...rest,
770
+ style: style,
771
+ ref: ref
772
+ });
773
+ }
774
+
775
+ // Convert sx to CSS styles using the theme context
776
+ const sxStyles = css(sxProp)(theme$1);
777
+ const mergedStyle = {
778
+ ...sxStyles,
779
+ ...style
780
+ };
781
+ return /*#__PURE__*/jsx(Token$1, {
782
+ ...rest,
783
+ style: mergedStyle,
784
+ ref: ref
785
+ });
786
+ });
787
+
200
788
  const Truncate = styled(Truncate$1).withConfig({
201
789
  shouldForwardProp: prop => prop !== 'sx'
202
790
  }).withConfig({
203
- displayName: "src__Truncate",
204
- componentId: "sc-1hfjsa7-0"
791
+ displayName: "Truncate",
792
+ componentId: "sc-x3i4it-0"
205
793
  })(["", ""], sx);
206
- const UnderlineNavImpl = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
794
+
795
+ const StyledUnderlineNav = /*#__PURE__*/forwardRef(function UnderlineNav(props, ref) {
207
796
  return /*#__PURE__*/jsx(Box, {
208
797
  as: UnderlineNav$1,
209
798
  ref: ref,
210
799
  ...props
211
800
  });
212
801
  });
213
- const UnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
802
+ const UnderlineNavImpl = /*#__PURE__*/forwardRef(({
803
+ as,
804
+ ...props
805
+ }, ref) => /*#__PURE__*/jsx(StyledUnderlineNav, {
806
+ ...props,
807
+ ...(as ? {
808
+ forwardedAs: as
809
+ } : {}),
810
+ ref: ref
811
+ }));
812
+ const StyledUnderlineNavItem = styled(UnderlineNav$1.Item).withConfig({
214
813
  shouldForwardProp: prop => prop !== 'sx'
215
814
  }).withConfig({
216
- displayName: "src__UnderlineNavItem",
217
- componentId: "sc-1hfjsa7-1"
815
+ displayName: "UnderlineNav__StyledUnderlineNavItem",
816
+ componentId: "sc-dx6br2-0"
218
817
  })(["", ""], sx);
818
+ const UnderlineNavItem = /*#__PURE__*/forwardRef(({
819
+ as,
820
+ ...props
821
+ }, ref) => /*#__PURE__*/jsx(StyledUnderlineNavItem, {
822
+ ...props,
823
+ ...(as ? {
824
+ forwardedAs: as
825
+ } : {}),
826
+ ref: ref
827
+ }));
219
828
  const UnderlineNav = Object.assign(UnderlineNavImpl, {
220
829
  Item: UnderlineNavItem
221
830
  });
222
831
 
223
- export { Checkbox, CounterLabel, Flash, Header, LinkButton, RadioGroup, RelativeTime, SegmentedControl, Spinner, StateLabel, SubNav, Timeline, ToggleSwitch, Truncate, UnderlineNav };
832
+ export { ActionList, ActionMenu, Autocomplete, Avatar, Breadcrumb, Breadcrumbs, ButtonComponent as Button, Checkbox, CheckboxGroup, CircleBadge, CounterLabel, Flash, Header, Heading, IconButton, Label, Link, LinkButton, NavList, Overlay, PageLayout, RadioGroup, RelativeTime, SegmentedControl, Spinner, StateLabel, SubNav, Text, TextInput, Timeline, ToggleSwitch, Token, Truncate, UnderlineNav };