@razorpay/blade 12.49.6 → 12.50.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.
Files changed (68) hide show
  1. package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js +1 -1
  2. package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  3. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  4. package/build/lib/native/components/Box/Box.js +1 -1
  5. package/build/lib/native/components/Box/Box.js.map +1 -1
  6. package/build/lib/native/components/DatePicker/DatePickerContext.js +7 -0
  7. package/build/lib/native/components/DatePicker/DatePickerContext.js.map +1 -0
  8. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  9. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  10. package/build/lib/native/components/Input/TextInput/TextInput.js +2 -1
  11. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  12. package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +5 -1
  13. package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  14. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  15. package/build/lib/web/development/components/Box/Box.js +3 -0
  16. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  17. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +27 -11
  18. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  19. package/build/lib/web/development/components/DatePicker/DateInput.web.js +15 -10
  20. package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
  21. package/build/lib/web/development/components/DatePicker/DatePickerContext.js +22 -0
  22. package/build/lib/web/development/components/DatePicker/DatePickerContext.js.map +1 -0
  23. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js +2 -4
  24. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  25. package/build/lib/web/{production/components/DatePicker/QuickSelection/PresetDropdown.web.js → development/components/DatePicker/QuickSelection/renderPresetDropdown.web.js} +10 -9
  26. package/build/lib/web/development/components/DatePicker/QuickSelection/renderPresetDropdown.web.js.map +1 -0
  27. package/build/lib/web/development/components/DatePicker/QuickSelection/{PresetContext.js → usePresetState.js} +6 -21
  28. package/build/lib/web/development/components/DatePicker/QuickSelection/usePresetState.js.map +1 -0
  29. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +5 -5
  30. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  31. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +7 -3
  32. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  33. package/build/lib/web/development/components/Input/TextInput/TextInput.js +5 -2
  34. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  35. package/build/lib/web/development/components/Tag/AnimatedTag.web.js +4 -4
  36. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  37. package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +5 -1
  38. package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  39. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  40. package/build/lib/web/production/components/Box/Box.js +3 -0
  41. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  42. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +27 -11
  43. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  44. package/build/lib/web/production/components/DatePicker/DateInput.web.js +15 -10
  45. package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
  46. package/build/lib/web/production/components/DatePicker/DatePickerContext.js +22 -0
  47. package/build/lib/web/production/components/DatePicker/DatePickerContext.js.map +1 -0
  48. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js +2 -4
  49. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  50. package/build/lib/web/{development/components/DatePicker/QuickSelection/PresetDropdown.web.js → production/components/DatePicker/QuickSelection/renderPresetDropdown.web.js} +10 -9
  51. package/build/lib/web/production/components/DatePicker/QuickSelection/renderPresetDropdown.web.js.map +1 -0
  52. package/build/lib/web/production/components/DatePicker/QuickSelection/{PresetContext.js → usePresetState.js} +6 -21
  53. package/build/lib/web/production/components/DatePicker/QuickSelection/usePresetState.js.map +1 -0
  54. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +5 -5
  55. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  56. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +7 -3
  57. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  58. package/build/lib/web/production/components/Input/TextInput/TextInput.js +5 -2
  59. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  60. package/build/lib/web/production/components/Tag/AnimatedTag.web.js +4 -4
  61. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  62. package/build/types/components/index.d.ts +545 -1
  63. package/build/types/components/index.native.d.ts +41 -1
  64. package/package.json +1 -1
  65. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetContext.js.map +0 -1
  66. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +0 -1
  67. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetContext.js.map +0 -1
  68. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sources":["../../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport { useFormattedInput } from './useFormattedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n ContainerElementType,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { DropdownOverlay } from '~components/Dropdown';\nimport type { FormInputOnEvent } from '~components/Form/FormTypes';\nimport { isIconComponent } from '~utils/isIconComponent';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n | 'textAlign'\n | 'popupId'\n | 'isPopupExpanded'\n | 'hasPopup'\n | 'componentName'\n | 'onKeyDown'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leading` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n /**\n *\n * Icon or React Element to be rendered at the end of the input field\n */\n trailing?: React.ReactElement | IconComponent;\n /**\n * Icon or React Element to be rendered at the beginning of the input field\n */\n leading?: React.ReactElement | IconComponent;\n /**\n * Format pattern where # represents input characters and other symbols act as delimiters\n * When provided, input will be automatically formatted and onChange will include rawValue\n *\n * **Note:**\n * 1. Format pattern should only contain # symbols and special characters as delimiters.\n * Alphanumeric characters (letters and numbers) are not allowed in the format pattern.\n * 2. When format is provided, user input is restricted to alphanumeric characters only.\n * Special characters and symbols will be filtered out automatically from user input.\n *\n * @example \"#### #### #### ####\" for card numbers\n * @example \"##/##\" for expiry dates\n * @example \"(###) ###-####\" for phone numbers\n */\n format?:\n | '#### #### #### ####'\n | '##/##'\n | '##/##/####'\n | '(###) ###-####'\n | '###-##-####'\n | '##:##'\n | '##:##:##'\n | '#### #### ####'\n | '###.###.###.###'\n | '## ## ####'\n | '##-###-##'\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {});\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\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 TextInputPropsWithLabel = {\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 TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\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 _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n format,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\n trailing,\n leading,\n labelSuffix,\n labelTrailing,\n onKeyDown,\n ...rest\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n\n if (__DEV__) {\n if (format) {\n const hasAlphanumeric = /[a-zA-Z0-9]/.test(format);\n if (hasAlphanumeric) {\n throw new Error(\n `[Blade: TextInput] Invalid format \"${format}\". Only # and special characters allowed, no letters/numbers.`,\n );\n }\n }\n }\n\n const formattingResult = useFormattedInput({\n format,\n onChange,\n value,\n defaultValue,\n });\n\n const inputValue = format ? formattingResult.formattedValue : value;\n const effectiveMaxCharacters = format ? formattingResult.maxLength : maxCharacters;\n\n const handleOnChange: FormInputOnEvent = React.useCallback(\n ({ name, value: inputValue }) => {\n if (format) {\n formattingResult.handleChange({ name, value: inputValue });\n } else {\n onChange?.({ name, value: inputValue });\n }\n },\n [format, formattingResult.handleChange, onChange],\n );\n\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange: handleOnChange,\n name,\n value: inputValue,\n inputRef: textInputRef,\n });\n const [isTrailingDropDownOpen, setIsTrailingDropDownOpen] = React.useState(false);\n const [isLeadingDropDownOpen, setIsLeadingDropDownOpen] = React.useState(false);\n const textInputWrapperRef = useRef<ContainerElementType | null>(null);\n\n useEffect(() => {\n if (isTrailingDropDownOpen && isLeadingDropDownOpen) {\n setIsLeadingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isTrailingDropDownOpen]);\n\n useEffect(() => {\n if (isLeadingDropDownOpen && isTrailingDropDownOpen) {\n setIsTrailingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLeadingDropDownOpen]);\n\n const leadingDropDown =\n leading && getComponentId(leading as React.ReactElement) === 'Dropdown' ? leading : null;\n\n const trailingDropdown =\n trailing && getComponentId(trailing as React.ReactElement) === 'Dropdown' ? trailing : null;\n // we need to look into name of component and check if it 's and icon or a dropdown\n const _leadingIcon: IconComponent | undefined = isIconComponent(leading)\n ? (leading as IconComponent)\n : undefined;\n\n const _trailingIcon: IconComponent | undefined = isIconComponent(trailing)\n ? (trailing as IconComponent)\n : undefined;\n const hasLeadingInteractionElement = !_leadingIcon && !leadingDropDown && leading;\n\n const hasTrailingInteractionElement = !_trailingIcon && !trailingDropdown && trailing;\n\n const renderDropdown = (\n dropdown: React.ReactElement,\n isOpen: boolean,\n setIsOpen: (isOpen: boolean) => void,\n defaultPlacement: 'bottom-start' | 'bottom-end',\n ): React.ReactElement | null => {\n if (!dropdown) {\n return null;\n }\n return React.cloneElement(dropdown, {\n selectionType: 'single',\n isOpen,\n onOpenChange: (isOpen: boolean) => {\n setIsOpen(isOpen);\n },\n children: React.Children.map(dropdown.props.children, (child) => {\n if (child.type === DropdownOverlay) {\n return React.cloneElement(child, {\n referenceRef: textInputWrapperRef,\n _isNestedDropdown: true,\n defaultPlacement,\n });\n }\n return child;\n }),\n });\n };\n\n const renderLeadingDropDown = renderDropdown(\n leadingDropDown as React.ReactElement,\n isLeadingDropDownOpen,\n setIsLeadingDropDownOpen,\n 'bottom-start',\n );\n const renderTrailingDropDown = renderDropdown(\n trailingDropdown as React.ReactElement,\n isTrailingDropDownOpen,\n setIsTrailingDropDownOpen,\n 'bottom-end',\n );\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? inputValue)));\n }, [showClearButton, defaultValue, inputValue]);\n\n const renderClearButton = (): React.ReactElement => {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(inputValue) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.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 textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n const hasTrailingDropDown = Boolean(trailingDropdown);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton && hasTrailingDropDown) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" />\n </BaseBox>\n );\n }\n\n if (showClearButton && hasTrailingInteractionElement) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" /> {trailing as React.ReactElement}\n </BaseBox>\n );\n }\n\n if (shouldShowClearButton) {\n return renderClearButton();\n }\n\n if (hasTrailingInteractionElement) {\n return trailing as React.ReactElement;\n }\n return null;\n };\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n setInputWrapperRef={(wrapperNode) => {\n textInputWrapperRef.current = wrapperNode;\n }}\n label={label as string}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n // CONTROLLED/UNCONTROLLED INPUT LOGIC:\n // For inputs WITHOUT format:\n // - Use standard React controlled/uncontrolled logic\n // - Controlled: user provides `value` prop → use `value` prop\n // - Uncontrolled: user provides `defaultValue` prop → use `defaultValue` prop\n //\n // For inputs WITH format:\n // - Formatting requires controlled mode to re-render and show formatted values\n // - Case 1: Only `value` provided → defaultValue: undefined, value: formattedValue (normal controlled)\n // - Case 2: Only `defaultValue` provided → defaultValue: undefined, value: formattedValue (convert to controlled)\n // - Case 3: Both `value` and `defaultValue` provided → defaultValue: defaultValue, value: formattedValue (let BaseInput detect conflict and throw error)\n //\n defaultValue={\n format\n ? value !== undefined && defaultValue !== undefined\n ? defaultValue\n : undefined\n : defaultValue\n }\n value={format ? inputValue : value}\n name={name}\n maxCharacters={effectiveMaxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n leadingDropDown={renderLeadingDropDown}\n trailingDropDown={renderTrailingDropDown}\n leadingInteractionElement={\n hasLeadingInteractionElement ? (leading as React.ReactElement) : null\n }\n onChange={({ name, value }: { name?: string; value?: string }) => {\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 handleOnChange({ name, value });\n }}\n onClick={onClick}\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?.(e);\n if (format) {\n formattingResult.handleKeyDown(e.event);\n }\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={_leadingIcon ?? leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={_trailingIcon ?? trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return format ? null : effectiveMaxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={effectiveMaxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","_ref4","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","format","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","trailing","leading","labelSuffix","labelTrailing","onKeyDown","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","hasAlphanumeric","test","Error","concat","formattingResult","useFormattedInput","inputValue","formattedValue","effectiveMaxCharacters","maxLength","handleOnChange","useCallback","_ref2","handleChange","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState","_React$useState2","isTrailingDropDownOpen","setIsTrailingDropDownOpen","_React$useState3","_React$useState4","isLeadingDropDownOpen","setIsLeadingDropDownOpen","textInputWrapperRef","useEffect","leadingDropDown","getComponentId","trailingDropdown","_leadingIcon","isIconComponent","undefined","_trailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","renderDropdown","dropdown","isOpen","setIsOpen","defaultPlacement","cloneElement","selectionType","onOpenChange","children","Children","map","props","child","DropdownOverlay","referenceRef","_isNestedDropdown","renderLeadingDropDown","renderTrailingDropDown","Boolean","renderClearButton","_jsx","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","hasTrailingDropDown","renderInteractionElement","Spinner","color","_jsxs","BaseBox","display","gap","Divider","orientation","BaseInput","_objectSpread","id","componentName","MetaConstants","TextInput","setInputWrapperRef","wrapperNode","hideLabelText","isDropdownTrigger","showAllTags","maxTagRows","trailingDropDown","leadingInteractionElement","_ref3","length","e","handleKeyDown","event","trailingInteractionElement","trailingFooterSlot","_value$length","marginTop","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyLA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAkB,EAA4C;AACnF,EAAA,OAAOC,eAAe,EAAE,KAAK,cAAc,CAAA;AAC7C,CAAC,CAAA;AAED,IAAMC,UAA2E,GAAG,SAA9EA,UAA2EA,CAAAC,IAAA,EAgD/EC,GAAG,EACc;AAAA,EAAA,IAAAC,KAAA,CAAA;AAAA,EAAA,IA/CfC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAAAC,kBAAA,GAAAL,IAAA,CAClBM,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,kBAAA;IACrBE,WAAW,GAAAP,IAAA,CAAXO,WAAW;IAAAC,SAAA,GAAAR,IAAA,CACXS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IACbE,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,IAAI,GAAAX,IAAA,CAAJW,IAAI;IACJC,KAAK,GAAAZ,IAAA,CAALY,KAAK;IACLC,aAAa,GAAAb,IAAA,CAAba,aAAa;IACbC,MAAM,GAAAd,IAAA,CAANc,MAAM;IACNC,QAAQ,GAAAf,IAA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,UAAAA,QAAQ,EAAEpG,sBAAuB;AACjCrC,UAAAA,IAAI,EAAEA,IAAAA;SACP,CAAA;OACM,CAAC,GACR,IAAI,CAAA;AACV,KAAA;AACA;AAAA;AACAN,IAAAA,SAAS,EAAEA,SAAU;AACrBI,IAAAA,MAAM,EAAEA,MAAAA;AAAO,GAAA,EACX4I,+BAA+B,CAAC;AAClCxK,IAAAA,IAAI,EAAJA,IAAI;AACJyB,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAC1BC,IAAAA,cAAc,EAAdA,cAAAA;AACF,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACFG,IAAAA,IAAI,EAAEA,IAAAA;GACFW,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;AAEKwG,IAAAA,SAAS,gBAAGwB,wBAAwB,cAAC5H,cAAK,CAAC6H,UAAU,CAACpL,UAAU,CAAC,EAAE;AACvEqL,EAAAA,WAAW,EAAE,WAAA;AACf,CAAC;;;;"}
1
+ {"version":3,"file":"TextInput.js","sources":["../../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport { useFormattedInput } from './useFormattedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n ContainerElementType,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { DropdownOverlay } from '~components/Dropdown';\nimport type { FormInputOnEvent } from '~components/Form/FormTypes';\nimport { isIconComponent } from '~utils/isIconComponent';\nimport { useDatePickerContext } from '~components/DatePicker/DatePickerContext';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n | 'textAlign'\n | 'popupId'\n | 'isPopupExpanded'\n | 'hasPopup'\n | 'componentName'\n | 'onKeyDown'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leading` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n /**\n *\n * Icon or React Element to be rendered at the end of the input field\n */\n trailing?: React.ReactElement | IconComponent;\n /**\n * Icon or React Element to be rendered at the beginning of the input field\n */\n leading?: React.ReactElement | IconComponent;\n /**\n * Format pattern where # represents input characters and other symbols act as delimiters\n * When provided, input will be automatically formatted and onChange will include rawValue\n *\n * **Note:**\n * 1. Format pattern should only contain # symbols and special characters as delimiters.\n * Alphanumeric characters (letters and numbers) are not allowed in the format pattern.\n * 2. When format is provided, user input is restricted to alphanumeric characters only.\n * Special characters and symbols will be filtered out automatically from user input.\n *\n * @example \"#### #### #### ####\" for card numbers\n * @example \"##/##\" for expiry dates\n * @example \"(###) ###-####\" for phone numbers\n */\n format?:\n | '#### #### #### ####'\n | '##/##'\n | '##/##/####'\n | '(###) ###-####'\n | '###-##-####'\n | '##:##'\n | '##:##:##'\n | '#### #### ####'\n | '###.###.###.###'\n | '## ## ####'\n | '##-###-##'\n // eslint-disable-next-line @typescript-eslint/ban-types\n | (string & {});\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\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 TextInputPropsWithLabel = {\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 TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\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 _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n format,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\n trailing,\n leading,\n labelSuffix,\n labelTrailing,\n onKeyDown,\n ...rest\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n const context = useDatePickerContext();\n const isDatePickerBodyOpen = context?.isDatePickerBodyOpen;\n\n if (__DEV__) {\n if (format) {\n const hasAlphanumeric = /[a-zA-Z0-9]/.test(format);\n if (hasAlphanumeric) {\n throw new Error(\n `[Blade: TextInput] Invalid format \"${format}\". Only # and special characters allowed, no letters/numbers.`,\n );\n }\n }\n }\n\n const formattingResult = useFormattedInput({\n format,\n onChange,\n value,\n defaultValue,\n });\n\n const inputValue = format ? formattingResult.formattedValue : value;\n const effectiveMaxCharacters = format ? formattingResult.maxLength : maxCharacters;\n\n const handleOnChange: FormInputOnEvent = React.useCallback(\n ({ name, value: inputValue }) => {\n if (format) {\n formattingResult.handleChange({ name, value: inputValue });\n } else {\n onChange?.({ name, value: inputValue });\n }\n },\n [format, formattingResult.handleChange, onChange],\n );\n\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange: handleOnChange,\n name,\n value: inputValue,\n inputRef: textInputRef,\n });\n const [isTrailingDropDownOpen, setIsTrailingDropDownOpen] = React.useState(false);\n const [isLeadingDropDownOpen, setIsLeadingDropDownOpen] = React.useState(false);\n const textInputWrapperRef = useRef<ContainerElementType | null>(null);\n\n useEffect(() => {\n if (\n (isTrailingDropDownOpen && isLeadingDropDownOpen) ||\n (isDatePickerBodyOpen && isLeadingDropDownOpen)\n ) {\n setIsLeadingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isTrailingDropDownOpen, isDatePickerBodyOpen]);\n\n useEffect(() => {\n if (isLeadingDropDownOpen && isTrailingDropDownOpen) {\n setIsTrailingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLeadingDropDownOpen]);\n\n const leadingDropDown =\n leading && getComponentId(leading as React.ReactElement) === 'Dropdown' ? leading : null;\n\n const trailingDropdown =\n trailing && getComponentId(trailing as React.ReactElement) === 'Dropdown' ? trailing : null;\n // we need to look into name of component and check if it 's and icon or a dropdown\n const _leadingIcon: IconComponent | undefined = isIconComponent(leading)\n ? (leading as IconComponent)\n : undefined;\n\n const _trailingIcon: IconComponent | undefined = isIconComponent(trailing)\n ? (trailing as IconComponent)\n : undefined;\n const hasLeadingInteractionElement = !_leadingIcon && !leadingDropDown && leading;\n\n const hasTrailingInteractionElement = !_trailingIcon && !trailingDropdown && trailing;\n\n const renderDropdown = (\n dropdown: React.ReactElement,\n isOpen: boolean,\n setIsOpen: (isOpen: boolean) => void,\n defaultPlacement: 'bottom-start' | 'bottom-end',\n ): React.ReactElement | null => {\n if (!dropdown) {\n return null;\n }\n return React.cloneElement(dropdown, {\n selectionType: 'single',\n isOpen,\n onOpenChange: (isOpen: boolean) => {\n setIsOpen(isOpen);\n },\n children: React.Children.map(dropdown.props.children, (child) => {\n if (child.type === DropdownOverlay) {\n return React.cloneElement(child, {\n referenceRef: textInputWrapperRef,\n _isNestedDropdown: true,\n defaultPlacement,\n });\n }\n return child;\n }),\n });\n };\n\n const renderLeadingDropDown = renderDropdown(\n leadingDropDown as React.ReactElement,\n isLeadingDropDownOpen,\n setIsLeadingDropDownOpen,\n 'bottom-start',\n );\n const renderTrailingDropDown = renderDropdown(\n trailingDropdown as React.ReactElement,\n isTrailingDropDownOpen,\n setIsTrailingDropDownOpen,\n 'bottom-end',\n );\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? inputValue)));\n }, [showClearButton, defaultValue, inputValue]);\n\n const renderClearButton = (): React.ReactElement => {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(inputValue) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.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 textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n const hasTrailingDropDown = Boolean(trailingDropdown);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton && hasTrailingDropDown) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" />\n </BaseBox>\n );\n }\n\n if (showClearButton && hasTrailingInteractionElement) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" /> {trailing as React.ReactElement}\n </BaseBox>\n );\n }\n\n if (shouldShowClearButton) {\n return renderClearButton();\n }\n\n if (hasTrailingInteractionElement) {\n return trailing as React.ReactElement;\n }\n return null;\n };\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n setInputWrapperRef={(wrapperNode) => {\n textInputWrapperRef.current = wrapperNode;\n }}\n label={label as string}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n // CONTROLLED/UNCONTROLLED INPUT LOGIC:\n // For inputs WITHOUT format:\n // - Use standard React controlled/uncontrolled logic\n // - Controlled: user provides `value` prop → use `value` prop\n // - Uncontrolled: user provides `defaultValue` prop → use `defaultValue` prop\n //\n // For inputs WITH format:\n // - Formatting requires controlled mode to re-render and show formatted values\n // - Case 1: Only `value` provided → defaultValue: undefined, value: formattedValue (normal controlled)\n // - Case 2: Only `defaultValue` provided → defaultValue: undefined, value: formattedValue (convert to controlled)\n // - Case 3: Both `value` and `defaultValue` provided → defaultValue: defaultValue, value: formattedValue (let BaseInput detect conflict and throw error)\n //\n defaultValue={\n format\n ? value !== undefined && defaultValue !== undefined\n ? defaultValue\n : undefined\n : defaultValue\n }\n value={format ? inputValue : value}\n name={name}\n maxCharacters={effectiveMaxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n leadingDropDown={renderLeadingDropDown}\n trailingDropDown={renderTrailingDropDown}\n leadingInteractionElement={\n hasLeadingInteractionElement ? (leading as React.ReactElement) : null\n }\n onChange={({ name, value }: { name?: string; value?: string }) => {\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 handleOnChange({ name, value });\n }}\n onClick={onClick}\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?.(e);\n if (format) {\n formattingResult.handleKeyDown(e.event);\n }\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={_leadingIcon ?? leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={_trailingIcon ?? trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return format ? null : effectiveMaxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={effectiveMaxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","_ref4","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","format","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","trailing","leading","labelSuffix","labelTrailing","onKeyDown","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","context","useDatePickerContext","isDatePickerBodyOpen","hasAlphanumeric","test","Error","concat","formattingResult","useFormattedInput","inputValue","formattedValue","effectiveMaxCharacters","maxLength","handleOnChange","useCallback","_ref2","handleChange","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState","_React$useState2","isTrailingDropDownOpen","setIsTrailingDropDownOpen","_React$useState3","_React$useState4","isLeadingDropDownOpen","setIsLeadingDropDownOpen","textInputWrapperRef","useEffect","leadingDropDown","getComponentId","trailingDropdown","_leadingIcon","isIconComponent","undefined","_trailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","renderDropdown","dropdown","isOpen","setIsOpen","defaultPlacement","cloneElement","selectionType","onOpenChange","children","Children","map","props","child","DropdownOverlay","referenceRef","_isNestedDropdown","renderLeadingDropDown","renderTrailingDropDown","Boolean","renderClearButton","_jsx","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","hasTrailingDropDown","renderInteractionElement","Spinner","color","_jsxs","BaseBox","display","gap","Divider","orientation","BaseInput","_objectSpread","id","componentName","MetaConstants","TextInput","setInputWrapperRef","wrapperNode","hideLabelText","isDropdownTrigger","showAllTags","maxTagRows","trailingDropDown","leadingInteractionElement","_ref3","length","e","handleKeyDown","event","trailingInteractionElement","trailingFooterSlot","_value$length","marginTop","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0LA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAkB,EAA4C;AACnF,EAAA,OAAOC,eAAe,EAAE,KAAK,cAAc,CAAA;AAC7C,CAAC,CAAA;AAED,IAAMC,UAA2E,GAAG,SAA9EA,UAA2EA,CAAAC,IAAA,EAgD/EC,GAAG,EACc;AAAA,EAAA,IAAAC,KAAA,CAAA;AAAA,EAAA,IA/CfC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAAAC,kBAAA,GAAAL,IAAA,CAClBM,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,kBAAA;IACrBE,WAAW,GAAAP,IAAA,CAAXO,WAAW;IAAAC,SAAA,GAAAR,IAAA,CACXS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,SAAA;IACbE,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,IAAI,GAAAX,IAAA,CAAJW,IAAI;IACJC,KAAK,GAAAZ,IAAA,CAALY,KAAK;IACLC,aAAa,GAAAb,IAAA,CAAba,aAAa;IACbC,MAAM,GAAAd,IAAA,CAANc,MAAM;IACNC,QAAQ,GAAAf,IAAA,CAARe,QAAQ;IACRC,OAAO,GAAAhB,IAAA,CAAPgB,OAAO;IACPC,QAAO,GAAAjB,IAAA,CAAPiB,OAAO;IACPC,OAAM,GAAAlB,IAAA,CAANkB,MAAM;IACNC,QAAQ,GAAAnB,IAAA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AAA,IAAAA,aAAA,KAAAA,KAAAA,CAAAA,GAAAA,aAAA,GAAI,CAAE;AACjCM,UAAAA,QAAQ,EAAEpG,sBAAuB;AACjCxC,UAAAA,IAAI,EAAEA,IAAAA;SACP,CAAA;OACM,CAAC,GACR,IAAI,CAAA;AACV,KAAA;AACA;AAAA;AACAN,IAAAA,SAAS,EAAEA,SAAU;AACrBI,IAAAA,MAAM,EAAEA,MAAAA;AAAO,GAAA,EACX+I,+BAA+B,CAAC;AAClC3K,IAAAA,IAAI,EAAJA,IAAI;AACJyB,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAC1BC,IAAAA,cAAc,EAAdA,cAAAA;AACF,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACFG,IAAAA,IAAI,EAAEA,IAAAA;GACFW,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;AAEK2G,IAAAA,SAAS,gBAAGwB,wBAAwB,cAAC/H,cAAK,CAACgI,UAAU,CAACvL,UAAU,CAAC,EAAE;AACvEwL,EAAAA,WAAW,EAAE,WAAA;AACf,CAAC;;;;"}
@@ -17,7 +17,7 @@ var AnimatedTagContainer = /*#__PURE__*/styled(BaseBox).withConfig({
17
17
  displayName: "AnimatedTagweb__AnimatedTagContainer",
18
18
  componentId: "sc-1ypkpkt-0"
19
19
  })(function (props) {
20
- return css(["", ";display:inline-block;opacity:", ";max-width:", ";flex-shrink:0;"], props.transition, props.isVisible ? TAG_OPACITY_START : TAG_OPACITY_END, props.isVisible ? TAG_MAX_WIDTH_START : TAG_MAX_WIDTH_END);
20
+ return css(["", ";display:inline-block;opacity:", ";max-width:", ";flex-shrink:0;"], props.animationProps, props.isVisible ? TAG_OPACITY_START : TAG_OPACITY_END, props.isVisible ? TAG_MAX_WIDTH_START : TAG_MAX_WIDTH_END);
21
21
  });
22
22
  var AnimatedTag = function AnimatedTag(_ref) {
23
23
  var children = _ref.children,
@@ -33,8 +33,8 @@ var AnimatedTag = function AnimatedTag(_ref) {
33
33
  setIsTagVisible = _React$useState2[1];
34
34
  var _useTheme = useTheme(),
35
35
  theme = _useTheme.theme;
36
- var hideTagTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], tagDissappearKeyframe, makeMotionTime(theme.motion.duration.xquick), String(theme.motion.easing.exit));
37
- var showTagTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], tagShowKeyframe, makeMotionTime(theme.motion.duration.xquick), String(theme.motion.easing.entrance));
36
+ var hideTagAnimationProps = /*#__PURE__*/css(["animation:", " ", " ", ";"], tagDissappearKeyframe, makeMotionTime(theme.motion.duration.xquick), String(theme.motion.easing.exit));
37
+ var showTagAnimationProps = /*#__PURE__*/css(["animation:", " ", " ", ";"], tagShowKeyframe, makeMotionTime(theme.motion.duration.xquick), String(theme.motion.easing.entrance));
38
38
  return /*#__PURE__*/jsx(AnimatedTagContainer, {
39
39
  isVisible: isTagVisible,
40
40
  onAnimationEnd: function onAnimationEnd() {
@@ -45,7 +45,7 @@ var AnimatedTag = function AnimatedTag(_ref) {
45
45
  });
46
46
  }
47
47
  },
48
- transition: isTagVisible ? showTagTransition : hideTagTransition,
48
+ animationProps: isTagVisible ? showTagAnimationProps : hideTagAnimationProps,
49
49
  children: /*#__PURE__*/jsx(Tag, {
50
50
  _isVirtuallyFocused: currentTagIndex === activeTagIndex,
51
51
  _isTagInsideInput: true,
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedTag.web.js","sources":["../../../../../../src/components/Tag/AnimatedTag.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport { Tag } from './Tag';\nimport type { AnimatedTagProps } from './types';\nimport {\n TAG_MAX_WIDTH_END,\n TAG_MAX_WIDTH_START,\n TAG_OPACITY_END,\n TAG_OPACITY_START,\n} from './tagAnimationConfig';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeMotionTime } from '~utils';\n\nconst tagDissappearKeyframe = keyframes`\n 0% {\n opacity: ${TAG_OPACITY_START};\n max-width: ${TAG_MAX_WIDTH_START}\n }\n\n 100% {\n opacity: ${TAG_OPACITY_END};\n max-width: ${TAG_MAX_WIDTH_END};\n }\n`;\n\nconst tagShowKeyframe = keyframes`\n 0% {\n opacity: ${TAG_OPACITY_END};\n }\n\n 100% {\n opacity: ${TAG_OPACITY_START};\n }\n`;\n\nconst AnimatedTagContainer = styled(BaseBox)<{\n transition: FlattenSimpleInterpolation;\n isVisible: boolean;\n}>(\n (props) => css`\n ${props.transition};\n display: inline-block;\n opacity: ${props.isVisible ? TAG_OPACITY_START : TAG_OPACITY_END};\n max-width: ${props.isVisible ? TAG_MAX_WIDTH_START : TAG_MAX_WIDTH_END};\n flex-shrink: 0;\n `,\n);\n\nconst AnimatedTag = ({\n children,\n currentTagIndex,\n isDisabled,\n activeTagIndex,\n onDismiss,\n size = 'medium',\n}: AnimatedTagProps): React.ReactElement => {\n const [isTagVisible, setIsTagVisible] = React.useState(true);\n const { theme } = useTheme();\n\n const hideTagTransition = css`\n animation: ${tagDissappearKeyframe} ${makeMotionTime(theme.motion.duration.xquick)}\n ${String(theme.motion.easing.exit)};\n `;\n\n const showTagTransition = css`\n animation: ${tagShowKeyframe} ${makeMotionTime(theme.motion.duration.xquick)}\n ${String(theme.motion.easing.entrance)};\n `;\n\n return (\n <AnimatedTagContainer\n isVisible={isTagVisible}\n onAnimationEnd={() => {\n if (!isTagVisible) {\n onDismiss({ tagIndex: currentTagIndex, tagName: children });\n }\n }}\n transition={isTagVisible ? showTagTransition : hideTagTransition}\n >\n <Tag\n _isVirtuallyFocused={currentTagIndex === activeTagIndex}\n _isTagInsideInput={true}\n onDismiss={() => {\n setIsTagVisible(false);\n }}\n marginRight=\"spacing.3\"\n marginY=\"spacing.2\"\n isDisabled={isDisabled}\n size={size}\n >\n {children}\n </Tag>\n </AnimatedTagContainer>\n );\n};\n\nexport { AnimatedTag };\n"],"names":["tagDissappearKeyframe","keyframes","TAG_OPACITY_START","TAG_MAX_WIDTH_START","TAG_OPACITY_END","TAG_MAX_WIDTH_END","tagShowKeyframe","AnimatedTagContainer","styled","BaseBox","withConfig","displayName","componentId","props","css","transition","isVisible","AnimatedTag","_ref","children","currentTagIndex","isDisabled","activeTagIndex","onDismiss","_ref$size","size","_React$useState","React","useState","_React$useState2","_slicedToArray","isTagVisible","setIsTagVisible","_useTheme","useTheme","theme","hideTagTransition","makeMotionTime","motion","duration","xquick","String","easing","exit","showTagTransition","entrance","_jsx","onAnimationEnd","tagIndex","tagName","Tag","_isVirtuallyFocused","_isTagInsideInput","marginRight","marginY"],"mappings":";;;;;;;;;;;;;AAeA,IAAMA,qBAAqB,gBAAGC,SAAS,CAExBC,CAAAA,aAAAA,EAAAA,aAAAA,EAAAA,gBAAAA,EAAAA,aAAAA,EAAAA,IAAAA,CAAAA,EAAAA,iBAAiB,EACfC,mBAAmB,EAIrBC,eAAe,EACbC,iBAAiB,CAEjC,CAAA;AAED,IAAMC,eAAe,gBAAGL,SAAS,2CAElBG,eAAe,EAIfF,iBAAiB,CAE/B,CAAA;AAED,IAAMK,oBAAoB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAAA,CAAA,CAI1C,UAACC,KAAK,EAAA;EAAA,OAAKC,GAAG,2EACVD,KAAK,CAACE,UAAU,EAEPF,KAAK,CAACG,SAAS,GAAGd,iBAAiB,GAAGE,eAAe,EACnDS,KAAK,CAACG,SAAS,GAAGb,mBAAmB,GAAGE,iBAAiB,CAAA,CAAA;AAAA,CAEvE,CACF,CAAA;AAED,IAAMY,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAO2B;AAAA,EAAA,IAN1CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,eAAe,GAAAF,IAAA,CAAfE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A,cAAcA,GAAQ;MACpB,IAAI,CAAChB,YAAY,EAAE;AACjBR,QAAAA,SAAS,CAAC;AAAEyB,UAAAA,QAAQ,EAAE5B,eAAe;AAAE6B,UAAAA,OAAO,EAAE9B,QAAAA;AAAS,SAAC,CAAC,CAAA;AAC7D,OAAA;KACA;AACFJ,IAAAA,UAAU,EAAEgB,YAAY,GAAGa,iBAAiB,GAAGR,iBAAkB;IAAAjB,QAAA,eAEjE2B,GAAA,CAACI,GAAG,EAAA;MACFC,mBAAmB,EAAE/B,eAAe,KAAKE,cAAe;AACxD8B,MAAAA,iBAAiB,EAAE,IAAK;AACxB7B,MAAAA,SAAS,EAAE,SAAXA,SAASA,GAAQ;QACfS,eAAe,CAAC,KAAK,CAAC,CAAA;OACtB;AACFqB,MAAAA,WAAW,EAAC,WAAW;AACvBC,MAAAA,OAAO,EAAC,WAAW;AACnBjC,MAAAA,UAAU,EAAEA,UAAW;AACvBI,MAAAA,IAAI,EAAEA,IAAK;AAAAN,MAAAA,QAAA,EAEVA,QAAAA;KACE,CAAA;AAAC,GACc,CAAC,CAAA;AAE3B;;;;"}
1
+ {"version":3,"file":"AnimatedTag.web.js","sources":["../../../../../../src/components/Tag/AnimatedTag.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport { Tag } from './Tag';\nimport type { AnimatedTagProps } from './types';\nimport {\n TAG_MAX_WIDTH_END,\n TAG_MAX_WIDTH_START,\n TAG_OPACITY_END,\n TAG_OPACITY_START,\n} from './tagAnimationConfig';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeMotionTime } from '~utils';\n\nconst tagDissappearKeyframe = keyframes`\n 0% {\n opacity: ${TAG_OPACITY_START};\n max-width: ${TAG_MAX_WIDTH_START}\n }\n\n 100% {\n opacity: ${TAG_OPACITY_END};\n max-width: ${TAG_MAX_WIDTH_END};\n }\n`;\n\nconst tagShowKeyframe = keyframes`\n 0% {\n opacity: ${TAG_OPACITY_END};\n }\n\n 100% {\n opacity: ${TAG_OPACITY_START};\n }\n`;\n\nconst AnimatedTagContainer = styled(BaseBox)<{\n animationProps: FlattenSimpleInterpolation;\n isVisible: boolean;\n}>(\n (props) => css`\n ${props.animationProps};\n display: inline-block;\n opacity: ${props.isVisible ? TAG_OPACITY_START : TAG_OPACITY_END};\n max-width: ${props.isVisible ? TAG_MAX_WIDTH_START : TAG_MAX_WIDTH_END};\n flex-shrink: 0;\n `,\n);\n\nconst AnimatedTag = ({\n children,\n currentTagIndex,\n isDisabled,\n activeTagIndex,\n onDismiss,\n size = 'medium',\n}: AnimatedTagProps): React.ReactElement => {\n const [isTagVisible, setIsTagVisible] = React.useState(true);\n const { theme } = useTheme();\n\n const hideTagAnimationProps = css`\n animation: ${tagDissappearKeyframe} ${makeMotionTime(theme.motion.duration.xquick)}\n ${String(theme.motion.easing.exit)};\n `;\n\n const showTagAnimationProps = css`\n animation: ${tagShowKeyframe} ${makeMotionTime(theme.motion.duration.xquick)}\n ${String(theme.motion.easing.entrance)};\n `;\n\n return (\n <AnimatedTagContainer\n isVisible={isTagVisible}\n onAnimationEnd={() => {\n if (!isTagVisible) {\n onDismiss({ tagIndex: currentTagIndex, tagName: children });\n }\n }}\n animationProps={isTagVisible ? showTagAnimationProps : hideTagAnimationProps}\n >\n <Tag\n _isVirtuallyFocused={currentTagIndex === activeTagIndex}\n _isTagInsideInput={true}\n onDismiss={() => {\n setIsTagVisible(false);\n }}\n marginRight=\"spacing.3\"\n marginY=\"spacing.2\"\n isDisabled={isDisabled}\n size={size}\n >\n {children}\n </Tag>\n </AnimatedTagContainer>\n );\n};\n\nexport { AnimatedTag };\n"],"names":["tagDissappearKeyframe","keyframes","TAG_OPACITY_START","TAG_MAX_WIDTH_START","TAG_OPACITY_END","TAG_MAX_WIDTH_END","tagShowKeyframe","AnimatedTagContainer","styled","BaseBox","withConfig","displayName","componentId","props","css","animationProps","isVisible","AnimatedTag","_ref","children","currentTagIndex","isDisabled","activeTagIndex","onDismiss","_ref$size","size","_React$useState","React","useState","_React$useState2","_slicedToArray","isTagVisible","setIsTagVisible","_useTheme","useTheme","theme","hideTagAnimationProps","makeMotionTime","motion","duration","xquick","String","easing","exit","showTagAnimationProps","entrance","_jsx","onAnimationEnd","tagIndex","tagName","Tag","_isVirtuallyFocused","_isTagInsideInput","marginRight","marginY"],"mappings":";;;;;;;;;;;;;AAeA,IAAMA,qBAAqB,gBAAGC,SAAS,CAExBC,CAAAA,aAAAA,EAAAA,aAAAA,EAAAA,gBAAAA,EAAAA,aAAAA,EAAAA,IAAAA,CAAAA,EAAAA,iBAAiB,EACfC,mBAAmB,EAIrBC,eAAe,EACbC,iBAAiB,CAEjC,CAAA;AAED,IAAMC,eAAe,gBAAGL,SAAS,2CAElBG,eAAe,EAIfF,iBAAiB,CAE/B,CAAA;AAED,IAAMK,oBAAoB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAAA,CAAA,CAI1C,UAACC,KAAK,EAAA;EAAA,OAAKC,GAAG,2EACVD,KAAK,CAACE,cAAc,EAEXF,KAAK,CAACG,SAAS,GAAGd,iBAAiB,GAAGE,eAAe,EACnDS,KAAK,CAACG,SAAS,GAAGb,mBAAmB,GAAGE,iBAAiB,CAAA,CAAA;AAAA,CAEvE,CACF,CAAA;AAED,IAAMY,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAO2B;AAAA,EAAA,IAN1CC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,eAAe,GAAAF,IAAA,CAAfE,eAAe;IACfC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC,SAAS,GAAAL,IAAA,CAATK,SAAS;IAAAC,SAAA,GAAAN,IAAA,CACTO,IAAI;AAAJA,IAA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AA;AAC7D,OAAA;KACA;AACFJ,IAAAA,cAAc,EAAEgB,YAAY,GAAGa,qBAAqB,GAAGR,qBAAsB;IAAAjB,QAAA,eAE7E2B,GAAA,CAACI,GAAG,EAAA;MACFC,mBAAmB,EAAE/B,eAAe,KAAKE,cAAe;AACxD8B,MAAAA,iBAAiB,EAAE,IAAK;AACxB7B,MAAAA,SAAS,EAAE,SAAXA,SAASA,GAAQ;QACfS,eAAe,CAAC,KAAK,CAAC,CAAA;OACtB;AACFqB,MAAAA,WAAW,EAAC,WAAW;AACvBC,MAAAA,OAAO,EAAC,WAAW;AACnBjC,MAAAA,UAAU,EAAEA,UAAW;AACvBI,MAAAA,IAAI,EAAEA,IAAK;AAAAN,MAAAA,QAAA,EAEVA,QAAAA;KACE,CAAA;AAAC,GACc,CAAC,CAAA;AAE3B;;;;"}
@@ -193,12 +193,16 @@ var getAllProps = function getAllProps(props, breakpoint) {
193
193
  opacity: getResponsiveValue(props.opacity, breakpoint),
194
194
  visibility: getResponsiveValue(props.visibility, breakpoint)
195
195
  }, !isReactNative() && {
196
- boxShadow: getElevationValue(props.elevation, props.theme, breakpoint)
196
+ boxShadow: getElevationValue(props.elevation, props.theme, breakpoint),
197
+ backdropFilter: getResponsiveValue(props.backdropFilter, breakpoint),
198
+ transition: getResponsiveValue(props.transition, breakpoint)
197
199
  }), {}, {
198
200
  // Polygon support
199
201
  transform: getResponsiveValue(props.transform, breakpoint),
200
202
  transformOrigin: getResponsiveValue(props.transformOrigin, breakpoint),
201
203
  clipPath: getResponsiveValue(props.clipPath, breakpoint)
204
+
205
+ // Animation
202
206
  });
203
207
  };
204
208
 
@@ -1 +1 @@
1
- {"version":3,"file":"baseBoxStyles.js","sources":["../../../../../../../src/components/Box/BaseBox/baseBoxStyles.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CSSObject } from 'styled-components';\nimport type {\n BaseBoxProps,\n MakeValueResponsive,\n SpacingValueType,\n ArrayOfMaxLength4,\n} from './types';\nimport { getResponsiveValue } from './getResponsiveValue';\nimport getIn from '~utils/lodashButBetter/get';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { Breakpoints } from '~tokens/global';\nimport { breakpoints } from '~tokens/global';\nimport { isReactNative, getMediaQuery } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\nconst isSpacingToken = (value: string): value is DotNotationSpacingStringToken => {\n return typeof value === 'string' && value.startsWith('spacing.');\n};\n\nconst getSpacingValue = (\n spacingValue:\n | MakeValueResponsive<SpacingValueType | ArrayOfMaxLength4<SpacingValueType>>\n | undefined,\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n if (isEmpty(spacingValue)) {\n return undefined;\n }\n\n const responsiveSpacingValue = getResponsiveValue(\n spacingValue as MakeValueResponsive<SpacingValueType | SpacingValueType[]>,\n breakpoint,\n );\n\n if (isEmpty(responsiveSpacingValue)) {\n return undefined;\n }\n\n if (responsiveSpacingValue === 'auto') {\n return responsiveSpacingValue;\n }\n\n if (Array.isArray(responsiveSpacingValue)) {\n return responsiveSpacingValue.map((value) => getSpacingValue(value, theme)).join(' ');\n }\n\n if (isSpacingToken(responsiveSpacingValue)) {\n const spacingReturnValue = getIn(theme, responsiveSpacingValue);\n return isEmpty(spacingReturnValue) ? makeSpace(spacingReturnValue!) : undefined;\n }\n\n // pixel or with unit values\n return responsiveSpacingValue;\n};\n\nconst getColorValue = (\n color: BaseBoxProps['backgroundColor'] | BaseBoxProps['borderColor'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string => {\n const responsiveBackgroundValue = getResponsiveValue(color, breakpoint);\n // @ts-expect-error: We always return any from getResponsiveValue so value can't be inferred here\n const tokenValue = getIn(theme, `colors.${responsiveBackgroundValue}`);\n return tokenValue ?? responsiveBackgroundValue;\n};\n\nconst getBorderRadiusValue = (\n borderRadius: BaseBoxProps['borderRadius'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderRadiusValue = getResponsiveValue(borderRadius, breakpoint);\n return isEmpty(responsiveBorderRadiusValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.radius.${responsiveBorderRadiusValue}`));\n};\n\nconst getBorderWidthValue = (\n borderWidth: BaseBoxProps['borderWidth'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderWidthValue = getResponsiveValue(borderWidth, breakpoint);\n return isEmpty(responsiveBorderWidthValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.width.${responsiveBorderWidthValue}`));\n};\n\nexport const getElevationValue = (\n elevation: BaseBoxProps['elevation'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveElevationValue = getResponsiveValue(elevation, breakpoint);\n return isEmpty(responsiveElevationValue)\n ? undefined\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n getIn(theme, `elevation.${responsiveElevationValue!}`);\n};\n\ntype GetBorderStyleValueReturnType =\n | CSSObject['borderStyle']\n | CSSObject['borderTopStyle']\n | CSSObject['borderBottomStyle']\n | CSSObject['borderLeftStyle']\n | CSSObject['borderRightStyle'];\nconst getBorderStyleValue = (\n borderStyle: BaseBoxProps['borderStyle'],\n breakpoint?: keyof Breakpoints,\n hasBorder?: boolean,\n // Using any as return type because borderStyle's type is incompatible with borderBottomStyle. There are ways to fix it but anyway since its internal function. Taking an easy way out\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): GetBorderStyleValueReturnType => {\n if (borderStyle) {\n return getResponsiveValue(borderStyle, breakpoint);\n }\n\n if (hasBorder) {\n return 'solid';\n }\n\n return undefined;\n};\n\nconst getAllProps = (\n props: BaseBoxProps & { theme: Theme },\n breakpoint?: keyof Breakpoints,\n): CSSObject => {\n const hasBorder = props.borderWidth || props.borderColor;\n const hasBorderRight = props.borderRight || props.borderRightColor || props.borderRightWidth;\n const hasBorderLeft = props.borderLeft || props.borderLeftColor || props.borderLeftWidth;\n const hasBorderTop = props.borderTop || props.borderTopColor || props.borderTopWidth;\n const hasBorderBottom = props.borderBottom || props.borderBottomColor || props.borderBottomWidth;\n\n return {\n display: getResponsiveValue(props.display, breakpoint),\n overflow: getResponsiveValue(props.overflow, breakpoint),\n overflowX: getResponsiveValue(props.overflowX, breakpoint),\n overflowY: getResponsiveValue(props.overflowY, breakpoint),\n textAlign: getResponsiveValue(props.textAlign, breakpoint),\n whiteSpace: getResponsiveValue(props.whiteSpace, breakpoint),\n\n // Flex\n flex: getResponsiveValue(props.flex, breakpoint),\n flexWrap: getResponsiveValue(props.flexWrap, breakpoint),\n flexDirection: getResponsiveValue(props.flexDirection, breakpoint),\n flexGrow: getResponsiveValue(props.flexGrow, breakpoint),\n flexShrink: getResponsiveValue(props.flexShrink, breakpoint),\n flexBasis: getResponsiveValue(props.flexBasis, breakpoint),\n alignItems: getResponsiveValue(props.alignItems, breakpoint),\n alignContent: getResponsiveValue(props.alignContent, breakpoint),\n alignSelf: getResponsiveValue(props.alignSelf, breakpoint),\n justifyItems: getResponsiveValue(props.justifyItems, breakpoint),\n justifyContent: getResponsiveValue(props.justifyContent, breakpoint),\n justifySelf: getResponsiveValue(props.justifySelf, breakpoint),\n placeSelf: getResponsiveValue(props.placeSelf, breakpoint),\n placeItems: getResponsiveValue(props.placeItems, breakpoint),\n order: getResponsiveValue(props.order, breakpoint),\n position: getResponsiveValue(props.position, breakpoint),\n zIndex: getResponsiveValue(props.zIndex, breakpoint),\n\n // Grid\n grid: getResponsiveValue(props.grid, breakpoint),\n gridColumn: getResponsiveValue(props.gridColumn, breakpoint),\n gridRow: getResponsiveValue(props.gridRow, breakpoint),\n gridRowStart: getResponsiveValue(props.gridRowStart, breakpoint),\n gridRowEnd: getResponsiveValue(props.gridRowEnd, breakpoint),\n gridArea: getResponsiveValue(props.gridArea, breakpoint),\n gridAutoFlow: getResponsiveValue(props.gridAutoFlow, breakpoint),\n gridAutoRows: getResponsiveValue(props.gridAutoRows, breakpoint),\n gridAutoColumns: getResponsiveValue(props.gridAutoColumns, breakpoint),\n gridTemplate: getResponsiveValue(props.gridTemplate, breakpoint),\n gridTemplateAreas: getResponsiveValue(props.gridTemplateAreas, breakpoint),\n gridTemplateColumns: getResponsiveValue(props.gridTemplateColumns, breakpoint),\n gridTemplateRows: getResponsiveValue(props.gridTemplateRows, breakpoint),\n\n // Spacing Props\n padding: getSpacingValue(props.padding, props.theme, breakpoint),\n paddingTop: getSpacingValue(props.paddingTop ?? props.paddingY, props.theme, breakpoint),\n paddingBottom: getSpacingValue(props.paddingBottom ?? props.paddingY, props.theme, breakpoint),\n paddingRight: getSpacingValue(props.paddingRight ?? props.paddingX, props.theme, breakpoint),\n paddingLeft: getSpacingValue(props.paddingLeft ?? props.paddingX, props.theme, breakpoint),\n margin: getSpacingValue(props.margin, props.theme, breakpoint),\n marginBottom: getSpacingValue(props.marginBottom ?? props.marginY, props.theme, breakpoint),\n marginTop: getSpacingValue(props.marginTop ?? props.marginY, props.theme, breakpoint),\n marginRight: getSpacingValue(props.marginRight ?? props.marginX, props.theme, breakpoint),\n marginLeft: getSpacingValue(props.marginLeft ?? props.marginX, props.theme, breakpoint),\n height: getSpacingValue(props.height, props.theme, breakpoint),\n minHeight: getSpacingValue(props.minHeight, props.theme, breakpoint),\n maxHeight: getSpacingValue(props.maxHeight, props.theme, breakpoint),\n width: getSpacingValue(props.width, props.theme, breakpoint),\n minWidth: getSpacingValue(props.minWidth, props.theme, breakpoint),\n maxWidth: getSpacingValue(props.maxWidth, props.theme, breakpoint),\n gap: getSpacingValue(props.gap, props.theme, breakpoint),\n rowGap: getSpacingValue(props.rowGap, props.theme, breakpoint),\n columnGap: getSpacingValue(props.columnGap, props.theme, breakpoint),\n top: getSpacingValue(props.top, props.theme, breakpoint),\n right: getSpacingValue(props.right, props.theme, breakpoint),\n bottom: getSpacingValue(props.bottom, props.theme, breakpoint),\n left: getSpacingValue(props.left, props.theme, breakpoint),\n\n // Visual props\n backgroundColor: getColorValue(props.backgroundColor, props.theme, breakpoint),\n backgroundImage: getResponsiveValue(props.backgroundImage, breakpoint),\n backgroundSize: getResponsiveValue(props.backgroundSize, breakpoint),\n backgroundPosition: getResponsiveValue(props.backgroundPosition, breakpoint),\n backgroundOrigin: getResponsiveValue(props.backgroundOrigin, breakpoint),\n backgroundRepeat: getResponsiveValue(props.backgroundRepeat, breakpoint),\n borderRadius: getBorderRadiusValue(props.borderRadius, props.theme, breakpoint),\n lineHeight: getSpacingValue(props.lineHeight, props.theme, breakpoint),\n border: getResponsiveValue(props.border, breakpoint),\n borderTop: getResponsiveValue(props.borderTop, breakpoint),\n borderRight: getResponsiveValue(props.borderRight, breakpoint),\n borderBottom: getResponsiveValue(props.borderBottom, breakpoint),\n borderLeft: getResponsiveValue(props.borderLeft, breakpoint),\n borderWidth: getBorderWidthValue(props.borderWidth, props.theme, breakpoint),\n borderColor: getColorValue(props.borderColor, props.theme, breakpoint),\n borderTopWidth: getBorderWidthValue(props.borderTopWidth, props.theme, breakpoint),\n borderTopColor: getColorValue(props.borderTopColor, props.theme, breakpoint),\n borderRightWidth: getBorderWidthValue(props.borderRightWidth, props.theme, breakpoint),\n borderRightColor: getColorValue(props.borderRightColor, props.theme, breakpoint),\n borderBottomWidth: getBorderWidthValue(props.borderBottomWidth, props.theme, breakpoint),\n borderBottomColor: getColorValue(props.borderBottomColor, props.theme, breakpoint),\n borderLeftWidth: getBorderWidthValue(props.borderLeftWidth, props.theme, breakpoint),\n borderLeftColor: getColorValue(props.borderLeftColor, props.theme, breakpoint),\n borderTopLeftRadius: getBorderRadiusValue(props.borderTopLeftRadius, props.theme, breakpoint),\n borderTopRightRadius: getBorderRadiusValue(props.borderTopRightRadius, props.theme, breakpoint),\n borderBottomRightRadius: getBorderRadiusValue(\n props.borderBottomRightRadius,\n props.theme,\n breakpoint,\n ),\n borderBottomLeftRadius: getBorderRadiusValue(\n props.borderBottomLeftRadius,\n props.theme,\n breakpoint,\n ),\n borderStyle: getBorderStyleValue(\n props.borderStyle,\n breakpoint,\n Boolean(hasBorder),\n ) as CSSObject['borderStyle'],\n cursor: getResponsiveValue(props.cursor, breakpoint),\n // Since we only allow 'solid', we can use the same value for all borders if hasBorder is true\n // If hasBorder is false, we need to check each border individually\n ...(!hasBorder && {\n borderTopStyle: getBorderStyleValue(\n props.borderTopStyle,\n breakpoint,\n Boolean(hasBorderTop),\n ) as CSSObject['borderTopStyle'],\n borderBottomStyle: getBorderStyleValue(\n props.borderBottomStyle,\n breakpoint,\n Boolean(hasBorderBottom),\n ) as CSSObject['borderBottomStyle'],\n borderLeftStyle: getBorderStyleValue(\n props.borderLeftStyle,\n breakpoint,\n Boolean(hasBorderLeft),\n ) as CSSObject['borderLeftStyle'],\n borderRightStyle: getBorderStyleValue(\n props.borderRightStyle,\n breakpoint,\n Boolean(hasBorderRight),\n ) as CSSObject['borderRightStyle'],\n }),\n touchAction: getResponsiveValue(props.touchAction, breakpoint),\n userSelect: getResponsiveValue(props.userSelect, breakpoint),\n pointerEvents: getResponsiveValue(props.pointerEvents),\n opacity: getResponsiveValue(props.opacity, breakpoint),\n visibility: getResponsiveValue(props.visibility, breakpoint),\n ...(!isReactNative() && {\n boxShadow: getElevationValue(props.elevation, props.theme, breakpoint),\n }),\n\n // Polygon support\n transform: getResponsiveValue(props.transform as string, breakpoint),\n transformOrigin: getResponsiveValue(props.transformOrigin, breakpoint),\n clipPath: getResponsiveValue(props.clipPath, breakpoint),\n };\n};\n\n/** We only add breakpoint if at least one of the value is defined */\nconst shouldAddBreakpoint = (cssProps: CSSObject): boolean => {\n const firstDefinedValue = Object.values(cssProps).find(\n (cssValue) => cssValue !== undefined && cssValue !== null,\n );\n\n return firstDefinedValue !== undefined;\n};\n\nconst getAllMediaQueries = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n if (isReactNative()) {\n return {};\n }\n\n const { base, ...breakpointsWithoutBase } = breakpoints;\n\n return Object.fromEntries(\n Object.entries(breakpointsWithoutBase).map(([breakpointKey, breakpointValue]) => {\n const cssPropsForCurrentBreakpoint = getAllProps(props, breakpointKey as keyof Breakpoints);\n if (!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)) {\n return [];\n }\n\n const mediaQuery = `@media ${getMediaQuery({ min: breakpointValue })}`;\n return [mediaQuery, cssPropsForCurrentBreakpoint];\n }),\n );\n};\n\nconst getBaseBoxStyles = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n return {\n ...getAllProps(props),\n ...getAllMediaQueries(props),\n };\n};\n\nexport {\n getBaseBoxStyles,\n getSpacingValue,\n getColorValue,\n getBorderRadiusValue,\n shouldAddBreakpoint,\n getAllMediaQueries,\n getAllProps,\n};\n"],"names":["isSpacingToken","value","startsWith","getSpacingValue","spacingValue","theme","breakpoint","isEmpty","undefined","responsiveSpacingValue","getResponsiveValue","Array","isArray","map","join","spacingReturnValue","getIn","makeSpace","getColorValue","color","responsiveBackgroundValue","tokenValue","concat","getBorderRadiusValue","borderRadius","responsiveBorderRadiusValue","makeBorderSize","getBorderWidthValue","borderWidth","responsiveBorderWidthValue","getElevationValue","elevation","responsiveElevationValue","getBorderStyleValue","borderStyle","hasBorder","getAllProps","props","_props$paddingTop","_props$paddingBottom","_props$paddingRight","_props$paddingLeft","_props$marginBottom","_props$marginTop","_props$marginRight","_props$marginLeft","borderColor","hasBorderRight","borderRight","borderRightColor","borderRightWidth","hasBorderLeft","borderLeft","borderLeftColor","borderLeftWidth","hasBorderTop","borderTop","borderTopColor","borderTopWidth","hasBorderBottom","borderBottom","borderBottomColor","borderBottomWidth","_objectSpread","display","overflow","overflowX","overflowY","textAlign","whiteSpace","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","position","zIndex","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingY","paddingBottom","paddingRight","paddingX","paddingLeft","margin","marginBottom","marginY","marginTop","marginRight","marginX","marginLeft","height","minHeight","maxHeight","width","minWidth","maxWidth","gap","rowGap","columnGap","top","right","bottom","left","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","lineHeight","border","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","Boolean","cursor","borderTopStyle","borderBottomStyle","borderLeftStyle","borderRightStyle","touchAction","userSelect","pointerEvents","opacity","visibility","isReactNative","boxShadow","transform","transformOrigin","clipPath","shouldAddBreakpoint","cssProps","firstDefinedValue","Object","values","find","cssValue","getAllMediaQueries","base","breakpoints","breakpointsWithoutBase","_objectWithoutProperties","_excluded","fromEntries","entries","_ref","_ref2","_slicedToArray","breakpointKey","breakpointValue","cssPropsForCurrentBreakpoint","mediaQuery","getMediaQuery","min","getBaseBoxStyles"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAa,EAA6C;EAChF,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,UAAU,CAAC,UAAU,CAAC,CAAA;AAClE,CAAC,CAAA;AAEKC,IAAAA,gBAAe,GAAG,SAAlBA,eAAeA,CACnBC,YAEa,EACbC,KAAY,EACZC,UAA8B,EACP;AACvB,EAAA,IAAIC,OAAO,CAACH,YAAY,CAAC,EAAE;AACzB,IAAA,OAAOI,SAAS,CAAA;AAClB,GAAA;AAEA,EAAA,IAAMC,sBAAsB,GAAGC,kBAAkB,CAC/CN,YAAY,EACZE,U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CAAAF,IAAA,EAAA,CAAA,CAAA;AAApCG,MAAAA,aAAa,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,MAAAA,eAAe,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;AACzE,IAAA,IAAMI,4BAA4B,GAAG3I,WAAW,CAACC,KAAK,EAAEwI,aAAkC,CAAC,CAAA;AAC3F,IAAA,IAAI,CAAClB,mBAAmB,CAACoB,4BAA4B,CAAC,EAAE;AACtD,MAAA,OAAO,EAAE,CAAA;AACX,KAAA;AAEA,IAAA,IAAMC,UAAU,GAAA,SAAA,CAAA1J,MAAA,CAAa2J,aAAa,CAAC;AAAEC,MAAAA,GAAG,EAAEJ,eAAAA;AAAgB,KAAC,CAAC,CAAE,CAAA;AACtE,IAAA,OAAO,CAACE,UAAU,EAAED,4BAA4B,CAAC,CAAA;AACnD,GAAC,CACH,CAAC,CAAA;AACH,EAAC;AAED,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAI9I,KAAsC,EAAgB;AAC9E,EAAA,OAAA0B,aAAA,CAAAA,aAAA,CAAA,EAAA,EACK3B,WAAW,CAACC,KAAK,CAAC,CAClB6H,EAAAA,kBAAkB,CAAC7H,KAAK,CAAC,CAAA,CAAA;AAEhC;;;;"}
1
+ {"version":3,"file":"baseBoxStyles.js","sources":["../../../../../../../src/components/Box/BaseBox/baseBoxStyles.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CSSObject } from 'styled-components';\nimport type {\n BaseBoxProps,\n MakeValueResponsive,\n SpacingValueType,\n ArrayOfMaxLength4,\n} from './types';\nimport { getResponsiveValue } from './getResponsiveValue';\nimport getIn from '~utils/lodashButBetter/get';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { Breakpoints } from '~tokens/global';\nimport { breakpoints } from '~tokens/global';\nimport { isReactNative, getMediaQuery } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\nconst isSpacingToken = (value: string): value is DotNotationSpacingStringToken => {\n return typeof value === 'string' && value.startsWith('spacing.');\n};\n\nconst getSpacingValue = (\n spacingValue:\n | MakeValueResponsive<SpacingValueType | ArrayOfMaxLength4<SpacingValueType>>\n | undefined,\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n if (isEmpty(spacingValue)) {\n return undefined;\n }\n\n const responsiveSpacingValue = getResponsiveValue(\n spacingValue as MakeValueResponsive<SpacingValueType | SpacingValueType[]>,\n breakpoint,\n );\n\n if (isEmpty(responsiveSpacingValue)) {\n return undefined;\n }\n\n if (responsiveSpacingValue === 'auto') {\n return responsiveSpacingValue;\n }\n\n if (Array.isArray(responsiveSpacingValue)) {\n return responsiveSpacingValue.map((value) => getSpacingValue(value, theme)).join(' ');\n }\n\n if (isSpacingToken(responsiveSpacingValue)) {\n const spacingReturnValue = getIn(theme, responsiveSpacingValue);\n return isEmpty(spacingReturnValue) ? makeSpace(spacingReturnValue!) : undefined;\n }\n\n // pixel or with unit values\n return responsiveSpacingValue;\n};\n\nconst getColorValue = (\n color: BaseBoxProps['backgroundColor'] | BaseBoxProps['borderColor'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string => {\n const responsiveBackgroundValue = getResponsiveValue(color, breakpoint);\n // @ts-expect-error: We always return any from getResponsiveValue so value can't be inferred here\n const tokenValue = getIn(theme, `colors.${responsiveBackgroundValue}`);\n return tokenValue ?? responsiveBackgroundValue;\n};\n\nconst getBorderRadiusValue = (\n borderRadius: BaseBoxProps['borderRadius'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderRadiusValue = getResponsiveValue(borderRadius, breakpoint);\n return isEmpty(responsiveBorderRadiusValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.radius.${responsiveBorderRadiusValue}`));\n};\n\nconst getBorderWidthValue = (\n borderWidth: BaseBoxProps['borderWidth'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderWidthValue = getResponsiveValue(borderWidth, breakpoint);\n return isEmpty(responsiveBorderWidthValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.width.${responsiveBorderWidthValue}`));\n};\n\nexport const getElevationValue = (\n elevation: BaseBoxProps['elevation'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveElevationValue = getResponsiveValue(elevation, breakpoint);\n return isEmpty(responsiveElevationValue)\n ? undefined\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n getIn(theme, `elevation.${responsiveElevationValue!}`);\n};\n\ntype GetBorderStyleValueReturnType =\n | CSSObject['borderStyle']\n | CSSObject['borderTopStyle']\n | CSSObject['borderBottomStyle']\n | CSSObject['borderLeftStyle']\n | CSSObject['borderRightStyle'];\nconst getBorderStyleValue = (\n borderStyle: BaseBoxProps['borderStyle'],\n breakpoint?: keyof Breakpoints,\n hasBorder?: boolean,\n // Using any as return type because borderStyle's type is incompatible with borderBottomStyle. There are ways to fix it but anyway since its internal function. Taking an easy way out\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): GetBorderStyleValueReturnType => {\n if (borderStyle) {\n return getResponsiveValue(borderStyle, breakpoint);\n }\n\n if (hasBorder) {\n return 'solid';\n }\n\n return undefined;\n};\n\nconst getAllProps = (\n props: BaseBoxProps & { theme: Theme },\n breakpoint?: keyof Breakpoints,\n): CSSObject => {\n const hasBorder = props.borderWidth || props.borderColor;\n const hasBorderRight = props.borderRight || props.borderRightColor || props.borderRightWidth;\n const hasBorderLeft = props.borderLeft || props.borderLeftColor || props.borderLeftWidth;\n const hasBorderTop = props.borderTop || props.borderTopColor || props.borderTopWidth;\n const hasBorderBottom = props.borderBottom || props.borderBottomColor || props.borderBottomWidth;\n\n return {\n display: getResponsiveValue(props.display, breakpoint),\n overflow: getResponsiveValue(props.overflow, breakpoint),\n overflowX: getResponsiveValue(props.overflowX, breakpoint),\n overflowY: getResponsiveValue(props.overflowY, breakpoint),\n textAlign: getResponsiveValue(props.textAlign, breakpoint),\n whiteSpace: getResponsiveValue(props.whiteSpace, breakpoint),\n\n // Flex\n flex: getResponsiveValue(props.flex, breakpoint),\n flexWrap: getResponsiveValue(props.flexWrap, breakpoint),\n flexDirection: getResponsiveValue(props.flexDirection, breakpoint),\n flexGrow: getResponsiveValue(props.flexGrow, breakpoint),\n flexShrink: getResponsiveValue(props.flexShrink, breakpoint),\n flexBasis: getResponsiveValue(props.flexBasis, breakpoint),\n alignItems: getResponsiveValue(props.alignItems, breakpoint),\n alignContent: getResponsiveValue(props.alignContent, breakpoint),\n alignSelf: getResponsiveValue(props.alignSelf, breakpoint),\n justifyItems: getResponsiveValue(props.justifyItems, breakpoint),\n justifyContent: getResponsiveValue(props.justifyContent, breakpoint),\n justifySelf: getResponsiveValue(props.justifySelf, breakpoint),\n placeSelf: getResponsiveValue(props.placeSelf, breakpoint),\n placeItems: getResponsiveValue(props.placeItems, breakpoint),\n order: getResponsiveValue(props.order, breakpoint),\n position: getResponsiveValue(props.position, breakpoint),\n zIndex: getResponsiveValue(props.zIndex, breakpoint),\n\n // Grid\n grid: getResponsiveValue(props.grid, breakpoint),\n gridColumn: getResponsiveValue(props.gridColumn, breakpoint),\n gridRow: getResponsiveValue(props.gridRow, breakpoint),\n gridRowStart: getResponsiveValue(props.gridRowStart, breakpoint),\n gridRowEnd: getResponsiveValue(props.gridRowEnd, breakpoint),\n gridArea: getResponsiveValue(props.gridArea, breakpoint),\n gridAutoFlow: getResponsiveValue(props.gridAutoFlow, breakpoint),\n gridAutoRows: getResponsiveValue(props.gridAutoRows, breakpoint),\n gridAutoColumns: getResponsiveValue(props.gridAutoColumns, breakpoint),\n gridTemplate: getResponsiveValue(props.gridTemplate, breakpoint),\n gridTemplateAreas: getResponsiveValue(props.gridTemplateAreas, breakpoint),\n gridTemplateColumns: getResponsiveValue(props.gridTemplateColumns, breakpoint),\n gridTemplateRows: getResponsiveValue(props.gridTemplateRows, breakpoint),\n\n // Spacing Props\n padding: getSpacingValue(props.padding, props.theme, breakpoint),\n paddingTop: getSpacingValue(props.paddingTop ?? props.paddingY, props.theme, breakpoint),\n paddingBottom: getSpacingValue(props.paddingBottom ?? props.paddingY, props.theme, breakpoint),\n paddingRight: getSpacingValue(props.paddingRight ?? props.paddingX, props.theme, breakpoint),\n paddingLeft: getSpacingValue(props.paddingLeft ?? props.paddingX, props.theme, breakpoint),\n margin: getSpacingValue(props.margin, props.theme, breakpoint),\n marginBottom: getSpacingValue(props.marginBottom ?? props.marginY, props.theme, breakpoint),\n marginTop: getSpacingValue(props.marginTop ?? props.marginY, props.theme, breakpoint),\n marginRight: getSpacingValue(props.marginRight ?? props.marginX, props.theme, breakpoint),\n marginLeft: getSpacingValue(props.marginLeft ?? props.marginX, props.theme, breakpoint),\n height: getSpacingValue(props.height, props.theme, breakpoint),\n minHeight: getSpacingValue(props.minHeight, props.theme, breakpoint),\n maxHeight: getSpacingValue(props.maxHeight, props.theme, breakpoint),\n width: getSpacingValue(props.width, props.theme, breakpoint),\n minWidth: getSpacingValue(props.minWidth, props.theme, breakpoint),\n maxWidth: getSpacingValue(props.maxWidth, props.theme, breakpoint),\n gap: getSpacingValue(props.gap, props.theme, breakpoint),\n rowGap: getSpacingValue(props.rowGap, props.theme, breakpoint),\n columnGap: getSpacingValue(props.columnGap, props.theme, breakpoint),\n top: getSpacingValue(props.top, props.theme, breakpoint),\n right: getSpacingValue(props.right, props.theme, breakpoint),\n bottom: getSpacingValue(props.bottom, props.theme, breakpoint),\n left: getSpacingValue(props.left, props.theme, breakpoint),\n\n // Visual props\n backgroundColor: getColorValue(props.backgroundColor, props.theme, breakpoint),\n backgroundImage: getResponsiveValue(props.backgroundImage, breakpoint),\n backgroundSize: getResponsiveValue(props.backgroundSize, breakpoint),\n backgroundPosition: getResponsiveValue(props.backgroundPosition, breakpoint),\n backgroundOrigin: getResponsiveValue(props.backgroundOrigin, breakpoint),\n backgroundRepeat: getResponsiveValue(props.backgroundRepeat, breakpoint),\n borderRadius: getBorderRadiusValue(props.borderRadius, props.theme, breakpoint),\n lineHeight: getSpacingValue(props.lineHeight, props.theme, breakpoint),\n border: getResponsiveValue(props.border, breakpoint),\n borderTop: getResponsiveValue(props.borderTop, breakpoint),\n borderRight: getResponsiveValue(props.borderRight, breakpoint),\n borderBottom: getResponsiveValue(props.borderBottom, breakpoint),\n borderLeft: getResponsiveValue(props.borderLeft, breakpoint),\n borderWidth: getBorderWidthValue(props.borderWidth, props.theme, breakpoint),\n borderColor: getColorValue(props.borderColor, props.theme, breakpoint),\n borderTopWidth: getBorderWidthValue(props.borderTopWidth, props.theme, breakpoint),\n borderTopColor: getColorValue(props.borderTopColor, props.theme, breakpoint),\n borderRightWidth: getBorderWidthValue(props.borderRightWidth, props.theme, breakpoint),\n borderRightColor: getColorValue(props.borderRightColor, props.theme, breakpoint),\n borderBottomWidth: getBorderWidthValue(props.borderBottomWidth, props.theme, breakpoint),\n borderBottomColor: getColorValue(props.borderBottomColor, props.theme, breakpoint),\n borderLeftWidth: getBorderWidthValue(props.borderLeftWidth, props.theme, breakpoint),\n borderLeftColor: getColorValue(props.borderLeftColor, props.theme, breakpoint),\n borderTopLeftRadius: getBorderRadiusValue(props.borderTopLeftRadius, props.theme, breakpoint),\n borderTopRightRadius: getBorderRadiusValue(props.borderTopRightRadius, props.theme, breakpoint),\n borderBottomRightRadius: getBorderRadiusValue(\n props.borderBottomRightRadius,\n props.theme,\n breakpoint,\n ),\n borderBottomLeftRadius: getBorderRadiusValue(\n props.borderBottomLeftRadius,\n props.theme,\n breakpoint,\n ),\n borderStyle: getBorderStyleValue(\n props.borderStyle,\n breakpoint,\n Boolean(hasBorder),\n ) as CSSObject['borderStyle'],\n cursor: getResponsiveValue(props.cursor, breakpoint),\n // Since we only allow 'solid', we can use the same value for all borders if hasBorder is true\n // If hasBorder is false, we need to check each border individually\n ...(!hasBorder && {\n borderTopStyle: getBorderStyleValue(\n props.borderTopStyle,\n breakpoint,\n Boolean(hasBorderTop),\n ) as CSSObject['borderTopStyle'],\n borderBottomStyle: getBorderStyleValue(\n props.borderBottomStyle,\n breakpoint,\n Boolean(hasBorderBottom),\n ) as CSSObject['borderBottomStyle'],\n borderLeftStyle: getBorderStyleValue(\n props.borderLeftStyle,\n breakpoint,\n Boolean(hasBorderLeft),\n ) as CSSObject['borderLeftStyle'],\n borderRightStyle: getBorderStyleValue(\n props.borderRightStyle,\n breakpoint,\n Boolean(hasBorderRight),\n ) as CSSObject['borderRightStyle'],\n }),\n touchAction: getResponsiveValue(props.touchAction, breakpoint),\n userSelect: getResponsiveValue(props.userSelect, breakpoint),\n pointerEvents: getResponsiveValue(props.pointerEvents),\n opacity: getResponsiveValue(props.opacity, breakpoint),\n visibility: getResponsiveValue(props.visibility, breakpoint),\n ...(!isReactNative() && {\n boxShadow: getElevationValue(props.elevation, props.theme, breakpoint),\n backdropFilter: getResponsiveValue(props.backdropFilter, breakpoint),\n transition: getResponsiveValue(props.transition, breakpoint),\n }),\n\n // Polygon support\n transform: getResponsiveValue(props.transform as string, breakpoint),\n transformOrigin: getResponsiveValue(props.transformOrigin, breakpoint),\n clipPath: getResponsiveValue(props.clipPath, breakpoint),\n\n // Animation\n };\n};\n\n/** We only add breakpoint if at least one of the value is defined */\nconst shouldAddBreakpoint = (cssProps: CSSObject): boolean => {\n const firstDefinedValue = Object.values(cssProps).find(\n (cssValue) => cssValue !== undefined && cssValue !== null,\n );\n\n return firstDefinedValue !== undefined;\n};\n\nconst getAllMediaQueries = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n if (isReactNative()) {\n return {};\n }\n\n const { base, ...breakpointsWithoutBase } = breakpoints;\n\n return Object.fromEntries(\n Object.entries(breakpointsWithoutBase).map(([breakpointKey, breakpointValue]) => {\n const cssPropsForCurrentBreakpoint = getAllProps(props, breakpointKey as keyof Breakpoints);\n if (!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)) {\n return [];\n }\n\n const mediaQuery = `@media ${getMediaQuery({ min: breakpointValue })}`;\n return [mediaQuery, cssPropsForCurrentBreakpoint];\n }),\n );\n};\n\nconst getBaseBoxStyles = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n return {\n ...getAllProps(props),\n ...getAllMediaQueries(props),\n };\n};\n\nexport {\n getBaseBoxStyles,\n getSpacingValue,\n getColorValue,\n getBorderRadiusValue,\n shouldAddBreakpoint,\n getAllMediaQueries,\n getAllProps,\n};\n"],"names":["isSpacingToken","value","startsWith","getSpacingValue","spacingValue","theme","breakpoint","isEmpty","undefined","responsiveSpacingValue","getResponsiveValue","Array","isArray","map","join","spacingReturnValue","getIn","makeSpace","getColorValue","color","responsiveBackgroundValue","tokenValue","concat","getBorderRadiusValue","borderRadius","responsiveBorderRadiusValue","makeBorderSize","getBorderWidthValue","borderWidth","responsiveBorderWidthValue","getElevationValue","elevation","responsiveElevationValue","getBorderStyleValue","borderStyle","hasBorder","getAllProps","props","_props$paddingTop","_props$paddingBottom","_props$paddingRight","_props$paddingLeft","_props$marginBottom","_props$marginTop","_props$marginRight","_props$marginLeft","borderColor","hasBorderRight","borderRight","borderRightColor","borderRightWidth","hasBorderLeft","borderLeft","borderLeftColor","borderLeftWidth","hasBorderTop","borderTop","borderTopColor","borderTopWidth","hasBorderBottom","borderBottom","borderBottomColor","borderBottomWidth","_objectSpread","display","overflow","overflowX","overflowY","textAlign","whiteSpace","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","position","zIndex","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingY","paddingBottom","paddingRight","paddingX","paddingLeft","margin","marginBottom","marginY","marginTop","marginRight","marginX","marginLeft","height","minHeight","maxHeight","width","minWidth","maxWidth","gap","rowGap","columnGap","top","right","bottom","left","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","lineHeight","border","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","Boolean","cursor","borderTopStyle","borderBottomStyle","borderLeftStyle","borderRightStyle","touchAction","userSelect","pointerEvents","opacity","visibility","isReactNative","boxShadow","backdropFilter","transition","transform","transformOrigin","clipPath","shouldAddBreakpoint","cssProps","firstDefinedValue","Object","values","find","cssValue","getAllMediaQueries","base","breakpoints","breakpointsWithoutBase","_objectWithoutProperties","_excluded","fromEntries","entries","_ref","_ref2","_slicedToArray","breakpointKey","breakpointValue","cssPropsForCurrentBreakpoint","mediaQuery","getMediaQuery","min","getBaseBoxStyles"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAa,EAA6C;EAChF,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,UAAU,CAAC,UAAU,CAAC,CAAA;AAClE,CAAC,CAAA;AAEKC,IAAAA,gBAAe,GAAG,SAAlBA,eAAeA,CACnBC,YAEa,EACbC,KAAY,EACZC,UAA8B,EACP;AACvB,EAAA,IAAIC,OAAO,CAACH,YAAY,CAAC,EAAE;AACzB,IAAA,OAAOI,SAAS,CAAA;AAClB,GAAA;AAEA,EAAA,IAAMC,sBAAsB,GAAGC,kBAAkB,CAC/CN,YAAY,EACZE,UACF,CAAC,CAAA;AAED,EAAA,IAAIC,OAAO,CAACE,sBAAsB,CAAC,EAAE;AACnC,IAAA,OAAOD,SAAS,CAAA;AAClB,GAAA;EAEA,IAAIC,sBAAsB,KAAK,MAAM,EAAE;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A,IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA,EAAA,CAAA,CAAA;AAApCG,MAAAA,aAAa,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,MAAAA,eAAe,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;AACzE,IAAA,IAAMI,4BAA4B,GAAG7I,WAAW,CAACC,KAAK,EAAE0I,aAAkC,CAAC,CAAA;AAC3F,IAAA,IAAI,CAAClB,mBAAmB,CAACoB,4BAA4B,CAAC,EAAE;AACtD,MAAA,OAAO,EAAE,CAAA;AACX,KAAA;AAEA,IAAA,IAAMC,UAAU,GAAA,SAAA,CAAA5J,MAAA,CAAa6J,aAAa,CAAC;AAAEC,MAAAA,GAAG,EAAEJ,eAAAA;AAAgB,KAAC,CAAC,CAAE,CAAA;AACtE,IAAA,OAAO,CAACE,UAAU,EAAED,4BAA4B,CAAC,CAAA;AACnD,GAAC,CACH,CAAC,CAAA;AACH,EAAC;AAED,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIhJ,KAAsC,EAAgB;AAC9E,EAAA,OAAA0B,aAAA,CAAAA,aAAA,CAAA,EAAA,EACK3B,WAAW,CAACC,KAAK,CAAC,CAClB+H,EAAAA,kBAAkB,CAAC/H,KAAK,CAAC,CAAA,CAAA;AAEhC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"propsTypes.js","sources":["../../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { DataAnalyticsAttribute, PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor:\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'feedback'>\n | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order' | 'flexWrap'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID &\n DataAnalyticsAttribute\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n DataAnalyticsAttribute &\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA6GA;AACMA,IAAAA,gBAAgB,GAAG,CACvB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO;;;;"}
1
+ {"version":3,"file":"propsTypes.js","sources":["../../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { DataAnalyticsAttribute, PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n | 'backdropFilter'\n | 'transition'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor:\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'feedback'>\n | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order' | 'flexWrap'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID &\n DataAnalyticsAttribute\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n DataAnalyticsAttribute &\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA6GA;AACMA,IAAAA,gBAAgB,GAAG,CACvB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO;;;;"}
@@ -129,6 +129,7 @@ var makeBoxProps = function makeBoxProps(props) {
129
129
  elevation: props.elevation,
130
130
  opacity: props.opacity,
131
131
  visibility: props.visibility,
132
+ backdropFilter: props.backdropFilter,
132
133
  // Border
133
134
  borderWidth: props.borderWidth,
134
135
  borderColor: props.borderColor,
@@ -154,6 +155,8 @@ var makeBoxProps = function makeBoxProps(props) {
154
155
  transform: props.transform,
155
156
  transformOrigin: props.transformOrigin,
156
157
  clipPath: props.clipPath,
158
+ // Animation
159
+ transition: props.transition,
157
160
  // callbacks
158
161
  onMouseEnter: props.onMouseEnter,
159
162
  onMouseLeave: props.onMouseLeave,