@primer/react 0.0.0-20260408164838 → 0.0.0-20260408181349

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 (42) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/ActionList/List.d.ts.map +1 -1
  3. package/dist/ActionList/List.js +41 -41
  4. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  5. package/dist/AnchoredOverlay/AnchoredOverlay.js +13 -3
  6. package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
  7. package/dist/ButtonGroup/ButtonGroup.js +23 -23
  8. package/dist/Card/Card-65d85331.css +2 -0
  9. package/dist/Card/Card-65d85331.css.map +1 -0
  10. package/dist/Card/Card.d.ts +96 -0
  11. package/dist/Card/Card.d.ts.map +1 -0
  12. package/dist/Card/Card.js +485 -0
  13. package/dist/Card/Card.module.css.js +5 -0
  14. package/dist/Card/index.d.ts +31 -0
  15. package/dist/Card/index.d.ts.map +1 -0
  16. package/dist/Card/index.js +12 -0
  17. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  18. package/dist/Checkbox/Checkbox.js +5 -5
  19. package/dist/Dialog/Dialog.d.ts.map +1 -1
  20. package/dist/Dialog/Dialog.js +7 -5
  21. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  22. package/dist/FilteredActionList/FilteredActionList.js +8 -8
  23. package/dist/PageHeader/PageHeader.d.ts.map +1 -1
  24. package/dist/PageHeader/PageHeader.js +31 -30
  25. package/dist/TextInput/TextInput.d.ts.map +1 -1
  26. package/dist/TextInput/TextInput.js +6 -5
  27. package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
  28. package/dist/TooltipV2/Tooltip.js +4 -4
  29. package/dist/experimental/Tabs/Tabs.d.ts +1 -1
  30. package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
  31. package/dist/experimental/Tabs/Tabs.js +16 -16
  32. package/dist/experimental/index.d.ts +2 -0
  33. package/dist/experimental/index.d.ts.map +1 -1
  34. package/dist/experimental/index.js +1 -0
  35. package/dist/hooks/useMergedRefs.d.ts +1 -1
  36. package/dist/hooks/useMergedRefs.d.ts.map +1 -1
  37. package/dist/hooks/useMergedRefs.js +1 -7
  38. package/dist/hooks/useProvidedRefOrCreate.d.ts +10 -7
  39. package/dist/hooks/useProvidedRefOrCreate.d.ts.map +1 -1
  40. package/dist/hooks/useProvidedRefOrCreate.js +10 -10
  41. package/generated/components.json +91 -0
  42. package/package.json +1 -1
@@ -4,6 +4,7 @@ import { useCallback, useRef, useState, useEffect, useMemo, forwardRef } from 'r
4
4
  import { ActionList } from '../ActionList/index.js';
5
5
  import { useFocusZone } from '../hooks/useFocusZone.js';
6
6
  import { useId } from '../hooks/useId.js';
7
+ import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
7
8
  import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
8
9
  import useScrollFlash from '../hooks/useScrollFlash.js';
9
10
  import { FilteredActionListLoadingTypes, FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
@@ -14,7 +15,6 @@ import { useAnnouncements } from './useAnnouncements.js';
14
15
  import { clsx } from 'clsx';
15
16
  import { useVirtualizer } from '@tanstack/react-virtual';
16
17
  import { jsxs, jsx } from 'react/jsx-runtime';
17
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
18
18
  import TextInput from '../TextInput/TextInput.js';
19
19
  import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
20
20
  import Checkbox from '../Checkbox/Checkbox.js';
@@ -73,10 +73,8 @@ function FilteredActionList({
73
73
  }, [onFilterChange, setInternalFilterValue]);
74
74
  const inputAndListContainerRef = useRef(null);
75
75
  const listRef = useRef(null);
76
- const scrollContainerRef = useRef(null);
77
- const combinedScrollContainerRef = useMergedRefs(scrollContainerRef, providedScrollContainerRef);
78
- const inputRef = useRef(null);
79
- const combinedInputRef = useMergedRefs(inputRef, providedInputRef);
76
+ const scrollContainerRef = useProvidedRefOrCreate(providedScrollContainerRef);
77
+ const inputRef = useProvidedRefOrCreate(providedInputRef);
80
78
  const usingRovingTabindex = _PrivateFocusManagement === 'roving-tabindex';
81
79
  const [listContainerElement, setListContainerElement] = useState(null);
82
80
  const activeDescendantRef = useRef();
@@ -389,8 +387,10 @@ function FilteredActionList({
389
387
  "data-testid": "filtered-action-list",
390
388
  children: [/*#__PURE__*/jsx("div", {
391
389
  className: classes.Header,
392
- children: /*#__PURE__*/jsx(TextInput, {
393
- ref: combinedInputRef,
390
+ children: /*#__PURE__*/jsx(TextInput
391
+ // @ts-expect-error it needs a non nullable ref
392
+ , {
393
+ ref: inputRef,
394
394
  block: true,
395
395
  width: "auto",
396
396
  color: "fg.default",
@@ -429,7 +429,7 @@ function FilteredActionList({
429
429
  children: selectAllLabelText
430
430
  })]
431
431
  }), /*#__PURE__*/jsx("div", {
432
- ref: combinedScrollContainerRef,
432
+ ref: scrollContainerRef,
433
433
  className: classes.Container,
434
434
  children: getBodyContent()
435
435
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAK,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,SAAS,CAAA;AAIvD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAI/F,OAAO,KAAK,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAO9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;CAC5C,CAAA;AAkBD,MAAM,MAAM,eAAe,GAAG;IAC5B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EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;CAClD,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;AAuDpF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,eAAe,CAAC,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;CAC7F,GAAG,iBAAiB,CAAA;AAsErB,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC7C,GAAG,iBAAiB,CAAA;AAiDrB,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;AAmBrE,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC5D,GAAG,iBAAiB,CAAA;AAsFrB,eAAO,MAAM,UAAU;;;;;;;;;;;;+CA3GiC,YAAY;;;CA0HlE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { useRef, useEffect } from 'react';
2
+ import React, { useEffect } from 'react';
3
3
  import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
4
4
  import { ArrowLeftIcon } from '@primer/octicons-react';
5
5
  import { getResponsiveAttributes } from '../internal/utils/getResponsiveAttributes.js';
@@ -9,7 +9,7 @@ import { clsx } from 'clsx';
9
9
  import classes from './PageHeader.module.css.js';
10
10
  import { isSlot } from '../utils/is-slot.js';
11
11
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
12
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
12
+ import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
13
13
  import Heading from '../Heading/Heading.js';
14
14
  import Link from '../Link/Link.js';
15
15
 
@@ -31,7 +31,7 @@ const hiddenOnNarrow = {
31
31
  // -----------------------------------------------------------------------------
32
32
 
33
33
  const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
34
- const $ = c(13);
34
+ const $ = c(14);
35
35
  const {
36
36
  children,
37
37
  className,
@@ -41,12 +41,11 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
41
41
  hasBorder
42
42
  } = t0;
43
43
  const BaseComponent = t1 === undefined ? "div" : t1;
44
- const rootRef = useRef(null);
45
- const mergedRef = useMergedRefs(rootRef, forwardedRef);
44
+ const rootRef = useProvidedRefOrCreate(forwardedRef);
46
45
  const isInteractive = _temp;
47
46
  let t2;
48
47
  let t3;
49
- if ($[0] !== children) {
48
+ if ($[0] !== children || $[1] !== rootRef) {
50
49
  t2 = function validateInteractiveElementsInTitle() {
51
50
  if (!(process.env.NODE_ENV !== "production")) {
52
51
  return;
@@ -73,42 +72,43 @@ const Root = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
73
72
  };
74
73
  t3 = [children, rootRef];
75
74
  $[0] = children;
76
- $[1] = t2;
77
- $[2] = t3;
75
+ $[1] = rootRef;
76
+ $[2] = t2;
77
+ $[3] = t3;
78
78
  } else {
79
- t2 = $[1];
80
- t3 = $[2];
79
+ t2 = $[2];
80
+ t3 = $[3];
81
81
  }
82
82
  useEffect(t2, t3);
83
83
  let t4;
84
- if ($[3] !== className) {
84
+ if ($[4] !== className) {
85
85
  t4 = clsx(classes.PageHeader, className);
86
- $[3] = className;
87
- $[4] = t4;
86
+ $[4] = className;
87
+ $[5] = t4;
88
88
  } else {
89
- t4 = $[4];
89
+ t4 = $[5];
90
90
  }
91
91
  const t5 = hasBorder ? "true" : undefined;
92
92
  let t6;
93
- if ($[5] !== BaseComponent || $[6] !== ariaLabel || $[7] !== children || $[8] !== mergedRef || $[9] !== role || $[10] !== t4 || $[11] !== t5) {
93
+ if ($[6] !== BaseComponent || $[7] !== ariaLabel || $[8] !== children || $[9] !== role || $[10] !== rootRef || $[11] !== t4 || $[12] !== t5) {
94
94
  t6 = /*#__PURE__*/jsx(BaseComponent, {
95
- ref: mergedRef,
95
+ ref: rootRef,
96
96
  className: t4,
97
97
  "data-has-border": t5,
98
98
  "aria-label": ariaLabel,
99
99
  role: role,
100
100
  children: children
101
101
  });
102
- $[5] = BaseComponent;
103
- $[6] = ariaLabel;
104
- $[7] = children;
105
- $[8] = mergedRef;
102
+ $[6] = BaseComponent;
103
+ $[7] = ariaLabel;
104
+ $[8] = children;
106
105
  $[9] = role;
107
- $[10] = t4;
108
- $[11] = t5;
109
- $[12] = t6;
106
+ $[10] = rootRef;
107
+ $[11] = t4;
108
+ $[12] = t5;
109
+ $[13] = t6;
110
110
  } else {
111
- t6 = $[12];
111
+ t6 = $[13];
112
112
  }
113
113
  return t6;
114
114
  });
@@ -334,6 +334,7 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
334
334
  } = t0;
335
335
  const hidden = t1 === undefined ? false : t1;
336
336
  const variant = t2 === undefined ? "medium" : t2;
337
+ const titleAreaRef = useProvidedRefOrCreate(forwardedRef);
337
338
  let t3;
338
339
  if ($[0] !== className) {
339
340
  t3 = clsx(classes.TitleArea, className);
@@ -359,20 +360,20 @@ const TitleArea = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
359
360
  t5 = $[5];
360
361
  }
361
362
  let t6;
362
- if ($[6] !== children || $[7] !== forwardedRef || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
363
+ if ($[6] !== children || $[7] !== t3 || $[8] !== t4 || $[9] !== t5 || $[10] !== titleAreaRef) {
363
364
  t6 = /*#__PURE__*/jsx("div", {
364
365
  className: t3,
365
- ref: forwardedRef,
366
+ ref: titleAreaRef,
366
367
  "data-component": "TitleArea",
367
368
  ...t4,
368
369
  ...t5,
369
370
  children: children
370
371
  });
371
372
  $[6] = children;
372
- $[7] = forwardedRef;
373
- $[8] = t3;
374
- $[9] = t4;
375
- $[10] = t5;
373
+ $[7] = t3;
374
+ $[8] = t4;
375
+ $[9] = t5;
376
+ $[10] = titleAreaRef;
376
377
  $[11] = t6;
377
378
  } else {
378
379
  t6 = $[11];
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/TextInput/TextInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwD,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAM/F,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAA;AAS/E,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;QAKI;IACJ,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IAChD,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACnD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAA;IACpD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACvE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,OAAO,CACT,IAAI,CACF,kB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,OAAO,GACP,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,kBAAkB,CACrB,CACF,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,CAAA;;;;;;;;;;;AA+PzG,wBAGE"}
@@ -10,7 +10,7 @@ import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
10
10
  import VisuallyHidden from '../_VisuallyHidden.js';
11
11
  import { CharacterCounter } from '../utils/character-counter.js';
12
12
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
13
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
13
+ import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
14
14
  import Text from '../Text/Text.js';
15
15
 
16
16
  // using forwardRef is important so that other components can autofocus the input
@@ -46,8 +46,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
46
46
  ...inputProps
47
47
  }, ref) => {
48
48
  const [isInputFocused, setIsInputFocused] = useState(false);
49
- const inputRef = useRef(null);
50
- const mergedRef = useMergedRefs(inputRef, ref);
49
+ const inputRef = useProvidedRefOrCreate(ref);
51
50
  const [characterCount, setCharacterCount] = useState('');
52
51
  const [isOverLimit, setIsOverLimit] = useState(false);
53
52
  const [screenReaderMessage, setScreenReaderMessage] = useState('');
@@ -171,8 +170,10 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
171
170
  hasLoadingIndicator: typeof loading === 'boolean',
172
171
  id: leadingVisualId,
173
172
  children: typeof LeadingVisual !== 'string' && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual
174
- }), /*#__PURE__*/jsx(UnstyledTextInput, {
175
- ref: mergedRef,
173
+ }), /*#__PURE__*/jsx(UnstyledTextInput
174
+ // @ts-expect-error it needs a non nullable ref
175
+ , {
176
+ ref: inputRef,
176
177
  disabled: disabled,
177
178
  onFocus: handleInputFocus,
178
179
  onBlur: handleInputBlur,
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/TooltipV2/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAyC,KAAK,yBAAyB,EAAS,MAAM,OAAO,CAAA;AAS3G,OAAO,EAAoD,KAAK,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAG7G,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAChF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjD,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,GAAG,aAAa,CAAA;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;IACjF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACnC;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC,CAAC,GACA,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAiEnC,eAAO,MAAM,cAAc;gBAAoC,MAAM;EAAM,CAAA;AAI3E,eAAO,MAAM,OAAO,EAAE,yBAAyB,CAC7C,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CACvE,GACC,UAiSD,CAAA"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/TooltipV2/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiD,KAAK,yBAAyB,EAAC,MAAM,OAAO,CAAA;AAS3G,OAAO,EAAoD,KAAK,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAG7G,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAE9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAA;AAChF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjD,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,GAAG,aAAa,CAAA;IAC9B,cAAc,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;IACjF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACnC;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC,CAAC,GACA,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAiEnC,eAAO,MAAM,cAAc;gBAAoC,MAAM;EAAM,CAAA;AAI3E,eAAO,MAAM,OAAO,EAAE,yBAAyB,CAC7C,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CACvE,GACC,UAiSD,CAAA"}
@@ -9,7 +9,7 @@ import VisuallyHidden from '../_VisuallyHidden.js';
9
9
  import useSafeTimeout from '../hooks/useSafeTimeout.js';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import { useId } from '../hooks/useId.js';
12
- import { useMergedRefs } from '../hooks/useMergedRefs.js';
12
+ import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
13
13
  import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
14
14
  import { useIsMacOS } from '../hooks/useIsMacOS.js';
15
15
  import { getAccessibleKeybindingHintString, KeybindingHint } from '../KeybindingHint/KeybindingHint.js';
@@ -91,8 +91,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
91
91
  }, forwardedRef) => {
92
92
  const tooltipId = useId(id);
93
93
  const child = Children.only(children);
94
- const triggerRef = useRef(null);
95
- const mergedTriggerRef = useMergedRefs(triggerRef, forwardedRef);
94
+ const triggerRef = useProvidedRefOrCreate(forwardedRef);
96
95
  const tooltipElRef = useRef(null);
97
96
  const [calculatedDirection, setCalculatedDirection] = useState(direction);
98
97
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
@@ -208,7 +207,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
208
207
  /*#__PURE__*/
209
208
  // eslint-disable-next-line react-hooks/refs
210
209
  React.cloneElement(child, {
211
- ref: mergedTriggerRef,
210
+ // @ts-expect-error it needs a non nullable ref
211
+ ref: triggerRef,
212
212
  // If it is a type description, we use tooltip to describe the trigger
213
213
  'aria-describedby': (() => {
214
214
  // If tooltip is not a description type, keep the original aria-describedby
@@ -66,7 +66,7 @@ declare function useTabList<T extends HTMLElement>(props: TabListProps & {
66
66
  'aria-orientation': AriaAttributes['aria-orientation'];
67
67
  'aria-label': AriaAttributes['aria-label'];
68
68
  'aria-labelledby': AriaAttributes['aria-labelledby'];
69
- ref: React.Ref<T>;
69
+ ref: React.RefObject<T | null>;
70
70
  role: 'tablist';
71
71
  };
72
72
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/experimental/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAA;AAKd;;GAEG;AACH,KAAK,mBAAmB,GAAG;IACzB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AAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAClB,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,IAAI,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAClH,GAAG;QACF,IAAI,EAAE,KAAK,CAAA;KACZ,CAAA;CACF,CAwCA;AAED,QAAA,MAAM,GAAG;IApEP;;OAEG;eACQ,OAAO;IAElB;;;OAGG;WACI,MAAM;2CA4Eb,CAAA;AAEF,KAAK,aAAa,GAAG;IACnB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,kCAAkC;AAClC,iBAAS,WAAW,CAAC,CAAC,SAAS,WAAW,EACxC,KAAK,EAAE,aAAa,GACnB;IACD,qDAAqD;IACrD,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,QAAQ,CAAC,GAAG;QAC7E;;WAEG;QACH,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;QACnC,IAAI,EAAE,UAAU,CAAA;KACjB,CAAA;CACF,CAeA;AAED,iBAAS,QAAQ,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,aAAa,qBAQjG;AA+BD,OAAO,EAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAC,CAAA;AACtE,YAAY,EAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAC,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { useId, useRef, createContext, useContext } from 'react';
2
+ import React, { useId, createContext, useContext } from 'react';
3
3
  import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect.js';
4
4
  import { useControllableState } from '../../hooks/useControllableState.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { useMergedRefs } from '../../hooks/useMergedRefs.js';
6
+ import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
7
7
 
8
8
  /**
9
9
  * The Tabs component provides the base structure for a tabbed interface, without providing any formal requirement on DOM structure or styling.
@@ -87,16 +87,15 @@ function Tabs(props) {
87
87
  return t5;
88
88
  }
89
89
  function useTabList(props) {
90
- const $ = c(8);
90
+ const $ = c(9);
91
91
  const {
92
92
  "aria-label": ariaLabel,
93
93
  "aria-labelledby": ariaLabelledby,
94
94
  "aria-orientation": ariaOrientation
95
95
  } = props;
96
- const ref = useRef(null);
97
- const mergedRef = useMergedRefs(ref, props.ref);
96
+ const ref = useProvidedRefOrCreate(props.ref);
98
97
  let t0;
99
- if ($[0] !== ariaOrientation) {
98
+ if ($[0] !== ariaOrientation || $[1] !== ref) {
100
99
  t0 = event => {
101
100
  const {
102
101
  current: tablist
@@ -143,17 +142,18 @@ function useTabList(props) {
143
142
  }
144
143
  };
145
144
  $[0] = ariaOrientation;
146
- $[1] = t0;
145
+ $[1] = ref;
146
+ $[2] = t0;
147
147
  } else {
148
- t0 = $[1];
148
+ t0 = $[2];
149
149
  }
150
150
  const onKeyDown = t0;
151
151
  const t1 = ariaOrientation !== null && ariaOrientation !== void 0 ? ariaOrientation : "horizontal";
152
152
  let t2;
153
- if ($[2] !== ariaLabel || $[3] !== ariaLabelledby || $[4] !== mergedRef || $[5] !== onKeyDown || $[6] !== t1) {
153
+ if ($[3] !== ariaLabel || $[4] !== ariaLabelledby || $[5] !== onKeyDown || $[6] !== ref || $[7] !== t1) {
154
154
  t2 = {
155
155
  tabListProps: {
156
- ref: mergedRef,
156
+ ref,
157
157
  "aria-label": ariaLabel,
158
158
  "aria-labelledby": ariaLabelledby,
159
159
  "aria-orientation": t1,
@@ -161,14 +161,14 @@ function useTabList(props) {
161
161
  onKeyDown
162
162
  }
163
163
  };
164
- $[2] = ariaLabel;
165
- $[3] = ariaLabelledby;
166
- $[4] = mergedRef;
164
+ $[3] = ariaLabel;
165
+ $[4] = ariaLabelledby;
167
166
  $[5] = onKeyDown;
168
- $[6] = t1;
169
- $[7] = t2;
167
+ $[6] = ref;
168
+ $[7] = t1;
169
+ $[8] = t2;
170
170
  } else {
171
- t2 = $[7];
171
+ t2 = $[8];
172
172
  }
173
173
  return t2;
174
174
  }
@@ -9,6 +9,8 @@ export { Blankslate } from '../Blankslate';
9
9
  export type { BlankslateProps } from '../Blankslate';
10
10
  export { ButtonBase } from '../Button';
11
11
  export type { ButtonBaseProps } from '../Button';
12
+ export { Card } from '../Card';
13
+ export type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardMenuProps, CardMetadataProps, } from '../Card';
12
14
  export { DataTable, Table, createColumnHelper } from '../DataTable';
13
15
  export type { DataTableProps, TableProps, TableHeadProps, TableBodyProps, TableRowProps, TableHeaderProps, TableCellProps, TableContainerProps, TableTitleProps, TableSubtitleProps, TableActionsProps, Column, CellAlignment, ColumnWidth, UniqueRow, ObjectPaths, } from '../DataTable';
14
16
  export * from '../Dialog';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,YAAY,EAAC,eAAe,EAAC,MAAM,eAAe,CAAA;AAElD,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AACpC,YAAY,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAE9C,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAC,MAAM,cAAc,CAAA;AACjE,YAAY,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,WAAW,EACX,SAAS,E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,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAC9D,YAAY,EAAC,aAAa,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAElF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,YAAY,EAAC,oBAAoB,EAAE,uBAAuB,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAA;AAE/G,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,YAAY,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,YAAY,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAA;AACjF,YAAY,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AAEtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAA;AACxD,YAAY,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA;AAEjD,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AAEtB,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AACpC,YAAY,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  export { Blankslate } from '../Blankslate/index.js';
3
+ export { Card } from '../Card/index.js';
3
4
  export { Table } from '../DataTable/index.js';
4
5
  export { ActionBar } from '../ActionBar/index.js';
5
6
  export { Stack } from '../Stack/index.js';
@@ -29,7 +29,7 @@ import type { ForwardedRef, Ref as StandardRef } from 'react';
29
29
  * return <button ref={mergedRef} />
30
30
  * }
31
31
  */
32
- export declare function useMergedRefs<T>(refA: Ref<T | null>, refB: Ref<T | null>): (value: T | null) => (() => void) | undefined;
32
+ export declare function useMergedRefs<T>(refA: Ref<T | null>, refB: Ref<T | null>): (value: T | null) => () => void;
33
33
  type CleanupFunction = () => void;
34
34
  /**
35
35
  * React 19 supports callback refs that can return a cleanup function. If a cleanup function is returned, the
@@ -1 +1 @@
1
- {"version":3,"file":"useMergedRefs.d.ts","sourceRoot":"","sources":["../../src/hooks/useMergedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,IAAI,WAAW,EAAmB,MAAM,OAAO,CAAA;AAK7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,WAE7D,CAAC,GAAG,IAAI,8BAmBnB;AAED,KAAK,eAAe,GAAG,MAAM,IAAI,CAAA;AAEjC;;;GAGG;AAEH,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,eAAe,CAAA;CACpD,CAAC,gBAAgB,CAAC,CAAA;AAEnB;;;;;;;GAOG;AACH,KAAK,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA"}
1
+ {"version":3,"file":"useMergedRefs.d.ts","sourceRoot":"","sources":["../../src/hooks/useMergedRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,IAAI,WAAW,EAAmB,MAAM,OAAO,CAAA;AAG7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,WAE7D,CAAC,GAAG,IAAI,gBAiBnB;AAED,KAAK,eAAe,GAAG,MAAM,IAAI,CAAA;AAEjC;;;GAGG;AAEH,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,eAAe,CAAA;CACpD,CAAC,gBAAgB,CAAC,CAAA;AAEnB;;;;;;;GAOG;AACH,KAAK,GAAG,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA"}
@@ -1,8 +1,5 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import { version } from 'react';
3
-
4
- var _version$split$;
5
- const majorReactVersion = parseInt((_version$split$ = version.split('.')[0]) !== null && _version$split$ !== void 0 ? _version$split$ : '18', 10);
2
+ import 'react';
6
3
 
7
4
  /**
8
5
  * Combine two refs of matching type (typically an external or forwarded ref and an internal `useRef` object or
@@ -41,9 +38,6 @@ function useMergedRefs(refA, refB) {
41
38
  t0 = value => {
42
39
  const cleanupA = setRef(refA, value);
43
40
  const cleanupB = setRef(refB, value);
44
- if (majorReactVersion <= 18) {
45
- return;
46
- }
47
41
  return () => {
48
42
  if (cleanupA) {
49
43
  cleanupA();
@@ -7,14 +7,17 @@ import React from 'react';
7
7
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
8
8
  * @type TRef The type of the RefObject which should be created.
9
9
  *
10
- * @note This hook is overly restrictive in that it forces the provided ref to be a ref object rather than a callback.
11
- * In particular, it should **not** be used to merge internal refs with forwarded refs. For this, use
12
- * {@linkcode useMergedRefs} instead.
10
+ * @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
11
+ * created ref instead.
13
12
  *
14
- * The primary valid use case for this hook is for when the consumer is using the provided ref to point to an external
15
- * element, like an externally rendered anchor. This is 'backwards' from forwarded refs with respect to data flow; the
16
- * consumer is passing a reference to an external element, rather than passing a handle to obtain a reference to an
17
- * internal element.
13
+ * ```diff
14
+ * - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
15
+ * + const ref = useRef(null)
16
+ * + const mergedRef = useMergedRefs(forwardedRef, ref)
17
+ *
18
+ * - return <div ref={ref} />
19
+ * + return <div ref={mergedRef} />
20
+ * ```
18
21
  */
19
22
  export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef | null>): React.RefObject<TRef | null>;
20
23
  //# sourceMappingURL=useProvidedRefOrCreate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProvidedRefOrCreate.d.ts","sourceRoot":"","sources":["../../src/hooks/useProvidedRefOrCreate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAGrH"}
1
+ {"version":3,"file":"useProvidedRefOrCreate.d.ts","sourceRoot":"","sources":["../../src/hooks/useProvidedRefOrCreate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAGrH"}
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
2
 
3
- // used in doc comment
4
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
-
6
3
  /**
7
4
  * There are some situations where we only want to create a new ref if one is not provided to a component
8
5
  * or hook as a prop. However, due to the `rules-of-hooks`, we cannot conditionally make a call to `React.useRef`
@@ -11,14 +8,17 @@ import React from 'react';
11
8
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
12
9
  * @type TRef The type of the RefObject which should be created.
13
10
  *
14
- * @note This hook is overly restrictive in that it forces the provided ref to be a ref object rather than a callback.
15
- * In particular, it should **not** be used to merge internal refs with forwarded refs. For this, use
16
- * {@linkcode useMergedRefs} instead.
11
+ * @deprecated This hook is incompatible with forwarded callback refs. Prefer `useMergedRefs` with an internally
12
+ * created ref instead.
13
+ *
14
+ * ```diff
15
+ * - const ref = useProvidedRefOrCreate(forwardedRef as RefObject<...>)
16
+ * + const ref = useRef(null)
17
+ * + const mergedRef = useMergedRefs(forwardedRef, ref)
17
18
  *
18
- * The primary valid use case for this hook is for when the consumer is using the provided ref to point to an external
19
- * element, like an externally rendered anchor. This is 'backwards' from forwarded refs with respect to data flow; the
20
- * consumer is passing a reference to an external element, rather than passing a handle to obtain a reference to an
21
- * internal element.
19
+ * - return <div ref={ref} />
20
+ * + return <div ref={mergedRef} />
21
+ * ```
22
22
  */
23
23
  function useProvidedRefOrCreate(providedRef) {
24
24
  const createdRef = React.useRef(null);
@@ -2100,6 +2100,97 @@
2100
2100
  ],
2101
2101
  "subcomponents": []
2102
2102
  },
2103
+ "card": {
2104
+ "source": "https://github.com/primer/react/tree/main/packages/react/src/Card",
2105
+ "id": "card",
2106
+ "name": "Card",
2107
+ "status": "draft",
2108
+ "a11yReviewed": false,
2109
+ "importPath": "@primer/react/experimental",
2110
+ "stories": [
2111
+ {
2112
+ "id": "components-card--default",
2113
+ "code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Icon icon={RocketIcon} />\n <Card.Heading>Card Heading</Card.Heading>\n <Card.Description>\n This is a description of the card providing supplemental information.\n </Card.Description>\n <Card.Metadata>Updated 2 hours ago</Card.Metadata>\n </Card>\n </div>\n )\n}"
2114
+ },
2115
+ {
2116
+ "id": "components-card-features--with-image",
2117
+ "code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Image src=\"https://github.com/octocat.png\" alt=\"Octocat\" />\n <Card.Heading>Card with Image</Card.Heading>\n <Card.Description>\n This card uses an edge-to-edge image instead of an icon.\n </Card.Description>\n </Card>\n </div>\n )\n}"
2118
+ },
2119
+ {
2120
+ "id": "components-card-features--with-metadata",
2121
+ "code": "() => {\n return (\n <div\n style={{\n maxWidth: '400px',\n }}\n >\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n </div>\n )\n}"
2122
+ }
2123
+ ],
2124
+ "props": [
2125
+ {
2126
+ "name": "className",
2127
+ "type": "string",
2128
+ "description": "CSS class name(s) for custom styling."
2129
+ },
2130
+ {
2131
+ "name": "padding",
2132
+ "type": "'none' | 'condensed' | 'normal'",
2133
+ "defaultValue": "'normal'",
2134
+ "description": "Controls the internal padding of the Card."
2135
+ }
2136
+ ],
2137
+ "subcomponents": [
2138
+ {
2139
+ "name": "Card.Icon",
2140
+ "props": [
2141
+ {
2142
+ "name": "icon",
2143
+ "type": "React.ElementType",
2144
+ "description": "An Octicon or custom SVG icon to render."
2145
+ },
2146
+ {
2147
+ "name": "aria-label",
2148
+ "type": "string",
2149
+ "description": "Accessible label for the icon. When omitted, the icon is treated as decorative."
2150
+ }
2151
+ ]
2152
+ },
2153
+ {
2154
+ "name": "Card.Image",
2155
+ "props": [
2156
+ {
2157
+ "name": "src",
2158
+ "type": "string",
2159
+ "description": "The image source URL."
2160
+ },
2161
+ {
2162
+ "name": "alt",
2163
+ "type": "string",
2164
+ "defaultValue": "\"\"",
2165
+ "description": "Alt text for accessibility. Defaults to empty string (decorative)."
2166
+ }
2167
+ ]
2168
+ },
2169
+ {
2170
+ "name": "Card.Heading",
2171
+ "props": [
2172
+ {
2173
+ "name": "as",
2174
+ "type": "'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
2175
+ "defaultValue": "'h3'",
2176
+ "description": "The heading level to render."
2177
+ }
2178
+ ]
2179
+ },
2180
+ {
2181
+ "name": "Card.Description",
2182
+ "props": []
2183
+ },
2184
+ {
2185
+ "name": "Card.Menu",
2186
+ "props": []
2187
+ },
2188
+ {
2189
+ "name": "Card.Metadata",
2190
+ "props": []
2191
+ }
2192
+ ]
2193
+ },
2103
2194
  "checkbox": {
2104
2195
  "source": "https://github.com/primer/react/tree/main/packages/react/src/Checkbox",
2105
2196
  "id": "checkbox",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260408164838",
4
+ "version": "0.0.0-20260408181349",
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",