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;qBACD;oBACD;wBAAC,CAAA,GAAA,0CAAY;wBAAG;4BAAC,MAAM,gCAAU,CAAC,KAAK;wBAAA;qBAAE;oBACzC;wBAAC,CAAA,GAAA,kDAAgB;wBAAG;4BAAC,MAAM,gCAAU,CAAC,KAAK;wBAAA;qBAAE;iBAC9C;0BACA;;;AAKX;AAEO,MAAM,0DAAsB,CAAA,GAAA,uBAAS,EAAE,SAAS,oBACrD,MAAqB,EACrB,GAA2B;IAE3B,IAAI,QAAC,OAAO,KAAI,GAAG;IACnB,qBACE,gCAAC;QAAM,GAAG,MAAK;QAAE,MAAM;QAAM,KAAK;QAAK,OAAO;kBAC3C,CAAA,GAAA,+DAAiB,EAAE,OAAM,QAAQ,EAAE,CAAA,yBAClC,gCAAC,CAAA,GAAA,wCAAO;gBACN,QAAQ;oBACN;wBACE,CAAA,GAAA,wCAAW;wBACX;4BACE,OAAO;gCACL,WAAW;oCACT,KAAK;oCACL,QAAQ;;;;;;;;;;;;;;;;;;;sCAiBL;8CAAC;oCAAI;gCACV;4BACF;wBACF;qBACD;oBACD;wBACE,CAAA,GAAA,0CAAY;wBACZ;4BACE,QAAQ,CAAA,GAAA,6CAAU,EAChB;wBAKJ;qBACD;oBACD;wBAAC,CAAA,GAAA,0CAAY;wBAAG;4BAAC,MAAM,gCAAU,CAAC,KAAK;wBAAA;qBAAE;oBACzC;wBAAC,CAAA,GAAA,kDAAgB;wBAAG;4BAAC,MAAM,gCAAU,CAAC,KAAK;wBAAA;qBAAE;iBAC9C;0BACA;;;AAKX","sources":["packages/@react-spectrum/ai/src/HorizontalCard.tsx"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionMenuContext} from '@react-spectrum/s2/ActionMenu';\nimport {ButtonContext} from '@react-spectrum/s2/Button';\nimport {Checkbox} from '@react-spectrum/s2/Checkbox';\nimport {\n  color,\n  focusRing,\n  lightDark,\n  space,\n  style\n} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {composeRenderProps} from 'react-aria-components/composeRenderProps';\nimport {ContentContext} from '@react-spectrum/s2/Content';\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {DEFAULT_SLOT, Provider} from 'react-aria-components/slots';\nimport {DOMProps, DOMRef, GlobalDOMAttributes} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FooterContext} from '@react-spectrum/s2/Footer';\nimport {GridListItem, GridListItemProps} from 'react-aria-components/GridList';\nimport {ImageContext} from '@react-spectrum/s2/Image';\nimport {ImageCoordinator} from '@react-spectrum/s2/ImageCoordinator';\nimport {inertValue} from 'react-aria/private/utils/inertValue';\nimport {Link} from 'react-aria-components/Link';\nimport {LinkButtonContext} from '@react-spectrum/s2/LinkButton';\nimport {mergeStyles} from '@react-spectrum/s2/mergeStyles';\nimport {pressScale} from '@react-spectrum/s2/pressScale';\nimport {SkeletonContext, useIsSkeleton} from '@react-spectrum/s2/Skeleton';\nimport {StyleString} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {TextContext} from '@react-spectrum/s2/Text';\nimport {useDOMRef} from './useDOMRef';\ninterface HorizontalCardRenderProps {\n  /** The size of the Card. */\n  size: 'XS' | 'S' | 'M' | 'L' | 'XL';\n}\n\nexport interface HorizontalCardProps extends Omit<\n  GridListItemProps,\n  | 'className'\n  | 'style'\n  | 'render'\n  | 'children'\n  | 'onHoverChange'\n  | 'onHoverStart'\n  | 'onHoverEnd'\n  | 'onClick'\n  | keyof GlobalDOMAttributes\n> {\n  /** The children of the Card. */\n  children: ReactNode | ((renderProps: HorizontalCardRenderProps) => ReactNode);\n  /**\n   * The size of the Card.\n   *\n   * @default 'M'\n   */\n  size?: 'XS' | 'S' | 'M' | 'L' | 'XL';\n  /**\n   * The amount of internal padding within the Card.\n   *\n   * @default 'regular'\n   */\n  density?: 'compact' | 'regular' | 'spacious';\n  /**\n   * The visual style of the Card.\n   *\n   * @default 'primary'\n   */\n  variant?: 'primary' | 'secondary' | 'tertiary';\n  /**\n   * Spectrum-defined styles, returned by the `style()` macro.\n   */\n  styles?: StyleString;\n}\n\nexport interface BasicCardProps extends Omit<HorizontalCardProps, 'variant'> {\n  /**\n   * The visual style of the Card.\n   *\n   * @default 'primary'\n   */\n  variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet';\n  /** Whether the card is in an error state. */\n  isInvalid?: boolean;\n}\n\nconst borderRadius = {\n  default: 'lg',\n  size: {\n    XS: 'default',\n    S: 'default'\n  },\n  isBasic: 'default'\n} as const;\n\n// Figma missing a lot of combinations of variant, tshirt, density\n// Quiet Basic cards?\n// Does Basic not participate in selection? (It does, but it's denoted by the border...)\n// Why is there a flipped horizontal card?\n// Max width on contents for horizontal cards? Doesn't appear to be one that includes the preview because the preview can have any ratio and that\n// causes the width grow.\n// (Max) height on cards? Maybe that makes more sense.\n\nconst onlyPreview = ':not(:has([data-slot=content])):not(:has([data-slot=preview]))';\n\nlet card = style({\n  display: 'flex',\n  flexDirection: 'row',\n  position: 'relative',\n  borderRadius,\n  backgroundColor: {\n    default: lightDark('transparent-white-300', 'transparent-black-300'),\n    forcedColors: 'ButtonFace'\n  },\n  // TODO: waiting for design to investigate thumbnail card/attachement error state\n  boxShadow: {\n    default: `[inset 0 0 0 1px light-dark(${color('transparent-black-300')}, ${color('transparent-white-300')})]`,\n    isInvalid: `[inset 0 0 0 1px ${color('negative-900')}]`\n  },\n  forcedColorAdjust: 'none',\n  transition: 'default',\n  fontFamily: 'sans',\n  textDecoration: 'none',\n  overflow: {\n    default: 'clip',\n    variant: {\n      quiet: 'visible'\n    }\n  },\n  contain: 'layout',\n  disableTapHighlight: true,\n  userSelect: {\n    isCardView: 'none'\n  },\n  cursor: {\n    isLink: 'pointer'\n  },\n  height: {\n    default: {\n      size: {\n        XS: 160,\n        S: 180,\n        M: 200,\n        L: 220,\n        XL: 240\n      }\n    },\n    isBasic: {\n      default: 68,\n      size: {\n        XS: 52,\n        S: 60,\n        M: 68,\n        L: 76,\n        XL: 80\n      }\n    },\n    isCardView: 'full'\n  },\n  width: {\n    default: 'full',\n    [onlyPreview]: 'auto'\n  },\n  aspectRatio: {\n    [onlyPreview]: '1/1'\n  },\n  '--card-spacing': {\n    type: 'paddingTop',\n    value: {\n      density: {\n        compact: {\n          size: {\n            XS: '[6px]',\n            S: 8,\n            M: 12,\n            L: 16,\n            XL: 20\n          }\n        },\n        regular: {\n          size: {\n            XS: 8,\n            S: 12,\n            M: 16,\n            L: 20,\n            XL: 24\n          }\n        },\n        spacious: {\n          size: {\n            XS: 12,\n            S: 16,\n            M: 20,\n            L: 24,\n            XL: 28\n          }\n        }\n      },\n      [onlyPreview]: 0\n    }\n  },\n  alignItems: {\n    isBasic: 'center'\n  },\n  '--card-padding-y': {\n    type: 'paddingTop',\n    value: {\n      default: '--card-spacing'\n    }\n  },\n  '--card-padding-x': {\n    type: 'paddingStart',\n    value: {\n      default: '--card-spacing'\n    }\n  },\n  paddingY: '--card-padding-y',\n  paddingX: '--card-padding-x',\n  boxSizing: 'border-box',\n  ...focusRing(),\n  outlineStyle: {\n    default: 'none',\n    isFocusVisible: 'solid',\n    // Focus ring moves to preview when quiet.\n    variant: {\n      quiet: 'none'\n    }\n  },\n  '--basic-thumb-size': {\n    type: 'height',\n    value: {\n      default: 68,\n      size: {\n        XS: 24,\n        S: 26,\n        M: 32,\n        L: 36,\n        XL: 40\n      },\n      [onlyPreview]: 'full'\n    }\n  }\n});\n\nlet selectionIndicator = style({\n  position: 'absolute',\n  inset: 0,\n  zIndex: 2,\n  borderRadius,\n  pointerEvents: 'none',\n  borderWidth: 2,\n  borderStyle: 'solid',\n  borderColor: 'gray-1000',\n  transition: 'default',\n  opacity: {\n    default: 0,\n    isSelected: 1\n  },\n  // Quiet cards with no checkbox have an extra inner stroke\n  // to distinguish the selection indicator from the preview.\n  outlineColor: lightDark('transparent-white-600', 'transparent-black-600'),\n  outlineOffset: -4,\n  outlineStyle: {\n    default: 'none',\n    isStrokeInner: 'solid'\n  },\n  outlineWidth: 2\n});\n\nlet preview = style({\n  position: 'relative',\n  transition: 'default',\n  overflow: 'clip',\n  marginY: 'calc(var(--card-padding-y) * -1)',\n  marginStart: 'calc(var(--card-padding-x) * -1)',\n  marginEnd: {\n    ':last-child': 'calc(var(--card-padding-x) * -1)'\n  },\n  borderRadius: {\n    isQuiet: borderRadius\n  },\n  boxShadow: {\n    isQuiet: {\n      isHovered: 'elevated',\n      isFocusVisible: 'elevated',\n      isSelected: 'elevated'\n    }\n  },\n  ...focusRing(),\n  outlineStyle: {\n    default: 'none',\n    isQuiet: {\n      isFocusVisible: 'solid'\n    }\n  }\n});\n\nconst image = style({\n  height: 'full',\n  aspectRatio: '1/1',\n  objectFit: 'cover',\n  userSelect: 'none',\n  pointerEvents: 'none'\n});\n\nlet title = style({\n  font: 'title',\n  fontSize: {\n    size: {\n      XS: 'title-xs',\n      S: 'title-xs',\n      M: 'title-sm',\n      L: 'title',\n      XL: 'title-lg'\n    }\n  },\n  lineClamp: 3,\n  gridArea: 'title'\n});\n\nlet description = style({\n  font: 'body',\n  fontSize: {\n    size: {\n      XS: 'body-2xs',\n      S: 'body-2xs',\n      M: 'body-xs',\n      L: 'body-sm',\n      XL: 'body'\n    }\n  },\n  lineClamp: 3,\n  gridArea: 'description'\n});\n\nlet content = style({\n  display: 'grid',\n  // By default, all elements are displayed in a stack.\n  // If an action menu is present, place it next to the title.\n  gridTemplateColumns: {\n    default: ['1fr'],\n    ':has([data-slot=menu])': ['minmax(0, 1fr)', 'auto']\n  },\n  gridTemplateAreas: {\n    default: ['title', 'description'],\n    ':has([data-slot=menu])': ['title menu', 'description description']\n  },\n  columnGap: 4,\n  flexGrow: 1,\n  alignItems: 'baseline',\n  alignContent: 'start',\n  rowGap: {\n    size: {\n      XS: 4,\n      S: 4,\n      M: space(6),\n      L: space(6),\n      XL: 8\n    }\n  },\n  paddingStart: {\n    default: '--card-spacing',\n    ':first-child': 0\n  },\n  paddingEnd: {\n    default: 'calc(var(--card-spacing) * 1.5 / 2)',\n    ':last-child': 0\n  }\n});\n\nlet actionMenu = style({\n  gridArea: 'menu',\n  // Don't cause the row to expand, preserve gap between title and description text.\n  // Would use -100% here but it doesn't work in Firefox.\n  marginY: 'calc(-1 * self(height))'\n});\n\nlet footer = style({\n  display: 'flex',\n  flexDirection: 'row',\n  alignItems: 'center',\n  justifyContent: 'space-between',\n  gap: 8\n});\n\nexport const InternalCardViewContext = createContext({\n  ElementType: 'div' as 'div' | typeof GridListItem,\n  layout: 'grid' as 'grid' | 'waterfall'\n});\n\ninterface InternalCardContextValue {\n  isQuiet: boolean;\n  size: 'XS' | 'S' | 'M' | 'L' | 'XL';\n  isSelected: boolean;\n  isHovered: boolean;\n  isFocusVisible: boolean;\n  isPressed: boolean;\n  isCheckboxSelection: boolean;\n}\n\nconst InternalCardContext = createContext<InternalCardContextValue>({\n  isQuiet: false,\n  size: 'M',\n  isSelected: false,\n  isHovered: false,\n  isFocusVisible: false,\n  isPressed: false,\n  isCheckboxSelection: true\n});\n\nconst actionButtonSize = {\n  XS: 'XS',\n  S: 'XS',\n  M: 'S',\n  L: 'M',\n  XL: 'L'\n} as const;\n\nconst Card = forwardRef(function Card(\n  props: Omit<HorizontalCardProps, 'variant'> & {\n    isBasic?: boolean;\n    isInvalid?: boolean;\n    variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet';\n  },\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {ElementType} = useContext(InternalCardViewContext);\n  let domRef = useDOMRef(ref);\n  let {\n    isBasic = false,\n    isInvalid = false,\n    density = 'regular',\n    size = 'M',\n    variant = 'primary',\n    styles,\n    id,\n    ...otherProps\n  } = props;\n  let isQuiet = variant === 'quiet';\n  let isSkeleton = useIsSkeleton();\n  let children = (\n    <Provider\n      values={[\n        [ImageContext, {alt: '', styles: image}],\n        [\n          TextContext,\n          {\n            slots: {\n              [DEFAULT_SLOT]: {},\n              title: {styles: title({size})},\n              description: {styles: description({size})}\n            }\n          }\n        ],\n        [\n          ContentContext,\n          {\n            styles: content({size}),\n            // @ts-ignore\n            'data-slot': 'content'\n          }\n        ],\n        [FooterContext, {styles: footer}],\n        [\n          ActionMenuContext,\n          {\n            isQuiet: true,\n            size: actionButtonSize[size],\n            isDisabled: isSkeleton,\n            // @ts-ignore\n            'data-slot': 'menu',\n            styles: actionMenu\n          }\n        ],\n        [SkeletonContext, isSkeleton]\n      ]}>\n      <ImageCoordinator>\n        {typeof props.children === 'function' ? props.children({size}) : props.children}\n      </ImageCoordinator>\n    </Provider>\n  );\n\n  // oxlint-disable-next-line react/react-compiler\n  let press = pressScale(domRef);\n  if (ElementType === 'div' && !isSkeleton && props.href) {\n    // Standalone Card that has an href should be rendered as a Link.\n    // NOTE: In this case, the card must not contain interactive elements.\n    return (\n      <Link\n        {...filterDOMProps(otherProps, {isLink: true})}\n        ref={domRef as any}\n        className={renderProps =>\n          mergeStyles(\n            card({\n              ...renderProps,\n              size,\n              density,\n              variant,\n              isBasic,\n              isInvalid,\n              isCardView: false,\n              isLink: true\n            }),\n            styles\n          )\n        }\n        style={renderProps =>\n          // Only the preview in quiet cards scales down on press\n          variant === 'quiet' ? undefined : press(renderProps)\n        }>\n        {renderProps => (\n          <InternalCardContext.Provider\n            value={{size, isQuiet, isCheckboxSelection: false, isSelected: false, ...renderProps}}>\n            {children}\n          </InternalCardContext.Provider>\n        )}\n      </Link>\n    );\n  }\n\n  if (ElementType === 'div' || isSkeleton) {\n    return (\n      <div\n        {...filterDOMProps(otherProps)}\n        id={id != null ? String(id) : undefined}\n        aria-invalid={isInvalid || undefined}\n        // @ts-ignore - React < 19 compat\n        inert={inertValue(isSkeleton)}\n        ref={domRef}\n        className={mergeStyles(\n          card({size, density, variant, isBasic, isInvalid, isCardView: ElementType !== 'div'}),\n          styles\n        )}>\n        <InternalCardContext.Provider\n          value={{\n            size,\n            isQuiet,\n            isCheckboxSelection: false,\n            isHovered: false,\n            isFocusVisible: false,\n            isSelected: false,\n            isPressed: false\n          }}>\n          {children}\n        </InternalCardContext.Provider>\n      </div>\n    );\n  }\n\n  return (\n    <ElementType\n      {...props}\n      ref={domRef}\n      aria-invalid={isInvalid || undefined}\n      className={renderProps =>\n        mergeStyles(\n          card({\n            ...renderProps,\n            isCardView: true,\n            isLink: !!props.href,\n            size,\n            density,\n            variant,\n            isBasic,\n            isInvalid\n          }),\n          styles\n        )\n      }\n      style={renderProps =>\n        // Only the preview in quiet cards scales down on press\n        variant === 'quiet' ? undefined : press(renderProps)\n      }>\n      {({selectionMode, selectionBehavior, isHovered, isFocusVisible, isSelected, isPressed}) => (\n        <InternalCardContext.Provider\n          value={{\n            size,\n            isQuiet,\n            isCheckboxSelection: selectionMode !== 'none' && selectionBehavior === 'toggle',\n            isHovered,\n            isFocusVisible,\n            isSelected,\n            isPressed\n          }}>\n          {/* Selection indicator and checkbox move inside the preview for quiet cards */}\n          {!isQuiet && <SelectionIndicator />}\n          {!isQuiet && selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n            <CardCheckbox />\n          )}\n          {/* this makes the :first-child selector work even with the checkbox */}\n          <div className={style({display: 'contents'})}>{children}</div>\n        </InternalCardContext.Provider>\n      )}\n    </ElementType>\n  );\n});\n\nfunction SelectionIndicator() {\n  let {size, isSelected, isQuiet, isCheckboxSelection} = useContext(InternalCardContext);\n  return (\n    <div\n      className={selectionIndicator({\n        size,\n        isSelected,\n        // Add an inner stroke only for quiet cards with no checkbox to\n        // help distinguish the selected state from the preview.\n        isStrokeInner: isQuiet && !isCheckboxSelection\n      })}\n    />\n  );\n}\n\nfunction CardCheckbox() {\n  let {size} = useContext(InternalCardContext);\n  return (\n    <div\n      className={style({\n        position: 'absolute',\n        top: '--card-spacing',\n        insetStart: '--card-spacing',\n        zIndex: 2,\n        padding: 4,\n        backgroundColor: lightDark('transparent-white-600', 'transparent-black-600'),\n        borderRadius: 'default',\n        boxShadow: 'emphasized'\n      })}>\n      <Checkbox slot=\"selection\" excludeFromTabOrder size={size === 'XS' ? 'S' : size} />\n    </div>\n  );\n}\n\nexport interface CardPreviewProps extends DOMProps {\n  children: ReactNode;\n  /**\n   * Spectrum-defined styles, returned by the `style()` macro.\n   */\n  styles?: StyleString;\n}\n\n// TODO: this should be the same component as the one in @react-spectrum/s2/Card\nexport const CardPreview = forwardRef(function CardPreview(\n  props: CardPreviewProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {size, isQuiet, isHovered, isFocusVisible, isSelected, isPressed, isCheckboxSelection} =\n    useContext(InternalCardContext);\n  let domRef = useDOMRef(ref);\n  // oxlint-disable react/react-compiler\n  return (\n    <div\n      {...filterDOMProps(props)}\n      slot=\"preview\"\n      ref={domRef}\n      className={preview({size, isQuiet, isHovered, isFocusVisible, isSelected})}\n      style={isQuiet ? pressScale(domRef)({isPressed}) : undefined}>\n      {isQuiet && <SelectionIndicator />}\n      {isQuiet && isCheckboxSelection && <CardCheckbox />}\n      <div className={style({borderRadius: 'inherit', overflow: 'clip', height: 'full'})}>\n        {props.children}\n      </div>\n    </div>\n  );\n  // oxlint-enable react/react-compiler\n});\n\nconst collection = style({\n  display: 'grid',\n  gridTemplateColumns: 'repeat(3, 1fr)',\n  gap: {\n    default: 4,\n    size: {\n      XS: 2,\n      S: 2\n    }\n  }\n});\n\nconst collectionImage = style({\n  width: 'full',\n  gridColumnEnd: {\n    ':nth-last-child(4):first-child': 'span 3'\n  },\n  objectFit: 'cover',\n  pointerEvents: 'none',\n  userSelect: 'none'\n});\n\nexport const CollectionCardPreview = forwardRef(function CollectionCardPreview(\n  props: CardPreviewProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {size} = useContext(InternalCardContext)!;\n  return (\n    <CardPreview {...props} ref={ref}>\n      <div className={collection({size})}>\n        <ImageContext.Provider value={{styles: collectionImage}}>\n          {props.children}\n        </ImageContext.Provider>\n      </div>\n    </CardPreview>\n  );\n});\n\nconst buttonSize = {\n  XS: 'S',\n  S: 'S',\n  M: 'M',\n  L: 'L',\n  XL: 'XL'\n} as const;\n\nexport const HorizontalCard = forwardRef(function HorizontalCard(\n  props: HorizontalCardProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {size = 'M'} = props;\n  return (\n    <Card {...props} size={size} ref={ref}>\n      {composeRenderProps(props.children, children => (\n        <Provider\n          values={[\n            [\n              ImageContext,\n              {\n                slots: {\n                  preview: {\n                    alt: '',\n                    styles: style({\n                      height: 'full',\n                      objectFit: 'cover',\n                      pointerEvents: 'none',\n                      userSelect: 'none'\n                    })\n                  },\n                  thumbnail: {\n                    alt: '',\n                    styles: style({\n                      // if there is a preview sibling, the thumbnail should be absolute\n                      // otherwise, it should be relative\n                      position: 'absolute',\n                      insetStart: 8,\n                      bottom: 8,\n                      pointerEvents: 'none',\n                      userSelect: 'none',\n                      size: {\n                        size: {\n                          XS: 24,\n                          S: 26,\n                          M: 32,\n                          L: 36,\n                          XL: 40\n                        }\n                      },\n                      borderRadius: {\n                        default: 'default',\n                        size: {\n                          XS: 'sm',\n                          S: 'sm'\n                        }\n                      },\n                      objectFit: 'cover',\n                      outlineStyle: 'solid',\n                      outlineWidth: {\n                        default: 2,\n                        size: {\n                          XS: 1\n                        }\n                      },\n                      outlineColor: '--s2-container-bg'\n                    })({size})\n                  }\n                }\n              }\n            ],\n            [\n              FooterContext,\n              {\n                styles: mergeStyles(\n                  footer,\n                  style({\n                    justifyContent: 'end'\n                  })\n                )\n              }\n            ],\n            [ButtonContext, {size: buttonSize[size]}],\n            [LinkButtonContext, {size: buttonSize[size]}]\n          ]}>\n          {children}\n        </Provider>\n      ))}\n    </Card>\n  );\n});\n\nexport const BasicHorizontalCard = forwardRef(function BasicHorizontalCard(\n  props: BasicCardProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {size = 'M'} = props;\n  return (\n    <Card {...props} size={size} ref={ref} isBasic>\n      {composeRenderProps(props.children, children => (\n        <Provider\n          values={[\n            [\n              ImageContext,\n              {\n                slots: {\n                  thumbnail: {\n                    alt: '',\n                    styles: style({\n                      position: 'relative',\n                      alignSelf: 'center',\n                      flexShrink: 0,\n                      pointerEvents: 'none',\n                      userSelect: 'none',\n                      size: '--basic-thumb-size',\n                      borderRadius: '[3px]',\n                      objectFit: 'cover',\n                      outlineStyle: 'solid',\n                      outlineWidth: {\n                        default: 2,\n                        size: {\n                          XS: 1\n                        }\n                      },\n                      outlineColor: '--s2-container-bg'\n                    })({size})\n                  }\n                }\n              }\n            ],\n            [\n              FooterContext,\n              {\n                styles: mergeStyles(\n                  footer,\n                  style({\n                    justifyContent: 'end'\n                  })\n                )\n              }\n            ],\n            [ButtonContext, {size: buttonSize[size]}],\n            [LinkButtonContext, {size: buttonSize[size]}]\n          ]}>\n          {children}\n        </Provider>\n      ))}\n    </Card>\n  );\n});\n"],"names":[],"version":3,"file":"HorizontalCard.cjs.map"}