@foxford/ui 2.76.1 → 2.77.0-beta-ee6908c-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 -6
- 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
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const Avatar=withMergedProps(forwardRef(((t,e)=>{const{size:r="m",textProps:o={},children:s,text:i,...a}=t;const m=typeof r!='string'||a.preset!=='default'&&r!=='sm'?r:SIZES_MAPPING_RULES[r]??r;return jsx(Root,{...a,size:m,ref:e,children:a.loading?jsx(Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):s??(!a.src&&jsx(Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...o,children:abbreviateCaption(i||a.title||'')}))})})),{displayName:'Avatar',sizes:t=>t.preset==='brand'?t.square?SIZES_SQUARE:SIZES:SIZES_DEFAULT});export{Avatar,SIZES,SIZES_SQUARE};
|
|
2
2
|
//# sourceMappingURL=Avatar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? SIZES_MAPPING_RULES[size] ?? size\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"+YAuBMA,MAAAA,OAAuDC,gBAC3DC,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,oBAAoBP,IAASA,EAGpC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,IAACS,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,aAAeC,MAGhCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"uCAAkCA,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n // eslint-disable-next-line no-param-reassign\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"uCAAkCA,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAE7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["abbreviateCaption","caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"AAAO,MAAMA,kBAAqBC,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../../src/components/Avatar/utils.ts"],"sourcesContent":["export const abbreviateCaption = (caption: string): string =>\n caption\n .split(' ')\n .map((seq) => seq.trim())\n .filter((seq) => seq.length !== 0)\n .slice(0, 2)\n .reduce((abbreviation, seq) => {\n if (typeof seq === 'string') {\n const symbolCodePoint = seq.codePointAt(0)\n\n if (typeof symbolCodePoint === 'number') {\n // eslint-disable-next-line no-param-reassign\n abbreviation += String.fromCodePoint(symbolCodePoint)\n }\n }\n\n return abbreviation\n }, '') || '#'\n"],"names":["abbreviateCaption","caption","split","map","seq","trim","filter","length","slice","reduce","abbreviation","symbolCodePoint","codePointAt","String","fromCodePoint"],"mappings":"AAAO,MAAMA,kBAAqBC,GAChCA,EACGC,MAAM,KACNC,KAAKC,GAAQA,EAAIC,SACjBC,QAAQF,GAAQA,EAAIG,SAAW,IAC/BC,MAAM,EAAG,GACTC,QAAO,CAACC,EAAcN,KACrB,UAAWA,GAAQ,SAAU,CAC3B,MAAMO,EAAkBP,EAAIQ,YAAY,UAE7BD,GAAoB,WAE7BD,GAAgBG,OAAOC,cAAcH,GAEzC,CAEA,OAAOD,CAAY,GAClB,KAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Badge=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="s",borderRadius:t=3,textProps:
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var style=require('./style.js');var constants=require('./constants.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Badge=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="s",borderRadius:t=3,textProps:n={},iconProps:i={},children:o,content:c,icon:a,...d}=e;const[u,x]=Array.isArray(a)?a:[a];const j={as:'span',size:'inherit',color:'inherit',marginLeft:u?'0.25em':void 0,marginRight:x?'0.25em':void 0};const p={color:'inherit'};return jsxRuntime.jsx(style.Root,{...d,size:s,borderRadius:t,ref:r,children:typeof o=='function'?o({baseTextProps:j,textProps:n,iconBaseProps:p,iconProps:i,icon:a}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u?jsxRuntime.jsx(Icon.Icon,{name:typeof u=='string'?u:void 0,icon:typeof u!='string'?u:void 0,...p,...i}):null,o||c?jsxRuntime.jsx(Text.Text,{...j,...n,children:o||c}):null,x?jsxRuntime.jsx(Icon.Icon,{name:typeof x=='string'?x:void 0,icon:typeof x!='string'?x:void 0,...p,...i}):null]})})})),{displayName:'Badge',sizes:e=>e.round?constants.SIZES_ROUND:constants.SIZES});exports.Badge=Badge;
|
|
2
2
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"iSAuBO,MAAMA,MAAqDC,gBAAAA,gBAChEC,MAAAA,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,WAAAA,IAACC,MAAAA,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,WAAAC,KAAAC,oBAAA,CAAAnB,SACGI,CAAAA,EACCW,WAAAK,IAACC,UAAI,CACHC,YAAalB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,WAAAA,IAACQ,KAAAA,KAAI,IAAKf,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,WAAAA,IAACM,KAAAA,KAAI,CACHC,YAAajB,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEyB,YArEmB,QAsEnBC,MAAQ/B,GAAWA,EAAMgC,MAAQC,UAAWA,YAAGC,UAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Root}from'./style.mjs';import{SIZES_ROUND,SIZES}from'./constants.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const Badge=withMergedProps(forwardRef(((o,r)=>{const{size:e="s",borderRadius:t=3,textProps:s={},iconProps:i={},children:n,content:c,icon:m,...a}=o;const[d,p]=Array.isArray(m)?m:[m];const f={as:'span',size:'inherit',color:'inherit',marginLeft:d?'0.25em':void 0,marginRight:p?'0.25em':void 0};const x={color:'inherit'};return jsx(Root,{...a,size:e,borderRadius:t,ref:r,children:typeof n=='function'?n({baseTextProps:f,textProps:s,iconBaseProps:x,iconProps:i,icon:m}):jsxs(Fragment,{children:[d
|
|
1
|
+
import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{Root}from'./style.mjs';import{SIZES_ROUND,SIZES}from'./constants.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const Badge=withMergedProps(forwardRef(((o,r)=>{const{size:e="s",borderRadius:t=3,textProps:s={},iconProps:i={},children:n,content:c,icon:m,...a}=o;const[d,p]=Array.isArray(m)?m:[m];const f={as:'span',size:'inherit',color:'inherit',marginLeft:d?'0.25em':void 0,marginRight:p?'0.25em':void 0};const x={color:'inherit'};return jsx(Root,{...a,size:e,borderRadius:t,ref:r,children:typeof n=='function'?n({baseTextProps:f,textProps:s,iconBaseProps:x,iconProps:i,icon:m}):jsxs(Fragment,{children:[d?jsx(Icon,{name:typeof d=='string'?d:void 0,icon:typeof d!='string'?d:void 0,...x,...i}):null,n||c?jsx(Text,{...f,...s,children:n||c}):null,p?jsx(Icon,{name:typeof p=='string'?p:void 0,icon:typeof p!='string'?p:void 0,...x,...i}):null]})})})),{displayName:'Badge',sizes:o=>o.round?SIZES_ROUND:SIZES});export{Badge};
|
|
2
2
|
//# sourceMappingURL=Badge.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before
|
|
1
|
+
{"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"8RAuBO,MAAMA,MAAqDC,gBAChEC,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,IAACC,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,KAAAC,SAAA,CAAAlB,SACGI,CAAAA,EACCW,IAACI,KAAI,CACHC,YAAahB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,IAACM,KAAI,IAAKb,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,IAACI,KAAI,CACHC,YAAaf,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEuB,YArEmB,QAsEnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,YAAcC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var styled=require('styled-components');var useClassname=require('../../hooks/useClassname.js');var withMergedProps=require('../../hocs/withMergedProps.js');var hooks=require('./hooks.js');var constants=require('./constants.js');var defaultConstants=require('./default-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');const Button=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{let{size:t="m",inline:n=!0,rounded:o=!0,color:r="accent",fontColor:a="white",textProps:i={},iconProps:c={},as:
|
|
1
|
+
'use strict';var React=require('react');var styled=require('styled-components');var useClassname=require('../../hooks/useClassname.js');var withMergedProps=require('../../hocs/withMergedProps.js');var hooks=require('./hooks.js');var constants=require('./constants.js');var defaultConstants=require('./default-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');const Button=withMergedProps.withMergedProps(React.forwardRef(((e,s)=>{let{size:t="m",inline:n=!0,rounded:o=!0,color:r="accent",fontColor:a="white",textProps:i={},iconProps:c={},as:l,className:u,children:d,content:m,fontWeight:p,icon:x,innerRef:h,...j}=e;const f=styled.useTheme();j.preset!=='default'||typeof t!='string'||j.round||(j={...defaultConstants.PROPS_BY_SIZE[t]??{},...j}),j.href&&(l='a'),j.to&&(l=f.link),j.disabled&&(l='button'),j.primary&&(r='primary'),j.secondary&&(r='atlantis');const R=useClassname.useClassname("Button",u);const y=useClassname.useClassname("Button");const S=hooks.useComputedRel(f,j);const g=hooks.useComputedLinkProps(l,j);let[v,I]=Array.isArray(x)?x:[x];j.success&&(v='checkFill',I=null),j.preset==='brand'&&j.loading&&(v=jsxRuntime.jsx(style.LoaderIcon,{}),I=null);const C={as:'span',size:'inherit',color:'inherit',weight:p??(j.preset==='brand'?800:600),lineHeight:j.preset==='brand'?1.2:1,marginLeft:v?'0.25em':void 0,marginRight:I?'0.25em':void 0};const P={as:'span',color:'inherit'};return jsxRuntime.jsx(style.Root,{...j,...g,size:t,inline:n,color:r,fontColor:a,rounded:o,rel:S,as:l,className:R,ref:s??h,children:typeof d=='function'?d({baseTextProps:C,textProps:i,iconBaseProps:P,iconProps:c,icon:[v,I]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v?jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...P,...c}):null,d||m?jsxRuntime.jsx(Text.Text,{className:`${y}__content`,...C,...i,children:d||m}):null,I?jsxRuntime.jsx(Icon.Icon,{className:"icon",name:typeof I=='string'?I:void 0,icon:typeof I!='string'?I:void 0,...P,...c}):null]})})})),{displayName:"Button",sizes:e=>{let s=e.preset==='brand'?constants.SIZES:defaultConstants.SIZES_DEFAULT;return e.round&&(s=e.preset==='brand'?constants.SIZES_ROUND:defaultConstants.SIZES_ROUND_DEFAULT),s}});exports.SIZES=constants.SIZES,exports.SIZES_ROUND=constants.SIZES_ROUND,exports.Button=Button,exports.COMPONENT_NAME="Button";
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"wdA6BMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,OAAAA,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,iBAAAA,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aAAAA,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,0BA/CH,UAgDnB,MAAME,EAAMC,MAAAA,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,MAAAA,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,WAAAC,IAACC,qBACVP,EAAQ,MAGV,MAAMQ,EAA2B,CAC/BpC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPyC,OAAQhC,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D2B,WAAY9B,EAAUG,SAAW,QAAU,IAAM,EACjD4B,WAAYZ,EAAS,cAAWa,EAChCC,YAAab,EAAQ,cAAWY,GAGlC,MAAME,EAA2B,CAAE1C,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,WAAAA,IAACE,MAAAA,KAAW,IACN3B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPiC,gBACAtC,YACA4C,gBACA3C,YACAO,KAAM,CAACqB,EAAQC,KAGjBe,WAAAC,KAAAC,oBAAA,CAAA1C,SACGwB,CAAAA,EACCM,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAapB,GAAW,SAAWA,OAASa,EAC5ClC,YAAaqB,GAAW,SAAWA,OAASa,KACxCE,KACA3C,IAEJ,KACHI,GAAYC,EACX6B,WAAAA,IAACe,KAAAA,KAAI,CAAC9C,UAAW,GAAGoB,gBAA8Bc,KAAmBtC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,WAAAA,IAACa,KAAAA,KAAI,CACH5C,UAAU,OACV6C,YAAanB,GAAU,SAAWA,OAAQY,EAC1ClC,YAAasB,GAAU,SAAWA,OAAQY,KACtCE,KACA3C,IAEJ,SAGI,IAGlB,CACEkD,YAhImB,SAiInBC,MAAQ3D,IACN,IAAI2D,EAAQ3D,EAAMoB,SAAW,QAAUwC,UAAAA,MAAQC,iBAAAA,cAG/C,OAFI7D,EAAMqB,QAAOsC,EAAQ3D,EAAMoB,SAAW,QAAU0C,UAAWA,YAAGC,sCAE3DJ,CAAK,yHArIK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import{useTheme}from'styled-components';import{useClassname}from'../../hooks/useClassname.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useComputedRel,useComputedLinkProps}from'./hooks.mjs';import{SIZES,SIZES_ROUND}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_ROUND_DEFAULT,PROPS_BY_SIZE}from'./default-constants.mjs';import{Root,LoaderIcon}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const COMPONENT_NAME='Button';const Button=withMergedProps(forwardRef(((o,e)=>{let{size:t="m",inline:s=!0,rounded:
|
|
1
|
+
import{forwardRef}from'react';import{useTheme}from'styled-components';import{useClassname}from'../../hooks/useClassname.mjs';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useComputedRel,useComputedLinkProps}from'./hooks.mjs';import{SIZES,SIZES_ROUND}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_ROUND_DEFAULT,PROPS_BY_SIZE}from'./default-constants.mjs';import{Root,LoaderIcon}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const COMPONENT_NAME='Button';const Button=withMergedProps(forwardRef(((o,e)=>{let{size:t="m",inline:s=!0,rounded:n=!0,color:r="accent",fontColor:i="white",textProps:a={},iconProps:m={},as:c,className:l,children:p,content:d,fontWeight:u,icon:f,innerRef:S,...h}=o;const E=useTheme();h.preset!=='default'||typeof t!='string'||h.round||(h={...PROPS_BY_SIZE[t]??{},...h}),h.href&&(c='a'),h.to&&(c=E.link),h.disabled&&(c='button'),h.primary&&(r='primary'),h.secondary&&(r='atlantis');const I=useClassname("Button",l);const g=useClassname("Button");const j=useComputedRel(E,h);const x=useComputedLinkProps(c,h);let[N,P]=Array.isArray(f)?f:[f];h.success&&(N='checkFill',P=null),h.preset==='brand'&&h.loading&&(N=jsx(LoaderIcon,{}),P=null);const _={as:'span',size:'inherit',color:'inherit',weight:u??(h.preset==='brand'?800:600),lineHeight:h.preset==='brand'?1.2:1,marginLeft:N?'0.25em':void 0,marginRight:P?'0.25em':void 0};const R={as:'span',color:'inherit'};return jsx(Root,{...h,...x,size:t,inline:s,color:r,fontColor:i,rounded:n,rel:j,as:c,className:I,ref:e??S,children:typeof p=='function'?p({baseTextProps:_,textProps:a,iconBaseProps:R,iconProps:m,icon:[N,P]}):jsxs(Fragment,{children:[N?jsx(Icon,{className:"icon",name:typeof N=='string'?N:void 0,icon:typeof N!='string'?N:void 0,...R,...m}):null,p||d?jsx(Text,{className:`${g}__content`,..._,...a,children:p||d}):null,P?jsx(Icon,{className:"icon",name:typeof P=='string'?P:void 0,icon:typeof P!='string'?P:void 0,...R,...m}):null]})})})),{displayName:"Button",sizes:o=>{let e=o.preset==='brand'?SIZES:SIZES_DEFAULT;return o.round&&(e=o.preset==='brand'?SIZES_ROUND:SIZES_ROUND_DEFAULT),e}});export{Button,COMPONENT_NAME,SIZES,SIZES_ROUND};
|
|
2
2
|
//# sourceMappingURL=Button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["COMPONENT_NAME","Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"0hBAiBMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,aA/CH,UAgDnB,MAAME,EAAMC,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,IAACC,eACVN,EAAQ,MAGV,MAAMO,EAA2B,CAC/BnC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPwC,OAAQ/B,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D0B,WAAY7B,EAAUG,SAAW,QAAU,IAAM,EACjD2B,WAAYX,EAAS,cAAWY,EAChCC,YAAaZ,EAAQ,cAAWW,GAGlC,MAAME,EAA2B,CAAEzC,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,IAACC,KAAW,IACN1B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPgC,gBACArC,YACA2C,gBACA1C,YACAO,KAAM,CAACqB,EAAQC,KAGjBc,KAAAC,SAAA,CAAAxC,SACGwB,CAAAA,EACCM,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAalB,GAAW,SAAWA,OAASY,EAC5CjC,YAAaqB,GAAW,SAAWA,OAASY,KACxCE,KACA1C,IAEJ,KACHI,GAAYC,EACX6B,IAACa,KAAI,CAAC5C,UAAW,GAAGoB,gBAA8Ba,KAAmBrC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAajB,GAAU,SAAWA,OAAQW,EAC1CjC,YAAasB,GAAU,SAAWA,OAAQW,KACtCE,KACA1C,IAEJ,SAGI,IAGlB,CACEgD,YAhImB,SAiInBC,MAAQzD,IACN,IAAIyD,EAAQzD,EAAMoB,SAAW,QAAUsC,MAAQC,cAG/C,OAFI3D,EAAMqB,QAAOoC,EAAQzD,EAAMoB,SAAW,QAAUwC,YAAcC,qBAE3DJ,CAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["_as","config","props","undefined","disabled","href","to","target","theme","relBuilder","utils","rel","autoRel"],"mappings":"0CAmBO,CAA8BA,EAAwBC,KAC3D,IAAIC,EAAQ,CAAA,EAEZ,OAAIF,SAAQG,GAAaF,EAAOG,WAE5BJ,IAAQ,IACVE,EAAQ,CAAEG,KAAMJ,EAAOI,MAAQJ,EAAOK,GAAIC,OAAQN,EAAOM,eACzCP,GAAQ,WACxBE,EAAQ,CAAEI,GAAIL,EAAOK,IAAML,EAAOI,QALaH,CASnD,yBA5BO,CAAwBM,EAAqBP,KAClD,MAAMQ,EAAaD,EAAME,OAAOD,WAEhC,IAAIE,EAUJ,OARIV,EAAOI,OACTM,EAAMV,EAAOU,KAERA,GAAOF,GAAcR,EAAOW,UAAYX,EAAOI,MAAQJ,EAAOK,MACjEK,EAAMF,EAAWR,EAAOI,MAAQJ,EAAOK,GAAIL,EAAOM,UAI/CI,CACT"}
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["_as","config","props","undefined","disabled","href","to","target","theme","relBuilder","utils","rel","autoRel"],"mappings":"0CAmBO,CAA8BA,EAAwBC,KAC3D,IAAIC,EAAQ,CAAA,EAEZ,OAAIF,SAAQG,GAAaF,EAAOG,WAE5BJ,IAAQ,IACVE,EAAQ,CAAEG,KAAMJ,EAAOI,MAAQJ,EAAOK,GAAIC,OAAQN,EAAOM,eACzCP,GAAQ,WACxBE,EAAQ,CAAEI,GAAIL,EAAOK,IAAML,EAAOI,QALaH,CASnD,yBA5BO,CAAwBM,EAAqBP,KAClD,MAAMQ,EAAaD,EAAME,OAAOD,WAEhC,IAAIE,EAUJ,OARIV,EAAOI,OACTM,EAAMV,EAAOU,KAERA,GAAOF,GAAcR,EAAOW,UAAYX,EAAOI,MAAQJ,EAAOK,MACjEK,EAAMF,EAAWR,EAAOI,MAAQJ,EAAOK,GAAIL,EAAOM,UAI/CI,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.mjs","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["useComputedRel","theme","config","relBuilder","utils","rel","href","autoRel","to","target","useComputedLinkProps","_as","props","undefined","disabled"],"mappings":"AAGO,SAASA,eAAeC,EAAqBC,GAClD,MAAMC,EAAaF,EAAMG,OAAOD,WAEhC,IAAIE,EAUJ,OARIH,EAAOI,OACTD,EAAMH,EAAOG,KAERA,GAAOF,GAAcD,EAAOK,UAAYL,EAAOI,MAAQJ,EAAOM,MACjEH,EAAMF,EAAWD,EAAOI,MAAQJ,EAAOM,GAAIN,EAAOO,UAI/CJ,CACT,CAEO,SAASK,qBAAqBC,EAAwBT,GAC3D,IAAIU,EAAQ,CAAA,EAEZ,OAAID,SAAQE,GAAaX,EAAOY,WAE5BH,IAAQ,IACVC,EAAQ,CAAEN,KAAMJ,EAAOI,MAAQJ,EAAOM,GAAIC,OAAQP,EAAOO,eACzCE,GAAQ,WACxBC,EAAQ,CAAEJ,GAAIN,EAAOM,IAAMN,EAAOI,QALaM,CASnD"}
|
|
1
|
+
{"version":3,"file":"hooks.mjs","sources":["../../../../src/components/Button/hooks.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport type { ButtonProps } from './types'\n\nexport function useComputedRel(theme: DefaultTheme, config: ButtonProps) {\n const relBuilder = theme.utils?.relBuilder\n\n let rel\n\n if (config.href) {\n rel = config.rel\n\n if (!rel && relBuilder && config.autoRel && (config.href || config.to)) {\n rel = relBuilder(config.href ?? config.to, config.target)\n }\n }\n\n return rel\n}\n\nexport function useComputedLinkProps(_as: ButtonProps['as'], config: ButtonProps) {\n let props = {}\n\n if (_as === undefined || config.disabled) return props\n\n if (_as === 'a') {\n props = { href: config.href || config.to, target: config.target }\n } else if (typeof _as !== 'string') {\n props = { to: config.to || config.href }\n }\n\n return props\n}\n"],"names":["useComputedRel","theme","config","relBuilder","utils","rel","href","autoRel","to","target","useComputedLinkProps","_as","props","undefined","disabled"],"mappings":"AAGO,SAASA,eAAeC,EAAqBC,GAClD,MAAMC,EAAaF,EAAMG,OAAOD,WAEhC,IAAIE,EAUJ,OARIH,EAAOI,OACTD,EAAMH,EAAOG,KAERA,GAAOF,GAAcD,EAAOK,UAAYL,EAAOI,MAAQJ,EAAOM,MACjEH,EAAMF,EAAWD,EAAOI,MAAQJ,EAAOM,GAAIN,EAAOO,UAI/CJ,CACT,CAEO,SAASK,qBAAqBC,EAAwBT,GAC3D,IAAIU,EAAQ,CAAA,EAEZ,OAAID,SAAQE,GAAaX,EAAOY,WAE5BH,IAAQ,IACVC,EAAQ,CAAEN,KAAMJ,EAAOI,MAAQJ,EAAOM,GAAIC,OAAQP,EAAOO,eACzCE,GAAQ,WACxBC,EAAQ,CAAEJ,GAAIN,EAAOM,IAAMN,EAAOI,QALaM,CASnD"}
|