@foxford/ui 2.24.0 → 2.26.0-beta-47ce7b9-20240425

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 (36) hide show
  1. package/components/Input/Input.js.map +1 -1
  2. package/components/Popover/Popover.js +2 -0
  3. package/components/Popover/Popover.js.map +1 -0
  4. package/components/PopoverComponent/PopoverComponent.js +2 -0
  5. package/components/PopoverComponent/PopoverComponent.js.map +1 -0
  6. package/components/PopoverComponent/constants.js +2 -0
  7. package/components/PopoverComponent/constants.js.map +1 -0
  8. package/components/PopoverComponent/images/close.module.svg.js +2 -0
  9. package/components/PopoverComponent/images/close.module.svg.js.map +1 -0
  10. package/components/PopoverComponent/style.js +2 -0
  11. package/components/PopoverComponent/style.js.map +1 -0
  12. package/components/Tooltip/Tooltip.js +1 -1
  13. package/components/Tooltip/Tooltip.js.map +1 -1
  14. package/components/Tooltip/TooltipWrapper.js +2 -0
  15. package/components/Tooltip/TooltipWrapper.js.map +1 -0
  16. package/components/Tooltip/default-constants.js +2 -0
  17. package/components/Tooltip/default-constants.js.map +1 -0
  18. package/components/TooltipComponent/TooltipComponent.js +2 -0
  19. package/components/TooltipComponent/TooltipComponent.js.map +1 -0
  20. package/components/TooltipComponent/constants.js +2 -0
  21. package/components/TooltipComponent/constants.js.map +1 -0
  22. package/components/TooltipComponent/images/close.module.svg.js +2 -0
  23. package/components/TooltipComponent/images/close.module.svg.js.map +1 -0
  24. package/components/TooltipComponent/style.js +2 -0
  25. package/components/TooltipComponent/style.js.map +1 -0
  26. package/dts/index.d.ts +378 -186
  27. package/hooks/useKeyboardListener.js +2 -0
  28. package/hooks/useKeyboardListener.js.map +1 -0
  29. package/index.cjs.js +1 -1
  30. package/index.cjs.js.map +1 -1
  31. package/index.js +1 -1
  32. package/package.json +2 -1
  33. package/theme/themes.js +1 -1
  34. package/theme/themes.js.map +1 -1
  35. package/components/Tooltip/tooltip-styles.js +0 -2
  36. package/components/Tooltip/tooltip-styles.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef, useState, useImperativeHandle, useRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { FormInputLabel, SIZES } from 'components/FormInputLabel'\nimport { Icon } from 'components/Icon'\nimport { InputPhone } from 'components/Input.Phone'\nimport { Spacer } from 'components/Spacer'\nimport Minus from './images/minus.module.svg'\nimport Plus from './images/plus.module.svg'\nimport * as Styled from './style'\nimport type { InputProps } from './types'\n\nconst COMPONENT_NAME = 'Input'\n\n/**\n *\n * Component accepts all \\<input\\> attributes and \"react-input-mask\" props.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to \\<input\\>.\n *\n * See full [InputProps](https://github.com/foxford/ui/blob/master/src/components/Input/types.ts)\n */\nconst Input: React.ForwardRefExoticComponent<InputProps> & { Phone: typeof InputPhone } = Object.assign(\n withMergedProps<InputProps, HTMLInputElement>(\n forwardRef((props, forwardedRef) => {\n const theme = useTheme()\n\n const {\n size = 'm',\n mask = '',\n rounded = true,\n color = 'mineShaft',\n placeholderColor = 'silver',\n width = theme.defaultInputControlsWidth,\n type = 'text',\n labelPosition = 'dynamic',\n textProps = {},\n iconProps = {},\n controls = {},\n preset,\n className,\n style,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n margin,\n marginXXS,\n marginXS,\n marginS,\n marginM,\n marginL,\n marginXL,\n marginTop,\n marginTopXXS,\n marginTopXS,\n marginTopS,\n marginTopM,\n marginTopL,\n marginTopXL,\n marginRight,\n marginRightXXS,\n marginRightXS,\n marginRightS,\n marginRightM,\n marginRightL,\n marginRightXL,\n marginBottom,\n marginBottomXXS,\n marginBottomXS,\n marginBottomS,\n marginBottomM,\n marginBottomL,\n marginBottomXL,\n marginLeft,\n marginLeftXXS,\n marginLeftXS,\n marginLeftS,\n marginLeftM,\n marginLeftL,\n marginLeftXL,\n marginUnits,\n palette,\n widthXXS,\n widthXS,\n widthS,\n widthM,\n widthL,\n widthXL,\n error,\n success,\n label,\n icon,\n text,\n primary,\n secondary,\n onColored,\n fluid,\n disabled,\n inline,\n inputRef,\n ...inputProps\n } = props\n\n const {\n icon: additionalControlIcon,\n iconProps: additionalControlIconProps = {},\n buttonProps: additionalControlButtonProps = {},\n } = controls.additional ?? {}\n\n const {\n icon: numberControlIcon,\n iconProps: numberControlIconProps = {},\n buttonProps: numberControlButtonProps = [],\n } = controls.number ?? {}\n\n const [minus, plus] = Array.isArray(numberControlIcon) ? numberControlIcon : [numberControlIcon]\n\n const minusButtonProps =\n (Array.isArray(numberControlButtonProps) ? numberControlButtonProps[0] : numberControlButtonProps) ?? {}\n\n const plusButtonProps = (Array.isArray(numberControlButtonProps) ? numberControlButtonProps[1] : {}) ?? {}\n\n const ref = useRef<HTMLInputElement | null>(null)\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(forwardedRef, () => ref.current, [])\n\n const hasInitValue =\n typeof inputProps.value === 'string' ||\n typeof inputProps.value === 'number' ||\n typeof inputProps.defaultValue === 'string' ||\n typeof inputProps.defaultValue === 'number'\n\n const [active, setActive] = useState(hasInitValue)\n const [hasValue, setHasValue] = useState(hasInitValue)\n\n const [minusDisabled, setMinusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.min === undefined) return false\n\n const { value = Infinity, defaultValue = Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const minValue = typeof inputProps.min === 'number' ? inputProps.min : parseFloat(inputProps.min)\n\n return Math.min(initValue, initDefaultValue) <= minValue\n })\n\n const [plusDisabled, setPlusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.max === undefined) return false\n\n const { value = -Infinity, defaultValue = -Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const maxValue = typeof inputProps.max === 'number' ? inputProps.max : parseFloat(inputProps.max)\n\n return Math.max(initValue, initDefaultValue) >= maxValue\n })\n\n if (preset !== 'brand') {\n return (\n <Styled.Root\n {...inputProps}\n inputRef={\n inputRef ??\n ((input) => {\n ref.current = input\n })\n }\n className={className}\n style={style}\n size={typeof size === 'number' ? size : undefined}\n mask={mask}\n rounded={rounded}\n color={color}\n placeholderColor={placeholderColor}\n width={width}\n widthXXS={widthXXS}\n widthXS={widthXS}\n widthS={widthS}\n widthM={widthM}\n widthL={widthL}\n widthXL={widthXL}\n error={error}\n type={type}\n fluid={fluid}\n disabled={disabled}\n />\n )\n }\n\n return (\n <FormInputLabel\n className={className}\n style={style}\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizeUnits={sizeUnits}\n sizes={sizes}\n margin={margin}\n marginXXS={marginXXS}\n marginXS={marginXS}\n marginS={marginS}\n marginM={marginM}\n marginL={marginL}\n marginXL={marginXL}\n marginTop={marginTop}\n marginTopXXS={marginTopXXS}\n marginTopXS={marginTopXS}\n marginTopS={marginTopS}\n marginTopM={marginTopM}\n marginTopL={marginTopL}\n marginTopXL={marginTopXL}\n marginRight={marginRight}\n marginRightXXS={marginRightXXS}\n marginRightXS={marginRightXS}\n marginRightS={marginRightS}\n marginRightM={marginRightM}\n marginRightL={marginRightL}\n marginRightXL={marginRightXL}\n marginBottom={marginBottom}\n marginBottomXXS={marginBottomXXS}\n marginBottomXS={marginBottomXS}\n marginBottomS={marginBottomS}\n marginBottomM={marginBottomM}\n marginBottomL={marginBottomL}\n marginBottomXL={marginBottomXL}\n marginLeft={marginLeft}\n marginLeftXXS={marginLeftXXS}\n marginLeftXS={marginLeftXS}\n marginLeftS={marginLeftS}\n marginLeftM={marginLeftM}\n marginLeftL={marginLeftL}\n marginLeftXL={marginLeftXL}\n marginUnits={marginUnits}\n palette={palette}\n error={error}\n success={success}\n label={label}\n labelPosition={labelPosition}\n icon={icon}\n text={text}\n primary={primary}\n secondary={secondary}\n onColored={onColored}\n disabled={disabled}\n inline={inline}\n active={active}\n textProps={textProps}\n iconProps={{\n size: 24,\n color: disabled ? 'content-disabled' : 'content-onmain-tertiary',\n ...iconProps,\n }}\n onClick={() => {\n if (ref.current) {\n ref.current.focus()\n }\n }}\n onFocus={(evt) => {\n if (evt.target !== evt.currentTarget) {\n setActive(true)\n }\n }}\n onBlur={(evt) => {\n if (evt.target !== evt.currentTarget && !hasValue) {\n setActive(false)\n }\n }}\n input={\n <Styled.Input\n {...inputProps}\n inputRef={(input) => {\n ref.current = input\n }}\n mask={mask}\n palette={palette}\n type={type}\n label={label}\n labelPosition={labelPosition}\n disabled={disabled}\n active={active}\n onChange={(evt) => {\n if (inputProps.onChange) {\n inputProps.onChange(evt)\n }\n\n if (type === 'number') {\n const currentValue = parseFloat(evt.currentTarget.value)\n\n const minValueReached = currentValue <= parseFloat(evt.currentTarget.min)\n const maxValueReached = currentValue >= parseFloat(evt.currentTarget.max)\n\n setMinusDisabled(minValueReached)\n setPlusDisabled(maxValueReached)\n\n if (minValueReached || maxValueReached) {\n evt.currentTarget.focus()\n }\n }\n }}\n onBlur={(evt) => {\n evt.stopPropagation()\n if (inputProps.onBlur) {\n inputProps.onBlur(evt)\n }\n\n setHasValue(Boolean(evt.currentTarget.value))\n setActive(Boolean(evt.currentTarget.value))\n }}\n />\n }\n controls={\n additionalControlIcon || type === 'number' ? (\n <>\n {additionalControlIcon && (\n <Styled.InputControl\n {...additionalControlButtonProps}\n type='button'\n palette={palette}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (additionalControlButtonProps.onClick) {\n additionalControlButtonProps.onClick(evt)\n }\n }}\n >\n <Icon\n icon={additionalControlIcon}\n as='span'\n size={24}\n color='inherit'\n {...additionalControlIconProps}\n />\n </Styled.InputControl>\n )}\n {type === 'number' && (\n <Spacer display='flex' marginLeft={4}>\n <Styled.InputControl\n {...minusButtonProps}\n type='button'\n palette={palette}\n disabled={disabled || minusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (minusButtonProps.onClick) {\n minusButtonProps.onClick(evt)\n }\n\n try {\n if (ref.current) {\n const prev = ref.current.value\n ref.current.stepDown()\n\n const decremented = ref.current.value\n if (prev !== decremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n >\n <Icon icon={minus ?? <Minus />} as='span' size={24} color='inherit' {...numberControlIconProps} />\n </Styled.InputControl>\n <Styled.InputControl\n {...plusButtonProps}\n type='button'\n palette={palette}\n disabled={disabled || plusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (plusButtonProps.onClick) {\n plusButtonProps.onClick(evt)\n }\n\n try {\n if (ref.current) {\n const prev = ref.current.value\n ref.current.stepUp()\n\n const incremented = ref.current.value\n if (prev !== incremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n >\n <Icon icon={plus ?? <Plus />} as='span' size={24} color='inherit' {...numberControlIconProps} />\n </Styled.InputControl>\n </Spacer>\n )}\n </>\n ) : undefined\n }\n />\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Phone: InputPhone,\n }\n)\n\nexport { Input, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Input","Object","assign","withMergedProps","forwardRef","props","forwardedRef","_controls$additional","_controls$number","_ref","_ref2","theme","useTheme","size","mask","rounded","color","placeholderColor","width","defaultInputControlsWidth","type","labelPosition","textProps","iconProps","controls","preset","className","style","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","margin","marginXXS","marginXS","marginS","marginM","marginL","marginXL","marginTop","marginTopXXS","marginTopXS","marginTopS","marginTopM","marginTopL","marginTopXL","marginRight","marginRightXXS","marginRightXS","marginRightS","marginRightM","marginRightL","marginRightXL","marginBottom","marginBottomXXS","marginBottomXS","marginBottomS","marginBottomM","marginBottomL","marginBottomXL","marginLeft","marginLeftXXS","marginLeftXS","marginLeftS","marginLeftM","marginLeftL","marginLeftXL","marginUnits","palette","widthXXS","widthXS","widthS","widthM","widthL","widthXL","error","success","label","icon","text","primary","secondary","onColored","fluid","disabled","inline","inputRef","inputProps","_excluded","additionalControlIcon","additionalControlIconProps","buttonProps","additionalControlButtonProps","additional","numberControlIcon","numberControlIconProps","numberControlButtonProps","number","minus","plus","Array","isArray","minusButtonProps","plusButtonProps","ref","useRef","useImperativeHandle","current","hasInitValue","value","defaultValue","active","setActive","useState","hasValue","setHasValue","minusDisabled","setMinusDisabled","undefined","min","Infinity","initValue","parseFloat","initDefaultValue","minValue","Math","plusDisabled","setPlusDisabled","max","maxValue","_jsx","Styled.Root","input","FormInputLabel","_objectSpread","onClick","focus","onFocus","evt","target","currentTarget","onBlur","Styled.Input","onChange","currentValue","minValueReached","maxValueReached","stopPropagation","Boolean","_jsxs","_Fragment","children","Styled.InputControl","Icon","as","Spacer","display","prev","stepDown","event","Event","bubbles","dispatchEvent","err","console","Minus","stepUp","Plus","SIZES","displayName","Phone","InputPhone"],"mappings":"+rDAYMA,IAAAA,EAAiB,QAYvB,IAAMC,EAAoFC,OAAOC,OAC/FC,EACEC,GAAAA,CAAYC,EAAOC,KAAiB,IAAAC,EAAAC,EAAAC,EAAAC,EAClC,IAAMC,EAAQC,IAEd,IAAMC,KACJA,EAAO,IADHC,KAEJA,EAAO,GAFHC,QAGJA,GAAU,EAHNC,MAIJA,EAAQ,YAJJC,iBAKJA,EAAmB,SALfC,MAMJA,EAAQP,EAAMQ,0BANVC,KAOJA,EAAO,OAPHC,cAQJA,EAAgB,UARZC,UASJA,EAAY,GATRC,UAUJA,EAAY,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QzF,MAAMwF,KAxBpBZ,SA4BErB,EAACuB,EAADnB,EAAA,CAAMxD,KAAMqB,MAAAA,GAAAA,GAAQ+B,EAACqC,EAArB,IAA8Bb,GAAG,OAAOjJ,KAAM,GAAIG,MAAM,WAAcmF,mBAAAA,OAUxF,CACEhE,MAAOyI,EACPC,YAxZiB,UA2ZrB,CACEC,MAAOC"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef, useState, useImperativeHandle, useRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { FormInputLabel, SIZES } from 'components/FormInputLabel'\nimport { Icon } from 'components/Icon'\nimport { InputPhone } from 'components/Input.Phone'\nimport { Spacer } from 'components/Spacer'\nimport Minus from './images/minus.module.svg'\nimport Plus from './images/plus.module.svg'\nimport * as Styled from './style'\nimport type { InputProps } from './types'\n\nconst COMPONENT_NAME = 'Input'\n\n/**\n *\n * Component accepts all \\<input\\> attributes and \"react-input-mask\" v2.0.4 props.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to \\<input\\>.\n *\n * See full [InputProps](https://github.com/foxford/ui/blob/master/src/components/Input/types.ts)\n */\nconst Input: React.ForwardRefExoticComponent<InputProps> & { Phone: typeof InputPhone } = Object.assign(\n withMergedProps<InputProps, HTMLInputElement>(\n forwardRef((props, forwardedRef) => {\n const theme = useTheme()\n\n const {\n size = 'm',\n mask = '',\n rounded = true,\n color = 'mineShaft',\n placeholderColor = 'silver',\n width = theme.defaultInputControlsWidth,\n type = 'text',\n labelPosition = 'dynamic',\n textProps = {},\n iconProps = {},\n controls = {},\n preset,\n className,\n style,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n margin,\n marginXXS,\n marginXS,\n marginS,\n marginM,\n marginL,\n marginXL,\n marginTop,\n marginTopXXS,\n marginTopXS,\n marginTopS,\n marginTopM,\n marginTopL,\n marginTopXL,\n marginRight,\n marginRightXXS,\n marginRightXS,\n marginRightS,\n marginRightM,\n marginRightL,\n marginRightXL,\n marginBottom,\n marginBottomXXS,\n marginBottomXS,\n marginBottomS,\n marginBottomM,\n marginBottomL,\n marginBottomXL,\n marginLeft,\n marginLeftXXS,\n marginLeftXS,\n marginLeftS,\n marginLeftM,\n marginLeftL,\n marginLeftXL,\n marginUnits,\n palette,\n widthXXS,\n widthXS,\n widthS,\n widthM,\n widthL,\n widthXL,\n error,\n success,\n label,\n icon,\n text,\n primary,\n secondary,\n onColored,\n fluid,\n disabled,\n inline,\n inputRef,\n ...inputProps\n } = props\n\n const {\n icon: additionalControlIcon,\n iconProps: additionalControlIconProps = {},\n buttonProps: additionalControlButtonProps = {},\n } = controls.additional ?? {}\n\n const {\n icon: numberControlIcon,\n iconProps: numberControlIconProps = {},\n buttonProps: numberControlButtonProps = [],\n } = controls.number ?? {}\n\n const [minus, plus] = Array.isArray(numberControlIcon) ? numberControlIcon : [numberControlIcon]\n\n const minusButtonProps =\n (Array.isArray(numberControlButtonProps) ? numberControlButtonProps[0] : numberControlButtonProps) ?? {}\n\n const plusButtonProps = (Array.isArray(numberControlButtonProps) ? numberControlButtonProps[1] : {}) ?? {}\n\n const ref = useRef<HTMLInputElement | null>(null)\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(forwardedRef, () => ref.current, [])\n\n const hasInitValue =\n typeof inputProps.value === 'string' ||\n typeof inputProps.value === 'number' ||\n typeof inputProps.defaultValue === 'string' ||\n typeof inputProps.defaultValue === 'number'\n\n const [active, setActive] = useState(hasInitValue)\n const [hasValue, setHasValue] = useState(hasInitValue)\n\n const [minusDisabled, setMinusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.min === undefined) return false\n\n const { value = Infinity, defaultValue = Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const minValue = typeof inputProps.min === 'number' ? inputProps.min : parseFloat(inputProps.min)\n\n return Math.min(initValue, initDefaultValue) <= minValue\n })\n\n const [plusDisabled, setPlusDisabled] = useState(() => {\n if (type !== 'number' || inputProps.max === undefined) return false\n\n const { value = -Infinity, defaultValue = -Infinity } = inputProps\n\n const initValue = typeof value === 'number' ? value : parseFloat(value)\n const initDefaultValue = typeof defaultValue === 'number' ? defaultValue : parseFloat(defaultValue)\n const maxValue = typeof inputProps.max === 'number' ? inputProps.max : parseFloat(inputProps.max)\n\n return Math.max(initValue, initDefaultValue) >= maxValue\n })\n\n if (preset !== 'brand') {\n return (\n <Styled.Root\n {...inputProps}\n inputRef={\n inputRef ??\n ((input) => {\n ref.current = input\n })\n }\n className={className}\n style={style}\n size={typeof size === 'number' ? size : undefined}\n mask={mask}\n rounded={rounded}\n color={color}\n placeholderColor={placeholderColor}\n width={width}\n widthXXS={widthXXS}\n widthXS={widthXS}\n widthS={widthS}\n widthM={widthM}\n widthL={widthL}\n widthXL={widthXL}\n error={error}\n type={type}\n fluid={fluid}\n disabled={disabled}\n />\n )\n }\n\n return (\n <FormInputLabel\n className={className}\n style={style}\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizeUnits={sizeUnits}\n sizes={sizes}\n margin={margin}\n marginXXS={marginXXS}\n marginXS={marginXS}\n marginS={marginS}\n marginM={marginM}\n marginL={marginL}\n marginXL={marginXL}\n marginTop={marginTop}\n marginTopXXS={marginTopXXS}\n marginTopXS={marginTopXS}\n marginTopS={marginTopS}\n marginTopM={marginTopM}\n marginTopL={marginTopL}\n marginTopXL={marginTopXL}\n marginRight={marginRight}\n marginRightXXS={marginRightXXS}\n marginRightXS={marginRightXS}\n marginRightS={marginRightS}\n marginRightM={marginRightM}\n marginRightL={marginRightL}\n marginRightXL={marginRightXL}\n marginBottom={marginBottom}\n marginBottomXXS={marginBottomXXS}\n marginBottomXS={marginBottomXS}\n marginBottomS={marginBottomS}\n marginBottomM={marginBottomM}\n marginBottomL={marginBottomL}\n marginBottomXL={marginBottomXL}\n marginLeft={marginLeft}\n marginLeftXXS={marginLeftXXS}\n marginLeftXS={marginLeftXS}\n marginLeftS={marginLeftS}\n marginLeftM={marginLeftM}\n marginLeftL={marginLeftL}\n marginLeftXL={marginLeftXL}\n marginUnits={marginUnits}\n palette={palette}\n error={error}\n success={success}\n label={label}\n labelPosition={labelPosition}\n icon={icon}\n text={text}\n primary={primary}\n secondary={secondary}\n onColored={onColored}\n disabled={disabled}\n inline={inline}\n active={active}\n textProps={textProps}\n iconProps={{\n size: 24,\n color: disabled ? 'content-disabled' : 'content-onmain-tertiary',\n ...iconProps,\n }}\n onClick={() => {\n if (ref.current) {\n ref.current.focus()\n }\n }}\n onFocus={(evt) => {\n if (evt.target !== evt.currentTarget) {\n setActive(true)\n }\n }}\n onBlur={(evt) => {\n if (evt.target !== evt.currentTarget && !hasValue) {\n setActive(false)\n }\n }}\n input={\n <Styled.Input\n {...inputProps}\n inputRef={(input) => {\n ref.current = input\n }}\n mask={mask}\n palette={palette}\n type={type}\n label={label}\n labelPosition={labelPosition}\n disabled={disabled}\n active={active}\n onChange={(evt) => {\n if (inputProps.onChange) {\n inputProps.onChange(evt)\n }\n\n if (type === 'number') {\n const currentValue = parseFloat(evt.currentTarget.value)\n\n const minValueReached = currentValue <= parseFloat(evt.currentTarget.min)\n const maxValueReached = currentValue >= parseFloat(evt.currentTarget.max)\n\n setMinusDisabled(minValueReached)\n setPlusDisabled(maxValueReached)\n\n if (minValueReached || maxValueReached) {\n evt.currentTarget.focus()\n }\n }\n }}\n onBlur={(evt) => {\n evt.stopPropagation()\n if (inputProps.onBlur) {\n inputProps.onBlur(evt)\n }\n\n setHasValue(Boolean(evt.currentTarget.value))\n setActive(Boolean(evt.currentTarget.value))\n }}\n />\n }\n controls={\n additionalControlIcon || type === 'number' ? (\n <>\n {additionalControlIcon && (\n <Styled.InputControl\n {...additionalControlButtonProps}\n type='button'\n palette={palette}\n disabled={disabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (additionalControlButtonProps.onClick) {\n additionalControlButtonProps.onClick(evt)\n }\n }}\n >\n <Icon\n icon={additionalControlIcon}\n as='span'\n size={24}\n color='inherit'\n {...additionalControlIconProps}\n />\n </Styled.InputControl>\n )}\n {type === 'number' && (\n <Spacer display='flex' marginLeft={4}>\n <Styled.InputControl\n {...minusButtonProps}\n type='button'\n palette={palette}\n disabled={disabled || minusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (minusButtonProps.onClick) {\n minusButtonProps.onClick(evt)\n }\n\n try {\n if (ref.current) {\n const prev = ref.current.value\n ref.current.stepDown()\n\n const decremented = ref.current.value\n if (prev !== decremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n >\n <Icon icon={minus ?? <Minus />} as='span' size={24} color='inherit' {...numberControlIconProps} />\n </Styled.InputControl>\n <Styled.InputControl\n {...plusButtonProps}\n type='button'\n palette={palette}\n disabled={disabled || plusDisabled}\n onClick={(evt) => {\n evt.stopPropagation()\n if (plusButtonProps.onClick) {\n plusButtonProps.onClick(evt)\n }\n\n try {\n if (ref.current) {\n const prev = ref.current.value\n ref.current.stepUp()\n\n const incremented = ref.current.value\n if (prev !== incremented) {\n const event = new Event('input', { bubbles: true })\n ref.current.dispatchEvent(event)\n }\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(err)\n }\n }}\n >\n <Icon icon={plus ?? <Plus />} as='span' size={24} color='inherit' {...numberControlIconProps} />\n </Styled.InputControl>\n </Spacer>\n )}\n </>\n ) : undefined\n }\n />\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Phone: InputPhone,\n }\n)\n\nexport { Input, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Input","Object","assign","withMergedProps","forwardRef","props","forwardedRef","_controls$additional","_controls$number","_ref","_ref2","theme","useTheme","size","mask","rounded","color","placeholderColor","width","defaultInputControlsWidth","type","labelPosition","textProps","iconProps","controls","preset","className","style","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","margin","marginXXS","marginXS","marginS","marginM","marginL","marginXL","marginTop","marginTopXXS","marginTopXS","marginTopS","marginTopM","marginTopL","marginTopXL","marginRight","marginRightXXS","marginRightXS","marginRightS","marginRightM","marginRightL","marginRightXL","marginBottom","marginBottomXXS","marginBottomXS","marginBottomS","marginBottomM","marginBottomL","marginBottomXL","marginLeft","marginLeftXXS","marginLeftXS","marginLeftS","marginLeftM","marginLeftL","marginLeftXL","marginUnits","palette","widthXXS","widthXS","widthS","widthM","widthL","widthXL","error","success","label","icon","text","primary","secondary","onColored","fluid","disabled","inline","inputRef","inputProps","_excluded","additionalControlIcon","additionalControlIconProps","buttonProps","additionalControlButtonProps","additional","numberControlIcon","numberControlIconProps","numberControlButtonProps","number","minus","plus","Array","isArray","minusButtonProps","plusButtonProps","ref","useRef","useImperativeHandle","current","hasInitValue","value","defaultValue","active","setActive","useState","hasValue","setHasValue","minusDisabled","setMinusDisabled","undefined","min","Infinity","initValue","parseFloat","initDefaultValue","minValue","Math","plusDisabled","setPlusDisabled","max","maxValue","_jsx","Styled.Root","input","FormInputLabel","_objectSpread","onClick","focus","onFocus","evt","target","currentTarget","onBlur","Styled.Input","onChange","currentValue","minValueReached","maxValueReached","stopPropagation","Boolean","_jsxs","_Fragment","children","Styled.InputControl","Icon","as","Spacer","display","prev","stepDown","event","Event","bubbles","dispatchEvent","err","console","Minus","stepUp","Plus","SIZES","displayName","Phone","InputPhone"],"mappings":"+rDAYMA,IAAAA,EAAiB,QAYvB,IAAMC,EAAoFC,OAAOC,OAC/FC,EACEC,GAAAA,CAAYC,EAAOC,KAAiB,IAAAC,EAAAC,EAAAC,EAAAC,EAClC,IAAMC,EAAQC,IAEd,IAAM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AMkD,EAAOrD,GAAIG,QAAQE,MAIzB,GAHAL,GAAIG,QAAQ2D,SAGRT,IADgBrD,GAAIG,QAAQE,MACN,CACxB,IAAMkD,EAAQ,IAAIC,MAAM,QAAS,CAAEC,SAAAA,IACnCzD,GAAIG,QAAQuD,cAAcH,KAG9B,MAAOI,GAEPC,QAAQzF,MAAMwF,KAxBpBZ,SA4BErB,EAACuB,EAADnB,EAAA,CAAMxD,KAAMqB,MAAAA,GAAAA,GAAQ+B,EAACqC,EAArB,IAA8Bb,GAAG,OAAOjJ,KAAM,GAAIG,MAAM,WAAcmF,mBAAAA,OAUxF,CACEhE,MAAOyI,EACPC,YAxZiB,UA2ZrB,CACEC,MAAOC"}
@@ -0,0 +1,2 @@
1
+ import o from'@babel/runtime/helpers/objectSpread2';import t from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as e}from'react';import{withMergedProps as r}from'../../hocs/withMergedProps.js';import{Tooltip as i}from'../Tooltip/Tooltip.js';import{PopoverComponent as n}from'../PopoverComponent/PopoverComponent.js';import{jsx as s}from'react/jsx-runtime';import{SIZES_LANDSCAPE as p,SIZES as a}from'../PopoverComponent/constants.js';var c=["size","sizes","sizeUnits","palette","orientation","loading","badge","caption","captionProps","titleProps","contentProps","controlsDirection","media","controls"];var l='Popover';var m=Object.assign(r(e(((e,r)=>{var p;var{size:a="s",sizes:l,sizeUnits:m,palette:P,orientation:d,loading:v,badge:b,caption:f,captionProps:g,titleProps:z,contentProps:j,controlsDirection:h,media:C,controls:u}=e,S=t(e,c);return s(i,o(o({},S),{},{preset:"brand",size:a,ref:r,styles:{arrow:{spread:20,length:12}},component:null!==(p=S.component)&&void 0!==p?p:s(n,{sizes:l,sizeUnits:m,palette:P,orientation:d,loading:v,badge:b,caption:f,captionProps:g,title:S.title,titleProps:z,content:S.content,contentProps:j,controlsDirection:h,media:C,controls:u})}))})),{displayName:"Popover",sizes:o=>'landscape'===o.orientation?p:a}),{Component:n});export{l as COMPONENT_NAME,m as Popover};
2
+ //# sourceMappingURL=Popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent, SIZES_LANDSCAPE, SIZES } from 'components/PopoverComponent'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to popover component root.\n *\n * See full [PopoverProps](https://github.com/foxford/ui/blob/master/src/components/Popover/types.ts)\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n sizes,\n sizeUnits,\n palette,\n orientation,\n loading,\n badge,\n caption,\n captionProps,\n titleProps,\n contentProps,\n controlsDirection,\n media,\n controls,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n size={size}\n ref={ref}\n styles={{\n arrow: {\n spread: 20,\n length: 12,\n },\n }}\n component={\n restProps.component ?? (\n <PopoverComponent\n sizes={sizes}\n sizeUnits={sizeUnits}\n palette={palette}\n orientation={orientation}\n loading={loading}\n badge={badge}\n caption={caption}\n captionProps={captionProps}\n title={restProps.title}\n titleProps={titleProps}\n content={restProps.content}\n contentProps={contentProps}\n controlsDirection={controlsDirection}\n media={media}\n controls={controls}\n />\n )\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Popover","Object","assign","withMergedProps","forwardRef","props","ref","_restProps$component","size","sizes","sizeUnits","palette","orientation","loading","badge","caption","captionProps","titleProps","contentProps","controlsDirection","media","controls","restProps","_excluded","_jsx","Tooltip","_objectSpread","preset","styles","arrow","spread","length","component","PopoverComponent","title","content","displayName","SIZES_LANDSCAPE","SIZES","Component"],"mappings":"+mBAMMA,IAAAA,EAAiB,UAYvB,IAAMC,EAAkGC,OAAOC,OAC7GC,EACEC,IAAYC,EAAOC,KAAQ,IAAAC,EACzB,IAAMC,KACJA,EAAO,IADHC,MAEJA,EAFIC,UAGJA,EAHIC,QAIJA,EAJIC,YAKJA,EALIC,QAMJA,EANIC,MAOJA,EAPIC,QAQJA,EARIC,aASJA,EATIC,WAUJA,EAVIC,aAWJA,EAXIC,kBAYJA,EAZIC,MAaJA,EAbIC,SAcJA,GAEEhB,EADCiB,IACDjB,EAhBJkB,GAkBA,OACEC,EAACC,EAADC,EAAAA,EAAA,GACMJ,GADN,GAAA,CAEEK,OAAO,QACPnB,KAAMA,EACNF,IAAKA,EACLsB,OAAQ,CACNC,MAAO,CACLC,OAAQ,GACRC,OAAQ,KAGZC,UAAS,UACPV,EAAUU,iBAAAA,IADHzB,EAAAA,EAELiB,EAACS,EAAD,CACExB,MAAOA,EACPC,UAAWA,EACXC,QAASA,EACTC,YAAaA,EACbC,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,aAAcA,EACdkB,MAAOZ,EAAUY,MACjBjB,WAAYA,EACZkB,QAASb,EAAUa,QACnBjB,aAAcA,EACdC,kBAAmBA,EACnBC,MAAOA,EACPC,SAAUA,UAOtB,CACEe,YAtEiB,UAuEjB3B,MAAQJ,GACuB,cAAtBA,EAAMO,YAA8ByB,EAAkBC,IAInE,CACEC,UAAWN"}
@@ -0,0 +1,2 @@
1
+ import e from'@babel/runtime/helpers/objectSpread2';import t from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as o}from'react';import{withMergedProps as i}from'../../hocs/withMergedProps.js';import{Badge as r}from'../Badge/Badge.js';import{Text as n}from'../Text/Text.js';import{Button as s}from'../Button/Button.js';import{Icon as a}from'../Icon/Icon.js';import'../Icon/icons.js';import{Skeleton as c}from'../Skeleton/Skeleton.js';import l from'./images/close.module.svg.js';import{SIZES_LANDSCAPE as p,SIZES as d}from'./constants.js';export{SIZES,SIZES_LANDSCAPE}from'./constants.js';import{Root as m,CloseButton as h,MediaLandscape as u,Media as g,Video as z,Container as b,Content as P,Header as f,Footer as S}from'./style.js';import{jsxs as v,jsx as j,Fragment as B}from'react/jsx-runtime';var C=["size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","showCloseButton"];var x='PopoverComponent';var y=i(o(((o,i)=>{var p,d;var{size:x="s",orientation:y="portrait",controlsDirection:w="row",badge:R={},captionProps:X={},titleProps:L={},contentProps:M={},closeButtonProps:I={},media:k={},controls:E={},sizeXXS:D,sizeXS:N,sizeS:U,sizeM:A,sizeL:F,sizeXL:T,loading:Z,caption:_,title:O,content:H,closeFn:V,palette:W,showCloseButton:q}=o,G=t(o,C);var J={size:x,sizeXXS:D,sizeXS:N,sizeS:U,sizeM:A,sizeL:F,sizeXL:T};var{badgeProps:K={}}=R;var{imgProps:Q={},videoProps:Y={}}=k;var{text:$,buttonProps:ee={}}=null!==(p=E.secondary)&&void 0!==p?p:{};var{text:te,buttonProps:oe={}}=null!==(d=E.primary)&&void 0!==d?d:{};return v(m,e(e(e({},G),J),{},{palette:W,orientation:y,controlsDirection:w,ref:i,children:[q&&j(h,e(e({},I),{},{onClick:e=>{'function'==typeof V&&V(),'function'==typeof I.onClick&&I.onClick(e)},palette:W,type:"button",children:j(a,{as:"span",icon:j(l,{}),size:24})})),'landscape'===y&&v(B,{children:[Z&&j(u,{children:j(g,{aspectRatio:"1:1",children:j(c,{})})}),!Z&&(Q.src||Y.src)&&j(u,{children:j(g,{aspectRatio:"1:1",children:Q.src?j("img",e({alt:""},Q)):j(z,e({controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0},Y))})})]}),v(b,{children:[v(P,{children:[(R.text||_||Z||q)&&j(f,{children:Z?j(c,{width:"20%",children:j(r,e(e({},J),{},{resetDefaultMargin:!0},K))}):v(B,{children:[R.text&&j(r,e(e(e({},J),{},{borderRadius:8,marginRight:12,resetDefaultMargin:!0},K),{},{children:R.text})),_&&j(n,e(e({as:"span",appearance:"caption",size:.9,sizeUnits:"em",color:"content-onmain-tertiary",weight:700},X),{},{children:_}))]})}),'portrait'===y&&v(B,{children:[Z&&j(g,{aspectRatio:"16:9",children:j(c,{})}),!Z&&(Q.src||Y.src)&&j(g,{aspectRatio:"16:9",children:Q.src?j("img",e({alt:""},Q)):j(z,e({controls:!0,controlsList:"nofullscreen",disablePictureInPicture:!0},Y))})]}),(O||H||Z)&&j("div",{children:v(B,Z?{children:[j(c,{borderRadius:4,marginBottom:.6,marginUnits:"em",children:j(n,e({appearance:"subheading",size:1.4,sizeUnits:"em"},L))}),j(c,{borderRadius:4,width:"70%",marginBottom:.4,marginUnits:"em",children:j(n,e({appearance:"body",size:"inherit"},M))}),j(c,{borderRadius:4,width:"50%",children:j(n,e({appearance:"body",size:"inherit"},M))})]}:{children:[O&&j(n,e(e({as:"h2",appearance:"subheading",size:1.4,color:"inherit",marginBottom:H?.4:void 0,sizeUnits:"em",marginUnits:"em"},L),{},{children:O})),H&&j(n,e(e({as:"p",appearance:"body",size:"inherit",color:"inherit"},M),{},{children:H}))]})})]}),($||te||Z)&&j(S,{children:Z?j(c,{width:"100%",children:j(s,e({preset:"brand"},J))}):v(B,{children:[$&&j(s,e(e(e({preset:"brand",black:!0,outline:!0,type:"button",marginRight:'row'===w?6:void 0,marginBottom:'column'===w?6:void 0},J),ee),{},{children:$})),te&&j(s,e(e(e({preset:"brand",black:!0,type:"button"},J),oe),{},{children:te}))]})})]})]}))})),{displayName:"PopoverComponent",sizes:e=>'landscape'===e.orientation?p:d});export{x as COMPONENT_NAME,y as PopoverComponent};
2
+ //# sourceMappingURL=PopoverComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport Close from './images/close.module.svg'\nimport { SIZES, SIZES_LANDSCAPE } from './constants'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [PopoverComponentProps](https://github.com/foxford/ui/blob/master/src/components/PopoverComponent/types.ts)\n *\n */\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n orientation = 'portrait',\n controlsDirection = 'row',\n badge = {},\n captionProps = {},\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n media = {},\n controls = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n loading,\n caption,\n title,\n content,\n closeFn,\n palette,\n showCloseButton,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const { badgeProps = {} } = badge\n\n const { imgProps = {}, videoProps = {} } = media\n\n const { text: secondaryButtonText, buttonProps: secondaryButtonProps = {} } = controls.secondary ?? {}\n\n const { text: primaryButtonText, buttonProps: primaryButtonProps = {} } = controls.primary ?? {}\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n palette={palette}\n orientation={orientation}\n controlsDirection={controlsDirection}\n ref={ref}\n >\n {showCloseButton && (\n <Styled.CloseButton\n {...closeButtonProps}\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (typeof closeButtonProps.onClick === 'function') closeButtonProps.onClick(evt)\n }}\n palette={palette}\n type='button'\n >\n <Icon as='span' icon={<Close />} size={24} />\n </Styled.CloseButton>\n )}\n {orientation === 'landscape' && (\n <>\n {loading && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n <Skeleton />\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.MediaLandscape>\n <Styled.Media aspectRatio='1:1'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n </Styled.MediaLandscape>\n )}\n </>\n )}\n <Styled.Container>\n <Styled.Content>\n {(badge.text || caption || loading || showCloseButton) && (\n <Styled.Header>\n {loading ? (\n <Skeleton width='20%'>\n <Badge {...sizeProps} resetDefaultMargin {...badgeProps} />\n </Skeleton>\n ) : (\n <>\n {badge.text && (\n <Badge {...sizeProps} borderRadius={8} marginRight={12} resetDefaultMargin {...badgeProps}>\n {badge.text}\n </Badge>\n )}\n {caption && (\n <Text\n as='span'\n appearance='caption'\n size={0.9}\n sizeUnits='em'\n color='content-onmain-tertiary'\n weight={700}\n {...captionProps}\n >\n {caption}\n </Text>\n )}\n </>\n )}\n </Styled.Header>\n )}\n {orientation === 'portrait' && (\n <>\n {loading && (\n <Styled.Media aspectRatio='16:9'>\n <Skeleton />\n </Styled.Media>\n )}\n {!loading && (imgProps.src || videoProps.src) && (\n <Styled.Media aspectRatio='16:9'>\n {imgProps.src ? (\n <img alt='' {...imgProps} />\n ) : (\n <Styled.Video controls controlsList='nofullscreen' disablePictureInPicture {...videoProps} />\n )}\n </Styled.Media>\n )}\n </>\n )}\n {(title || content || loading) && (\n <div>\n {loading ? (\n <>\n <Skeleton borderRadius={4} marginBottom={0.6} marginUnits='em'>\n <Text appearance='subheading' size={1.4} sizeUnits='em' {...titleProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%' marginBottom={0.4} marginUnits='em'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' size='inherit' {...contentProps} />\n </Skeleton>\n </>\n ) : (\n <>\n {title && (\n <Text\n as='h2'\n appearance='subheading'\n size={1.4}\n color='inherit'\n marginBottom={content ? 0.4 : undefined}\n sizeUnits='em'\n marginUnits='em'\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text as='p' appearance='body' size='inherit' color='inherit' {...contentProps}>\n {content}\n </Text>\n )}\n </>\n )}\n </div>\n )}\n </Styled.Content>\n {(secondaryButtonText || primaryButtonText || loading) && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : (\n <>\n {secondaryButtonText && (\n <Button\n preset='brand'\n black\n outline\n type='button'\n marginRight={controlsDirection === 'row' ? 6 : undefined}\n marginBottom={controlsDirection === 'column' ? 6 : undefined}\n {...sizeProps}\n {...secondaryButtonProps}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button preset='brand' black type='button' {...sizeProps} {...primaryButtonProps}>\n {primaryButtonText}\n </Button>\n )}\n </>\n )}\n </Styled.Footer>\n )}\n </Styled.Container>\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n return props.orientation === 'landscape' ? SIZES_LANDSCAPE : SIZES\n },\n }\n)\n\nexport { PopoverComponent }\n\nexport { COMPONENT_NAME, SIZES_LANDSCAPE, SIZES }\n"],"names":["COMPONENT_NAME","PopoverComponent","withMergedProps","forwardRef","props","ref","_controls$secondary","_controls$primary","size","orientation","controlsDirection","badge","captionProps","titleProps","contentProps","closeButtonProps","media","controls","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","loading","caption","title","content","closeFn","palette","showCloseButton","restProps","_excluded","sizeProps","badgeProps","imgProps","videoProps","text","secondaryButtonText","buttonProps","secondaryButtonProps","secondary","primaryButtonText","primaryButtonProps","primary","_jsxs","Styled.Root","children","_jsx","Styled.CloseButton","onClick","evt","type","Icon","as","icon","Close","_Fragment","Styled.MediaLandscape","Styled.Media","aspectRatio","Skeleton","src","_objectSpread","alt","Styled.Video","controlsList","disablePictureInPicture","Styled.Container","Styled.Content","Styled.Header","width","Badge","resetDefaultMargin","borderRadius","marginRight","Text","appearance","sizeUnits","color","weight","marginBottom","marginUnits","Styled.Footer","Button","preset","black","outline","undefined","displayName","sizes","SIZES_LANDSCAPE","SIZES"],"mappings":"2jCAYMA,IAAAA,EAAiB,mBAajBC,IAAAA,EAA2EC,EAI/EC,GAAW,CAACC,EAAOC,KAAQ,IAAAC,EAAAC,EACzB,IAAMC,KACJA,EAAO,IADHC,YAEJA,EAAc,WAFVC,kBAGJA,EAAoB,MAHhBC,MAIJA,EAAQ,GAJJC,aAKJA,EAAe,GALXC,WAMJA,EAAa,GANTC,aAOJA,EAAe,GAPXC,iBAQJA,EAAmB,GARfC,MASJA,EAAQ,GATJC,SAUJA,EAAW,GAVPC,QAWJA,EAXIC,OAYJA,EAZIC,MAaJA,EAbIC,MAcJA,EAdIC,MAeJA,EAfIC,OAgBJA,EAhBIC,QAiBJA,EAjBIC,QAkBJA,EAlBIC,MAmBJA,EAnBIC,QAoBJA,EApBIC,QAqBJA,EArBIC,QAsBJA,EAtBIC,gBAuBJA,GAEE1B,EADC2B,IACD3B,EAzBJ4B,GA2BA,IAAMC,EAAY,CAChBzB,KAAAA,EACAU,QAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,OAAAA,GAGF,IAAMW,WAAEA,EAAa,IAAOvB,EAE5B,IAAMwB,SAAEA,EAAW,GAAbC,WAAiBA,EAAa,IAAOpB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B,EAADb,EAAAA,EAAA,CACET,GAAG,KACHuB,WAAW,aACXrE,KAAM,IACNuE,MAAM,UACNE,aAActD,EAAU,QAAA,EACxBmD,UAAU,KACVI,YAAY,MACRrE,GARN,GAAA,CAAAkC,SAUGrB,KAGJC,GACCqB,EAAC4B,EAADb,EAAAA,EAAA,CAAMT,GAAG,IAAIuB,WAAW,OAAOrE,KAAK,UAAUuE,MAAM,WAAcjE,GAAlE,GAAA,CAAAiC,SACGpB,cAQbW,GAAuBI,IAAqBlB,IAC5CwB,EAACmC,EAAD,CAAApC,SACGvB,EACCwB,EAACa,EAAD,CAAUU,MAAM,OAAhBxB,SACEC,EAACoC,EAADrB,EAAA,CAAQsB,OAAO,SAAYpD,MAG7BY,EAAAY,EAAA,CAAAV,SACGT,CAAAA,GACCU,EAACoC,EAADrB,EAAAA,EAAAA,EAAA,CACEsB,OAAO,QACPC,OAFF,EAGEC,WACAnC,KAAK,SACLuB,YAAmC,QAAtBjE,EAA8B,OAAI8E,EAC/CP,aAAoC,WAAtBvE,EAAiC,OAAI8E,GAC/CvD,GACAO,IARN,GAAA,CAAAO,SAUGT,KAGJI,IACCM,EAACoC,EAADrB,EAAAA,EAAAA,EAAA,CAAQsB,OAAO,QAAQC,OAAAA,EAAMlC,KAAK,UAAanB,GAAeU,IAA9D,GAAA,CAAAI,SACGL,qBAWrB,CACE+C,YAzOmB,mBA0OnBC,MAAQtF,GACuB,cAAtBA,EAAMK,YAA8BkF,EAAkBC"}
@@ -0,0 +1,2 @@
1
+ var d={xxxl:{width:600,padding:'1.6em',borderRadius:16,fontSize:22},xxl:{width:600,padding:'1.6em',borderRadius:16,fontSize:22},xl:{width:600,padding:'1.6em',borderRadius:16,fontSize:22},l:{width:560,padding:'1.6em',borderRadius:16,fontSize:20},m:{width:356,padding:'1.6em',borderRadius:16,fontSize:16},s:{width:280,padding:'1.6em',borderRadius:16,fontSize:14},xs:{width:260,padding:'1.6em',borderRadius:16,fontSize:12},xxs:{width:260,padding:'1.6em',borderRadius:16,fontSize:12},xxxs:{width:260,padding:'1.6em',borderRadius:16,fontSize:12}};var i={xxxl:{width:900,padding:'1.6em',borderRadius:16,fontSize:22},xxl:{width:900,padding:'1.6em',borderRadius:16,fontSize:22},xl:{width:900,padding:'1.6em',borderRadius:16,fontSize:22},l:{width:792,padding:'1.6em',borderRadius:16,fontSize:20},m:{width:600,padding:'1.6em',borderRadius:16,fontSize:16},s:{width:520,padding:'1.6em',borderRadius:16,fontSize:14},xs:{width:375,padding:'1.6em',borderRadius:16,fontSize:12},xxs:{width:375,padding:'1.6em',borderRadius:16,fontSize:12},xxxs:{width:375,padding:'1.6em',borderRadius:16,fontSize:12}};export{d as SIZES,i as SIZES_LANDSCAPE};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/PopoverComponent/constants.ts"],"sourcesContent":["import type { Sizes } from 'shared/types'\n\nexport const SIZES: Sizes = {\n xxxl: {\n width: 600,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n xxl: {\n width: 600,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n xl: {\n width: 600,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n l: {\n width: 560,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 20,\n },\n m: {\n width: 356,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 16,\n },\n s: {\n width: 280,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 14,\n },\n xs: {\n width: 260,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n xxs: {\n width: 260,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n xxxs: {\n width: 260,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n}\n\nexport const SIZES_LANDSCAPE: Sizes = {\n xxxl: {\n width: 900,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n xxl: {\n width: 900,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n xl: {\n width: 900,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 22,\n },\n l: {\n width: 792,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 20,\n },\n m: {\n width: 600,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 16,\n },\n s: {\n width: 520,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 14,\n },\n xs: {\n width: 375,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n xxs: {\n width: 375,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n xxxs: {\n width: 375,\n padding: '1.6em',\n borderRadius: 16,\n fontSize: 12,\n },\n}\n"],"names":["SIZES","xxxl","width","padding","borderRadius","fontSize","xxl","xl","l","m","s","xs","xxs","xxxs","SIZES_LANDSCAPE"],"mappings":"AAEO,IAAMA,EAAe,CAC1BC,KAAM,CACJC,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZC,IAAK,CACHJ,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZE,GAAI,CACFL,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZG,EAAG,CACDN,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZI,EAAG,CACDP,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZK,EAAG,CACDR,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZM,GAAI,CACFT,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZO,IAAK,CACHV,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZQ,KAAM,CACJX,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,KAIP,IAAMS,EAAyB,CACpCb,KAAM,CACJC,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZC,IAAK,CACHJ,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZE,GAAI,CACFL,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZG,EAAG,CACDN,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZI,EAAG,CACDP,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZK,EAAG,CACDR,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZM,GAAI,CACFT,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZO,IAAK,CACHV,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU,IAEZQ,KAAM,CACJX,MAAO,IACPC,QAAS,QACTC,aAAc,GACdC,SAAU"}
@@ -0,0 +1,2 @@
1
+ import*as e from'react';var r;function a(){return a=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},a.apply(this,arguments)}var t=t=>e.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"currentcolor",viewBox:"0 0 24 24"},t),r||(r=e.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06",clipRule:"evenodd"})));export{t as default};
2
+ //# sourceMappingURL=close.module.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close.module.svg.js","sources":["../../../../../src/components/PopoverComponent/images/close.module.svg"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentcolor\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"/></svg>"],"names":["_path","_extends","Object","assign","target","i","arguments","length","source","key","hasOwnProperty","call","apply","this","SvgClosemodule","props","React","createElement","xmlns","fill","viewBox","fillRule","d","clipRule"],"mappings":"wBAAA,IAAIA,EAEJ,SAASC,IAA2Q,OAA9PA,EAAWC,OAAOC,QAAU,SAAUC,GAAU,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAAE,IAAIG,EAASF,UAAUD,GAAI,IAAK,IAAII,KAAOD,GAAcN,IAAiBQ,eAAeC,KAAKH,EAAQC,KAAQL,EAAOK,GAAOD,EAAOC,IAAY,OAAOL,GAAkBH,EAASW,MAAMC,KAAMP,WAI7S,IAACQ,EAAyCC,GACvBC,EAAMC,cAAc,MAAOhB,EAAS,CACtDiB,MAAO,6BACPC,KAAM,eACNC,QAAS,aACRL,GAAQf,IAAUA,EAAqBgB,EAAMC,cAAc,OAAQ,CACpEI,SAAU,UACVC,EAAG,uMACHC,SAAU"}
@@ -0,0 +1,2 @@
1
+ import o from'@babel/runtime/helpers/objectSpread2';import n from'styled-components';import r from'tinycolor2';import{responsiveSize as e}from'../../mixins/responsive-size.js';import{focus as t}from'../../mixins/focus.js';import{createShouldForwardProp as i}from'../../shared/utils/style.js';var c=i((o=>!['orientation','controlsDirection','black','contrast','elevated'].includes(o)));var a=n.div.withConfig({componentId:"fox-ui__sc-hvg57g-0"})(["box-sizing:border-box;flex-shrink:0;width:45%;margin-right:1.6em;"]);var l=n.div.withConfig({shouldForwardProp:o=>'aspectRatio'!==o}).withConfig({componentId:"fox-ui__sc-hvg57g-1"})(["",""],(o=>"\n box-sizing: border-box;\n position: relative;\n height: 0;\n padding-bottom: ".concat('16:9'===o.aspectRatio?'56.25%':'100%',";\n border-radius: 8px;\n\n & > * {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n }\n\n & img,\n & video {\n border-radius: inherit;\n object-fit: contain;\n height: 100%;\n width: 100%;\n } \n ")));var s=n.div.withConfig({componentId:"fox-ui__sc-hvg57g-2"})(["display:flex;flex-wrap:wrap;margin-top:1.6em;"]);var d=n.div.withConfig({shouldForwardProp:c}).attrs((o=>({dynamicSizeDeclaration:(n,r)=>({fontSize:'string'==typeof n?n:"".concat(n).concat(r),width:'portrait'===o.orientation?'28em':'40em',padding:'1.6em',borderRadius:16})}))).withConfig({componentId:"fox-ui__sc-hvg57g-3"})(["box-sizing:border-box;display:inline-flex;isolation:isolate;position:relative;"," "," ",""],(o=>"\n flex-direction: ".concat('landscape'===o.orientation?'row':'column',";\n & ").concat(s," {\n flex-direction: ").concat(o.controlsDirection,";\n }\n ")),(n=>{return r=o({color:n.theme.colors['content-onmain-primary'],backgroundColor:n.theme.colors['bg-onmain-primary'],shadowColor:n.elevated?n.theme.colors['bg-oncolor-hover']:n.theme.colors.transparent,mediaPlaceholderColor:n.theme.colors['bg-oncolor-hover']},n.palette),"\n color: ".concat(r.color,";\n background-color: ").concat(r.backgroundColor,";\n filter: drop-shadow(0 0 3px ").concat(r.shadowColor,");\n\n & ").concat(l," {\n background-color: ").concat(r.mediaPlaceholderColor,";\n }\n");var r}),e);var g=n.div.withConfig({componentId:"fox-ui__sc-hvg57g-4"})(["box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;flex-grow:1;"]);var p=n.div.withConfig({componentId:"fox-ui__sc-hvg57g-5"})(["box-sizing:border-box;display:flex;align-items:center;margin-right:20px;"]);var m=n.div.withConfig({componentId:"fox-ui__sc-hvg57g-6"})(["box-sizing:border-box;word-break:break-word;& > *:not(:last-child){margin-bottom:1.6em;}"]);var h=n.video.withConfig({componentId:"fox-ui__sc-hvg57g-7"})(["",""],t);var b=n.button.withConfig({shouldForwardProp:o=>!['palette'].includes(o)}).withConfig({componentId:"fox-ui__sc-hvg57g-8"})(["box-sizing:border-box;position:absolute;top:10px;right:10px;appearance:none;padding:2px;margin:0;border:none;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:",";"," ",""],(o=>o.disabled?'not-allowed':'pointer'),(n=>{return e=o({closeColor:n.theme.colors['content-onmain-tertiary'],closeBackgroundColor:n.theme.colors.transparent,closeColorHover:n.theme.colors['content-onmain-primary'],closeBackgroundColorHover:r(n.theme.colors['bg-oncolor-hover']).lighten(20).toString(),closeColorActive:n.theme.colors['content-onmain-primary'],closeBackgroundColorActive:n.theme.colors['bg-oncolor-hover'],closeColorDisabled:n.theme.colors['content-disabled'],closeBackgroundColorDisabled:n.theme.colors.transparent},n.palette),"\n color: ".concat(e.closeColor,";\n background-color: ").concat(e.closeBackgroundColor,";\n &:hover {\n color: ").concat(e.closeColorHover,";\n background-color: ").concat(e.closeBackgroundColorHover,";\n }\n &:active {\n color: ").concat(e.closeColorActive,";\n background-color: ").concat(e.closeBackgroundColorActive,";\n }\n &:disabled {\n color: ").concat(e.closeColorDisabled,";\n background-color: ").concat(e.closeBackgroundColorDisabled,";\n }\n");var e}),t);export{b as CloseButton,g as Container,m as Content,s as Footer,p as Header,l as Media,a as MediaLandscape,d as Root,h as Video};
2
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/PopoverComponent/style.ts"],"sourcesContent":["import styled from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { focus } from 'mixins/focus'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport type { CSSColor } from 'shared/types'\nimport type {\n PopoverComponentPalette,\n StyledPopoverComponentProps,\n StyledPopoverComponentCloseProps,\n StyledPopoverComponentMediaProps,\n} from './types'\n\nconst shouldForwardPopoverComponentProp = createShouldForwardProp(\n (propKey) => !['orientation', 'controlsDirection', 'black', 'contrast', 'elevated'].includes(propKey)\n)\n\nexport const MediaLandscape = styled.div`\n box-sizing: border-box;\n flex-shrink: 0;\n width: 45%;\n margin-right: 1.6em;\n`\n\nexport const Media = styled.div.withConfig<StyledPopoverComponentMediaProps>({\n shouldForwardProp: (propKey) => propKey !== 'aspectRatio',\n})`\n ${(props) => `\n box-sizing: border-box;\n position: relative;\n height: 0;\n padding-bottom: ${props.aspectRatio === '16:9' ? '56.25%' : '100%'};\n border-radius: 8px;\n\n & > * {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n }\n\n & img,\n & video {\n border-radius: inherit;\n object-fit: contain;\n height: 100%;\n width: 100%;\n } \n `}\n`\n\nexport const Footer = styled.div`\n display: flex;\n flex-wrap: wrap;\n margin-top: 1.6em;\n`\n\nconst template = (\n palette: Pick<PopoverComponentPalette, 'color' | 'backgroundColor' | 'shadowColor' | 'mediaPlaceholderColor'>\n) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n filter: drop-shadow(0 0 3px ${palette.shadowColor});\n\n & ${Media} {\n background-color: ${palette.mediaPlaceholderColor};\n }\n`\n\nconst closeTemplate = (\n palette: Pick<\n PopoverComponentPalette,\n | 'closeColor'\n | 'closeBackgroundColor'\n | 'closeColorHover'\n | 'closeBackgroundColorHover'\n | 'closeColorActive'\n | 'closeBackgroundColorActive'\n | 'closeColorDisabled'\n | 'closeBackgroundColorDisabled'\n >\n) => `\n color: ${palette.closeColor};\n background-color: ${palette.closeBackgroundColor};\n &:hover {\n color: ${palette.closeColorHover};\n background-color: ${palette.closeBackgroundColorHover};\n }\n &:active {\n color: ${palette.closeColorActive};\n background-color: ${palette.closeBackgroundColorActive};\n }\n &:disabled {\n color: ${palette.closeColorDisabled};\n background-color: ${palette.closeBackgroundColorDisabled};\n }\n`\n\nexport const Root = styled.div\n .withConfig<StyledPopoverComponentProps>({\n shouldForwardProp: shouldForwardPopoverComponentProp,\n })\n .attrs<StyledPopoverComponentProps>(\n (props): Required<Pick<StyledPopoverComponentProps, 'dynamicSizeDeclaration'>> => ({\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n width: props.orientation === 'portrait' ? '28em' : '40em',\n padding: '1.6em',\n borderRadius: 16,\n }),\n })\n )`\n box-sizing: border-box;\n display: inline-flex;\n isolation: isolate;\n position: relative;\n\n ${(props) => `\n flex-direction: ${props.orientation === 'landscape' ? 'row' : 'column'};\n & ${Footer} {\n flex-direction: ${props.controlsDirection};\n }\n `}\n\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n mediaPlaceholderColor: props.theme.colors['bg-oncolor-hover'],\n ...props.palette,\n })}\n\n ${responsiveSize}\n`\n\nexport const Container = styled.div`\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-grow: 1;\n`\n\nexport const Header = styled.div`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n margin-right: 20px;\n`\n\nexport const Content = styled.div`\n box-sizing: border-box;\n word-break: break-word;\n\n & > *:not(:last-child) {\n margin-bottom: 1.6em;\n }\n`\n\nexport const Video = styled.video`\n ${focus}\n`\n\nexport const CloseButton = styled.button.withConfig<StyledPopoverComponentCloseProps>({\n shouldForwardProp: (propKey) => !['palette'].includes(propKey),\n})`\n box-sizing: border-box;\n position: absolute;\n top: 10px;\n right: 10px;\n appearance: none;\n padding: 2px;\n margin: 0;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\n ${(props) =>\n closeTemplate({\n closeColor: props.theme.colors['content-onmain-tertiary'],\n closeBackgroundColor: props.theme.colors.transparent,\n closeColorHover: props.theme.colors['content-onmain-primary'],\n closeBackgroundColorHover: tinycolor(props.theme.colors['bg-oncolor-hover']).lighten(20).toString() as CSSColor,\n closeColorActive: props.theme.colors['content-onmain-primary'],\n closeBackgroundColorActive: props.theme.colors['bg-oncolor-hover'],\n closeColorDisabled: props.theme.colors['content-disabled'],\n closeBackgroundColorDisabled: props.theme.colors.transparent,\n ...props.palette,\n })}\n\n ${focus}\n`\n"],"names":["shouldForwardPopoverComponentProp","createShouldForwardProp","propKey","includes","MediaLandscape","styled","div","withConfig","componentId","Media","shouldForwardProp","props","concat","aspectRatio","Footer","Root","attrs","dynamicSizeDeclaration","size","sizeUnits","fontSize","width","orientation","padding","borderRadius","controlsDirection","template","palette","_objectSpread","color","theme","colors","backgroundColor","shadowColor","elevated","transparent","mediaPlaceholderColor","responsiveSize","Container","Header","Content","Video","video","focus","CloseButton","button","disabled","closeTemplate","closeColor","closeBackgroundColor","closeColorHover","closeBackgroundColorHover","tinycolor","lighten","toString","closeColorActive","closeBackgroundColorActive","closeColorDisabled","closeBackgroundColorDisabled"],"mappings":"oSAaA,IAAMA,EAAoCC,GACvCC,IAAa,CAAC,cAAe,oBAAqB,QAAS,WAAY,YAAYC,SAASD,KAGlFE,IAAAA,EAAiBC,EAAOC,IAAVC,WAAA,CAAAC,YAAA,uBAAGH,CAAvB,CAAA,sEAOA,IAAMI,EAAQJ,EAAOC,IAAIC,WAA6C,CAC3EG,kBAAoBR,GAAwB,gBAAZA,IADhBK,WAAA,CAAAC,YAAA,uBAAGH,CAAH,CAAA,GAAA,KAGbM,GAAD,+FAAAC,OAIwC,SAAtBD,EAAME,YAAyB,SAAW,OAJ5D,sUA0BSC,IAAAA,EAAST,EAAOC,IAAVC,WAAA,CAAAC,YAAA,uBAAGH,CAAf,CAAA,kDA+CA,IAAMU,EAAOV,EAAOC,IACxBC,WAAwC,CACvCG,kBAAmBV,IAEpBgB,OACEL,IAAAA,CACCM,uBAAwB,CAACC,EAAMC,KAAe,CAC5CC,SAA0B,iBAATF,EAAoBA,EAAUA,GAAAA,OAAAA,GAAOC,OAAAA,GACtDE,MAA6B,aAAtBV,EAAMW,YAA6B,OAAS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AMmB,MAAMC,OAAOI,YACzCe,gBAAiBvC,EAAMmB,MAAMC,OAAO,0BACpCoB,0BAA2BC,EAAUzC,EAAMmB,MAAMC,OAAO,qBAAqBsB,QAAQ,IAAIC,WACzFC,iBAAkB5C,EAAMmB,MAAMC,OAAO,0BACrCyB,2BAA4B7C,EAAMmB,MAAMC,OAAO,oBAC/C0B,mBAAoB9C,EAAMmB,MAAMC,OAAO,oBACvC2B,6BAA8B/C,EAAMmB,MAAMC,OAAOI,aAC9CxB,EAAMgB,SA1HO,cAAAf,OAaXe,EAAQqB,WACGrB,2BAAAA,OAAAA,EAAQsB,qBAdR,+BAAArC,OAgBTe,EAAQuB,gBACGvB,6BAAAA,OAAAA,EAAQwB,sEAGnBxB,EAAQ4B,iBApBC,6BAAA3C,OAqBEe,EAAQ6B,2BAGnB7B,uCAAAA,OAAAA,EAAQ8B,mBAxBC,6BAAA7C,OAyBEe,EAAQ+B,6BAzBhC,YACE/B,IAAAA,IA4HEgB"}
@@ -1,2 +1,2 @@
1
- import t from'@babel/runtime/helpers/objectSpread2';import e from'@babel/runtime/helpers/objectWithoutProperties';import o from'react-floater';import{mergeDeepRight as l}from'ramda';import{tooltipStyles as s,tooltipDisplayBlockStyles as i,tooltipStylesRounend as r}from'./tooltip-styles.js';import{jsx as p}from'react/jsx-runtime';var a=["children","styles"];function n(i){var{children:r,styles:n={}}=i,m=e(i,a);var c=l(s||{},n);return p(o,t(t({styles:c},m),{},{children:p("span",{children:r})}))}n.defaultProps={autoOpen:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:'click',eventDelay:.4,offset:15,placement:'bottom',showCloseButton:!1,styles:s,target:null,wrapperOptions:{position:!1},component:null},n.themes={tooltipStyles:s,tooltipDisplayBlockStyles:i,tooltipStylesRounend:r},n.displayName='Tooltip';export{n as Tooltip};
1
+ import o from'@babel/runtime/helpers/objectSpread2';import e from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as t}from'react';import{useTheme as r}from'styled-components';import s from'react-floater';import{mergeDeepLeft as i}from'ramda';import{withMergedProps as n}from'../../hocs/withMergedProps.js';import{TooltipComponent as a}from'../TooltipComponent/TooltipComponent.js';import{TooltipWrapper as l}from'./TooltipWrapper.js';import{TOOLTIP_STYLES_DEFAULT as p}from'./default-constants.js';import{jsx as m}from'react/jsx-runtime';import{SIZES as c}from'../TooltipComponent/constants.js';var z=["preset","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","palette","black","contrast","titleProps","contentProps","closeButtonProps"];var d='Tooltip';var f=Object.assign(n(t(((t,n)=>{var a,c;var{preset:d,size:f="s",sizeXXS:b,sizeXS:u,sizeS:h,sizeM:v,sizeL:T,sizeXL:P,sizeUnits:S,sizes:g,palette:X,black:C,contrast:j,titleProps:L,contentProps:y,closeButtonProps:w}=t,M=e(t,z);var k=r();if('brand'!==d){var B;var E=o(o({},M),{},{styles:i(null!==(B=M.styles)&&void 0!==B?B:{},p)});return m(s,o(o({},E),{},{children:m("span",{children:E.children})}))}var O=k.colors['bg-onmain-primary'];C&&(O=k.colors['bg-onmain-inverse']),j&&(O=k.colors['bg-brand-primary-basic']),null!=X&&X.backgroundColor&&(O=null!==(a=k.colors[X.backgroundColor])&&void 0!==a?a:X.backgroundColor);var x=o(o({},M),{},{styles:i(null!==(c=M.styles)&&void 0!==c?c:{},{arrow:{color:O,spread:16,length:8},floater:{filter:"drop-shadow(0 0 3px ".concat(k.colors['bg-oncolor-hover'],")")}}),component:m(l,{ref:n,size:f,sizeXXS:b,sizeXS:u,sizeS:h,sizeM:v,sizeL:T,sizeXL:P,sizeUnits:S,sizes:g,palette:X,black:C,contrast:j,title:M.title,titleProps:L,content:M.content,contentProps:y,footer:M.footer,showCloseButton:M.showCloseButton,closeButtonProps:w,component:M.component})});return m(s,o(o({},x),{},{modifiers:{flip:{enabled:!x.disableFlip}}}))})),{displayName:"Tooltip",sizes:c}),{Component:a});export{d as COMPONENT_NAME,f as Tooltip};
2
2
  //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import Floater from 'react-floater'\nimport type { Props } from 'react-floater/lib/types'\nimport { mergeDeepRight } from 'ramda'\nimport { tooltipStyles, tooltipStylesRounend, tooltipDisplayBlockStyles } from './tooltip-styles'\nimport type { TooltipDefaultProps, TooltipDefaultStyles } from './types'\n\nTooltip.defaultProps = {\n autoOpen: false,\n disableAnimation: false,\n disableFlip: false,\n disableHoverToClick: false,\n event: 'click',\n eventDelay: 0.4,\n offset: 15,\n placement: 'bottom',\n showCloseButton: false,\n styles: tooltipStyles,\n target: null,\n wrapperOptions: {\n position: false,\n },\n component: null,\n} as TooltipDefaultProps\n\nTooltip.themes = {\n tooltipStyles,\n tooltipDisplayBlockStyles,\n tooltipStylesRounend,\n} as TooltipDefaultStyles\n\nTooltip.displayName = 'Tooltip'\n\nexport type TooltipProps = Props\n\n/**\n * Основан на [react-floater](https://github.com/gilbarbara/react-floater).\n */\nexport function Tooltip({ children, styles = {}, ...props }: TooltipProps) {\n const tooltipStyle = mergeDeepRight(tooltipStyles || {}, styles) as TooltipProps['styles']\n\n return (\n <Floater styles={tooltipStyle} {...props}>\n <span>{children}</span>\n </Floater>\n )\n}\n"],"names":["Tooltip","_ref","children","styles","props","_objectWithoutProperties","_excluded","tooltipStyle","mergeDeepRight","tooltipStyles","_jsx","Floater","_objectSpread","defaultProps","autoOpen","disableAnimation","disableFlip","disableHoverToClick","event","eventDelay","offset","placement","showCloseButton","target","wrapperOptions","position","component","themes","tooltipDisplayBlockStyles","tooltipStylesRounend","displayName"],"mappings":"uWAqCO,SAASA,EAA2DC,GAAA,IAAnDC,SAAEA,EAAFC,OAAYA,EAAS,IAA8BF,EAAvBG,EAAuBC,EAAAJ,EAAAK,GACzE,IAAMC,EAAeC,EAAeC,GAAiB,GAAIN,GAEzD,OACEO,EAACC,EAADC,EAAAA,EAAA,CAAST,OAAQI,GAAkBH,GAAnC,GAAA,CAAAF,SACEQ,EAAA,OAAA,CAAAR,SAAOA,OApCbF,EAAQa,aAAe,CACrBC,UAAU,EACVC,oBACAC,aAAAA,EACAC,qBAAqB,EACrBC,MAAO,QACPC,WAAY,GACZC,OAAQ,GACRC,UAAW,SACXC,iBAAiB,EACjBnB,OAAQM,EACRc,OAAQ,KACRC,eAAgB,CACdC,UAAU,GAEZC,UAAW,MAGb1B,EAAQ2B,OAAS,CACflB,cAAAA,EACAmB,0BAAAA,EACAC,qBAAAA,GAGF7B,EAAQ8B,YAAc"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport Floater from 'react-floater'\nimport { mergeDeepLeft } from 'ramda'\nimport type { Props as FloaterProps } from 'react-floater/lib/types'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { SIZES, TooltipComponent } from 'components/TooltipComponent'\nimport { TooltipWrapper } from './TooltipWrapper'\nimport { TOOLTIP_STYLES_DEFAULT } from './default-constants'\nimport type { TooltipProps } from './types'\n\nconst COMPONENT_NAME = 'Tooltip'\n\n/**\n *\n * Component accepts [\"react-floater\"](https://www.npmjs.com/package/react-floater/v/0.8.2) v0.8.2 props.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to tooltip component root.\n *\n * See full [TooltipProps](https://github.com/foxford/ui/blob/master/src/components/Tooltip/types.ts)\n */\nconst Tooltip: React.ForwardRefExoticComponent<TooltipProps> & { Component: typeof TooltipComponent } = Object.assign(\n withMergedProps<TooltipProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n preset,\n size = 's',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n palette,\n black,\n contrast,\n titleProps,\n contentProps,\n closeButtonProps,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (preset !== 'brand') {\n const tooltipProps = {\n ...restProps,\n styles: mergeDeepLeft(restProps.styles ?? {}, TOOLTIP_STYLES_DEFAULT),\n } as FloaterProps\n\n return (\n <Floater {...tooltipProps}>\n <span>{tooltipProps.children}</span>\n </Floater>\n )\n }\n\n let color = theme.colors['bg-onmain-primary']\n\n if (black) color = theme.colors['bg-onmain-inverse']\n if (contrast) color = theme.colors['bg-brand-primary-basic']\n if (palette?.backgroundColor) color = theme.colors[palette.backgroundColor] ?? palette.backgroundColor\n\n const tooltipProps = {\n ...restProps,\n styles: mergeDeepLeft(restProps.styles ?? {}, {\n arrow: {\n color,\n spread: 16,\n length: 8,\n },\n floater: {\n filter: `drop-shadow(0 0 3px ${theme.colors['bg-oncolor-hover']})`,\n },\n }),\n component: (\n <TooltipWrapper\n ref={ref}\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizeUnits={sizeUnits}\n sizes={sizes}\n palette={palette}\n black={black}\n contrast={contrast}\n title={restProps.title}\n titleProps={titleProps}\n content={restProps.content}\n contentProps={contentProps}\n footer={restProps.footer}\n showCloseButton={restProps.showCloseButton}\n closeButtonProps={closeButtonProps}\n component={restProps.component}\n />\n ),\n } as FloaterProps\n\n return (\n <Floater\n {...tooltipProps}\n modifiers={{\n flip: {\n enabled: !tooltipProps.disableFlip,\n },\n }}\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: TooltipComponent,\n }\n)\n\nexport { Tooltip }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Tooltip","Object","assign","withMergedProps","forwardRef","props","ref","_theme$colors$palette","_restProps$styles2","preset","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","palette","black","contrast","titleProps","contentProps","closeButtonProps","restProps","_excluded","theme","useTheme","_restProps$styles","tooltipProps","styles","mergeDeepLeft","TOOLTIP_STYLES_DEFAULT","_jsx","Floater","_objectSpread","children","color","colors","backgroundColor","arrow","spread","length","floater","filter","component","TooltipWrapper","title","content","footer","showCloseButton","modifiers","flip","enabled","disableFlip","displayName","SIZES","Component","TooltipComponent"],"mappings":"kxBAWMA,IAAAA,EAAiB,UAYvB,IAAMC,EAAkGC,OAAOC,OAC7GC,EACEC,GAAAA,CAAYC,EAAOC,KAAQ,IAAAC,EAAAC,EACzB,IAAMC,OACJA,EADIC,KAEJA,EAAO,IAFHC,QAGJA,EAHIC,OAIJA,EAJIC,MAKJA,EALIC,MAMJA,EANIC,MAOJA,EAPIC,OAQJA,EARIC,UASJA,EATIC,MAUJA,EAVIC,QAWJA,EAXIC,MAYJA,EAZIC,SAaJA,EAbIC,WAcJA,EAdIC,aAeJA,EAfIC,iBAgBJA,GAEEnB,EADCoB,IACDpB,EAlBJqB,GAoBA,IAAMC,EAAQC,IAEd,GAAe,UAAXnB,EAAoB,CAAA,IAAAoB,EACtB,IAAMC,SACDL,GADa,GAAA,CAEhBM,OAAQC,EAAa,QAACP,EAAAA,EAAUM,cAAX,IAAAF,EAAAA,EAAqB,GAAII,KAGhD,OACEC,EAACC,EAADC,EAAAA,EAAA,GAAaN,GAAb,GAAA,CAAAO,SACEH,EAAA,OAAA,CAAAG,SAAOP,EAAaO,cAK1B,IAAIC,EAAQX,EAAMY,OAAO,qBAErBnB,IAAOkB,EAAQX,EAAMY,OAAO,sBAC5BlB,IAAUiB,EAAQX,EAAMY,OAAO,2BAC/BpB,MAAAA,GAAAA,EAASqB,kBAAiBF,EAAK,QAAA/B,EAAGoB,EAAMY,OAAOpB,EAAQqB,wBAAxB,IAAAjC,EAAAA,EAA4CY,EAAQqB,iBAEvF,IAAMV,SACDL,GADa,GAAA,CAEhBM,OAAQC,EAAa,QAACP,EAAAA,EAAUM,cAAAA,IAAXvB,EAAAA,EAAqB,GAAI,CAC5CiC,MAAO,CACLH,MAAAA,EACAI,OAAQ,GACRC,OAAQ,GAEVC,QAAS,CACPC,qCAA+BlB,EAAMY,OAAO,oBAAtC,QAGVO,UACEZ,EAACa,EAAD,CACEzC,IAAKA,EACLI,KAAMA,EACNC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,UAAWA,EACXC,MAAOA,EACPC,QAASA,EACTC,MAAOA,EACPC,SAAUA,EACV2B,MAAOvB,EAAUuB,MACjB1B,WAAYA,EACZ2B,QAASxB,EAAUwB,QACnB1B,aAAcA,EACd2B,OAAQzB,EAAUyB,OAClBC,gBAAiB1B,EAAU0B,gBAC3B3B,iBAAkBA,EAClBsB,UAAWrB,EAAUqB,cAK3B,OACEZ,EAACC,EAADC,EAAAA,EAAA,GACMN,GADN,GAAA,CAEEsB,UAAW,CACTC,KAAM,CACJC,SAAUxB,EAAayB,oBAMjC,CACEC,YA3GiB,UA4GjBtC,MAAOuC,IAGX,CACEC,UAAWC"}
@@ -0,0 +1,2 @@
1
+ import e from'@babel/runtime/helpers/objectSpread2';import o from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as s,isValidElement as r,cloneElement as t}from'react';import{useKeyboardListener as i}from'../../hooks/useKeyboardListener.js';import{TooltipComponent as n}from'../TooltipComponent/TooltipComponent.js';import{jsx as p}from'react/jsx-runtime';var a=["size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","black","contrast","showCloseButton","closeButtonProps","id","role","closeFn","component"];var l=()=>{};var c=['Escape','Esc'];var m=s(((s,m)=>{var{size:z,sizeXXS:u,sizeXS:f,sizeS:b,sizeM:X,sizeL:S,sizeXL:d,black:L,contrast:h,showCloseButton:j,closeButtonProps:v,id:B,role:C,closeFn:k=l,component:y}=s,w=o(s,a);i('keyup',c,k);var E={size:z,sizeXXS:u,sizeXS:f,sizeS:b,sizeM:X,sizeL:S,sizeXL:d,black:L,contrast:h,showCloseButton:j,closeButtonProps:v,id:B,role:C,closeFn:k};if(r(y)){var P='object'==typeof y.props&&null!==y.props?y.props:{};return t(y,e(e({ref:m},E),P))}return'function'==typeof y?y(E):p(n,e(e({ref:m},E),w))}));export{m as TooltipWrapper};
2
+ //# sourceMappingURL=TooltipWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipWrapper.js","sources":["../../../../src/components/Tooltip/TooltipWrapper.tsx"],"sourcesContent":["import { forwardRef, isValidElement, cloneElement } from 'react'\nimport { useKeyboardListener } from 'hooks/useKeyboardListener'\nimport { TooltipComponent } from 'components/TooltipComponent'\nimport type { TooltipWrapperProps } from './types'\n\nconst closeFnNoop = () => undefined\n\nconst ESC_KEYS = ['Escape', 'Esc']\n\nconst TooltipWrapper = forwardRef<HTMLDivElement, TooltipWrapperProps>((props, ref) => {\n const {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n black,\n contrast,\n showCloseButton,\n closeButtonProps,\n id,\n role,\n closeFn = closeFnNoop,\n component,\n ...restProps\n } = props\n\n useKeyboardListener('keyup', ESC_KEYS, closeFn)\n\n const injectionProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n black,\n contrast,\n showCloseButton,\n closeButtonProps,\n id,\n role,\n closeFn,\n }\n\n if (isValidElement(component)) {\n const elementProps = typeof component.props === 'object' && component.props !== null ? component.props : {}\n\n return cloneElement(component, { ref, ...injectionProps, ...elementProps })\n }\n\n if (typeof component === 'function') {\n return component(injectionProps)\n }\n\n return <TooltipComponent ref={ref} {...injectionProps} {...restProps} />\n})\n\nexport { TooltipWrapper }\n"],"names":["closeFnNoop","ESC_KEYS","TooltipWrapper","forwardRef","props","ref","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","black","contrast","showCloseButton","closeButtonProps","id","role","closeFn","component","restProps","_excluded","useKeyboardListener","injectionProps","isValidElement","elementProps","cloneElement","_objectSpread","_jsx","TooltipComponent"],"mappings":"ohBAKA,IAAMA,EAAc,OAEpB,IAAMC,EAAW,CAAC,SAAU,OAEtBC,IAAAA,EAAiBC,GAAAA,CAAiDC,EAAOC,KAC7E,IAAMC,KACJA,EADIC,QAEJA,EAFIC,OAGJA,EAHIC,MAIJA,EAJIC,MAKJA,EALIC,MAMJA,EANIC,OAOJA,EAPIC,MAQJA,EARIC,SASJA,EATIC,gBAUJA,EAVIC,iBAWJA,EAXIC,GAYJA,EAZIC,KAaJA,EAbIC,QAcJA,EAAUnB,EAdNoB,UAeJA,GAEEhB,EADCiB,IACDjB,EAjBJkB,GAmBAC,EAAoB,QAAStB,EAAUkB,GAEvC,IAAMK,EAAiB,CACrBlB,KAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,SAAAA,EACAC,gBAAAA,EACAC,iBAAAA,EACAC,GAAAA,EACAC,KAAAA,EACAC,QAAAA,GAGF,GAAIM,EAAeL,GAAY,CAC7B,IAAMM,EAA0C,iBAApBN,EAAUhB,OAA0C,OAApBgB,EAAUhB,MAAiBgB,EAAUhB,MAAQ,GAEzG,OAAOuB,EAAaP,EAADQ,EAAAA,EAAA,CAAcvB,IAAAA,GAAQmB,GAAmBE,IAG9D,MAAyB,mBAAdN,EACFA,EAAUI,GAGZK,EAACC,EAADF,EAAAA,EAAA,CAAkBvB,IAAKA,GAASmB,GAAoBH"}
@@ -0,0 +1,2 @@
1
+ var i={wrapper:{display:'inline-flex',flexDirection:'column',zIndex:100},wrapperPosition:{left:-1e3,position:'absolute',top:-1e3,visibility:'hidden'},floater:{display:'inline-block',filter:'drop-shadow(0 6px 6px rgba(0, 0, 0, 0.2))',WebkitFilter:'drop-shadow(0 6px 6px rgba(0, 0, 0, 0.2))',maxWidth:300,opacity:0,position:'relative',transition:'opacity 0.2s',visibility:'hidden',zIndex:100},floaterOpening:{opacity:1,visibility:'visible'},floaterWithAnimation:{opacity:1,transition:'opacity 0.2s, transform 0.2s',visibility:'visible'},floaterClosing:{opacity:0,visibility:'visible'},floaterCentered:{left:'50%',position:'fixed',top:'50%',transform:'translate(-50%, -50%)'},container:{boxSizing:'border-box',borderRadius:3,backgroundColor:'#fff',color:'var(--mineShaft)',minHeight:32,minWidth:180,padding:'16px',position:'relative',display:'flex',flexDirection:'column',justifyContent:'center'},title:{borderBottom:'1px solid var(--mineShaft)',color:'var(--mineShaft)',fontWeight:'bold',fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:12,lineHeight:'16px'},close:{backgroundColor:'transparent',border:0,borderRadius:0,color:'var(--mineShaft)',fontSize:14,height:10,lineHeight:'16px',outline:'none',padding:0,position:'absolute',right:'4px',textAlign:'center',top:'4px',WebkitAppearance:'none',width:10},footer:{borderTop:'1px solid var(--mineShaft)',fontSize:13,marginTop:10,paddingTop:5},arrow:{color:'#fff',display:'inline-flex',length:6,position:'absolute',spread:12},options:{zIndex:100}};export{i as TOOLTIP_STYLES_DEFAULT};
2
+ //# sourceMappingURL=default-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-constants.js","sources":["../../../../src/components/Tooltip/default-constants.ts"],"sourcesContent":["import type { Styles } from 'react-floater/lib/types'\n\nexport const TOOLTIP_STYLES_DEFAULT: Partial<Styles> = {\n wrapper: {\n display: 'inline-flex',\n flexDirection: 'column',\n zIndex: 100,\n },\n wrapperPosition: {\n left: -1000,\n position: 'absolute',\n top: -1000,\n visibility: 'hidden',\n },\n floater: {\n display: 'inline-block',\n filter: 'drop-shadow(0 6px 6px rgba(0, 0, 0, 0.2))',\n WebkitFilter: 'drop-shadow(0 6px 6px rgba(0, 0, 0, 0.2))',\n maxWidth: 300,\n opacity: 0,\n position: 'relative',\n transition: 'opacity 0.2s',\n visibility: 'hidden',\n zIndex: 100,\n },\n floaterOpening: {\n opacity: 1,\n visibility: 'visible',\n },\n floaterWithAnimation: {\n opacity: 1,\n transition: 'opacity 0.2s, transform 0.2s',\n visibility: 'visible',\n },\n floaterClosing: {\n opacity: 0,\n visibility: 'visible',\n },\n floaterCentered: {\n left: '50%',\n position: 'fixed',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n },\n container: {\n boxSizing: 'border-box',\n borderRadius: 3,\n backgroundColor: '#fff',\n color: 'var(--mineShaft)',\n minHeight: 32,\n minWidth: 180,\n padding: '16px',\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n },\n title: {\n borderBottom: '1px solid var(--mineShaft)',\n color: 'var(--mineShaft)',\n fontWeight: 'bold',\n fontSize: 18,\n marginBottom: 5,\n paddingBottom: 6,\n paddingRight: 18,\n },\n content: {\n fontSize: 12,\n lineHeight: '16px',\n },\n close: {\n backgroundColor: 'transparent',\n border: 0,\n borderRadius: 0,\n color: 'var(--mineShaft)',\n fontSize: 14,\n height: 10,\n lineHeight: '16px',\n outline: 'none',\n padding: 0,\n position: 'absolute',\n right: '4px',\n textAlign: 'center',\n top: '4px',\n WebkitAppearance: 'none',\n width: 10,\n },\n footer: {\n borderTop: '1px solid var(--mineShaft)',\n fontSize: 13,\n marginTop: 10,\n paddingTop: 5,\n },\n arrow: {\n color: '#fff',\n display: 'inline-flex',\n length: 6,\n position: 'absolute',\n spread: 12,\n },\n options: {\n zIndex: 100,\n },\n}\n"],"names":["TOOLTIP_STYLES_DEFAULT","wrapper","display","flexDirection","zIndex","wrapperPosition","left","position","top","visibility","floater","filter","WebkitFilter","maxWidth","opacity","transition","floaterOpening","floaterWithAnimation","floaterClosing","floaterCentered","transform","container","boxSizing","borderRadius","backgroundColor","color","minHeight","minWidth","padding","justifyContent","title","borderBottom","fontWeight","fontSize","marginBottom","paddingBottom","paddingRight","content","lineHeight","close","border","height","outline","right","textAlign","WebkitAppearance","width","footer","borderTop","marginTop","paddingTop","arrow","length","spread","options"],"mappings":"AAEO,IAAMA,EAA0C,CACrDC,QAAS,CACPC,QAAS,cACTC,cAAe,SACfC,OAAQ,KAEVC,gBAAiB,CACfC,MAAO,IACPC,SAAU,WACVC,KAAM,IACNC,WAAY,UAEdC,QAAS,CACPR,QAAS,eACTS,OAAQ,4CACRC,aAAc,4CACdC,SAAU,IACVC,QAAS,EACTP,SAAU,WACVQ,WAAY,eACZN,WAAY,SACZL,OAAQ,KAEVY,eAAgB,CACdF,QAAS,EACTL,WAAY,WAEdQ,qBAAsB,CACpBH,QAAS,EACTC,WAAY,+BACZN,WAAY,WAEdS,eAAgB,CACdJ,QAAS,EACTL,WAAY,WAEdU,gBAAiB,CACfb,KAAM,MACNC,SAAU,QACVC,IAAK,MACLY,UAAW,yBAEbC,UAAW,CACTC,UAAW,aACXC,aAAc,EACdC,gBAAiB,OACjBC,MAAO,mBACPC,UAAW,GACXC,SAAU,IACVC,QAAS,OACTrB,SAAU,WACVL,QAAS,OACTC,cAAe,SACf0B,eAAgB,UAElBC,MAAO,CACLC,aAAc,6BACdN,MAAO,mBACPO,WAAY,OACZC,SAAU,GACVC,aAAc,EACdC,cAAe,EACfC,aAAc,IAEhBC,QAAS,CACPJ,SAAU,GACVK,WAAY,QAEdC,MAAO,CACLf,gBAAiB,cACjBgB,OAAQ,EACRjB,aAAc,EACdE,MAAO,mBACPQ,SAAU,GACVQ,OAAQ,GACRH,WAAY,OACZI,QAAS,OACTd,QAAS,EACTrB,SAAU,WACVoC,MAAO,MACPC,UAAW,SACXpC,IAAK,MACLqC,iBAAkB,OAClBC,MAAO,IAETC,OAAQ,CACNC,UAAW,6BACXf,SAAU,GACVgB,UAAW,GACXC,WAAY,GAEdC,MAAO,CACL1B,MAAO,OACPvB,QAAS,cACTkD,OAAQ,EACR7C,SAAU,WACV8C,OAAQ,IAEVC,QAAS,CACPlD,OAAQ"}
@@ -0,0 +1,2 @@
1
+ import o from'@babel/runtime/helpers/objectSpread2';import t from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as e}from'react';import{withMergedProps as r}from'../../hocs/withMergedProps.js';import{Text as s}from'../Text/Text.js';import{Icon as i}from'../Icon/Icon.js';import'../Icon/icons.js';import n from'./images/close.module.svg.js';import{SIZES as m}from'./constants.js';export{SIZES}from'./constants.js';import{Root as p,CloseButton as a}from'./style.js';import{jsxs as c,jsx as l}from'react/jsx-runtime';var f=["size","titleProps","contentProps","closeButtonProps","title","content","footer","closeFn","showCloseButton"];var h='TooltipComponent';var d=r(e(((e,r)=>{var{size:m="s",titleProps:h={},contentProps:d={},closeButtonProps:j={},title:u,content:g,footer:v,closeFn:C,showCloseButton:P}=e,b=t(e,f);var x={appearance:'body',size:'inherit',color:'inherit'};return c(p,o(o({},b),{},{size:m,ref:r,children:[P&&l(a,o(o({},j),{},{type:"button",onClick:o=>{'function'==typeof C&&C(),j.onClick&&j.onClick(o)},children:l(i,{as:"span",icon:l(n,{}),size:16})})),u&&l(s,o(o(o({weight:700,marginRight:P?16:void 0,marginBottom:g||v?'0.3em':void 0},x),h),{},{children:u})),g&&l(s,o(o(o({marginRight:!u&&P?16:void 0,marginBottom:v?'0.2em':void 0},x),d),{},{children:g})),v]}))})),{sizes:m,displayName:"TooltipComponent"});export{h as COMPONENT_NAME,d as TooltipComponent};
2
+ //# sourceMappingURL=TooltipComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipComponent.js","sources":["../../../../src/components/TooltipComponent/TooltipComponent.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport Close from './images/close.module.svg'\nimport { SIZES } from './constants'\nimport type { TooltipComponentProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'TooltipComponent'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [TooltipComponentProps](https://github.com/foxford/ui/blob/master/src/components/TooltipComponent/types.ts)\n */\nconst TooltipComponent: React.ForwardRefExoticComponent<TooltipComponentProps> = withMergedProps<\n TooltipComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n titleProps = {},\n contentProps = {},\n closeButtonProps = {},\n title,\n content,\n footer,\n closeFn,\n showCloseButton,\n ...restProps\n } = props\n\n const textProps: TextProps = { appearance: 'body', size: 'inherit', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} ref={ref}>\n {showCloseButton && (\n <Styled.CloseButton\n {...closeButtonProps}\n type='button'\n onClick={(evt) => {\n if (typeof closeFn === 'function') closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n >\n <Icon as='span' icon={<Close />} size={16} />\n </Styled.CloseButton>\n )}\n {title && (\n <Text\n weight={700}\n marginRight={showCloseButton ? 16 : undefined}\n marginBottom={content || footer ? '0.3em' : undefined}\n {...textProps}\n {...titleProps}\n >\n {title}\n </Text>\n )}\n {content && (\n <Text\n marginRight={!title && showCloseButton ? 16 : undefined}\n marginBottom={footer ? '0.2em' : undefined}\n {...textProps}\n {...contentProps}\n >\n {content}\n </Text>\n )}\n {footer}\n </Styled.Root>\n )\n }),\n {\n sizes: SIZES,\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { TooltipComponent }\n\nexport { COMPONENT_NAME, SIZES }\n"],"names":["COMPONENT_NAME","TooltipComponent","withMergedProps","forwardRef","props","ref","size","titleProps","contentProps","closeButtonProps","title","content","footer","closeFn","showCloseButton","restProps","_excluded","textProps","appearance","color","_jsxs","Styled.Root","children","_jsx","Styled.CloseButton","type","onClick","evt","Icon","as","icon","Close","Text","_objectSpread","weight","marginRight","marginBottom","undefined","sizes","SIZES","displayName"],"mappings":"2oBAUMA,IAAAA,EAAiB,mBAYjBC,IAAAA,EAA2EC,EAI/EC,GAAW,CAACC,EAAOC,KACjB,IAAMC,KACJA,EAAO,IADHC,WAEJA,EAAa,GAFTC,aAGJA,EAAe,GAHXC,iBAIJA,EAAmB,GAJfC,MAKJA,EALIC,QAMJA,EANIC,OAOJA,EAPIC,QAQJA,EARIC,gBASJA,GAEEV,EADCW,IACDX,EAXJY,GAaA,IAAMC,EAAuB,CAAEC,WAAY,OAAQZ,KAAM,UAAWa,MAAO,WAE3E,OACEC,EAACC,SAAgBN,GAAjB,GAAA,CAA4BT,KAAMA,EAAMD,IAAKA,EAA7CiB,SAAA,CACGR,GACCS,EAACC,SACKf,GADN,GAAA,CAEEgB,KAAK,SACLC,QAAUC,IACe,mBAAZd,GAAwBA,IAC/BJ,EAAiBiB,SAASjB,EAAiBiB,QAAQC,IAL3DL,SAQEC,EAACK,EAAD,CAAMC,GAAG,OAAOC,KAAMP,EAACQ,EAAvB,IAAiCzB,KAAM,QAG1CI,GACCa,EAACS,EAADC,EAAAA,EAAAA,EAAA,CACEC,OAAQ,IACRC,YAAarB,EAAkB,QAAA,EAC/BsB,aAAczB,GAAWC,EAAS,aAAUyB,GACxCpB,GACAV,GALN,GAAA,CAAAe,SAOGZ,KAGJC,GACCY,EAACS,EAADC,EAAAA,EAAAA,EAAA,CACEE,aAAczB,GAASI,EAAkB,QAAKuB,EAC9CD,aAAcxB,EAAS,aAAA,GACnBK,GACAT,GAJN,GAAA,CAAAc,SAMGX,KAGJC,SAIP,CACE0B,MAAOC,EACPC,YAzEmB"}
@@ -0,0 +1,2 @@
1
+ var d={xxxl:{fontSize:16,minWidth:80,maxWidth:380,paddingTop:14,paddingRight:18,paddingBottom:14,paddingLeft:18,borderRadius:8},xxl:{fontSize:16,minWidth:80,maxWidth:380,paddingTop:14,paddingRight:18,paddingBottom:14,paddingLeft:18,borderRadius:8},xl:{fontSize:16,minWidth:80,maxWidth:380,paddingTop:14,paddingRight:18,paddingBottom:14,paddingLeft:18,borderRadius:8},l:{fontSize:16,minWidth:80,maxWidth:380,paddingTop:14,paddingRight:18,paddingBottom:14,paddingLeft:18,borderRadius:8},m:{fontSize:14,minWidth:64,maxWidth:340,paddingTop:12,paddingRight:16,paddingBottom:12,paddingLeft:16,borderRadius:8},s:{fontSize:14,minWidth:45,maxWidth:200,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,borderRadius:8},xs:{fontSize:14,minWidth:45,maxWidth:200,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,borderRadius:8},xxs:{fontSize:14,minWidth:45,maxWidth:200,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,borderRadius:8},xxxs:{fontSize:14,minWidth:45,maxWidth:200,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,borderRadius:8}};export{d as SIZES};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/TooltipComponent/constants.ts"],"sourcesContent":["import type { Sizes } from 'shared/types'\n\nexport const SIZES: Sizes = {\n xxxl: {\n fontSize: 16,\n minWidth: 80,\n maxWidth: 380,\n paddingTop: 14,\n paddingRight: 18,\n paddingBottom: 14,\n paddingLeft: 18,\n borderRadius: 8,\n },\n xxl: {\n fontSize: 16,\n minWidth: 80,\n maxWidth: 380,\n paddingTop: 14,\n paddingRight: 18,\n paddingBottom: 14,\n paddingLeft: 18,\n borderRadius: 8,\n },\n xl: {\n fontSize: 16,\n minWidth: 80,\n maxWidth: 380,\n paddingTop: 14,\n paddingRight: 18,\n paddingBottom: 14,\n paddingLeft: 18,\n borderRadius: 8,\n },\n l: {\n fontSize: 16,\n minWidth: 80,\n maxWidth: 380,\n paddingTop: 14,\n paddingRight: 18,\n paddingBottom: 14,\n paddingLeft: 18,\n borderRadius: 8,\n },\n m: {\n fontSize: 14,\n minWidth: 64,\n maxWidth: 340,\n paddingTop: 12,\n paddingRight: 16,\n paddingBottom: 12,\n paddingLeft: 16,\n borderRadius: 8,\n },\n s: {\n fontSize: 14,\n minWidth: 45,\n maxWidth: 200,\n paddingTop: 8,\n paddingRight: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n borderRadius: 8,\n },\n xs: {\n fontSize: 14,\n minWidth: 45,\n maxWidth: 200,\n paddingTop: 8,\n paddingRight: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n borderRadius: 8,\n },\n xxs: {\n fontSize: 14,\n minWidth: 45,\n maxWidth: 200,\n paddingTop: 8,\n paddingRight: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n borderRadius: 8,\n },\n xxxs: {\n fontSize: 14,\n minWidth: 45,\n maxWidth: 200,\n paddingTop: 8,\n paddingRight: 8,\n paddingBottom: 8,\n paddingLeft: 8,\n borderRadius: 8,\n },\n}\n"],"names":["SIZES","xxxl","fontSize","minWidth","maxWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","xxl","xl","l","m","s","xs","xxs","xxxs"],"mappings":"AAEO,IAAMA,EAAe,CAC1BC,KAAM,CACJC,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,aAAc,GAEhBC,IAAK,CACHR,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,aAAc,GAEhBE,GAAI,CACFT,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,aAAc,GAEhBG,EAAG,CACDV,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,aAAc,GAEhBI,EAAG,CACDX,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,GACZC,aAAc,GACdC,cAAe,GACfC,YAAa,GACbC,aAAc,GAEhBK,EAAG,CACDZ,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,EACbC,aAAc,GAEhBM,GAAI,CACFb,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,EACbC,aAAc,GAEhBO,IAAK,CACHd,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,EACbC,aAAc,GAEhBQ,KAAM,CACJf,SAAU,GACVC,SAAU,GACVC,SAAU,IACVC,WAAY,EACZC,aAAc,EACdC,cAAe,EACfC,YAAa,EACbC,aAAc"}
@@ -0,0 +1,2 @@
1
+ import*as e from'react';var r;function a(){return a=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},a.apply(this,arguments)}var t=t=>e.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"currentcolor",viewBox:"0 0 16 16"},t),r||(r=e.createElement("path",{fillRule:"evenodd",d:"M3.646 3.646a.5.5 0 0 1 .708 0L8 7.293l3.646-3.647a.5.5 0 0 1 .708.708L8.707 8l3.647 3.646a.5.5 0 0 1-.708.708L8 8.707l-3.646 3.647a.5.5 0 0 1-.708-.708L7.293 8 3.646 4.354a.5.5 0 0 1 0-.708",clipRule:"evenodd"})));export{t as default};
2
+ //# sourceMappingURL=close.module.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close.module.svg.js","sources":["../../../../../src/components/TooltipComponent/images/close.module.svg"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentcolor\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M3.646 3.646a.5.5 0 0 1 .708 0L8 7.293l3.646-3.647a.5.5 0 0 1 .708.708L8.707 8l3.647 3.646a.5.5 0 0 1-.708.708L8 8.707l-3.646 3.647a.5.5 0 0 1-.708-.708L7.293 8 3.646 4.354a.5.5 0 0 1 0-.708\" clip-rule=\"evenodd\"/></svg>"],"names":["_path","_extends","Object","assign","target","i","arguments","length","source","key","hasOwnProperty","call","apply","this","SvgClosemodule","props","React","createElement","xmlns","fill","viewBox","fillRule","d","clipRule"],"mappings":"wBAAA,IAAIA,EAEJ,SAASC,IAA2Q,OAA9PA,EAAWC,OAAOC,QAAU,SAAUC,GAAU,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAAE,IAAIG,EAASF,UAAUD,GAAI,IAAK,IAAII,KAAOD,GAAcN,IAAiBQ,eAAeC,KAAKH,EAAQC,KAAQL,EAAOK,GAAOD,EAAOC,IAAY,OAAOL,GAAkBH,EAASW,MAAMC,KAAMP,WAI7S,IAACQ,EAAyCC,GACvBC,EAAMC,cAAc,MAAOhB,EAAS,CACtDiB,MAAO,6BACPC,KAAM,eACNC,QAAS,aACRL,GAAQf,IAAUA,EAAqBgB,EAAMC,cAAc,OAAQ,CACpEI,SAAU,UACVC,EAAG,iMACHC,SAAU"}
@@ -0,0 +1,2 @@
1
+ import o from'@babel/runtime/helpers/objectSpread2';import e,{css as r}from'styled-components';import n from'tinycolor2';import{createShouldForwardProp as t}from'../../shared/utils/style.js';import{focus as c}from'../../mixins/focus.js';import{responsiveSize as l}from'../../mixins/responsive-size.js';var a=t((o=>!['black','contrast','elevated'].includes(o)));var s=e.button.withConfig({componentId:"fox-ui__sc-1fjl2iv-0"})(["box-sizing:border-box;appearance:none;position:absolute;top:0;right:0;padding:4px;margin:0;border:none;display:flex;align-items:center;justify-content:center;border-radius:50%;background-color:transparent;cursor:pointer;&:disabled{cursor:not-allowed;}",""],c);var i=o=>"\n color: ".concat(o.color,";\n background-color: ").concat(o.backgroundColor,";\n filter: drop-shadow(0 0 3px ").concat(o.shadowColor,");\n\n & > ").concat(s," {\n color: ").concat(o.closeColor,";\n }\n & > ").concat(s,":hover {\n color: ").concat(o.closeColorHover,";\n }\n & > ").concat(s,":active {\n color: ").concat(o.closeColorActive,";\n }\n & > ").concat(s,":disabled {\n color: ").concat(o.closeColorDisabled,";\n }\n\n");var m={contrast:r(["",""],(e=>i(o({color:e.theme.colors['content-oncolor-primary'],backgroundColor:e.theme.colors['bg-brand-primary-basic'],shadowColor:e.elevated?e.theme.colors['bg-oncolor-hover']:e.theme.colors.transparent,closeColor:e.theme.colors['content-oncolor-tertiary'],closeColorHover:e.theme.colors['content-oncolor-primary'],closeColorActive:e.theme.colors['content-oncolor-primary'],closeColorDisabled:e.theme.colors['content-oncolor-disabled']},e.palette)))),black:r(["",""],(e=>i(o({color:e.theme.colors['content-onmain-inverse'],backgroundColor:e.theme.colors['bg-onmain-inverse'],shadowColor:e.elevated?e.theme.colors['bg-oncolor-hover']:e.theme.colors.transparent,closeColor:e.theme.colors['content-onmain-inverse'],closeColorHover:n(e.theme.colors['content-onmain-inverse']).darken(20).toString(),closeColorActive:n(e.theme.colors['content-onmain-inverse']).darken(20).toString(),closeColorDisabled:e.theme.colors['content-disabled']},e.palette)))),primary:r(["",""],(e=>i(o({color:e.theme.colors['content-onmain-primary'],backgroundColor:e.theme.colors['bg-onmain-primary'],shadowColor:e.elevated?e.theme.colors['bg-oncolor-hover']:e.theme.colors.transparent,closeColor:e.theme.colors['content-onmain-tertiary'],closeColorHover:e.theme.colors['content-onmain-primary'],closeColorActive:e.theme.colors['content-onmain-primary'],closeColorDisabled:e.theme.colors['content-disabled']},e.palette))))};var d=e.div.withConfig({shouldForwardProp:a}).attrs({dynamicSizeDeclaration:(o,e)=>({fontSize:'string'==typeof o?o:"".concat(o).concat(e),minWidth:'4.6em',maxWidth:'24em',padding:'0.8em',borderRadius:8})}).withConfig({componentId:"fox-ui__sc-1fjl2iv-1"})(["box-sizing:border-box;display:inline-block;isolation:isolate;position:relative;cursor:default;word-break:break-word;"," ",""],(o=>{var e=m.primary;return o.black&&(e=m.black),o.contrast&&(e=m.contrast),e}),l);export{s as CloseButton,d as Root};
2
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/TooltipComponent/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { focus } from 'mixins/focus'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport type { CSSColor } from 'shared/types'\nimport type { StyledTooltipComponentProps, TooltipComponentPalette } from './types'\n\nconst shouldForwardTooltipComponentProp = createShouldForwardProp(\n (propKey) => !['black', 'contrast', 'elevated'].includes(propKey)\n)\n\nexport const CloseButton = styled.button`\n box-sizing: border-box;\n appearance: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 4px;\n margin: 0;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: transparent;\n cursor: pointer;\n &:disabled {\n cursor: not-allowed;\n }\n\n ${focus}\n`\n\nconst template = (palette: TooltipComponentPalette) => `\n color: ${palette.color};\n background-color: ${palette.backgroundColor};\n filter: drop-shadow(0 0 3px ${palette.shadowColor});\n\n & > ${CloseButton} {\n color: ${palette.closeColor};\n }\n & > ${CloseButton}:hover {\n color: ${palette.closeColorHover};\n }\n & > ${CloseButton}:active {\n color: ${palette.closeColorActive};\n }\n & > ${CloseButton}:disabled {\n color: ${palette.closeColorDisabled};\n }\n\n`\n\nconst COLOR_SCHEMA = {\n contrast: css<StyledTooltipComponentProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n backgroundColor: props.theme.colors['bg-brand-primary-basic'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n closeColor: props.theme.colors['content-oncolor-tertiary'],\n closeColorHover: props.theme.colors['content-oncolor-primary'],\n closeColorActive: props.theme.colors['content-oncolor-primary'],\n closeColorDisabled: props.theme.colors['content-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n black: css<StyledTooltipComponentProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-inverse'],\n backgroundColor: props.theme.colors['bg-onmain-inverse'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n closeColor: props.theme.colors['content-onmain-inverse'],\n closeColorHover: tinycolor(props.theme.colors['content-onmain-inverse']).darken(20).toString() as CSSColor,\n closeColorActive: tinycolor(props.theme.colors['content-onmain-inverse']).darken(20).toString() as CSSColor,\n closeColorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n primary: css<StyledTooltipComponentProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-onmain-primary'],\n backgroundColor: props.theme.colors['bg-onmain-primary'],\n shadowColor: props.elevated ? props.theme.colors['bg-oncolor-hover'] : props.theme.colors.transparent,\n closeColor: props.theme.colors['content-onmain-tertiary'],\n closeColorHover: props.theme.colors['content-onmain-primary'],\n closeColorActive: props.theme.colors['content-onmain-primary'],\n closeColorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n}\n\nexport const Root = styled.div\n .withConfig<StyledTooltipComponentProps>({\n shouldForwardProp: shouldForwardTooltipComponentProp,\n })\n .attrs<StyledTooltipComponentProps>(<Required<Pick<StyledTooltipComponentProps, 'dynamicSizeDeclaration'>>>{\n dynamicSizeDeclaration: (size, sizeUnits) => ({\n fontSize: typeof size === 'string' ? size : `${size}${sizeUnits}`,\n minWidth: '4.6em',\n maxWidth: '24em',\n padding: '0.8em',\n borderRadius: 8,\n }),\n })`\n box-sizing: border-box;\n display: inline-block;\n isolation: isolate;\n position: relative;\n cursor: default;\n word-break: break-word;\n\n ${(props) => {\n let schema = COLOR_SCHEMA.primary\n\n if (props.black) schema = COLOR_SCHEMA.black\n if (props.contrast) schema = COLOR_SCHEMA.contrast\n\n return schema\n }}\n\n ${responsiveSize}\n`\n"],"names":["shouldForwardTooltipComponentProp","createShouldForwardProp","propKey","includes","CloseButton","styled","button","withConfig","componentId","focus","template","palette","color","concat","backgroundColor","shadowColor","closeColor","closeColorHover","closeColorActive","closeColorDisabled","COLOR_SCHEMA","contrast","css","props","_objectSpread","theme","colors","elevated","transparent","black","tinycolor","darken","toString","primary","Root","div","shouldForwardProp","attrs","dynamicSizeDeclaration","size","sizeUnits","fontSize","minWidth","maxWidth","padding","borderRadius","schema","responsiveSize"],"mappings":"8SAQA,IAAMA,EAAoCC,GACvCC,IAAa,CAAC,QAAS,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