@pushwoosh/dumb-components 1.0.0 → 1.0.2
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/ActionsGroup/ActionsGroup.d.ts +3 -0
- package/ActionsGroup/ActionsGroup.js +18 -0
- package/ActionsGroup/ActionsGroupItem.d.ts +3 -0
- package/ActionsGroup/ActionsGroupItem.js +12 -0
- package/ActionsGroup/index.d.ts +3 -0
- package/ActionsGroup/index.js +2 -0
- package/ActionsGroup/styles.d.ts +7 -0
- package/ActionsGroup/styles.js +22 -0
- package/ActionsGroup/types.d.ts +12 -0
- package/Badge/Badge.d.ts +3 -0
- package/Badge/Badge.js +16 -0
- package/Badge/index.d.ts +2 -0
- package/Badge/index.js +1 -0
- package/Badge/maps.d.ts +19 -0
- package/Badge/maps.js +19 -0
- package/Badge/styles.d.ts +5 -0
- package/Badge/styles.js +14 -0
- package/Badge/types.d.ts +8 -0
- package/Banner/Banner.d.ts +3 -0
- package/Banner/Banner.js +82 -0
- package/Banner/colors.d.ts +12 -0
- package/Banner/colors.js +115 -0
- package/Banner/index.d.ts +2 -0
- package/Banner/index.js +1 -0
- package/Banner/maps.d.ts +27 -0
- package/Banner/maps.js +19 -0
- package/Banner/styles.d.ts +29 -0
- package/Banner/styles.js +45 -0
- package/Banner/types.d.ts +20 -0
- package/Button/Button.d.ts +5 -0
- package/Button/Button.js +48 -0
- package/Button/GhostButton.d.ts +1 -0
- package/Button/GhostButton.js +5 -0
- package/Button/colors.d.ts +16 -0
- package/Button/colors.js +130 -0
- package/Button/index.d.ts +3 -0
- package/Button/index.js +2 -0
- package/Button/maps.d.ts +132 -0
- package/Button/maps.js +37 -0
- package/Button/styles.d.ts +120 -0
- package/Button/styles.js +103 -0
- package/Button/types.d.ts +26 -0
- package/CardMetric/CardChildren.d.ts +3 -0
- package/CardMetric/CardChildren.js +25 -0
- package/CardMetric/CardCollapse.d.ts +3 -0
- package/CardMetric/CardCollapse.js +13 -0
- package/CardMetric/CardMetric.d.ts +3 -0
- package/CardMetric/CardMetric.js +62 -0
- package/CardMetric/index.d.ts +2 -0
- package/CardMetric/index.js +1 -0
- package/CardMetric/styles.d.ts +13 -0
- package/CardMetric/styles.js +74 -0
- package/CardMetric/types.d.ts +34 -0
- package/Checkbox/Checkbox.d.ts +3 -0
- package/Checkbox/Checkbox.js +47 -0
- package/Checkbox/index.d.ts +2 -0
- package/Checkbox/index.js +1 -0
- package/Checkbox/maps.d.ts +3 -0
- package/Checkbox/maps.js +7 -0
- package/Checkbox/styles.d.ts +9 -0
- package/Checkbox/styles.js +17 -0
- package/Checkbox/types.d.ts +15 -0
- package/Drawer/Drawer.d.ts +3 -0
- package/Drawer/Drawer.js +62 -0
- package/Drawer/index.d.ts +1 -0
- package/Drawer/index.js +1 -0
- package/Drawer/maps.d.ts +6 -0
- package/Drawer/maps.js +6 -0
- package/Drawer/styles.d.ts +11 -0
- package/Drawer/styles.js +57 -0
- package/Drawer/types.d.ts +18 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +27 -0
- package/DropdownMenu/components/DropdownMenu/hooks.d.ts +4 -0
- package/DropdownMenu/components/DropdownMenu/hooks.js +10 -0
- package/DropdownMenu/components/DropdownMenu/index.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenu/index.js +2 -0
- package/DropdownMenu/components/DropdownMenu/types.d.ts +23 -0
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuContainer/DropdownMenuContainer.js +79 -0
- package/DropdownMenu/components/DropdownMenuContainer/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuContainer/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuContainer/maps.d.ts +26 -0
- package/DropdownMenu/components/DropdownMenuContainer/maps.js +11 -0
- package/DropdownMenu/components/DropdownMenuContainer/styles.d.ts +35 -0
- package/DropdownMenu/components/DropdownMenuContainer/styles.js +109 -0
- package/DropdownMenu/components/DropdownMenuContainer/types.d.ts +19 -0
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuGroup/DropdownMenuGroup.js +12 -0
- package/DropdownMenu/components/DropdownMenuGroup/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuGroup/styles.js +7 -0
- package/DropdownMenu/components/DropdownMenuGroup/types.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuGroup/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +38 -0
- package/DropdownMenu/components/DropdownMenuItem/index.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenuItem/index.js +2 -0
- package/DropdownMenu/components/DropdownMenuItem/styles.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuItem/styles.js +73 -0
- package/DropdownMenu/components/DropdownMenuItem/types.d.ts +24 -0
- package/DropdownMenu/components/DropdownMenuItem/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/DropdownMenuItemCheckbox.js +9 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemCheckbox/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemPick/DropdownMenuItemPick.js +16 -0
- package/DropdownMenu/components/DropdownMenuItemPick/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemPick/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemPick/styles.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemPick/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuItemPick/types.d.ts +2 -0
- package/DropdownMenu/components/DropdownMenuItemPick/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/DropdownMenuItemRadio.js +9 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuItemRadio/styles.js +8 -0
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuNested/DropdownMenuNested.js +69 -0
- package/DropdownMenu/components/DropdownMenuNested/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuNested/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuNested/styles.d.ts +8 -0
- package/DropdownMenu/components/DropdownMenuNested/styles.js +35 -0
- package/DropdownMenu/components/DropdownMenuNested/types.d.ts +6 -0
- package/DropdownMenu/components/DropdownMenuNested/types.js +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuWindow/DropdownMenuWindow.js +12 -0
- package/DropdownMenu/components/DropdownMenuWindow/index.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/index.js +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/styles.d.ts +1 -0
- package/DropdownMenu/components/DropdownMenuWindow/styles.js +7 -0
- package/DropdownMenu/components/DropdownMenuWindow/types.d.ts +5 -0
- package/DropdownMenu/components/DropdownMenuWindow/types.js +1 -0
- package/DropdownMenu/index.d.ts +9 -0
- package/DropdownMenu/index.js +9 -0
- package/EditableField/EditableField.d.ts +3 -0
- package/EditableField/EditableField.js +61 -0
- package/EditableField/index.d.ts +2 -0
- package/EditableField/index.js +1 -0
- package/EditableField/styles.d.ts +8 -0
- package/EditableField/styles.js +25 -0
- package/EditableField/types.d.ts +15 -0
- package/EditableField/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.d.ts +3 -11
- package/EmailTemplatePreview/EmailTemplatePreview.js +11 -10
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.d.ts +2 -2
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +3 -3
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/assets/PW_logo.svg +1 -5
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.js → styles.js} +2 -2
- package/EmailTemplatePreview/{styled.js → styles.js} +1 -1
- package/EmailTemplatePreview/types.d.ts +8 -0
- package/EmailTemplatePreview/types.js +1 -0
- package/ExportResult/ExportResult.d.ts +2 -2
- package/ExportResult/ExportResult.js +11 -10
- package/ExportResult/{styled.js → styles.js} +5 -5
- package/FieldBox/FieldBox.d.ts +3 -3
- package/FieldBox/FieldBox.js +8 -7
- package/FieldBox/index.d.ts +1 -1
- package/FieldBox/types.js +1 -0
- package/InputFile/InputFile.d.ts +3 -0
- package/InputFile/InputFile.js +88 -0
- package/InputFile/index.d.ts +1 -0
- package/InputFile/index.js +1 -0
- package/InputFile/styles.d.ts +5 -0
- package/InputFile/styles.js +29 -0
- package/InputFile/types.d.ts +25 -0
- package/InputFile/types.js +1 -0
- package/Link/Link.d.ts +5 -0
- package/Link/Link.js +12 -0
- package/Link/index.d.ts +1 -0
- package/Link/index.js +1 -0
- package/Link/styles.d.ts +1 -0
- package/Link/styles.js +7 -0
- package/Link/types.d.ts +21 -0
- package/Link/types.js +1 -0
- package/Modal/components/Modal/Modal.d.ts +3 -0
- package/Modal/components/Modal/Modal.js +51 -0
- package/Modal/components/Modal/index.d.ts +1 -0
- package/Modal/components/Modal/index.js +1 -0
- package/Modal/components/Modal/maps.d.ts +6 -0
- package/Modal/components/Modal/maps.js +6 -0
- package/Modal/components/Modal/styles.d.ts +13 -0
- package/Modal/components/Modal/styles.js +45 -0
- package/Modal/components/Modal/types.d.ts +13 -0
- package/Modal/components/Modal/types.js +1 -0
- package/Modal/components/ModalConfirm/ModalConfirm.d.ts +3 -0
- package/Modal/components/ModalConfirm/ModalConfirm.js +54 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +4 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +35 -0
- package/Modal/components/ModalConfirm/hooks.d.ts +2 -0
- package/Modal/components/ModalConfirm/hooks.js +9 -0
- package/Modal/components/ModalConfirm/index.d.ts +3 -0
- package/Modal/components/ModalConfirm/index.js +3 -0
- package/Modal/components/ModalConfirm/types.d.ts +20 -0
- package/Modal/components/ModalConfirm/types.js +1 -0
- package/Modal/components/ModalContent/index.d.ts +1 -0
- package/Modal/components/ModalContent/index.js +1 -0
- package/Modal/components/ModalContent/styled.d.ts +19 -0
- package/Modal/components/ModalContent/styled.js +29 -0
- package/Modal/components/ModalTitle/ModalTitle.d.ts +3 -0
- package/Modal/components/ModalTitle/ModalTitle.js +18 -0
- package/Modal/components/ModalTitle/index.d.ts +1 -0
- package/Modal/components/ModalTitle/index.js +1 -0
- package/Modal/components/ModalTitle/styles.d.ts +1 -0
- package/Modal/components/ModalTitle/styles.js +8 -0
- package/Modal/components/ModalTitle/types.d.ts +5 -0
- package/Modal/components/ModalTitle/types.js +1 -0
- package/Modal/index.d.ts +4 -0
- package/Modal/index.js +4 -0
- package/NumberPicker/NumberPicker.js +2 -2
- package/NumberPicker/{AutosizeInput.d.ts → components/AutosizeInput/AutosizeInput.d.ts} +1 -1
- package/NumberPicker/{AutosizeInput.js → components/AutosizeInput/AutosizeInput.js} +3 -3
- package/NumberPicker/components/AutosizeInput/index.d.ts +1 -0
- package/NumberPicker/components/AutosizeInput/index.js +1 -0
- package/NumberPicker/{AutosizeInput.styled.js → components/AutosizeInput/styles.js} +1 -1
- package/NumberPicker/components/AutosizeInput/types.js +1 -0
- package/NumberPicker/{styled.js → styles.js} +3 -3
- package/PageHeader/components/AutosizeInput/AutosizeInput.d.ts +3 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +80 -0
- package/PageHeader/components/AutosizeInput/constants.d.ts +2 -0
- package/PageHeader/components/AutosizeInput/constants.js +2 -0
- package/PageHeader/components/AutosizeInput/index.d.ts +1 -0
- package/PageHeader/components/AutosizeInput/index.js +1 -0
- package/PageHeader/components/AutosizeInput/styles.d.ts +5 -0
- package/PageHeader/components/AutosizeInput/styles.js +20 -0
- package/PageHeader/components/AutosizeInput/types.d.ts +10 -0
- package/PageHeader/components/AutosizeInput/types.js +1 -0
- package/PageHeader/components/PageHeader/PageHeader.d.ts +3 -0
- package/PageHeader/components/PageHeader/PageHeader.js +51 -0
- package/PageHeader/components/PageHeader/index.d.ts +1 -0
- package/PageHeader/components/PageHeader/index.js +1 -0
- package/PageHeader/components/PageHeader/styles.d.ts +9 -0
- package/PageHeader/components/PageHeader/styles.js +29 -0
- package/PageHeader/components/PageHeader/types.d.ts +15 -0
- package/PageHeader/components/PageHeader/types.js +1 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.d.ts +3 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +67 -0
- package/PageHeader/components/PageHeaderEditable/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderEditable/index.js +1 -0
- package/PageHeader/components/PageHeaderEditable/styles.d.ts +10 -0
- package/PageHeader/components/PageHeaderEditable/styles.js +33 -0
- package/PageHeader/components/PageHeaderEditable/types.d.ts +21 -0
- package/PageHeader/components/PageHeaderEditable/types.js +1 -0
- package/PageHeader/components/PageHeaderError/PageHeaderError.d.ts +3 -0
- package/PageHeader/components/PageHeaderError/PageHeaderError.js +19 -0
- package/PageHeader/components/PageHeaderError/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderError/index.js +1 -0
- package/PageHeader/components/PageHeaderError/styles.d.ts +6 -0
- package/PageHeader/components/PageHeaderError/styles.js +20 -0
- package/PageHeader/components/PageHeaderError/types.d.ts +5 -0
- package/PageHeader/components/PageHeaderError/types.js +1 -0
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.d.ts +2 -0
- package/PageHeader/components/PageHeaderSkeleton/PageHeaderSkeleton.js +20 -0
- package/PageHeader/components/PageHeaderSkeleton/index.d.ts +1 -0
- package/PageHeader/components/PageHeaderSkeleton/index.js +1 -0
- package/PageHeader/components/PageHeaderSkeleton/styles.d.ts +5 -0
- package/PageHeader/components/PageHeaderSkeleton/styles.js +15 -0
- package/PageHeader/index.d.ts +3 -0
- package/PageHeader/index.js +3 -0
- package/Pagination/Pagination.d.ts +3 -0
- package/Pagination/Pagination.js +85 -0
- package/Pagination/helpers.d.ts +1 -0
- package/Pagination/helpers.js +4 -0
- package/Pagination/index.d.ts +1 -0
- package/Pagination/index.js +1 -0
- package/Pagination/styles.d.ts +8 -0
- package/Pagination/styles.js +35 -0
- package/Pagination/types.d.ts +9 -0
- package/Pagination/types.js +1 -0
- package/Popover/Popover.d.ts +3 -0
- package/Popover/Popover.js +44 -0
- package/Popover/index.d.ts +4 -0
- package/Popover/index.js +2 -0
- package/Popover/styles.d.ts +6 -0
- package/Popover/styles.js +19 -0
- package/Popover/types.d.ts +12 -0
- package/Popover/types.js +1 -0
- package/ProgressBar/ProgressBar.d.ts +2 -2
- package/ProgressBar/ProgressBar.js +20 -17
- package/ProgressBar/{styled.js → styles.js} +10 -10
- package/PushPreview/PushPreview.js +4 -4
- package/PushPreview/{styled.js → styles.js} +8 -8
- package/Radio/Radio.d.ts +3 -0
- package/Radio/Radio.js +37 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.js +1 -0
- package/Radio/maps.d.ts +3 -0
- package/Radio/maps.js +8 -0
- package/Radio/styled.d.ts +5 -0
- package/Radio/styled.js +13 -0
- package/Radio/types.d.ts +12 -0
- package/Radio/types.js +1 -0
- package/ReCaptcha/ReCaptcha.d.ts +2 -0
- package/ReCaptcha/ReCaptcha.js +8 -0
- package/ReCaptcha/constants.d.ts +3 -0
- package/ReCaptcha/constants.js +4 -0
- package/ReCaptcha/helpers.d.ts +1 -0
- package/ReCaptcha/helpers.js +15 -0
- package/ReCaptcha/hooks.d.ts +2 -0
- package/ReCaptcha/hooks.js +66 -0
- package/ReCaptcha/index.d.ts +3 -0
- package/ReCaptcha/index.js +3 -0
- package/ReCaptcha/styles.d.ts +1 -0
- package/ReCaptcha/styles.js +5 -0
- package/ReCaptcha/types.d.ts +8 -0
- package/ReCaptcha/types.js +1 -0
- package/Skeleton/TextSkeleton.d.ts +3 -0
- package/Skeleton/TextSkeleton.js +16 -0
- package/Skeleton/index.d.ts +2 -0
- package/Skeleton/index.js +2 -0
- package/Skeleton/styles.d.ts +4 -0
- package/Skeleton/styles.js +33 -0
- package/Skeleton/types.d.ts +16 -0
- package/Skeleton/types.js +1 -0
- package/SortButton/SortButton.d.ts +6 -0
- package/SortButton/SortButton.js +33 -0
- package/SortButton/constants.d.ts +2 -0
- package/SortButton/constants.js +1 -0
- package/SortButton/index.d.ts +1 -0
- package/SortButton/index.js +1 -0
- package/SortButton/maps.d.ts +10 -0
- package/SortButton/maps.js +15 -0
- package/SortButton/styles.d.ts +3 -0
- package/SortButton/styles.js +9 -0
- package/SortButton/types.d.ts +14 -0
- package/SortButton/types.js +1 -0
- package/Spinner/Spinner.d.ts +3 -0
- package/Spinner/Spinner.js +20 -0
- package/Spinner/assets/index.d.ts +4 -0
- package/Spinner/assets/index.js +6 -0
- package/Spinner/assets/spinner.medium.svg +1 -0
- package/Spinner/assets/spinner.small.svg +1 -0
- package/Spinner/index.d.ts +2 -0
- package/Spinner/index.js +1 -0
- package/Spinner/maps.d.ts +5 -0
- package/Spinner/maps.js +5 -0
- package/Spinner/styles.d.ts +5 -0
- package/Spinner/styles.js +20 -0
- package/Spinner/types.d.ts +6 -0
- package/Spinner/types.js +1 -0
- package/StatisticCard/StatisticCard.d.ts +2 -2
- package/StatisticCard/StatisticCard.js +16 -15
- package/Switch/Switch.d.ts +3 -0
- package/Switch/Switch.js +23 -0
- package/Switch/index.d.ts +1 -0
- package/Switch/index.js +1 -0
- package/Switch/styles.d.ts +5 -0
- package/Switch/styles.js +62 -0
- package/Switch/types.d.ts +15 -0
- package/Switch/types.js +1 -0
- package/Tabs/{tab/tab.d.ts → components/Tab/Tab.d.ts} +2 -2
- package/Tabs/{tab/tab.js → components/Tab/Tab.js} +2 -2
- package/Tabs/components/Tab/index.d.ts +1 -0
- package/Tabs/components/Tab/index.js +1 -0
- package/Tabs/{tab/tab.types.d.ts → components/Tab/types.d.ts} +1 -1
- package/Tabs/components/Tab/types.js +1 -0
- package/Tabs/{tab-bar/tab-bar.js → components/TabBar/TabBar.js} +2 -2
- package/Tabs/components/TabBar/index.d.ts +1 -0
- package/Tabs/components/TabBar/index.js +1 -0
- package/Tabs/{tab-bar/tab-bar.styles.js → components/TabBar/styles.js} +2 -2
- package/Tabs/components/TabBar/types.js +1 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.d.ts → components/TabBarScrollableFrame/TabBarScrollableFrame.d.ts} +1 -1
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.js → components/TabBarScrollableFrame/TabBarScrollableFrame.js} +2 -2
- package/Tabs/components/TabBarScrollableFrame/index.d.ts +1 -0
- package/Tabs/components/TabBarScrollableFrame/index.js +1 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.js → components/TabBarScrollableFrame/styles.js} +5 -5
- package/Tabs/components/TabBarScrollableFrame/types.js +1 -0
- package/Tabs/{tab-base/tab-base.js → components/TabBase/TabBase.js} +1 -1
- package/Tabs/components/TabBase/index.d.ts +1 -0
- package/Tabs/components/TabBase/index.js +1 -0
- package/Tabs/{tab-base/tab-base.styles.js → components/TabBase/styles.js} +4 -4
- package/Tabs/components/TabBase/types.js +1 -0
- package/Tabs/{tab-panel/tab-panel.d.ts → components/TabPanel/TabPanel.d.ts} +1 -1
- package/Tabs/{tab-panel/tab-panel.js → components/TabPanel/TabPanel.js} +1 -1
- package/Tabs/components/TabPanel/index.d.ts +1 -0
- package/Tabs/components/TabPanel/index.js +1 -0
- package/Tabs/{tab-panel → components/TabPanel}/styles.js +1 -1
- package/Tabs/{tab-panel/tab-panel.types.d.ts → components/TabPanel/types.d.ts} +1 -1
- package/Tabs/components/TabPanel/types.js +1 -0
- package/Tabs/{tabs/tabs.d.ts → components/Tabs/Tabs.d.ts} +1 -1
- package/Tabs/{tabs/tabs.js → components/Tabs/Tabs.js} +1 -1
- package/Tabs/components/Tabs/index.d.ts +1 -0
- package/Tabs/components/Tabs/index.js +1 -0
- package/Tabs/{tabs → components/Tabs}/styles.js +1 -1
- package/Tabs/{tabs/tabs.types.d.ts → components/Tabs/types.d.ts} +1 -1
- package/Tabs/components/Tabs/types.js +1 -0
- package/Tabs/{tabs.context.d.ts → context.d.ts} +1 -1
- package/Tabs/index.d.ts +5 -5
- package/Tabs/index.js +4 -5
- package/Tabs/types.js +1 -0
- package/Toast/Toast.d.ts +3 -0
- package/Toast/Toast.js +62 -0
- package/Toast/ToastProvider.d.ts +4 -0
- package/Toast/ToastProvider.js +45 -0
- package/Toast/constants.d.ts +8 -0
- package/Toast/constants.js +8 -0
- package/Toast/hooks.d.ts +2 -0
- package/Toast/hooks.js +9 -0
- package/Toast/index.d.ts +3 -0
- package/Toast/index.js +3 -0
- package/Toast/styles.d.ts +8 -0
- package/Toast/styles.js +23 -0
- package/Toast/types.d.ts +28 -0
- package/Toast/types.js +1 -0
- package/Tooltip/Tooltip.d.ts +3 -0
- package/Tooltip/Tooltip.js +47 -0
- package/Tooltip/index.d.ts +2 -0
- package/Tooltip/index.js +1 -0
- package/Tooltip/maps.d.ts +48 -0
- package/Tooltip/maps.js +161 -0
- package/Tooltip/styles.d.ts +5 -0
- package/Tooltip/styles.js +22 -0
- package/Tooltip/types.d.ts +14 -0
- package/Tooltip/types.js +1 -0
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +2 -0
- package/hooks/useElementWidth.d.ts +11 -0
- package/hooks/useElementWidth.js +27 -0
- package/hooks/useOnClickOutside.d.ts +4 -0
- package/hooks/useOnClickOutside.js +23 -0
- package/index.d.ts +24 -3
- package/index.js +22 -1
- package/package.json +6 -5
- package/Tabs/tab/index.d.ts +0 -2
- package/Tabs/tab/index.js +0 -2
- package/Tabs/tab-bar/index.d.ts +0 -2
- package/Tabs/tab-bar/index.js +0 -2
- package/Tabs/tab-base/index.d.ts +0 -3
- package/Tabs/tab-base/index.js +0 -3
- package/Tabs/tab-panel/index.d.ts +0 -2
- package/Tabs/tab-panel/index.js +0 -2
- package/Tabs/tabs/index.d.ts +0 -2
- package/Tabs/tabs/index.js +0 -2
- package/Tabs/tabs-list-slide-frame/index.d.ts +0 -3
- package/Tabs/tabs-list-slide-frame/index.js +0 -3
- package/{FieldBox/FieldBox.types.js → ActionsGroup/types.js} +0 -0
- package/{NumberPicker/AutosizeInput.types.js → Badge/types.js} +0 -0
- package/{Tabs/tab-bar/tab-bar.types.js → Banner/types.js} +0 -0
- package/{Tabs/tab-base/tab-base.types.js → Button/types.js} +0 -0
- package/{Tabs/tab-panel/tab-panel.types.js → CardMetric/types.js} +0 -0
- package/{Tabs/tab/tab.types.js → Checkbox/types.js} +0 -0
- package/{Tabs/tabs-list-slide-frame/tabs-list-slide-frame.types.js → Drawer/types.js} +0 -0
- package/{Tabs/tabs.types.js → DropdownMenu/components/DropdownMenu/types.js} +0 -0
- package/{Tabs/tabs/tabs.types.js → DropdownMenu/components/DropdownMenuContainer/types.js} +0 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
- package/EmailTemplatePreview/{styled.d.ts → styles.d.ts} +0 -0
- package/ExportResult/{styled.d.ts → styles.d.ts} +0 -0
- package/FieldBox/{FieldBox.types.d.ts → types.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.constants.d.ts → components/AutosizeInput/constants.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.constants.js → components/AutosizeInput/constants.js} +0 -0
- package/NumberPicker/{AutosizeInput.styled.d.ts → components/AutosizeInput/styles.d.ts} +0 -0
- package/NumberPicker/{AutosizeInput.types.d.ts → components/AutosizeInput/types.d.ts} +0 -0
- package/NumberPicker/{styled.d.ts → styles.d.ts} +0 -0
- package/ProgressBar/{styled.d.ts → styles.d.ts} +0 -0
- package/PushPreview/{constants/urls.d.ts → constants.d.ts} +0 -0
- package/PushPreview/{constants/urls.js → constants.js} +0 -0
- package/PushPreview/{helpers/helpers.d.ts → helpers.d.ts} +0 -0
- package/PushPreview/{helpers/helpers.js → helpers.js} +0 -0
- package/PushPreview/{styled.d.ts → styles.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.d.ts → components/TabBar/TabBar.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.styles.d.ts → components/TabBar/styles.d.ts} +0 -0
- package/Tabs/{tab-bar/tab-bar.types.d.ts → components/TabBar/types.d.ts} +0 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.styles.d.ts → components/TabBarScrollableFrame/styles.d.ts} +0 -0
- package/Tabs/{tabs-list-slide-frame/tabs-list-slide-frame.types.d.ts → components/TabBarScrollableFrame/types.d.ts} +0 -0
- package/Tabs/{tab-base/tab-base.d.ts → components/TabBase/TabBase.d.ts} +1 -1
- package/Tabs/{tab-base/tab-base.styles.d.ts → components/TabBase/styles.d.ts} +0 -0
- package/Tabs/{tab-base/tab-base.types.d.ts → components/TabBase/types.d.ts} +1 -1
- /package/Tabs/{tab-panel → components/TabPanel}/styles.d.ts +0 -0
- /package/Tabs/{tabs → components/Tabs}/styles.d.ts +0 -0
- /package/Tabs/{tabs.context.js → context.js} +0 -0
- /package/Tabs/{tabs.helpers.d.ts → helpers.d.ts} +0 -0
- /package/Tabs/{tabs.helpers.js → helpers.js} +0 -0
- /package/Tabs/{tabs.types.d.ts → types.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { H4 } from '@pushwoosh/kit-typography';
|
|
3
|
-
import { TabBarTitleBox, TabBarContainer } from './
|
|
4
|
-
import { TabBarScrollableFrame } from '../
|
|
3
|
+
import { TabBarTitleBox, TabBarContainer } from './styles';
|
|
4
|
+
import { TabBarScrollableFrame } from '../TabBarScrollableFrame';
|
|
5
5
|
export const TabBar = forwardRef((props, ref) => {
|
|
6
6
|
const {
|
|
7
7
|
children,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar } from './TabBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar } from './TabBar';
|
|
@@ -2,11 +2,11 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Color, Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-pu8yhh-0"
|
|
6
6
|
})(["position:relative;display:grid;grid-template-columns:", ";width:100%;height:40px;background:", ";border-radius:8px;padding:", ";overflow:hidden;"], ({
|
|
7
7
|
hasTitle
|
|
8
8
|
}) => hasTitle ? 'max-content 1fr' : '1fr', Color.SOFT_LIGHT, Spacing.S1);
|
|
9
9
|
export const TabBarTitleBox = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarTitleBox",
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-pu8yhh-1"
|
|
12
12
|
})(["display:flex;align-items:center;position:relative;padding:0 ", " 0 ", ";"], Spacing.S4, Spacing.S5);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { TabsListSlideFrameProps } from './types';
|
|
3
3
|
export declare const TabBarScrollableFrame: React.ForwardRefExoticComponent<TabsListSlideFrameProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debounce from 'lodash/debounce';
|
|
2
2
|
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
4
|
-
import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './
|
|
5
|
-
import { widthObserver } from '
|
|
4
|
+
import { TabBarContent, TabBarFrame, TabBarArrowContainer, TabBarWindow } from './styles';
|
|
5
|
+
import { widthObserver } from '../../helpers';
|
|
6
6
|
export const TabBarScrollableFrame = forwardRef(({
|
|
7
7
|
children,
|
|
8
8
|
...props
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBarScrollableFrame } from './TabBarScrollableFrame';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBarScrollableFrame } from './TabBarScrollableFrame';
|
|
@@ -2,25 +2,25 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Color, Shadow, ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabBarArrowContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabBarArrowContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1sonok9-0"
|
|
6
6
|
})(["position:absolute;top:0;", ":0;display:flex;align-items:center;height:32px;cursor:pointer;color:", ";background-color:", ";box-shadow:", ";border-radius:", ";padding:", " ", ";&:hover{color:", ";}"], ({
|
|
7
7
|
$right
|
|
8
8
|
}) => $right ? 'right' : 'left', Color.MAIN, Color.CLEAR, Shadow.SMALL, ShapeRadius.CONTROL, Spacing.S3, Spacing.S1, Color.PRIMARY_HOVER);
|
|
9
9
|
export const TabBarWindow = styled.div.withConfig({
|
|
10
10
|
displayName: "TabBarWindow",
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-1sonok9-1"
|
|
12
12
|
})(["position:relative;height:32px;width:100%;"]);
|
|
13
13
|
export const TabsListContentBase = styled.div.withConfig({
|
|
14
14
|
displayName: "TabsListContentBase",
|
|
15
|
-
componentId: "sc-
|
|
15
|
+
componentId: "sc-1sonok9-2"
|
|
16
16
|
})(["position:absolute;top:0;display:flex;align-items:center;transition:left .4s ease-in;"]);
|
|
17
17
|
export const TabBarContent = styled(TabsListContentBase).withConfig({
|
|
18
18
|
displayName: "TabBarContent",
|
|
19
|
-
componentId: "sc-
|
|
19
|
+
componentId: "sc-1sonok9-3"
|
|
20
20
|
})(["left:", "px;gap:", ";"], ({
|
|
21
21
|
left
|
|
22
22
|
}) => left, Spacing.S1);
|
|
23
23
|
export const TabBarFrame = styled.div.withConfig({
|
|
24
24
|
displayName: "TabBarFrame",
|
|
25
|
-
componentId: "sc-
|
|
25
|
+
componentId: "sc-1sonok9-4"
|
|
26
26
|
})(["position:relative;width:100%;"]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './
|
|
2
|
+
import { TabIconBox, TabRedDot, TabBody, TabButtonLabel } from './styles';
|
|
3
3
|
export const TabBase = forwardRef((props, ref) => {
|
|
4
4
|
const {
|
|
5
5
|
isActive,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBase } from './TabBase';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBase } from './TabBase';
|
|
@@ -4,7 +4,7 @@ import { H4 } from '@pushwoosh/kit-typography';
|
|
|
4
4
|
const tabBodyHover = css(["&:hover{color:", ";background-color:", ";}"], Color.PRIMARY_HOVER, Color.BRIGHT_LIGHT);
|
|
5
5
|
export const TabBody = styled.div.withConfig({
|
|
6
6
|
displayName: "TabBody",
|
|
7
|
-
componentId: "sc-
|
|
7
|
+
componentId: "sc-133yrgu-0"
|
|
8
8
|
})(["display:flex;justify-content:center;align-items:center;position:relative;padding:", " ", " ", " ", ";background-color:", ";border-radius:", ";box-shadow:", ";cursor:", ";user-select:none;white-space:nowrap;color:", ";", ""], Spacing.S2, ({
|
|
9
9
|
$hasIcon
|
|
10
10
|
}) => $hasIcon ? Spacing.S4 : Spacing.S5, Spacing.S2, Spacing.S5, ({
|
|
@@ -27,15 +27,15 @@ export const TabBody = styled.div.withConfig({
|
|
|
27
27
|
}) => !$isActive && !$isDisabled && tabBodyHover);
|
|
28
28
|
export const TabRedDot = styled.div.withConfig({
|
|
29
29
|
displayName: "TabRedDot",
|
|
30
|
-
componentId: "sc-
|
|
30
|
+
componentId: "sc-133yrgu-1"
|
|
31
31
|
})(["width:4px;height:20px;position:relative;&::before{content:\"\";background-color:", ";position:absolute;top:0;left:0;width:4px;height:4px;border-radius:4px;}"], Color.DANGER);
|
|
32
32
|
export const TabButtonLabel = styled(H4).withConfig({
|
|
33
33
|
displayName: "TabButtonLabel",
|
|
34
|
-
componentId: "sc-
|
|
34
|
+
componentId: "sc-133yrgu-2"
|
|
35
35
|
})(["opacity:", ";"], ({
|
|
36
36
|
$isActive
|
|
37
37
|
}) => $isActive ? 1 : 0.8);
|
|
38
38
|
export const TabIconBox = styled.div.withConfig({
|
|
39
39
|
displayName: "TabIconBox",
|
|
40
|
-
componentId: "sc-
|
|
40
|
+
componentId: "sc-133yrgu-3"
|
|
41
41
|
})(["margin-left:", ";"], Spacing.S1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabPanel } from './TabPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabPanel } from './TabPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs } from './Tabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs } from './Tabs';
|
|
@@ -2,5 +2,5 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Spacing } from '@pushwoosh/kit-constants';
|
|
3
3
|
export const TabsContainer = styled.div.withConfig({
|
|
4
4
|
displayName: "TabsContainer",
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1pr0dun-0"
|
|
6
6
|
})(["display:flex;flex-direction:column;gap:", ";width:100%;height:100%;"], Spacing.S5);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Tabs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { Tab } from './components/Tab';
|
|
2
|
+
export { TabBar } from './components/TabBar';
|
|
3
|
+
export { TabPanel } from './components/TabPanel';
|
|
4
|
+
export { Tabs } from './components/Tabs';
|
|
5
|
+
export type { TabCode } from './types';
|
package/Tabs/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './tab-panel';
|
|
1
|
+
export { Tab } from './components/Tab';
|
|
2
|
+
export { TabBar } from './components/TabBar';
|
|
3
|
+
export { TabPanel } from './components/TabPanel';
|
|
4
|
+
export { Tabs } from './components/Tabs';
|
package/Tabs/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Toast/Toast.d.ts
ADDED
package/Toast/Toast.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { InfoRoundIcon, CheckRoundIcon, WarningRoundIcon, DangerTriangleIcon, CloseIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { H4, Paragraph } from '@pushwoosh/kit-typography';
|
|
5
|
+
import { TypeColorMap } from './constants';
|
|
6
|
+
import { RootBox, IconBox, ContentBox, CloseBox } from './styles';
|
|
7
|
+
function getIconByType(type) {
|
|
8
|
+
switch (type) {
|
|
9
|
+
case 'info':
|
|
10
|
+
return React.createElement(InfoRoundIcon, {
|
|
11
|
+
view: "filled",
|
|
12
|
+
size: "medium",
|
|
13
|
+
color: TypeColorMap[type]
|
|
14
|
+
});
|
|
15
|
+
case 'success':
|
|
16
|
+
return React.createElement(CheckRoundIcon, {
|
|
17
|
+
view: "filled",
|
|
18
|
+
type: "fill",
|
|
19
|
+
size: "medium",
|
|
20
|
+
color: TypeColorMap[type]
|
|
21
|
+
});
|
|
22
|
+
case 'warning':
|
|
23
|
+
return React.createElement(WarningRoundIcon, {
|
|
24
|
+
view: "filled",
|
|
25
|
+
size: "medium",
|
|
26
|
+
color: TypeColorMap[type]
|
|
27
|
+
});
|
|
28
|
+
case 'error':
|
|
29
|
+
return React.createElement(DangerTriangleIcon, {
|
|
30
|
+
view: "filled",
|
|
31
|
+
size: "medium",
|
|
32
|
+
color: TypeColorMap[type]
|
|
33
|
+
});
|
|
34
|
+
default:
|
|
35
|
+
return React.createElement(InfoRoundIcon, {
|
|
36
|
+
view: "filled",
|
|
37
|
+
size: "medium",
|
|
38
|
+
color: TypeColorMap[type]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function Toast(props) {
|
|
43
|
+
const {
|
|
44
|
+
open,
|
|
45
|
+
toast,
|
|
46
|
+
onClose
|
|
47
|
+
} = props;
|
|
48
|
+
const {
|
|
49
|
+
title,
|
|
50
|
+
description,
|
|
51
|
+
type,
|
|
52
|
+
additionalContent
|
|
53
|
+
} = toast;
|
|
54
|
+
return createPortal(React.createElement(RootBox, {
|
|
55
|
+
open: open,
|
|
56
|
+
type: type
|
|
57
|
+
}, React.createElement(IconBox, null, getIconByType(type)), React.createElement(ContentBox, null, React.createElement(H4, null, title), description && React.createElement(Paragraph, null, description), additionalContent && React.createElement("div", null, additionalContent)), React.createElement(CloseBox, {
|
|
58
|
+
onClick: onClose
|
|
59
|
+
}, React.createElement(CloseIcon, {
|
|
60
|
+
size: "medium"
|
|
61
|
+
}))), document.body);
|
|
62
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback, createContext } from 'react';
|
|
2
|
+
import { DEFAULT_DURATION } from './constants';
|
|
3
|
+
import { Toast } from './Toast';
|
|
4
|
+
export const ToastContext = createContext(null);
|
|
5
|
+
export const ToastProvider = ({
|
|
6
|
+
children
|
|
7
|
+
}) => {
|
|
8
|
+
const initialState = {
|
|
9
|
+
title: '',
|
|
10
|
+
description: '',
|
|
11
|
+
type: 'info',
|
|
12
|
+
duration: DEFAULT_DURATION
|
|
13
|
+
};
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
const [toast, setToast] = useState(initialState);
|
|
16
|
+
const closeToast = useCallback(() => setOpen(false), []);
|
|
17
|
+
const openToast = useCallback(({
|
|
18
|
+
title = '',
|
|
19
|
+
description = '',
|
|
20
|
+
duration = DEFAULT_DURATION,
|
|
21
|
+
type = 'info',
|
|
22
|
+
additionalContent = null
|
|
23
|
+
}) => {
|
|
24
|
+
setOpen(true);
|
|
25
|
+
setToast({
|
|
26
|
+
title,
|
|
27
|
+
description,
|
|
28
|
+
duration,
|
|
29
|
+
type,
|
|
30
|
+
additionalContent
|
|
31
|
+
});
|
|
32
|
+
setTimeout(closeToast, duration);
|
|
33
|
+
}, [closeToast]);
|
|
34
|
+
const contextValue = useMemo(() => ({
|
|
35
|
+
openToast,
|
|
36
|
+
closeToast
|
|
37
|
+
}), [openToast, closeToast]);
|
|
38
|
+
return React.createElement(ToastContext.Provider, {
|
|
39
|
+
value: contextValue
|
|
40
|
+
}, children, React.createElement(Toast, {
|
|
41
|
+
open: open,
|
|
42
|
+
toast: toast,
|
|
43
|
+
onClose: closeToast
|
|
44
|
+
}));
|
|
45
|
+
};
|
package/Toast/hooks.d.ts
ADDED
package/Toast/hooks.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ToastContext } from './ToastProvider';
|
|
3
|
+
export const useToast = () => {
|
|
4
|
+
const context = useContext(ToastContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('useToast must be used within a ToastProvider');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
package/Toast/index.d.ts
ADDED
package/Toast/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToastType } from './types';
|
|
2
|
+
export declare const RootBox: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
open: boolean;
|
|
4
|
+
type: ToastType;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const IconBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const ContentBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const CloseBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/Toast/styles.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { TypeColorMap } from './constants';
|
|
4
|
+
export const RootBox = styled.div.withConfig({
|
|
5
|
+
displayName: "RootBox",
|
|
6
|
+
componentId: "sc-8jll5u-0"
|
|
7
|
+
})(["position:fixed;display:flex;align-items:flex-start;width:380px;top:", ";left:50%;transform:translateX(-50%);color:", ";padding:", " 0 ", ";border-radius:", ";border:1px solid ", ";background:", ";box-shadow:", ";transition:top 250ms;z-index:999999999;"], ({
|
|
8
|
+
open
|
|
9
|
+
}) => open ? '50px' : '-250px', Color.MAIN, Spacing.S5, Spacing.S5, ShapeRadius.DIALOG, ({
|
|
10
|
+
type
|
|
11
|
+
}) => TypeColorMap[type], Color.CLEAR, Shadow.LARGE);
|
|
12
|
+
export const IconBox = styled.div.withConfig({
|
|
13
|
+
displayName: "IconBox",
|
|
14
|
+
componentId: "sc-8jll5u-1"
|
|
15
|
+
})(["display:flex;align-items:center;justify-content:center;width:56px;height:100%;padding:0 ", ";box-sizing:border-box;"], Spacing.S5);
|
|
16
|
+
export const ContentBox = styled.div.withConfig({
|
|
17
|
+
displayName: "ContentBox",
|
|
18
|
+
componentId: "sc-8jll5u-2"
|
|
19
|
+
})(["display:flex;flex-direction:column;justify-content:center;width:100%;min-height:24px;flex-grow:1;gap:", ";"], Spacing.S0);
|
|
20
|
+
export const CloseBox = styled.div.withConfig({
|
|
21
|
+
displayName: "CloseBox",
|
|
22
|
+
componentId: "sc-8jll5u-3"
|
|
23
|
+
})(["display:flex;padding:0 14px;cursor:pointer;"]);
|
package/Toast/types.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ToastType = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type ToastParams = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
duration: number;
|
|
7
|
+
type: ToastType;
|
|
8
|
+
additionalContent?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type OpenToastParams = {
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
duration?: number;
|
|
14
|
+
type?: ToastType;
|
|
15
|
+
additionalContent?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export interface ToastContextProps {
|
|
18
|
+
openToast: (params: OpenToastParams) => void;
|
|
19
|
+
closeToast: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ToastProviderProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface ToastProps {
|
|
25
|
+
open: boolean;
|
|
26
|
+
toast: ToastParams;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
}
|
package/Toast/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipPositionToArrowOffsetMap, TooltipPositionToTippyOffsetMap, TooltipPositionToTippyPlacementMap } from './maps';
|
|
3
|
+
import { TooltipBox } from './styles';
|
|
4
|
+
export function Tooltip(props) {
|
|
5
|
+
const {
|
|
6
|
+
position = 'top-start',
|
|
7
|
+
arrowOffset = TooltipPositionToArrowOffsetMap[position],
|
|
8
|
+
offset = TooltipPositionToTippyOffsetMap[position],
|
|
9
|
+
maxWidth = 240,
|
|
10
|
+
zIndex = 999999,
|
|
11
|
+
isDisabled,
|
|
12
|
+
isVisible,
|
|
13
|
+
...rest
|
|
14
|
+
} = props;
|
|
15
|
+
return React.createElement(TooltipBox, {
|
|
16
|
+
animation: false,
|
|
17
|
+
delay: 0,
|
|
18
|
+
duration: 0,
|
|
19
|
+
disabled: isDisabled,
|
|
20
|
+
maxWidth: maxWidth,
|
|
21
|
+
zIndex: zIndex,
|
|
22
|
+
placement: TooltipPositionToTippyPlacementMap[position],
|
|
23
|
+
visible: isVisible,
|
|
24
|
+
"$position": position,
|
|
25
|
+
"$arrowOffset": arrowOffset,
|
|
26
|
+
popperOptions: {
|
|
27
|
+
strategy: 'fixed',
|
|
28
|
+
modifiers: [{
|
|
29
|
+
name: 'offset',
|
|
30
|
+
options: {
|
|
31
|
+
offset
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
name: 'flip',
|
|
35
|
+
options: {
|
|
36
|
+
fallbackPlacements: []
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
name: 'preventOverflow',
|
|
40
|
+
options: {
|
|
41
|
+
mainAxis: false
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
44
|
+
},
|
|
45
|
+
...rest
|
|
46
|
+
});
|
|
47
|
+
}
|
package/Tooltip/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './Tooltip';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TooltipPosition } from './types';
|
|
2
|
+
export declare const TooltipPositionToTippyPlacementMap: {
|
|
3
|
+
'top-start': "top-start";
|
|
4
|
+
'top-middle': "top";
|
|
5
|
+
'top-end': "top-end";
|
|
6
|
+
'right-start': "right-start";
|
|
7
|
+
'right-middle': "right";
|
|
8
|
+
'right-end': "right-end";
|
|
9
|
+
'bottom-start': "bottom-start";
|
|
10
|
+
'bottom-middle': "bottom";
|
|
11
|
+
'bottom-end': "bottom-end";
|
|
12
|
+
'left-start': "left-start";
|
|
13
|
+
'left-middle': "left";
|
|
14
|
+
'left-end': "left-end";
|
|
15
|
+
};
|
|
16
|
+
export declare const TooltipPositionToTippyOffsetMap: {
|
|
17
|
+
'top-start': number[];
|
|
18
|
+
'top-middle': number[];
|
|
19
|
+
'top-end': number[];
|
|
20
|
+
'right-start': number[];
|
|
21
|
+
'right-middle': number[];
|
|
22
|
+
'right-end': number[];
|
|
23
|
+
'bottom-start': number[];
|
|
24
|
+
'bottom-middle': number[];
|
|
25
|
+
'bottom-end': number[];
|
|
26
|
+
'left-start': number[];
|
|
27
|
+
'left-middle': number[];
|
|
28
|
+
'left-end': number[];
|
|
29
|
+
};
|
|
30
|
+
export declare const TooltipPositionToArrowOffsetMap: {
|
|
31
|
+
'top-start': string;
|
|
32
|
+
'top-middle': string;
|
|
33
|
+
'top-end': string;
|
|
34
|
+
'right-start': string;
|
|
35
|
+
'right-middle': string;
|
|
36
|
+
'right-end': string;
|
|
37
|
+
'bottom-start': string;
|
|
38
|
+
'bottom-middle': string;
|
|
39
|
+
'bottom-end': string;
|
|
40
|
+
'left-start': string;
|
|
41
|
+
'left-middle': string;
|
|
42
|
+
'left-end': string;
|
|
43
|
+
};
|
|
44
|
+
export declare function getTransform(position: TooltipPosition): "none" | "translateX(-50%) translateY(50%) rotate(45deg);" | "translateX(50%) translateY(50%) rotate(45deg);" | "translateX(-50%) translateY(-50%) rotate(45deg);" | "translateX(50%) translateY(-50%) rotate(45deg);";
|
|
45
|
+
export declare function getTopPosition(position: TooltipPosition, offset: string): string;
|
|
46
|
+
export declare function getRightPosition(position: TooltipPosition, offset: string): string;
|
|
47
|
+
export declare function getBottomPosition(position: TooltipPosition, offset: string): string;
|
|
48
|
+
export declare function getLeftPosition(position: TooltipPosition, offset: string): string;
|