@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { AttachmentIcon } from '@pushwoosh/kit-icons';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { FieldBox } from '../FieldBox';
|
|
6
|
+
import { InputFileFieldsStyled, InputFileButtonStyled, InputFileInputStyled, InputFileInputHiddenStyled, InputFileErrorStyled } from './styles';
|
|
7
|
+
export function InputFile(props) {
|
|
8
|
+
const {
|
|
9
|
+
fileId,
|
|
10
|
+
textId,
|
|
11
|
+
buttonId,
|
|
12
|
+
label,
|
|
13
|
+
buttonText,
|
|
14
|
+
accept,
|
|
15
|
+
placeholder,
|
|
16
|
+
disabled,
|
|
17
|
+
fileName,
|
|
18
|
+
errorText,
|
|
19
|
+
name,
|
|
20
|
+
maxSize,
|
|
21
|
+
onError = () => {},
|
|
22
|
+
onChange,
|
|
23
|
+
isIgnoreFileSize = false
|
|
24
|
+
} = props;
|
|
25
|
+
const fieldRef = useRef(null);
|
|
26
|
+
const uploadFile = event => {
|
|
27
|
+
var _event$target$files;
|
|
28
|
+
const file = ((_event$target$files = event.target.files) === null || _event$target$files === void 0 ? void 0 : _event$target$files.length) && event.target.files[0];
|
|
29
|
+
if (!file) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!isIgnoreFileSize) {
|
|
33
|
+
if (!file.size) {
|
|
34
|
+
onError('The file could not be empty', name);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (maxSize && file.size > maxSize * 1024 * 1024) {
|
|
38
|
+
onError(`The file size should be less than ${maxSize}MB`, name);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const reader = new FileReader();
|
|
43
|
+
reader.onload = upload => {
|
|
44
|
+
var _upload$target;
|
|
45
|
+
const result = {
|
|
46
|
+
file,
|
|
47
|
+
[name]: (_upload$target = upload.target) === null || _upload$target === void 0 ? void 0 : _upload$target.result
|
|
48
|
+
};
|
|
49
|
+
onChange(result);
|
|
50
|
+
};
|
|
51
|
+
reader.readAsDataURL(file);
|
|
52
|
+
};
|
|
53
|
+
return React.createElement(FieldBox, {
|
|
54
|
+
title: label,
|
|
55
|
+
error: errorText
|
|
56
|
+
}, React.createElement(InputFileFieldsStyled, null, React.createElement(InputFileInputHiddenStyled, {
|
|
57
|
+
ref: fieldRef,
|
|
58
|
+
id: fileId,
|
|
59
|
+
type: "file",
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
accept: accept,
|
|
62
|
+
onChange: uploadFile,
|
|
63
|
+
value: ""
|
|
64
|
+
}), React.createElement(InputFileInputStyled, {
|
|
65
|
+
id: textId,
|
|
66
|
+
type: "text",
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
placeholder: placeholder,
|
|
69
|
+
value: fileName,
|
|
70
|
+
readOnly: true,
|
|
71
|
+
color: errorText ? Color.DANGER : Color.FORM
|
|
72
|
+
}), React.createElement(InputFileButtonStyled, null, React.createElement(Button, {
|
|
73
|
+
id: buttonId,
|
|
74
|
+
type: "button",
|
|
75
|
+
color: "secondary",
|
|
76
|
+
size: "field",
|
|
77
|
+
view: "shape",
|
|
78
|
+
isDisabled: disabled,
|
|
79
|
+
onClick: () => {
|
|
80
|
+
var _fieldRef$current;
|
|
81
|
+
return fieldRef === null || fieldRef === void 0 || (_fieldRef$current = fieldRef.current) === null || _fieldRef$current === void 0 ? void 0 : _fieldRef$current.click();
|
|
82
|
+
},
|
|
83
|
+
icon: React.createElement(AttachmentIcon, {
|
|
84
|
+
size: "medium",
|
|
85
|
+
view: "lined"
|
|
86
|
+
})
|
|
87
|
+
}, buttonText))), !!errorText && React.createElement(InputFileErrorStyled, null, errorText));
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputFile } from './InputFile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputFile } from './InputFile';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const InputFileFieldsStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const InputFileButtonStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const InputFileInputStyled: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
4
|
+
export declare const InputFileInputHiddenStyled: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
5
|
+
export declare const InputFileErrorStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing, FontSize, FontFamily, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
3
|
+
export const InputFileFieldsStyled = styled.div.withConfig({
|
|
4
|
+
displayName: "InputFileFieldsStyled",
|
|
5
|
+
componentId: "sc-8mwin7-0"
|
|
6
|
+
})(["display:flex;position:relative;gap:", ";"], Spacing.S5);
|
|
7
|
+
export const InputFileButtonStyled = styled.div.withConfig({
|
|
8
|
+
displayName: "InputFileButtonStyled",
|
|
9
|
+
componentId: "sc-8mwin7-1"
|
|
10
|
+
})(["Button{display:flex;}"]);
|
|
11
|
+
export const InputFileInputStyled = styled.input.withConfig({
|
|
12
|
+
displayName: "InputFileInputStyled",
|
|
13
|
+
componentId: "sc-8mwin7-2"
|
|
14
|
+
})(["width:100%;height:36px;padding:0 ", ";color:#555;font-size:", ";font-family:", ";line-height:1.4;background:", ";border:1px solid ", ";border-radius:4px;box-sizing:border-box;outline:none;caret-color:", ";&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{appearance:none;}&:focus{border-color:", ";}"], Spacing.S5, FontSize.HEADING4, FontFamily.MAIN, Color.CLEAR, ({
|
|
15
|
+
color
|
|
16
|
+
}) => color, Color.BRIGHT, Color.BRIGHT);
|
|
17
|
+
export const InputFileInputHiddenStyled = styled(InputFileInputStyled).withConfig({
|
|
18
|
+
displayName: "InputFileInputHiddenStyled",
|
|
19
|
+
componentId: "sc-8mwin7-3"
|
|
20
|
+
})(["opacity:0;position:absolute;"]);
|
|
21
|
+
export const InputFileErrorStyled = styled.div.withConfig({
|
|
22
|
+
displayName: "InputFileErrorStyled",
|
|
23
|
+
componentId: "sc-8mwin7-4"
|
|
24
|
+
})(["margin:", " 0;padding:", " ", ";border:1px solid ", ";border-radius:", ";color:", ";background:", ";"], Spacing.S5, Spacing.S4, Spacing.S6, Color.DANGER, ShapeRadius.DIALOG, Color.DANGER, Color.DANGER_LIGHT);
|
|
25
|
+
InputFileFieldsStyled.displayName = 'InputFileFieldsStyled';
|
|
26
|
+
InputFileButtonStyled.displayName = 'InputFileButtonStyled';
|
|
27
|
+
InputFileInputStyled.displayName = 'InputFileInputStyled';
|
|
28
|
+
InputFileInputHiddenStyled.displayName = 'InputFileInputHiddenStyled';
|
|
29
|
+
InputFileErrorStyled.displayName = 'InputFileErrorStyled';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type InputFileProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
fileName?: string;
|
|
4
|
+
errorText?: string;
|
|
5
|
+
fileId?: string;
|
|
6
|
+
textId?: string;
|
|
7
|
+
buttonId?: string;
|
|
8
|
+
accept?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
buttonWidth?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
isIgnoreFileSize?: boolean;
|
|
16
|
+
onChange: (result: any) => void;
|
|
17
|
+
onError?: (message: string, field: string) => void;
|
|
18
|
+
};
|
|
19
|
+
type FileProp = {
|
|
20
|
+
file: File;
|
|
21
|
+
};
|
|
22
|
+
export type InputFileData = FileProp & {
|
|
23
|
+
[name: string]: string;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Link/Link.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { LinkPropsWithoutAs, LinkPropsWithAsTag, LinkPropsWithAsComponent } from './types';
|
|
3
|
+
export declare function Link(props: LinkPropsWithoutAs): ReactElement;
|
|
4
|
+
export declare function Link<AS extends keyof JSX.IntrinsicElements>(props: LinkPropsWithAsTag<AS>): ReactElement;
|
|
5
|
+
export declare function Link<OuterProps extends object>(props: LinkPropsWithAsComponent<OuterProps>): ReactElement;
|
package/Link/Link.js
ADDED
package/Link/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from './Link';
|
package/Link/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from './Link';
|
package/Link/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LinkBox: import("styled-components").StyledComponent<"a", any, {}, never>;
|
package/Link/styles.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color } from '@pushwoosh/kit-constants';
|
|
3
|
+
export const LinkBox = styled.a.withConfig({
|
|
4
|
+
displayName: "LinkBox",
|
|
5
|
+
componentId: "sc-4gb8j5-0"
|
|
6
|
+
})(["display:inline;padding:0;appearance:none;border:none;background:transparent;color:", ";text-decoration:none;cursor:pointer;&:hover{color:", ";text-decoration:underline;}&:focus-visible{outline:1px solid ", ";outline-offset:2px;}&:active{color:", ";}&:focus:not(:focus-visible){outline:none;}"], Color.PRIMARY, Color.PRIMARY_HOVER, Color.BRIGHT, Color.PRIMARY_PRESSED);
|
|
7
|
+
LinkBox.displayName = 'LinkBox';
|
package/Link/types.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref, ReactNode, ComponentType } from 'react';
|
|
2
|
+
export type LinkPropsWithoutAs = Omit<JSX.IntrinsicElements['a'], 'ref'> & {
|
|
3
|
+
readonly boxRef?: Ref<HTMLAnchorElement>;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly href: string;
|
|
6
|
+
readonly children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type LinkPropsWithAsTag<AS extends keyof JSX.IntrinsicElements> = Omit<JSX.IntrinsicElements[AS], 'ref'> & {
|
|
9
|
+
readonly boxRef?: Ref<JSX.IntrinsicElements[AS]>;
|
|
10
|
+
readonly as: AS;
|
|
11
|
+
readonly title?: string;
|
|
12
|
+
readonly href?: string;
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export type LinkPropsWithAsComponent<OuterProps extends object> = OuterProps & {
|
|
16
|
+
readonly boxRef?: Ref<HTMLElement>;
|
|
17
|
+
readonly as: ComponentType<OuterProps>;
|
|
18
|
+
readonly title?: string;
|
|
19
|
+
readonly href?: string;
|
|
20
|
+
readonly children: ReactNode;
|
|
21
|
+
};
|
package/Link/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { modalSizes } from './maps';
|
|
4
|
+
import { LockBody, ModalBox, ModalBoxTrans, ModalContainer, ModalInner } from './styles';
|
|
5
|
+
function createDivElement() {
|
|
6
|
+
return document.createElement('div');
|
|
7
|
+
}
|
|
8
|
+
export function Modal(props) {
|
|
9
|
+
const {
|
|
10
|
+
size,
|
|
11
|
+
zIndex = 10000,
|
|
12
|
+
isOpen,
|
|
13
|
+
onClose,
|
|
14
|
+
children
|
|
15
|
+
} = props;
|
|
16
|
+
const ref = useRef();
|
|
17
|
+
const [element] = useState(createDivElement);
|
|
18
|
+
const handleClose = useCallback(event => {
|
|
19
|
+
if (event.target === event.currentTarget) {
|
|
20
|
+
onClose === null || onClose === void 0 || onClose();
|
|
21
|
+
}
|
|
22
|
+
}, [onClose]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
var _document$body$lastCh;
|
|
25
|
+
(_document$body$lastCh = document.body.lastChild) === null || _document$body$lastCh === void 0 || _document$body$lastCh.after(element);
|
|
26
|
+
return () => element.remove();
|
|
27
|
+
}, [element]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (isOpen && onClose) {
|
|
30
|
+
const onCloseEventHandler = event => {
|
|
31
|
+
if (event.key === 'Escape') {
|
|
32
|
+
onClose();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
window.addEventListener('keydown', onCloseEventHandler);
|
|
36
|
+
return () => window.removeEventListener('keydown', onCloseEventHandler);
|
|
37
|
+
}
|
|
38
|
+
}, [isOpen, onClose]);
|
|
39
|
+
return createPortal(React.createElement(ModalBoxTrans, {
|
|
40
|
+
nodeRef: ref,
|
|
41
|
+
isOpen: isOpen
|
|
42
|
+
}, React.createElement(ModalBox, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
"$zIndex": zIndex
|
|
45
|
+
}, React.createElement(LockBody, null), React.createElement(ModalInner, {
|
|
46
|
+
onMouseDown: handleClose
|
|
47
|
+
}, React.createElement(ModalContainer, {
|
|
48
|
+
"$width": modalSizes[size],
|
|
49
|
+
onClick: handleClose
|
|
50
|
+
}, typeof children === 'function' ? children() : children)))), element);
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Modal } from './Modal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Modal } from './Modal';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ModalBoxBaseProps } from './types';
|
|
3
|
+
export declare const LockBody: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
|
4
|
+
export declare const ModalBox: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
$zIndex: number;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const ModalInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
declare function ModalBoxBase(props: ModalBoxBaseProps): ReactElement;
|
|
9
|
+
export declare const ModalBoxTrans: import("styled-components").StyledComponent<typeof ModalBoxBase, any, {}, never>;
|
|
10
|
+
export declare const ModalContainer: import("styled-components").StyledComponent<"div", any, {
|
|
11
|
+
$width: string;
|
|
12
|
+
}, never>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CSSTransition } from 'react-transition-group';
|
|
3
|
+
import styled, { createGlobalStyle } from 'styled-components';
|
|
4
|
+
import { ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
|
|
5
|
+
const animationTimeout = 300;
|
|
6
|
+
export const LockBody = createGlobalStyle(["body{overflow:hidden;position:relative;height:100%;}"]);
|
|
7
|
+
export const ModalBox = styled.div.withConfig({
|
|
8
|
+
displayName: "ModalBox",
|
|
9
|
+
componentId: "sc-lejcgu-0"
|
|
10
|
+
})(["position:fixed;top:0;left:0;width:100vw;height:100vh;pointer-events:all;z-index:", ";"], ({
|
|
11
|
+
$zIndex
|
|
12
|
+
}) => $zIndex);
|
|
13
|
+
export const ModalInner = styled.div.withConfig({
|
|
14
|
+
displayName: "ModalInner",
|
|
15
|
+
componentId: "sc-lejcgu-1"
|
|
16
|
+
})(["display:flex;justify-content:center;width:100vw;height:100vh;padding:", " 0;"], Spacing.S13);
|
|
17
|
+
function ModalBoxBase(props) {
|
|
18
|
+
const {
|
|
19
|
+
isOpen,
|
|
20
|
+
nodeRef,
|
|
21
|
+
className,
|
|
22
|
+
children
|
|
23
|
+
} = props;
|
|
24
|
+
return React.createElement(CSSTransition, {
|
|
25
|
+
appear: true,
|
|
26
|
+
in: isOpen,
|
|
27
|
+
timeout: animationTimeout,
|
|
28
|
+
classNames: className,
|
|
29
|
+
unmountOnExit: true,
|
|
30
|
+
nodeRef: nodeRef
|
|
31
|
+
}, children);
|
|
32
|
+
}
|
|
33
|
+
export const ModalBoxTrans = styled(ModalBoxBase).withConfig({
|
|
34
|
+
displayName: "ModalBoxTrans",
|
|
35
|
+
componentId: "sc-lejcgu-2"
|
|
36
|
+
})(["&-appear{background-color:rgb(0 0 0 / 0%);transition:background-color ", "ms;", "{opacity:0;transform:scale(0.5);}}&-appear-active{background-color:rgb(0 0 0 / 70%);", "{opacity:0.99;transform:scale(0.99);transition:opacity ", "ms,transform ", "ms;}}&-appear-done{background-color:rgb(0 0 0 / 70%);", "{opacity:1;transform:translateX(0);}}&-enter{background-color:rgb(0 0 0 / 0%);transition:background-color ", "ms;", "{opacity:0;transform:scale(0.5);}}&-enter-active{background-color:rgb(0 0 0 / 70%);", "{opacity:0.99;transform:scale(0.99);transition:opacity ", "ms,transform ", "ms;}}&-enter-done{background-color:rgb(0 0 0 / 70%);", "{opacity:1;transform:translateX(0);}}&-exit{background-color:rgba(0 0 0 / 70%);", "{opacity:1;transform:translateX(0);transition:opacity ", "ms,transform ", "ms;}}&-exit-active{transition:background-color ", "ms;background-color:rgb(0 0 0 / 0%);", "{opacity:0;transform:scale(0.5);}}"], animationTimeout, ModalInner, ModalInner, animationTimeout, animationTimeout, ModalInner, animationTimeout, ModalInner, ModalInner, animationTimeout, animationTimeout, ModalInner, ModalInner, animationTimeout, animationTimeout, animationTimeout, ModalInner);
|
|
37
|
+
export const ModalContainer = styled.div.withConfig({
|
|
38
|
+
displayName: "ModalContainer",
|
|
39
|
+
componentId: "sc-lejcgu-3"
|
|
40
|
+
})(["display:inline-flex;flex-direction:column;align-items:stretch;justify-content:flex-start;position:relative;width:", ";height:calc(100vh - 2 * ", ");vertical-align:middle;z-index:10;& > *{&:first-child{border-top-left-radius:", ";border-top-right-radius:", ";}&:last-child{border-bottom-left-radius:", ";border-bottom-right-radius:", ";}}"], ({
|
|
41
|
+
$width
|
|
42
|
+
}) => $width, Spacing.S13, ShapeRadius.DIALOG, ShapeRadius.DIALOG, ShapeRadius.DIALOG, ShapeRadius.DIALOG);
|
|
43
|
+
ModalBox.displayName = 'ModalBox';
|
|
44
|
+
ModalInner.displayName = 'ModalInner';
|
|
45
|
+
ModalContainer.displayName = 'ModalContainer';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MutableRefObject, PropsWithChildren } from 'react';
|
|
2
|
+
import type { modalSizes } from './maps';
|
|
3
|
+
export type ModalProps = PropsWithChildren<{
|
|
4
|
+
readonly size: keyof typeof modalSizes;
|
|
5
|
+
readonly zIndex?: number;
|
|
6
|
+
readonly isOpen: boolean;
|
|
7
|
+
readonly onClose?: () => any;
|
|
8
|
+
}>;
|
|
9
|
+
export type ModalBoxBaseProps = PropsWithChildren<{
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
nodeRef: MutableRefObject<HTMLElement | undefined>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
import { Vertical, Horizontal } from '@pushwoosh/kit-helpers';
|
|
3
|
+
import { Banner } from '../../../Banner';
|
|
4
|
+
import { Button } from '../../../Button';
|
|
5
|
+
import { Modal } from '../Modal';
|
|
6
|
+
import { ModalHeader, ModalBody, ModalFooter } from '../ModalContent';
|
|
7
|
+
import { ModalTitle } from '../ModalTitle';
|
|
8
|
+
export function ModalConfirm(props) {
|
|
9
|
+
const {
|
|
10
|
+
isOpen,
|
|
11
|
+
title = 'Confirm action',
|
|
12
|
+
description = '',
|
|
13
|
+
confirmButtonText = 'Confirm',
|
|
14
|
+
cancelButtonText = 'Cancel',
|
|
15
|
+
confirmButtonColor = 'primary',
|
|
16
|
+
callback,
|
|
17
|
+
onAccept,
|
|
18
|
+
onCancel
|
|
19
|
+
} = props;
|
|
20
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
21
|
+
const [errorMessage, setErrorMessage] = useState('');
|
|
22
|
+
const handleConfirm = useCallback(async () => {
|
|
23
|
+
try {
|
|
24
|
+
setIsLoading(true);
|
|
25
|
+
setErrorMessage('');
|
|
26
|
+
await (callback === null || callback === void 0 ? void 0 : callback());
|
|
27
|
+
await onAccept();
|
|
28
|
+
} catch (error) {
|
|
29
|
+
setErrorMessage((error === null || error === void 0 ? void 0 : error.message) || 'Unexpected error occurred');
|
|
30
|
+
} finally {
|
|
31
|
+
setIsLoading(false);
|
|
32
|
+
}
|
|
33
|
+
}, [callback, onAccept]);
|
|
34
|
+
return React.createElement(Modal, {
|
|
35
|
+
size: "small",
|
|
36
|
+
isOpen: isOpen,
|
|
37
|
+
onClose: onCancel
|
|
38
|
+
}, React.createElement(ModalHeader, null, React.createElement(Vertical, {
|
|
39
|
+
"$gap": 8
|
|
40
|
+
}, React.createElement(ModalTitle, null, title), errorMessage && React.createElement(Banner, {
|
|
41
|
+
type: "error",
|
|
42
|
+
title: errorMessage
|
|
43
|
+
}))), description && React.createElement(ModalBody, null, description), React.createElement(ModalFooter, null, React.createElement(Horizontal, {
|
|
44
|
+
"$justifyContent": "end",
|
|
45
|
+
"$gap": 8
|
|
46
|
+
}, React.createElement(Button, {
|
|
47
|
+
color: "secondary",
|
|
48
|
+
onClick: onCancel
|
|
49
|
+
}, cancelButtonText), React.createElement(Button, {
|
|
50
|
+
color: confirmButtonColor,
|
|
51
|
+
isLoading: isLoading,
|
|
52
|
+
onClick: handleConfirm
|
|
53
|
+
}, confirmButtonText))));
|
|
54
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { type ReactElement, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { ModalConfirmContextProps } from './types';
|
|
3
|
+
export declare const ModalConfirmContext: React.Context<ModalConfirmContextProps | null>;
|
|
4
|
+
export declare function ModalConfirmProvider(props: PropsWithChildren): ReactElement;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useState, useMemo, createContext } from 'react';
|
|
2
|
+
import { ModalConfirm } from './ModalConfirm';
|
|
3
|
+
export const ModalConfirmContext = createContext(null);
|
|
4
|
+
export function ModalConfirmProvider(props) {
|
|
5
|
+
const {
|
|
6
|
+
children
|
|
7
|
+
} = props;
|
|
8
|
+
const [modalConfirmParams, setModalConfirmParams] = useState(() => ({
|
|
9
|
+
isOpen: false,
|
|
10
|
+
title: '',
|
|
11
|
+
onAccept: () => null,
|
|
12
|
+
onCancel: () => null
|
|
13
|
+
}));
|
|
14
|
+
const contextValue = useMemo(() => {
|
|
15
|
+
const closeModalConfirm = () => setModalConfirmParams(prev => ({
|
|
16
|
+
...prev,
|
|
17
|
+
isOpen: false
|
|
18
|
+
}));
|
|
19
|
+
const openModalConfirm = params => setModalConfirmParams({
|
|
20
|
+
...params,
|
|
21
|
+
isOpen: true,
|
|
22
|
+
onCancel: params.onCancel || closeModalConfirm,
|
|
23
|
+
onAccept: params.onAccept
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
openModalConfirm,
|
|
27
|
+
closeModalConfirm
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return React.createElement(ModalConfirmContext.Provider, {
|
|
31
|
+
value: contextValue
|
|
32
|
+
}, children, React.createElement(ModalConfirm, {
|
|
33
|
+
...modalConfirmParams
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ModalConfirmContext } from './ModalConfirmProvider';
|
|
3
|
+
export const useModalConfirm = () => {
|
|
4
|
+
const context = useContext(ModalConfirmContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('useModalConfirm must be used within an ModalConfirmProvider');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ConfirmButtonColor = 'primary' | 'secondary' | 'danger';
|
|
2
|
+
export interface ModalConfirmProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
confirmButtonText?: string;
|
|
7
|
+
confirmButtonColor?: ConfirmButtonColor;
|
|
8
|
+
cancelButtonText?: string;
|
|
9
|
+
callback?: () => void;
|
|
10
|
+
onAccept: () => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
}
|
|
13
|
+
export type OpenModalConfirmParams = Omit<ModalConfirmProps, 'isOpen' | 'onCancel'> & {
|
|
14
|
+
isOpen?: ModalConfirmProps['isOpen'];
|
|
15
|
+
onCancel?: () => void;
|
|
16
|
+
};
|
|
17
|
+
export interface ModalConfirmContextProps {
|
|
18
|
+
openModalConfirm: (params: OpenModalConfirmParams) => void;
|
|
19
|
+
closeModalConfirm: () => void;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalHeader, ModalBodyGroup, ModalBodyItem, ModalBody, ModalFooter, } from './styled';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalHeader, ModalBodyGroup, ModalBodyItem, ModalBody, ModalFooter } from './styled';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const ModalHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const ModalBodyGroup: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
$alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
4
|
+
$alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
5
|
+
$gap?: string | number | undefined;
|
|
6
|
+
$gridAutoFlow?: "row" | "column" | "dense" | "row dense" | "column dense" | undefined;
|
|
7
|
+
$justifyContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
|
|
8
|
+
$justifyItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
|
|
9
|
+
$margin?: string | number | undefined;
|
|
10
|
+
$padding?: string | number | undefined;
|
|
11
|
+
$placeItems?: "end" | "start" | "center" | "stretch" | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
$gridAutoFlow: string;
|
|
14
|
+
}, "$gridAutoFlow">;
|
|
15
|
+
export declare const ModalBodyItem: import("styled-components").StyledComponent<"div", any, {
|
|
16
|
+
$vPadding?: boolean;
|
|
17
|
+
}, never>;
|
|
18
|
+
export declare const ModalBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const ModalFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, Spacing } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
|
+
export const ModalHeader = styled.div.withConfig({
|
|
5
|
+
displayName: "ModalHeader",
|
|
6
|
+
componentId: "sc-t60vr-0"
|
|
7
|
+
})(["padding:", " ", " ", ";background-color:", ";"], Spacing.S7, Spacing.S7, Spacing.S3, Color.CLEAR);
|
|
8
|
+
ModalHeader.displayName = 'ModalHeader';
|
|
9
|
+
export const ModalBodyGroup = styled(Vertical).withConfig({
|
|
10
|
+
displayName: "ModalBodyGroup",
|
|
11
|
+
componentId: "sc-t60vr-1"
|
|
12
|
+
})(["background-color:", ";gap:1px;"], Color.DIVIDER);
|
|
13
|
+
ModalBodyGroup.displayName = 'ModalBodyGroup';
|
|
14
|
+
export const ModalBodyItem = styled.div.withConfig({
|
|
15
|
+
displayName: "ModalBodyItem",
|
|
16
|
+
componentId: "sc-t60vr-2"
|
|
17
|
+
})(["padding:", " ", ";background-color:", ";"], ({
|
|
18
|
+
$vPadding
|
|
19
|
+
}) => $vPadding ? Spacing.S7 : 0, Spacing.S7, Color.CLEAR);
|
|
20
|
+
export const ModalBody = styled.div.withConfig({
|
|
21
|
+
displayName: "ModalBody",
|
|
22
|
+
componentId: "sc-t60vr-3"
|
|
23
|
+
})(["background-color:", ";overflow-y:auto;&:not(:has(> ", ")){padding:", ";&:not(:first-child){padding-top:0;}}"], Color.CLEAR, ModalBodyGroup, Spacing.S7);
|
|
24
|
+
ModalBody.displayName = 'ModalBody';
|
|
25
|
+
export const ModalFooter = styled.div.withConfig({
|
|
26
|
+
displayName: "ModalFooter",
|
|
27
|
+
componentId: "sc-t60vr-4"
|
|
28
|
+
})(["padding:", ";background-color:", ";border-top:1px solid ", ";"], Spacing.S7, Color.CLEAR, Color.DIVIDER);
|
|
29
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
3
|
+
import { ModalTitleBox } from './styles';
|
|
4
|
+
import { GhostButton } from '../../../Button';
|
|
5
|
+
export function ModalTitle(props) {
|
|
6
|
+
const {
|
|
7
|
+
children,
|
|
8
|
+
onClose,
|
|
9
|
+
...rest
|
|
10
|
+
} = props;
|
|
11
|
+
return React.createElement(ModalTitleBox, {
|
|
12
|
+
...rest
|
|
13
|
+
}, children, onClose && React.createElement(GhostButton, {
|
|
14
|
+
onClick: onClose
|
|
15
|
+
}, React.createElement(CloseIcon, {
|
|
16
|
+
size: "medium"
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalTitle } from './ModalTitle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalTitle } from './ModalTitle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ModalTitleBox: import("styled-components").StyledComponent<"h2", any, {}, never>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Color, FontSize, FontWeight } from '@pushwoosh/kit-constants';
|
|
3
|
+
import { GhostButton } from '../../../Button';
|
|
4
|
+
export const ModalTitleBox = styled.h2.withConfig({
|
|
5
|
+
displayName: "ModalTitleBox",
|
|
6
|
+
componentId: "sc-8qbijb-0"
|
|
7
|
+
})(["display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;font-size:", ";font-weight:", ";line-height:22px;letter-spacing:0;margin:0;", "{color:", ";cursor:pointer;&:hover{color:", ";}}"], FontSize.HEADING2, FontWeight.BOLD, GhostButton, Color.LOCKED, Color.MAIN);
|
|
8
|
+
ModalTitleBox.displayName = 'ModalTitleBox';
|