@foxford/ui 2.76.1-beta-3d975b5-20250715 → 2.77.0-beta-90a741d-20250807
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/LICENSE +27 -0
- package/components/Accordion/Accordion.js +1 -1
- package/components/Accordion/Accordion.js.map +1 -1
- package/components/Accordion/Accordion.mjs +1 -1
- package/components/Accordion/Accordion.mjs.map +1 -1
- package/components/Accordion/hooks.js +1 -1
- package/components/Accordion/hooks.js.map +1 -1
- package/components/Accordion/hooks.mjs +1 -1
- package/components/Accordion/hooks.mjs.map +1 -1
- package/components/AccordionItem/AccordionItem.js +1 -1
- package/components/AccordionItem/AccordionItem.js.map +1 -1
- package/components/AccordionItem/AccordionItem.mjs +1 -1
- package/components/AccordionItem/AccordionItem.mjs.map +1 -1
- package/components/ActionBtn/ActionBtn.js +1 -1
- package/components/ActionBtn/ActionBtn.js.map +1 -1
- package/components/ActionBtn/ActionBtn.mjs +1 -1
- package/components/ActionBtn/ActionBtn.mjs.map +1 -1
- package/components/ActionBtn/style.js.map +1 -1
- package/components/ActionBtn/style.mjs.map +1 -1
- package/components/Alert/Alert.js +1 -1
- package/components/Alert/Alert.js.map +1 -1
- package/components/Alert/Alert.mjs +1 -1
- package/components/Alert/Alert.mjs.map +1 -1
- package/components/Amount/Amount.js +1 -1
- package/components/Amount/Amount.js.map +1 -1
- package/components/Amount/Amount.mjs +1 -1
- package/components/Amount/Amount.mjs.map +1 -1
- package/components/Amount/data/index.js.map +1 -1
- package/components/Amount/data/index.mjs.map +1 -1
- package/components/Amount/style.js.map +1 -1
- package/components/Amount/style.mjs.map +1 -1
- package/components/Anchor/Anchor.js +1 -1
- package/components/Anchor/Anchor.js.map +1 -1
- package/components/Anchor/Anchor.mjs +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/AspectRatio/style.js.map +1 -1
- package/components/AspectRatio/style.mjs.map +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/Avatar.mjs +1 -1
- package/components/Avatar/Avatar.mjs.map +1 -1
- package/components/Avatar/utils.js.map +1 -1
- package/components/Avatar/utils.mjs.map +1 -1
- package/components/Badge/Badge.js +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/Badge.mjs +1 -1
- package/components/Badge/Badge.mjs.map +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Button/Button.mjs +1 -1
- package/components/Button/Button.mjs.map +1 -1
- package/components/Button/hooks.js.map +1 -1
- package/components/Button/hooks.mjs.map +1 -1
- package/components/Button/style.js.map +1 -1
- package/components/Button/style.mjs.map +1 -1
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/Checkbox.mjs +1 -1
- package/components/Checkbox/Checkbox.mjs.map +1 -1
- package/components/Chip/Chip.js +1 -1
- package/components/Chip/Chip.js.map +1 -1
- package/components/Chip/Chip.mjs +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/Container/style.js.map +1 -1
- package/components/Container/style.mjs.map +1 -1
- package/components/ContextMenu/ContextMenu.js +1 -1
- package/components/ContextMenu/ContextMenu.js.map +1 -1
- package/components/ContextMenu/ContextMenu.mjs +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/style.js.map +1 -1
- package/components/ContextMenu/style.mjs.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs.map +1 -1
- package/components/ContextMenu.Multilevel/Controls.js.map +1 -1
- package/components/ContextMenu.Multilevel/Controls.mjs.map +1 -1
- package/components/Dialog/Dialog.js.map +1 -1
- package/components/Dialog/Dialog.mjs.map +1 -1
- package/components/DialogComponent/DialogComponent.js +1 -1
- package/components/DialogComponent/DialogComponent.js.map +1 -1
- package/components/DialogComponent/DialogComponent.mjs +1 -1
- package/components/DialogComponent/DialogComponent.mjs.map +1 -1
- package/components/DialogComponent/style.js.map +1 -1
- package/components/DialogComponent/style.mjs.map +1 -1
- package/components/Divider/style.js.map +1 -1
- package/components/Divider/style.mjs.map +1 -1
- package/components/Dropdown/Dropdown.js +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.mjs +1 -1
- package/components/Dropdown/Dropdown.mjs.map +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.js +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.js.map +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.mjs +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.mjs.map +1 -1
- package/components/Dropdown/hooks.js.map +1 -1
- package/components/Dropdown/hooks.mjs.map +1 -1
- package/components/FormInput/FormInput.js.map +1 -1
- package/components/FormInput/FormInput.mjs.map +1 -1
- package/components/FormInputLabel/FormInputLabel.js +1 -1
- package/components/FormInputLabel/FormInputLabel.js.map +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs.map +1 -1
- package/components/FormLabel/FormLabel.js +1 -1
- package/components/FormLabel/FormLabel.js.map +1 -1
- package/components/FormLabel/FormLabel.mjs +1 -1
- package/components/FormLabel/FormLabel.mjs.map +1 -1
- package/components/Icon/Icon.js +1 -1
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/Icon.mjs +1 -1
- package/components/Icon/Icon.mjs.map +1 -1
- package/components/Icon/bg-worker.js.map +1 -1
- package/components/Icon/bg-worker.mjs.map +1 -1
- package/components/Icon/list/default.js.map +1 -1
- package/components/Icon/list/default.mjs.map +1 -1
- package/components/Icon/list/icon-pack.js.map +1 -1
- package/components/Icon/list/icon-pack.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 +1 -1
- package/components/Indicator/Indicator.js.map +1 -1
- package/components/Indicator/Indicator.mjs +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/helpers.js.map +1 -1
- package/components/Input/helpers.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 +1 -1
- package/components/ListItem/ListItem.js.map +1 -1
- package/components/ListItem/ListItem.mjs +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/MenuComponent/style.js +1 -1
- package/components/MenuComponent/style.js.map +1 -1
- package/components/MenuComponent/style.mjs +1 -1
- package/components/MenuComponent/style.mjs.map +1 -1
- package/components/MenuContainer/MenuContainer.js +1 -1
- package/components/MenuContainer/MenuContainer.js.map +1 -1
- package/components/MenuContainer/MenuContainer.mjs +1 -1
- package/components/MenuContainer/MenuContainer.mjs.map +1 -1
- package/components/MenuDivider/MenuDivider.js +1 -1
- package/components/MenuDivider/MenuDivider.js.map +1 -1
- package/components/MenuDivider/MenuDivider.mjs +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/Modal/adapter.js.map +1 -1
- package/components/Modal/adapter.mjs.map +1 -1
- package/components/Modal/style.js +1 -1
- package/components/Modal/style.js.map +1 -1
- package/components/Modal/style.mjs +1 -1
- package/components/Modal/style.mjs.map +1 -1
- package/components/Notification/Notification.js +1 -1
- package/components/Notification/Notification.js.map +1 -1
- package/components/Notification/Notification.mjs +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/Paper/style.js.map +1 -1
- package/components/Paper/style.mjs.map +1 -1
- package/components/Popover/Popover.js.map +1 -1
- package/components/Popover/Popover.mjs.map +1 -1
- package/components/PopoverComponent/PopoverComponent.js +1 -1
- package/components/PopoverComponent/PopoverComponent.js.map +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs.map +1 -1
- package/components/Progress/Progress.js.map +1 -1
- package/components/Progress/Progress.mjs.map +1 -1
- package/components/Progress/style.js +1 -1
- package/components/Progress/style.js.map +1 -1
- package/components/Progress/style.mjs +1 -1
- package/components/Progress/style.mjs.map +1 -1
- package/components/Progress.Circle/Progress.Circle.js +1 -1
- package/components/Progress.Circle/Progress.Circle.js.map +1 -1
- package/components/Progress.Circle/Progress.Circle.mjs +1 -1
- package/components/Progress.Circle/Progress.Circle.mjs.map +1 -1
- package/components/Progress.Circle/style.js +1 -1
- package/components/Progress.Circle/style.js.map +1 -1
- package/components/Progress.Circle/style.mjs +1 -1
- package/components/Progress.Circle/style.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/Progress.Segmented/style.js.map +1 -1
- package/components/Progress.Segmented/style.mjs.map +1 -1
- package/components/ProgressCircle/ProgressCircle.js +1 -1
- package/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
- package/components/ProgressCircle/style.js +1 -1
- package/components/ProgressCircle/style.js.map +1 -1
- package/components/ProgressCircle/style.mjs +1 -1
- package/components/ProgressCircle/style.mjs.map +1 -1
- package/components/ProgressLine/ProgressLine.js +1 -1
- package/components/ProgressLine/ProgressLine.js.map +1 -1
- package/components/ProgressLine/ProgressLine.mjs +1 -1
- package/components/ProgressLine/ProgressLine.mjs.map +1 -1
- package/components/Radio/Group.js.map +1 -1
- package/components/Radio/Group.mjs.map +1 -1
- package/components/Radio/Radio.js +1 -1
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/Radio.mjs +1 -1
- package/components/Radio/Radio.mjs.map +1 -1
- package/components/Radio/style.js.map +1 -1
- package/components/Radio/style.mjs.map +1 -1
- package/components/Scrollable/Scrollable.js +1 -1
- package/components/Scrollable/Scrollable.js.map +1 -1
- package/components/Scrollable/Scrollable.mjs +1 -1
- package/components/Scrollable/Scrollable.mjs.map +1 -1
- package/components/Section/Section.js.map +1 -1
- package/components/Section/Section.mjs.map +1 -1
- package/components/Section/style.js +1 -1
- package/components/Section/style.js.map +1 -1
- package/components/Section/style.mjs +1 -1
- package/components/Section/style.mjs.map +1 -1
- package/components/Select/Select.js.map +1 -1
- package/components/Select/Select.mjs.map +1 -1
- package/components/Select/style.js +1 -1
- package/components/Select/style.js.map +1 -1
- package/components/Select/style.mjs +1 -1
- package/components/Select/style.mjs.map +1 -1
- package/components/Separator/Separator.js.map +1 -1
- package/components/Separator/Separator.mjs.map +1 -1
- package/components/Separator/SeparatorText.js.map +1 -1
- package/components/Separator/SeparatorText.mjs.map +1 -1
- package/components/Separator/style.js +1 -1
- package/components/Separator/style.js.map +1 -1
- package/components/Separator/style.mjs +1 -1
- package/components/Separator/style.mjs.map +1 -1
- package/components/Spacer/Spacer.js.map +1 -1
- package/components/Spacer/Spacer.mjs.map +1 -1
- package/components/Spacer/style.js.map +1 -1
- package/components/Spacer/style.mjs.map +1 -1
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/Spinner/Spinner.mjs.map +1 -1
- package/components/Spinner/style.js +1 -1
- package/components/Spinner/style.js.map +1 -1
- package/components/Spinner/style.mjs +1 -1
- package/components/Spinner/style.mjs.map +1 -1
- package/components/Switch/Switch.js.map +1 -1
- package/components/Switch/Switch.mjs.map +1 -1
- package/components/Switcher/style.js.map +1 -1
- package/components/Switcher/style.mjs.map +1 -1
- package/components/Tab/Tab.js +1 -1
- package/components/Tab/Tab.js.map +1 -1
- package/components/Tab/Tab.mjs +1 -1
- package/components/Tab/Tab.mjs.map +1 -1
- package/components/TabList/TabList.js +1 -1
- package/components/TabList/TabList.js.map +1 -1
- package/components/TabList/TabList.mjs +1 -1
- package/components/TabList/TabList.mjs.map +1 -1
- package/components/TabList/TabListMenuTab.js +1 -1
- package/components/TabList/TabListMenuTab.js.map +1 -1
- package/components/TabList/TabListMenuTab.mjs +1 -1
- package/components/TabList/TabListMenuTab.mjs.map +1 -1
- package/components/TabList/TabListPanel.js.map +1 -1
- package/components/TabList/TabListPanel.mjs.map +1 -1
- package/components/TabList/hooks.js +1 -1
- package/components/TabList/hooks.js.map +1 -1
- package/components/TabList/hooks.mjs +1 -1
- package/components/TabList/hooks.mjs.map +1 -1
- package/components/TabList/style.js +1 -1
- package/components/TabList/style.js.map +1 -1
- package/components/TabList/style.mjs +1 -1
- package/components/TabList/style.mjs.map +1 -1
- package/components/TabListTab/TabListTab.js.map +1 -1
- package/components/TabListTab/TabListTab.mjs.map +1 -1
- package/components/TabListTab/style.js +1 -1
- package/components/TabListTab/style.js.map +1 -1
- package/components/TabListTab/style.mjs +1 -1
- package/components/TabListTab/style.mjs.map +1 -1
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/Tabs.mjs.map +1 -1
- package/components/Tabs/style.js +1 -1
- package/components/Tabs/style.js.map +1 -1
- package/components/Tabs/style.mjs +1 -1
- package/components/Tabs/style.mjs.map +1 -1
- package/components/Tag/Tag.js +1 -1
- package/components/Tag/Tag.js.map +1 -1
- package/components/Tag/Tag.mjs +1 -1
- package/components/Tag/Tag.mjs.map +1 -1
- package/components/Tag/style.js +1 -1
- package/components/Tag/style.js.map +1 -1
- package/components/Tag/style.mjs +1 -1
- package/components/Tag/style.mjs.map +1 -1
- package/components/Text/Ellipsis.js +1 -1
- package/components/Text/Ellipsis.js.map +1 -1
- package/components/Text/Ellipsis.mjs +1 -1
- package/components/Text/Ellipsis.mjs.map +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/Text.mjs.map +1 -1
- package/components/Text/style.js.map +1 -1
- package/components/Text/style.mjs.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.mjs +1 -1
- package/components/Text.Ellipse/Text.Ellipse.mjs.map +1 -1
- package/components/Textarea/Textarea.js +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.mjs +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/Tooltip/TooltipWrapper.js.map +1 -1
- package/components/Tooltip/TooltipWrapper.mjs.map +1 -1
- package/components/TooltipComponent/TooltipComponent.js +1 -1
- package/components/TooltipComponent/TooltipComponent.js.map +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
- package/dts/index.d.ts +2630 -2557
- package/hocs/withMergedProps.js.map +1 -1
- package/hocs/withMergedProps.mjs.map +1 -1
- package/hocs/withTranslation.js +1 -1
- package/hocs/withTranslation.js.map +1 -1
- package/hocs/withTranslation.mjs +1 -1
- package/hocs/withTranslation.mjs.map +1 -1
- package/hooks/use-config-priority.js.map +1 -1
- package/hooks/use-config-priority.mjs +1 -1
- package/hooks/use-config-priority.mjs.map +1 -1
- package/hooks/useClickOutside.js.map +1 -1
- package/hooks/useClickOutside.mjs.map +1 -1
- package/hooks/useMergedPalette.js +1 -1
- package/hooks/useMergedPalette.js.map +1 -1
- package/hooks/useMergedPalette.mjs +1 -1
- package/hooks/useMergedPalette.mjs.map +1 -1
- package/hooks/useMergedProps.js.map +1 -1
- package/hooks/useMergedProps.mjs.map +1 -1
- package/hooks/useMergedSizes.js.map +1 -1
- package/hooks/useMergedSizes.mjs.map +1 -1
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useResizeObserver.mjs.map +1 -1
- package/hooks/useScrollMonitor.js +1 -1
- package/hooks/useScrollMonitor.js.map +1 -1
- package/hooks/useScrollMonitor.mjs +1 -1
- package/hooks/useScrollMonitor.mjs.map +1 -1
- package/hooks/useScrollThresholds.js.map +1 -1
- package/hooks/useScrollThresholds.mjs.map +1 -1
- package/mixins/color.js.map +1 -1
- package/mixins/color.mjs.map +1 -1
- package/mixins/create-responsive-props.js.map +1 -1
- package/mixins/create-responsive-props.mjs.map +1 -1
- package/mixins/display.js.map +1 -1
- package/mixins/display.mjs.map +1 -1
- package/mixins/responsive-margin.js.map +1 -1
- package/mixins/responsive-margin.mjs.map +1 -1
- package/mixins/responsive-property.js +1 -1
- package/mixins/responsive-property.js.map +1 -1
- package/mixins/responsive-property.mjs +1 -1
- package/mixins/responsive-property.mjs.map +1 -1
- package/mixins/screen.js +1 -1
- package/mixins/screen.js.map +1 -1
- package/mixins/screen.mjs +1 -1
- package/mixins/screen.mjs.map +1 -1
- package/mixins/shared.js +4 -4
- package/mixins/shared.js.map +1 -1
- package/mixins/shared.mjs +4 -4
- package/mixins/shared.mjs.map +1 -1
- package/mixins/vAlign.js.map +1 -1
- package/mixins/vAlign.mjs.map +1 -1
- package/package.json +7 -7
- package/shared/enums/sizeInput.js.map +1 -1
- package/shared/enums/sizeInput.mjs.map +1 -1
- package/shared/resize-observer.js.map +1 -1
- package/shared/resize-observer.mjs.map +1 -1
- package/shared/utils/colors.js.map +1 -1
- package/shared/utils/colors.mjs.map +1 -1
- package/shared/utils/dom.js.map +1 -1
- package/shared/utils/dom.mjs.map +1 -1
- package/shared/utils/react.js.map +1 -1
- package/shared/utils/react.mjs.map +1 -1
- package/shared/utils/rel-builder.js +1 -1
- package/shared/utils/rel-builder.js.map +1 -1
- package/shared/utils/rel-builder.mjs +1 -1
- package/shared/utils/rel-builder.mjs.map +1 -1
- package/theme/colors-dark.js.map +1 -1
- package/theme/colors-dark.mjs.map +1 -1
- package/theme/colors-light.js.map +1 -1
- package/theme/colors-light.mjs.map +1 -1
- package/theme/colors.js.map +1 -1
- package/theme/colors.mjs.map +1 -1
- package/theme/global-styled.js.map +1 -1
- package/theme/global-styled.mjs.map +1 -1
- package/theme/theme-provider.js.map +1 -1
- package/theme/theme-provider.mjs.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var responsiveProperty=require('../../mixins/responsive-property.js');var adapter=require('./adapter.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WIDTHS={xxxs:100,xxs:200,xs:300,s:400,m:500,l:600,xl:740,xxl:800,xxxl:900};const Modal=styled__default.default(adapter.ReactModalAdapter).withConfig({displayName:"Modal",componentId:"ui__sc-1ilisuf-0"})(["&__overlay{z-index:",";display:flex;flex-direction:row;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;overflow
|
|
1
|
+
'use strict';var styled=require('styled-components');var responsiveProperty=require('../../mixins/responsive-property.js');var adapter=require('./adapter.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const WIDTHS={xxxs:100,xxs:200,xs:300,s:400,m:500,l:600,xl:740,xxl:800,xxxl:900};const Modal=styled__default.default(adapter.ReactModalAdapter).withConfig({displayName:"Modal",componentId:"ui__sc-1ilisuf-0"})(["&__overlay{z-index:",";display:flex;flex-direction:row;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;overflow:hidden auto;"," &.ReactModal__Overlay--after-open{","}}&__content{width:100%;max-height:100%;position:relative;&:focus{outline:0;}","}"],(e=>e.zIndex||e.theme.zIndex.modal),(e=>e.valign?styled.css(["align-items:",";"],(e=>{switch(e){case'top':return'flex-start';case'bottom':return'flex-end';default:return'center'}})(e.valign)):null),(e=>e.overlayClassName?null:styled.css(e.blurredOverlay?["background:rgba(246,247,251,0.3);backdrop-filter:blur(3.5px);"]:["background:rgba(246,247,251,0.9);"])),(e=>e.width?responsiveProperty.property((e=>typeof e.width=='number'?e.width:e.width&&typeof e.width=='string'&&WIDTHS[e.width]?WIDTHS[e.width]:'auto')(e),'max-width'):null));const ModalClose=styled__default.default.span.withConfig({displayName:"Modal__ModalClose",componentId:"ui__sc-1ilisuf-1"})(["opacity:1;transition:0.3s;position:absolute;right:20px;top:20px;cursor:pointer;z-index:10;svg{width:18px;height:18px;}&:hover{opacity:0.5;}"]);styled.createGlobalStyle([".bodyOpen{overflow:hidden;}"]),exports.Modal=Modal,exports.ModalClose=ModalClose;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/Modal/style.ts"],"sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components'\nimport
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/Modal/style.ts"],"sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components'\n\nimport { property } from 'mixins/responsive-property'\nimport type { PossibleValues } from 'mixins/responsive-property'\nimport type { ModalProps } from './Modal'\nimport { ReactModalAdapter } from './adapter'\n\ninterface ReactModalProps extends ReactModal.Props {\n zIndex?: ModalProps['zIndex']\n valign?: ModalProps['valign']\n}\n\nconst WIDTHS = {\n xxxs: 100,\n xxs: 200,\n xs: 300,\n s: 400,\n m: 500,\n l: 600,\n xl: 740,\n xxl: 800,\n xxxl: 900,\n}\n\nconst chooseWidthValue = (props: ModalProps): PossibleValues => {\n if (typeof props.width === 'number') return props.width\n\n if (props.width && typeof props.width === 'string' && WIDTHS[props.width as keyof typeof WIDTHS]) {\n return WIDTHS[props.width as keyof typeof WIDTHS]\n }\n\n return 'auto'\n}\n\nconst getPosition = (valign: ModalProps['valign']) => {\n switch (valign) {\n case 'top':\n return 'flex-start'\n case 'bottom':\n return 'flex-end'\n case 'center':\n return 'center'\n default:\n return 'center'\n }\n}\n\nexport const Modal = styled(ReactModalAdapter)<ReactModalProps>`\n &__overlay {\n z-index: ${(props) => props.zIndex || props.theme.zIndex.modal};\n display: flex;\n flex-direction: row;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden auto;\n ${(props) =>\n props.valign\n ? css`\n align-items: ${getPosition(props.valign)};\n `\n : null}\n &.ReactModal__Overlay--after-open {\n ${(props) => {\n if (props.overlayClassName) return null\n\n if (props.blurredOverlay) {\n return css`\n background: rgba(246, 247, 251, 0.3);\n backdrop-filter: blur(3.5px);\n `\n }\n\n return css`\n background: rgba(246, 247, 251, 0.9);\n `\n }}\n }\n }\n\n &__content {\n width: 100%;\n max-height: 100%;\n position: relative;\n &:focus {\n outline: 0;\n }\n ${(props) => (props.width ? property(chooseWidthValue(props), 'max-width') : null)}\n }\n`\n\nexport const ModalClose = styled.span`\n opacity: 1;\n transition: 0.3s;\n position: absolute;\n right: 20px;\n top: 20px;\n cursor: pointer;\n z-index: 10;\n svg {\n width: 18px;\n height: 18px;\n }\n &:hover {\n opacity: 0.5;\n }\n`\n\nexport const GlobalRoot = createGlobalStyle`\n .bodyOpen {\n overflow: hidden;\n }\n`\n"],"names":["WIDTHS","xxxs","xxs","xs","s","m","l","xl","xxl","xxxl","Modal","styled","default","ReactModalAdapter","withConfig","displayName","componentId","props","zIndex","theme","modal","valign","css","getPosition","overlayClassName","blurredOverlay","width","property","chooseWidthValue","ModalClose","span","createGlobalStyle"],"mappings":"4QAYA,MAAMA,OAAS,CACbC,KAAM,IACNC,IAAK,IACLC,GAAI,IACJC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IACJC,IAAK,IACLC,KAAM,KA0BD,MAAMC,MAAQC,gBAAMC,QAACC,2BAAkBC,WAAA,CAAAC,YAAA,QAAAC,YAAA,oBAAzBL,CAAyB,CAAA,sBAAA,6HAAA,sCAAA,gFAAA,MAE9BM,GAAUA,EAAMC,QAAUD,EAAME,MAAMD,OAAOE,QAUtDH,GACDA,EAAMI,OACFC,OAAGA,IAAA,CAAA,eAAA,KA3BQD,KACnB,OAAQA,GACN,IAAK,MACH,MAAO,aACT,IAAK,SACH,MAAO,WAGT,QACE,MAAO,SACX,EAkByBE,CAAYN,EAAMI,SAEnC,OAEDJ,GACGA,EAAMO,iBAAyB,KAG1BF,OAAGA,IADRL,EAAMQ,eACE,CAAA,iEAMF,CAAA,wCAcXR,GAAWA,EAAMS,MAAQC,mBAAQA,SAlEdV,WACbA,EAAMS,OAAU,SAAiBT,EAAMS,MAE9CT,EAAMS,cAAgBT,EAAMS,OAAU,UAAY1B,OAAOiB,EAAMS,OAC1D1B,OAAOiB,EAAMS,OAGf,OA2DgCE,CAAiBX,GAAQ,aAAe,aAIpEY,WAAalB,gBAAAA,QAAOmB,KAAIhB,WAAA,CAAAC,YAAA,oBAAAC,YAAA,oBAAXL,CAezB,CAAA,gJAEyBoB,OAAiBA,kBAI1C,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import styled,{css,createGlobalStyle}from'styled-components';import{property}from'../../mixins/responsive-property.mjs';import{ReactModalAdapter}from'./adapter.mjs';const WIDTHS={xxxs:100,xxs:200,xs:300,s:400,m:500,l:600,xl:740,xxl:800,xxxl:900};const Modal=styled(ReactModalAdapter).withConfig({displayName:"Modal",componentId:"ui__sc-1ilisuf-0"})(["&__overlay{z-index:",";display:flex;flex-direction:row;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;overflow
|
|
1
|
+
import styled,{css,createGlobalStyle}from'styled-components';import{property}from'../../mixins/responsive-property.mjs';import{ReactModalAdapter}from'./adapter.mjs';const WIDTHS={xxxs:100,xxs:200,xs:300,s:400,m:500,l:600,xl:740,xxl:800,xxxl:900};const Modal=styled(ReactModalAdapter).withConfig({displayName:"Modal",componentId:"ui__sc-1ilisuf-0"})(["&__overlay{z-index:",";display:flex;flex-direction:row;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;overflow:hidden auto;"," &.ReactModal__Overlay--after-open{","}}&__content{width:100%;max-height:100%;position:relative;&:focus{outline:0;}","}"],(t=>t.zIndex||t.theme.zIndex.modal),(t=>t.valign?css(["align-items:",";"],(t=>{switch(t){case'top':return'flex-start';case'bottom':return'flex-end';default:return'center'}})(t.valign)):null),(t=>t.overlayClassName?null:css(t.blurredOverlay?["background:rgba(246,247,251,0.3);backdrop-filter:blur(3.5px);"]:["background:rgba(246,247,251,0.9);"])),(t=>t.width?property((t=>typeof t.width=='number'?t.width:t.width&&typeof t.width=='string'&&WIDTHS[t.width]?WIDTHS[t.width]:'auto')(t),'max-width'):null));const ModalClose=styled.span.withConfig({displayName:"Modal__ModalClose",componentId:"ui__sc-1ilisuf-1"})(["opacity:1;transition:0.3s;position:absolute;right:20px;top:20px;cursor:pointer;z-index:10;svg{width:18px;height:18px;}&:hover{opacity:0.5;}"]);createGlobalStyle([".bodyOpen{overflow:hidden;}"]);export{Modal,ModalClose};
|
|
2
2
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Modal/style.ts"],"sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components'\nimport
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Modal/style.ts"],"sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components'\n\nimport { property } from 'mixins/responsive-property'\nimport type { PossibleValues } from 'mixins/responsive-property'\nimport type { ModalProps } from './Modal'\nimport { ReactModalAdapter } from './adapter'\n\ninterface ReactModalProps extends ReactModal.Props {\n zIndex?: ModalProps['zIndex']\n valign?: ModalProps['valign']\n}\n\nconst WIDTHS = {\n xxxs: 100,\n xxs: 200,\n xs: 300,\n s: 400,\n m: 500,\n l: 600,\n xl: 740,\n xxl: 800,\n xxxl: 900,\n}\n\nconst chooseWidthValue = (props: ModalProps): PossibleValues => {\n if (typeof props.width === 'number') return props.width\n\n if (props.width && typeof props.width === 'string' && WIDTHS[props.width as keyof typeof WIDTHS]) {\n return WIDTHS[props.width as keyof typeof WIDTHS]\n }\n\n return 'auto'\n}\n\nconst getPosition = (valign: ModalProps['valign']) => {\n switch (valign) {\n case 'top':\n return 'flex-start'\n case 'bottom':\n return 'flex-end'\n case 'center':\n return 'center'\n default:\n return 'center'\n }\n}\n\nexport const Modal = styled(ReactModalAdapter)<ReactModalProps>`\n &__overlay {\n z-index: ${(props) => props.zIndex || props.theme.zIndex.modal};\n display: flex;\n flex-direction: row;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden auto;\n ${(props) =>\n props.valign\n ? css`\n align-items: ${getPosition(props.valign)};\n `\n : null}\n &.ReactModal__Overlay--after-open {\n ${(props) => {\n if (props.overlayClassName) return null\n\n if (props.blurredOverlay) {\n return css`\n background: rgba(246, 247, 251, 0.3);\n backdrop-filter: blur(3.5px);\n `\n }\n\n return css`\n background: rgba(246, 247, 251, 0.9);\n `\n }}\n }\n }\n\n &__content {\n width: 100%;\n max-height: 100%;\n position: relative;\n &:focus {\n outline: 0;\n }\n ${(props) => (props.width ? property(chooseWidthValue(props), 'max-width') : null)}\n }\n`\n\nexport const ModalClose = styled.span`\n opacity: 1;\n transition: 0.3s;\n position: absolute;\n right: 20px;\n top: 20px;\n cursor: pointer;\n z-index: 10;\n svg {\n width: 18px;\n height: 18px;\n }\n &:hover {\n opacity: 0.5;\n }\n`\n\nexport const GlobalRoot = createGlobalStyle`\n .bodyOpen {\n overflow: hidden;\n }\n`\n"],"names":["WIDTHS","xxxs","xxs","xs","s","m","l","xl","xxl","xxxl","Modal","styled","ReactModalAdapter","withConfig","displayName","componentId","props","zIndex","theme","modal","valign","css","getPosition","overlayClassName","blurredOverlay","width","property","chooseWidthValue","ModalClose","span","createGlobalStyle"],"mappings":"qKAYA,MAAMA,OAAS,CACbC,KAAM,IACNC,IAAK,IACLC,GAAI,IACJC,EAAG,IACHC,EAAG,IACHC,EAAG,IACHC,GAAI,IACJC,IAAK,IACLC,KAAM,KA0BD,MAAMC,MAAQC,OAAOC,mBAAkBC,WAAA,CAAAC,YAAA,QAAAC,YAAA,oBAAzBJ,CAAyB,CAAA,sBAAA,6HAAA,sCAAA,gFAAA,MAE9BK,GAAUA,EAAMC,QAAUD,EAAME,MAAMD,OAAOE,QAUtDH,GACDA,EAAMI,OACFC,IAAG,CAAA,eAAA,KA3BQD,KACnB,OAAQA,GACN,IAAK,MACH,MAAO,aACT,IAAK,SACH,MAAO,WAGT,QACE,MAAO,SACX,EAkByBE,CAAYN,EAAMI,SAEnC,OAEDJ,GACGA,EAAMO,iBAAyB,KAG1BF,IADLL,EAAMQ,eACE,CAAA,iEAMF,CAAA,wCAcXR,GAAWA,EAAMS,MAAQC,SAlENV,WACbA,EAAMS,OAAU,SAAiBT,EAAMS,MAE9CT,EAAMS,cAAgBT,EAAMS,OAAU,UAAYzB,OAAOgB,EAAMS,OAC1DzB,OAAOgB,EAAMS,OAGf,OA2DgCE,CAAiBX,GAAQ,aAAe,aAIpEY,WAAajB,OAAOkB,KAAIhB,WAAA,CAAAC,YAAA,oBAAAC,YAAA,oBAAXJ,CAezB,CAAA,gJAEyBmB,kBAIzB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');var Anchor=require('../Anchor/Anchor.js');var IconButton=require('../IconButton/IconButton.js');const Notification=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="m",status:
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');var Anchor=require('../Anchor/Anchor.js');var IconButton=require('../IconButton/IconButton.js');const Notification=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="m",status:n="system",iconProps:r={},discardButtonProps:o={},titleProps:i={},textProps:a={},actionButtonProps:c={},anchorProps:u={},title:l,text:x,hideIcon:j,sizeXXS:d,sizeXS:p,sizeS:m,sizeM:h,sizeL:z,sizeXL:I,...R}=e;const S={size:s,sizeXXS:d,sizeXS:p,sizeS:m,sizeM:h,sizeL:z,sizeXL:I};return jsxRuntime.jsxs(style.Root,{...R,...S,status:n,ref:t,children:[!j&&jsxRuntime.jsx(style.Spacer,{children:jsxRuntime.jsx(Icon.Icon,{preset:"brand",name:constants.ICON_NAMES[n],sizes:constants.SIZES_ICON,...S,...r})}),jsxRuntime.jsxs(style.Container,{children:[jsxRuntime.jsxs(style.Content,{children:[l?jsxRuntime.jsx(Text.Text,{as:"p",appearance:"body",weight:700,wordBreak:"break-word",color:"content-onmain-primary",...S,...i,children:l}):null,x?jsxRuntime.jsx(Text.Text,{as:"p",appearance:"body",wordBreak:"break-word",color:"content-onmain-primary",marginTop:l?'0.2em':void 0,sizes:constants.SIZES_TEXT,...S,...a,children:x}):null]}),c.onClick||u.href||u.to?jsxRuntime.jsxs(style.Controls,{children:[c.onClick?jsxRuntime.jsx(Button.Button,{preset:"brand",black:!0,sizes:constants.SIZES_ACTION,...S,...c}):null,u.href||u.to?jsxRuntime.jsx(Anchor.Anchor,{preset:"brand",underline:!0,palette:{color:'content-onmain-primary'},textProps:{appearance:'body',wordBreak:'break-word'},marginLeft:c.onClick?'0.6em':void 0,...S,...u}):null]}):null]}),o.onClick?jsxRuntime.jsx(style.Spacer,{children:jsxRuntime.jsx(IconButton.IconButton,{icon:"close",square:!0,...S,...o})}):null]})})),{displayName:'Notification',sizes:constants.SIZES});exports.Notification=Notification;
|
|
2
2
|
//# sourceMappingURL=Notification.js.map
|
|
@@ -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 { 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((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
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,ICON_NAMES,SIZES_ICON,SIZES_TEXT,SIZES_ACTION}from'./constants.mjs';import{Root,Spacer,Container,Content,Controls}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';import{Anchor}from'../Anchor/Anchor.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const Notification=withMergedProps(forwardRef(((o,r)=>{const{size:t="m",status:e="system",iconProps:
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,ICON_NAMES,SIZES_ICON,SIZES_TEXT,SIZES_ACTION}from'./constants.mjs';import{Root,Spacer,Container,Content,Controls}from'./style.mjs';import{jsxs,jsx}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';import{Anchor}from'../Anchor/Anchor.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const Notification=withMergedProps(forwardRef(((o,r)=>{const{size:t="m",status:e="system",iconProps:n={},discardButtonProps:s={},titleProps:i={},textProps:c={},actionButtonProps:a={},anchorProps:m={},title:p,text:l,hideIcon:d,sizeXXS:S,sizeXS:x,sizeS:j,sizeM:I,sizeL:u,sizeXL:f,...h}=o;const z={size:t,sizeXXS:S,sizeXS:x,sizeS:j,sizeM:I,sizeL:u,sizeXL:f};return jsxs(Root,{...h,...z,status:e,ref:r,children:[!d&&jsx(Spacer,{children:jsx(Icon,{preset:"brand",name:ICON_NAMES[e],sizes:SIZES_ICON,...z,...n})}),jsxs(Container,{children:[jsxs(Content,{children:[p?jsx(Text,{as:"p",appearance:"body",weight:700,wordBreak:"break-word",color:"content-onmain-primary",...z,...i,children:p}):null,l?jsx(Text,{as:"p",appearance:"body",wordBreak:"break-word",color:"content-onmain-primary",marginTop:p?'0.2em':void 0,sizes:SIZES_TEXT,...z,...c,children:l}):null]}),a.onClick||m.href||m.to?jsxs(Controls,{children:[a.onClick?jsx(Button,{preset:"brand",black:!0,sizes:SIZES_ACTION,...z,...a}):null,m.href||m.to?jsx(Anchor,{preset:"brand",underline:!0,palette:{color:'content-onmain-primary'},textProps:{appearance:'body',wordBreak:'break-word'},marginLeft:a.onClick?'0.6em':void 0,...z,...m}):null]}):null]}),s.onClick?jsx(Spacer,{children:jsx(IconButton,{icon:"close",square:!0,...z,...s})}):null]})})),{displayName:'Notification',sizes:SIZES});export{Notification};
|
|
2
2
|
//# sourceMappingURL=Notification.mjs.map
|
|
@@ -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 { 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((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
|
|
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,EA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/Paper/Paper.tsx"],"sourcesContent":["import { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport { 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\n/**\n * Расширен:\n * - [`SpacerProps`](#/Разметка/Spacer)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'padding'>`](#/Миксины)\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":"iJAmCA,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 { ResponsiveNamedProperty } from 'mixins/responsive-property'\nimport { ColorProperty } from 'mixins/color'\nimport { useClassname } from 'hooks/useClassname'\nimport { 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\n/**\n * Расширен:\n * - [`SpacerProps`](#/Разметка/Spacer)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'padding'>`](#/Миксины)\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":"wHAmCA,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":"style.js","sources":["../../../../src/components/Paper/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { Spacer } from 'components/Spacer'\nimport { PaperProps } from './Paper'\n\nconst zDepth = {\n 0: css`\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.11);\n `,\n 1: css`\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);\n `,\n 2: css`\n box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);\n `,\n 3: css`\n box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.08);\n `,\n 4: css`\n box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.14);\n `,\n}\n\nconst circle = css`\n border-radius: 50%;\n justify-content: center;\n display: flex;\n align-items: center;\n min-width: 100px;\n min-height: 100px;\n`\n\nconst rounded = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const Root = styled(Spacer)<PaperProps>`\n box-sizing: border-box;\n background-color: ${(props) => props.theme.colors.white};\n ${(props) =>\n props.textAlign\n ? css`\n text-align: ${props.textAlign};\n `\n : null}\n ${(props) => (props.color ? color(props.color, 'background-color') : null)}\n ${(props) => (typeof props.zDepth === 'number' && props.shadow ? zDepth[props.zDepth] : null)}\n ${(props) => (props.rounded ? rounded : null)}\n ${(props) => (props.circle ? circle : null)}\n`\n"],"names":["zDepth","css","circle","rounded","props","theme","borderRadius","Root","styled","default","Spacer","withConfig","displayName","componentId","colors","white","textAlign","color","shadow"],"mappings":"uPAKA,MAAMA,OAAS,CACb,EAAGC,OAAAA,IAEF,CAAA,2CACD,EAAGA,OAAAA,IAEF,CAAA,6CACD,EAAGA,OAAAA,IAEF,CAAA,6CACD,EAAGA,OAAAA,IAEF,CAAA,+CACD,EAAGA,OAAAA,IAAG,CAAA,gDAKR,MAAMC,OAASD,OAAGA,IAOjB,CAAA,+GAED,MAAME,QAAUF,OAAAA,IACIG,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMC,eAGnC,MAAMC,KAAOC,gBAAMC,QAACC,eAAOC,WAAA,CAAAC,YAAA,cAAAC,YAAA,oBAAdL,CAAc,CAAA,0CAAA,IAAA,IAAA,IAAA,IAAA,IAAA,KAEXJ,GAAUA,EAAMC,MAAMS,OAAOC,QAC/CX,GACDA,EAAMY,UACFf,OAAAA,IACgBG,CAAAA,cAAAA,KAAAA,EAAMY,WAEtB,OACHZ,GAAWA,EAAMa,MAAQA,MAAAA,MAAMb,EAAMa,MAAO,oBAAsB,OAClEb,UAAkBA,EAAMJ,QAAW,UAAYI,EAAMc,OAASlB,OAAOI,EAAMJ,QAAU,OACrFI,GAAWA,EAAMD,QAAUA,QAAU,OACrCC,GAAWA,EAAMF,OAASA,OAAS"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/Paper/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { Spacer } from 'components/Spacer'\nimport type { PaperProps } from './Paper'\n\nconst zDepth = {\n 0: css`\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.11);\n `,\n 1: css`\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);\n `,\n 2: css`\n box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);\n `,\n 3: css`\n box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.08);\n `,\n 4: css`\n box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.14);\n `,\n}\n\nconst circle = css`\n border-radius: 50%;\n justify-content: center;\n display: flex;\n align-items: center;\n min-width: 100px;\n min-height: 100px;\n`\n\nconst rounded = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const Root = styled(Spacer)<PaperProps>`\n box-sizing: border-box;\n background-color: ${(props) => props.theme.colors.white};\n ${(props) =>\n props.textAlign\n ? css`\n text-align: ${props.textAlign};\n `\n : null}\n ${(props) => (props.color ? color(props.color, 'background-color') : null)}\n ${(props) => (typeof props.zDepth === 'number' && props.shadow ? zDepth[props.zDepth] : null)}\n ${(props) => (props.rounded ? rounded : null)}\n ${(props) => (props.circle ? circle : null)}\n`\n"],"names":["zDepth","css","circle","rounded","props","theme","borderRadius","Root","styled","default","Spacer","withConfig","displayName","componentId","colors","white","textAlign","color","shadow"],"mappings":"uPAKA,MAAMA,OAAS,CACb,EAAGC,OAAAA,IAEF,CAAA,2CACD,EAAGA,OAAAA,IAEF,CAAA,6CACD,EAAGA,OAAAA,IAEF,CAAA,6CACD,EAAGA,OAAAA,IAEF,CAAA,+CACD,EAAGA,OAAAA,IAAG,CAAA,gDAKR,MAAMC,OAASD,OAAGA,IAOjB,CAAA,+GAED,MAAME,QAAUF,OAAAA,IACIG,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMC,eAGnC,MAAMC,KAAOC,gBAAMC,QAACC,eAAOC,WAAA,CAAAC,YAAA,cAAAC,YAAA,oBAAdL,CAAc,CAAA,0CAAA,IAAA,IAAA,IAAA,IAAA,IAAA,KAEXJ,GAAUA,EAAMC,MAAMS,OAAOC,QAC/CX,GACDA,EAAMY,UACFf,OAAAA,IACgBG,CAAAA,cAAAA,KAAAA,EAAMY,WAEtB,OACHZ,GAAWA,EAAMa,MAAQA,MAAAA,MAAMb,EAAMa,MAAO,oBAAsB,OAClEb,UAAkBA,EAAMJ,QAAW,UAAYI,EAAMc,OAASlB,OAAOI,EAAMJ,QAAU,OACrFI,GAAWA,EAAMD,QAAUA,QAAU,OACrCC,GAAWA,EAAMF,OAASA,OAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Paper/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { Spacer } from 'components/Spacer'\nimport { PaperProps } from './Paper'\n\nconst zDepth = {\n 0: css`\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.11);\n `,\n 1: css`\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);\n `,\n 2: css`\n box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);\n `,\n 3: css`\n box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.08);\n `,\n 4: css`\n box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.14);\n `,\n}\n\nconst circle = css`\n border-radius: 50%;\n justify-content: center;\n display: flex;\n align-items: center;\n min-width: 100px;\n min-height: 100px;\n`\n\nconst rounded = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const Root = styled(Spacer)<PaperProps>`\n box-sizing: border-box;\n background-color: ${(props) => props.theme.colors.white};\n ${(props) =>\n props.textAlign\n ? css`\n text-align: ${props.textAlign};\n `\n : null}\n ${(props) => (props.color ? color(props.color, 'background-color') : null)}\n ${(props) => (typeof props.zDepth === 'number' && props.shadow ? zDepth[props.zDepth] : null)}\n ${(props) => (props.rounded ? rounded : null)}\n ${(props) => (props.circle ? circle : null)}\n`\n"],"names":["zDepth","css","circle","rounded","props","theme","borderRadius","Root","styled","Spacer","withConfig","displayName","componentId","colors","white","textAlign","color","shadow"],"mappings":"8HAKA,MAAMA,OAAS,CACb,EAAGC,IAEF,CAAA,2CACD,EAAGA,IAEF,CAAA,6CACD,EAAGA,IAEF,CAAA,6CACD,EAAGA,IAEF,CAAA,+CACD,EAAGA,IAAG,CAAA,gDAKR,MAAMC,OAASD,IAOd,CAAA,+GAED,MAAME,QAAUF,IACIG,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMC,eAGnC,MAAMC,KAAOC,OAAOC,QAAOC,WAAA,CAAAC,YAAA,cAAAC,YAAA,oBAAdJ,CAAc,CAAA,0CAAA,IAAA,IAAA,IAAA,IAAA,IAAA,KAEXJ,GAAUA,EAAMC,MAAMQ,OAAOC,QAC/CV,GACDA,EAAMW,UACFd,IACgBG,CAAAA,cAAAA,KAAAA,EAAMW,WAEtB,OACHX,GAAWA,EAAMY,MAAQA,MAAMZ,EAAMY,MAAO,oBAAsB,OAClEZ,UAAkBA,EAAMJ,QAAW,UAAYI,EAAMa,OAASjB,OAAOI,EAAMJ,QAAU,OACrFI,GAAWA,EAAMD,QAAUA,QAAU,OACrCC,GAAWA,EAAMF,OAASA,OAAS"}
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/Paper/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { color } from 'mixins/color'\nimport { Spacer } from 'components/Spacer'\nimport type { PaperProps } from './Paper'\n\nconst zDepth = {\n 0: css`\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.11);\n `,\n 1: css`\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08);\n `,\n 2: css`\n box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);\n `,\n 3: css`\n box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.08);\n `,\n 4: css`\n box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.14);\n `,\n}\n\nconst circle = css`\n border-radius: 50%;\n justify-content: center;\n display: flex;\n align-items: center;\n min-width: 100px;\n min-height: 100px;\n`\n\nconst rounded = css`\n border-radius: ${(props) => props.theme.borderRadius};\n`\n\nexport const Root = styled(Spacer)<PaperProps>`\n box-sizing: border-box;\n background-color: ${(props) => props.theme.colors.white};\n ${(props) =>\n props.textAlign\n ? css`\n text-align: ${props.textAlign};\n `\n : null}\n ${(props) => (props.color ? color(props.color, 'background-color') : null)}\n ${(props) => (typeof props.zDepth === 'number' && props.shadow ? zDepth[props.zDepth] : null)}\n ${(props) => (props.rounded ? rounded : null)}\n ${(props) => (props.circle ? circle : null)}\n`\n"],"names":["zDepth","css","circle","rounded","props","theme","borderRadius","Root","styled","Spacer","withConfig","displayName","componentId","colors","white","textAlign","color","shadow"],"mappings":"8HAKA,MAAMA,OAAS,CACb,EAAGC,IAEF,CAAA,2CACD,EAAGA,IAEF,CAAA,6CACD,EAAGA,IAEF,CAAA,6CACD,EAAGA,IAEF,CAAA,+CACD,EAAGA,IAAG,CAAA,gDAKR,MAAMC,OAASD,IAOd,CAAA,+GAED,MAAME,QAAUF,IACIG,CAAAA,iBAAAA,MAAAA,GAAUA,EAAMC,MAAMC,eAGnC,MAAMC,KAAOC,OAAOC,QAAOC,WAAA,CAAAC,YAAA,cAAAC,YAAA,oBAAdJ,CAAc,CAAA,0CAAA,IAAA,IAAA,IAAA,IAAA,IAAA,KAEXJ,GAAUA,EAAMC,MAAMQ,OAAOC,QAC/CV,GACDA,EAAMW,UACFd,IACgBG,CAAAA,cAAAA,KAAAA,EAAMW,WAEtB,OACHX,GAAWA,EAAMY,MAAQA,MAAMZ,EAAMY,MAAO,oBAAsB,OAClEZ,UAAkBA,EAAMJ,QAAW,UAAYI,EAAMa,OAASjB,OAAOI,EAAMJ,QAAU,OACrFI,GAAWA,EAAMD,QAAUA,QAAU,OACrCC,GAAWA,EAAMF,OAASA,OAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n styles = {},\n palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\n }}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","jsx","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<PopoverProps>>((props, ref) => {\n const {\n size = 's',\n styles = {},\n palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\n }}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","jsx","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"qVAiBA,MAAMA,QAAkGC,OAAOC,OAC7GC,gBAAAA,gBACEC,MAAAA,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KACJA,EAA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
|
-
{"version":3,"file":"Popover.mjs","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n styles = {},\n palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\n }}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popover.mjs","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Tooltip } from 'components/Tooltip'\nimport { PopoverComponent } from 'components/PopoverComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES } from './sizes'\nimport type { PopoverProps } from './types'\n\nconst COMPONENT_NAME = 'Popover'\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживается \"ref\" и все нативные атрибуты \\<div\\> элемента.\n */\nconst Popover: React.ForwardRefExoticComponent<PopoverProps> & { Component: typeof PopoverComponent } = Object.assign(\n withMergedProps<PopoverProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<PopoverProps>>((props, ref) => {\n const {\n size = 's',\n styles = {},\n palette = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n sizes,\n sizeUnits,\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n badge,\n caption,\n header,\n title,\n content,\n body,\n media,\n footer,\n root,\n closeButton,\n position,\n trigger,\n ...restProps\n } = props\n\n return (\n <Tooltip\n {...restProps}\n preset='brand'\n ref={ref}\n placement={position}\n styles={deepmerge({ arrow: { spread: 20, length: 12 } }, styles)}\n palette={{\n backgroundColor: palette.backgroundColor,\n }}\n component={\n <PopoverComponent\n size={size}\n sizeXXS={sizeXXS}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n sizes={sizes}\n sizeUnits={sizeUnits}\n layout={layout}\n layoutXXS={layoutXXS}\n layoutXS={layoutXS}\n layoutS={layoutS}\n layoutM={layoutM}\n layoutL={layoutL}\n layoutXL={layoutXL}\n imgSrcVertical={imgSrcVertical}\n imgSrcHorizontal={imgSrcHorizontal}\n palette={palette}\n loading={loading}\n badge={badge}\n caption={caption}\n header={header}\n title={title}\n content={content}\n body={body}\n media={media}\n footer={footer}\n root={root}\n closeButton={closeButton}\n />\n }\n >\n {trigger}\n </Tooltip>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n ),\n {\n Component: PopoverComponent,\n }\n)\n\nexport { Popover }\n"],"names":["Popover","Object","assign","withMergedProps","forwardRef","props","ref","size","styles","palette","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","sizes","sizeUnits","layout","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","imgSrcVertical","imgSrcHorizontal","loading","badge","caption","header","title","content","body","media","footer","root","closeButton","position","trigger","restProps","_jsx","Tooltip","preset","placement","deepmerge","arrow","spread","length","backgroundColor","component","PopoverComponent","children","displayName","SIZES","Component"],"mappings":"kUAiBA,MAAMA,QAAkGC,OAAOC,OAC7GC,gBACEC,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,CAAE,EAAAC,QACXA,EAAU,CAAE,EAAAC,QACZA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,MACNA,EAAKC,UACLA,EAASC,OACTA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,eACRA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,MACPA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,MACJA,EAAKC,OACLA,EAAMC,KACNA,EAAIC,YACJA,EAAWC,SACXA,EAAQC,QACRA,KACGC,GACDnC,EAEJ,OACEoC,IAACC,QAAO,IACFF,EACJG,OAAO,QACPrC,IAAKA,EACLsC,UAAWN,EACX9B,OAAQqC,UAAU,CAAEC,MAAO,CAAEC,OAAQ,GAAIC,OAAQ,KAAQxC,GACzDC,QAAS,CACPwC,gBAAiBxC,EAAQwC,iBAE3BC,UACET,IAACU,iBAAgB,CACf5C,KAAMA,EACNG,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,MAAOA,EACPC,UAAWA,EACXC,OAAQA,EACRC,UAAWA,EACXC,SAAUA,EACVC,QAASA,EACTC,QAASA,EACTC,QAASA,EACTC,SAAUA,EACVC,eAAgBA,EAChBC,iBAAkBA,EAClBjB,QAASA,EACTkB,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRC,MAAOA,EACPC,QAASA,EACTC,KAAMA,EACNC,MAAOA,EACPC,OAAQA,EACRC,KAAMA,EACNC,YAAaA,IAEhBe,SAEAb,GACO,IAGd,CACEc,YAlGiB,UAmGjBrC,MAAOsC,QAGX,CACEC,UAAWJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Badge=require('../Badge/Badge.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');const PopoverComponent=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",layout:i="vertical",sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:p,root:R,badge:y,caption:S,header:h,title:g,content:z,body:T,closeButton:f,media:E,footer:B,imgSrcVertical:k,imgSrcHorizontal:I,loading:b,palette:w,closeFn:v,...P}=e;const A={size:s,sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u};const L={layout:i,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:p};const X={...A,borderRadius:8,marginRight:12,resetDefaultMargin:!0,sizes:sizes.SIZES_HEADER_BADGE};const V={...A,as:'span',appearance:'caption',color:'content-onmain-tertiary',weight:700,wordBreak:'break-word',sizes:sizes.SIZES_CAPTION};const C={...A,as:'h2',appearance:'subheading',color:'inherit',marginBottom:z?'0.4em':void 0,wordBreak:'break-word',sizes:sizes.SIZES_TITLE};const q={...A,as:'p',appearance:'body',color:'inherit',wordBreak:'break-word',sizes:sizes.SIZES_CONTENT};const _={...A,icon:'close',square:!0,marginTop:10,marginRight:10,sizes:sizes.SIZES_CLOSE_BUTTON,onClick:()=>{typeof v=='function'&&v()}};return jsxRuntime.jsx(style.Root,{...P,...A,...L,layouts:layouts.LAYOUTS,palette:w,ref:t,children:React.isValidElement(R)?R:typeof R=='function'?R({badgeProps:X,captionProps:V,titleProps:C,contentProps:q,closeButtonProps:_}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Badge=require('../Badge/Badge.js');var Text=require('../Text/Text.js');var Button=require('../Button/Button.js');const PopoverComponent=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",layout:i="vertical",sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:p,root:R,badge:y,caption:S,header:h,title:g,content:z,body:T,closeButton:f,media:E,footer:B,imgSrcVertical:k,imgSrcHorizontal:I,loading:b,palette:w,closeFn:v,...P}=e;const A={size:s,sizeXXS:n,sizeXS:o,sizeS:r,sizeM:a,sizeL:l,sizeXL:u};const L={layout:i,layoutXXS:c,layoutXS:d,layoutS:x,layoutM:j,layoutL:m,layoutXL:p};const X={...A,borderRadius:8,marginRight:12,resetDefaultMargin:!0,sizes:sizes.SIZES_HEADER_BADGE};const V={...A,as:'span',appearance:'caption',color:'content-onmain-tertiary',weight:700,wordBreak:'break-word',sizes:sizes.SIZES_CAPTION};const C={...A,as:'h2',appearance:'subheading',color:'inherit',marginBottom:z?'0.4em':void 0,wordBreak:'break-word',sizes:sizes.SIZES_TITLE};const q={...A,as:'p',appearance:'body',color:'inherit',wordBreak:'break-word',sizes:sizes.SIZES_CONTENT};const _={...A,icon:'close',square:!0,marginTop:10,marginRight:10,sizes:sizes.SIZES_CLOSE_BUTTON,onClick:()=>{typeof v=='function'&&v()}};return jsxRuntime.jsx(style.Root,{...P,...A,...L,layouts:layouts.LAYOUTS,palette:w,ref:t,children:React.isValidElement(R)?R:typeof R=='function'?R({badgeProps:X,captionProps:V,titleProps:C,contentProps:q,closeButtonProps:_}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b||E||I?jsxRuntime.jsx(style.Media,{...L,layouts:layouts.VISIBILITY_HORIZONTAL,children:b?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"1:1",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{})}):React.isValidElement(E)?E:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"1:1",width:"100%",children:jsxRuntime.jsx(style.Img,{src:I})})}):null,jsxRuntime.jsxs(style.Container,{children:[jsxRuntime.jsxs(style.Content,{children:[b?jsxRuntime.jsx(style.Header,{children:jsxRuntime.jsx(Skeleton.Skeleton,{width:"20%",children:jsxRuntime.jsx(Badge.Badge,{...X})})}):React.isValidElement(h)?h:typeof h=='function'?h({badgeProps:X,captionProps:V}):y||S?jsxRuntime.jsxs(style.Header,{children:[React.isValidElement(y)?y:typeof y=='function'?y(X):typeof y=='string'||typeof y=='number'?jsxRuntime.jsx(Badge.Badge,{...X,children:y}):null,React.isValidElement(S)?S:typeof S=='function'?S(V):typeof S=='string'||typeof S=='number'?jsxRuntime.jsx(Text.Text,{...V,children:S}):null]}):null,b||E||k?jsxRuntime.jsx(style.Media,{...L,layouts:layouts.VISIBILITY_VERTICAL,children:b?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"16:9",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{})}):React.isValidElement(E)?E:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"16:9",width:"100%",children:jsxRuntime.jsx(style.Img,{src:k})})}):null,b?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,children:jsxRuntime.jsx(Text.Text,{appearance:"subheading",marginBottom:"0.4em",sizes:sizes.SIZES_TITLE,...A})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"70%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",marginBottom:"0.4em",sizes:sizes.SIZES_CONTENT,...A})}),jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:4,width:"50%",children:jsxRuntime.jsx(Text.Text,{appearance:"body",sizes:sizes.SIZES_CONTENT,...A})})]}):React.isValidElement(T)?T:typeof T=='function'?T({titleProps:C,contentProps:q}):g||z?jsxRuntime.jsxs("div",{children:[React.isValidElement(g)?g:typeof g=='function'?g(C):typeof g=='string'||typeof g=='number'?jsxRuntime.jsx(Text.Text,{...C,children:g}):null,React.isValidElement(z)?z:typeof z=='function'?z(q):typeof z=='string'||typeof z=='number'?jsxRuntime.jsx(Text.Text,{...q,children:z}):null]}):null]}),B?jsxRuntime.jsx(style.Footer,{children:b?jsxRuntime.jsx(Skeleton.Skeleton,{width:"100%",children:jsxRuntime.jsx(Button.Button,{preset:"brand",...A})}):React.isValidElement(B)?B:null}):null]}),f?jsxRuntime.jsx(style.ButtonPosition,{children:React.isValidElement(f)?f:typeof f=='function'?f(_):null}):null]})})})),{displayName:'PopoverComponent',sizes:sizes.SIZES});exports.PopoverComponent=PopoverComponent;
|
|
2
2
|
//# sourceMappingURL=PopoverComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeProps: BadgeProps = {\n ...sizeProps,\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps,\n captionProps,\n titleProps,\n contentProps,\n closeButtonProps,\n })\n ) : (\n <>\n {(loading || media || imgSrcHorizontal) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...badgeProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n badgeProps,\n captionProps,\n })\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge(badgeProps)\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...badgeProps}>{badge}</Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {(loading || media || imgSrcVertical) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n titleProps,\n contentProps,\n })\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content(contentProps)\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...contentProps}>{content}</Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n )}\n </Styled.Container>\n {closeButton && (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleProps","marginBottom","undefined","SIZES_TITLE","contentProps","SIZES_CONTENT","closeButtonProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","_jsxs","jsxs","_Fragment","jsx","VISIBILITY_HORIZONTAL","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"mdAiBMA,MAAAA,iBAA2EC,gBAAAA,gBAI/EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,QACnBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,YACJA,EAAWC,MACXA,EAAKC,OACLA,EAAMC,eACNA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACD/B,EAEJ,MAAMgC,EAAY,CAChB9B,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMwB,EAAc,CAClB9B,SACAO,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMmB,EAAyB,IAC1BF,EACHG,aAAc,EACdC,YAAa,GACbC,oBAAoB,EACpBC,MAAOC,MAAAA,oBAGT,MAAMC,EAA0B,IAC3BR,EACHS,GAAI,OACJC,WAAY,UACZC,MAAO,0BACPC,OAAQ,IACRC,UAAW,aACXP,MAAOQ,MAAAA,eAGT,MAAMC,EAAwB,IACzBf,EACHS,GAAI,KACJC,WAAY,aACZC,MAAO,UACPK,aAAc3B,EAAU,aAAU4B,EAClCJ,UAAW,aACXP,MAAOY,MAAAA,aAGT,MAAMC,EAA0B,IAC3BnB,EACHS,GAAI,IACJC,WAAY,OACZC,MAAO,UACPE,UAAW,aACXP,MAAOc,MAAAA,eAGT,MAAMC,EAAoC,IACrCrB,EACHsB,KAAM,QACNC,QAAQ,EACRC,UAAW,GACXpB,YAAa,GACbE,MAAOmB,MAAkBA,mBACzBC,QAASA,YACI5B,GA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WAAAS,IAACR,aAAa,CAAAG,SACXnC,EACC+B,WAAAS,IAACK,kBAAQ,CAACD,MAAM,OAAMT,SACpBJ,WAAAS,IAACU,cAAM,CAACC,OAAO,WAAY/C,MAE3BgC,MAAcA,eAACvC,GACjBA,EACE,UAITF,GACCoC,WAAAS,IAACR,qBAAqB,CAAAG,SACnBC,MAAAA,eAAezC,GACZA,SACOA,GAAgB,WACvBA,EAAY8B,GACZ,WAKA,IAGlB,CACE2B,YA3PmB,mBA4PnB1C,MAAO2C,MAAAA"}
|
|
1
|
+
{"version":3,"file":"PopoverComponent.js","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<PopoverComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeProps: BadgeProps = {\n ...sizeProps,\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps,\n captionProps,\n titleProps,\n contentProps,\n closeButtonProps,\n })\n ) : (\n <>\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...badgeProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n badgeProps,\n captionProps,\n })\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge(badgeProps)\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...badgeProps}>{badge}</Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n titleProps,\n contentProps,\n })\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content(contentProps)\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...contentProps}>{content}</Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer ? (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleProps","marginBottom","undefined","SIZES_TITLE","contentProps","SIZES_CONTENT","closeButtonProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","_jsxs","jsxs","_Fragment","VISIBILITY_HORIZONTAL","jsx","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"mdAkBMA,MAAAA,iBAA2EC,gBAAAA,gBAI/EC,MAAAA,YAA+D,CAACC,EAAOC,KACrE,MAAMC,KACJA,EAAO,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MAAcA,eAACvC,GACjBA,EACE,OAEJ,QAELF,EACCoC,WAAAU,IAACT,qBAAqB,CAAAG,SACnBC,MAAAA,eAAezC,GACZA,SACOA,GAAgB,WACrBA,EAAY8B,GACZ,OAEN,SAGI,IAGlB,CACE2B,YA3PmB,mBA4PnB1C,MAAO2C,MAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef,isValidElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,SIZES_TITLE,SIZES_CONTENT,SIZES_HEADER_BADGE,SIZES_CAPTION,SIZES_CLOSE_BUTTON}from'./sizes.mjs';import{LAYOUTS,VISIBILITY_HORIZONTAL,VISIBILITY_VERTICAL}from'./layouts.mjs';import{Root,Media,Img,Container,Content,Header,Footer,ButtonPosition}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{AspectRatio}from'../AspectRatio/AspectRatio.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Badge}from'../Badge/Badge.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';const PopoverComponent=withMergedProps(forwardRef(((e,t)=>{const{size:o="s",layout:i="vertical",sizeXXS:
|
|
1
|
+
import{forwardRef,isValidElement}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,SIZES_TITLE,SIZES_CONTENT,SIZES_HEADER_BADGE,SIZES_CAPTION,SIZES_CLOSE_BUTTON}from'./sizes.mjs';import{LAYOUTS,VISIBILITY_HORIZONTAL,VISIBILITY_VERTICAL}from'./layouts.mjs';import{Root,Media,Img,Container,Content,Header,Footer,ButtonPosition}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{AspectRatio}from'../AspectRatio/AspectRatio.mjs';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Badge}from'../Badge/Badge.mjs';import{Text}from'../Text/Text.mjs';import{Button}from'../Button/Button.mjs';const PopoverComponent=withMergedProps(forwardRef(((e,t)=>{const{size:o="s",layout:i="vertical",sizeXXS:n,sizeXS:s,sizeS:r,sizeM:a,sizeL:l,sizeXL:d,layoutXXS:c,layoutXS:p,layoutS:m,layoutM:S,layoutL:u,layoutXL:x,root:h,badge:j,caption:f,header:E,title:I,content:y,body:T,closeButton:g,media:B,footer:z,imgSrcVertical:L,imgSrcHorizontal:R,loading:b,palette:_,closeFn:w,...A}=e;const P={size:o,sizeXXS:n,sizeXS:s,sizeS:r,sizeM:a,sizeL:l,sizeXL:d};const V={layout:i,layoutXXS:c,layoutXS:p,layoutS:m,layoutM:S,layoutL:u,layoutXL:x};const C={...P,borderRadius:8,marginRight:12,resetDefaultMargin:!0,sizes:SIZES_HEADER_BADGE};const k={...P,as:'span',appearance:'caption',color:'content-onmain-tertiary',weight:700,wordBreak:'break-word',sizes:SIZES_CAPTION};const Z={...P,as:'h2',appearance:'subheading',color:'inherit',marginBottom:y?'0.4em':void 0,wordBreak:'break-word',sizes:SIZES_TITLE};const O={...P,as:'p',appearance:'body',color:'inherit',wordBreak:'break-word',sizes:SIZES_CONTENT};const X={...P,icon:'close',square:!0,marginTop:10,marginRight:10,sizes:SIZES_CLOSE_BUTTON,onClick:()=>{typeof w=='function'&&w()}};return jsx(Root,{...A,...P,...V,layouts:LAYOUTS,palette:_,ref:t,children:isValidElement(h)?h:typeof h=='function'?h({badgeProps:C,captionProps:k,titleProps:Z,contentProps:O,closeButtonProps:X}):jsxs(Fragment,{children:[b||B||R?jsx(Media,{...V,layouts:VISIBILITY_HORIZONTAL,children:b?jsx(AspectRatio,{ratio:"1:1",width:"100%",children:jsx(Skeleton,{})}):isValidElement(B)?B:jsx(AspectRatio,{ratio:"1:1",width:"100%",children:jsx(Img,{src:R})})}):null,jsxs(Container,{children:[jsxs(Content,{children:[b?jsx(Header,{children:jsx(Skeleton,{width:"20%",children:jsx(Badge,{...C})})}):isValidElement(E)?E:typeof E=='function'?E({badgeProps:C,captionProps:k}):j||f?jsxs(Header,{children:[isValidElement(j)?j:typeof j=='function'?j(C):typeof j=='string'||typeof j=='number'?jsx(Badge,{...C,children:j}):null,isValidElement(f)?f:typeof f=='function'?f(k):typeof f=='string'||typeof f=='number'?jsx(Text,{...k,children:f}):null]}):null,b||B||L?jsx(Media,{...V,layouts:VISIBILITY_VERTICAL,children:b?jsx(AspectRatio,{ratio:"16:9",width:"100%",children:jsx(Skeleton,{})}):isValidElement(B)?B:jsx(AspectRatio,{ratio:"16:9",width:"100%",children:jsx(Img,{src:L})})}):null,b?jsxs("div",{children:[jsx(Skeleton,{borderRadius:4,children:jsx(Text,{appearance:"subheading",marginBottom:"0.4em",sizes:SIZES_TITLE,...P})}),jsx(Skeleton,{borderRadius:4,width:"70%",children:jsx(Text,{appearance:"body",marginBottom:"0.4em",sizes:SIZES_CONTENT,...P})}),jsx(Skeleton,{borderRadius:4,width:"50%",children:jsx(Text,{appearance:"body",sizes:SIZES_CONTENT,...P})})]}):isValidElement(T)?T:typeof T=='function'?T({titleProps:Z,contentProps:O}):I||y?jsxs("div",{children:[isValidElement(I)?I:typeof I=='function'?I(Z):typeof I=='string'||typeof I=='number'?jsx(Text,{...Z,children:I}):null,isValidElement(y)?y:typeof y=='function'?y(O):typeof y=='string'||typeof y=='number'?jsx(Text,{...O,children:y}):null]}):null]}),z?jsx(Footer,{children:b?jsx(Skeleton,{width:"100%",children:jsx(Button,{preset:"brand",...P})}):isValidElement(z)?z:null}):null]}),g?jsx(ButtonPosition,{children:isValidElement(g)?g:typeof g=='function'?g(X):null}):null]})})})),{displayName:'PopoverComponent',sizes:SIZES});export{PopoverComponent};
|
|
2
2
|
//# sourceMappingURL=PopoverComponent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverComponent.mjs","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeProps: BadgeProps = {\n ...sizeProps,\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps,\n captionProps,\n titleProps,\n contentProps,\n closeButtonProps,\n })\n ) : (\n <>\n {(loading || media || imgSrcHorizontal) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...badgeProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n badgeProps,\n captionProps,\n })\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge(badgeProps)\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...badgeProps}>{badge}</Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {(loading || media || imgSrcVertical) && (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n titleProps,\n contentProps,\n })\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content(contentProps)\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...contentProps}>{content}</Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer && (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n )}\n </Styled.Container>\n {closeButton && (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n )}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleProps","marginBottom","undefined","SIZES_TITLE","contentProps","SIZES_CONTENT","closeButtonProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","_jsxs","_Fragment","VISIBILITY_HORIZONTAL","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"ooBAiBMA,MAAAA,iBAA2EC,gBAI/EC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,QACnBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,QACLA,EAAOC,KACPA,EAAIC,YACJA,EAAWC,MACXA,EAAKC,OACLA,EAAMC,eACNA,EAAcC,iBACdA,EAAgBC,QAChBA,EAAOC,QACPA,EAAOC,QACPA,KACGC,GACD/B,EAEJ,MAAMgC,EAAY,CAChB9B,OACAE,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAMwB,EAAc,CAClB9B,SACAO,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMmB,EAAyB,IAC1BF,EACHG,aAAc,EACdC,YAAa,GACbC,oBAAoB,EACpBC,MAAOC,oBAGT,MAAMC,EAA0B,I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,EAAYY,SAAG1C,IACvB,QAEJ,QAELI,GACCkC,IAACC,OAAa,CAAAG,SACXnC,EACC+B,IAACY,SAAQ,CAACD,MAAM,OAAMP,SACpBJ,IAACiB,OAAM,CAACC,OAAO,WAAY7C,MAE3BgC,eAAevC,GACjBA,EACE,UAITF,GACCoC,IAACC,eAAqB,CAAAG,SACnBC,eAAezC,GACZA,SACOA,GAAgB,WACvBA,EAAY8B,GACZ,WAKA,IAGlB,CACEyB,YA3PmB,mBA4PnBxC,MAAOyC"}
|
|
1
|
+
{"version":3,"file":"PopoverComponent.mjs","sources":["../../../../src/components/PopoverComponent/PopoverComponent.tsx"],"sourcesContent":["import { forwardRef, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Badge } from 'components/Badge'\nimport { Text } from 'components/Text'\nimport { Button } from 'components/Button'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { BadgeProps } from 'components/Badge'\nimport type { TextProps } from 'components/Text'\nimport { SIZES, SIZES_CLOSE_BUTTON, SIZES_HEADER_BADGE, SIZES_CAPTION, SIZES_TITLE, SIZES_CONTENT } from './sizes'\nimport { LAYOUTS, VISIBILITY_HORIZONTAL, VISIBILITY_VERTICAL } from './layouts'\nimport * as Styled from './style'\nimport type { PopoverComponentProps } from './types'\n\nconst COMPONENT_NAME = 'PopoverComponent'\n\nconst PopoverComponent: React.ForwardRefExoticComponent<PopoverComponentProps> = withMergedProps<\n PopoverComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<PopoverComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n badge,\n caption,\n header,\n title,\n content,\n body,\n closeButton,\n media,\n footer,\n imgSrcVertical,\n imgSrcHorizontal,\n loading,\n palette,\n closeFn,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const badgeProps: BadgeProps = {\n ...sizeProps,\n borderRadius: 8,\n marginRight: 12,\n resetDefaultMargin: true,\n sizes: SIZES_HEADER_BADGE,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n as: 'span',\n appearance: 'caption',\n color: 'content-onmain-tertiary',\n weight: 700,\n wordBreak: 'break-word',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'subheading',\n color: 'inherit',\n marginBottom: content ? '0.4em' : undefined,\n wordBreak: 'break-word',\n sizes: SIZES_TITLE,\n }\n\n const contentProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'inherit',\n wordBreak: 'break-word',\n sizes: SIZES_CONTENT,\n }\n\n const closeButtonProps: IconButtonProps = {\n ...sizeProps,\n icon: 'close',\n square: true,\n marginTop: 10,\n marginRight: 10,\n sizes: SIZES_CLOSE_BUTTON,\n onClick: () => {\n if (typeof closeFn === 'function') closeFn()\n },\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} {...layoutProps} layouts={LAYOUTS} palette={palette} ref={ref}>\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n badgeProps,\n captionProps,\n titleProps,\n contentProps,\n closeButtonProps,\n })\n ) : (\n <>\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='1:1' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='1:1' width='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Container>\n <Styled.Content>\n {loading ? (\n <Styled.Header>\n <Skeleton width='20%'>\n <Badge {...badgeProps} />\n </Skeleton>\n </Styled.Header>\n ) : isValidElement(header) ? (\n header\n ) : typeof header === 'function' ? (\n header({\n badgeProps,\n captionProps,\n })\n ) : badge || caption ? (\n <Styled.Header>\n {isValidElement(badge) ? (\n badge\n ) : typeof badge === 'function' ? (\n badge(badgeProps)\n ) : typeof badge === 'string' || typeof badge === 'number' ? (\n <Badge {...badgeProps}>{badge}</Badge>\n ) : null}\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n </Styled.Header>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={VISIBILITY_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='16:9' width='100%'>\n <Skeleton />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='16:9' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading ? (\n <div>\n <Skeleton borderRadius={4}>\n <Text appearance='subheading' marginBottom='0.4em' sizes={SIZES_TITLE} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='70%'>\n <Text appearance='body' marginBottom='0.4em' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n <Skeleton borderRadius={4} width='50%'>\n <Text appearance='body' sizes={SIZES_CONTENT} {...sizeProps} />\n </Skeleton>\n </div>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n titleProps,\n contentProps,\n })\n ) : title || content ? (\n <div>\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(content) ? (\n content\n ) : typeof content === 'function' ? (\n content(contentProps)\n ) : typeof content === 'string' || typeof content === 'number' ? (\n <Text {...contentProps}>{content}</Text>\n ) : null}\n </div>\n ) : null}\n </Styled.Content>\n {footer ? (\n <Styled.Footer>\n {loading ? (\n <Skeleton width='100%'>\n <Button preset='brand' {...sizeProps} />\n </Skeleton>\n ) : isValidElement(footer) ? (\n footer\n ) : null}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { PopoverComponent }\n"],"names":["PopoverComponent","withMergedProps","forwardRef","props","ref","size","layout","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","badge","caption","header","title","content","body","closeButton","media","footer","imgSrcVertical","imgSrcHorizontal","loading","palette","closeFn","restProps","sizeProps","layoutProps","badgeProps","borderRadius","marginRight","resetDefaultMargin","sizes","SIZES_HEADER_BADGE","captionProps","as","appearance","color","weight","wordBreak","SIZES_CAPTION","titleProps","marginBottom","undefined","SIZES_TITLE","contentProps","SIZES_CONTENT","closeButtonProps","icon","square","marginTop","SIZES_CLOSE_BUTTON","onClick","_jsx","Styled","layouts","LAYOUTS","children","isValidElement","_jsxs","_Fragment","VISIBILITY_HORIZONTAL","AspectRatio","ratio","width","Skeleton","src","Badge","Text","VISIBILITY_VERTICAL","Button","preset","displayName","SIZES"],"mappings":"ooBAkBMA,MAAAA,iBAA2EC,gBAI/EC,YAA+D,CAACC,EAAOC,KACrE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,QACnB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AOY,eAAiBlB,MAE7E2B,IAACY,SAAQ,CAACpC,aAAc,EAAGmC,MAAM,MAAKP,SACpCJ,IAACe,KAAI,CAAChC,WAAW,OAAOM,aAAa,QAAQV,MAAOc,iBAAmBpB,MAEzE2B,IAACY,SAAQ,CAACpC,aAAc,EAAGmC,MAAM,MAAKP,SACpCJ,IAACe,KAAI,CAAChC,WAAW,OAAOJ,MAAOc,iBAAmBpB,SAGpDgC,eAAe1C,GACjBA,SACSA,GAAS,WAClBA,EAAK,CACHyB,aACAI,iBAEA/B,GAASC,EACX4C,KAAA,MAAA,CAAAF,SACG,CAAAC,eAAe5C,GACdA,SACSA,GAAU,WACnBA,EAAM2B,UACG3B,GAAU,iBAAmBA,GAAU,SAChDuC,IAACe,KAAI,IAAK3B,EAAUgB,SAAG3C,IACrB,KACH4C,eAAe3C,GACdA,SACSA,GAAY,WACrBA,EAAQ8B,UACC9B,GAAY,iBAAmBA,GAAY,SACpDsC,IAACe,KAAI,IAAKvB,EAAYY,SAAG1C,IACvB,QAEJ,QAELI,EACCkC,IAACC,OAAa,CAAAG,SACXnC,EACC+B,IAACY,SAAQ,CAACD,MAAM,OAAMP,SACpBJ,IAACiB,OAAM,CAACC,OAAO,WAAY7C,MAE3BgC,eAAevC,GACjBA,EACE,OAEJ,QAELF,EACCoC,IAACC,eAAqB,CAAAG,SACnBC,eAAezC,GACZA,SACOA,GAAgB,WACrBA,EAAY8B,GACZ,OAEN,SAGI,IAGlB,CACEyB,YA3PmB,mBA4PnBxC,MAAOyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import { ColorProperty } from 'mixins/color'\nimport { 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\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'backgroundColor'>`](#/Миксины)\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":"4OAoBA,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 { ColorProperty } from 'mixins/color'\nimport { 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\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'backgroundColor'>`](#/Миксины)\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":"oNAoBA,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,2 +1,2 @@
|
|
|
1
|
-
'use strict';var styled=require('styled-components');var tinycolor=require('tinycolor2');var color=require('../../mixins/color.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);var tinycolor__default=_interopDefault(tinycolor);const move=styled.keyframes(["0%{background-position:0 0;}100%{background-position:50px 50px;}"]);const bgColor=o=>styled.css(["background-color:",";"],tinycolor__default.default(o).setAlpha(.6).toString());const isLoading=styled.css(["background-image:linear-gradient( -45deg,rgba(255,255,255,0.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.4) 50%,rgba(255,255,255,0.4) 75%,transparent 75%,transparent );background-size:25px 25px;animation:"," 2s linear infinite;"],move);const Root=styled__default.default.div.withConfig({displayName:"Progress__Root",componentId:"ui__sc-1vq95i6-0"})(["display:block;height:4px;border-radius:40px;overflow:hidden;"," ",""],(o=>o.backgroundColor?color.color(o.backgroundColor,bgColor):null),(o=>o.color?color.color(o.color):null));const Bar=styled__default.default.div.withConfig({shouldForwardProp:()=>!1}).withConfig({displayName:"Progress__Bar",componentId:"ui__sc-1vq95i6-1"})(["width:0;transition:width 1s ease-in-out;height:100%;border-radius:inherit;color:inherit;background-color:
|
|
1
|
+
'use strict';var styled=require('styled-components');var tinycolor=require('tinycolor2');var color=require('../../mixins/color.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);var tinycolor__default=_interopDefault(tinycolor);const move=styled.keyframes(["0%{background-position:0 0;}100%{background-position:50px 50px;}"]);const bgColor=o=>styled.css(["background-color:",";"],tinycolor__default.default(o).setAlpha(.6).toString());const isLoading=styled.css(["background-image:linear-gradient( -45deg,rgba(255,255,255,0.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.4) 50%,rgba(255,255,255,0.4) 75%,transparent 75%,transparent );background-size:25px 25px;animation:"," 2s linear infinite;"],move);const Root=styled__default.default.div.withConfig({displayName:"Progress__Root",componentId:"ui__sc-1vq95i6-0"})(["display:block;height:4px;border-radius:40px;overflow:hidden;"," ",""],(o=>o.backgroundColor?color.color(o.backgroundColor,bgColor):null),(o=>o.color?color.color(o.color):null));const Bar=styled__default.default.div.withConfig({shouldForwardProp:()=>!1}).withConfig({displayName:"Progress__Bar",componentId:"ui__sc-1vq95i6-1"})(["width:0;transition:width 1s ease-in-out;height:100%;border-radius:inherit;color:inherit;background-color:currentcolor;"," ",""],(o=>o.isLoading?isLoading:null),(o=>o.width?styled.css(["width:","%;"],o.width):styled.css(["width:0%;"])));exports.Bar=Bar,exports.Root=Root;
|
|
2
2
|
//# sourceMappingURL=style.js.map
|