@razorpay/blade 12.9.1 → 12.11.0
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/build/lib/native/components/ChatMessage/ChatMessage.native.js +12 -0
- package/build/lib/native/components/ChatMessage/ChatMessage.native.js.map +1 -0
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/native/components/index.js +1 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +100 -0
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -0
- package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js +39 -0
- package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -0
- package/build/lib/web/development/components/ChatMessage/Rotate.web.js +37 -0
- package/build/lib/web/development/components/ChatMessage/Rotate.web.js.map +1 -0
- package/build/lib/web/development/components/ChatMessage/SelfMessageBubble.web.js +42 -0
- package/build/lib/web/development/components/ChatMessage/SelfMessageBubble.web.js.map +1 -0
- package/build/lib/web/development/components/ChatMessage/index.js +2 -0
- package/build/lib/web/development/components/ChatMessage/index.js.map +1 -0
- package/build/lib/web/development/components/ChatMessage/token.js +18 -0
- package/build/lib/web/development/components/ChatMessage/token.js.map +1 -0
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +15 -5
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -1
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +1 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +100 -0
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -0
- package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js +39 -0
- package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -0
- package/build/lib/web/production/components/ChatMessage/Rotate.web.js +37 -0
- package/build/lib/web/production/components/ChatMessage/Rotate.web.js.map +1 -0
- package/build/lib/web/production/components/ChatMessage/SelfMessageBubble.web.js +42 -0
- package/build/lib/web/production/components/ChatMessage/SelfMessageBubble.web.js.map +1 -0
- package/build/lib/web/production/components/ChatMessage/index.js +2 -0
- package/build/lib/web/production/components/ChatMessage/index.js.map +1 -0
- package/build/lib/web/production/components/ChatMessage/token.js +18 -0
- package/build/lib/web/production/components/ChatMessage/token.js.map +1 -0
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +15 -5
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -1
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +1 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/types/components/index.d.ts +90 -2
- package/build/types/components/index.native.d.ts +90 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../../../../src/components/Input/TextArea/TextArea.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\nimport React from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'onSubmit'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'maxCharacters'\n | 'autoFocus'\n | 'numberOfLines'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextAreaPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextAreaPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextAreaProps = (TextAreaPropsWithA11yLabel | TextAreaPropsWithLabel) & TextAreaCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextArea: React.ForwardRefRenderFunction<BladeElementRef, TextAreaProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition,\n necessityIndicator,\n errorText,\n helpText,\n successText,\n validationState,\n defaultValue,\n isDisabled,\n isRequired,\n name,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n isTaggedInput,\n tags,\n onTagChange,\n ...rest\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n const [isInputFocussed, setIsInputFocussed] = React.useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n tags,\n onTagChange,\n isDisabled,\n inputRef,\n isTaggedInput,\n name,\n value,\n onChange,\n });\n\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (value?.length || defaultValue?.length)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): React.ReactNode => {\n if (shouldShowClearButton) {\n return (\n <BaseBox paddingTop=\"spacing.3\" marginTop=\"spacing.1\">\n <IconButton\n icon={CloseIcon}\n accessibilityLabel=\"Clear textarea content\"\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(inputRef.current)) {\n inputRef.current.clear();\n inputRef.current.focus();\n } else if (inputRef.current instanceof HTMLTextAreaElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n />\n </BaseBox>\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n as=\"textarea\"\n id=\"textarea\"\n maxTagRows=\"multiple\"\n componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n isDropdownTrigger={isTaggedInput}\n showAllTags={isInputFocussed}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n necessityIndicator={necessityIndicator}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n validationState={validationState}\n isDisabled={isDisabled}\n isRequired={isRequired}\n name={name}\n maxCharacters={maxCharacters}\n placeholder={placeholder}\n trailingInteractionElement={renderInteractionElement()}\n defaultValue={defaultValue}\n value={value}\n numberOfLines={numberOfLines}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n }}\n onSubmit={onSubmit}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n }}\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextArea = assignWithoutSideEffects(React.forwardRef(_TextArea), {\n displayName: 'TextArea',\n});\n\nexport type { TextAreaProps };\nexport { TextArea };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextArea","_ref","ref","label","accessibilityLabel","labelPosition","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","isTaggedInput","tags","onTagChange","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState3","_React$useState4","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","Object","assign","as","id","maxTagRows","componentName","MetaConstants","TextArea","undefined","isDropdownTrigger","showAllTags","hideLabelText","trailingInteractionElement","_ref2","e","onKeyDown","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;gYA8FA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAIC,aAAkB,CAA4C,CACnF,OAAOC,eAAe,EAAE,GAAK,cAAc,CAC7C,CAAC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AC3E,KAAK,CAAK,CAAA4E,IAAAA,aAAA,CAC7B,OAAO3E,aAAa,CAClB0C,GAAA,CAACC,OAAO,CAACE,CAAAA,SAAS,CAAE+B,aAAa,CAACpE,IAAI,CAAE,CAACqE,WAAW,CAAC,WAAW,CAAA/B,QAAA,CAC9DJ,GAAA,CAACoC,gBAAgB,CAAA,CAACC,YAAY,CAAAJ,CAAAA,aAAA,CAAE5E,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEyC,MAAM,GAAAmC,IAAAA,CAAAA,aAAA,CAAI,CAAE,CAACK,QAAQ,CAAEhF,aAAc,CAAE,CAAC,CACxE,CAAC,CACR,IAAI,CACV,CAAE,CACFM,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CACPI,CAAAA,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAAqD,QAAQ,CAAGgB,wBAAwB,CAACjE,cAAK,CAACkE,UAAU,CAACvG,SAAS,CAAC,CAAE,CACrEwG,WAAW,CAAE,UACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../../../../src/components/Input/TextArea/TextArea.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\nimport React from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'onSubmit'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'maxCharacters'\n | 'autoFocus'\n | 'numberOfLines'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n onKeyDown?: ({\n name,\n value,\n event,\n }: {\n name?: FormInputOnKeyDownEvent['name'];\n value: string;\n event: FormInputOnKeyDownEvent['event'];\n }) => void;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextAreaPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextAreaPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextAreaProps = (TextAreaPropsWithA11yLabel | TextAreaPropsWithLabel) & TextAreaCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextArea: React.ForwardRefRenderFunction<BladeElementRef, TextAreaProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition,\n necessityIndicator,\n errorText,\n helpText,\n successText,\n validationState,\n defaultValue,\n isDisabled,\n isRequired,\n name,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n onKeyDown,\n placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n isTaggedInput,\n tags,\n onTagChange,\n ...rest\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n const [isInputFocussed, setIsInputFocussed] = React.useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n tags,\n onTagChange,\n isDisabled,\n inputRef,\n isTaggedInput,\n name,\n value,\n onChange,\n });\n\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (value?.length || defaultValue?.length)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): React.ReactNode => {\n if (shouldShowClearButton) {\n return (\n <BaseBox paddingTop=\"spacing.3\" marginTop=\"spacing.1\">\n <IconButton\n icon={CloseIcon}\n accessibilityLabel=\"Clear textarea content\"\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(inputRef.current)) {\n inputRef.current.clear();\n inputRef.current.focus();\n } else if (inputRef.current instanceof HTMLTextAreaElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n />\n </BaseBox>\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n as=\"textarea\"\n id=\"textarea\"\n maxTagRows=\"multiple\"\n componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n isDropdownTrigger={isTaggedInput}\n showAllTags={isInputFocussed}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n necessityIndicator={necessityIndicator}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n validationState={validationState}\n isDisabled={isDisabled}\n isRequired={isRequired}\n name={name}\n maxCharacters={maxCharacters}\n placeholder={placeholder}\n trailingInteractionElement={renderInteractionElement()}\n defaultValue={defaultValue}\n value={value}\n numberOfLines={numberOfLines}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n onKeyDown?.({\n name: e.name,\n value: e.event.currentTarget.value,\n event: e.event,\n });\n }}\n onSubmit={onSubmit}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n }}\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextArea = assignWithoutSideEffects(React.forwardRef(_TextArea), {\n displayName: 'TextArea',\n});\n\nexport type { TextAreaProps };\nexport { TextArea };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextArea","_ref","ref","label","accessibilityLabel","labelPosition","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","onKeyDown","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","isTaggedInput","tags","onTagChange","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState3","_React$useState4","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","Object","assign","as","id","maxTagRows","componentName","MetaConstants","TextArea","undefined","isDropdownTrigger","showAllTags","hideLabelText","trailingInteractionElement","_ref2","e","event","currentTarget","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,iBAAA,CAAA,cAAA,CAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,UAAA,CAAA,SAAA,CAAA,QAAA,CAAA,UAAA,CAAA,WAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,eAAA,CAAA,QAAA,CAAA,MAAA,CAAA,eAAA,CAAA,MAAA,CAAA,aAAA,CAAA,CAwGA,IAAMA,a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AA,SAAAA,CAAC2E,CAAC,CAAK,CAChBzC,wBAAwB,CAACyC,CAAC,CAAC,CAC3B3E,UAAS,EAATA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,UAAS,CAAG,CACVL,IAAI,CAAEgF,CAAC,CAAChF,IAAI,CACZO,KAAK,CAAEyE,CAAC,CAACC,KAAK,CAACC,aAAa,CAAC3E,KAAK,CAClC0E,KAAK,CAAED,CAAC,CAACC,KACX,CAAC,CAAC,CACJ,CAAE,CACF7E,QAAQ,CAAEA,QAAS,CACnB+E,kBAAkB,CAAE,SAAAA,kBAAAA,CAAC5E,KAAK,CAAK,CAAA6E,IAAAA,aAAA,CAC7B,OAAO5E,aAAa,CAClB0C,GAAA,CAACC,OAAO,CAACE,CAAAA,SAAS,CAAEgC,aAAa,CAACrE,IAAI,CAAE,CAACsE,WAAW,CAAC,WAAW,CAAAhC,QAAA,CAC9DJ,GAAA,CAACqC,gBAAgB,CAACC,CAAAA,YAAY,CAAAJ,CAAAA,aAAA,CAAE7E,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEyC,MAAM,GAAAoC,IAAAA,CAAAA,aAAA,CAAI,CAAE,CAACK,QAAQ,CAAEjF,aAAc,CAAE,CAAC,CACxE,CAAC,CACR,IAAI,CACV,CAAE,CACFM,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CAAA,CACPI,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAAqD,QAAQ,CAAGiB,wBAAwB,CAAClE,cAAK,CAACmE,UAAU,CAACzG,SAAS,CAAC,CAAE,CACrE0G,WAAW,CAAE,UACf,CAAC;;;;"}
|
|
@@ -29,6 +29,7 @@ export { Carousel } from './Carousel/Carousel.native.js';
|
|
|
29
29
|
export { CarouselItem } from './Carousel/CarouselItem.native.js';
|
|
30
30
|
export { Checkbox } from './Checkbox/Checkbox.js';
|
|
31
31
|
export { CheckboxGroup } from './Checkbox/CheckboxGroup/CheckboxGroup.js';
|
|
32
|
+
export { ChatMessage } from './ChatMessage/ChatMessage.native.js';
|
|
32
33
|
export { Chip } from './Chip/Chip.js';
|
|
33
34
|
export { ChipGroup } from './Chip/ChipGroup.js';
|
|
34
35
|
export { Collapsible } from './Collapsible/Collapsible.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',AccordionItemHeader:'accordion-item-header',AccordionItemBody:'accordion-item-body',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Avatar:'avatar',AvatarGroup:'avatar-group',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',ButtonGroup:'button-group',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',BottomNav:'bottomnav',BottomNavItem:'bottomnav-item',Carousel:'carousel',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Drawer:'drawer',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',DatePicker:'datepicker',Calendar:'calendar',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',SearchInput:'search-input',TextArea:'textarea',TextInput:'textinput',PhoneNumberInput:'phone-number-input',Toast:'toast',ToastContainer:'toast-container',TopNav:'top-nav',TopNavBrand:'top-nav-brand',TopNavContent:'top-nav-content',TopNavActions:'top-nav-actions',TabNav:'tab-nav',TabNavItems:'tab-nav-items',TabNavItem:'tab-nav-item',TabNavItemLink:'tab-nav-item-link',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SideNav:'sidenav',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableCellWrapper:'table-cell-wrapper',TableSortButton:'table-sort-button',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TablePageSelectionButton:'table-page-selection-button',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Menu:'menu',MenuHeader:'menu-header',MenuFooter:'menu-footer',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton',StepGroup:'step-group',StepItem:'step-item'};
|
|
1
|
+
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',AccordionItemHeader:'accordion-item-header',AccordionItemBody:'accordion-item-body',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Avatar:'avatar',AvatarGroup:'avatar-group',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',ButtonGroup:'button-group',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',BottomNav:'bottomnav',BottomNavItem:'bottomnav-item',Carousel:'carousel',ChatMessage:'chat-message',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Drawer:'drawer',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',DatePicker:'datepicker',Calendar:'calendar',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',SearchInput:'search-input',TextArea:'textarea',TextInput:'textinput',PhoneNumberInput:'phone-number-input',Toast:'toast',ToastContainer:'toast-container',TopNav:'top-nav',TopNavBrand:'top-nav-brand',TopNavContent:'top-nav-content',TopNavActions:'top-nav-actions',TabNav:'tab-nav',TabNavItems:'tab-nav-items',TabNavItem:'tab-nav-item',TabNavItemLink:'tab-nav-item-link',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SideNav:'sidenav',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableCellWrapper:'table-cell-wrapper',TableSortButton:'table-sort-button',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TablePageSelectionButton:'table-page-selection-button',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Menu:'menu',MenuHeader:'menu-header',MenuFooter:'menu-footer',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton',StepGroup:'step-group',StepItem:'step-item'};
|
|
2
2
|
|
|
3
3
|
export { MetaConstants };
|
|
4
4
|
//# sourceMappingURL=metaConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n AccordionItemHeader: 'accordion-item-header',\n AccordionItemBody: 'accordion-item-body',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Avatar: 'avatar',\n AvatarGroup: 'avatar-group',\n Badge: 'badge',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n ButtonGroup: 'button-group',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n BottomNav: 'bottomnav',\n BottomNavItem: 'bottomnav-item',\n Carousel: 'carousel',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Drawer: 'drawer',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n DatePicker: 'datepicker',\n Calendar: 'calendar',\n FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n SearchInput: 'search-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n PhoneNumberInput: 'phone-number-input',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n TopNav: 'top-nav',\n TopNavBrand: 'top-nav-brand',\n TopNavContent: 'top-nav-content',\n TopNavActions: 'top-nav-actions',\n TabNav: 'tab-nav',\n TabNavItems: 'tab-nav-items',\n TabNavItem: 'tab-nav-item',\n TabNavItemLink: 'tab-nav-item-link',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SideNav: 'sidenav',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableCellWrapper: 'table-cell-wrapper',\n TableSortButton: 'table-sort-button',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TablePageSelectionButton: 'table-page-selection-button',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Menu: 'menu',\n MenuHeader: 'menu-header',\n MenuFooter: 'menu-footer',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n StepGroup: 'step-group',\n StepItem: 'step-item',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Avatar","AvatarGroup","Badge","Box","BaseBox","BaseText","Button","ButtonGroup","Breadcrumb","BreadcrumbItem","BottomNav","BottomNavItem","Carousel","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","DatePicker","Calendar","FileUpload","FileUploadItem","FileUploadLabel","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","SearchInput","TextArea","TextInput","PhoneNumberInput","Toast","ToastContainer","TopNav","TopNavBrand","TopNavContent","TopNavActions","TabNav","TabNavItems","TabNavItem","TabNavItemLink","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SideNav","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableCellWrapper","TableSortButton","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TablePageSelectionButton","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Menu","MenuHeader","MenuFooter","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton","StepGroup","StepItem"],"mappings":"AAAa,IAAAA,aAAa,CAAG,CAC3BC,SAAS,CAAE,WAAW,CACtBC,eAAe,CAAE,kBAAkB,CACnCC,aAAa,CAAE,gBAAgB,CAC/BC,mBAAmB,CAAE,uBAAuB,CAC5CC,iBAAiB,CAAE,qBAAqB,CACxCC,UAAU,CAAE,aAAa,CACzBC,cAAc,CAAE,kBAAkB,CAClCC,iBAAiB,CAAE,qBAAqB,CACxCC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,YAAY,CAAE,cAAc,CAC5BC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,KAAK,CAAE,OAAO,CACdC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,UAAU,CAAE,YAAY,CACxBC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,WAAW,CACtBC,aAAa,CAAE,gBAAgB,CAC/BC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,aAAa,CAAE,gBAAgB,CAC/BC,aAAa,CAAE,gBAAgB,CAC/BC,IAAI,CAAE,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,OAAO,CACdC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBAAgB,CAC/BC,kBAAkB,CAAE,sBAAsB,CAC1CC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,YAAY,CACvBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UAAU,CACpBC,SAAS,CAAE,YAAY,CACvBC,QAAQ,CAAE,WACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n AccordionItemHeader: 'accordion-item-header',\n AccordionItemBody: 'accordion-item-body',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Avatar: 'avatar',\n AvatarGroup: 'avatar-group',\n Badge: 'badge',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n ButtonGroup: 'button-group',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n BottomNav: 'bottomnav',\n BottomNavItem: 'bottomnav-item',\n Carousel: 'carousel',\n ChatMessage: 'chat-message',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Drawer: 'drawer',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n DatePicker: 'datepicker',\n Calendar: 'calendar',\n FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n SearchInput: 'search-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n PhoneNumberInput: 'phone-number-input',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n TopNav: 'top-nav',\n TopNavBrand: 'top-nav-brand',\n TopNavContent: 'top-nav-content',\n TopNavActions: 'top-nav-actions',\n TabNav: 'tab-nav',\n TabNavItems: 'tab-nav-items',\n TabNavItem: 'tab-nav-item',\n TabNavItemLink: 'tab-nav-item-link',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SideNav: 'sidenav',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableCellWrapper: 'table-cell-wrapper',\n TableSortButton: 'table-sort-button',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TablePageSelectionButton: 'table-page-selection-button',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Menu: 'menu',\n MenuHeader: 'menu-header',\n MenuFooter: 'menu-footer',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n StepGroup: 'step-group',\n StepItem: 'step-item',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Avatar","AvatarGroup","Badge","Box","BaseBox","BaseText","Button","ButtonGroup","Breadcrumb","BreadcrumbItem","BottomNav","BottomNavItem","Carousel","ChatMessage","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","DatePicker","Calendar","FileUpload","FileUploadItem","FileUploadLabel","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","SearchInput","TextArea","TextInput","PhoneNumberInput","Toast","ToastContainer","TopNav","TopNavBrand","TopNavContent","TopNavActions","TabNav","TabNavItems","TabNavItem","TabNavItemLink","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SideNav","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableCellWrapper","TableSortButton","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TablePageSelectionButton","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Menu","MenuHeader","MenuFooter","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton","StepGroup","StepItem"],"mappings":"AAAa,IAAAA,aAAa,CAAG,CAC3BC,SAAS,CAAE,WAAW,CACtBC,eAAe,CAAE,kBAAkB,CACnCC,aAAa,CAAE,gBAAgB,CAC/BC,mBAAmB,CAAE,uBAAuB,CAC5CC,iBAAiB,CAAE,qBAAqB,CACxCC,UAAU,CAAE,aAAa,CACzBC,cAAc,CAAE,kBAAkB,CAClCC,iBAAiB,CAAE,qBAAqB,CACxCC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,YAAY,CAAE,cAAc,CAC5BC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,KAAK,CAAE,OAAO,CACdC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,UAAU,CAAE,YAAY,CACxBC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,WAAW,CACtBC,aAAa,CAAE,gBAAgB,CAC/BC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,cAAc,CAC3BC,QAAQ,CAAE,UAAU,CACpBC,aAAa,CAAE,gBAAgB,CAC/BC,aAAa,CAAE,gBAAgB,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a,CACzBC,KAAK,CAAE,OAAO,CACdC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBAAgB,CAC/BC,kBAAkB,CAAE,sBAAsB,CAC1CC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,YAAY,CACvBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UAAU,CACpBC,SAAS,CAAE,YAAY,CACvBC,QAAQ,CAAE,WACZ;;;;"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { SelfMessageBubble } from './SelfMessageBubble.web.js';
|
|
5
|
+
import { DefaultMessageBubble } from './DefaultMessageBubble.web.js';
|
|
6
|
+
import '../Typography/index.js';
|
|
7
|
+
import '../Box/BaseBox/index.js';
|
|
8
|
+
import '../../utils/getStringChildren/index.js';
|
|
9
|
+
import '../../utils/assignWithoutSideEffects/index.js';
|
|
10
|
+
import '../../utils/metaAttribute/index.js';
|
|
11
|
+
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
12
|
+
import '../Box/styledProps/index.js';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
15
|
+
import { getStringFromReactText } from '../../utils/getStringChildren/getStringChildren.js';
|
|
16
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
17
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
18
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
19
|
+
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
20
|
+
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
21
|
+
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
22
|
+
|
|
23
|
+
var _excluded = ["messageType", "senderType", "isLoading", "validationState", "errorText", "onClick", "footerActions", "children", "leading", "loadingText", "wordBreak", "maxWidth"];
|
|
24
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
+
var ButtonResetCss = {
|
|
27
|
+
background: 'none',
|
|
28
|
+
border: 'none',
|
|
29
|
+
padding: undefined,
|
|
30
|
+
cursor: 'pointer',
|
|
31
|
+
color: 'inherit',
|
|
32
|
+
font: 'inherit',
|
|
33
|
+
textAlign: 'left',
|
|
34
|
+
outline: 'inherit',
|
|
35
|
+
appearance: 'none',
|
|
36
|
+
backgroundColor: 'inherit'
|
|
37
|
+
};
|
|
38
|
+
var _ChatMessage = function _ChatMessage(_ref, ref) {
|
|
39
|
+
var _ref$messageType = _ref.messageType,
|
|
40
|
+
messageType = _ref$messageType === void 0 ? 'default' : _ref$messageType,
|
|
41
|
+
_ref$senderType = _ref.senderType,
|
|
42
|
+
senderType = _ref$senderType === void 0 ? 'self' : _ref$senderType,
|
|
43
|
+
_ref$isLoading = _ref.isLoading,
|
|
44
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
45
|
+
_ref$validationState = _ref.validationState,
|
|
46
|
+
validationState = _ref$validationState === void 0 ? 'none' : _ref$validationState,
|
|
47
|
+
errorText = _ref.errorText,
|
|
48
|
+
onClick = _ref.onClick,
|
|
49
|
+
footerActions = _ref.footerActions,
|
|
50
|
+
children = _ref.children,
|
|
51
|
+
leading = _ref.leading,
|
|
52
|
+
loadingText = _ref.loadingText,
|
|
53
|
+
_ref$wordBreak = _ref.wordBreak,
|
|
54
|
+
wordBreak = _ref$wordBreak === void 0 ? 'break-word' : _ref$wordBreak,
|
|
55
|
+
maxWidth = _ref.maxWidth,
|
|
56
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
// since we can pass both string and Card component as children, we need to check if children is string or Card component
|
|
58
|
+
// if children is string or array of string, we need to wrap it in Text component otherwise we will pass children as it is
|
|
59
|
+
var shouldWrapInText = typeof children === 'string' || Array.isArray(children) && children.every(function (child) {
|
|
60
|
+
return typeof child === 'string';
|
|
61
|
+
}) || isLoading;
|
|
62
|
+
var finalChildren = shouldWrapInText ? /*#__PURE__*/jsx(Text, {
|
|
63
|
+
color: isLoading ? 'surface.text.gray.muted' : 'surface.text.gray.normal',
|
|
64
|
+
weight: "regular",
|
|
65
|
+
variant: "body",
|
|
66
|
+
size: "medium",
|
|
67
|
+
wordBreak: wordBreak,
|
|
68
|
+
children: isLoading ? loadingText : getStringFromReactText(children)
|
|
69
|
+
}) : children;
|
|
70
|
+
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
71
|
+
onClick: onClick
|
|
72
|
+
}, onClick ? _objectSpread({}, ButtonResetCss) : {}), metaAttribute({
|
|
73
|
+
name: MetaConstants.ChatMessage,
|
|
74
|
+
testID: props.testID
|
|
75
|
+
})), makeAnalyticsAttribute(props)), getStyledProps(props)), {}, {
|
|
76
|
+
maxWidth: maxWidth,
|
|
77
|
+
ref: ref,
|
|
78
|
+
as: onClick ? 'button' : undefined,
|
|
79
|
+
children: senderType === 'self' ? /*#__PURE__*/jsx(SelfMessageBubble, {
|
|
80
|
+
validationState: validationState,
|
|
81
|
+
errorText: errorText,
|
|
82
|
+
children: finalChildren,
|
|
83
|
+
messageType: messageType,
|
|
84
|
+
isChildText: shouldWrapInText
|
|
85
|
+
}) : /*#__PURE__*/jsx(DefaultMessageBubble, {
|
|
86
|
+
children: finalChildren,
|
|
87
|
+
leading: leading,
|
|
88
|
+
isLoading: isLoading,
|
|
89
|
+
footerActions: footerActions,
|
|
90
|
+
isChildText: shouldWrapInText
|
|
91
|
+
})
|
|
92
|
+
}));
|
|
93
|
+
};
|
|
94
|
+
var ChatMessage = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_ChatMessage), {
|
|
95
|
+
displayName: 'ChatMessage',
|
|
96
|
+
componentId: MetaConstants.ChatMessage
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export { ChatMessage };
|
|
100
|
+
//# sourceMappingURL=ChatMessage.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatMessage.web.js","sources":["../../../../../../src/components/ChatMessage/ChatMessage.web.tsx"],"sourcesContent":["import React from 'react';\nimport { SelfMessageBubble } from './SelfMessageBubble.web';\nimport { DefaultMessageBubble } from './DefaultMessageBubble.web';\nimport type { ChatMessageProps } from './types';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStringFromReactText } from '~utils/getStringChildren';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeElementRef } from '~utils/types';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\n\nconst ButtonResetCss = {\n background: 'none',\n border: 'none',\n padding: undefined,\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n textAlign: 'left' as const,\n outline: 'inherit',\n appearance: 'none',\n backgroundColor: 'inherit',\n};\n\nconst _ChatMessage: React.ForwardRefRenderFunction<BladeElementRef, ChatMessageProps> = (\n {\n messageType = 'default',\n senderType = 'self',\n isLoading = false,\n validationState = 'none',\n errorText,\n onClick,\n footerActions,\n children,\n leading,\n loadingText,\n wordBreak = 'break-word',\n maxWidth,\n ...props\n }: ChatMessageProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n // since we can pass both string and Card component as children, we need to check if children is string or Card component\n // if children is string or array of string, we need to wrap it in Text component otherwise we will pass children as it is\n const shouldWrapInText =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every((child) => typeof child === 'string')) ||\n isLoading;\n\n const finalChildren = shouldWrapInText ? (\n <Text\n color={isLoading ? 'surface.text.gray.muted' : 'surface.text.gray.normal'}\n weight=\"regular\"\n variant=\"body\"\n size=\"medium\"\n wordBreak={wordBreak}\n >\n {isLoading ? loadingText : getStringFromReactText(children as string | string[])}\n </Text>\n ) : (\n (children as React.ReactElement)\n );\n\n return (\n <BaseBox\n onClick={onClick}\n {...(onClick ? { ...ButtonResetCss } : {})}\n {...metaAttribute({ name: MetaConstants.ChatMessage, testID: props.testID })}\n {...makeAnalyticsAttribute(props)}\n {...getStyledProps(props)}\n maxWidth={maxWidth}\n ref={ref as never}\n as={onClick ? 'button' : undefined}\n >\n {senderType === 'self' ? (\n <SelfMessageBubble\n validationState={validationState}\n errorText={errorText}\n children={finalChildren}\n messageType={messageType}\n isChildText={shouldWrapInText}\n />\n ) : (\n <DefaultMessageBubble\n children={finalChildren}\n leading={leading}\n isLoading={isLoading}\n footerActions={footerActions}\n isChildText={shouldWrapInText}\n />\n )}\n </BaseBox>\n );\n};\n\nconst ChatMessage = assignWithoutSideEffects(React.forwardRef(_ChatMessage), {\n displayName: 'ChatMessage',\n componentId: MetaConstants.ChatMessage,\n});\nexport { ChatMessage };\n"],"names":["ButtonResetCss","background","border","padding","undefined","cursor","color","font","textAlign","outline","appearance","backgroundColor","_ChatMessage","_ref","ref","_ref$messageType","messageType","_ref$senderType","senderType","_ref$isLoading","isLoading","_ref$validationState","validationState","errorText","onClick","footerActions","children","leading","loadingText","_ref$wordBreak","wordBreak","maxWidth","props","_objectWithoutProperties","_excluded","shouldWrapInText","Array","isArray","every","child","finalChildren","_jsx","Text","weight","variant","size","getStringFromReactText","BaseBox","_objectSpread","metaAttribute","name","MetaConstants","ChatMessage","testID","makeAnalyticsAttribute","getStyledProps","as","SelfMessageBubble","isChildText","DefaultMessageBubble","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,cAAc,GAAG;AACrBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,MAAM,EAAE,MAAM;AACdC,EAAAA,OAAO,EAAEC,SAAS;AAClBC,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,SAAS,EAAE,MAAe;AAC1BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,UAAU,EAAE,MAAM;AAClBC,EAAAA,eAAe,EAAE,SAAA;AACnB,CAAC,CAAA;AAED,IAAMC,YAA+E,GAAG,SAAlFA,YAA+EA,CAAAC,IAAA,EAgBnFC,GAA+B,EACR;AAAA,EAAA,IAAAC,gBAAA,GAAAF,IAAA,CAfrBG,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,gBAAA;IAAAE,eAAA,GAAAJ,IAAA,CACvBK,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,eAAA;IAAAE,cAAA,GAAAN,IAAA,CACnBO,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;IAAAE,oBAAA,GAAAR,IAAA,CACjBS,e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Eb,aAAa,CAACC,WAAAA;AAC7B,CAAC;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import Rotate from './Rotate.web.js';
|
|
3
|
+
import '../Box/BaseBox/index.js';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
6
|
+
|
|
7
|
+
var DefaultMessageBubble = function DefaultMessageBubble(_ref) {
|
|
8
|
+
var children = _ref.children,
|
|
9
|
+
leading = _ref.leading,
|
|
10
|
+
isLoading = _ref.isLoading,
|
|
11
|
+
footerActions = _ref.footerActions,
|
|
12
|
+
isChildText = _ref.isChildText;
|
|
13
|
+
return /*#__PURE__*/jsx(BaseBox, {
|
|
14
|
+
children: /*#__PURE__*/jsxs(BaseBox, {
|
|
15
|
+
display: "grid",
|
|
16
|
+
gridTemplateColumns: "auto 1fr",
|
|
17
|
+
gridTemplateRows: "auto auto",
|
|
18
|
+
columnGap: "spacing.4",
|
|
19
|
+
children: [/*#__PURE__*/jsx(BaseBox, {
|
|
20
|
+
padding: "spacing.2",
|
|
21
|
+
children: /*#__PURE__*/jsx(Rotate, {
|
|
22
|
+
animate: isLoading,
|
|
23
|
+
children: leading
|
|
24
|
+
})
|
|
25
|
+
}), /*#__PURE__*/jsx(BaseBox, {
|
|
26
|
+
display: "flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
paddingY: isChildText ? 'spacing.2' : 'spacing.0',
|
|
29
|
+
children: children
|
|
30
|
+
}), /*#__PURE__*/jsx(BaseBox, {
|
|
31
|
+
gridColumn: "2",
|
|
32
|
+
children: footerActions
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { DefaultMessageBubble };
|
|
39
|
+
//# sourceMappingURL=DefaultMessageBubble.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultMessageBubble.web.js","sources":["../../../../../../src/components/ChatMessage/DefaultMessageBubble.web.tsx"],"sourcesContent":["import React from 'react';\nimport Rotate from './Rotate.web';\nimport type { CommonChatMessageProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst DefaultMessageBubble = ({\n children,\n leading,\n isLoading,\n footerActions,\n isChildText,\n}: Pick<CommonChatMessageProps, 'children' | 'leading' | 'isLoading' | 'footerActions'> & {\n isChildText: boolean;\n}): React.ReactElement => {\n return (\n <BaseBox>\n <BaseBox\n display=\"grid\"\n gridTemplateColumns=\"auto 1fr\"\n gridTemplateRows=\"auto auto\"\n columnGap=\"spacing.4\"\n >\n <BaseBox padding=\"spacing.2\">\n <Rotate animate={isLoading}>{leading as React.ReactElement}</Rotate>\n </BaseBox>\n\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n paddingY={isChildText ? 'spacing.2' : 'spacing.0'}\n >\n {children}\n </BaseBox>\n\n <BaseBox gridColumn=\"2\">{footerActions}</BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport { DefaultMessageBubble };\n"],"names":["DefaultMessageBubble","_ref","children","leading","isLoading","footerActions","isChildText","_jsx","BaseBox","_jsxs","display","gridTemplateColumns","gridTemplateRows","columnGap","padding","Rotate","animate","alignItems","paddingY","gridColumn"],"mappings":";;;;;;AAKA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAQA;AAAA,EAAA,IAPxBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,WAAW,GAAAL,IAAA,CAAXK,WAAW,CAAA;EAIX,oBACEC,GAAA,CAACC,OAAO,EAAA;IAAAN,QAAA,eACNO,IAAA,CAACD,OAAO,EAAA;AACNE,MAAAA,OAAO,EAAC,MAAM;AACdC,MAAAA,mBAAmB,EAAC,UAAU;AAC9BC,MAAAA,gBAAgB,EAAC,WAAW;AAC5BC,MAAAA,SAAS,EAAC,WAAW;MAAAX,QAAA,EAAA,cAErBK,GAAA,CAACC,OAAO,EAAA;AAACM,QAAAA,OAAO,EAAC,WAAW;QAAAZ,QAAA,eAC1BK,GAAA,CAACQ,MAAM,EAAA;AAACC,UAAAA,OAAO,EAAEZ,SAAU;AAAAF,UAAAA,QAAA,EAAEC,OAAAA;SAAsC,CAAA;AAAC,OAC7D,CAAC,eAEVI,GAAA,CAACC,OAAO,EAAA;AACNE,QAAAA,OAAO,EAAC,MAAM;AACdO,QAAAA,UAAU,EAAC,QAAQ;AACnBC,QAAAA,QAAQ,EAAEZ,WAAW,GAAG,WAAW,GAAG,WAAY;AAAAJ,QAAAA,QAAA,EAEjDA,QAAAA;AAAQ,OACF,CAAC,eAEVK,GAAA,CAACC,OAAO,EAAA;AAACW,QAAAA,UAAU,EAAC,GAAG;AAAAjB,QAAAA,QAAA,EAAEG,aAAAA;AAAa,OAAU,CAAC,CAAA;KAC1C,CAAA;AAAC,GACH,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import { m } from 'framer-motion';
|
|
3
|
+
import '../../utils/index.js';
|
|
4
|
+
import '../BladeProvider/index.js';
|
|
5
|
+
import { msToSeconds } from '../../utils/msToSeconds.js';
|
|
6
|
+
import { cssBezierToArray } from '../../utils/cssBezierToArray.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
import useTheme from '../BladeProvider/useTheme.js';
|
|
9
|
+
import { castWebType } from '../../utils/platform/castUtils.js';
|
|
10
|
+
|
|
11
|
+
var Rotate = function Rotate(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
animate = _ref.animate;
|
|
14
|
+
var _useTheme = useTheme(),
|
|
15
|
+
theme = _useTheme.theme;
|
|
16
|
+
if (!animate) {
|
|
17
|
+
return children;
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/jsx(m.div, {
|
|
20
|
+
style: {
|
|
21
|
+
display: 'flex'
|
|
22
|
+
},
|
|
23
|
+
animate: {
|
|
24
|
+
rotate: 90
|
|
25
|
+
},
|
|
26
|
+
transition: {
|
|
27
|
+
duration: msToSeconds(theme.motion.duration.gentle),
|
|
28
|
+
repeat: Infinity,
|
|
29
|
+
ease: cssBezierToArray(castWebType(theme.motion.easing.emphasized)),
|
|
30
|
+
delay: msToSeconds(theme.motion.delay.gentle)
|
|
31
|
+
},
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { Rotate as default };
|
|
37
|
+
//# sourceMappingURL=Rotate.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rotate.web.js","sources":["../../../../../../src/components/ChatMessage/Rotate.web.tsx"],"sourcesContent":["import React from 'react';\nimport { m } from 'framer-motion';\nimport { castWebType } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { msToSeconds } from '~utils/msToSeconds';\nimport { cssBezierToArray } from '~utils/cssBezierToArray';\n\nconst Rotate = ({\n children,\n animate,\n}: {\n children: React.ReactElement;\n animate?: boolean;\n}): React.ReactElement => {\n const { theme } = useTheme();\n\n if (!animate) {\n return children;\n }\n\n return (\n <m.div\n style={{\n display: 'flex',\n }}\n animate={{ rotate: 90 }}\n transition={{\n duration: msToSeconds(theme.motion.duration.gentle),\n repeat: Infinity,\n ease: cssBezierToArray(castWebType(theme.motion.easing.emphasized)),\n delay: msToSeconds(theme.motion.delay.gentle),\n }}\n >\n {children}\n </m.div>\n );\n};\n\nexport default Rotate;\n"],"names":["Rotate","_ref","children","animate","_useTheme","useTheme","theme","_jsx","m","div","style","display","rotate","transition","duration","msToSeconds","motion","gentle","repeat","Infinity","ease","cssBezierToArray","castWebType","easing","emphasized","delay"],"mappings":";;;;;;;;;;AAOA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAMc;AAAA,EAAA,IALxBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,OAAO,GAAAF,IAAA,CAAPE,OAAO,CAAA;AAKP,EAAA,IAAAC,SAAA,GAAkBC,QAAQ,EAAE;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK,CAAA;EAEb,IAAI,CAACH,OAAO,EAAE;AACZ,IAAA,OAAOD,QAAQ,CAAA;AACjB,GAAA;AAEA,EAAA,oBACEK,GAAA,CAACC,CAAC,CAACC,GAAG,EAAA;AACJC,IAAAA,KAAK,EAAE;AACLC,MAAAA,OAAO,EAAE,MAAA;KACT;AACFR,IAAAA,OAAO,EAAE;AAAES,MAAAA,MAAM,EAAE,EAAA;KAAK;AACxBC,IAAAA,UAAU,EAAE;MACVC,QAAQ,EAAEC,WAAW,CAACT,KAAK,CAACU,MAAM,CAACF,QAAQ,CAACG,MAAM,CAAC;AACnDC,MAAAA,MAAM,EAAEC,QAAQ;AAChBC,MAAAA,IAAI,EAAEC,gBAAgB,CAACC,WAAW,CAAChB,KAAK,CAACU,MAAM,CAACO,MAAM,CAACC,UAAU,CAAC,CAAC;MACnEC,KAAK,EAAEV,WAAW,CAACT,KAAK,CAACU,MAAM,CAACS,KAAK,CAACR,MAAM,CAAA;KAC5C;AAAAf,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACJ,CAAC,CAAA;AAEZ;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import { chatMessageToken } from './token.js';
|
|
3
|
+
import '../Box/BaseBox/index.js';
|
|
4
|
+
import { FormHint } from '../Form/FormHint.js';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
7
|
+
|
|
8
|
+
var SelfMessageBubble = function SelfMessageBubble(_ref) {
|
|
9
|
+
var children = _ref.children,
|
|
10
|
+
validationState = _ref.validationState,
|
|
11
|
+
_ref$errorText = _ref.errorText,
|
|
12
|
+
errorText = _ref$errorText === void 0 ? 'Message not sent. Tap to retry.' : _ref$errorText,
|
|
13
|
+
messageType = _ref.messageType,
|
|
14
|
+
isChildText = _ref.isChildText;
|
|
15
|
+
var isError = validationState === 'error';
|
|
16
|
+
return /*#__PURE__*/jsxs(BaseBox, {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
children: [/*#__PURE__*/jsx(BaseBox, {
|
|
20
|
+
backgroundColor: isError ? chatMessageToken.self.backgroundColor.error : chatMessageToken.self.backgroundColor["default"],
|
|
21
|
+
padding: isChildText ? 'spacing.4' : 'spacing.0',
|
|
22
|
+
borderTopLeftRadius: chatMessageToken.self.borderTopLeftRadius,
|
|
23
|
+
borderTopRightRadius: chatMessageToken.self.borderTopRightRadius,
|
|
24
|
+
borderBottomLeftRadius: chatMessageToken.self.borderBottomLeftRadius,
|
|
25
|
+
borderBottomRightRadius: messageType === 'last' ? chatMessageToken.self.borderBottomRightRadiusForLastMessage : chatMessageToken.self.borderBottomRightRadius,
|
|
26
|
+
width: "fit-content",
|
|
27
|
+
height: "auto",
|
|
28
|
+
alignSelf: "flex-end",
|
|
29
|
+
children: children
|
|
30
|
+
}), /*#__PURE__*/jsx(BaseBox, {
|
|
31
|
+
alignSelf: "flex-end",
|
|
32
|
+
children: isError && /*#__PURE__*/jsx(FormHint, {
|
|
33
|
+
type: "error",
|
|
34
|
+
errorText: errorText,
|
|
35
|
+
size: "small"
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { SelfMessageBubble };
|
|
42
|
+
//# sourceMappingURL=SelfMessageBubble.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelfMessageBubble.web.js","sources":["../../../../../../src/components/ChatMessage/SelfMessageBubble.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { CommonChatMessageProps } from './types';\nimport { chatMessageToken } from './token';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint } from '~components/Form/FormHint';\n\nconst SelfMessageBubble = ({\n children,\n validationState,\n errorText = 'Message not sent. Tap to retry.',\n messageType,\n isChildText,\n}: Pick<CommonChatMessageProps, 'children' | 'validationState' | 'errorText' | 'messageType'> & {\n // is child is text then only add padding otherwise no need to add padding\n isChildText: boolean;\n}): React.ReactElement => {\n const isError = validationState === 'error';\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox\n backgroundColor={\n isError\n ? chatMessageToken.self.backgroundColor.error\n : chatMessageToken.self.backgroundColor.default\n }\n padding={isChildText ? 'spacing.4' : 'spacing.0'}\n borderTopLeftRadius={chatMessageToken.self.borderTopLeftRadius}\n borderTopRightRadius={chatMessageToken.self.borderTopRightRadius}\n borderBottomLeftRadius={chatMessageToken.self.borderBottomLeftRadius}\n borderBottomRightRadius={\n messageType === 'last'\n ? chatMessageToken.self.borderBottomRightRadiusForLastMessage\n : chatMessageToken.self.borderBottomRightRadius\n }\n width=\"fit-content\"\n height=\"auto\"\n alignSelf=\"flex-end\"\n >\n {children}\n </BaseBox>\n <BaseBox alignSelf=\"flex-end\">\n {isError && <FormHint type=\"error\" errorText={errorText} size=\"small\" />}\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport { SelfMessageBubble };\n"],"names":["SelfMessageBubble","_ref","children","validationState","_ref$errorText","errorText","messageType","isChildText","isError","_jsxs","BaseBox","display","flexDirection","_jsx","backgroundColor","chatMessageToken","self","error","padding","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomRightRadiusForLastMessage","width","height","alignSelf","FormHint","type","size"],"mappings":";;;;;;;AAMA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EASG;AAAA,EAAA,IARxBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,eAAe,GAAAF,IAAA,CAAfE,eAAe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,QAAAA,IAAI,EAAC,OAAO;AAACvB,QAAAA,SAAS,EAAEA,SAAU;AAACwB,QAAAA,IAAI,EAAC,OAAA;OAAS,CAAA;AAAC,KACjE,CAAC,CAAA;AAAA,GACH,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var chatMessageToken = {
|
|
2
|
+
"default": {},
|
|
3
|
+
self: {
|
|
4
|
+
padding: 'spacing.4',
|
|
5
|
+
borderTopLeftRadius: 'large',
|
|
6
|
+
borderTopRightRadius: 'large',
|
|
7
|
+
borderBottomLeftRadius: 'large',
|
|
8
|
+
borderBottomRightRadiusForLastMessage: 'none',
|
|
9
|
+
borderBottomRightRadius: 'large',
|
|
10
|
+
backgroundColor: {
|
|
11
|
+
"default": 'surface.background.primary.subtle',
|
|
12
|
+
error: 'feedback.background.negative.subtle'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { chatMessageToken };
|
|
18
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sources":["../../../../../../src/components/ChatMessage/token.ts"],"sourcesContent":["const chatMessageToken = {\n default: {},\n self: {\n padding: 'spacing.4',\n borderTopLeftRadius: 'large',\n borderTopRightRadius: 'large',\n borderBottomLeftRadius: 'large',\n borderBottomRightRadiusForLastMessage: 'none',\n borderBottomRightRadius: 'large',\n backgroundColor: {\n default: 'surface.background.primary.subtle',\n error: 'feedback.background.negative.subtle',\n },\n },\n} as const;\n\nexport { chatMessageToken };\n"],"names":["chatMessageToken","self","padding","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadiusForLastMessage","borderBottomRightRadius","backgroundColor","error"],"mappings":"AAAA,IAAMA,gBAAgB,GAAG;AACvB,EAAA,SAAA,EAAS,EAAE;AACXC,EAAAA,IAAI,EAAE;AACJC,IAAAA,OAAO,EAAE,WAAW;AACpBC,IAAAA,mBAAmB,EAAE,OAAO;AAC5BC,IAAAA,oBAAoB,EAAE,OAAO;AAC7BC,IAAAA,sBAAsB,EAAE,OAAO;AAC/BC,IAAAA,qCAAqC,EAAE,MAAM;AAC7CC,IAAAA,uBAAuB,EAAE,OAAO;AAChCC,IAAAA,eAAe,EAAE;AACf,MAAA,SAAA,EAAS,mCAAmC;AAC5CC,MAAAA,KAAK,EAAE,qCAAA;AACT,KAAA;AACF,GAAA;AACF;;;;"}
|