@primer/react 0.0.0-20260520195001 → 0.0.0-20260520211038

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260520195001
3
+ ## 0.0.0-20260520211038
4
+
5
+ ### Minor Changes
6
+
7
+ - [#7852](https://github.com/primer/react/pull/7852) [`8966e0d`](https://github.com/primer/react/commit/8966e0dddd591fa83cc89b962ec1a6d8c0faa875) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Card: Add `data-component` attributes to `Card` and its subcomponents (`Icon`, `Image`, `Heading`, `Description`, `Metadata`, `Menu`). Add an `as` prop (`'div' | 'section'`) so standalone Cards can render as a labelled region landmark; `as="section"` requires `aria-label` or `aria-labelledby`. `Card` now requires `children`. Also improves docs and stories.
8
+
9
+ ### Patch Changes
10
+
11
+ - Fake entry to force publishing
12
+
13
+ ## 38.24.0
4
14
 
5
15
  ### Minor Changes
6
16
 
@@ -34,8 +44,6 @@
34
44
 
35
45
  - [#7842](https://github.com/primer/react/pull/7842) [`635357e`](https://github.com/primer/react/commit/635357e7d2963bb594718a754fb7f53c1f917c41) Thanks [@joshblack](https://github.com/joshblack)! - DataTable: Treat zero as a populated value when sorting numeric columns
36
46
 
37
- - Fake entry to force publishing
38
-
39
47
  - [#7824](https://github.com/primer/react/pull/7824) [`6889235`](https://github.com/primer/react/commit/6889235fac93f17cfd0354758f4f9a1e6ff01942) Thanks [@jonrohan](https://github.com/jonrohan)! - Fix `usePaneWidth` triggering unnecessary React re-renders on every window resize
40
48
 
41
49
  - [#7833](https://github.com/primer/react/pull/7833) [`dfed7ca`](https://github.com/primer/react/commit/dfed7ca73532922ec0526dd85afcf7ae471c566e) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Timeline: Remove border override from TimelineBadge when variant is set
@@ -0,0 +1,2 @@
1
+ .prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium{position:relative}.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:none;position:absolute;right:var(--base-size-8,.5rem);top:var(--base-size-8,.5rem)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:inline-grid}}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z{position-try-fallbacks:flip-block,flip-inline,flip-block flip-inline;position-visibility:anchors-visible;position:fixed!important;z-index:100}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[popover]{border:0;inset:auto;margin:0;max-width:none;padding:0}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom]{left:anchor(left);top:calc(anchor(bottom) + var(--base-size-4,.25rem))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom][data-align=left]{left:auto;right:calc(anchor(right) - var(--anchored-overlay-anchor-offset-left))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top]{bottom:anchor(top);left:anchor(left);margin-bottom:var(--base-size-4,.25rem)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top][data-align=left]{left:auto;right:anchor(right)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-left]{margin-right:var(--base-size-4,.25rem);right:anchor(left);top:var(--anchored-overlay-top-override,anchor(top));position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-left-to-bottom}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right]{left:anchor(right);margin-left:var(--base-size-4,.25rem);top:var(--anchored-overlay-top-override,anchor(top));position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-right-to-bottom}@position-try --outside-left-to-bottom{margin:0;right:anchor(right);top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}@position-try --outside-right-to-bottom{left:anchor(left);margin:0;top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}
2
+ /*# sourceMappingURL=AnchoredOverlay-ec9e15fc.css.map */
@@ -0,0 +1 @@
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"]}
@@ -1,4 +1,4 @@
1
- import './AnchoredOverlay-7fc6a215.css';
1
+ import './AnchoredOverlay-ec9e15fc.css';
2
2
 
3
3
  var classes = {"ResponsiveCloseButtonContainer":"prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium","ResponsiveCloseButton":"prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx","AnchoredOverlay":"prc-AnchoredOverlay-AnchoredOverlay-fYg9Z"};
4
4
 
@@ -1,21 +1,19 @@
1
1
  import React from 'react';
2
- export type CardProps = React.ComponentPropsWithoutRef<'div'> & {
3
- /**
4
- * Provide an optional className to add to the outermost element rendered by
5
- * the Card
6
- */
2
+ import { type PolymorphicProps } from '../utils/modern-polymorphic';
3
+ type CardAs = 'div' | 'section';
4
+ export type CardProps<As extends CardAs = 'div'> = PolymorphicProps<As, 'div', {
5
+ /** Optional className for the root element. */
7
6
  className?: string;
8
- /**
9
- * Controls the internal padding of the Card.
10
- * @default 'normal'
11
- */
7
+ /** Internal padding. @default 'normal' */
12
8
  padding?: 'none' | 'condensed' | 'normal';
9
+ /** Border radius. @default 'large' */
10
+ borderRadius?: 'medium' | 'large';
13
11
  /**
14
- * Controls the border radius of the Card.
15
- * @default 'large'
12
+ * Card contents. Provide either `Card.*` subcomponents (e.g. `Card.Heading`,
13
+ * `Card.Description`, `Card.Metadata`) or custom content. Empty cards do not render.
16
14
  */
17
- borderRadius?: 'medium' | 'large';
18
- };
15
+ children: React.ReactNode;
16
+ }>;
19
17
  type HeadingLevel = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
20
18
  type HeadingProps = React.ComponentPropsWithoutRef<'h3'> & {
21
19
  /**
@@ -25,6 +23,9 @@ type HeadingProps = React.ComponentPropsWithoutRef<'h3'> & {
25
23
  children: React.ReactNode;
26
24
  };
27
25
  type DescriptionProps = React.ComponentPropsWithoutRef<'p'> & {
26
+ /**
27
+ * Card description. Rendered as a `<p>`, so keep it to flowing text.
28
+ */
28
29
  children: React.ReactNode;
29
30
  };
30
31
  type IconProps = {
@@ -49,36 +50,57 @@ type ImageProps = React.ComponentPropsWithoutRef<'img'> & {
49
50
  alt?: string;
50
51
  };
51
52
  type MenuProps = {
53
+ /** Interactive control for the top-right corner of the card. */
52
54
  children: React.ReactNode;
53
55
  };
54
56
  type MetadataProps = React.ComponentPropsWithoutRef<'div'> & {
55
- children: React.ReactNode;
56
- };
57
- declare const CardImpl: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
58
57
  /**
59
- * Provide an optional className to add to the outermost element rendered by
60
- * the Card
58
+ * Metadata row at the bottom of the card. Any content works: text, icons,
59
+ * a `Label`, an `Octicon`.
61
60
  */
61
+ children: React.ReactNode;
62
+ };
63
+ declare const CardImpl: <As extends CardAs>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "div" : As> & {
64
+ /** Optional className for the root element. */
62
65
  className?: string;
66
+ /** Internal padding. @default 'normal' */
67
+ padding?: "none" | "condensed" | "normal";
68
+ /** Border radius. @default 'large' */
69
+ borderRadius?: "medium" | "large";
63
70
  /**
64
- * Controls the internal padding of the Card.
65
- * @default 'normal'
71
+ * Card contents. Provide either `Card.*` subcomponents (e.g. `Card.Heading`,
72
+ * `Card.Description`, `Card.Metadata`) or custom content. Empty cards do not render.
66
73
  */
74
+ children: React.ReactNode;
75
+ } extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "div" : As> & {
76
+ /** Optional className for the root element. */
77
+ className?: string;
78
+ /** Internal padding. @default 'normal' */
67
79
  padding?: "none" | "condensed" | "normal";
80
+ /** Border radius. @default 'large' */
81
+ borderRadius?: "medium" | "large";
68
82
  /**
69
- * Controls the border radius of the Card.
70
- * @default 'large'
83
+ * Card contents. Provide either `Card.*` subcomponents (e.g. `Card.Heading`,
84
+ * `Card.Description`, `Card.Metadata`) or custom content. Empty cards do not render.
71
85
  */
72
- borderRadius?: "medium" | "large";
73
- } & React.RefAttributes<HTMLDivElement>>;
74
- declare const CardIcon: {
75
- ({ icon: IconComponent, "aria-label": ariaLabel, className }: IconProps): React.JSX.Element;
76
- displayName: string;
77
- };
78
- declare const CardImage: {
79
- ({ src, alt, className, ...rest }: ImageProps): React.JSX.Element;
80
- displayName: string;
81
- };
86
+ children: React.ReactNode;
87
+ } ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
88
+ as?: As | undefined;
89
+ } & React.RefAttributes<any>) => React.ReactNode;
90
+ declare function CardIcon({ icon: IconComponent, 'aria-label': ariaLabel, className }: IconProps): React.JSX.Element;
91
+ declare namespace CardIcon {
92
+ var displayName: string;
93
+ }
94
+ declare function CardImage({ src, alt, className, ...rest }: ImageProps): React.JSX.Element;
95
+ declare namespace CardImage {
96
+ var displayName: string;
97
+ }
98
+ /**
99
+ * Heading shown at the top of a Card.
100
+ *
101
+ * When the parent Card uses `as="section"`, the heading's `id` is
102
+ * automatically wired to the section's `aria-labelledby`.
103
+ */
82
104
  declare const CardHeading: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
83
105
  /**
84
106
  * The heading level to render. Defaults to 'h3'.
@@ -87,13 +109,27 @@ declare const CardHeading: React.ForwardRefExoticComponent<Omit<React.DetailedHT
87
109
  children: React.ReactNode;
88
110
  } & React.RefAttributes<HTMLHeadingElement>>;
89
111
  declare const CardDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
112
+ /**
113
+ * Card description. Rendered as a `<p>`, so keep it to flowing text.
114
+ */
90
115
  children: React.ReactNode;
91
116
  } & React.RefAttributes<HTMLParagraphElement>>;
92
- declare const CardMenu: {
93
- ({ children }: MenuProps): React.JSX.Element;
94
- displayName: string;
95
- };
117
+ /**
118
+ * Top-right slot for a single interactive control.
119
+ *
120
+ * Give the control a label that names the card (e.g. `"More options for
121
+ * Project Alpha"`, not just `"More options"`) so users can tell which card
122
+ * the action applies to when several cards are visible.
123
+ */
124
+ declare function CardMenu({ children }: MenuProps): React.JSX.Element;
125
+ declare namespace CardMenu {
126
+ var displayName: string;
127
+ }
96
128
  declare const CardMetadata: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
129
+ /**
130
+ * Metadata row at the bottom of the card. Any content works: text, icons,
131
+ * a `Label`, an `Octicon`.
132
+ */
97
133
  children: React.ReactNode;
98
134
  } & React.RefAttributes<HTMLDivElement>>;
99
135
  export { CardImpl, CardIcon, CardImage, CardHeading, CardDescription, CardMenu, CardMetadata };
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../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C,YAAY,IAAI,gBAAgB,EAAC,CAAA;AAC9C,YAAY,EAAC,gBAAgB,IAAI,oBAAoB,EAAC,CAAA;AACtD,YAAY,EAAC,SAAS,IAAI,aAAa,EAAC,CAAA;AACxC,YAAY,EAAC,UAAU,IAAI,cAAc,EAAC,CAAA;AAC1C,YAAY,EAAC,SAAS,IAAI,aAAa,EAAC,CAAA;AACxC,YAAY,EAAC,aAAa,IAAI,iBAAiB,EAAC,CAAA"}
package/dist/Card/Card.js CHANGED
@@ -1,43 +1,40 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { clsx } from 'clsx';
3
- import React, { forwardRef } from 'react';
3
+ import React, { forwardRef, useContext, createContext } from 'react';
4
4
  import classes from './Card.module.css.js';
5
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+ import { warning } from '../utils/warning.js';
6
+ import { fixedForwardRef } from '../utils/modern-polymorphic.js';
7
+ import { useId } from '../hooks/useId.js';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
9
 
7
- const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
8
- const $ = c(53);
9
- let children;
10
- let className;
11
- let rest;
12
- let t1;
13
- let t2;
14
- if ($[0] !== t0) {
15
- ({
16
- children,
17
- className,
18
- padding: t1,
19
- borderRadius: t2,
20
- ...rest
21
- } = t0);
22
- $[0] = t0;
23
- $[1] = children;
24
- $[2] = className;
25
- $[3] = rest;
26
- $[4] = t1;
27
- $[5] = t2;
28
- } else {
29
- children = $[1];
30
- className = $[2];
31
- rest = $[3];
32
- t1 = $[4];
33
- t2 = $[5];
10
+ const CardContext = /*#__PURE__*/createContext({});
11
+ function CardComponent(props, ref) {
12
+ const $ = c(67);
13
+ const {
14
+ children,
15
+ className,
16
+ padding: t0,
17
+ borderRadius: t1,
18
+ as: t2,
19
+ ...rest
20
+ } = props;
21
+ const padding = t0 === undefined ? "normal" : t0;
22
+ const borderRadius = t1 === undefined ? "large" : t1;
23
+ const as = t2 === undefined ? "div" : t2;
24
+ const Component = as;
25
+ const generatedId = useId();
26
+ const titleId = as === "section" ? generatedId : undefined;
27
+ if (as === "section" && !("aria-label" in props) && !("aria-labelledby" in props)) {
28
+ rest["aria-labelledby"] = titleId;
34
29
  }
35
- const padding = t1 === undefined ? "normal" : t1;
36
- const borderRadius = t2 === undefined ? "large" : t2;
30
+ let T0;
31
+ let T1;
37
32
  let description;
38
33
  let heading;
39
34
  let menu;
40
35
  let metadata;
36
+ let t10;
37
+ let t11;
41
38
  let t3;
42
39
  let t4;
43
40
  let t5;
@@ -45,8 +42,8 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
45
42
  let t7;
46
43
  let t8;
47
44
  let t9;
48
- if ($[6] !== borderRadius || $[7] !== children || $[8] !== className || $[9] !== padding || $[10] !== ref || $[11] !== rest) {
49
- t9 = Symbol.for("react.early_return_sentinel");
45
+ if ($[0] !== Component || $[1] !== borderRadius || $[2] !== children || $[3] !== className || $[4] !== padding || $[5] !== ref || $[6] !== rest || $[7] !== titleId) {
46
+ t11 = Symbol.for("react.early_return_sentinel");
50
47
  bb0: {
51
48
  let icon = null;
52
49
  let image = null;
@@ -84,64 +81,112 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
84
81
  }
85
82
  }
86
83
  const hasSlotChildren = icon || image || heading || description || metadata || menu;
84
+ const isEmpty = !hasSlotChildren && childArray.length === 0;
85
+ process.env.NODE_ENV !== "production" ? warning(isEmpty, "The <Card> component was rendered with no children and will not render. Provide either Card subcomponents (Card.Heading, Card.Description, etc.) or custom content.") : void 0;
86
+ if (isEmpty) {
87
+ t11 = null;
88
+ break bb0;
89
+ }
87
90
  if (!hasSlotChildren) {
88
- let t10;
89
- if ($[23] !== className) {
90
- t10 = clsx(classes.Card, className);
91
- $[23] = className;
92
- $[24] = t10;
91
+ let t12;
92
+ if ($[23] !== titleId) {
93
+ t12 = {
94
+ titleId
95
+ };
96
+ $[23] = titleId;
97
+ $[24] = t12;
93
98
  } else {
94
- t10 = $[24];
99
+ t12 = $[24];
95
100
  }
96
- let t11;
97
- if ($[25] !== borderRadius || $[26] !== children || $[27] !== padding || $[28] !== ref || $[29] !== rest || $[30] !== t10) {
98
- t11 = /*#__PURE__*/jsx("div", {
101
+ let t13;
102
+ if ($[25] !== className) {
103
+ t13 = clsx(classes.Card, className);
104
+ $[25] = className;
105
+ $[26] = t13;
106
+ } else {
107
+ t13 = $[26];
108
+ }
109
+ let t14;
110
+ if ($[27] !== Component || $[28] !== borderRadius || $[29] !== children || $[30] !== padding || $[31] !== ref || $[32] !== rest || $[33] !== t13) {
111
+ t14 = /*#__PURE__*/jsx(Component, {
99
112
  ref: ref,
100
- className: t10,
113
+ className: t13,
114
+ "data-component": "Card",
101
115
  "data-padding": padding,
102
116
  "data-border-radius": borderRadius,
103
117
  ...rest,
104
118
  children: children
105
119
  });
106
- $[25] = borderRadius;
107
- $[26] = children;
108
- $[27] = padding;
109
- $[28] = ref;
110
- $[29] = rest;
111
- $[30] = t10;
112
- $[31] = t11;
120
+ $[27] = Component;
121
+ $[28] = borderRadius;
122
+ $[29] = children;
123
+ $[30] = padding;
124
+ $[31] = ref;
125
+ $[32] = rest;
126
+ $[33] = t13;
127
+ $[34] = t14;
113
128
  } else {
114
- t11 = $[31];
129
+ t14 = $[34];
115
130
  }
116
- t9 = t11;
131
+ let t15;
132
+ if ($[35] !== t12 || $[36] !== t14) {
133
+ t15 = /*#__PURE__*/jsx(CardContext.Provider, {
134
+ value: t12,
135
+ children: t14
136
+ });
137
+ $[35] = t12;
138
+ $[36] = t14;
139
+ $[37] = t15;
140
+ } else {
141
+ t15 = $[37];
142
+ }
143
+ t11 = t15;
117
144
  break bb0;
118
145
  }
146
+ T1 = CardContext.Provider;
147
+ if ($[38] !== titleId) {
148
+ t10 = {
149
+ titleId
150
+ };
151
+ $[38] = titleId;
152
+ $[39] = t10;
153
+ } else {
154
+ t10 = $[39];
155
+ }
156
+ T0 = Component;
119
157
  t3 = ref;
120
- if ($[32] !== className) {
158
+ if ($[40] !== className) {
121
159
  t4 = clsx(classes.Card, className);
122
- $[32] = className;
123
- $[33] = t4;
160
+ $[40] = className;
161
+ $[41] = t4;
124
162
  } else {
125
- t4 = $[33];
163
+ t4 = $[41];
126
164
  }
127
- t5 = padding;
128
- t6 = borderRadius;
129
- t7 = rest;
130
- t8 = (image || icon) && /*#__PURE__*/jsx("div", {
165
+ t5 = "Card";
166
+ t6 = padding;
167
+ t7 = borderRadius;
168
+ t8 = rest;
169
+ t9 = (image || icon) && /*#__PURE__*/jsx("div", {
131
170
  className: clsx(classes.CardHeader, image && classes.CardHeaderEdgeToEdge),
132
171
  children: image || icon
133
172
  });
134
173
  }
135
- $[6] = borderRadius;
136
- $[7] = children;
137
- $[8] = className;
138
- $[9] = padding;
139
- $[10] = ref;
140
- $[11] = rest;
141
- $[12] = description;
142
- $[13] = heading;
143
- $[14] = menu;
144
- $[15] = metadata;
174
+ $[0] = Component;
175
+ $[1] = borderRadius;
176
+ $[2] = children;
177
+ $[3] = className;
178
+ $[4] = padding;
179
+ $[5] = ref;
180
+ $[6] = rest;
181
+ $[7] = titleId;
182
+ $[8] = T0;
183
+ $[9] = T1;
184
+ $[10] = description;
185
+ $[11] = heading;
186
+ $[12] = menu;
187
+ $[13] = metadata;
188
+ $[14] = t10;
189
+ $[15] = t11;
145
190
  $[16] = t3;
146
191
  $[17] = t4;
147
192
  $[18] = t5;
@@ -150,10 +195,14 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
150
195
  $[21] = t8;
151
196
  $[22] = t9;
152
197
  } else {
153
- description = $[12];
154
- heading = $[13];
155
- menu = $[14];
156
- metadata = $[15];
198
+ T0 = $[8];
199
+ T1 = $[9];
200
+ description = $[10];
201
+ heading = $[11];
202
+ menu = $[12];
203
+ metadata = $[13];
204
+ t10 = $[14];
205
+ t11 = $[15];
157
206
  t3 = $[16];
158
207
  t4 = $[17];
159
208
  t5 = $[18];
@@ -162,80 +211,98 @@ const CardImpl = /*#__PURE__*/forwardRef(function Card(t0, ref) {
162
211
  t8 = $[21];
163
212
  t9 = $[22];
164
213
  }
165
- if (t9 !== Symbol.for("react.early_return_sentinel")) {
166
- return t9;
214
+ if (t11 !== Symbol.for("react.early_return_sentinel")) {
215
+ return t11;
167
216
  }
168
- let t10;
169
- if ($[34] !== description || $[35] !== heading) {
170
- t10 = /*#__PURE__*/jsxs("div", {
217
+ let t12;
218
+ if ($[42] !== description || $[43] !== heading) {
219
+ t12 = /*#__PURE__*/jsxs("div", {
171
220
  className: classes.CardContent,
172
221
  children: [heading, description]
173
222
  });
174
- $[34] = description;
175
- $[35] = heading;
176
- $[36] = t10;
223
+ $[42] = description;
224
+ $[43] = heading;
225
+ $[44] = t12;
177
226
  } else {
178
- t10 = $[36];
227
+ t12 = $[44];
179
228
  }
180
- let t11;
181
- if ($[37] !== metadata) {
182
- t11 = metadata ? /*#__PURE__*/jsx("div", {
229
+ let t13;
230
+ if ($[45] !== metadata) {
231
+ t13 = metadata ? /*#__PURE__*/jsx("div", {
183
232
  className: classes.CardMetadataContainer,
184
233
  children: metadata
185
234
  }) : null;
186
- $[37] = metadata;
187
- $[38] = t11;
235
+ $[45] = metadata;
236
+ $[46] = t13;
188
237
  } else {
189
- t11 = $[38];
238
+ t13 = $[46];
190
239
  }
191
- let t12;
192
- if ($[39] !== t10 || $[40] !== t11) {
193
- t12 = /*#__PURE__*/jsxs("div", {
240
+ let t14;
241
+ if ($[47] !== t12 || $[48] !== t13) {
242
+ t14 = /*#__PURE__*/jsxs("div", {
194
243
  className: classes.CardBody,
195
- children: [t10, t11]
244
+ children: [t12, t13]
196
245
  });
197
- $[39] = t10;
198
- $[40] = t11;
199
- $[41] = t12;
246
+ $[47] = t12;
247
+ $[48] = t13;
248
+ $[49] = t14;
200
249
  } else {
201
- t12 = $[41];
250
+ t14 = $[49];
202
251
  }
203
- let t13;
204
- if ($[42] !== menu) {
205
- t13 = menu ? /*#__PURE__*/jsx("div", {
252
+ let t15;
253
+ if ($[50] !== menu) {
254
+ t15 = menu ? /*#__PURE__*/jsx("div", {
206
255
  className: classes.CardMenu,
207
256
  children: menu
208
257
  }) : null;
209
- $[42] = menu;
210
- $[43] = t13;
258
+ $[50] = menu;
259
+ $[51] = t15;
211
260
  } else {
212
- t13 = $[43];
261
+ t15 = $[51];
213
262
  }
214
- let t14;
215
- if ($[44] !== t12 || $[45] !== t13 || $[46] !== t3 || $[47] !== t4 || $[48] !== t5 || $[49] !== t6 || $[50] !== t7 || $[51] !== t8) {
216
- t14 = /*#__PURE__*/jsxs("div", {
263
+ let t16;
264
+ if ($[52] !== T0 || $[53] !== t14 || $[54] !== t15 || $[55] !== t3 || $[56] !== t4 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7 || $[60] !== t8 || $[61] !== t9) {
265
+ t16 = /*#__PURE__*/jsxs(T0, {
217
266
  ref: t3,
218
267
  className: t4,
219
- "data-padding": t5,
220
- "data-border-radius": t6,
221
- ...t7,
222
- children: [t8, t12, t13]
268
+ "data-component": t5,
269
+ "data-padding": t6,
270
+ "data-border-radius": t7,
271
+ ...t8,
272
+ children: [t9, t14, t15]
223
273
  });
224
- $[44] = t12;
225
- $[45] = t13;
226
- $[46] = t3;
227
- $[47] = t4;
228
- $[48] = t5;
229
- $[49] = t6;
230
- $[50] = t7;
231
- $[51] = t8;
232
- $[52] = t14;
274
+ $[52] = T0;
275
+ $[53] = t14;
276
+ $[54] = t15;
277
+ $[55] = t3;
278
+ $[56] = t4;
279
+ $[57] = t5;
280
+ $[58] = t6;
281
+ $[59] = t7;
282
+ $[60] = t8;
283
+ $[61] = t9;
284
+ $[62] = t16;
233
285
  } else {
234
- t14 = $[52];
286
+ t16 = $[62];
235
287
  }
236
- return t14;
237
- });
238
- const CardIcon = t0 => {
288
+ let t17;
289
+ if ($[63] !== T1 || $[64] !== t10 || $[65] !== t16) {
290
+ t17 = /*#__PURE__*/jsx(T1, {
291
+ value: t10,
292
+ children: t16
293
+ });
294
+ $[63] = T1;
295
+ $[64] = t10;
296
+ $[65] = t16;
297
+ $[66] = t17;
298
+ } else {
299
+ t17 = $[66];
300
+ }
301
+ return t17;
302
+ }
303
+ CardComponent.displayName = 'Card';
304
+ const CardImpl = fixedForwardRef(CardComponent);
305
+ function CardIcon(t0) {
239
306
  const $ = c(10);
240
307
  const {
241
308
  icon: IconComponent,
@@ -264,6 +331,7 @@ const CardIcon = t0 => {
264
331
  if ($[4] !== ariaLabel || $[5] !== t1 || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
265
332
  t5 = /*#__PURE__*/jsx("span", {
266
333
  className: t1,
334
+ "data-component": "Card.Icon",
267
335
  role: t2,
268
336
  "aria-label": ariaLabel,
269
337
  "aria-hidden": t3,
@@ -279,9 +347,9 @@ const CardIcon = t0 => {
279
347
  t5 = $[9];
280
348
  }
281
349
  return t5;
282
- };
350
+ }
283
351
  CardIcon.displayName = 'Card.Icon';
284
- const CardImage = t0 => {
352
+ function CardImage(t0) {
285
353
  const $ = c(12);
286
354
  let className;
287
355
  let rest;
@@ -317,10 +385,11 @@ const CardImage = t0 => {
317
385
  let t3;
318
386
  if ($[7] !== alt || $[8] !== rest || $[9] !== src || $[10] !== t2) {
319
387
  t3 = /*#__PURE__*/jsx("img", {
388
+ ...rest,
320
389
  src: src,
321
390
  alt: alt,
322
391
  className: t2,
323
- ...rest
392
+ "data-component": "Card.Image"
324
393
  });
325
394
  $[7] = alt;
326
395
  $[8] = rest;
@@ -331,12 +400,21 @@ const CardImage = t0 => {
331
400
  t3 = $[11];
332
401
  }
333
402
  return t3;
334
- };
403
+ }
335
404
  CardImage.displayName = 'Card.Image';
405
+
406
+ /**
407
+ * Heading shown at the top of a Card.
408
+ *
409
+ * When the parent Card uses `as="section"`, the heading's `id` is
410
+ * automatically wired to the section's `aria-labelledby`.
411
+ */
336
412
  const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
337
- const $ = c(13);
413
+ var _id;
414
+ const $ = c(15);
338
415
  let children;
339
416
  let className;
417
+ let id;
340
418
  let rest;
341
419
  let t1;
342
420
  if ($[0] !== t0) {
@@ -344,47 +422,58 @@ const CardHeading = /*#__PURE__*/forwardRef(function CardHeading(t0, ref) {
344
422
  as: t1,
345
423
  children,
346
424
  className,
425
+ id,
347
426
  ...rest
348
427
  } = t0);
349
428
  $[0] = t0;
350
429
  $[1] = children;
351
430
  $[2] = className;
352
- $[3] = rest;
353
- $[4] = t1;
431
+ $[3] = id;
432
+ $[4] = rest;
433
+ $[5] = t1;
354
434
  } else {
355
435
  children = $[1];
356
436
  className = $[2];
357
- rest = $[3];
358
- t1 = $[4];
437
+ id = $[3];
438
+ rest = $[4];
439
+ t1 = $[5];
359
440
  }
360
441
  const Component = t1 === undefined ? "h3" : t1;
361
- let t2;
362
- if ($[5] !== className) {
363
- t2 = clsx(classes.CardHeading, className);
364
- $[5] = className;
365
- $[6] = t2;
442
+ const {
443
+ titleId
444
+ } = useContext(CardContext);
445
+ const t2 = (_id = id) !== null && _id !== void 0 ? _id : titleId;
446
+ let t3;
447
+ if ($[6] !== className) {
448
+ t3 = clsx(classes.CardHeading, className);
449
+ $[6] = className;
450
+ $[7] = t3;
366
451
  } else {
367
- t2 = $[6];
452
+ t3 = $[7];
368
453
  }
369
- let t3;
370
- if ($[7] !== Component || $[8] !== children || $[9] !== ref || $[10] !== rest || $[11] !== t2) {
371
- t3 = /*#__PURE__*/jsx(Component, {
372
- ref: ref,
373
- className: t2,
454
+ let t4;
455
+ if ($[8] !== Component || $[9] !== children || $[10] !== ref || $[11] !== rest || $[12] !== t2 || $[13] !== t3) {
456
+ t4 = /*#__PURE__*/jsx(Component, {
374
457
  ...rest,
458
+ ref: ref,
459
+ id: t2,
460
+ className: t3,
461
+ "data-component": "Card.Heading",
375
462
  children: children
376
463
  });
377
- $[7] = Component;
378
- $[8] = children;
379
- $[9] = ref;
380
- $[10] = rest;
381
- $[11] = t2;
382
- $[12] = t3;
464
+ $[8] = Component;
465
+ $[9] = children;
466
+ $[10] = ref;
467
+ $[11] = rest;
468
+ $[12] = t2;
469
+ $[13] = t3;
470
+ $[14] = t4;
383
471
  } else {
384
- t3 = $[12];
472
+ t4 = $[14];
385
473
  }
386
- return t3;
474
+ return t4;
387
475
  });
476
+ CardHeading.displayName = 'Card.Heading';
388
477
  const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref) {
389
478
  const $ = c(11);
390
479
  let children;
@@ -416,9 +505,10 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
416
505
  let t2;
417
506
  if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
418
507
  t2 = /*#__PURE__*/jsx("p", {
508
+ ...rest,
419
509
  ref: ref,
420
510
  className: t1,
421
- ...rest,
511
+ "data-component": "Card.Description",
422
512
  children: children
423
513
  });
424
514
  $[6] = children;
@@ -431,14 +521,24 @@ const CardDescription = /*#__PURE__*/forwardRef(function CardDescription(t0, ref
431
521
  }
432
522
  return t2;
433
523
  });
434
- const CardMenu = t0 => {
524
+ CardDescription.displayName = 'Card.Description';
525
+
526
+ /**
527
+ * Top-right slot for a single interactive control.
528
+ *
529
+ * Give the control a label that names the card (e.g. `"More options for
530
+ * Project Alpha"`, not just `"More options"`) so users can tell which card
531
+ * the action applies to when several cards are visible.
532
+ */
533
+ function CardMenu(t0) {
435
534
  const $ = c(2);
436
535
  const {
437
536
  children
438
537
  } = t0;
439
538
  let t1;
440
539
  if ($[0] !== children) {
441
- t1 = /*#__PURE__*/jsx(Fragment, {
540
+ t1 = /*#__PURE__*/jsx("div", {
541
+ "data-component": "Card.Menu",
442
542
  children: children
443
543
  });
444
544
  $[0] = children;
@@ -447,7 +547,7 @@ const CardMenu = t0 => {
447
547
  t1 = $[1];
448
548
  }
449
549
  return t1;
450
- };
550
+ }
451
551
  CardMenu.displayName = 'Card.Menu';
452
552
  const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
453
553
  const $ = c(11);
@@ -480,9 +580,10 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
480
580
  let t2;
481
581
  if ($[6] !== children || $[7] !== ref || $[8] !== rest || $[9] !== t1) {
482
582
  t2 = /*#__PURE__*/jsx("div", {
583
+ ...rest,
483
584
  ref: ref,
484
585
  className: t1,
485
- ...rest,
586
+ "data-component": "Card.Metadata",
486
587
  children: children
487
588
  });
488
589
  $[6] = children;
@@ -495,5 +596,6 @@ const CardMetadata = /*#__PURE__*/forwardRef(function CardMetadata(t0, ref) {
495
596
  }
496
597
  return t2;
497
598
  });
599
+ CardMetadata.displayName = 'Card.Metadata';
498
600
 
499
601
  export { CardDescription, CardHeading, CardIcon, CardImage, CardImpl, CardMenu, CardMetadata };
@@ -1,17 +1,20 @@
1
+ import { CardIcon, CardImage, CardMenu } from './Card';
1
2
  import type { CardProps, CardIconProps, CardImageProps, CardHeadingProps, CardDescriptionProps, CardMenuProps, CardMetadataProps } from './Card';
2
- declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ declare const Card: (<As extends "div" | "section">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
3
4
  className?: string;
4
5
  padding?: "none" | "condensed" | "normal";
5
6
  borderRadius?: "medium" | "large";
6
- } & import("react").RefAttributes<HTMLDivElement>> & {
7
- Icon: {
8
- ({ icon: IconComponent, "aria-label": ariaLabel, className }: CardIconProps): import("react").JSX.Element;
9
- displayName: string;
10
- };
11
- Image: {
12
- ({ src, alt, className, ...rest }: CardImageProps): import("react").JSX.Element;
13
- displayName: string;
14
- };
7
+ children: React.ReactNode;
8
+ } extends infer T ? T extends import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "div" : As> & {
9
+ className?: string;
10
+ padding?: "none" | "condensed" | "normal";
11
+ borderRadius?: "medium" | "large";
12
+ children: React.ReactNode;
13
+ } ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
14
+ as?: As | undefined;
15
+ } & import("react").RefAttributes<any>) => React.ReactNode) & {
16
+ Icon: typeof CardIcon;
17
+ Image: typeof CardImage;
15
18
  Heading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
16
19
  as?: "h2" | "h3" | "h4" | "h5" | "h6";
17
20
  children: React.ReactNode;
@@ -19,10 +22,7 @@ declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react
19
22
  Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
20
23
  children: React.ReactNode;
21
24
  } & import("react").RefAttributes<HTMLParagraphElement>>;
22
- Menu: {
23
- ({ children }: CardMenuProps): import("react").JSX.Element;
24
- displayName: string;
25
- };
25
+ Menu: typeof CardMenu;
26
26
  Metadata: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
27
  children: React.ReactNode;
28
28
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EAClB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOR,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA;AACb,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,QAAQ,EAAE,SAAS,EAAgC,QAAQ,EAAe,MAAM,QAAQ,CAAA;AAC1G,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EAClB,MAAM,QAAQ,CAAA;AAEf,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAOR,CAAA;AAEF,OAAO,EAAC,IAAI,EAAC,CAAA;AACb,YAAY,EACV,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,CAAA"}
@@ -2126,18 +2126,40 @@
2126
2126
  "stories": [
2127
2127
  {
2128
2128
  "id": "experimental-components-card--default",
2129
- "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}"
2129
+ "code": "() => {\n return (\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>\n <PeopleIcon size={16} />3 contributors\n </Card.Metadata>\n </Card>\n )\n}"
2130
2130
  },
2131
2131
  {
2132
2132
  "id": "experimental-components-card-features--with-image",
2133
- "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}"
2133
+ "code": "() => {\n return (\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 )\n}"
2134
2134
  },
2135
2135
  {
2136
2136
  "id": "experimental-components-card-features--with-metadata",
2137
- "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}"
2137
+ "code": "() => {\n return (\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 )\n}"
2138
+ },
2139
+ {
2140
+ "id": "experimental-components-card-features--with-menu",
2141
+ "code": "() => {\n return (\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.Menu>\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton\n icon={KebabHorizontalIcon}\n aria-label=\"More options for primer/react\"\n variant=\"invisible\"\n />\n </ActionMenu.Anchor>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.Item>Star</ActionList.Item>\n <ActionList.Item>Watch</ActionList.Item>\n <ActionList.Item>Fork</ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n </Card.Menu>\n </Card>\n )\n}"
2142
+ },
2143
+ {
2144
+ "id": "experimental-components-card-features--standalone-section",
2145
+ "code": "() => (\n <Card as=\"section\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n 'Standalone cards render as a labelled <section> landmark. aria-labelledby is automatically wired to Card.Heading.'\n }\n </Card.Description>\n </Card>\n)"
2146
+ },
2147
+ {
2148
+ "id": "experimental-components-card-features--in-list",
2149
+ "code": "() => (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/react</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/css</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 850 stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/octicons</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 2.1k stars\n </Card.Metadata>\n </Card>\n </li>\n </ul>\n)"
2150
+ },
2151
+ {
2152
+ "id": "experimental-components-card-features--interactive-content",
2153
+ "code": "() => {\n const repos = [\n {\n name: 'primer/react',\n },\n {\n name: 'primer/css',\n },\n {\n name: 'primer/octicons',\n },\n ]\n return (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n {repos.map((repo) => (\n <li key={repo.name}>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>{repo.name}</Card.Description>\n <Card.Metadata>\n <Button leadingVisual={StarIcon} size=\"small\">\n Star <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n <Button leadingVisual={RepoForkedIcon} size=\"small\">\n Fork <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n </Card.Metadata>\n </Card>\n </li>\n ))}\n </ul>\n )\n}"
2138
2154
  }
2139
2155
  ],
2140
2156
  "props": [
2157
+ {
2158
+ "name": "children",
2159
+ "type": "React.ReactNode",
2160
+ "required": true,
2161
+ "description": "The contents of the card. Provide either `Card.*` subcomponents (for example `Card.Heading`, `Card.Description`, `Card.Metadata`) or any custom content. A card with no children will not render."
2162
+ },
2141
2163
  {
2142
2164
  "name": "className",
2143
2165
  "type": "string",
@@ -2154,6 +2176,12 @@
2154
2176
  "type": "'medium' | 'large'",
2155
2177
  "defaultValue": "'large'",
2156
2178
  "description": "Controls the border radius of the Card."
2179
+ },
2180
+ {
2181
+ "name": "as",
2182
+ "type": "'div' | 'section'",
2183
+ "defaultValue": "'div'",
2184
+ "description": "The HTML element to render. Use `'section'` for **standalone** Cards (not inside a list of cards) so screen readers announce the Card as a labelled region. When `Card.Heading` is present, `aria-labelledby` is automatically wired. Use the default `'div'` when the Card is inside an `<li>` of a list of cards."
2157
2185
  }
2158
2186
  ],
2159
2187
  "subcomponents": [
@@ -2195,21 +2223,42 @@
2195
2223
  "name": "as",
2196
2224
  "type": "'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
2197
2225
  "defaultValue": "'h3'",
2198
- "description": "The heading level to render."
2226
+ "description": "The heading level to render. When the parent Card uses `as=\"section\"`, the heading's `id` is automatically wired to the section's `aria-labelledby`."
2199
2227
  }
2200
2228
  ]
2201
2229
  },
2202
2230
  {
2203
2231
  "name": "Card.Description",
2204
- "props": []
2232
+ "props": [
2233
+ {
2234
+ "name": "children",
2235
+ "type": "React.ReactNode",
2236
+ "required": true,
2237
+ "description": "The descriptive text for the card. Rendered inside a `<p>` element so should be flowing text content."
2238
+ }
2239
+ ]
2205
2240
  },
2206
2241
  {
2207
2242
  "name": "Card.Menu",
2208
- "props": []
2243
+ "props": [
2244
+ {
2245
+ "name": "children",
2246
+ "type": "React.ReactNode",
2247
+ "required": true,
2248
+ "description": "Interactive control for the top-right corner of the card."
2249
+ }
2250
+ ]
2209
2251
  },
2210
2252
  {
2211
2253
  "name": "Card.Metadata",
2212
- "props": []
2254
+ "props": [
2255
+ {
2256
+ "name": "children",
2257
+ "type": "React.ReactNode",
2258
+ "required": true,
2259
+ "description": "Metadata content for the bottom of the card. Accepts any content: plain text, icons, or other Primer components."
2260
+ }
2261
+ ]
2213
2262
  }
2214
2263
  ]
2215
2264
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260520195001",
4
+ "version": "0.0.0-20260520211038",
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",
@@ -1,2 +0,0 @@
1
- .prc-AnchoredOverlay-ResponsiveCloseButtonContainer-nuium{position:relative}.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:none;position:absolute;right:var(--base-size-8,.5rem);top:var(--base-size-8,.5rem)}@media screen and (max-width:calc(48rem - 0.02px)){.prc-AnchoredOverlay-ResponsiveCloseButton-z-2rx{display:inline-grid}}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z{position-try-fallbacks:flip-block,flip-inline,flip-block flip-inline,--inline-end-center,--inline-start-center,--fit-block-bottom,--fit-block-top;position-visibility:anchors-visible;position:fixed!important;z-index:100}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[popover]{border:0;inset:auto;margin:0;max-width:none;padding:0}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom]{left:anchor(left);top:calc(anchor(bottom) + var(--base-size-4,.25rem))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom][data-align=left]{left:auto;right:calc(anchor(right) - var(--anchored-overlay-anchor-offset-left))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-bottom][data-align=right]{left:calc(anchor(left) - var(--anchored-overlay-anchor-offset-right))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top]{bottom:anchor(top);left:anchor(left);margin-bottom:var(--base-size-4,.25rem)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top][data-align=left]{left:auto;right:anchor(right)}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-top][data-align=right]{left:calc(anchor(left) - var(--anchored-overlay-anchor-offset-right))}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-left]{margin-right:var(--base-size-4,.25rem);right:anchor(left);top:var(--anchored-overlay-top-override,anchor(top));position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-left-to-bottom}.prc-AnchoredOverlay-AnchoredOverlay-fYg9Z[data-side=outside-right]{left:anchor(right);margin-left:var(--base-size-4,.25rem);top:var(--anchored-overlay-top-override,anchor(top));position-try-fallbacks:flip-inline,flip-block,flip-start,--outside-right-to-bottom}@position-try --outside-left-to-bottom{margin:0;right:anchor(right);top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}@position-try --outside-right-to-bottom{left:anchor(left);margin:0;top:calc(anchor(bottom) + var(--base-size-4,.25rem));width:auto}@position-try --inline-end-center{align-self:anchor-center;bottom:auto;left:anchor(right);margin-left:var(--base-size-4,.25rem);top:auto}@position-try --inline-start-center{align-self:anchor-center;bottom:auto;left:auto;margin-right:var(--base-size-4,.25rem);right:anchor(left);top:auto}@position-try --fit-block-bottom{bottom:var(--base-size-8,.5rem);height:auto;max-height:none;overflow-y:auto;top:calc(anchor(bottom) + var(--base-size-4,.25rem))}@position-try --fit-block-top{bottom:calc(100vh - anchor(top) + var(--base-size-4,.25rem));height:auto;max-height:none;overflow-y:auto;top:var(--base-size-8,.5rem)}
2
- /*# sourceMappingURL=AnchoredOverlay-7fc6a215.css.map */
@@ -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,iJAOiB,CACjB,mCAAoC,CAEpC,wBAA0B,CAD1B,WA8DF,CA3DE,oDAIE,QAAS,CAHT,UAAW,CACX,QAAS,CAGT,cAAe,CAFf,SAGF,CAEA,qEAGE,iBAAkB,CADlB,oDAWF,CARE,sFACE,SAAU,CACV,sEACF,CAEA,uFACE,qEACF,CAGF,kEAEE,kBAAmB,CACnB,iBAAkB,CAFlB,uCAYF,CARE,mFACE,SAAU,CACV,mBACF,CAEA,oFACE,qEACF,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,CAEA,kCAKE,wBAAyB,CAFzB,WAAY,CAFZ,kBAAmB,CAGnB,qCAA+B,CAF/B,QAIF,CAEA,oCAME,wBAAyB,CAFzB,WAAY,CAFZ,SAAU,CAGV,sCAAgC,CAJhC,kBAAmB,CAEnB,QAIF,CAEA,iCAEE,+BAA0B,CAC1B,WAAY,CACZ,eAAgB,CAChB,eAAgB,CAJhB,oDAKF,CAEA,8BAEE,4DAAsD,CACtD,WAAY,CACZ,eAAgB,CAChB,eAAgB,CAJhB,4BAKF","file":"AnchoredOverlay-7fc6a215.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 --inline-end-center,\n --inline-start-center,\n --fit-block-bottom,\n --fit-block-top;\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 &[data-align='right'] {\n left: calc(anchor(left) - var(--anchored-overlay-anchor-offset-right));\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 &[data-align='right'] {\n left: calc(anchor(left) - var(--anchored-overlay-anchor-offset-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\n@position-try --inline-end-center {\n left: anchor(right);\n top: auto;\n bottom: auto;\n margin-left: var(--base-size-4);\n align-self: anchor-center;\n}\n\n@position-try --inline-start-center {\n right: anchor(left);\n left: auto;\n top: auto;\n bottom: auto;\n margin-right: var(--base-size-4);\n align-self: anchor-center;\n}\n\n@position-try --fit-block-bottom {\n top: calc(anchor(bottom) + var(--base-size-4));\n bottom: var(--base-size-8);\n height: auto;\n max-height: none;\n overflow-y: auto;\n}\n\n@position-try --fit-block-top {\n top: var(--base-size-8);\n bottom: calc(100vh - anchor(top) + var(--base-size-4));\n height: auto;\n max-height: none;\n overflow-y: auto;\n}"]}