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oBAAK;8BAClF,cAAA,gCAAC,CAAA,GAAA,gEAAU;;8BAEb,gCAAC;oBAAK,SAAS;8BAAwC;;;;;AAI7D,qCAAqC;AACvC;AAeA,MAAM;AAMN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcN,MAAM;AASC,MAAM,0DAAwB,CAAA,GAAA,uBAAS,EAAE,SAAS,sBACvD,KAAiC,EACjC,GAA2B;IAE3B,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,YAAC,QAAQ,SAAE,KAAK,UAAE,MAAM,QAAE,OAAO,KAAI,GAAG;IAE5C,qBACE,iCAAC;QACE,GAAG,CAAA,GAAA,6CAAa,EAAE,OAAO;YAAC,WAAW;QAAI,EAAE;QAC5C,KAAK;QACL,WAAW,CAAA,GAAA,6CAAU,EAAE,kCAAY;;0BACnC,gCAAC;gBAAG,WAAW,kCAAY;0BAAC;gBAAI;0BAAK;;0BACrC,gCAAC,+CAAyB,QAAQ;gBAAC,OAAO;oBAAC,WAAW;gBAAI;0BACxD,cAAA,gCAAC;oBAAI,WAAW;8BAAiB;;;;;AAIzC","sources":["packages/@react-spectrum/ai/src/MessageSuggestion.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 {AriaLabelingProps, DOMProps, DOMRef, GlobalDOMAttributes} from '@react-types/shared';\nimport ArrowCurved from '@react-spectrum/s2/icons/ArrowCurved';\nimport {\n  baseColor,\n  centerPadding,\n  focusRing,\n  style\n} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {ButtonProps, Button as RACButton} from 'react-aria-components/Button';\nimport {CenterBaseline} from '@react-spectrum/s2/CenterBaseline';\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {IconContext} from '@react-spectrum/s2/Icon';\nimport {mergeStyles} from '@react-spectrum/s2/mergeStyles';\nimport {pressScale} from '@react-spectrum/s2';\nimport {Provider, SlotProps} from 'react-aria-components/slots';\nimport {StyleString} from '@react-spectrum/s2/style' with {type: 'macro'};\nimport {useDOMRef} from './useDOMRef';\nimport {useLocale} from 'react-aria/I18nProvider';\n\nconst controlSizeM = {\n  default: 32,\n  size: {\n    XS: 20,\n    S: 24,\n    L: 40,\n    XL: 48\n  }\n} as const;\n\nexport interface MessageSuggestionProps extends Omit<\n  ButtonProps,\n  'style' | 'className' | 'isPending' | 'isDisabled' | 'render' | keyof GlobalDOMAttributes\n> {\n  /** The text content of the suggestion. */\n  children: ReactNode;\n  /**\n   * The size of the MessageSuggestion.\n   *\n   * @default 'M'\n   */\n  size?: 'S' | 'M' | 'L' | 'XL';\n  /** Spectrum-defined styles, returned by the `style()` macro. */\n  styles?: StyleString;\n}\n\nconst MessageSuggestionContext = createContext<{groupSize?: 'S' | 'M' | 'L' | 'XL'}>({});\n\nconst suggestionStyles = style<{\n  isHovered: boolean;\n  isPressed: boolean;\n  isDisabled: boolean;\n  isFocusVisible: boolean;\n  isFocused: boolean;\n  size: 'S' | 'M' | 'L' | 'XL';\n}>({\n  display: 'flex',\n  flexDirection: 'row',\n  alignItems: 'baseline',\n  gap: 'text-to-visual',\n  paddingX: 'pill',\n  paddingY: 0,\n  '--labelPadding': {\n    type: 'paddingTop',\n    value: centerPadding()\n  },\n  minHeight: controlSizeM,\n  borderRadius: 'pill',\n  font: {\n    size: {\n      S: 'body-sm',\n      M: 'body',\n      L: 'body-lg',\n      XL: 'body-xl'\n    }\n  },\n  backgroundColor: baseColor('gray-100'),\n  color: 'neutral',\n  borderStyle: 'none',\n  disableTapHighlight: true,\n  transition: 'default',\n  textAlign: 'start',\n  ...focusRing()\n});\n\n/**\n * MessageSuggestion renders a single pressable suggestion in a conversation.\n */\nexport const MessageSuggestion = forwardRef(function MessageSuggestion(\n  props: MessageSuggestionProps,\n  ref: DOMRef<HTMLButtonElement>\n) {\n  let domRef = useDOMRef<HTMLButtonElement>(ref);\n  let {children, styles, size = 'M', ...otherProps} = props;\n  let {direction} = useLocale();\n  let isRTL = direction === 'rtl';\n\n  let {groupSize} = useContext(MessageSuggestionContext);\n  size = groupSize ? groupSize : size;\n\n  // oxlint-disable react/react-compiler\n  return (\n    <RACButton\n      {...filterDOMProps(props, {labelable: true})}\n      {...otherProps}\n      ref={domRef}\n      style={pressScale(domRef)}\n      className={renderProps => mergeStyles(suggestionStyles({...renderProps, size}), styles)}>\n      <Provider\n        values={[\n          [\n            IconContext,\n            {\n              styles: style({\n                flexShrink: 0,\n                '--iconPrimary': {\n                  type: 'fill',\n                  value: 'currentColor'\n                }\n              })\n            }\n          ]\n        ]}>\n        <CenterBaseline styles={style({order: 0, transform: {isRTL: 'scale(-1, 1)'}})({isRTL})}>\n          <ArrowCurved />\n        </CenterBaseline>\n        <span className={style({paddingY: '--labelPadding'})}>{children}</span>\n      </Provider>\n    </RACButton>\n  );\n  // oxlint-enable react/react-compiler\n});\n\nexport interface MessageSuggestionListProps extends DOMProps, AriaLabelingProps, SlotProps {\n  /** The MessageSuggestion children to display. */\n  children: ReactNode;\n  /** Heading displayed above the suggestions. */\n  title: string;\n  /** The size of hte Buttons within the MessageSuggestionList. */\n  size?: 'S' | 'M' | 'L' | 'XL';\n  /**\n   * Spectrum-defined styles, returned by the `style()` macro.\n   */\n  styles?: StyleString;\n}\n\nconst listStyles = style({\n  display: 'flex',\n  flexDirection: 'column',\n  gap: 8\n});\n\nconst titleStyles = style({\n  font: {\n    size: {\n      S: 'title-sm',\n      M: 'title',\n      L: 'title-lg',\n      XL: 'title-xl'\n    }\n  },\n  color: 'neutral',\n  margin: 0,\n  padding: 0\n});\n\nconst responseStyles = style({\n  display: 'flex',\n  flexWrap: 'wrap',\n  gap: 8\n});\n\n/**\n * MessageSuggestionList renders a group of suggestion responses with a title heading.\n */\nexport const MessageSuggestionList = forwardRef(function MessageSuggestionList(\n  props: MessageSuggestionListProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let domRef = useDOMRef(ref);\n  let {children, title, styles, size = 'M'} = props;\n\n  return (\n    <div\n      {...filterDOMProps(props, {labelable: true})}\n      ref={domRef}\n      className={mergeStyles(listStyles, styles)}>\n      <h3 className={titleStyles({size})}>{title}</h3>\n      <MessageSuggestionContext.Provider value={{groupSize: size}}>\n        <div className={responseStyles}>{children}</div>\n      </MessageSuggestionContext.Provider>\n    </div>\n  );\n});\n"],"names":[],"version":3,"file":"MessageSuggestion.cjs.map"}