`, and inside a dialog takes the id the popup points
* `aria-labelledby` at, so the card names the dialog without knowing it is in one.
@@ -271,9 +307,9 @@ const Footer = React.forwardRef>(fun
});
/**
- * A styled surface composed through `Card.Root`, `Card.Header`, `Card.Title`, `Card.Description`,
- * `Card.Banner`, `Card.Content`, and `Card.Footer`. Every part accepts the Mosaic `render` prop and
- * forwards its ref.
+ * A styled surface composed through `Card.Root`, `Card.Header`, `Card.Media`, `Card.Title`,
+ * `Card.Description`, `Card.Banner`, `Card.Content`, and `Card.Footer`. Every part accepts the Mosaic
+ * `render` prop and forwards its ref.
*
* `Card.Banner` is a message slot between the header and the content. It is always rendered, and
* a `Banner` expands into it while its children hold a message, collapsing again once they are
@@ -282,4 +318,4 @@ const Footer = React.forwardRef>(fun
* Rendered as the content of a `Dialog.Popup`, the card reads that surface from `DialogContext`:
* the title and description take the popup's ARIA ids, and the header carries the dismiss button.
*/
-export const Card = { Root, Header, Title, Description, Banner: CardBanner, Content, Footer };
+export const Card = { Root, Header, Media, Title, Description, Banner: CardBanner, Content, Footer };
diff --git a/packages/mosaic/src/components/card/index.ts b/packages/mosaic/src/components/card/index.ts
index 8d998d68918..e68e9b40726 100644
--- a/packages/mosaic/src/components/card/index.ts
+++ b/packages/mosaic/src/components/card/index.ts
@@ -1,2 +1,2 @@
export { Card } from './card';
-export type { CardBannerProps, CardProps, CardSize } from './card';
+export type { CardBannerProps, CardHeaderAlign, CardHeaderProps, CardProps, CardSize } from './card';
diff --git a/packages/swingset/src/stories/card.component.mdx b/packages/swingset/src/stories/card.component.mdx
index 3882d6984ef..56e7846a96b 100644
--- a/packages/swingset/src/stories/card.component.mdx
+++ b/packages/swingset/src/stories/card.component.mdx
@@ -29,6 +29,10 @@ import { Card } from '@clerk/mosaic/components/card';
```
+`Card.Media` goes first in `Card.Header`, above the title, for a logo, icon or image. It leaves 24px below it.
+
+`Card.Header` takes `align='center'` to center its content.
+
`Card.Banner` sits between the header and the content and is always rendered. While its children hold a message, a `Banner` of the given `color` expands into it; once they are empty it collapses again. Give it `role='alert'` so the message is announced.
Buttons in `Card.Footer` are full width by default. Pass `fullWidth={false}` to opt out. A `Dialog.Popup` or `Popover.Popup` rendered inside the footer doesn't inherit this.
@@ -37,6 +41,22 @@ Buttons in `Card.Footer` are full width by default. Pass `fullWidth={false}` to
## Examples
+### Media
+
+
+
+### OAuth consent
+
+`Card.Media` can hold more than one logo. Here it shows the two apps being connected.
+
+
+
### Banner
) {
);
}
+export function WithMedia() {
+ return (
+
+
+
+
+
+
+
+
+ Join Clerk
+ You have been invited to this organization.
+
+
+
+
+
+ );
+}
+
+export function OAuthConsent() {
+ return (
+
+
+
+
+
+
+