@foxford/ui 2.77.0-beta-ee6908c-20250807 → 2.77.1-beta-0c09a09-20250813
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ActionBtn/ActionBtn.js.map +1 -1
- package/components/ActionBtn/ActionBtn.mjs.map +1 -1
- package/components/Amount/Amount.js.map +1 -1
- package/components/Amount/Amount.mjs.map +1 -1
- package/components/Anchor/Anchor.js.map +1 -1
- package/components/Anchor/Anchor.mjs.map +1 -1
- package/components/Arrow/Arrow.js.map +1 -1
- package/components/Arrow/Arrow.mjs.map +1 -1
- package/components/ArrowBadge/ArrowBadge.js.map +1 -1
- package/components/ArrowBadge/ArrowBadge.mjs.map +1 -1
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/Avatar.mjs.map +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/Badge.mjs.map +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Button/Button.mjs.map +1 -1
- package/components/Chip/Chip.js.map +1 -1
- package/components/Chip/Chip.mjs.map +1 -1
- package/components/Container/Container.js.map +1 -1
- package/components/Container/Container.mjs.map +1 -1
- package/components/ContextMenu/ContextMenu.js.map +1 -1
- package/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/components/ContextMenu/Item.js.map +1 -1
- package/components/ContextMenu/Item.mjs.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs.map +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.mjs.map +1 -1
- package/components/FormLabel/FormLabel.js.map +1 -1
- package/components/FormLabel/FormLabel.mjs.map +1 -1
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/Icon.mjs.map +1 -1
- package/components/IconButton/IconButton.js.map +1 -1
- package/components/IconButton/IconButton.mjs.map +1 -1
- package/components/Indicator/Indicator.js.map +1 -1
- package/components/Indicator/Indicator.mjs.map +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.mjs.map +1 -1
- package/components/Input.Phone/Input.Phone.js.map +1 -1
- package/components/Input.Phone/Input.Phone.mjs.map +1 -1
- package/components/InputCheckbox/InputCheckbox.js.map +1 -1
- package/components/InputCheckbox/InputCheckbox.mjs.map +1 -1
- package/components/InputRadio/InputRadio.js.map +1 -1
- package/components/InputRadio/InputRadio.mjs.map +1 -1
- package/components/ListItem/ListItem.js.map +1 -1
- package/components/ListItem/ListItem.mjs.map +1 -1
- package/components/Menu/Menu.js.map +1 -1
- package/components/Menu/Menu.mjs.map +1 -1
- package/components/MenuComponent/MenuComponent.js.map +1 -1
- package/components/MenuComponent/MenuComponent.mjs.map +1 -1
- package/components/MenuContainer/MenuContainer.js.map +1 -1
- package/components/MenuContainer/MenuContainer.mjs.map +1 -1
- package/components/MenuDivider/MenuDivider.js.map +1 -1
- package/components/MenuDivider/MenuDivider.mjs.map +1 -1
- package/components/MenuList/MenuList.js.map +1 -1
- package/components/MenuList/MenuList.mjs.map +1 -1
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/Modal.mjs.map +1 -1
- package/components/Notification/Notification.js.map +1 -1
- package/components/Notification/Notification.mjs.map +1 -1
- package/components/Paper/Paper.js.map +1 -1
- package/components/Paper/Paper.mjs.map +1 -1
- package/components/Progress/Progress.js.map +1 -1
- package/components/Progress/Progress.mjs.map +1 -1
- package/components/Progress.Circle/Progress.Circle.js.map +1 -1
- package/components/Progress.Circle/Progress.Circle.mjs.map +1 -1
- package/components/Progress.Segmented/Progress.Segmented.js.map +1 -1
- package/components/Progress.Segmented/Progress.Segmented.mjs.map +1 -1
- package/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
- package/components/ProgressLine/ProgressLine.js.map +1 -1
- package/components/ProgressLine/ProgressLine.mjs.map +1 -1
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/Radio.mjs.map +1 -1
- package/components/Section/Section.js.map +1 -1
- package/components/Section/Section.mjs.map +1 -1
- package/components/Separator/Separator.js.map +1 -1
- package/components/Separator/Separator.mjs.map +1 -1
- package/components/Skeleton/Skeleton.js.map +1 -1
- package/components/Skeleton/Skeleton.mjs.map +1 -1
- package/components/Spacer/Spacer.js.map +1 -1
- package/components/Spacer/Spacer.mjs.map +1 -1
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/Spinner/Spinner.mjs.map +1 -1
- package/components/Switch/Switch.js.map +1 -1
- package/components/Switch/Switch.mjs.map +1 -1
- package/components/Tab/Tab.js.map +1 -1
- package/components/Tab/Tab.mjs.map +1 -1
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/Tabs.mjs.map +1 -1
- package/components/Tag/Tag.js.map +1 -1
- package/components/Tag/Tag.mjs.map +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/Text.mjs.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.mjs.map +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.mjs.map +1 -1
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/Tooltip.mjs.map +1 -1
- package/components/TooltipComponent/TooltipComponent.js.map +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
- package/dts/index.d.ts +29 -165
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, useLayoutEffect } from 'react'\nimport type { Styles } from 'react-floater'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { deepmerge } from 'shared/utils/misc'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<MenuProps>>((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n portalElement,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const [portal, setPortal] = useState<HTMLElement | null>(null)\n\n const trigger = useRef<HTMLElement | null>(null)\n\n useLayoutEffect(() => {\n let menuPortal: HTMLElement | null = null\n\n if (portalElement) {\n setPortal(null)\n } else if (document.body) {\n menuPortal = document.createElement('div')\n\n menuPortal.dataset.menuPortal = 'true'\n menuPortal.style.position = 'relative'\n\n document.body.appendChild(menuPortal)\n\n setPortal(menuPortal)\n }\n\n return () => {\n if (menuPortal && menuPortal.isConnected) {\n menuPortal.remove()\n }\n }\n }, [portalElement])\n\n if (!portalElement && !portal) {\n return null\n }\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n portalElement={portalElement ?? portal}\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={deepmerge(\n (secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }) as Partial<Styles>,\n styles\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","portalElement","restProps","sizeProps","portal","setPortal","useState","trigger","useRef","useLayoutEffect","menuPortal","document","body","createElement","dataset","style","position","appendChild","isConnected","remove","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","deepmerge","floater","filter","wrapper","cursor","component","jsx","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"wjBAyBA,MAAMA,KAKFC,OAAOC,OACTC,gBAAAA,gBACEC,MAAAA,YAAmD,CAACC,EAAOC,KACzD,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,EAAgBC,cAChBA,KACGC,GACDtB,EAEJ,MAAMuB,EAAY,CAChBrB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAOU,EAAQC,GAAaC,MAAQA,SAAqB,MAEzD,MAAMC,EAAUC,aAA2B,MAyB3C,OAvBAC,MAAAA,iBAAgB,KACd,IAAIC,EAAiC,KAerC,OAbIT,EACFI,EAAU,MACDM,SAASC,OAClBF,EAAaC,SAASE,cAAc,OAEpCH,EAAWI,QAAQJ,WAAa,OAChCA,EAAWK,MAAMC,SAAW,WAE5BL,SAASC,KAAKK,YAAYP,GAE1BL,EAAUK,IAGL,KACDA,GAAcA,EAAWQ,aAC3BR,EAAWS,QACb,CACD,GACA,CAAClB,IAECA,GAAkBG,EAKrBgB,WAAAA,IAACC,QAAAA,QAAO,IACFnB,EACJrB,IAAKA,EACLyC,OAAO,QACPC,WAAS,EACTtB,cAAeA,GAAiBG,EAChCoB,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CvB,EAAQwB,QAAUN,EAAOE,MAAMC,SAASC,WAGtC3B,EAAUsB,WACZtB,EAAUsB,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAW1B,EAAQwB,mBAAmBD,aACnDK,wBAAoB5B,EAAQwB,SAG1B7B,EAAU8B,UACZ9B,EAAU8B,SAASC,EAAQC,EAC7B,EAEFnD,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQkD,KAASA,UACdvC,EACG,CAAEwC,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,YACzBtD,GAEFuD,UACErB,WAAAsB,IAACC,4BAAa,IACRxC,EACJJ,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ8C,SAEhBjD,MA9CA,IAiDL,IAGN,CACEkD,YAzIiB,OA0IjBpD,MAAOqD,UAAAA,QAGX,CACEC,UAAWJ,cAAaA,cACxBK,KAAMC,SAAQA,SACdC,UAAWC,cAAaA,cACxBC,QAASC,YAAAA"}
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, useLayoutEffect } from 'react'\nimport type { Styles } from 'react-floater'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { deepmerge } from 'shared/utils/misc'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<MenuProps>>((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n portalElement,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const [portal, setPortal] = useState<HTMLElement | null>(null)\n\n const trigger = useRef<HTMLElement | null>(null)\n\n useLayoutEffect(() => {\n let menuPortal: HTMLElement | null = null\n\n if (portalElement) {\n setPortal(null)\n } else if (document.body) {\n menuPortal = document.createElement('div')\n\n menuPortal.dataset.menuPortal = 'true'\n menuPortal.style.position = 'relative'\n\n document.body.appendChild(menuPortal)\n\n setPortal(menuPortal)\n }\n\n return () => {\n if (menuPortal && menuPortal.isConnected) {\n menuPortal.remove()\n }\n }\n }, [portalElement])\n\n if (!portalElement && !portal) {\n return null\n }\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n portalElement={portalElement ?? portal}\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={deepmerge(\n (secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }) as Partial<Styles>,\n styles\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","portalElement","restProps","sizeProps","portal","setPortal","useState","trigger","useRef","useLayoutEffect","menuPortal","document","body","createElement","dataset","style","position","appendChild","isConnected","remove","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","deepmerge","floater","filter","wrapper","cursor","component","jsx","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"wjBAyBA,MAAMA,KAKFC,OAAOC,OACTC,gBAAAA,gBACEC,MAAAA,YAAmD,CAACC,EAAOC,KACzD,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,EAAgBC,cAChBA,KACGC,GACDtB,EAEJ,MAAMuB,EAAY,CAChBrB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAOU,EAAQC,GAAaC,MAAQA,SAAqB,MAEzD,MAAMC,EAAUC,aAA2B,MAyB3C,OAvBAC,MAAAA,iBAAgB,KACd,IAAIC,EAAiC,KAerC,OAbIT,EACFI,EAAU,MACDM,SAASC,OAClBF,EAAaC,SAASE,cAAc,OAEpCH,EAAWI,QAAQJ,WAAa,OAChCA,EAAWK,MAAMC,SAAW,WAE5BL,SAASC,KAAKK,YAAYP,GAE1BL,EAAUK,IAGL,KACDA,GAAcA,EAAWQ,aAC3BR,EAAWS,QACb,CACD,GACA,CAAClB,IAECA,GAAkBG,EAKrBgB,WAAAA,IAACC,QAAAA,QAAO,IACFnB,EACJrB,IAAKA,EACLyC,OAAO,QACPC,WAAS,EACTtB,cAAeA,GAAiBG,EAChCoB,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CvB,EAAQwB,QAAUN,EAAOE,MAAMC,SAASC,WAGtC3B,EAAUsB,WACZtB,EAAUsB,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAW1B,EAAQwB,mBAAmBD,aACnDK,wBAAoB5B,EAAQwB,SAG1B7B,EAAU8B,UACZ9B,EAAU8B,SAASC,EAAQC,EAC7B,EAEFnD,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQkD,KAASA,UACdvC,EACG,CAAEwC,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,YACzBtD,GAEFuD,UACErB,WAAAsB,IAACC,4BAAa,IACRxC,EACJJ,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ8C,SAEhBjD,MA9CA,IAiDL,IAGN,CACEkD,YAzIiB,OA0IjBpD,MAAOqD,UAAAA,QAGX,CACEC,UAAWJ,cAAaA,cACxBK,KAAMC,SAAQA,SACdC,UAAWC,cAAaA,cACxBC,QAASC,YAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, useLayoutEffect } from 'react'\nimport type { Styles } from 'react-floater'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { deepmerge } from 'shared/utils/misc'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<MenuProps>>((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n portalElement,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const [portal, setPortal] = useState<HTMLElement | null>(null)\n\n const trigger = useRef<HTMLElement | null>(null)\n\n useLayoutEffect(() => {\n let menuPortal: HTMLElement | null = null\n\n if (portalElement) {\n setPortal(null)\n } else if (document.body) {\n menuPortal = document.createElement('div')\n\n menuPortal.dataset.menuPortal = 'true'\n menuPortal.style.position = 'relative'\n\n document.body.appendChild(menuPortal)\n\n setPortal(menuPortal)\n }\n\n return () => {\n if (menuPortal && menuPortal.isConnected) {\n menuPortal.remove()\n }\n }\n }, [portalElement])\n\n if (!portalElement && !portal) {\n return null\n }\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n portalElement={portalElement ?? portal}\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={deepmerge(\n (secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }) as Partial<Styles>,\n styles\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","portalElement","restProps","sizeProps","portal","setPortal","useState","trigger","useRef","useLayoutEffect","menuPortal","document","body","createElement","dataset","style","position","appendChild","isConnected","remove","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","deepmerge","floater","filter","wrapper","cursor","component","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"6kBAyBA,MAAMA,KAKFC,OAAOC,OACTC,gBACEC,YAAmD,CAACC,EAAOC,KACzD,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,EAAgBC,cAChBA,KACGC,GACDtB,EAEJ,MAAMuB,EAAY,CAChBrB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAOU,EAAQC,GAAaC,SAA6B,MAEzD,MAAMC,EAAUC,OAA2B,MAyB3C,OAvBAC,iBAAgB,KACd,IAAIC,EAAiC,KAerC,OAbIT,EACFI,EAAU,MACDM,SAASC,OAClBF,EAAaC,SAASE,cAAc,OAEpCH,EAAWI,QAAQJ,WAAa,OAChCA,EAAWK,MAAMC,SAAW,WAE5BL,SAASC,KAAKK,YAAYP,GAE1BL,EAAUK,IAGL,KACDA,GAAcA,EAAWQ,aAC3BR,EAAWS,QACb,CACD,GACA,CAAClB,IAECA,GAAkBG,EAKrBgB,IAACC,QAAO,IACFnB,EACJrB,IAAKA,EACLyC,OAAO,QACPC,WAAS,EACTtB,cAAeA,GAAiBG,EAChCoB,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CvB,EAAQwB,QAAUN,EAAOE,MAAMC,SAASC,WAGtC3B,EAAUsB,WACZtB,EAAUsB,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAW1B,EAAQwB,mBAAmBD,aACnDK,oBAAoB5B,EAAQwB,SAG1B7B,EAAU8B,UACZ9B,EAAU8B,SAASC,EAAQC,EAC7B,EAEFnD,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQkD,UACLvC,EACG,CAAEwC,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,YACzBtD,GAEFuD,UACErB,IAACsB,cAAa,IACRvC,EACJJ,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ6C,SAEhBhD,MA9CA,IAiDL,IAGN,CACEiD,YAzIiB,OA0IjBnD,MAAOoD,QAGX,CACEC,UAAWJ,cACXK,KAAMC,SACNC,UAAWC,cACXC,QAASC"}
|
|
1
|
+
{"version":3,"file":"Menu.mjs","sources":["../../../../src/components/Menu/Menu.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, useLayoutEffect } from 'react'\nimport type { Styles } from 'react-floater'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { deepmerge } from 'shared/utils/misc'\nimport { Tooltip } from 'components/Tooltip'\nimport { MenuComponent, SIZES } from 'components/MenuComponent'\nimport { MenuList } from 'components/MenuList'\nimport { MenuContainer } from 'components/MenuContainer'\nimport { MenuDivider } from 'components/MenuDivider'\nimport type { MenuProps } from './types'\n\nconst COMPONENT_NAME = 'Menu'\n\n/**\n *\n * Component based on [\"react-floater\"](https://www.npmjs.com/package/react-floater).\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to menu component root.\n *\n * See full [MenuProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Menu/types.ts)\n */\nconst Menu: React.ForwardRefExoticComponent<MenuProps> & {\n Component: typeof MenuComponent\n List: typeof MenuList\n Container: typeof MenuContainer\n Divider: typeof MenuDivider\n} = Object.assign(\n withMergedProps<MenuProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<MenuProps>>((props, ref) => {\n const {\n size = 'm',\n disableFlip = true,\n offset = 8,\n placement = 'bottom-start',\n styles = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n render,\n primary,\n secondary,\n palette,\n autoFocus,\n disableAutoFocus,\n portalElement,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n }\n\n const [portal, setPortal] = useState<HTMLElement | null>(null)\n\n const trigger = useRef<HTMLElement | null>(null)\n\n useLayoutEffect(() => {\n let menuPortal: HTMLElement | null = null\n\n if (portalElement) {\n setPortal(null)\n } else if (document.body) {\n menuPortal = document.createElement('div')\n\n menuPortal.dataset.menuPortal = 'true'\n menuPortal.style.position = 'relative'\n\n document.body.appendChild(menuPortal)\n\n setPortal(menuPortal)\n }\n\n return () => {\n if (menuPortal && menuPortal.isConnected) {\n menuPortal.remove()\n }\n }\n }, [portalElement])\n\n if (!portalElement && !portal) {\n return null\n }\n\n return (\n <Tooltip\n {...restProps}\n ref={ref}\n preset='brand'\n hideArrow\n portalElement={portalElement ?? portal}\n getPopper={(popper, origin) => {\n if (popper.state.elements.reference instanceof HTMLElement) {\n trigger.current = popper.state.elements.reference\n }\n\n if (restProps.getPopper) {\n restProps.getPopper(popper, origin)\n }\n }}\n callback={(action, tooltipProps) => {\n if (action === 'close' && trigger.current instanceof HTMLElement) {\n focusFirstFocusable(trigger.current)\n }\n\n if (restProps.callback) {\n restProps.callback(action, tooltipProps)\n }\n }}\n disableFlip={disableFlip}\n offset={offset}\n placement={placement}\n styles={deepmerge(\n (secondary\n ? { floater: { filter: 'none' }, wrapper: { cursor: 'pointer' } }\n : { wrapper: { cursor: 'pointer' } }) as Partial<Styles>,\n styles\n )}\n component={\n <MenuComponent\n {...sizeProps}\n autoFocus={autoFocus}\n disableAutoFocus={disableAutoFocus}\n primary={primary}\n secondary={secondary}\n palette={palette}\n >\n {render}\n </MenuComponent>\n }\n />\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: MenuComponent,\n List: MenuList,\n Container: MenuContainer,\n Divider: MenuDivider,\n }\n)\n\nexport { Menu }\n"],"names":["Menu","Object","assign","withMergedProps","forwardRef","props","ref","size","disableFlip","offset","placement","styles","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","render","primary","secondary","palette","autoFocus","disableAutoFocus","portalElement","restProps","sizeProps","portal","setPortal","useState","trigger","useRef","useLayoutEffect","menuPortal","document","body","createElement","dataset","style","position","appendChild","isConnected","remove","_jsx","Tooltip","preset","hideArrow","getPopper","popper","origin","state","elements","reference","HTMLElement","current","callback","action","tooltipProps","focusFirstFocusable","deepmerge","floater","filter","wrapper","cursor","component","MenuComponent","children","displayName","SIZES","Component","List","MenuList","Container","MenuContainer","Divider","MenuDivider"],"mappings":"6kBAyBA,MAAMA,KAKFC,OAAOC,OACTC,gBACEC,YAAmD,CAACC,EAAOC,KACzD,MAAMC,KACJA,EAAO,IAAGC,YACVA,GAAc,EAAIC,OAClBA,EAAS,EAACC,UACVA,EAAY,eAAcC,OAC1BA,EAAS,CAAE,EAAAC,QACXA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,QACNA,EAAOC,UACPA,EAASC,QACTA,EAAOC,UACPA,EAASC,iBACTA,EAAgBC,cAChBA,KACGC,GACDtB,EAEJ,MAAMuB,EAAY,CAChBrB,OACAK,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,QACAC,aAGF,MAAOU,EAAQC,GAAaC,SAA6B,MAEzD,MAAMC,EAAUC,OAA2B,MAyB3C,OAvBAC,iBAAgB,KACd,IAAIC,EAAiC,KAerC,OAbIT,EACFI,EAAU,MACDM,SAASC,OAClBF,EAAaC,SAASE,cAAc,OAEpCH,EAAWI,QAAQJ,WAAa,OAChCA,EAAWK,MAAMC,SAAW,WAE5BL,SAASC,KAAKK,YAAYP,GAE1BL,EAAUK,IAGL,KACDA,GAAcA,EAAWQ,aAC3BR,EAAWS,QACb,CACD,GACA,CAAClB,IAECA,GAAkBG,EAKrBgB,IAACC,QAAO,IACFnB,EACJrB,IAAKA,EACLyC,OAAO,QACPC,WAAS,EACTtB,cAAeA,GAAiBG,EAChCoB,UAAWA,CAACC,EAAQC,KACdD,EAAOE,MAAMC,SAASC,qBAAqBC,cAC7CvB,EAAQwB,QAAUN,EAAOE,MAAMC,SAASC,WAGtC3B,EAAUsB,WACZtB,EAAUsB,UAAUC,EAAQC,EAC9B,EAEFM,SAAUA,CAACC,EAAQC,KACbD,IAAW,SAAW1B,EAAQwB,mBAAmBD,aACnDK,oBAAoB5B,EAAQwB,SAG1B7B,EAAU8B,UACZ9B,EAAU8B,SAASC,EAAQC,EAC7B,EAEFnD,YAAaA,EACbC,OAAQA,EACRC,UAAWA,EACXC,OAAQkD,UACLvC,EACG,CAAEwC,QAAS,CAAEC,OAAQ,QAAUC,QAAS,CAAEC,OAAQ,YAClD,CAAED,QAAS,CAAEC,OAAQ,YACzBtD,GAEFuD,UACErB,IAACsB,cAAa,IACRvC,EACJJ,UAAWA,EACXC,iBAAkBA,EAClBJ,QAASA,EACTC,UAAWA,EACXC,QAASA,EAAQ6C,SAEhBhD,MA9CA,IAiDL,IAGN,CACEiD,YAzIiB,OA0IjBnD,MAAOoD,QAGX,CACEC,UAAWJ,cACXK,KAAMC,SACNC,UAAWC,cACXC,QAASC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuComponent.js","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\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 [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<MenuComponentProps>>((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"sQAUA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAAAA,gBAIzEC,MAAAA,YAA4D,CAACC,EAAOC,KAClE,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,KACGC,GACDf,EAEJ,MAAMgB,EAAMC,aAAuB,MAEnCC,MAAAA,oBAAkEjB,GAAc,IAAMe,EAAIG,SAAS,IAEnGC,MAAAA,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBV,GAAoBI,EAAIG,SAASI,IAAAA,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACV,EAAWC,IAEf,MAAMa,EAAY,CAChBvB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMiB,EAAe,CACnBb,kBACAC,mBACAX,WAGF,MAAMwB,EACJC,MAAcA,eAAClB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE6B,WAAAA,IAACC,MAAAA,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIN,SACjDkB,MAAAA,eAAelB,GACZqB,MAAAA,aAAarB,EAAU,IAAKe,KAAcC,KAAiBC,WACpDjB,GAAa,WAClBA,EAAS,IAAKe,KAAcC,SAC5BM,GACM,IAGlB,CACEC,YAhFmB,gBAiFnBC,MAAOC,UAAAA"}
|
|
1
|
+
{"version":3,"file":"MenuComponent.js","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\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 [MenuComponentProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<MenuComponentProps>>((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"sQAUA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAAAA,gBAIzEC,MAAAA,YAA4D,CAACC,EAAOC,KAClE,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,KACGC,GACDf,EAEJ,MAAMgB,EAAMC,aAAuB,MAEnCC,MAAAA,oBAAkEjB,GAAc,IAAMe,EAAIG,SAAS,IAEnGC,MAAAA,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBV,GAAoBI,EAAIG,SAASI,IAAAA,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACV,EAAWC,IAEf,MAAMa,EAAY,CAChBvB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMiB,EAAe,CACnBb,kBACAC,mBACAX,WAGF,MAAMwB,EACJC,MAAcA,eAAClB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE6B,WAAAA,IAACC,MAAAA,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIN,SACjDkB,MAAAA,eAAelB,GACZqB,MAAAA,aAAarB,EAAU,IAAKe,KAAcC,KAAiBC,WACpDjB,GAAa,WAClBA,EAAS,IAAKe,KAAcC,SAC5BM,GACM,IAGlB,CACEC,YAhFmB,gBAiFnBC,MAAOC,UAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuComponent.mjs","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\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 [MenuComponentProps](https://github.com/foxford/ui/blob/master/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<MenuComponentProps>>((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"2TAUA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAIzEC,YAA4D,CAACC,EAAOC,KAClE,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,KACGC,GACDf,EAEJ,MAAMgB,EAAMC,OAAuB,MAEnCC,oBAAkEjB,GAAc,IAAMe,EAAIG,SAAS,IAEnGC,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBV,GAAoBI,EAAIG,SAASI,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACV,EAAWC,IAEf,MAAMa,EAAY,CAChBvB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMiB,EAAe,CACnBb,kBACAC,mBACAX,WAGF,MAAMwB,EACJC,eAAelB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE6B,IAACC,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIN,SACjDkB,eAAelB,GACZqB,aAAarB,EAAU,IAAKe,KAAcC,KAAiBC,WACpDjB,GAAa,WAClBA,EAAS,IAAKe,KAAcC,SAC5BM,GACM,IAGlB,CACEC,YAhFmB,gBAiFnBC,MAAOC"}
|
|
1
|
+
{"version":3,"file":"MenuComponent.mjs","sources":["../../../../src/components/MenuComponent/MenuComponent.tsx"],"sourcesContent":["import { forwardRef, useRef, useImperativeHandle, useEffect, isValidElement, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { MenuComponentProps } from './types'\n\nconst COMPONENT_NAME = 'MenuComponent'\n\nconst noop = () => undefined\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 [MenuComponentProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuComponent/types.ts)\n */\nconst MenuComponent: React.ForwardRefExoticComponent<MenuComponentProps> = withMergedProps<\n MenuComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<MenuComponentProps>>((props, forwardedRef) => {\n const {\n size = 'm',\n closeFn = noop,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n autoFocus,\n disableAutoFocus,\n showCloseButton,\n closeButtonProps,\n ...restProps\n } = props\n\n const ref = useRef<HTMLDivElement>(null)\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current, [])\n\n useEffect(() => {\n const timerId = setTimeout(() => {\n if (!disableAutoFocus && ref.current) focusFirstFocusable(ref.current)\n }, 0)\n\n return () => {\n clearTimeout(timerId)\n }\n }, [autoFocus, disableAutoFocus])\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const forwardProps = {\n showCloseButton,\n closeButtonProps,\n closeFn,\n }\n\n const elementProps =\n isValidElement(children) && typeof children.props === 'object' && children.props !== null ? children.props : {}\n\n return (\n <Styled.Root {...restProps} {...sizeProps} ref={ref}>\n {isValidElement(children)\n ? cloneElement(children, { ...sizeProps, ...forwardProps, ...elementProps })\n : typeof children === 'function'\n ? children({ ...sizeProps, ...forwardProps })\n : undefined}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { MenuComponent }\n\nexport { SIZES }\n"],"names":["noop","MenuComponent","withMergedProps","forwardRef","props","forwardedRef","size","closeFn","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","autoFocus","disableAutoFocus","showCloseButton","closeButtonProps","restProps","ref","useRef","useImperativeHandle","current","useEffect","timerId","setTimeout","focusFirstFocusable","clearTimeout","sizeProps","forwardProps","elementProps","isValidElement","_jsx","Styled","cloneElement","undefined","displayName","sizes","SIZES"],"mappings":"2TAUA,MAAMA,KAAOA,KAAe,EAYtBC,MAAAA,cAAqEC,gBAIzEC,YAA4D,CAACC,EAAOC,KAClE,MAAMC,KACJA,EAAO,IAAGC,QACVA,EAAUP,KAAIQ,QACdA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,UACRA,EAASC,iBACTA,EAAgBC,gBAChBA,EAAeC,iBACfA,KACGC,GACDf,EAEJ,MAAMgB,EAAMC,OAAuB,MAEnCC,oBAAkEjB,GAAc,IAAMe,EAAIG,SAAS,IAEnGC,WAAU,KACR,MAAMC,EAAUC,YAAW,MACpBV,GAAoBI,EAAIG,SAASI,oBAAoBP,EAAIG,QAAQ,GACrE,GAEH,MAAO,KACLK,aAAaH,EAAQ,CACtB,GACA,CAACV,EAAWC,IAEf,MAAMa,EAAY,CAChBvB,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMiB,EAAe,CACnBb,kBACAC,mBACAX,WAGF,MAAMwB,EACJC,eAAelB,WAAoBA,EAASV,OAAU,UAAYU,EAASV,QAAU,KAAOU,EAASV,MAAQ,CAAA,EAE/G,OACE6B,IAACC,KAAW,IAAKf,KAAeU,EAAWT,IAAKA,EAAIN,SACjDkB,eAAelB,GACZqB,aAAarB,EAAU,IAAKe,KAAcC,KAAiBC,WACpDjB,GAAa,WAClBA,EAAS,IAAKe,KAAcC,SAC5BM,GACM,IAGlB,CACEC,YAhFmB,gBAiFnBC,MAAOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContainer.js","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton ? (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n ) : null}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","jsx","square","size","icon","onClick","evt"],"mappings":"0IAY2EA,MAAUA,YAGnF,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,WAAAA,KAACC,MAAAA,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,EACCK,WAAAC,IAACF,kBAAkB,CACjBG,QAAM,EACNC,KAAK,IACLC,KAAK,WACDX,EACJY,QAAUC,IACJV,GAASA,IACTH,EAAiBY,SAASZ,EAAiBY,QAAQC,EAAI,IAG7D,KACHZ,IACW"}
|
|
1
|
+
{"version":3,"file":"MenuContainer.js","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton ? (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n ) : null}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","jsx","square","size","icon","onClick","evt"],"mappings":"0IAY2EA,MAAUA,YAGnF,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,WAAAA,KAACC,MAAAA,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,EACCK,WAAAC,IAACF,kBAAkB,CACjBG,QAAM,EACNC,KAAK,IACLC,KAAK,WACDX,EACJY,QAAUC,IACJV,GAASA,IACTH,EAAiBY,SAASZ,EAAiBY,QAAQC,EAAI,IAG7D,KACHZ,IACW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContainer.mjs","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton ? (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n ) : null}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["MenuContainer","forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","square","size","icon","onClick","evt"],"mappings":"gHAYMA,MAAAA,cAAqEC,YAGzE,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,KAACC,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,EACCK,IAACD,YAAkB,CACjBE,QAAM,EACNC,KAAK,IACLC,KAAK,WACDV,EACJW,QAAUC,IACJT,GAASA,IACTH,EAAiBW,SAASX,EAAiBW,QAAQC,EAAI,IAG7D,KACHX,IACW"}
|
|
1
|
+
{"version":3,"file":"MenuContainer.mjs","sources":["../../../../src/components/MenuContainer/MenuContainer.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport * as Styled from './style'\nimport type { MenuContainerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuContainerProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuContainer/types.ts)\n */\nconst MenuContainer: React.ForwardRefExoticComponent<MenuContainerProps> = forwardRef<\n HTMLDivElement,\n MenuContainerProps\n>((props, ref) => {\n const { closeButtonProps = {}, children, showCloseButton, closeFn, ...restProps } = props\n\n return (\n <Styled.Root {...restProps} ref={ref}>\n {showCloseButton ? (\n <Styled.CloseButton\n square\n size='m'\n icon='close'\n {...closeButtonProps}\n onClick={(evt) => {\n if (closeFn) closeFn()\n if (closeButtonProps.onClick) closeButtonProps.onClick(evt)\n }}\n />\n ) : null}\n {children}\n </Styled.Root>\n )\n})\n\nexport { MenuContainer }\n"],"names":["MenuContainer","forwardRef","props","ref","closeButtonProps","children","showCloseButton","closeFn","restProps","_jsxs","Styled","_jsx","square","size","icon","onClick","evt"],"mappings":"gHAYMA,MAAAA,cAAqEC,YAGzE,CAACC,EAAOC,KACR,MAAMC,iBAAEA,EAAmB,CAAE,EAAAC,SAAEA,EAAQC,gBAAEA,EAAeC,QAAEA,KAAYC,GAAcN,EAEpF,OACEO,KAACC,KAAW,IAAKF,EAAWL,IAAKA,EAAIE,UAClCC,EACCK,IAACD,YAAkB,CACjBE,QAAM,EACNC,KAAK,IACLC,KAAK,WACDV,EACJW,QAAUC,IACJT,GAASA,IACTH,EAAiBW,SAASX,EAAiBW,QAAQC,EAAI,IAG7D,KACHX,IACW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuDivider.js","sources":["../../../../src/components/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { Text } from 'components/Text'\nimport * as Styled from './style'\nimport type { MenuDividerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuDividerProps](https://github.com/foxford/ui/blob/master/src/components/MenuDivider/types.ts)\n */\nconst MenuDivider: React.ForwardRefExoticComponent<MenuDividerProps> = forwardRef<HTMLDivElement, MenuDividerProps>(\n (props, ref) => {\n const { textProps = {}, children, text, ...restProps } = props\n\n const palette = useMergedPalette(restProps)\n\n return (\n <Styled.Root {...restProps} palette={palette} ref={ref}>\n {children || text ? (\n <Text appearance='body' size='xs' color='inherit' marginTop={8} marginBottom={4} {...textProps}>\n {children ?? text}\n </Text>\n ) : null}\n <Styled.HorizontalLine />\n </Styled.Root>\n )\n }\n)\n\nexport { MenuDivider }\n"],"names":["forwardRef","props","ref","textProps","children","text","restProps","palette","useMergedPalette","_jsxs","Styled","_jsx","Text","appearance","size","color","marginTop","marginBottom","HorizontalLine"],"mappings":"4OAcuEA,MAAUA,YAC/E,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcL,EAEzD,MAAMM,EAAUC,kCAAiBF,GAEjC,OACEG,WAAAA,KAACC,MAAAA,KAAW,IAAKJ,EAAWC,QAASA,EAASL,IAAKA,EAAIE,UACpDA,GAAYC,EACXM,WAAAA,IAACC,KAAAA,KAAI,CAACC,WAAW,OAAOC,KAAK,KAAKC,MAAM,UAAUC,UAAW,EAAGC,aAAc,KAAOd,EAASC,SAC3FA,GAAYC,IAEb,KACJM,WAAAA,IAACD,MAAqBQ,eAAA,CAAE,KACZ"}
|
|
1
|
+
{"version":3,"file":"MenuDivider.js","sources":["../../../../src/components/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { Text } from 'components/Text'\nimport * as Styled from './style'\nimport type { MenuDividerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuDividerProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuDivider/types.ts)\n */\nconst MenuDivider: React.ForwardRefExoticComponent<MenuDividerProps> = forwardRef<HTMLDivElement, MenuDividerProps>(\n (props, ref) => {\n const { textProps = {}, children, text, ...restProps } = props\n\n const palette = useMergedPalette(restProps)\n\n return (\n <Styled.Root {...restProps} palette={palette} ref={ref}>\n {children || text ? (\n <Text appearance='body' size='xs' color='inherit' marginTop={8} marginBottom={4} {...textProps}>\n {children ?? text}\n </Text>\n ) : null}\n <Styled.HorizontalLine />\n </Styled.Root>\n )\n }\n)\n\nexport { MenuDivider }\n"],"names":["forwardRef","props","ref","textProps","children","text","restProps","palette","useMergedPalette","_jsxs","Styled","_jsx","Text","appearance","size","color","marginTop","marginBottom","HorizontalLine"],"mappings":"4OAcuEA,MAAUA,YAC/E,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcL,EAEzD,MAAMM,EAAUC,kCAAiBF,GAEjC,OACEG,WAAAA,KAACC,MAAAA,KAAW,IAAKJ,EAAWC,QAASA,EAASL,IAAKA,EAAIE,UACpDA,GAAYC,EACXM,WAAAA,IAACC,KAAAA,KAAI,CAACC,WAAW,OAAOC,KAAK,KAAKC,MAAM,UAAUC,UAAW,EAAGC,aAAc,KAAOd,EAASC,SAC3FA,GAAYC,IAEb,KACJM,WAAAA,IAACD,MAAqBQ,eAAA,CAAE,KACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuDivider.mjs","sources":["../../../../src/components/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { Text } from 'components/Text'\nimport * as Styled from './style'\nimport type { MenuDividerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuDividerProps](https://github.com/foxford/ui/blob/master/src/components/MenuDivider/types.ts)\n */\nconst MenuDivider: React.ForwardRefExoticComponent<MenuDividerProps> = forwardRef<HTMLDivElement, MenuDividerProps>(\n (props, ref) => {\n const { textProps = {}, children, text, ...restProps } = props\n\n const palette = useMergedPalette(restProps)\n\n return (\n <Styled.Root {...restProps} palette={palette} ref={ref}>\n {children || text ? (\n <Text appearance='body' size='xs' color='inherit' marginTop={8} marginBottom={4} {...textProps}>\n {children ?? text}\n </Text>\n ) : null}\n <Styled.HorizontalLine />\n </Styled.Root>\n )\n }\n)\n\nexport { MenuDivider }\n"],"names":["MenuDivider","forwardRef","props","ref","textProps","children","text","restProps","palette","useMergedPalette","_jsxs","Styled","_jsx","Text","appearance","size","color","marginTop","marginBottom"],"mappings":"qNAcMA,MAAAA,YAAiEC,YACrE,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcL,EAEzD,MAAMM,EAAUC,iBAAiBF,GAEjC,OACEG,KAACC,KAAW,IAAKJ,EAAWC,QAASA,EAASL,IAAKA,EAAIE,UACpDA,GAAYC,EACXM,IAACC,KAAI,CAACC,WAAW,OAAOC,KAAK,KAAKC,MAAM,UAAUC,UAAW,EAAGC,aAAc,KAAOd,EAASC,SAC3FA,GAAYC,IAEb,KACJM,IAACD,eAAqB,CAAE,KACZ"}
|
|
1
|
+
{"version":3,"file":"MenuDivider.mjs","sources":["../../../../src/components/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useMergedPalette } from 'hooks/useMergedPalette'\nimport { Text } from 'components/Text'\nimport * as Styled from './style'\nimport type { MenuDividerProps } from './types'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuDividerProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuDivider/types.ts)\n */\nconst MenuDivider: React.ForwardRefExoticComponent<MenuDividerProps> = forwardRef<HTMLDivElement, MenuDividerProps>(\n (props, ref) => {\n const { textProps = {}, children, text, ...restProps } = props\n\n const palette = useMergedPalette(restProps)\n\n return (\n <Styled.Root {...restProps} palette={palette} ref={ref}>\n {children || text ? (\n <Text appearance='body' size='xs' color='inherit' marginTop={8} marginBottom={4} {...textProps}>\n {children ?? text}\n </Text>\n ) : null}\n <Styled.HorizontalLine />\n </Styled.Root>\n )\n }\n)\n\nexport { MenuDivider }\n"],"names":["MenuDivider","forwardRef","props","ref","textProps","children","text","restProps","palette","useMergedPalette","_jsxs","Styled","_jsx","Text","appearance","size","color","marginTop","marginBottom"],"mappings":"qNAcMA,MAAAA,YAAiEC,YACrE,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcL,EAEzD,MAAMM,EAAUC,iBAAiBF,GAEjC,OACEG,KAACC,KAAW,IAAKJ,EAAWC,QAASA,EAASL,IAAKA,EAAIE,UACpDA,GAAYC,EACXM,IAACC,KAAI,CAACC,WAAW,OAAOC,KAAK,KAAKC,MAAM,UAAUC,UAAW,EAAGC,aAAc,KAAOd,EAASC,SAC3FA,GAAYC,IAEb,KACJM,IAACD,eAAqB,CAAE,KACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.js","sources":["../../../../src/components/MenuList/MenuList.tsx"],"sourcesContent":["import { forwardRef, Children, isValidElement, cloneElement, Fragment } from 'react'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { keyboardKeys } from 'shared/constants'\nimport type { MenuListProps } from './types'\nimport * as Styled from './style'\n\nconst HOT_KEYS: string[] = [...keyboardKeys.ArrowUp.key, ...keyboardKeys.ArrowDown.key]\n\n/**\n *\n * Component accepts all \\<ul\\> attributes.\n *\n * Responsive \"size\" props are forwarded to children elements.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuListProps](https://github.com/foxford/ui/blob/master/src/components/MenuList/types.ts)\n */\nconst MenuList: React.ForwardRefExoticComponent<MenuListProps> = forwardRef<HTMLUListElement, MenuListProps>(\n (props, ref) => {\n const {\n role = 'list',\n gap = 4,\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n }\n\n const children =\n isValidElement(restProps.children) &&\n restProps.children.type === Fragment &&\n typeof restProps.children.props === 'object' &&\n restProps.children.props !== null\n ? restProps.children.props.children\n : restProps.children\n\n return (\n <Styled.Root\n {...restProps}\n role={role}\n gap={gap}\n onKeyDown={(evt) => {\n if (restProps.onKeyDown) restProps.onKeyDown(evt)\n\n if (HOT_KEYS.includes(evt.key)) {\n evt.preventDefault()\n\n const listItems = [...evt.currentTarget.children]\n let idx = listItems.findIndex((item) => item.contains(evt.target as Node))\n\n do {\n // eslint-disable-next-line no-useless-assignment\n idx = keyboardKeys.ArrowUp.validate(evt.key) ? --idx : ++idx\n\n if (idx < 0) {\n idx = listItems.length - 1\n } else if (idx > listItems.length - 1) {\n idx = 0\n }\n } while (!(listItems[idx] instanceof HTMLElement && focusFirstFocusable(listItems[idx] as HTMLElement)))\n }\n }}\n ref={ref}\n >\n {Children.map(children, (child, idx) => {\n if (isValidElement(child)) {\n const childProps = typeof child.props === 'object' && child.props !== null ? child.props : {}\n\n return <li key={idx}>{cloneElement(child, { ...sizeProps, ...childProps })}</li>\n }\n\n return child === null || child === undefined || typeof child === 'boolean' ? (\n child\n ) : (\n <li key={idx}>{child}</li>\n )\n })}\n </Styled.Root>\n )\n }\n)\n\nexport { MenuList }\n"],"names":["HOT_KEYS","keyboardKeys","ArrowUp","key","ArrowDown","forwardRef","props","ref","role","gap","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","restProps","sizeProps","children","isValidElement","type","Fragment","_jsx","Styled","onKeyDown","evt","includes","preventDefault","listItems","currentTarget","idx","findIndex","item","contains","target","validate","length","HTMLElement","focusFirstFocusable","Children","map","child","cloneElement","undefined","jsx"],"mappings":"oNAMA,MAAMA,SAAqB,IAAIC,UAAAA,aAAaC,QAAQC,OAAQF,UAAYA,aAACG,UAAUD,sBAYlBE,MAAUA,YACzE,CAACC,EAAOC,KACN,MAAMC,KACJA,EAAO,OAAMC,IACbA,EAAM,EAACC,KACPA,EAAIC,QACJA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,KACGC,GACDb,EAEJ,MAAMc,EAAY,CAChBV,OACAC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,YACAC,SAGF,MAAMG,EACJC,MAAAA,eAAeH,EAAUE,WACzBF,EAAUE,SAASE,OAASC,uBACrBL,EAAUE,SAASf,OAAU,UACpCa,EAAUE,SAASf,QAAU,KACzBa,EAAUE,SAASf,MAAMe,SACzBF,EAAUE,SAEhB,OACEI,WAAAA,IAACC,MAAAA,KAAW,IACNP,EACJX,KAAMA,EACNC,IAAKA,EACLkB,UAAYC,IAGV,GAFIT,EAAUQ,WAAWR,EAAUQ,UAAUC,GAEzC5B,SAAS6B,SAASD,EAAIzB,KAAM,CAC9ByB,EAAIE,iBAEJ,MAAMC,EAAY,IAAIH,EAAII,cAAcX,UACxC,IAAIY,EAAMF,EAAUG,WAAWC,GAASA,EAAKC,SAASR,EAAIS,UAE1D,GAEEJ,EAAMhC,UAAAA,aAAaC,QAAQoC,SAASV,EAAIzB,OAAS8B,IAAQA,EAErDA,EAAM,EACRA,EAAMF,EAAUQ,OAAS,EAChBN,EAAMF,EAAUQ,OAAS,IAClCN,EAAM,WAECF,EAAUE,aAAgBO,aAAeC,IAAAA,oBAAoBV,EAAUE,KACpF,GAEF1B,IAAKA,EAAIc,SAERqB,MAAQA,SAACC,IAAItB,GAAU,CAACuB,EAAOX,IAC1BX,MAAAA,eAAesB,GAGVnB,WAAAA,IAAA,KAAA,CAAAJ,SAAewB,MAAYA,aAACD,EAAO,IAAKxB,YAFrBwB,EAAMtC,OAAU,UAAYsC,EAAMtC,QAAU,KAAOsC,EAAMtC,MAAQ,CAAA,KAE3E2B,GAGXW,IAAU,MAAQA,SAAUE,UAAoBF,GAAU,UAC/DA,EAEAnB,WAAAsB,IAAA,KAAA,CAAA1B,SAAeuB,GAANX,MAGD"}
|
|
1
|
+
{"version":3,"file":"MenuList.js","sources":["../../../../src/components/MenuList/MenuList.tsx"],"sourcesContent":["import { forwardRef, Children, isValidElement, cloneElement, Fragment } from 'react'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { keyboardKeys } from 'shared/constants'\nimport type { MenuListProps } from './types'\nimport * as Styled from './style'\n\nconst HOT_KEYS: string[] = [...keyboardKeys.ArrowUp.key, ...keyboardKeys.ArrowDown.key]\n\n/**\n *\n * Component accepts all \\<ul\\> attributes.\n *\n * Responsive \"size\" props are forwarded to children elements.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuListProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuList/types.ts)\n */\nconst MenuList: React.ForwardRefExoticComponent<MenuListProps> = forwardRef<HTMLUListElement, MenuListProps>(\n (props, ref) => {\n const {\n role = 'list',\n gap = 4,\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n }\n\n const children =\n isValidElement(restProps.children) &&\n restProps.children.type === Fragment &&\n typeof restProps.children.props === 'object' &&\n restProps.children.props !== null\n ? restProps.children.props.children\n : restProps.children\n\n return (\n <Styled.Root\n {...restProps}\n role={role}\n gap={gap}\n onKeyDown={(evt) => {\n if (restProps.onKeyDown) restProps.onKeyDown(evt)\n\n if (HOT_KEYS.includes(evt.key)) {\n evt.preventDefault()\n\n const listItems = [...evt.currentTarget.children]\n let idx = listItems.findIndex((item) => item.contains(evt.target as Node))\n\n do {\n // eslint-disable-next-line no-useless-assignment\n idx = keyboardKeys.ArrowUp.validate(evt.key) ? --idx : ++idx\n\n if (idx < 0) {\n idx = listItems.length - 1\n } else if (idx > listItems.length - 1) {\n idx = 0\n }\n } while (!(listItems[idx] instanceof HTMLElement && focusFirstFocusable(listItems[idx] as HTMLElement)))\n }\n }}\n ref={ref}\n >\n {Children.map(children, (child, idx) => {\n if (isValidElement(child)) {\n const childProps = typeof child.props === 'object' && child.props !== null ? child.props : {}\n\n return <li key={idx}>{cloneElement(child, { ...sizeProps, ...childProps })}</li>\n }\n\n return child === null || child === undefined || typeof child === 'boolean' ? (\n child\n ) : (\n <li key={idx}>{child}</li>\n )\n })}\n </Styled.Root>\n )\n }\n)\n\nexport { MenuList }\n"],"names":["HOT_KEYS","keyboardKeys","ArrowUp","key","ArrowDown","forwardRef","props","ref","role","gap","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","restProps","sizeProps","children","isValidElement","type","Fragment","_jsx","Styled","onKeyDown","evt","includes","preventDefault","listItems","currentTarget","idx","findIndex","item","contains","target","validate","length","HTMLElement","focusFirstFocusable","Children","map","child","cloneElement","undefined","jsx"],"mappings":"oNAMA,MAAMA,SAAqB,IAAIC,UAAAA,aAAaC,QAAQC,OAAQF,UAAYA,aAACG,UAAUD,sBAYlBE,MAAUA,YACzE,CAACC,EAAOC,KACN,MAAMC,KACJA,EAAO,OAAMC,IACbA,EAAM,EAACC,KACPA,EAAIC,QACJA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,KACGC,GACDb,EAEJ,MAAMc,EAAY,CAChBV,OACAC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,YACAC,SAGF,MAAMG,EACJC,MAAAA,eAAeH,EAAUE,WACzBF,EAAUE,SAASE,OAASC,uBACrBL,EAAUE,SAASf,OAAU,UACpCa,EAAUE,SAASf,QAAU,KACzBa,EAAUE,SAASf,MAAMe,SACzBF,EAAUE,SAEhB,OACEI,WAAAA,IAACC,MAAAA,KAAW,IACNP,EACJX,KAAMA,EACNC,IAAKA,EACLkB,UAAYC,IAGV,GAFIT,EAAUQ,WAAWR,EAAUQ,UAAUC,GAEzC5B,SAAS6B,SAASD,EAAIzB,KAAM,CAC9ByB,EAAIE,iBAEJ,MAAMC,EAAY,IAAIH,EAAII,cAAcX,UACxC,IAAIY,EAAMF,EAAUG,WAAWC,GAASA,EAAKC,SAASR,EAAIS,UAE1D,GAEEJ,EAAMhC,UAAAA,aAAaC,QAAQoC,SAASV,EAAIzB,OAAS8B,IAAQA,EAErDA,EAAM,EACRA,EAAMF,EAAUQ,OAAS,EAChBN,EAAMF,EAAUQ,OAAS,IAClCN,EAAM,WAECF,EAAUE,aAAgBO,aAAeC,IAAAA,oBAAoBV,EAAUE,KACpF,GAEF1B,IAAKA,EAAIc,SAERqB,MAAQA,SAACC,IAAItB,GAAU,CAACuB,EAAOX,IAC1BX,MAAAA,eAAesB,GAGVnB,WAAAA,IAAA,KAAA,CAAAJ,SAAewB,MAAYA,aAACD,EAAO,IAAKxB,YAFrBwB,EAAMtC,OAAU,UAAYsC,EAAMtC,QAAU,KAAOsC,EAAMtC,MAAQ,CAAA,KAE3E2B,GAGXW,IAAU,MAAQA,SAAUE,UAAoBF,GAAU,UAC/DA,EAEAnB,WAAAsB,IAAA,KAAA,CAAA1B,SAAeuB,GAANX,MAGD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.mjs","sources":["../../../../src/components/MenuList/MenuList.tsx"],"sourcesContent":["import { forwardRef, Children, isValidElement, cloneElement, Fragment } from 'react'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { keyboardKeys } from 'shared/constants'\nimport type { MenuListProps } from './types'\nimport * as Styled from './style'\n\nconst HOT_KEYS: string[] = [...keyboardKeys.ArrowUp.key, ...keyboardKeys.ArrowDown.key]\n\n/**\n *\n * Component accepts all \\<ul\\> attributes.\n *\n * Responsive \"size\" props are forwarded to children elements.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuListProps](https://github.com/foxford/ui/blob/master/src/components/MenuList/types.ts)\n */\nconst MenuList: React.ForwardRefExoticComponent<MenuListProps> = forwardRef<HTMLUListElement, MenuListProps>(\n (props, ref) => {\n const {\n role = 'list',\n gap = 4,\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n }\n\n const children =\n isValidElement(restProps.children) &&\n restProps.children.type === Fragment &&\n typeof restProps.children.props === 'object' &&\n restProps.children.props !== null\n ? restProps.children.props.children\n : restProps.children\n\n return (\n <Styled.Root\n {...restProps}\n role={role}\n gap={gap}\n onKeyDown={(evt) => {\n if (restProps.onKeyDown) restProps.onKeyDown(evt)\n\n if (HOT_KEYS.includes(evt.key)) {\n evt.preventDefault()\n\n const listItems = [...evt.currentTarget.children]\n let idx = listItems.findIndex((item) => item.contains(evt.target as Node))\n\n do {\n // eslint-disable-next-line no-useless-assignment\n idx = keyboardKeys.ArrowUp.validate(evt.key) ? --idx : ++idx\n\n if (idx < 0) {\n idx = listItems.length - 1\n } else if (idx > listItems.length - 1) {\n idx = 0\n }\n } while (!(listItems[idx] instanceof HTMLElement && focusFirstFocusable(listItems[idx] as HTMLElement)))\n }\n }}\n ref={ref}\n >\n {Children.map(children, (child, idx) => {\n if (isValidElement(child)) {\n const childProps = typeof child.props === 'object' && child.props !== null ? child.props : {}\n\n return <li key={idx}>{cloneElement(child, { ...sizeProps, ...childProps })}</li>\n }\n\n return child === null || child === undefined || typeof child === 'boolean' ? (\n child\n ) : (\n <li key={idx}>{child}</li>\n )\n })}\n </Styled.Root>\n )\n }\n)\n\nexport { MenuList }\n"],"names":["HOT_KEYS","keyboardKeys","ArrowUp","key","ArrowDown","MenuList","forwardRef","props","ref","role","gap","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","restProps","sizeProps","children","isValidElement","type","Fragment","_jsx","Styled","onKeyDown","evt","includes","preventDefault","listItems","currentTarget","idx","findIndex","item","contains","target","validate","length","HTMLElement","focusFirstFocusable","Children","map","child","cloneElement","undefined"],"mappings":"8PAMA,MAAMA,SAAqB,IAAIC,aAAaC,QAAQC,OAAQF,aAAaG,UAAUD,KAY7EE,MAAAA,SAA2DC,YAC/D,CAACC,EAAOC,KACN,MAAMC,KACJA,EAAO,OAAMC,IACbA,EAAM,EAACC,KACPA,EAAIC,QACJA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,KACGC,GACDb,EAEJ,MAAMc,EAAY,CAChBV,OACAC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,YACAC,SAGF,MAAMG,EACJC,eAAeH,EAAUE,WACzBF,EAAUE,SAASE,OAASC,iBACrBL,EAAUE,SAASf,OAAU,UACpCa,EAAUE,SAASf,QAAU,KACzBa,EAAUE,SAASf,MAAMe,SACzBF,EAAUE,SAEhB,OACEI,IAACC,KAAW,IACNP,EACJX,KAAMA,EACNC,IAAKA,EACLkB,UAAYC,IAGV,GAFIT,EAAUQ,WAAWR,EAAUQ,UAAUC,GAEzC7B,SAAS8B,SAASD,EAAI1B,KAAM,CAC9B0B,EAAIE,iBAEJ,MAAMC,EAAY,IAAIH,EAAII,cAAcX,UACxC,IAAIY,EAAMF,EAAUG,WAAWC,GAASA,EAAKC,SAASR,EAAIS,UAE1D,GAEEJ,EAAMjC,aAAaC,QAAQqC,SAASV,EAAI1B,OAAS+B,IAAQA,EAErDA,EAAM,EACRA,EAAMF,EAAUQ,OAAS,EAChBN,EAAMF,EAAUQ,OAAS,IAClCN,EAAM,WAECF,EAAUE,aAAgBO,aAAeC,oBAAoBV,EAAUE,KACpF,GAEF1B,IAAKA,EAAIc,SAERqB,SAASC,IAAItB,GAAU,CAACuB,EAAOX,IAC1BX,eAAesB,GAGVnB,IAAA,KAAA,CAAAJ,SAAewB,aAAaD,EAAO,IAAKxB,YAFrBwB,EAAMtC,OAAU,UAAYsC,EAAMtC,QAAU,KAAOsC,EAAMtC,MAAQ,CAAA,KAE3E2B,GAGXW,IAAU,MAAQA,SAAUE,UAAoBF,GAAU,UAC/DA,EAEAnB,IAAA,KAAA,CAAAJ,SAAeuB,GAANX,MAGD"}
|
|
1
|
+
{"version":3,"file":"MenuList.mjs","sources":["../../../../src/components/MenuList/MenuList.tsx"],"sourcesContent":["import { forwardRef, Children, isValidElement, cloneElement, Fragment } from 'react'\nimport { focusFirstFocusable } from 'shared/utils/dom'\nimport { keyboardKeys } from 'shared/constants'\nimport type { MenuListProps } from './types'\nimport * as Styled from './style'\n\nconst HOT_KEYS: string[] = [...keyboardKeys.ArrowUp.key, ...keyboardKeys.ArrowDown.key]\n\n/**\n *\n * Component accepts all \\<ul\\> attributes.\n *\n * Responsive \"size\" props are forwarded to children elements.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [MenuListProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/MenuList/types.ts)\n */\nconst MenuList: React.ForwardRefExoticComponent<MenuListProps> = forwardRef<HTMLUListElement, MenuListProps>(\n (props, ref) => {\n const {\n role = 'list',\n gap = 4,\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizeUnits,\n sizes,\n }\n\n const children =\n isValidElement(restProps.children) &&\n restProps.children.type === Fragment &&\n typeof restProps.children.props === 'object' &&\n restProps.children.props !== null\n ? restProps.children.props.children\n : restProps.children\n\n return (\n <Styled.Root\n {...restProps}\n role={role}\n gap={gap}\n onKeyDown={(evt) => {\n if (restProps.onKeyDown) restProps.onKeyDown(evt)\n\n if (HOT_KEYS.includes(evt.key)) {\n evt.preventDefault()\n\n const listItems = [...evt.currentTarget.children]\n let idx = listItems.findIndex((item) => item.contains(evt.target as Node))\n\n do {\n // eslint-disable-next-line no-useless-assignment\n idx = keyboardKeys.ArrowUp.validate(evt.key) ? --idx : ++idx\n\n if (idx < 0) {\n idx = listItems.length - 1\n } else if (idx > listItems.length - 1) {\n idx = 0\n }\n } while (!(listItems[idx] instanceof HTMLElement && focusFirstFocusable(listItems[idx] as HTMLElement)))\n }\n }}\n ref={ref}\n >\n {Children.map(children, (child, idx) => {\n if (isValidElement(child)) {\n const childProps = typeof child.props === 'object' && child.props !== null ? child.props : {}\n\n return <li key={idx}>{cloneElement(child, { ...sizeProps, ...childProps })}</li>\n }\n\n return child === null || child === undefined || typeof child === 'boolean' ? (\n child\n ) : (\n <li key={idx}>{child}</li>\n )\n })}\n </Styled.Root>\n )\n }\n)\n\nexport { MenuList }\n"],"names":["HOT_KEYS","keyboardKeys","ArrowUp","key","ArrowDown","MenuList","forwardRef","props","ref","role","gap","size","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizeUnits","sizes","restProps","sizeProps","children","isValidElement","type","Fragment","_jsx","Styled","onKeyDown","evt","includes","preventDefault","listItems","currentTarget","idx","findIndex","item","contains","target","validate","length","HTMLElement","focusFirstFocusable","Children","map","child","cloneElement","undefined"],"mappings":"8PAMA,MAAMA,SAAqB,IAAIC,aAAaC,QAAQC,OAAQF,aAAaG,UAAUD,KAY7EE,MAAAA,SAA2DC,YAC/D,CAACC,EAAOC,KACN,MAAMC,KACJA,EAAO,OAAMC,IACbA,EAAM,EAACC,KACPA,EAAIC,QACJA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,KACGC,GACDb,EAEJ,MAAMc,EAAY,CAChBV,OACAC,UACAC,SACAC,QACAC,QACAC,QACAC,SACAC,YACAC,SAGF,MAAMG,EACJC,eAAeH,EAAUE,WACzBF,EAAUE,SAASE,OAASC,iBACrBL,EAAUE,SAASf,OAAU,UACpCa,EAAUE,SAASf,QAAU,KACzBa,EAAUE,SAASf,MAAMe,SACzBF,EAAUE,SAEhB,OACEI,IAACC,KAAW,IACNP,EACJX,KAAMA,EACNC,IAAKA,EACLkB,UAAYC,IAGV,GAFIT,EAAUQ,WAAWR,EAAUQ,UAAUC,GAEzC7B,SAAS8B,SAASD,EAAI1B,KAAM,CAC9B0B,EAAIE,iBAEJ,MAAMC,EAAY,IAAIH,EAAII,cAAcX,UACxC,IAAIY,EAAMF,EAAUG,WAAWC,GAASA,EAAKC,SAASR,EAAIS,UAE1D,GAEEJ,EAAMjC,aAAaC,QAAQqC,SAASV,EAAI1B,OAAS+B,IAAQA,EAErDA,EAAM,EACRA,EAAMF,EAAUQ,OAAS,EAChBN,EAAMF,EAAUQ,OAAS,IAClCN,EAAM,WAECF,EAAUE,aAAgBO,aAAeC,oBAAoBV,EAAUE,KACpF,GAEF1B,IAAKA,EAAIc,SAERqB,SAASC,IAAItB,GAAU,CAACuB,EAAOX,IAC1BX,eAAesB,GAGVnB,IAAA,KAAA,CAAAJ,SAAewB,aAAaD,EAAO,IAAKxB,YAFrBwB,EAAMtC,OAAU,UAAYsC,EAAMtC,QAAU,KAAOsC,EAAMtC,MAAQ,CAAA,KAE3E2B,GAGXW,IAAU,MAAQA,SAAUE,UAAoBF,GAAU,UAC/DA,EAEAnB,IAAA,KAAA,CAAAJ,SAAeuB,GAANX,MAGD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal from 'react-modal'\nimport type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | { base: string; afterOpen: string; beforeClose: string }\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal from 'react-modal'\nimport type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | { base: string; afterOpen: string; beforeClose: string }\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n */\nfunction Modal(props: ModalProps) {\n const {\n blurredOverlay,\n children,\n closeTimeoutMS,\n contentLabel,\n isOpen,\n onAfterOpen,\n onRequestClose,\n overlayClassName,\n role,\n shouldCloseOnOverlayClick,\n width,\n valign,\n className,\n style,\n zIndex,\n } = props\n\n return (\n <Styled.Modal\n blurredOverlay={blurredOverlay}\n closeTimeoutMS={closeTimeoutMS}\n contentLabel={contentLabel}\n isOpen={Boolean(isOpen)}\n onAfterOpen={onAfterOpen}\n onRequestClose={onRequestClose}\n portalClassName={className}\n overlayClassName={overlayClassName}\n bodyOpenClassName='modal--open'\n role={role}\n zIndex={zIndex}\n valign={valign}\n width={width}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n >\n <div style={style}>{children}</div>\n </Styled.Modal>\n )\n}\n\nModal.defaultProps = {\n blurredOverlay: false,\n closeTimeoutMS: 0,\n zIndex: 9000,\n contentLabel: '',\n isOpen: false,\n role: 'dialog',\n shouldCloseOnOverlayClick: true,\n width: 'm',\n valign: 'center',\n className: 'modal',\n}\n\nModal.Close = ModalClose\nModal.displayName = 'Modal'\n\nexport { Modal }\n"],"names":["Modal","props","blurredOverlay","children","closeTimeoutMS","contentLabel","isOpen","onAfterOpen","onRequestClose","overlayClassName","role","shouldCloseOnOverlayClick","width","valign","className","style","zIndex","_jsx","Styled","Boolean","portalClassName","bodyOpenClassName","jsx","window","appElement","document","body","HTMLElement","ReactModal","setAppElement","setAppModalElement","defaultProps","Close","ModalClose","displayName"],"mappings":"oRA8EA,SAASA,MAAMC,GACb,MAAMC,eACJA,EAAcC,SACdA,EAAQC,eACRA,EAAcC,aACdA,EAAYC,OACZA,EAAMC,YACNA,EAAWC,eACXA,EAAcC,iBACdA,EAAgBC,KAChBA,EAAIC,0BACJA,EAAyBC,MACzBA,EAAKC,OACLA,EAAMC,UACNA,QACAC,EAAKC,OACLA,GACEf,EAEJ,OACEgB,WAAAA,IAACC,MAAAA,MAAY,CACXhB,eAAgBA,EAChBE,eAAgBA,EAChBC,aAAcA,EACdC,OAAQa,QAAQb,GAChBC,YAAaA,EACbC,eAAgBA,EAChBY,gBAAiBN,EACjBL,iBAAkBA,EAClBY,kBAAkB,cAClBX,KAAMA,EACNM,OAAQA,EACRH,OAAQA,EACRD,MAAOA,EACPD,0BAA2BA,EAA0BR,SAErDc,WAAAK,IAAA,MAAA,CAAKP,MAAOA,EAAMZ,SAAEA,KAG1B,QAzGWoB,QAAW,aANtB,MACE,MAAMC,EAAaC,SAASC,KAExBF,GAAcA,aAAsBG,aAAaC,oBAAAA,QAAWC,cAAcL,EAChF,EAGEM,GA0GF9B,MAAM+B,aAAe,CACnB7B,gBAAgB,EAChBE,eAAgB,EAChBY,OAAQ,IACRX,aAAc,GACdC,QAAQ,EACRI,KAAM,SACNC,2BAA2B,EAC3BC,MAAO,IACPC,OAAQ,SACRC,UAAW,SAGbd,MAAMgC,MAAQC,MAAAA,WACdjC,MAAMkC,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal from 'react-modal'\nimport type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | { base: string; afterOpen: string; beforeClose: string }\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n
|
|
1
|
+
{"version":3,"file":"Modal.mjs","sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import ReactModal from 'react-modal'\nimport type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ModalClose } from './Close'\nimport * as Styled from './style'\n\nfunction setAppModalElement() {\n const appElement = document.body\n\n if (appElement && appElement instanceof HTMLElement) ReactModal.setAppElement(appElement)\n}\n\nif (typeof window !== 'undefined') {\n setAppModalElement()\n}\n\nexport interface ModalProps extends BaseProps, ResponsiveNamedProperty<'width'> {\n /**\n * Primary content.\n */\n /**\n * Boolean indicating if the overlay background should be blurred\n */\n blurredOverlay?: boolean\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Modal class name\n */\n className?: string\n /**\n * Number indicating the milliseconds to wait before closing the modal.\n */\n closeTimeoutMS?: number\n /**\n * String indicating how the content container should be announced to screenreaders\n */\n contentLabel?: string\n /**\n * Boolean describing if the modal should be shown or not.\n */\n isOpen?: boolean\n /**\n * Function that will be run after the modal has opened.\n */\n onAfterOpen?(): void\n /**\n * Function that will be run when the modal is requested to be closed, prior to actually closing.\n */\n onRequestClose?(): void\n /**\n * Custom overlay CSS class name\n */\n overlayClassName?: string | { base: string; afterOpen: string; beforeClose: string }\n /**\n * String indicating the role of the modal, allowing the 'dialog' role to be applied if desired.\n */\n role?: string\n /**\n * Boolean indicating if the overlay should close the modal\n */\n shouldCloseOnOverlayClick?: boolean\n /**\n * Vertical align\n */\n valign?: 'top' | 'center' | 'bottom'\n /**\n * z-index\n */\n zIndex?: number\n}\n\n/**\n * Основан на [react-modal](https://github.com/reactjs/react-modal).\n *\n */\nfunction Modal(props: ModalProps) {\n const {\n blurredOverlay,\n children,\n closeTimeoutMS,\n contentLabel,\n isOpen,\n onAfterOpen,\n onRequestClose,\n overlayClassName,\n role,\n shouldCloseOnOverlayClick,\n width,\n valign,\n className,\n style,\n zIndex,\n } = props\n\n return (\n <Styled.Modal\n blurredOverlay={blurredOverlay}\n closeTimeoutMS={closeTimeoutMS}\n contentLabel={contentLabel}\n isOpen={Boolean(isOpen)}\n onAfterOpen={onAfterOpen}\n onRequestClose={onRequestClose}\n portalClassName={className}\n overlayClassName={overlayClassName}\n bodyOpenClassName='modal--open'\n role={role}\n zIndex={zIndex}\n valign={valign}\n width={width}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n >\n <div style={style}>{children}</div>\n </Styled.Modal>\n )\n}\n\nModal.defaultProps = {\n blurredOverlay: false,\n closeTimeoutMS: 0,\n zIndex: 9000,\n contentLabel: '',\n isOpen: false,\n role: 'dialog',\n shouldCloseOnOverlayClick: true,\n width: 'm',\n valign: 'center',\n className: 'modal',\n}\n\nModal.Close = ModalClose\nModal.displayName = 'Modal'\n\nexport { Modal }\n"],"names":["Modal","props","blurredOverlay","children","closeTimeoutMS","contentLabel","isOpen","onAfterOpen","onRequestClose","overlayClassName","role","shouldCloseOnOverlayClick","width","valign","className","style","zIndex","_jsx","Styled","Boolean","portalClassName","bodyOpenClassName","window","appElement","document","body","HTMLElement","ReactModal","setAppElement","setAppModalElement","defaultProps","Close","ModalClose","displayName"],"mappings":"qJA8EA,SAASA,MAAMC,GACb,MAAMC,eACJA,EAAcC,SACdA,EAAQC,eACRA,EAAcC,aACdA,EAAYC,OACZA,EAAMC,YACNA,EAAWC,eACXA,EAAcC,iBACdA,EAAgBC,KAChBA,EAAIC,0BACJA,EAAyBC,MACzBA,EAAKC,OACLA,EAAMC,UACNA,EAASC,MACTA,EAAKC,OACLA,GACEf,EAEJ,OACEgB,IAACC,QAAY,CACXhB,eAAgBA,EAChBE,eAAgBA,EAChBC,aAAcA,EACdC,OAAQa,QAAQb,GAChBC,YAAaA,EACbC,eAAgBA,EAChBY,gBAAiBN,EACjBL,iBAAkBA,EAClBY,kBAAkB,cAClBX,KAAMA,EACNM,OAAQA,EACRH,OAAQA,EACRD,MAAOA,EACPD,0BAA2BA,EAA0BR,SAErDc,IAAA,MAAA,CAAKF,MAAOA,EAAMZ,SAAEA,KAG1B,QAzGWmB,QAAW,aANtB,MACE,MAAMC,EAAaC,SAASC,KAExBF,GAAcA,aAAsBG,aAAaC,WAAWC,cAAcL,EAChF,EAGEM,GA0GF7B,MAAM8B,aAAe,CACnB5B,gBAAgB,EAChBE,eAAgB,EAChBY,OAAQ,IACRX,aAAc,GACdC,QAAQ,EACRI,KAAM,SACNC,2BAA2B,EAC3BC,MAAO,IACPC,OAAQ,SACRC,UAAW,SAGbd,MAAM+B,MAAQC,WACdhC,MAAMiC,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\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 return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","jsxs","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"2aAwBMA,MAAAA,aAAmEC,gBAAAA,gBAIvEC,MAAAA,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,WAAAA,KAACC,MAAAA,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAACC,UAAI,CAACC,OAAO,QAAQC,KAAMC,UAAUA,WAAC1B,GAAS2B,MAAOC,UAAWA,cAAKX,KAAehB,MAGzFiB,WAAAW,KAACV,gBAAgB,CAAAC,SACfF,CAAAA,WAAAW,KAACV,cAAc,CAAAC,SACZb,CAAAA,EACCc,WAAAC,IAACQ,UAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFlB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,WAAAA,IAACS,KAAAA,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW7B,EAAQ,aAAU8B,EAC7BV,MAAOW,UAAWA,cACdrB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBkC,SAAWjC,EAAYkC,MAAQlC,EAAYmC,GAC5DvB,WAAAW,KAACV,eAAe,CAAAC,UACbf,EAAkBkC,QACjBlB,WAAAA,IAACqB,OAAAA,OAAM,CAAClB,OAAO,QAAQmB,OAAK,EAAChB,MAAOiB,UAAaA,gBAAK3B,KAAeZ,IACnE,KACHC,EAAYkC,MAAQlC,EAAYmC,GAC/BpB,WAAAC,IAACuB,cAAM,CACLrB,OAAO,QACPsB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET/B,UAAW,CACT4B,WAAY,OACZE,UAAW,cAEbc,WAAY3C,EAAkBkC,QAAU,aAAUF,KAC9CpB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBqC,QAClBlB,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAAC2B,sBAAU,CAACC,KAAK,QAAQC,QAAM,KAAKlC,KAAef,MAEnD,OACQ,IAGlB,CACEkD,YAtHmB,eAuHnBzB,MAAO0B,UAAAA"}
|
|
1
|
+
{"version":3,"file":"Notification.js","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\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 return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","jsxs","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"2aAwBMA,MAAAA,aAAmEC,gBAAAA,gBAIvEC,MAAAA,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,WAAAA,KAACC,MAAAA,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAACC,UAAI,CAACC,OAAO,QAAQC,KAAMC,UAAUA,WAAC1B,GAAS2B,MAAOC,UAAWA,cAAKX,KAAehB,MAGzFiB,WAAAW,KAACV,gBAAgB,CAAAC,SACfF,CAAAA,WAAAW,KAACV,cAAc,CAAAC,SACZb,CAAAA,EACCc,WAAAC,IAACQ,UAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFlB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,WAAAA,IAACS,KAAAA,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW7B,EAAQ,aAAU8B,EAC7BV,MAAOW,UAAWA,cACdrB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBkC,SAAWjC,EAAYkC,MAAQlC,EAAYmC,GAC5DvB,WAAAW,KAACV,eAAe,CAAAC,UACbf,EAAkBkC,QACjBlB,WAAAA,IAACqB,OAAAA,OAAM,CAAClB,OAAO,QAAQmB,OAAK,EAAChB,MAAOiB,UAAaA,gBAAK3B,KAAeZ,IACnE,KACHC,EAAYkC,MAAQlC,EAAYmC,GAC/BpB,WAAAC,IAACuB,cAAM,CACLrB,OAAO,QACPsB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET/B,UAAW,CACT4B,WAAY,OACZE,UAAW,cAEbc,WAAY3C,EAAkBkC,QAAU,aAAUF,KAC9CpB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBqC,QAClBlB,WAAAA,IAACF,MAAAA,OAAa,CAAAC,SACZC,WAAAC,IAAC2B,sBAAU,CAACC,KAAK,QAAQC,QAAM,KAAKlC,KAAef,MAEnD,OACQ,IAGlB,CACEkD,YAtHmB,eAuHnBzB,MAAO0B,UAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\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 return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"geAwBMA,MAAAA,aAAmEC,gBAIvEC,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,KAACC,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,IAACF,OAAa,CAAAC,SACZC,IAACC,KAAI,CAACC,OAAO,QAAQC,KAAMC,WAAWzB,GAAS0B,MAAOC,cAAgBV,KAAehB,MAGzFiB,KAACC,UAAgB,CAAAC,SACfF,CAAAA,KAACC,QAAc,CAAAC,SACZb,CAAAA,EACCc,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFhB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW3B,EAAQ,aAAU4B,EAC7BT,MAAOU,cACHnB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBgC,SAAW/B,EAAYgC,MAAQhC,EAAYiC,GAC5DrB,KAACC,SAAe,CAAAC,UACbf,EAAkBgC,QACjBhB,IAACmB,OAAM,CAACjB,OAAO,QAAQkB,OAAK,EAACf,MAAOgB,gBAAkBzB,KAAeZ,IACnE,KACHC,EAAYgC,MAAQhC,EAAYiC,GAC/BlB,IAACsB,OAAM,CACLpB,OAAO,QACPqB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET7B,UAAW,CACT0B,WAAY,OACZE,UAAW,cAEbc,WAAYzC,EAAkBgC,QAAU,aAAUF,KAC9ClB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBmC,QAClBhB,IAACF,OAAa,CAAAC,SACZC,IAAC0B,WAAU,CAACC,KAAK,QAAQC,QAAM,KAAKhC,KAAef,MAEnD,OACQ,IAGlB,CACEgD,YAtHmB,eAuHnBxB,MAAOyB"}
|
|
1
|
+
{"version":3,"file":"Notification.mjs","sources":["../../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { IconButton } from 'components/IconButton'\nimport { Button } from 'components/Button'\nimport { Anchor } from 'components/Anchor'\nimport { Text } from 'components/Text'\nimport { SIZES, SIZES_ICON, SIZES_TEXT, ICON_NAMES, SIZES_ACTION } from './constants'\nimport * as Styled from './style'\nimport type { NotificationProps } from './types'\n\nconst COMPONENT_NAME = 'Notification'\n\n/**\n *\n * Компонент поддерживает все атрибуты \\<div\\> элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Notification/types.ts).\n */\nconst Notification: React.ForwardRefExoticComponent<NotificationProps> = withMergedProps<\n NotificationProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<NotificationProps>>((props, ref) => {\n const {\n size = 'm',\n status = 'system',\n iconProps = {},\n discardButtonProps = {},\n titleProps = {},\n textProps = {},\n actionButtonProps = {},\n anchorProps = {},\n title,\n text,\n hideIcon,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\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 return (\n <Styled.Root {...restProps} {...sizeProps} status={status} ref={ref}>\n {!hideIcon && (\n <Styled.Spacer>\n <Icon preset='brand' name={ICON_NAMES[status]} sizes={SIZES_ICON} {...sizeProps} {...iconProps} />\n </Styled.Spacer>\n )}\n <Styled.Container>\n <Styled.Content>\n {title ? (\n <Text\n as='p'\n appearance='body'\n weight={700}\n wordBreak='break-word'\n color='content-onmain-primary'\n {...sizeProps}\n {...titleProps}\n >\n {title}\n </Text>\n ) : null}\n {text ? (\n <Text\n as='p'\n appearance='body'\n wordBreak='break-word'\n color='content-onmain-primary'\n marginTop={title ? '0.2em' : undefined}\n sizes={SIZES_TEXT}\n {...sizeProps}\n {...textProps}\n >\n {text}\n </Text>\n ) : null}\n </Styled.Content>\n {actionButtonProps.onClick || anchorProps.href || anchorProps.to ? (\n <Styled.Controls>\n {actionButtonProps.onClick ? (\n <Button preset='brand' black sizes={SIZES_ACTION} {...sizeProps} {...actionButtonProps} />\n ) : null}\n {anchorProps.href || anchorProps.to ? (\n <Anchor\n preset='brand'\n underline\n palette={{\n color: 'content-onmain-primary',\n }}\n textProps={{\n appearance: 'body',\n wordBreak: 'break-word',\n }}\n marginLeft={actionButtonProps.onClick ? '0.6em' : undefined}\n {...sizeProps}\n {...anchorProps}\n />\n ) : null}\n </Styled.Controls>\n ) : null}\n </Styled.Container>\n {discardButtonProps.onClick ? (\n <Styled.Spacer>\n <IconButton icon='close' square {...sizeProps} {...discardButtonProps} />\n </Styled.Spacer>\n ) : null}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Notification }\n"],"names":["Notification","withMergedProps","forwardRef","props","ref","size","status","iconProps","discardButtonProps","titleProps","textProps","actionButtonProps","anchorProps","title","text","hideIcon","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","restProps","sizeProps","_jsxs","Styled","children","_jsx","Icon","preset","name","ICON_NAMES","sizes","SIZES_ICON","Text","as","appearance","weight","wordBreak","color","marginTop","undefined","SIZES_TEXT","onClick","href","to","Button","black","SIZES_ACTION","Anchor","underline","palette","marginLeft","IconButton","icon","square","displayName","SIZES"],"mappings":"geAwBMA,MAAAA,aAAmEC,gBAIvEC,YAA2D,CAACC,EAAOC,KACjE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,SAAQC,UACjBA,EAAY,CAAE,EAAAC,mBACdA,EAAqB,CAAE,EAAAC,WACvBA,EAAa,CAAE,EAAAC,UACfA,EAAY,CAAE,EAAAC,kBACdA,EAAoB,CAAE,EAAAC,YACtBA,EAAc,CAAE,EAAAC,MAChBA,EAAKC,KACLA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,KACGC,GACDnB,EAEJ,MAAMoB,EAAY,CAChBlB,OACAW,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,OACEG,KAACC,KAAW,IAAKH,KAAeC,EAAWjB,OAAQA,EAAQF,IAAKA,EAAIsB,SAAA,EAChEX,GACAY,IAACF,OAAa,CAAAC,SACZC,IAACC,KAAI,CAACC,OAAO,QAAQC,KAAMC,WAAWzB,GAAS0B,MAAOC,cAAgBV,KAAehB,MAGzFiB,KAACC,UAAgB,CAAAC,SACfF,CAAAA,KAACC,QAAc,CAAAC,SACZb,CAAAA,EACCc,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXC,OAAQ,IACRC,UAAU,aACVC,MAAM,4BACFhB,KACAd,EAAUiB,SAEbb,IAED,KACHC,EACCa,IAACO,KAAI,CACHC,GAAG,IACHC,WAAW,OACXE,UAAU,aACVC,MAAM,yBACNC,UAAW3B,EAAQ,aAAU4B,EAC7BT,MAAOU,cACHnB,KACAb,EAASgB,SAEZZ,IAED,QAELH,EAAkBgC,SAAW/B,EAAYgC,MAAQhC,EAAYiC,GAC5DrB,KAACC,SAAe,CAAAC,UACbf,EAAkBgC,QACjBhB,IAACmB,OAAM,CAACjB,OAAO,QAAQkB,OAAK,EAACf,MAAOgB,gBAAkBzB,KAAeZ,IACnE,KACHC,EAAYgC,MAAQhC,EAAYiC,GAC/BlB,IAACsB,OAAM,CACLpB,OAAO,QACPqB,WAAS,EACTC,QAAS,CACPZ,MAAO,0BAET7B,UAAW,CACT0B,WAAY,OACZE,UAAW,cAEbc,WAAYzC,EAAkBgC,QAAU,aAAUF,KAC9ClB,KACAX,IAEJ,QAEJ,QAELJ,EAAmBmC,QAClBhB,IAACF,OAAa,CAAAC,SACZC,IAAC0B,WAAU,CAACC,KAAK,QAAQC,QAAM,KAAKhC,KAAef,MAEnD,OACQ,IAGlB,CACEgD,YAtHmB,eAuHnBxB,MAAOyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paper.js","sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport type { SpacerProps } from 'components/Spacer'\nimport * as Styled from './style'\n\nexport interface PaperProps extends SpacerProps, ColorProperty, ResponsiveNamedProperty<'padding'> {\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: false | 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\
|
|
1
|
+
{"version":3,"file":"Paper.js","sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport type { SpacerProps } from 'components/Spacer'\nimport * as Styled from './style'\n\nexport interface PaperProps extends SpacerProps, ColorProperty, ResponsiveNamedProperty<'padding'> {\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: false | 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\nfunction Paper({ padding = 'm', rounded = true, shadow = true, className, ...props }: PaperProps) {\n const _className = useClassname(Paper.displayName, className)\n\n return <Styled.Root padding={padding} rounded={rounded} shadow={shadow} className={_className} {...props} />\n}\n\nPaper.displayName = 'Paper'\n\nexport { Paper }\n"],"names":["Paper","padding","rounded","shadow","className","props","_className","useClassname","displayName","_jsx","Styled"],"mappings":"iJA6BA,SAASA,OAAMC,QAAEA,EAAU,IAAGC,QAAEA,GAAU,EAAIC,OAAEA,GAAS,EAAIC,UAAEA,KAAcC,IAC3E,MAAMC,EAAaC,aAAYA,aAACP,MAAMQ,YAAaJ,GAEnD,OAAOK,WAAAA,IAACC,MAAAA,KAAW,CAACT,QAASA,EAASC,QAASA,EAASC,OAAQA,EAAQC,UAAWE,KAAgBD,GACrG,CAEAL,MAAMQ,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paper.mjs","sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport type { SpacerProps } from 'components/Spacer'\nimport * as Styled from './style'\n\nexport interface PaperProps extends SpacerProps, ColorProperty, ResponsiveNamedProperty<'padding'> {\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: false | 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\
|
|
1
|
+
{"version":3,"file":"Paper.mjs","sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import type { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport type { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport type { SpacerProps } from 'components/Spacer'\nimport * as Styled from './style'\n\nexport interface PaperProps extends SpacerProps, ColorProperty, ResponsiveNamedProperty<'padding'> {\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: false | 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\nfunction Paper({ padding = 'm', rounded = true, shadow = true, className, ...props }: PaperProps) {\n const _className = useClassname(Paper.displayName, className)\n\n return <Styled.Root padding={padding} rounded={rounded} shadow={shadow} className={_className} {...props} />\n}\n\nPaper.displayName = 'Paper'\n\nexport { Paper }\n"],"names":["Paper","padding","rounded","shadow","className","props","_className","useClassname","displayName","_jsx","Styled"],"mappings":"wHA6BA,SAASA,OAAMC,QAAEA,EAAU,IAAGC,QAAEA,GAAU,EAAIC,OAAEA,GAAS,EAAIC,UAAEA,KAAcC,IAC3E,MAAMC,EAAaC,aAAaP,MAAMQ,YAAaJ,GAEnD,OAAOK,IAACC,KAAW,CAACT,QAASA,EAASC,QAASA,EAASC,OAAQA,EAAQC,UAAWE,KAAgBD,GACrG,CAEAL,MAAMQ,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ProgressSegmented } from 'components/Progress.Segmented'\nimport { ProgressCircle } from 'components/Progress.Circle'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, ColorProperty, ColorProperty<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ProgressSegmented } from 'components/Progress.Segmented'\nimport { ProgressCircle } from 'components/Progress.Circle'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, ColorProperty, ColorProperty<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\nfunction Progress(props: ProgressProps) {\n const { className, isLoading, backgroundColor, color, percent } = props\n\n let _percent: number = typeof percent === 'string' ? parseInt(percent, 10) : percent || 0\n\n if (_percent > 100) _percent = 100\n if (_percent < 0) _percent = 0\n\n return (\n <Styled.Root className={className} backgroundColor={backgroundColor} color={color}>\n <Styled.Bar width={_percent} isLoading={Boolean(isLoading)} />\n </Styled.Root>\n )\n}\n\nProgress.defaultProps = {\n percent: 0,\n color: 'green',\n backgroundColor: 'alto',\n isLoading: false,\n}\n\nProgress.Circle = ProgressCircle\nProgress.Segmented = ProgressSegmented\nProgress.displayName = 'Progress'\n\nexport { Progress }\n"],"names":["Progress","props","className","isLoading","backgroundColor","color","percent","_percent","parseInt","_jsx","Styled","children","jsx","width","Boolean","defaultProps","Circle","ProgressCircle","Segmented","ProgressSegmented","displayName"],"mappings":"4OAcA,SAASA,SAASC,GAChB,MAAMC,UAAEA,EAASC,UAAEA,EAASC,gBAAEA,EAAeC,MAAEA,EAAKC,QAAEA,GAAYL,EAElE,IAAIM,SAA0BD,GAAY,SAAWE,SAASF,EAAS,IAAMA,GAAW,EAKxF,OAHIC,EAAW,MAAKA,EAAW,KAC3BA,EAAW,IAAGA,EAAW,GAG3BE,WAAAA,IAACC,MAAAA,KAAW,CAACR,UAAWA,EAAWE,gBAAiBA,EAAiBC,MAAOA,EAAMM,SAChFF,WAAAG,IAACF,UAAU,CAACG,MAAON,EAAUJ,UAAWW,QAAQX,MAGtD,CAEAH,SAASe,aAAe,CACtBT,QAAS,EACTD,MAAO,QACPD,gBAAiB,OACjBD,WAAW,GAGbH,SAASgB,OAASC,gBAAAA,eAClBjB,SAASkB,UAAYC,mBAAAA,kBACrBnB,SAASoB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.mjs","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ProgressSegmented } from 'components/Progress.Segmented'\nimport { ProgressCircle } from 'components/Progress.Circle'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, ColorProperty, ColorProperty<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.mjs","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ProgressSegmented } from 'components/Progress.Segmented'\nimport { ProgressCircle } from 'components/Progress.Circle'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, ColorProperty, ColorProperty<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\nfunction Progress(props: ProgressProps) {\n const { className, isLoading, backgroundColor, color, percent } = props\n\n let _percent: number = typeof percent === 'string' ? parseInt(percent, 10) : percent || 0\n\n if (_percent > 100) _percent = 100\n if (_percent < 0) _percent = 0\n\n return (\n <Styled.Root className={className} backgroundColor={backgroundColor} color={color}>\n <Styled.Bar width={_percent} isLoading={Boolean(isLoading)} />\n </Styled.Root>\n )\n}\n\nProgress.defaultProps = {\n percent: 0,\n color: 'green',\n backgroundColor: 'alto',\n isLoading: false,\n}\n\nProgress.Circle = ProgressCircle\nProgress.Segmented = ProgressSegmented\nProgress.displayName = 'Progress'\n\nexport { Progress }\n"],"names":["Progress","props","className","isLoading","backgroundColor","color","percent","_percent","parseInt","_jsx","Styled","children","width","Boolean","defaultProps","Circle","ProgressCircle","Segmented","ProgressSegmented","displayName"],"mappings":"oNAcA,SAASA,SAASC,GAChB,MAAMC,UAAEA,EAASC,UAAEA,EAASC,gBAAEA,EAAeC,MAAEA,EAAKC,QAAEA,GAAYL,EAElE,IAAIM,SAA0BD,GAAY,SAAWE,SAASF,EAAS,IAAMA,GAAW,EAKxF,OAHIC,EAAW,MAAKA,EAAW,KAC3BA,EAAW,IAAGA,EAAW,GAG3BE,IAACC,KAAW,CAACR,UAAWA,EAAWE,gBAAiBA,EAAiBC,MAAOA,EAAMM,SAChFF,IAACC,IAAU,CAACE,MAAOL,EAAUJ,UAAWU,QAAQV,MAGtD,CAEAH,SAASc,aAAe,CACtBR,QAAS,EACTD,MAAO,QACPD,gBAAiB,OACjBD,WAAW,GAGbH,SAASe,OAASC,eAClBhB,SAASiB,UAAYC,kBACrBlB,SAASmB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.Circle.js","sources":["../../../../src/components/Progress.Circle/Progress.Circle.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nfunction polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number) {\n const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0\n\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians),\n }\n}\n\nfunction describeArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, reverse = false) {\n const start = polarToCartesian(x, y, radius, endAngle)\n const end = polarToCartesian(x, y, radius, startAngle)\n\n const diff = endAngle - startAngle\n const angleDiff = diff < 0 ? -diff : diff\n\n const sweep = angleDiff <= 180 ? '1' : '0'\n const arcSweep = reverse ? +!+sweep : sweep\n\n return ['M', start.x, start.y, 'A', radius, radius, 0, arcSweep, 0, end.x, end.y].join(' ')\n}\n\nexport interface ProgressCircleProps extends BaseProps, ColorProperty<'resultColor'>, ColorProperty<'strokeBGColor'> {\n /**\n * status ['fail', 'success', 'started']\n */\n status?: 'fail' | 'success' | 'started'\n /**\n * progress percent\n */\n progress?: number\n /**\n * width and height\n */\n size?: number\n /**\n * React children\n */\n children?: React.ReactNode\n /**\n * width progress line\n */\n strokeLineWidth?: number\n /**\n * width background line\n */\n strokeBGWidth?: number\n /**\n * start angle of progress\n */\n progressStartAngle?: number\n /**\n * @ignore @deprecated Use children\n */\n content?: string | number\n}\n\ninterface ProgressCircleState {\n bgAngleDiff: number\n describeArcProgress: string | null\n describeArcBg: string | null\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.Circle.js","sources":["../../../../src/components/Progress.Circle/Progress.Circle.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nfunction polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number) {\n const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0\n\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians),\n }\n}\n\nfunction describeArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, reverse = false) {\n const start = polarToCartesian(x, y, radius, endAngle)\n const end = polarToCartesian(x, y, radius, startAngle)\n\n const diff = endAngle - startAngle\n const angleDiff = diff < 0 ? -diff : diff\n\n const sweep = angleDiff <= 180 ? '1' : '0'\n const arcSweep = reverse ? +!+sweep : sweep\n\n return ['M', start.x, start.y, 'A', radius, radius, 0, arcSweep, 0, end.x, end.y].join(' ')\n}\n\nexport interface ProgressCircleProps extends BaseProps, ColorProperty<'resultColor'>, ColorProperty<'strokeBGColor'> {\n /**\n * status ['fail', 'success', 'started']\n */\n status?: 'fail' | 'success' | 'started'\n /**\n * progress percent\n */\n progress?: number\n /**\n * width and height\n */\n size?: number\n /**\n * React children\n */\n children?: React.ReactNode\n /**\n * width progress line\n */\n strokeLineWidth?: number\n /**\n * width background line\n */\n strokeBGWidth?: number\n /**\n * start angle of progress\n */\n progressStartAngle?: number\n /**\n * @ignore @deprecated Use children\n */\n content?: string | number\n}\n\ninterface ProgressCircleState {\n bgAngleDiff: number\n describeArcProgress: string | null\n describeArcBg: string | null\n}\n\nexport class ProgressCircle extends PureComponent<\n typeof ProgressCircle.defaultProps & ProgressCircleProps,\n ProgressCircleState\n> {\n static displayName = 'Progress.Circle'\n static defaultProps = {\n size: 84,\n progress: 0,\n strokeLineWidth: 2,\n strokeBGWidth: 2,\n resultColor: 'accent',\n progressStartAngle: 180,\n }\n\n constructor(props: typeof ProgressCircle.defaultProps & ProgressCircleProps) {\n super(props)\n this.state = {\n bgAngleDiff: 0,\n describeArcProgress: null,\n describeArcBg: null,\n }\n }\n\n componentDidMount() {\n this.renderSvg()\n }\n\n componentDidUpdate(prevProps: ProgressCircleProps) {\n const { progress, size } = this.props\n const { progress: prevProgress, size: prevSize } = prevProps\n\n if (progress !== prevProgress || size !== prevSize) {\n this.renderSvg()\n }\n }\n\n renderSvg = () => {\n const { size, progress, strokeLineWidth, strokeBGWidth, progressStartAngle } = this.props\n\n const thickness = strokeLineWidth > strokeBGWidth ? strokeLineWidth : strokeBGWidth\n\n const center = size / 2 + thickness / 2\n const progressGap = 0.5\n const progressEndAngle = progressStartAngle - progressGap + (+progress / 100) * 360\n const bgStartAngle = progressStartAngle\n const bgEndAngle = bgStartAngle - progressGap\n\n const centerX = center - thickness / 2\n const centerY = center - thickness / 2\n const radius = center - thickness\n const diff = bgStartAngle - bgEndAngle\n\n const describeArcProgress = describeArc(centerX, centerY, radius, progressStartAngle, progressEndAngle, true)\n\n const describeArcBg = describeArc(centerX, centerY, radius, bgStartAngle, bgEndAngle)\n\n const bgAngleDiff = diff < 0 ? -diff : diff\n\n this.setState({\n describeArcProgress,\n describeArcBg,\n bgAngleDiff,\n })\n }\n\n render() {\n const {\n size,\n children,\n content,\n strokeLineWidth,\n strokeBGWidth,\n resultColor,\n strokeBGColor,\n status,\n progress,\n className,\n style,\n } = this.props\n\n const { bgAngleDiff, describeArcProgress, describeArcBg } = this.state\n\n return (\n <Styled.Root\n className={className}\n style={style}\n size={size}\n strokeBGColor={strokeBGColor}\n resultColor={resultColor}\n status={status}\n >\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n <g className={'pathBox'}>\n <path\n className='bg'\n d={bgAngleDiff < 360 && describeArcBg ? describeArcBg : ''}\n fill='none'\n strokeWidth={strokeBGWidth}\n strokeLinecap='round'\n />\n <path\n className='line'\n d={Boolean(+progress) && describeArcProgress ? describeArcProgress : ''}\n strokeWidth={strokeLineWidth}\n strokeLinecap='round'\n />\n </g>\n </svg>\n {children || content ? <Styled.Content>{children || content}</Styled.Content> : null}\n </Styled.Root>\n )\n }\n}\n"],"names":["polarToCartesian","centerX","centerY","radius","angleInDegrees","angleInRadians","Math","PI","x","cos","y","sin","describeArc","startAngle","endAngle","reverse","start","end","diff","sweep","join","ProgressCircle","PureComponent","static","size","progress","strokeLineWidth","strokeBGWidth","resultColor","progressStartAngle","constructor","props","super","this","state","bgAngleDiff","describeArcProgress","describeArcBg","componentDidMount","renderSvg","componentDidUpdate","prevProps","prevProgress","prevSize","thickness","center","bgStartAngle","bgEndAngle","setState","render","children","content","strokeBGColor","status","className","style","_jsxs","Styled","_jsx","jsx","width","height","viewBox","jsxs","d","fill","strokeWidth","strokeLinecap","Boolean"],"mappings":"oHAKA,SAASA,iBAAiBC,EAAiBC,EAAiBC,EAAgBC,GAC1E,MAAMC,GAAmBD,EAAiB,IAAME,KAAKC,GAAM,IAE3D,MAAO,CACLC,EAAGP,EAAUE,EAASG,KAAKG,IAAIJ,GAC/BK,EAAGR,EAAUC,EAASG,KAAKK,IAAIN,GAEnC,CAEA,SAASO,YAAYJ,EAAWE,EAAWP,EAAgBU,EAAoBC,EAAkBC,GAAU,GACzG,MAAMC,EAAQhB,iBAAiBQ,EAAGE,EAAGP,EAAQW,GAC7C,MAAMG,EAAMjB,iBAAiBQ,EAAGE,EAAGP,EAAQU,GAE3C,MAAMK,EAAOJ,EAAWD,EAGxB,MAAMM,GAFYD,EAAO,GAAKA,EAAOA,IAEV,IAAM,IAAM,IAGvC,MAAO,CAAC,IAAKF,EAAMR,EAAGQ,EAAMN,EAAG,IAAKP,EAAQA,EAAQ,EAFnCY,KAAaI,EAAQA,EAE2B,EAAGF,EAAIT,EAAGS,EAAIP,GAAGU,KAAK,IACzF,wBA2CO,MAAMC,uBAAuBC,MAAAA,cAIlCC,mBAAqB,kBACrBA,oBAAsB,CACpBC,KAAM,GACNC,SAAU,EACVC,gBAAiB,EACjBC,cAAe,EACfC,YAAa,SACbC,mBAAoB,KAGtBC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CACXC,YAAa,EACbC,oBAAqB,KACrBC,cAAe,KAEnB,CAEAC,iBAAAA,GACEL,KAAKM,WACP,CAEAC,kBAAAA,CAAmBC,GACjB,MAAMhB,SAAEA,EAAQD,KAAEA,GAASS,KAAKF,MAChC,MAAQN,SAAUiB,EAAclB,KAAMmB,GAAaF,EAE/ChB,IAAaiB,GAAgBlB,IAASmB,GACxCV,KAAKM,WAET,CAEAA,UAAYA,KACV,MAAMf,KAAEA,EAAIC,SAAEA,EAAQC,gBAAEA,EAAeC,cAAEA,EAAaE,mBAAEA,GAAuBI,KAAKF,MAEpF,MAAMa,EAAYlB,EAAkBC,EAAgBD,EAAkBC,EAEtE,MAAMkB,EAASrB,EAAO,EAAIoB,EAAY,EAGtC,MAAME,EAAejB,EACrB,MAAMkB,EAAaD,EAHC,GAKpB,MAAM7C,EAAU4C,EAASD,EAAY,EACrC,MAAM1C,EAAU2C,EAASD,EAAY,EACrC,MAAMzC,EAAS0C,EAASD,EACxB,MAAM1B,EAAO4B,EAAeC,EAE5B,MAAMX,EAAsBxB,YAAYX,EAASC,EAASC,EAAQ0B,EATzCA,EADL,KAC0CJ,EAAW,IAAO,KASwB,GAExG,MAAMY,EAAgBzB,YAAYX,EAASC,EAASC,EAAQ2C,EAAcC,GAI1Ed,KAAKe,SAAS,CACZZ,sBACAC,gBACAF,YALkBjB,EAAO,GAAKA,EAAOA,GAMrC,EAGJ+B,MAAAA,GACE,MAAMzB,KACJA,EAAI0B,SACJA,EAAQC,QACRA,EAAOzB,gBACPA,EAAeC,cACfA,EAAaC,YACbA,EAAWwB,cACXA,EAAaC,OACbA,EAAM5B,SACNA,EAAQ6B,UACRA,EACAC,MAAAA,GACEtB,KAAKF,MAET,MAAMI,YAAEA,EAAWC,oBAAEA,EAAmBC,cAAEA,GAAkBJ,KAAKC,MAEjE,OACEsB,WAAAA,KAACC,MAAAA,KAAW,CACVH,UAAWA,EACXC,MAAOA,EACP/B,KAAMA,EACN4B,cAAeA,EACfxB,YAAaA,EACbyB,OAAQA,EAAOH,UAEfQ,WAAAC,IAAA,MAAA,CAAKC,MAAOpC,EAAMqC,OAAQrC,EAAMsC,QAAS,OAAOtC,KAAQA,IAAO0B,SAC7DM,WAAAO,KAAA,IAAA,CAAGT,UAAW,UAAUJ,UACtBQ,WAAAC,IAAA,OAAA,CACEL,UAAU,KACVU,EAAG7B,EAAc,KAAOE,EAAgBA,EAAgB,GACxD4B,KAAK,OACLC,YAAavC,EACbwC,cAAc,UAEhBT,WAAAC,IAAA,OAAA,CACEL,UAAU,OACVU,EAAGI,SAAS3C,IAAaW,EAAsBA,EAAsB,GACrE8B,YAAaxC,EACbyC,cAAc,eAInBjB,GAAYC,EAAUO,WAAAA,IAACD,MAAAA,QAAc,CAAAP,SAAEA,GAAYC,IAA4B,OAGtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.Circle.mjs","sources":["../../../../src/components/Progress.Circle/Progress.Circle.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nfunction polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number) {\n const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0\n\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians),\n }\n}\n\nfunction describeArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, reverse = false) {\n const start = polarToCartesian(x, y, radius, endAngle)\n const end = polarToCartesian(x, y, radius, startAngle)\n\n const diff = endAngle - startAngle\n const angleDiff = diff < 0 ? -diff : diff\n\n const sweep = angleDiff <= 180 ? '1' : '0'\n const arcSweep = reverse ? +!+sweep : sweep\n\n return ['M', start.x, start.y, 'A', radius, radius, 0, arcSweep, 0, end.x, end.y].join(' ')\n}\n\nexport interface ProgressCircleProps extends BaseProps, ColorProperty<'resultColor'>, ColorProperty<'strokeBGColor'> {\n /**\n * status ['fail', 'success', 'started']\n */\n status?: 'fail' | 'success' | 'started'\n /**\n * progress percent\n */\n progress?: number\n /**\n * width and height\n */\n size?: number\n /**\n * React children\n */\n children?: React.ReactNode\n /**\n * width progress line\n */\n strokeLineWidth?: number\n /**\n * width background line\n */\n strokeBGWidth?: number\n /**\n * start angle of progress\n */\n progressStartAngle?: number\n /**\n * @ignore @deprecated Use children\n */\n content?: string | number\n}\n\ninterface ProgressCircleState {\n bgAngleDiff: number\n describeArcProgress: string | null\n describeArcBg: string | null\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.Circle.mjs","sources":["../../../../src/components/Progress.Circle/Progress.Circle.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nfunction polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number) {\n const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0\n\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians),\n }\n}\n\nfunction describeArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, reverse = false) {\n const start = polarToCartesian(x, y, radius, endAngle)\n const end = polarToCartesian(x, y, radius, startAngle)\n\n const diff = endAngle - startAngle\n const angleDiff = diff < 0 ? -diff : diff\n\n const sweep = angleDiff <= 180 ? '1' : '0'\n const arcSweep = reverse ? +!+sweep : sweep\n\n return ['M', start.x, start.y, 'A', radius, radius, 0, arcSweep, 0, end.x, end.y].join(' ')\n}\n\nexport interface ProgressCircleProps extends BaseProps, ColorProperty<'resultColor'>, ColorProperty<'strokeBGColor'> {\n /**\n * status ['fail', 'success', 'started']\n */\n status?: 'fail' | 'success' | 'started'\n /**\n * progress percent\n */\n progress?: number\n /**\n * width and height\n */\n size?: number\n /**\n * React children\n */\n children?: React.ReactNode\n /**\n * width progress line\n */\n strokeLineWidth?: number\n /**\n * width background line\n */\n strokeBGWidth?: number\n /**\n * start angle of progress\n */\n progressStartAngle?: number\n /**\n * @ignore @deprecated Use children\n */\n content?: string | number\n}\n\ninterface ProgressCircleState {\n bgAngleDiff: number\n describeArcProgress: string | null\n describeArcBg: string | null\n}\n\nexport class ProgressCircle extends PureComponent<\n typeof ProgressCircle.defaultProps & ProgressCircleProps,\n ProgressCircleState\n> {\n static displayName = 'Progress.Circle'\n static defaultProps = {\n size: 84,\n progress: 0,\n strokeLineWidth: 2,\n strokeBGWidth: 2,\n resultColor: 'accent',\n progressStartAngle: 180,\n }\n\n constructor(props: typeof ProgressCircle.defaultProps & ProgressCircleProps) {\n super(props)\n this.state = {\n bgAngleDiff: 0,\n describeArcProgress: null,\n describeArcBg: null,\n }\n }\n\n componentDidMount() {\n this.renderSvg()\n }\n\n componentDidUpdate(prevProps: ProgressCircleProps) {\n const { progress, size } = this.props\n const { progress: prevProgress, size: prevSize } = prevProps\n\n if (progress !== prevProgress || size !== prevSize) {\n this.renderSvg()\n }\n }\n\n renderSvg = () => {\n const { size, progress, strokeLineWidth, strokeBGWidth, progressStartAngle } = this.props\n\n const thickness = strokeLineWidth > strokeBGWidth ? strokeLineWidth : strokeBGWidth\n\n const center = size / 2 + thickness / 2\n const progressGap = 0.5\n const progressEndAngle = progressStartAngle - progressGap + (+progress / 100) * 360\n const bgStartAngle = progressStartAngle\n const bgEndAngle = bgStartAngle - progressGap\n\n const centerX = center - thickness / 2\n const centerY = center - thickness / 2\n const radius = center - thickness\n const diff = bgStartAngle - bgEndAngle\n\n const describeArcProgress = describeArc(centerX, centerY, radius, progressStartAngle, progressEndAngle, true)\n\n const describeArcBg = describeArc(centerX, centerY, radius, bgStartAngle, bgEndAngle)\n\n const bgAngleDiff = diff < 0 ? -diff : diff\n\n this.setState({\n describeArcProgress,\n describeArcBg,\n bgAngleDiff,\n })\n }\n\n render() {\n const {\n size,\n children,\n content,\n strokeLineWidth,\n strokeBGWidth,\n resultColor,\n strokeBGColor,\n status,\n progress,\n className,\n style,\n } = this.props\n\n const { bgAngleDiff, describeArcProgress, describeArcBg } = this.state\n\n return (\n <Styled.Root\n className={className}\n style={style}\n size={size}\n strokeBGColor={strokeBGColor}\n resultColor={resultColor}\n status={status}\n >\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n <g className={'pathBox'}>\n <path\n className='bg'\n d={bgAngleDiff < 360 && describeArcBg ? describeArcBg : ''}\n fill='none'\n strokeWidth={strokeBGWidth}\n strokeLinecap='round'\n />\n <path\n className='line'\n d={Boolean(+progress) && describeArcProgress ? describeArcProgress : ''}\n strokeWidth={strokeLineWidth}\n strokeLinecap='round'\n />\n </g>\n </svg>\n {children || content ? <Styled.Content>{children || content}</Styled.Content> : null}\n </Styled.Root>\n )\n }\n}\n"],"names":["polarToCartesian","centerX","centerY","radius","angleInDegrees","angleInRadians","Math","PI","x","cos","y","sin","describeArc","startAngle","endAngle","reverse","start","end","diff","sweep","join","ProgressCircle","PureComponent","static","size","progress","strokeLineWidth","strokeBGWidth","resultColor","progressStartAngle","constructor","props","super","this","state","bgAngleDiff","describeArcProgress","describeArcBg","componentDidMount","renderSvg","componentDidUpdate","prevProps","prevProgress","prevSize","thickness","center","bgStartAngle","bgEndAngle","setState","render","children","content","strokeBGColor","status","className","style","_jsxs","Styled","_jsx","width","height","viewBox","d","fill","strokeWidth","strokeLinecap","Boolean"],"mappings":"+GAKA,SAASA,iBAAiBC,EAAiBC,EAAiBC,EAAgBC,GAC1E,MAAMC,GAAmBD,EAAiB,IAAME,KAAKC,GAAM,IAE3D,MAAO,CACLC,EAAGP,EAAUE,EAASG,KAAKG,IAAIJ,GAC/BK,EAAGR,EAAUC,EAASG,KAAKK,IAAIN,GAEnC,CAEA,SAASO,YAAYJ,EAAWE,EAAWP,EAAgBU,EAAoBC,EAAkBC,GAAU,GACzG,MAAMC,EAAQhB,iBAAiBQ,EAAGE,EAAGP,EAAQW,GAC7C,MAAMG,EAAMjB,iBAAiBQ,EAAGE,EAAGP,EAAQU,GAE3C,MAAMK,EAAOJ,EAAWD,EAGxB,MAAMM,GAFYD,EAAO,GAAKA,EAAOA,IAEV,IAAM,IAAM,IAGvC,MAAO,CAAC,IAAKF,EAAMR,EAAGQ,EAAMN,EAAG,IAAKP,EAAQA,EAAQ,EAFnCY,KAAaI,EAAQA,EAE2B,EAAGF,EAAIT,EAAGS,EAAIP,GAAGU,KAAK,IACzF,CA2CO,MAAMC,uBAAuBC,cAIlCC,mBAAqB,kBACrBA,oBAAsB,CACpBC,KAAM,GACNC,SAAU,EACVC,gBAAiB,EACjBC,cAAe,EACfC,YAAa,SACbC,mBAAoB,KAGtBC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CACXC,YAAa,EACbC,oBAAqB,KACrBC,cAAe,KAEnB,CAEAC,iBAAAA,GACEL,KAAKM,WACP,CAEAC,kBAAAA,CAAmBC,GACjB,MAAMhB,SAAEA,EAAQD,KAAEA,GAASS,KAAKF,MAChC,MAAQN,SAAUiB,EAAclB,KAAMmB,GAAaF,EAE/ChB,IAAaiB,GAAgBlB,IAASmB,GACxCV,KAAKM,WAET,CAEAA,UAAYA,KACV,MAAMf,KAAEA,EAAIC,SAAEA,EAAQC,gBAAEA,EAAeC,cAAEA,EAAaE,mBAAEA,GAAuBI,KAAKF,MAEpF,MAAMa,EAAYlB,EAAkBC,EAAgBD,EAAkBC,EAEtE,MAAMkB,EAASrB,EAAO,EAAIoB,EAAY,EAGtC,MAAME,EAAejB,EACrB,MAAMkB,EAAaD,EAHC,GAKpB,MAAM7C,EAAU4C,EAASD,EAAY,EACrC,MAAM1C,EAAU2C,EAASD,EAAY,EACrC,MAAMzC,EAAS0C,EAASD,EACxB,MAAM1B,EAAO4B,EAAeC,EAE5B,MAAMX,EAAsBxB,YAAYX,EAASC,EAASC,EAAQ0B,EATzCA,EADL,KAC0CJ,EAAW,IAAO,KASwB,GAExG,MAAMY,EAAgBzB,YAAYX,EAASC,EAASC,EAAQ2C,EAAcC,GAI1Ed,KAAKe,SAAS,CACZZ,sBACAC,gBACAF,YALkBjB,EAAO,GAAKA,EAAOA,GAMrC,EAGJ+B,MAAAA,GACE,MAAMzB,KACJA,EAAI0B,SACJA,EAAQC,QACRA,EAAOzB,gBACPA,EAAeC,cACfA,EAAaC,YACbA,EAAWwB,cACXA,EAAaC,OACbA,EAAM5B,SACNA,EAAQ6B,UACRA,EAASC,MACTA,GACEtB,KAAKF,MAET,MAAMI,YAAEA,EAAWC,oBAAEA,EAAmBC,cAAEA,GAAkBJ,KAAKC,MAEjE,OACEsB,KAACC,KAAW,CACVH,UAAWA,EACXC,MAAOA,EACP/B,KAAMA,EACN4B,cAAeA,EACfxB,YAAaA,EACbyB,OAAQA,EAAOH,UAEfQ,IAAA,MAAA,CAAKC,MAAOnC,EAAMoC,OAAQpC,EAAMqC,QAAS,OAAOrC,KAAQA,IAAO0B,SAC7DM,KAAA,IAAA,CAAGF,UAAW,UAAUJ,UACtBQ,IAAA,OAAA,CACEJ,UAAU,KACVQ,EAAG3B,EAAc,KAAOE,EAAgBA,EAAgB,GACxD0B,KAAK,OACLC,YAAarC,EACbsC,cAAc,UAEhBP,IAAA,OAAA,CACEJ,UAAU,OACVQ,EAAGI,SAASzC,IAAaW,EAAsBA,EAAsB,GACrE4B,YAAatC,EACbuC,cAAc,eAInBf,GAAYC,EAAUO,IAACD,QAAc,CAAAP,SAAEA,GAAYC,IAA4B,OAGtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.Segmented.js","sources":["../../../../src/components/Progress.Segmented/Progress.Segmented.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressSegmentedProps\n extends BaseProps,\n ColorProperty<'separatorColor'>,\n ColorProperty<'percentColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n /**\n * segments count\n */\n segments?: number\n /**\n * custom class\n */\n className?: string\n /**\n * circle in begin progress\n */\n haveCircle?: boolean\n /**\n * active state\n */\n isActive?: boolean\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.Segmented.js","sources":["../../../../src/components/Progress.Segmented/Progress.Segmented.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressSegmentedProps\n extends BaseProps,\n ColorProperty<'separatorColor'>,\n ColorProperty<'percentColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n /**\n * segments count\n */\n segments?: number\n /**\n * custom class\n */\n className?: string\n /**\n * circle in begin progress\n */\n haveCircle?: boolean\n /**\n * active state\n */\n isActive?: boolean\n}\n\nfunction ProgressSegmented(props: typeof ProgressSegmented.defaultProps & ProgressSegmentedProps) {\n const { percent, segments, className, style, percentColor, separatorColor, haveCircle, isActive } = props\n\n return (\n <Styled.Root\n className={className}\n style={style}\n percent={percent}\n haveCircle={haveCircle}\n percentColor={percentColor}\n isActive={isActive}\n >\n <Styled.Progress percent={percent} percentColor={percentColor} />\n <Styled.Separators>\n {Array.from(new Array(segments + 1).keys()).map((_, key) => (\n <Styled.Separator separatorColor={separatorColor} key={key} />\n ))}\n </Styled.Separators>\n </Styled.Root>\n )\n}\n\nProgressSegmented.defaultProps = {\n percent: 0,\n percentColor: '#7fc92e',\n separatorColor: '#ffffff',\n segments: 9,\n haveCircle: true,\n}\n\nProgressSegmented.displayName = 'Progress.Segmented'\n\nexport { ProgressSegmented }\n"],"names":["ProgressSegmented","props","percent","segments","className","style","percentColor","separatorColor","haveCircle","isActive","_jsxs","Styled","children","_jsx","jsx","Array","from","keys","map","_","key","defaultProps","displayName"],"mappings":"yFA8BA,SAASA,kBAAkBC,GACzB,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,QAAWC,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,WAAEA,EAAUC,SAAEA,GAAaR,EAEpG,OACES,WAAAA,KAACC,MAAAA,KAAW,CACVP,UAAWA,EACXC,MAAOA,EACPH,QAASA,EACTM,WAAYA,EACZF,aAAcA,EACdG,SAAUA,EAASG,SAEnBC,CAAAA,WAAAC,IAACH,eAAe,CAACT,QAASA,EAASI,aAAcA,IACjDO,WAAAC,IAACH,iBAAiB,CAAAC,SACfG,MAAMC,KAAK,IAAID,MAAMZ,EAAW,GAAGc,QAAQC,KAAI,CAACC,EAAGC,IAClDP,WAAAA,IAACF,MAAAA,UAAgB,CAACJ,eAAgBA,GAAqBa,SAKjE,CAEApB,kBAAkBqB,aAAe,CAC/BnB,QAAS,EACTI,aAAc,UACdC,eAAgB,UAChBJ,SAAU,EACVK,YAAY,GAGdR,kBAAkBsB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.Segmented.mjs","sources":["../../../../src/components/Progress.Segmented/Progress.Segmented.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressSegmentedProps\n extends BaseProps,\n ColorProperty<'separatorColor'>,\n ColorProperty<'percentColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n /**\n * segments count\n */\n segments?: number\n /**\n * custom class\n */\n className?: string\n /**\n * circle in begin progress\n */\n haveCircle?: boolean\n /**\n * active state\n */\n isActive?: boolean\n}\n\
|
|
1
|
+
{"version":3,"file":"Progress.Segmented.mjs","sources":["../../../../src/components/Progress.Segmented/Progress.Segmented.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressSegmentedProps\n extends BaseProps,\n ColorProperty<'separatorColor'>,\n ColorProperty<'percentColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n /**\n * segments count\n */\n segments?: number\n /**\n * custom class\n */\n className?: string\n /**\n * circle in begin progress\n */\n haveCircle?: boolean\n /**\n * active state\n */\n isActive?: boolean\n}\n\nfunction ProgressSegmented(props: typeof ProgressSegmented.defaultProps & ProgressSegmentedProps) {\n const { percent, segments, className, style, percentColor, separatorColor, haveCircle, isActive } = props\n\n return (\n <Styled.Root\n className={className}\n style={style}\n percent={percent}\n haveCircle={haveCircle}\n percentColor={percentColor}\n isActive={isActive}\n >\n <Styled.Progress percent={percent} percentColor={percentColor} />\n <Styled.Separators>\n {Array.from(new Array(segments + 1).keys()).map((_, key) => (\n <Styled.Separator separatorColor={separatorColor} key={key} />\n ))}\n </Styled.Separators>\n </Styled.Root>\n )\n}\n\nProgressSegmented.defaultProps = {\n percent: 0,\n percentColor: '#7fc92e',\n separatorColor: '#ffffff',\n segments: 9,\n haveCircle: true,\n}\n\nProgressSegmented.displayName = 'Progress.Segmented'\n\nexport { ProgressSegmented }\n"],"names":["ProgressSegmented","props","percent","segments","className","style","percentColor","separatorColor","haveCircle","isActive","_jsxs","Styled","children","_jsx","Array","from","keys","map","_","key","defaultProps","displayName"],"mappings":"oGA8BA,SAASA,kBAAkBC,GACzB,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,MAAEA,EAAKC,aAAEA,EAAYC,eAAEA,EAAcC,WAAEA,EAAUC,SAAEA,GAAaR,EAEpG,OACES,KAACC,KAAW,CACVP,UAAWA,EACXC,MAAOA,EACPH,QAASA,EACTM,WAAYA,EACZF,aAAcA,EACdG,SAAUA,EAASG,SAEnBC,CAAAA,IAACF,SAAe,CAACT,QAASA,EAASI,aAAcA,IACjDO,IAACF,WAAiB,CAAAC,SACfE,MAAMC,KAAK,IAAID,MAAMX,EAAW,GAAGa,QAAQC,KAAI,CAACC,EAAGC,IAClDN,IAACF,UAAgB,CAACJ,eAAgBA,GAAqBY,SAKjE,CAEAnB,kBAAkBoB,aAAe,CAC/BlB,QAAS,EACTI,aAAc,UACdC,eAAgB,UAChBJ,SAAU,EACVK,YAAY,GAGdR,kBAAkBqB,YAAc"}
|