@primer/react 0.0.0-20260506211456 → 0.0.0-20260506232002

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 (53) hide show
  1. package/CHANGELOG.md +11 -7
  2. package/dist/ActionBar/ActionBar-a41224b2.css +2 -0
  3. package/dist/ActionBar/ActionBar-a41224b2.css.map +1 -0
  4. package/dist/ActionBar/ActionBar.d.ts +1 -1
  5. package/dist/ActionBar/ActionBar.d.ts.map +1 -1
  6. package/dist/ActionBar/ActionBar.js +379 -292
  7. package/dist/ActionBar/ActionBar.module.css.js +2 -2
  8. package/dist/ActionBar/index.d.ts +1 -1
  9. package/dist/ActionList/LinkItem.d.ts +1 -1
  10. package/dist/ActionList/index.d.ts +2 -2
  11. package/dist/AnchoredOverlay/{AnchoredOverlay-ec9e15fc.css → AnchoredOverlay-0c26c5f8.css} +2 -2
  12. package/dist/AnchoredOverlay/AnchoredOverlay-0c26c5f8.css.map +1 -0
  13. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  14. package/dist/AnchoredOverlay/AnchoredOverlay.js +25 -62
  15. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -1
  16. package/dist/Autocomplete/Autocomplete.d.ts +1 -1
  17. package/dist/Blankslate/Blankslate.d.ts.map +1 -1
  18. package/dist/Blankslate/Blankslate.js +6 -0
  19. package/dist/BranchName/BranchName.js +1 -0
  20. package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  21. package/dist/Breadcrumbs/Breadcrumbs.js +3 -0
  22. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  23. package/dist/ButtonGroup/ButtonGroup.js +1 -0
  24. package/dist/Checkbox/Checkbox.d.ts +1 -0
  25. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  26. package/dist/Checkbox/Checkbox.js +10 -5
  27. package/dist/CheckboxGroup/CheckboxGroup.js +1 -0
  28. package/dist/CircleBadge/CircleBadge.d.ts.map +1 -1
  29. package/dist/CircleBadge/CircleBadge.js +44 -28
  30. package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
  31. package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -0
  32. package/dist/CounterLabel/CounterLabel.d.ts +2 -0
  33. package/dist/CounterLabel/CounterLabel.d.ts.map +1 -1
  34. package/dist/CounterLabel/CounterLabel.js +25 -90
  35. package/dist/DataTable/sorting.d.ts +1 -1
  36. package/dist/Dialog/Dialog.d.ts +1 -0
  37. package/dist/Dialog/Dialog.d.ts.map +1 -1
  38. package/dist/Dialog/Dialog.js +17 -6
  39. package/dist/TextInput/TextInput.d.ts +1 -1
  40. package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +3 -3
  41. package/dist/experimental/SelectPanel2/mock-story-data.d.ts +3 -3
  42. package/dist/hooks/useSyncedState.d.ts +1 -1
  43. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +1 -1
  44. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
  45. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +3 -1
  46. package/dist/internal/components/TextInputInnerAction.d.ts +1 -1
  47. package/dist/theme.d.ts +1 -1
  48. package/dist/utils/useIsomorphicLayoutEffect.d.ts +2 -2
  49. package/dist/utils/useIsomorphicLayoutEffect.d.ts.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/ActionBar/ActionBar-3f7b52a3.css +0 -2
  52. package/dist/ActionBar/ActionBar-3f7b52a3.css.map +0 -1
  53. package/dist/AnchoredOverlay/AnchoredOverlay-ec9e15fc.css.map +0 -1
@@ -1,100 +1,35 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import { clsx } from 'clsx';
3
2
  import { forwardRef } from 'react';
4
3
  import classes from './CounterLabel.module.css.js';
5
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
5
  import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
7
6
 
8
- const CounterLabel = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
9
- const $ = c(21);
10
- let children;
11
- let className;
12
- let rest;
13
- let scheme;
14
- let variant;
15
- if ($[0] !== t0) {
16
- ({
17
- variant,
18
- scheme,
19
- className,
20
- children,
21
- ...rest
22
- } = t0);
23
- $[0] = t0;
24
- $[1] = children;
25
- $[2] = className;
26
- $[3] = rest;
27
- $[4] = scheme;
28
- $[5] = variant;
29
- } else {
30
- children = $[1];
31
- className = $[2];
32
- rest = $[3];
33
- scheme = $[4];
34
- variant = $[5];
35
- }
36
- let t1;
37
- if ($[6] !== children) {
38
- t1 = /*#__PURE__*/jsxs(VisuallyHidden, {
39
- children: ["\xA0(", children, ")"]
40
- });
41
- $[6] = children;
42
- $[7] = t1;
43
- } else {
44
- t1 = $[7];
45
- }
46
- const label = t1;
47
- const inferredVariant = variant || scheme || "secondary";
48
- let t2;
49
- if ($[8] !== forwardedRef || $[9] !== inferredVariant || $[10] !== rest) {
50
- t2 = {
51
- ref: forwardedRef,
52
- "aria-hidden": "true",
53
- "data-variant": inferredVariant,
54
- ...rest
55
- };
56
- $[8] = forwardedRef;
57
- $[9] = inferredVariant;
58
- $[10] = rest;
59
- $[11] = t2;
60
- } else {
61
- t2 = $[11];
62
- }
63
- const counterProps = t2;
64
- let t3;
65
- if ($[12] !== className) {
66
- t3 = clsx(className, classes.CounterLabel);
67
- $[12] = className;
68
- $[13] = t3;
69
- } else {
70
- t3 = $[13];
71
- }
72
- let t4;
73
- if ($[14] !== children || $[15] !== counterProps || $[16] !== t3) {
74
- t4 = /*#__PURE__*/jsx("span", {
7
+ const CounterLabel = /*#__PURE__*/forwardRef(({
8
+ variant,
9
+ scheme,
10
+ className,
11
+ children,
12
+ ['data-component']: dataComponent,
13
+ ...rest
14
+ }, forwardedRef) => {
15
+ const label = /*#__PURE__*/jsxs(VisuallyHidden, {
16
+ children: ["\xA0(", children, ")"]
17
+ });
18
+ const inferredVariant = variant || scheme || 'secondary';
19
+ const counterProps = {
20
+ ref: forwardedRef,
21
+ ['aria-hidden']: 'true',
22
+ ['data-variant']: inferredVariant,
23
+ ...rest
24
+ };
25
+ return /*#__PURE__*/jsxs(Fragment, {
26
+ children: [/*#__PURE__*/jsx("span", {
75
27
  ...counterProps,
76
- className: t3,
28
+ "data-component": dataComponent !== null && dataComponent !== void 0 ? dataComponent : 'CounterLabel',
29
+ className: clsx(className, classes.CounterLabel),
77
30
  children: children
78
- });
79
- $[14] = children;
80
- $[15] = counterProps;
81
- $[16] = t3;
82
- $[17] = t4;
83
- } else {
84
- t4 = $[17];
85
- }
86
- let t5;
87
- if ($[18] !== label || $[19] !== t4) {
88
- t5 = /*#__PURE__*/jsxs(Fragment, {
89
- children: [t4, label]
90
- });
91
- $[18] = label;
92
- $[19] = t4;
93
- $[20] = t5;
94
- } else {
95
- t5 = $[20];
96
- }
97
- return t5;
31
+ }), label]
32
+ });
98
33
  });
99
34
  CounterLabel.displayName = 'CounterLabel';
100
35
 
@@ -7,7 +7,7 @@ export declare function transition(direction: Exclude<SortDirection, 'NONE'>): E
7
7
  /**
8
8
  * A sort strategy for comparing any two values
9
9
  */
10
- export declare function basic<T>(a: T, b: T): 1 | 0 | -1;
10
+ export declare function basic<T>(a: T, b: T): -1 | 0 | 1;
11
11
  /**
12
12
  * A sort strategy for comparing two `Date` values. Also includes support for
13
13
  * values from `Date.now()`
@@ -30,6 +30,7 @@ export type DialogButtonProps = Omit<ButtonProps, 'content'> & {
30
30
  * Props to customize the rendering of the Dialog.
31
31
  */
32
32
  export interface DialogProps {
33
+ 'data-component'?: string;
33
34
  /**
34
35
  * Title of the Dialog. Also serves as the aria-label for this Dialog.
35
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAA;AA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O,MAAM,MAAM;;;;;;;;;;iBAzEuC,iBAAiB,EAAE;;;iBAmCf,MAAM,IAAI;;CA+CtE,CAAA"}
@@ -33,6 +33,7 @@ const DefaultHeader = ({
33
33
  className: classes.HeaderInner,
34
34
  children: [/*#__PURE__*/jsxs("div", {
35
35
  className: classes.HeaderContent,
36
+ "data-component": "Dialog.Header.Content",
36
37
  children: [/*#__PURE__*/jsx(Dialog.Title, {
37
38
  id: dialogLabelId,
38
39
  children: title !== null && title !== void 0 ? title : 'Dialog'
@@ -85,6 +86,7 @@ const DIALOG_CONTEXT_VALUE = Object.freeze({});
85
86
  const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
86
87
  var _slots$header, _slots$body, _slots$footer;
87
88
  const {
89
+ 'data-component': dataComponentProp,
88
90
  title = 'Dialog',
89
91
  subtitle = '',
90
92
  renderHeader,
@@ -192,6 +194,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
192
194
  } : Object.fromEntries(Object.entries(position).map(([key, value]) => {
193
195
  return [`data-position-${key}`, value];
194
196
  }));
197
+ const dataComponent = dataComponentProp !== null && dataComponentProp !== void 0 ? dataComponentProp : 'Dialog';
195
198
  return /*#__PURE__*/jsx(DialogContext.Provider, {
196
199
  value: DIALOG_CONTEXT_VALUE,
197
200
  children: /*#__PURE__*/jsx(Portal, {
@@ -222,9 +225,11 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
222
225
  "data-footer-button-layout": hasFooter ? footerButtonLayout : undefined,
223
226
  className: clsx(className, classes.Dialog),
224
227
  style: style,
228
+ "data-component": dataComponent,
225
229
  children: [header, /*#__PURE__*/jsx(ScrollableRegion, {
226
230
  "aria-labelledby": dialogLabelId,
227
231
  className: classes.DialogOverflowWrapper,
232
+ "data-component": "Dialog.OverflowWrapper",
228
233
  children: body
229
234
  }), footer]
230
235
  })
@@ -240,7 +245,8 @@ const Header = /*#__PURE__*/React.forwardRef(function Header({
240
245
  return /*#__PURE__*/jsx("div", {
241
246
  ref: forwardRef,
242
247
  className: clsx(className, classes.Header),
243
- ...rest
248
+ ...rest,
249
+ "data-component": "Dialog.Header"
244
250
  });
245
251
  });
246
252
  Header.displayName = 'Dialog.Header';
@@ -251,7 +257,8 @@ const Title = /*#__PURE__*/React.forwardRef(function Title({
251
257
  return /*#__PURE__*/jsx("h1", {
252
258
  ref: forwardRef,
253
259
  className: clsx(className, classes.Title),
254
- ...rest
260
+ ...rest,
261
+ "data-component": "Dialog.Title"
255
262
  });
256
263
  });
257
264
  Title.displayName = 'Dialog.Title';
@@ -262,7 +269,8 @@ const Subtitle = /*#__PURE__*/React.forwardRef(function Subtitle({
262
269
  return /*#__PURE__*/jsx("h2", {
263
270
  ref: forwardRef,
264
271
  className: clsx(className, classes.Subtitle),
265
- ...rest
272
+ ...rest,
273
+ "data-component": "Dialog.Subtitle"
266
274
  });
267
275
  });
268
276
  Subtitle.displayName = 'Dialog.Subtitle';
@@ -273,7 +281,8 @@ const Body = /*#__PURE__*/React.forwardRef(function Body({
273
281
  return /*#__PURE__*/jsx("div", {
274
282
  ref: forwardRef,
275
283
  className: clsx(className, classes.Body),
276
- ...rest
284
+ ...rest,
285
+ "data-component": "Dialog.Body"
277
286
  });
278
287
  });
279
288
  Body.displayName = 'Dialog.Body';
@@ -284,7 +293,8 @@ const Footer = /*#__PURE__*/React.forwardRef(function Footer({
284
293
  return /*#__PURE__*/jsx("div", {
285
294
  ref: forwardRef,
286
295
  className: clsx(className, classes.Footer),
287
- ...rest
296
+ ...rest,
297
+ "data-component": "Dialog.Footer"
288
298
  });
289
299
  });
290
300
  Footer.displayName = 'Dialog.Footer';
@@ -332,7 +342,8 @@ const CloseButton = ({
332
342
  icon: XIcon,
333
343
  "aria-label": "Close",
334
344
  onClick: onClose,
335
- variant: "invisible"
345
+ variant: "invisible",
346
+ "data-component": "Dialog.CloseButton"
336
347
  });
337
348
  };
338
349
  CloseButton.displayName = "CloseButton";
@@ -37,7 +37,7 @@ export type TextInputNonPassthroughProps = {
37
37
  export type TextInputProps = Merge<React.ComponentPropsWithoutRef<'input'>, TextInputNonPassthroughProps>;
38
38
  declare const _default: PolymorphicForwardRefComponent<"input", TextInputProps> & {
39
39
  __SLOT__: symbol;
40
- Action: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size" | "aria-label" | "tooltipDirection"> & {
40
+ Action: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "size" | "tooltipDirection"> & {
41
41
  children?: React.ReactNode;
42
42
  "aria-label"?: string;
43
43
  tooltipDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
@@ -48,11 +48,11 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<{
48
48
  * The array of tokens to render
49
49
  */
50
50
  tokens: any[] | (Omit<(Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
51
- ref?: ((instance: HTMLAnchorElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLAnchorElement> | null | undefined;
51
+ ref?: RefObject<HTMLAnchorElement> | ((instance: HTMLAnchorElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
52
52
  }) | (Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
53
- ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLButtonElement> | null | undefined;
53
+ ref?: RefObject<HTMLButtonElement> | ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
54
54
  }) | (Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
55
- ref?: ((instance: HTMLSpanElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLSpanElement> | null | undefined;
55
+ ref?: RefObject<HTMLSpanElement> | ((instance: HTMLSpanElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
56
56
  }), keyof import("..").TokenProps> & import("..").TokenProps & {
57
57
  as?: "a" | "button" | "span" | undefined;
58
58
  })[];
@@ -10,10 +10,10 @@ declare const data: {
10
10
  login: string;
11
11
  recommended: boolean;
12
12
  } | {
13
+ recommended?: undefined;
13
14
  id: string;
14
15
  name: string;
15
16
  login: string;
16
- recommended?: undefined;
17
17
  })[];
18
18
  labels: ({
19
19
  color: string;
@@ -38,18 +38,18 @@ declare const data: {
38
38
  name: string;
39
39
  trailingInfo: string;
40
40
  } | {
41
+ trailingInfo?: undefined;
41
42
  id: string;
42
43
  name: string;
43
- trailingInfo?: undefined;
44
44
  })[];
45
45
  tags: ({
46
46
  id: string;
47
47
  name: string;
48
48
  trailingInfo: string;
49
49
  } | {
50
+ trailingInfo?: undefined;
50
51
  id: string;
51
52
  name: string;
52
- trailingInfo?: undefined;
53
53
  })[];
54
54
  repos: {
55
55
  org: string;
@@ -9,7 +9,7 @@
9
9
  * This is adapted almost directly from https://beta.reactjs.org/learn/you-might-not-need-an-effect#adjusting-some-state-when-a-prop-changes
10
10
  */
11
11
  export declare const useSyncedState: <T>(initialValue: T | (() => T), { isPropUpdateDisabled, isEqual }?: {
12
- isPropUpdateDisabled?: boolean | undefined;
13
12
  isEqual?: ((value1: any, value2: any) => boolean) | undefined;
13
+ isPropUpdateDisabled?: boolean | undefined;
14
14
  }) => readonly [T, import("react").Dispatch<import("react").SetStateAction<T>>];
15
15
  //# sourceMappingURL=useSyncedState.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type CheckboxOrRadioGroupProps = {
2
+ export type CheckboxOrRadioGroupProps = Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
3
3
  /** Class name for custom styling */
4
4
  className?: string;
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxOrRadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,MAAM,yBAAyB,GAAG;IACtC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAyHD,YAAY,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAA;;;;;;;;;;AAC/E,wBAIE"}
1
+ {"version":3,"file":"CheckboxOrRadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,GAAG;IAC5F,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AA2HD,YAAY,EAAC,8BAA8B,EAAC,MAAM,6BAA6B,CAAA;;;;;;;;;;AAC/E,wBAIE"}
@@ -18,7 +18,8 @@ const CheckboxOrRadioGroup = ({
18
18
  disabled = false,
19
19
  id: idProp,
20
20
  required = false,
21
- className
21
+ className,
22
+ ...restProps
22
23
  }) => {
23
24
  const [slots, rest] = useSlots(children, {
24
25
  caption: CheckboxOrRadioGroupCaption,
@@ -47,6 +48,7 @@ const CheckboxOrRadioGroup = ({
47
48
  },
48
49
  children: /*#__PURE__*/jsxs("div", {
49
50
  children: [/*#__PURE__*/jsxs(Component, {
51
+ ...restProps,
50
52
  className: clsx(className, classes.GroupFieldset),
51
53
  "data-validation": validationChild ? '' : undefined,
52
54
  ...(labelChild ? {
@@ -16,7 +16,7 @@ export type TextInputActionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonEle
16
16
  */
17
17
  variant?: ButtonProps['variant'];
18
18
  };
19
- declare const TextInputAction: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size" | "aria-label" | "tooltipDirection"> & {
19
+ declare const TextInputAction: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "size" | "tooltipDirection"> & {
20
20
  /** @deprecated Text input action buttons should only use icon buttons */
21
21
  children?: React.ReactNode;
22
22
  /** Text that appears in a tooltip. If an icon is passed, this is also used as the label used by assistive technologies. */
package/dist/theme.d.ts CHANGED
@@ -29,7 +29,7 @@ declare const theme: {
29
29
  xlarge: string;
30
30
  };
31
31
  space: string[];
32
- colorSchemes: Record<"light" | "light_high_contrast" | "light_colorblind" | "light_tritanopia" | "dark" | "dark_dimmed" | "dark_high_contrast" | "dark_colorblind" | "dark_tritanopia", {
32
+ colorSchemes: Record<"dark" | "dark_colorblind" | "dark_dimmed" | "dark_high_contrast" | "dark_tritanopia" | "light" | "light_colorblind" | "light_high_contrast" | "light_tritanopia", {
33
33
  colors: Partial<{
34
34
  colors: {
35
35
  canvasDefaultTransparent: string;
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
2
- declare const useIsomorphicLayoutEffect: typeof useEffect;
1
+ import { useLayoutEffect } from 'react';
2
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
3
3
  export default useIsomorphicLayoutEffect;
4
4
  //# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/utils/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAkB,MAAM,OAAO,CAAA;AAEhD,QAAA,MAAM,yBAAyB,kBAOhB,CAAA;AAEf,eAAe,yBAAyB,CAAA"}
1
+ {"version":3,"file":"useIsomorphicLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/utils/useIsomorphicLayoutEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,eAAe,EAAC,MAAM,OAAO,CAAA;AAEhD,QAAA,MAAM,yBAAyB,wBAOhB,CAAA;AAEf,eAAe,yBAAyB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260506211456",
4
+ "version": "0.0.0-20260506232002",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -178,7 +178,7 @@
178
178
  "ts-toolbelt": "9.6.0",
179
179
  "tsx": "4.20.3",
180
180
  "typed-css-modules": "^0.9.1",
181
- "typescript": "^5.9.2",
181
+ "typescript": "^6.0.3",
182
182
  "typescript-plugin-css-modules": "^5.2.0",
183
183
  "unist-util-find": "3.0.0",
184
184
  "unist-util-find-before": "4.0.0",
@@ -1,2 +0,0 @@
1
- .prc-ActionBar-List-9uz46{align-items:flex-start;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));height:var(--actionbar-height,var(--control-small-size,1.75rem));list-style:none;margin-bottom:-1px;min-width:0;overflow:hidden;position:relative}.prc-ActionBar-List-9uz46:not([data-has-overflow]){animation:prc-ActionBar-detect-overflow-mAuJu linear;animation-timeline:scroll(self block)}.prc-ActionBar-List-9uz46[data-has-overflow=true]{--morebutton-display:flex}.prc-ActionBar-List-9uz46:where([data-size=small]){--actionbar-height:var(--control-small-size,1.75rem)}.prc-ActionBar-List-9uz46:where([data-size=medium]){--actionbar-height:var(--control-medium-size,2rem)}.prc-ActionBar-List-9uz46:where([data-size=large]){--actionbar-height:var(--control-large-size,2.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=none]){--actionbar-gap:0}.prc-ActionBar-List-9uz46:where([data-gap=none]) .prc-ActionBar-Divider-6V8yH{padding:0 var(--base-size-8,.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=condensed]){--actionbar-gap:var(--stack-gap-condensed,0.5rem)}.prc-ActionBar-List-9uz46 [data-overflowing]{visibility:hidden!important}@keyframes prc-ActionBar-detect-overflow-mAuJu{0%,to{--morebutton-display:flex}}.prc-ActionBar-Nav-9spON{align-items:center;display:flex;justify-content:flex-end;padding-inline:var(--base-size-16,1rem)}.prc-ActionBar-Nav-9spON:where([data-flush=true]){padding-inline:0}.prc-ActionBar-Divider-6V8yH:before{background:var(--borderColor-muted,#d1d9e0b3);content:"";display:block;height:var(--base-size-20,1.25rem);margin-top:calc((var(--actionbar-height) - var(--base-size-20,1.25rem))/2);width:var(--borderWidth-thin,.0625rem)}.prc-ActionBar-Group-peNCk,.prc-ActionBar-OverflowContainer-AkYZs{display:flex;gap:inherit}.prc-ActionBar-OverflowContainer-AkYZs{flex-wrap:wrap;justify-content:flex-end;overflow:hidden}.prc-ActionBar-MoreButton-RHqpx{display:var(--morebutton-display,none)}
2
- /*# sourceMappingURL=ActionBar-3f7b52a3.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BASE,sBAAuB,CAPvB,YAAa,CAQb,yDAAqD,CAGrD,gEAA0D,CAL1D,eAAgB,CADhB,kBAAmB,CAJnB,WAAY,CAQZ,eAAgB,CAVhB,iBA2DF,CA5CE,mDAIE,oDAAiC,CACjC,qCACF,CAGA,kDACE,yBACF,CAEA,mDACE,oDACF,CAEA,oDACE,kDACF,CAEA,mDACE,mDACF,CAGA,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAEA,6CAIE,2BACF,CAGF,+CACE,MAEE,yBACF,CACF,CAEA,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6CAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WASF,CANA,uCAEE,cAAe,CAEf,wBAAyB,CACzB,eACF,CAEA,gCACE,sCACF","file":"ActionBar-3f7b52a3.css","sourcesContent":[".List {\n position: relative;\n display: flex;\n min-width: 0;\n\n /* wonder why this is here */\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n list-style: none;\n align-items: flex-start;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\n overflow: hidden;\n /* Explicit height is required to clip wrapped items */\n height: var(--actionbar-height, var(--control-small-size));\n\n /* Only apply scroll animation before overflow is calculated (for SSR/initial render) */\n &:not([data-has-overflow]) {\n /* Scroll-based animations have no effect unless the container is scrollable (has overflow, even with overflow:hidden)\n so we can use them to detect overflow. It would be cleaner to use scroll-state container queries for this, but\n browser support for scroll-driven animations is slightly better. */\n animation: detect-overflow linear;\n animation-timeline: scroll(self block);\n }\n\n /* After initial render, JS is used to control visibility which provides progressive enhancement for unsupported browsers */\n &[data-has-overflow='true'] {\n --morebutton-display: flex;\n }\n\n &:where([data-size='small']) {\n --actionbar-height: var(--control-small-size);\n }\n\n &:where([data-size='medium']) {\n --actionbar-height: var(--control-medium-size);\n }\n\n &:where([data-size='large']) {\n --actionbar-height: var(--control-large-size);\n }\n\n /* Gap scale (mirrors Stack) */\n &:where([data-gap='none']) {\n --actionbar-gap: 0;\n\n .Divider {\n padding: 0 var(--base-size-8);\n }\n }\n\n &:where([data-gap='condensed']) {\n --actionbar-gap: var(--stack-gap-condensed);\n }\n\n & [data-overflowing] {\n /* Hide overflowing items. Even though they are clipped by `overflow: hidden`, setting `visibility: hidden` ensures\n they can't accidentally be shown and also hides them from screen readers / keyboard nav. `!important` prevents\n consumers from unintentionally overriding this and breaking accessibility. */\n visibility: hidden !important;\n }\n}\n\n@keyframes detect-overflow {\n 0%,\n 100% {\n --morebutton-display: flex;\n }\n}\n\n.Nav {\n display: flex;\n padding-inline: var(--base-size-16);\n justify-content: flex-end;\n align-items: center;\n\n &:where([data-flush='true']) {\n padding-inline: 0;\n }\n}\n\n.Divider {\n &::before {\n display: block;\n width: var(--borderWidth-thin);\n height: var(--base-size-20);\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background: var(--borderColor-muted);\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc((var(--actionbar-height) - var(--base-size-20)) / 2);\n }\n}\n\n.Group {\n display: flex;\n gap: inherit;\n}\n\n.OverflowContainer {\n display: flex;\n flex-wrap: wrap;\n gap: inherit;\n justify-content: flex-end;\n overflow: hidden;\n}\n\n.MoreButton {\n display: var(--morebutton-display, none);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/AnchoredOverlay/AnchoredOverlay.module.css.js"],"names":[],"mappings":"AAAA,0DACE,iBACF,CAEA,iDAIE,YAAa,CAHb,iBAAkB,CAElB,8BAAyB,CADzB,4BAOF,CAHE,mDANF,iDAOI,mBAEJ,CADE,CAGF,2CACE,oEAGwB,CACxB,mCAAoC,CAEpC,wBAA0B,CAD1B,WAsDF,CAnDE,oDAIE,QAAS,CAHT,UAAW,CACX,QAAS,CAGT,cAAe,CAFf,SAGF,CAEA,qEAGE,iBAAkB,CADlB,oDAOF,CAJE,sFACE,SAAU,CACV,sEACF,CAGF,kEAEE,kBAAmB,CACnB,iBAAkB,CAFlB,uCAQF,CAJE,mFACE,SAAU,CACV,mBACF,CAGF,mEAWE,sCAAgC,CAVhC,kBAAmB,CASnB,oDAAsD,CAEtD,iFACF,CAEA,oEACE,kBAAmB,CAEnB,qCAA+B,CAD/B,oDAAsD,CAEtD,kFACF,CAGF,uCAGE,QAAS,CAFT,mBAAoB,CACpB,oDAA8C,CAE9C,UACF,CAEA,wCACE,iBAAkB,CAElB,QAAS,CADT,oDAA8C,CAE9C,UACF","file":"AnchoredOverlay-ec9e15fc.css","sourcesContent":[".ResponsiveCloseButtonContainer {\n position: relative;\n}\n\n.ResponsiveCloseButton {\n position: absolute;\n top: var(--base-size-8);\n right: var(--base-size-8);\n display: none;\n\n @media screen and (--viewportRange-narrow) {\n display: inline-grid;\n }\n}\n\n.AnchoredOverlay {\n position-try-fallbacks:\n flip-block,\n flip-inline,\n flip-block flip-inline;\n position-visibility: anchors-visible;\n z-index: 100;\n position: fixed !important;\n\n &[popover] {\n inset: auto;\n margin: 0;\n padding: 0;\n border: 0;\n max-width: none;\n }\n\n &[data-side='outside-bottom'] {\n /* stylelint-disable primer/spacing */\n top: calc(anchor(bottom) + var(--base-size-4));\n left: anchor(left);\n\n &[data-align='left'] {\n left: auto;\n right: calc(anchor(right) - var(--anchored-overlay-anchor-offset-left));\n }\n }\n\n &[data-side='outside-top'] {\n margin-bottom: var(--base-size-4);\n bottom: anchor(top);\n left: anchor(left);\n\n &[data-align='left'] {\n left: auto;\n right: anchor(right);\n }\n }\n\n &[data-side='outside-left'] {\n right: anchor(left);\n /* Falls back to `anchor(top)` when JS hasn't overridden it. JS sets the\n override when the overlay's bottom would overflow the viewport so we\n can lift it up to keep the bottom edge on screen, mirroring the JS\n anchored-positioning code path.\n\n This override only applies when CSS cannot find space using the default position -\n or any of its defined fallbacks.\n */\n top: var(--anchored-overlay-top-override, anchor(top));\n margin-right: var(--base-size-4);\n position-try-fallbacks: flip-inline, flip-block, flip-start, --outside-left-to-bottom;\n }\n\n &[data-side='outside-right'] {\n left: anchor(right);\n top: var(--anchored-overlay-top-override, anchor(top));\n margin-left: var(--base-size-4);\n position-try-fallbacks: flip-inline, flip-block, flip-start, --outside-right-to-bottom;\n }\n}\n\n@position-try --outside-left-to-bottom {\n right: anchor(right);\n top: calc(anchor(bottom) + var(--base-size-4));\n margin: 0;\n width: auto;\n}\n\n@position-try --outside-right-to-bottom {\n left: anchor(left);\n top: calc(anchor(bottom) + var(--base-size-4));\n margin: 0;\n width: auto;\n}\n"]}