@primer/react 37.29.0-rc.af59a9de1 → 38.0.0-rc.195178541

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 (210) hide show
  1. package/CHANGELOG.md +3 -15
  2. package/dist/browser.esm.js +2 -2
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +3 -3
  5. package/dist/browser.umd.js.map +1 -1
  6. package/dist/components.css +72 -85
  7. package/generated/components.json +133 -133
  8. package/lib/ActionList/Description.d.ts.map +1 -1
  9. package/lib/ActionList/Description.js +2 -1
  10. package/lib/ActionList/Divider.d.ts.map +1 -1
  11. package/lib/ActionList/Divider.js +2 -1
  12. package/lib/ActionList/Group.d.ts.map +1 -1
  13. package/lib/ActionList/Group.js +6 -1
  14. package/lib/ActionList/Item.d.ts.map +1 -1
  15. package/lib/ActionList/Item.js +2 -1
  16. package/lib/ActionList/LinkItem.d.ts.map +1 -1
  17. package/lib/ActionList/LinkItem.js +2 -1
  18. package/lib/ActionList/List.d.ts.map +1 -1
  19. package/lib/ActionList/List.js +3 -0
  20. package/lib/ActionList/Visuals.d.ts.map +1 -1
  21. package/lib/ActionList/Visuals.js +7 -0
  22. package/lib/Avatar/Avatar.d.ts.map +1 -1
  23. package/lib/Avatar/Avatar.js +41 -39
  24. package/lib/AvatarPair/AvatarPair.js +1 -1
  25. package/lib/AvatarStack/AvatarStack.d.ts +1 -1
  26. package/lib/AvatarStack/AvatarStack.d.ts.map +1 -1
  27. package/lib/AvatarStack/AvatarStack.js +2 -1
  28. package/lib/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  29. package/lib/ButtonGroup/ButtonGroup.js +61 -24
  30. package/lib/CounterLabel/CounterLabel.d.ts.map +1 -1
  31. package/lib/CounterLabel/CounterLabel.js +87 -43
  32. package/lib/DataTable/Pagination.d.ts.map +1 -1
  33. package/lib/DataTable/Pagination.js +88 -81
  34. package/lib/DataTable/Table.d.ts +1 -1
  35. package/lib/DataTable/Table.d.ts.map +1 -1
  36. package/lib/DataTable/Table.js +26 -18
  37. package/lib/Details/Details.d.ts.map +1 -1
  38. package/lib/Details/Details.js +82 -35
  39. package/lib/FilteredActionList/FilteredActionListLoaders.js +1 -1
  40. package/lib/FormControl/FormControl.d.ts.map +1 -1
  41. package/lib/FormControl/FormControl.js +12 -3
  42. package/lib/Header/Header.d.ts.map +1 -1
  43. package/lib/Header/Header.js +170 -64
  44. package/lib/InlineMessage/InlineMessage.d.ts +1 -1
  45. package/lib/InlineMessage/InlineMessage.d.ts.map +1 -1
  46. package/lib/InlineMessage/InlineMessage.js +69 -31
  47. package/lib/PageLayout/PageLayout.d.ts.map +1 -1
  48. package/lib/PageLayout/PageLayout.js +473 -465
  49. package/lib/Pagehead/Pagehead.d.ts +1 -1
  50. package/lib/Pagehead/Pagehead.d.ts.map +1 -1
  51. package/lib/Pagehead/Pagehead.js +11 -2
  52. package/lib/Radio/Radio.d.ts.map +1 -1
  53. package/lib/Radio/Radio.js +91 -40
  54. package/lib/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  55. package/lib/SegmentedControl/SegmentedControl.js +25 -23
  56. package/lib/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
  57. package/lib/SegmentedControl/SegmentedControlButton.js +72 -70
  58. package/lib/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
  59. package/lib/SegmentedControl/SegmentedControlIconButton.js +112 -110
  60. package/lib/SideNav.d.ts.map +1 -1
  61. package/lib/SideNav.js +2 -1
  62. package/lib/Skeleton/SkeletonBox.d.ts +2 -2
  63. package/lib/Skeleton/SkeletonBox.d.ts.map +1 -1
  64. package/lib/Skeleton/SkeletonBox.js +24 -25
  65. package/lib/Spinner/Spinner.d.ts +1 -1
  66. package/lib/Spinner/Spinner.d.ts.map +1 -1
  67. package/lib/Spinner/Spinner.js +51 -13
  68. package/lib/SubNav/SubNav.d.ts.map +1 -1
  69. package/lib/SubNav/SubNav.js +215 -77
  70. package/lib/Timeline/Timeline.d.ts +1 -1
  71. package/lib/Timeline/Timeline.d.ts.map +1 -1
  72. package/lib/Timeline/Timeline.js +264 -92
  73. package/lib/Token/Token.d.ts.map +1 -1
  74. package/lib/Token/Token.js +128 -120
  75. package/lib/TreeView/TreeView.js +2 -2
  76. package/lib/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  77. package/lib/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  78. package/lib/VisuallyHidden/VisuallyHidden.js +51 -19
  79. package/lib/_VisuallyHidden.d.ts +2 -3
  80. package/lib/_VisuallyHidden.d.ts.map +1 -1
  81. package/lib/_VisuallyHidden.js +26 -63
  82. package/lib/experimental/Skeleton/SkeletonAvatar-e00fff32.css +2 -0
  83. package/lib/experimental/Skeleton/SkeletonAvatar-e00fff32.css.map +1 -0
  84. package/lib/experimental/Skeleton/SkeletonAvatar.d.ts +8 -0
  85. package/lib/experimental/Skeleton/SkeletonAvatar.d.ts.map +1 -0
  86. package/lib/{SkeletonAvatar → experimental/Skeleton}/SkeletonAvatar.js +5 -5
  87. package/lib/{SkeletonAvatar → experimental/Skeleton}/SkeletonAvatar.module.css.js +1 -1
  88. package/lib/experimental/Skeleton/SkeletonText-5cf908c1.css +2 -0
  89. package/lib/experimental/Skeleton/SkeletonText-5cf908c1.css.map +1 -0
  90. package/lib/{SkeletonText → experimental/Skeleton}/SkeletonText.d.ts +4 -5
  91. package/lib/experimental/Skeleton/SkeletonText.d.ts.map +1 -0
  92. package/lib/experimental/Skeleton/SkeletonText.js +149 -0
  93. package/lib/experimental/Skeleton/SkeletonText.module.css.js +7 -0
  94. package/lib/experimental/Skeleton/index.d.ts +4 -0
  95. package/lib/experimental/Skeleton/index.d.ts.map +1 -0
  96. package/lib/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
  97. package/lib/experimental/UnderlinePanels/UnderlinePanels.js +40 -30
  98. package/lib/experimental/index.d.ts +1 -6
  99. package/lib/experimental/index.d.ts.map +1 -1
  100. package/lib/experimental/index.js +2 -2
  101. package/lib/internal/components/ButtonReset.d.ts +2 -1
  102. package/lib/internal/components/ButtonReset.d.ts.map +1 -1
  103. package/lib/internal/components/ButtonReset.js +13 -49
  104. package/lib/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
  105. package/lib/internal/components/UnderlineTabbedInterface.js +108 -60
  106. package/lib/internal/utils/toggleStyledComponent.d.ts +20 -0
  107. package/lib/internal/utils/toggleStyledComponent.d.ts.map +1 -0
  108. package/lib-esm/ActionList/Description.js +2 -1
  109. package/lib-esm/ActionList/Divider.js +2 -1
  110. package/lib-esm/ActionList/Group.js +6 -1
  111. package/lib-esm/ActionList/Item.js +2 -1
  112. package/lib-esm/ActionList/LinkItem.js +2 -1
  113. package/lib-esm/ActionList/List.js +3 -0
  114. package/lib-esm/ActionList/Visuals.js +7 -0
  115. package/lib-esm/Avatar/Avatar.js +41 -39
  116. package/lib-esm/AvatarPair/AvatarPair.js +1 -1
  117. package/lib-esm/AvatarStack/AvatarStack.d.ts +1 -1
  118. package/lib-esm/AvatarStack/AvatarStack.js +2 -1
  119. package/lib-esm/ButtonGroup/ButtonGroup.js +61 -24
  120. package/lib-esm/CounterLabel/CounterLabel.js +87 -43
  121. package/lib-esm/DataTable/Pagination.js +84 -81
  122. package/lib-esm/DataTable/Table.d.ts +1 -1
  123. package/lib-esm/DataTable/Table.js +26 -18
  124. package/lib-esm/Details/Details.js +82 -35
  125. package/lib-esm/FilteredActionList/FilteredActionListLoaders.js +1 -1
  126. package/lib-esm/FormControl/FormControl.js +12 -3
  127. package/lib-esm/Header/Header.js +170 -64
  128. package/lib-esm/InlineMessage/InlineMessage.d.ts +1 -1
  129. package/lib-esm/InlineMessage/InlineMessage.js +69 -31
  130. package/lib-esm/PageLayout/PageLayout.js +473 -465
  131. package/lib-esm/Pagehead/Pagehead.d.ts +1 -1
  132. package/lib-esm/Pagehead/Pagehead.js +11 -2
  133. package/lib-esm/Radio/Radio.js +91 -40
  134. package/lib-esm/SegmentedControl/SegmentedControl.js +25 -23
  135. package/lib-esm/SegmentedControl/SegmentedControlButton.js +72 -70
  136. package/lib-esm/SegmentedControl/SegmentedControlIconButton.js +112 -110
  137. package/lib-esm/SideNav.js +2 -1
  138. package/lib-esm/Skeleton/SkeletonBox.d.ts +2 -2
  139. package/lib-esm/Skeleton/SkeletonBox.js +24 -25
  140. package/lib-esm/Spinner/Spinner.d.ts +1 -1
  141. package/lib-esm/Spinner/Spinner.js +47 -13
  142. package/lib-esm/SubNav/SubNav.js +215 -77
  143. package/lib-esm/Timeline/Timeline.d.ts +1 -1
  144. package/lib-esm/Timeline/Timeline.js +264 -92
  145. package/lib-esm/Token/Token.js +128 -120
  146. package/lib-esm/TreeView/TreeView.js +2 -2
  147. package/lib-esm/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  148. package/lib-esm/VisuallyHidden/VisuallyHidden.js +51 -19
  149. package/lib-esm/_VisuallyHidden.d.ts +2 -3
  150. package/lib-esm/_VisuallyHidden.js +22 -63
  151. package/lib-esm/experimental/Skeleton/SkeletonAvatar-e00fff32.css +2 -0
  152. package/lib-esm/experimental/Skeleton/SkeletonAvatar-e00fff32.css.map +1 -0
  153. package/lib-esm/experimental/Skeleton/SkeletonAvatar.d.ts +8 -0
  154. package/lib-esm/{SkeletonAvatar → experimental/Skeleton}/SkeletonAvatar.js +5 -5
  155. package/lib-esm/experimental/Skeleton/SkeletonAvatar.module.css.js +5 -0
  156. package/lib-esm/experimental/Skeleton/SkeletonText-5cf908c1.css +2 -0
  157. package/lib-esm/experimental/Skeleton/SkeletonText-5cf908c1.css.map +1 -0
  158. package/lib-esm/{SkeletonText → experimental/Skeleton}/SkeletonText.d.ts +4 -5
  159. package/lib-esm/experimental/Skeleton/SkeletonText.js +143 -0
  160. package/lib-esm/experimental/Skeleton/SkeletonText.module.css.js +5 -0
  161. package/lib-esm/experimental/Skeleton/index.d.ts +4 -0
  162. package/lib-esm/experimental/UnderlinePanels/UnderlinePanels.js +40 -30
  163. package/lib-esm/experimental/index.d.ts +1 -6
  164. package/lib-esm/experimental/index.js +2 -2
  165. package/lib-esm/internal/components/ButtonReset.d.ts +2 -1
  166. package/lib-esm/internal/components/ButtonReset.js +9 -49
  167. package/lib-esm/internal/components/UnderlineTabbedInterface.js +108 -60
  168. package/lib-esm/internal/utils/toggleStyledComponent.d.ts +20 -0
  169. package/package.json +1 -1
  170. package/lib/DataTable/Pagination-b6f8418c.css +0 -2
  171. package/lib/DataTable/Pagination-b6f8418c.css.map +0 -1
  172. package/lib/DataTable/Pagination.module.css.js +0 -7
  173. package/lib/SkeletonAvatar/SkeletonAvatar-e00fff32.css +0 -2
  174. package/lib/SkeletonAvatar/SkeletonAvatar-e00fff32.css.map +0 -1
  175. package/lib/SkeletonAvatar/SkeletonAvatar.d.ts +0 -12
  176. package/lib/SkeletonAvatar/SkeletonAvatar.d.ts.map +0 -1
  177. package/lib/SkeletonAvatar/index.d.ts +0 -3
  178. package/lib/SkeletonAvatar/index.d.ts.map +0 -1
  179. package/lib/SkeletonText/SkeletonText-5cf908c1.css +0 -2
  180. package/lib/SkeletonText/SkeletonText-5cf908c1.css.map +0 -1
  181. package/lib/SkeletonText/SkeletonText.d.ts.map +0 -1
  182. package/lib/SkeletonText/SkeletonText.js +0 -142
  183. package/lib/SkeletonText/SkeletonText.module.css.js +0 -7
  184. package/lib/SkeletonText/index.d.ts +0 -3
  185. package/lib/SkeletonText/index.d.ts.map +0 -1
  186. package/lib/_VisuallyHidden-5c0a2499.css +0 -2
  187. package/lib/_VisuallyHidden-5c0a2499.css.map +0 -1
  188. package/lib/_VisuallyHidden.module.css.js +0 -7
  189. package/lib/internal/components/ButtonReset-904f2483.css +0 -2
  190. package/lib/internal/components/ButtonReset-904f2483.css.map +0 -1
  191. package/lib/internal/components/ButtonReset.module.css.js +0 -7
  192. package/lib-esm/DataTable/Pagination-b6f8418c.css +0 -2
  193. package/lib-esm/DataTable/Pagination-b6f8418c.css.map +0 -1
  194. package/lib-esm/DataTable/Pagination.module.css.js +0 -5
  195. package/lib-esm/SkeletonAvatar/SkeletonAvatar-e00fff32.css +0 -2
  196. package/lib-esm/SkeletonAvatar/SkeletonAvatar-e00fff32.css.map +0 -1
  197. package/lib-esm/SkeletonAvatar/SkeletonAvatar.d.ts +0 -12
  198. package/lib-esm/SkeletonAvatar/SkeletonAvatar.module.css.js +0 -5
  199. package/lib-esm/SkeletonAvatar/index.d.ts +0 -3
  200. package/lib-esm/SkeletonText/SkeletonText-5cf908c1.css +0 -2
  201. package/lib-esm/SkeletonText/SkeletonText-5cf908c1.css.map +0 -1
  202. package/lib-esm/SkeletonText/SkeletonText.js +0 -140
  203. package/lib-esm/SkeletonText/SkeletonText.module.css.js +0 -5
  204. package/lib-esm/SkeletonText/index.d.ts +0 -3
  205. package/lib-esm/_VisuallyHidden-5c0a2499.css +0 -2
  206. package/lib-esm/_VisuallyHidden-5c0a2499.css.map +0 -1
  207. package/lib-esm/_VisuallyHidden.module.css.js +0 -5
  208. package/lib-esm/internal/components/ButtonReset-904f2483.css +0 -2
  209. package/lib-esm/internal/components/ButtonReset-904f2483.css.map +0 -1
  210. package/lib-esm/internal/components/ButtonReset.module.css.js +0 -5
@@ -3,6 +3,7 @@
3
3
  var reactCompilerRuntime = require('react-compiler-runtime');
4
4
  var React = require('react');
5
5
  var reactIs = require('react-is');
6
+ var defaultSxProp = require('../../utils/defaultSxProp.js');
6
7
  var UnderlineTabbedInterface_module = require('./UnderlineTabbedInterface.module.css.js');
7
8
  var clsx = require('clsx');
8
9
  var BoxWithFallback = require('./BoxWithFallback.js');
@@ -11,50 +12,57 @@ var CounterLabel = require('../../CounterLabel/CounterLabel.js');
11
12
 
12
13
  const GAP = 8;
13
14
  const UnderlineWrapper = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
14
- const $ = reactCompilerRuntime.c(11);
15
+ const $ = reactCompilerRuntime.c(13);
15
16
  let children;
16
17
  let className;
17
18
  let rest;
19
+ let t1;
18
20
  if ($[0] !== t0) {
19
21
  ({
20
22
  children,
21
23
  className,
24
+ sx: t1,
22
25
  ...rest
23
26
  } = t0);
24
27
  $[0] = t0;
25
28
  $[1] = children;
26
29
  $[2] = className;
27
30
  $[3] = rest;
31
+ $[4] = t1;
28
32
  } else {
29
33
  children = $[1];
30
34
  className = $[2];
31
35
  rest = $[3];
36
+ t1 = $[4];
32
37
  }
33
- let t1;
34
- if ($[4] !== className) {
35
- t1 = clsx.clsx(UnderlineTabbedInterface_module.UnderlineWrapper, className);
36
- $[4] = className;
37
- $[5] = t1;
38
+ const sxProp = t1 === undefined ? defaultSxProp.defaultSxProp : t1;
39
+ let t2;
40
+ if ($[5] !== className) {
41
+ t2 = clsx.clsx(UnderlineTabbedInterface_module.UnderlineWrapper, className);
42
+ $[5] = className;
43
+ $[6] = t2;
38
44
  } else {
39
- t1 = $[5];
45
+ t2 = $[6];
40
46
  }
41
- let t2;
42
- if ($[6] !== children || $[7] !== forwardedRef || $[8] !== rest || $[9] !== t1) {
43
- t2 = /*#__PURE__*/jsxRuntime.jsx(BoxWithFallback.BoxWithFallback, {
44
- className: t1,
47
+ let t3;
48
+ if ($[7] !== children || $[8] !== forwardedRef || $[9] !== rest || $[10] !== sxProp || $[11] !== t2) {
49
+ t3 = /*#__PURE__*/jsxRuntime.jsx(BoxWithFallback.BoxWithFallback, {
50
+ className: t2,
45
51
  ref: forwardedRef,
52
+ sx: sxProp,
46
53
  ...rest,
47
54
  children: children
48
55
  });
49
- $[6] = children;
50
- $[7] = forwardedRef;
51
- $[8] = rest;
52
- $[9] = t1;
53
- $[10] = t2;
56
+ $[7] = children;
57
+ $[8] = forwardedRef;
58
+ $[9] = rest;
59
+ $[10] = sxProp;
60
+ $[11] = t2;
61
+ $[12] = t3;
54
62
  } else {
55
- t2 = $[10];
63
+ t3 = $[12];
56
64
  }
57
- return t2;
65
+ return t3;
58
66
  });
59
67
  const UnderlineItemList = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
60
68
  const $ = reactCompilerRuntime.c(7);
@@ -102,8 +110,41 @@ const LoadingCounter = () => {
102
110
  }
103
111
  return t0;
104
112
  };
113
+
114
+ // We can uncomment these when/if we add overflow behavior
115
+ // to the UnderlinePanels component
116
+ //
117
+ // export const StyledMoreButton = styled(Button)`
118
+ // margin: 0;
119
+ // border: 0;
120
+ // background: transparent;
121
+ // font-weight: normal;
122
+ // box-shadow: none;
123
+ // padding-block: var(--control-small-paddingBlock);
124
+ // padding-inline: var(--control-small-paddingInline-condensed);
125
+
126
+ // > span[data-component='trailingVisual'] {
127
+ // margin-left: 0;
128
+ // }
129
+ // `
130
+
131
+ // export const StyledOverflowDivider = styled.span`
132
+ // display: inline-block;
133
+ // border-left: 1px solid var(--borderColor-muted);
134
+ // width: 1px;
135
+ // margin-right: var(--control-xsmall-gap);
136
+ // /* The height of the divider - reference from Figma */
137
+ // height: 24px;
138
+ // `
139
+
140
+ // export const StyledMoreMenuListItem = styled.li`
141
+ // display: flex;
142
+ // align-items: center;
143
+ // height: 45px;
144
+ // `
145
+
105
146
  const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
106
- const $ = reactCompilerRuntime.c(27);
147
+ const $ = reactCompilerRuntime.c(29);
107
148
  let Icon;
108
149
  let children;
109
150
  let className;
@@ -112,6 +153,7 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
112
153
  let loadingCounters;
113
154
  let rest;
114
155
  let t1;
156
+ let t2;
115
157
  if ($[0] !== t0) {
116
158
  ({
117
159
  as: t1,
@@ -120,6 +162,7 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
120
162
  icon: Icon,
121
163
  iconsVisible,
122
164
  loadingCounters,
165
+ sx: t2,
123
166
  className,
124
167
  ...rest
125
168
  } = t0);
@@ -132,6 +175,7 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
132
175
  $[6] = loadingCounters;
133
176
  $[7] = rest;
134
177
  $[8] = t1;
178
+ $[9] = t2;
135
179
  } else {
136
180
  Icon = $[1];
137
181
  children = $[2];
@@ -141,43 +185,45 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
141
185
  loadingCounters = $[6];
142
186
  rest = $[7];
143
187
  t1 = $[8];
188
+ t2 = $[9];
144
189
  }
145
190
  const as = t1 === undefined ? "a" : t1;
146
- let t2;
147
- if ($[9] !== className) {
148
- t2 = clsx.clsx(UnderlineTabbedInterface_module.UnderlineItem, className);
149
- $[9] = className;
150
- $[10] = t2;
191
+ const sxProp = t2 === undefined ? defaultSxProp.defaultSxProp : t2;
192
+ let t3;
193
+ if ($[10] !== className) {
194
+ t3 = clsx.clsx(UnderlineTabbedInterface_module.UnderlineItem, className);
195
+ $[10] = className;
196
+ $[11] = t3;
151
197
  } else {
152
- t2 = $[10];
198
+ t3 = $[11];
153
199
  }
154
- let t3;
155
- if ($[11] !== Icon || $[12] !== iconsVisible) {
156
- t3 = iconsVisible && Icon && /*#__PURE__*/jsxRuntime.jsx("span", {
200
+ let t4;
201
+ if ($[12] !== Icon || $[13] !== iconsVisible) {
202
+ t4 = iconsVisible && Icon && /*#__PURE__*/jsxRuntime.jsx("span", {
157
203
  "data-component": "icon",
158
204
  children: reactIs.isElement(Icon) ? Icon : /*#__PURE__*/jsxRuntime.jsx(Icon, {})
159
205
  });
160
- $[11] = Icon;
161
- $[12] = iconsVisible;
162
- $[13] = t3;
206
+ $[12] = Icon;
207
+ $[13] = iconsVisible;
208
+ $[14] = t4;
163
209
  } else {
164
- t3 = $[13];
210
+ t4 = $[14];
165
211
  }
166
- let t4;
167
- if ($[14] !== children) {
168
- t4 = children && /*#__PURE__*/jsxRuntime.jsx("span", {
212
+ let t5;
213
+ if ($[15] !== children) {
214
+ t5 = children && /*#__PURE__*/jsxRuntime.jsx("span", {
169
215
  "data-component": "text",
170
216
  "data-content": children,
171
217
  children: children
172
218
  });
173
- $[14] = children;
174
- $[15] = t4;
219
+ $[15] = children;
220
+ $[16] = t5;
175
221
  } else {
176
- t4 = $[15];
222
+ t5 = $[16];
177
223
  }
178
- let t5;
179
- if ($[16] !== counter || $[17] !== loadingCounters) {
180
- t5 = counter !== undefined ? loadingCounters ? /*#__PURE__*/jsxRuntime.jsx("span", {
224
+ let t6;
225
+ if ($[17] !== counter || $[18] !== loadingCounters) {
226
+ t6 = counter !== undefined ? loadingCounters ? /*#__PURE__*/jsxRuntime.jsx("span", {
181
227
  "data-component": "counter",
182
228
  children: /*#__PURE__*/jsxRuntime.jsx(LoadingCounter, {})
183
229
  }) : /*#__PURE__*/jsxRuntime.jsx("span", {
@@ -186,33 +232,35 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
186
232
  children: counter
187
233
  })
188
234
  }) : null;
189
- $[16] = counter;
190
- $[17] = loadingCounters;
191
- $[18] = t5;
235
+ $[17] = counter;
236
+ $[18] = loadingCounters;
237
+ $[19] = t6;
192
238
  } else {
193
- t5 = $[18];
239
+ t6 = $[19];
194
240
  }
195
- let t6;
196
- if ($[19] !== as || $[20] !== forwardedRef || $[21] !== rest || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t5) {
197
- t6 = /*#__PURE__*/jsxRuntime.jsxs(BoxWithFallback.BoxWithFallback, {
241
+ let t7;
242
+ if ($[20] !== as || $[21] !== forwardedRef || $[22] !== rest || $[23] !== sxProp || $[24] !== t3 || $[25] !== t4 || $[26] !== t5 || $[27] !== t6) {
243
+ t7 = /*#__PURE__*/jsxRuntime.jsxs(BoxWithFallback.BoxWithFallback, {
198
244
  ref: forwardedRef,
199
245
  as: as,
200
- className: t2,
246
+ sx: sxProp,
247
+ className: t3,
201
248
  ...rest,
202
- children: [t3, t4, t5]
249
+ children: [t4, t5, t6]
203
250
  });
204
- $[19] = as;
205
- $[20] = forwardedRef;
206
- $[21] = rest;
207
- $[22] = t2;
208
- $[23] = t3;
209
- $[24] = t4;
210
- $[25] = t5;
211
- $[26] = t6;
251
+ $[20] = as;
252
+ $[21] = forwardedRef;
253
+ $[22] = rest;
254
+ $[23] = sxProp;
255
+ $[24] = t3;
256
+ $[25] = t4;
257
+ $[26] = t5;
258
+ $[27] = t6;
259
+ $[28] = t7;
212
260
  } else {
213
- t6 = $[26];
261
+ t7 = $[28];
214
262
  }
215
- return t6;
263
+ return t7;
216
264
  });
217
265
 
218
266
  exports.GAP = GAP;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ type CSSModulesProps = {
3
+ as?: string | React.ComponentType<any>;
4
+ sx?: React.CSSProperties;
5
+ };
6
+ /**
7
+ * Utility to toggle rendering a styled component or a "plain" component based
8
+ * on the provided `as` prop. When the provided feature flag is enabled, the
9
+ * props will be passed through to an element or component created with the `as`
10
+ * prop. When it is disabled, the provided styled component is used instead.
11
+ *
12
+ * @param flag - the feature flag that will control whether or not the provided
13
+ * styled component is used
14
+ * @param defaultAs - the default component to use when `as` is not provided
15
+ * @param Component - the styled component that will be used if the feature flag
16
+ * is disabled
17
+ */
18
+ export declare function toggleStyledComponent<T, P extends CSSModulesProps>(flag: string, defaultAs: string | React.ComponentType<any>, Component: React.ComponentType<P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
19
+ export {};
20
+ //# sourceMappingURL=toggleStyledComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggleStyledComponent.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/toggleStyledComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,eAAe,GAAG;IAErB,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IACtC,EAAE,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CACzB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,EAChE,IAAI,EAAE,MAAM,EAEZ,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAC5C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,sFAiBlC"}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ItemContext } from './shared.js';
3
3
  import classes from './ActionList.module.css.js';
4
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
4
5
  import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
5
6
  import { clsx } from 'clsx';
6
7
  import { jsx } from 'react/jsx-runtime';
@@ -8,7 +9,7 @@ import Truncate from '../Truncate/Truncate.js';
8
9
 
9
10
  const Description = ({
10
11
  variant = 'inline',
11
- sx,
12
+ sx = defaultSxProp,
12
13
  className,
13
14
  truncate,
14
15
  ...props
@@ -1,5 +1,6 @@
1
1
  import { clsx } from 'clsx';
2
2
  import classes from './ActionList.module.css.js';
3
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
3
4
  import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
4
5
  import { jsx } from 'react/jsx-runtime';
5
6
 
@@ -7,7 +8,7 @@ import { jsx } from 'react/jsx-runtime';
7
8
  * Visually separates `Item`s or `Group`s in an `ActionList`.
8
9
  */
9
10
  const Divider = ({
10
- sx,
11
+ sx = defaultSxProp,
11
12
  className
12
13
  }) => {
13
14
  return /*#__PURE__*/jsx(BoxWithFallback, {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { useId } from '../hooks/useId.js';
3
3
  import { ListContext } from './shared.js';
4
4
  import { useSlots } from '../hooks/useSlots.js';
5
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
5
6
  import { invariant } from '../utils/invariant.js';
6
7
  import { clsx } from 'clsx';
7
8
  import classes from './ActionList.module.css.js';
@@ -13,6 +14,7 @@ const Heading = ({
13
14
  as: Component = 'h3',
14
15
  className,
15
16
  children,
17
+ sx = defaultSxProp,
16
18
  id,
17
19
  ...rest
18
20
  }) => {
@@ -22,6 +24,7 @@ const Heading = ({
22
24
  jsx(BoxWithFallback, {
23
25
  as: Component,
24
26
  className: className,
27
+ sx: sx,
25
28
  id: id,
26
29
  ...rest,
27
30
  children: children
@@ -52,6 +55,7 @@ const Group = ({
52
55
  role,
53
56
  className,
54
57
  'aria-label': ariaLabel,
58
+ sx = defaultSxProp,
55
59
  ...props
56
60
  }) => {
57
61
  var _slots$groupHeading;
@@ -78,6 +82,7 @@ const Group = ({
78
82
  as: "li",
79
83
  className: clsx(className, groupClasses.Group),
80
84
  role: listRole ? 'none' : undefined,
85
+ sx: sx,
81
86
  ...props,
82
87
  children: /*#__PURE__*/jsxs(GroupContext.Provider, {
83
88
  value: {
@@ -121,7 +126,7 @@ const GroupHeading = ({
121
126
  auxiliaryText,
122
127
  children,
123
128
  className,
124
- sx,
129
+ sx = defaultSxProp,
125
130
  headingWrapElement = 'div',
126
131
  ...props
127
132
  }) => {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useId } from '../hooks/useId.js';
3
3
  import { useSlots } from '../hooks/useSlots.js';
4
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
4
5
  import { ActionListContainerContext } from './ActionListContainerContext.js';
5
6
  import { Description } from './Description.js';
6
7
  import { GroupContext } from './Group.js';
@@ -54,7 +55,7 @@ const Item = /*#__PURE__*/React.forwardRef(({
54
55
  selected = undefined,
55
56
  active = false,
56
57
  onSelect: onSelectUser,
57
- sx: sxProp,
58
+ sx: sxProp = defaultSxProp,
58
59
  id,
59
60
  role,
60
61
  loading,
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { Item } from './Item.js';
3
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
3
4
  import { jsx } from 'react/jsx-runtime';
4
5
  import Link from '../Link/Link.js';
5
6
 
6
7
  const LinkItem = /*#__PURE__*/React.forwardRef(({
7
- sx,
8
+ sx = defaultSxProp,
8
9
  active,
9
10
  inactiveText,
10
11
  variant,
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ActionListContainerContext } from './ActionListContainerContext.js';
3
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
3
4
  import { useSlots } from '../hooks/useSlots.js';
4
5
  import { Heading } from './Heading.js';
5
6
  import { useId } from '../hooks/useId.js';
@@ -17,6 +18,7 @@ const List = /*#__PURE__*/React.forwardRef(({
17
18
  selectionVariant,
18
19
  showDividers = false,
19
20
  role,
21
+ sx: sxProp = defaultSxProp,
20
22
  disableFocusZone = false,
21
23
  className,
22
24
  ...props
@@ -56,6 +58,7 @@ const List = /*#__PURE__*/React.forwardRef(({
56
58
  },
57
59
  children: [slots.heading, /*#__PURE__*/jsx(BoxWithFallback, {
58
60
  as: "ul",
61
+ sx: sxProp,
59
62
  className: clsx(classes.ActionList, className),
60
63
  role: listRole,
61
64
  "aria-labelledby": ariaLabelledBy,
@@ -3,34 +3,40 @@ import { AlertIcon } from '@primer/octicons-react';
3
3
  import { ItemContext } from './shared.js';
4
4
  import { clsx } from 'clsx';
5
5
  import classes from './ActionList.module.css.js';
6
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
6
7
  import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
7
8
  import { jsx } from 'react/jsx-runtime';
8
9
  import { Tooltip } from '../TooltipV2/Tooltip.js';
9
10
  import StyledSpinner from '../Spinner/Spinner.js';
10
11
 
11
12
  const VisualContainer = ({
13
+ sx = defaultSxProp,
12
14
  className,
13
15
  ...props
14
16
  }) => {
15
17
  return /*#__PURE__*/jsx(BoxWithFallback, {
16
18
  as: "span",
17
19
  className: clsx(className, classes.VisualWrap),
20
+ sx: sx,
18
21
  ...props
19
22
  });
20
23
  };
21
24
  VisualContainer.displayName = "VisualContainer";
22
25
  const LeadingVisual = ({
26
+ sx = defaultSxProp,
23
27
  className,
24
28
  ...props
25
29
  }) => {
26
30
  return /*#__PURE__*/jsx(VisualContainer, {
27
31
  className: clsx(className, classes.LeadingVisual),
32
+ sx: sx,
28
33
  ...props,
29
34
  children: props.children
30
35
  });
31
36
  };
32
37
  LeadingVisual.displayName = "LeadingVisual";
33
38
  const TrailingVisual = ({
39
+ sx = defaultSxProp,
34
40
  className,
35
41
  ...props
36
42
  }) => {
@@ -39,6 +45,7 @@ const TrailingVisual = ({
39
45
  } = React.useContext(ItemContext);
40
46
  return /*#__PURE__*/jsx(VisualContainer, {
41
47
  className: clsx(className, classes.TrailingVisual),
48
+ sx: sx,
42
49
  id: trailingVisualId,
43
50
  ...props,
44
51
  children: props.children
@@ -2,6 +2,7 @@ import { c } from 'react-compiler-runtime';
2
2
  import { clsx } from 'clsx';
3
3
  import React from 'react';
4
4
  import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
5
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
5
6
  import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
6
7
  import classes from './Avatar.module.css.js';
7
8
  import { jsx } from 'react/jsx-runtime';
@@ -12,16 +13,16 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(t0, ref) {
12
13
  let className;
13
14
  let rest;
14
15
  let style;
15
- let sxProp;
16
16
  let t1;
17
17
  let t2;
18
18
  let t3;
19
+ let t4;
19
20
  if ($[0] !== t0) {
20
21
  ({
21
22
  alt: t1,
22
23
  size: t2,
23
24
  square: t3,
24
- sx: sxProp,
25
+ sx: t4,
25
26
  className,
26
27
  style,
27
28
  ...rest
@@ -30,31 +31,32 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(t0, ref) {
30
31
  $[1] = className;
31
32
  $[2] = rest;
32
33
  $[3] = style;
33
- $[4] = sxProp;
34
- $[5] = t1;
35
- $[6] = t2;
36
- $[7] = t3;
34
+ $[4] = t1;
35
+ $[5] = t2;
36
+ $[6] = t3;
37
+ $[7] = t4;
37
38
  } else {
38
39
  className = $[1];
39
40
  rest = $[2];
40
41
  style = $[3];
41
- sxProp = $[4];
42
- t1 = $[5];
43
- t2 = $[6];
44
- t3 = $[7];
42
+ t1 = $[4];
43
+ t2 = $[5];
44
+ t3 = $[6];
45
+ t4 = $[7];
45
46
  }
46
47
  const alt = t1 === undefined ? "" : t1;
47
48
  const size = t2 === undefined ? DEFAULT_AVATAR_SIZE : t2;
48
49
  const square = t3 === undefined ? false : t3;
49
- let t4;
50
+ const sxProp = t4 === undefined ? defaultSxProp : t4;
51
+ let t5;
50
52
  if ($[8] !== size) {
51
- t4 = isResponsiveValue(size);
53
+ t5 = isResponsiveValue(size);
52
54
  $[8] = size;
53
- $[9] = t4;
55
+ $[9] = t5;
54
56
  } else {
55
- t4 = $[9];
57
+ t5 = $[9];
56
58
  }
57
- const isResponsive = t4;
59
+ const isResponsive = t5;
58
60
  let cssSizeVars;
59
61
  if ($[10] !== isResponsive || $[11] !== size) {
60
62
  cssSizeVars = {};
@@ -71,43 +73,43 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(t0, ref) {
71
73
  } else {
72
74
  cssSizeVars = $[12];
73
75
  }
74
- let t5;
76
+ let t6;
75
77
  if ($[13] !== className) {
76
- t5 = clsx(className, classes.Avatar);
78
+ t6 = clsx(className, classes.Avatar);
77
79
  $[13] = className;
78
- $[14] = t5;
80
+ $[14] = t6;
79
81
  } else {
80
- t5 = $[14];
82
+ t6 = $[14];
81
83
  }
82
- const t6 = isResponsive ? "" : undefined;
83
- const t7 = square ? "" : undefined;
84
- const t8 = isResponsive ? undefined : size;
84
+ const t7 = isResponsive ? "" : undefined;
85
+ const t8 = square ? "" : undefined;
85
86
  const t9 = isResponsive ? undefined : size;
86
- let t10;
87
+ const t10 = isResponsive ? undefined : size;
88
+ let t11;
87
89
  if ($[15] !== cssSizeVars || $[16] !== style) {
88
- t10 = style ? {
90
+ t11 = style ? {
89
91
  ...cssSizeVars,
90
92
  ...style
91
93
  } : cssSizeVars;
92
94
  $[15] = cssSizeVars;
93
95
  $[16] = style;
94
- $[17] = t10;
96
+ $[17] = t11;
95
97
  } else {
96
- t10 = $[17];
98
+ t11 = $[17];
97
99
  }
98
- let t11;
99
- if ($[18] !== alt || $[19] !== ref || $[20] !== rest || $[21] !== sxProp || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
100
- t11 = /*#__PURE__*/jsx(BoxWithFallback, {
100
+ let t12;
101
+ if ($[18] !== alt || $[19] !== ref || $[20] !== rest || $[21] !== sxProp || $[22] !== t10 || $[23] !== t11 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
102
+ t12 = /*#__PURE__*/jsx(BoxWithFallback, {
101
103
  as: "img",
102
104
  "data-component": "Avatar",
103
- className: t5,
105
+ className: t6,
104
106
  ref: ref,
105
107
  alt: alt,
106
- "data-responsive": t6,
107
- "data-square": t7,
108
- width: t8,
109
- height: t9,
110
- style: t10,
108
+ "data-responsive": t7,
109
+ "data-square": t8,
110
+ width: t9,
111
+ height: t10,
112
+ style: t11,
111
113
  sx: sxProp,
112
114
  ...rest
113
115
  });
@@ -116,16 +118,16 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(t0, ref) {
116
118
  $[20] = rest;
117
119
  $[21] = sxProp;
118
120
  $[22] = t10;
119
- $[23] = t5;
121
+ $[23] = t11;
120
122
  $[24] = t6;
121
123
  $[25] = t7;
122
124
  $[26] = t8;
123
125
  $[27] = t9;
124
- $[28] = t11;
126
+ $[28] = t12;
125
127
  } else {
126
- t11 = $[28];
128
+ t12 = $[28];
127
129
  }
128
- return t11;
130
+ return t12;
129
131
  });
130
132
  if (process.env.NODE_ENV !== "production") {
131
133
  Avatar.displayName = 'Avatar';
@@ -1,9 +1,9 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import React from 'react';
3
+ import { SkeletonAvatar } from '../experimental/Skeleton/SkeletonAvatar.js';
3
4
  import classes from './AvatarPair.module.css.js';
4
5
  import { clsx } from 'clsx';
5
6
  import { jsx } from 'react/jsx-runtime';
6
- import { SkeletonAvatar } from '../SkeletonAvatar/SkeletonAvatar.js';
7
7
  import Avatar from '../Avatar/Avatar.js';
8
8
 
9
9
  const AvatarPair = t0 => {
@@ -9,6 +9,6 @@ export type AvatarStackProps = {
9
9
  children: React.ReactNode;
10
10
  style?: React.CSSProperties;
11
11
  } & SxProp;
12
- declare const AvatarStack: ({ children, alignRight, disableExpand, size, className, style, sx: sxProp }: AvatarStackProps) => React.JSX.Element;
12
+ declare const AvatarStack: ({ children, alignRight, disableExpand, size, className, style, sx: sxProp, }: AvatarStackProps) => React.JSX.Element;
13
13
  export default AvatarStack;
14
14
  //# sourceMappingURL=AvatarStack.d.ts.map
@@ -2,6 +2,7 @@ import { clsx } from 'clsx';
2
2
  import React, { useState, useRef, useEffect } from 'react';
3
3
  import { DEFAULT_AVATAR_SIZE } from '../Avatar/Avatar.js';
4
4
  import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
5
+ import { defaultSxProp } from '../utils/defaultSxProp.js';
5
6
  import classes from './AvatarStack.module.css.js';
6
7
  import { hasInteractiveNodes } from '../internal/utils/hasInteractiveNodes.js';
7
8
  import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
@@ -40,7 +41,7 @@ const AvatarStack = ({
40
41
  size,
41
42
  className,
42
43
  style,
43
- sx: sxProp
44
+ sx: sxProp = defaultSxProp
44
45
  }) => {
45
46
  const [hasInteractiveChildren, setHasInteractiveChildren] = useState(false);
46
47
  const stackContainer = useRef(null);