@qoretechnologies/reqore 0.20.1 → 0.20.4
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/__tests__/modal.test.tsx +3 -8
- package/__tests__/panel.test.tsx +3 -3
- package/dist/src/components/Breadcrumbs/index.d.ts +33 -0
- package/dist/src/components/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs/index.js +167 -0
- package/dist/src/components/Breadcrumbs/index.js.map +1 -0
- package/dist/src/components/Breadcrumbs/item.d.ts +14 -0
- package/dist/src/components/Breadcrumbs/item.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs/item.js +84 -0
- package/dist/src/components/Breadcrumbs/item.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +33 -0
- package/dist/src/components/Button/index.d.ts.map +1 -0
- package/dist/src/components/Button/index.js +154 -0
- package/dist/src/components/Button/index.js.map +1 -0
- package/dist/src/components/Checkbox/index.d.ts +26 -0
- package/dist/src/components/Checkbox/index.d.ts.map +1 -0
- package/dist/src/components/Checkbox/index.js +108 -0
- package/dist/src/components/Checkbox/index.js.map +1 -0
- package/dist/src/components/Columns/column.d.ts +5 -0
- package/dist/src/components/Columns/column.d.ts.map +1 -0
- package/dist/src/components/Columns/column.js +37 -0
- package/dist/src/components/Columns/column.js.map +1 -0
- package/dist/src/components/Columns/index.d.ts +17 -0
- package/dist/src/components/Columns/index.d.ts.map +1 -0
- package/dist/src/components/Columns/index.js +69 -0
- package/dist/src/components/Columns/index.js.map +1 -0
- package/dist/src/components/Comment/index.d.ts +24 -0
- package/dist/src/components/Comment/index.d.ts.map +1 -0
- package/dist/src/components/Comment/index.js +71 -0
- package/dist/src/components/Comment/index.js.map +1 -0
- package/dist/src/components/CommentFeed/index.d.ts +7 -0
- package/dist/src/components/CommentFeed/index.d.ts.map +1 -0
- package/dist/src/components/CommentFeed/index.js +49 -0
- package/dist/src/components/CommentFeed/index.js.map +1 -0
- package/dist/src/components/Content/index.d.ts +11 -0
- package/dist/src/components/Content/index.d.ts.map +1 -0
- package/dist/src/components/Content/index.js +70 -0
- package/dist/src/components/Content/index.js.map +1 -0
- package/dist/src/components/Content/wrapper.d.ts +11 -0
- package/dist/src/components/Content/wrapper.d.ts.map +1 -0
- package/dist/src/components/Content/wrapper.js +43 -0
- package/dist/src/components/Content/wrapper.js.map +1 -0
- package/dist/src/components/ControlGroup/index.d.ts +17 -0
- package/dist/src/components/ControlGroup/index.d.ts.map +1 -0
- package/dist/src/components/ControlGroup/index.js +90 -0
- package/dist/src/components/ControlGroup/index.js.map +1 -0
- package/dist/src/components/Drawer/index.d.ts +36 -0
- package/dist/src/components/Drawer/index.d.ts.map +1 -0
- package/dist/src/components/Drawer/index.js +251 -0
- package/dist/src/components/Drawer/index.js.map +1 -0
- package/dist/src/components/Dropdown/index.d.ts +24 -0
- package/dist/src/components/Dropdown/index.d.ts.map +1 -0
- package/dist/src/components/Dropdown/index.js +38 -0
- package/dist/src/components/Dropdown/index.js.map +1 -0
- package/dist/src/components/Dropdown/item.d.ts +10 -0
- package/dist/src/components/Dropdown/item.d.ts.map +1 -0
- package/dist/src/components/Dropdown/item.js +35 -0
- package/dist/src/components/Dropdown/item.js.map +1 -0
- package/dist/src/components/Dropdown/list.d.ts +14 -0
- package/dist/src/components/Dropdown/list.d.ts.map +1 -0
- package/dist/src/components/Dropdown/list.js +47 -0
- package/dist/src/components/Dropdown/list.js.map +1 -0
- package/dist/src/components/Header/index.d.ts +13 -0
- package/dist/src/components/Header/index.d.ts.map +1 -0
- package/dist/src/components/Header/index.js +44 -0
- package/dist/src/components/Header/index.js.map +1 -0
- package/dist/src/components/Icon/index.d.ts +16 -0
- package/dist/src/components/Icon/index.d.ts.map +1 -0
- package/dist/src/components/Icon/index.js +81 -0
- package/dist/src/components/Icon/index.js.map +1 -0
- package/dist/src/components/Input/index.d.ts +33 -0
- package/dist/src/components/Input/index.d.ts.map +1 -0
- package/dist/src/components/Input/index.js +115 -0
- package/dist/src/components/Input/index.js.map +1 -0
- package/dist/src/components/InputClearButton/index.d.ts +10 -0
- package/dist/src/components/InputClearButton/index.d.ts.map +1 -0
- package/dist/src/components/InputClearButton/index.js +49 -0
- package/dist/src/components/InputClearButton/index.js.map +1 -0
- package/dist/src/components/InternalPopover/index.d.ts +7 -0
- package/dist/src/components/InternalPopover/index.d.ts.map +1 -0
- package/dist/src/components/InternalPopover/index.js +132 -0
- package/dist/src/components/InternalPopover/index.js.map +1 -0
- package/dist/src/components/Layout/content.d.ts +8 -0
- package/dist/src/components/Layout/content.d.ts.map +1 -0
- package/dist/src/components/Layout/content.js +41 -0
- package/dist/src/components/Layout/content.js.map +1 -0
- package/dist/src/components/Layout/index.d.ts +8 -0
- package/dist/src/components/Layout/index.d.ts.map +1 -0
- package/dist/src/components/Layout/index.js +69 -0
- package/dist/src/components/Layout/index.js.map +1 -0
- package/dist/src/components/Menu/divider.d.ts +7 -0
- package/dist/src/components/Menu/divider.d.ts.map +1 -0
- package/dist/src/components/Menu/divider.js +49 -0
- package/dist/src/components/Menu/divider.js.map +1 -0
- package/dist/src/components/Menu/index.d.ts +17 -0
- package/dist/src/components/Menu/index.d.ts.map +1 -0
- package/dist/src/components/Menu/index.js +89 -0
- package/dist/src/components/Menu/index.js.map +1 -0
- package/dist/src/components/Menu/item.d.ts +31 -0
- package/dist/src/components/Menu/item.d.ts.map +1 -0
- package/dist/src/components/Menu/item.js +121 -0
- package/dist/src/components/Menu/item.js.map +1 -0
- package/dist/src/components/Message/index.d.ts +25 -0
- package/dist/src/components/Message/index.d.ts.map +1 -0
- package/dist/src/components/Message/index.js +54 -0
- package/dist/src/components/Message/index.js.map +1 -0
- package/dist/src/components/Modal/index.d.ts +14 -0
- package/dist/src/components/Modal/index.d.ts.map +1 -0
- package/dist/src/components/Modal/index.js +33 -0
- package/dist/src/components/Modal/index.js.map +1 -0
- package/dist/src/components/Navbar/divider.d.ts +9 -0
- package/dist/src/components/Navbar/divider.d.ts.map +1 -0
- package/dist/src/components/Navbar/divider.js +47 -0
- package/dist/src/components/Navbar/divider.js.map +1 -0
- package/dist/src/components/Navbar/group.d.ts +15 -0
- package/dist/src/components/Navbar/group.d.ts.map +1 -0
- package/dist/src/components/Navbar/group.js +75 -0
- package/dist/src/components/Navbar/group.js.map +1 -0
- package/dist/src/components/Navbar/index.d.ts +16 -0
- package/dist/src/components/Navbar/index.d.ts.map +1 -0
- package/dist/src/components/Navbar/index.js +86 -0
- package/dist/src/components/Navbar/index.js.map +1 -0
- package/dist/src/components/Navbar/item.d.ts +16 -0
- package/dist/src/components/Navbar/item.d.ts.map +1 -0
- package/dist/src/components/Navbar/item.js +81 -0
- package/dist/src/components/Navbar/item.js.map +1 -0
- package/dist/src/components/Notifications/index.d.ts +12 -0
- package/dist/src/components/Notifications/index.d.ts.map +1 -0
- package/dist/src/components/Notifications/index.js +60 -0
- package/dist/src/components/Notifications/index.js.map +1 -0
- package/dist/src/components/Notifications/notification.d.ts +43 -0
- package/dist/src/components/Notifications/notification.d.ts.map +1 -0
- package/dist/src/components/Notifications/notification.js +140 -0
- package/dist/src/components/Notifications/notification.js.map +1 -0
- package/dist/src/components/Panel/index.d.ts +49 -0
- package/dist/src/components/Panel/index.d.ts.map +1 -0
- package/dist/src/components/Panel/index.js +172 -0
- package/dist/src/components/Panel/index.js.map +1 -0
- package/dist/src/components/Panel/panel.screenshot.d.ts +3 -0
- package/dist/src/components/Panel/panel.screenshot.d.ts.map +1 -0
- package/dist/src/components/Panel/panel.screenshot.js +30 -0
- package/dist/src/components/Panel/panel.screenshot.js.map +1 -0
- package/dist/src/components/Paragraph/index.d.ts +8 -0
- package/dist/src/components/Paragraph/index.d.ts.map +1 -0
- package/dist/src/components/Paragraph/index.js +64 -0
- package/dist/src/components/Paragraph/index.js.map +1 -0
- package/dist/src/components/Popover/index.d.ts +16 -0
- package/dist/src/components/Popover/index.d.ts.map +1 -0
- package/dist/src/components/Popover/index.js +55 -0
- package/dist/src/components/Popover/index.js.map +1 -0
- package/dist/src/components/RadioGroup/index.d.ts +17 -0
- package/dist/src/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/src/components/RadioGroup/index.js +48 -0
- package/dist/src/components/RadioGroup/index.js.map +1 -0
- package/dist/src/components/Sidebar/index.d.ts +60 -0
- package/dist/src/components/Sidebar/index.d.ts.map +1 -0
- package/dist/src/components/Sidebar/index.js +265 -0
- package/dist/src/components/Sidebar/index.js.map +1 -0
- package/dist/src/components/Sidebar/item.d.ts +36 -0
- package/dist/src/components/Sidebar/item.d.ts.map +1 -0
- package/dist/src/components/Sidebar/item.js +106 -0
- package/dist/src/components/Sidebar/item.js.map +1 -0
- package/dist/src/components/Table/body.d.ts +10 -0
- package/dist/src/components/Table/body.d.ts.map +1 -0
- package/dist/src/components/Table/body.js +44 -0
- package/dist/src/components/Table/body.js.map +1 -0
- package/dist/src/components/Table/header.d.ts +29 -0
- package/dist/src/components/Table/header.d.ts.map +1 -0
- package/dist/src/components/Table/header.js +106 -0
- package/dist/src/components/Table/header.js.map +1 -0
- package/dist/src/components/Table/headerCell.d.ts +18 -0
- package/dist/src/components/Table/headerCell.d.ts.map +1 -0
- package/dist/src/components/Table/headerCell.js +92 -0
- package/dist/src/components/Table/headerCell.js.map +1 -0
- package/dist/src/components/Table/helpers.d.ts +8 -0
- package/dist/src/components/Table/helpers.d.ts.map +1 -0
- package/dist/src/components/Table/helpers.js +41 -0
- package/dist/src/components/Table/helpers.js.map +1 -0
- package/dist/src/components/Table/index.d.ts +75 -0
- package/dist/src/components/Table/index.d.ts.map +1 -0
- package/dist/src/components/Table/index.js +165 -0
- package/dist/src/components/Table/index.js.map +1 -0
- package/dist/src/components/Table/row.d.ts +58 -0
- package/dist/src/components/Table/row.d.ts.map +1 -0
- package/dist/src/components/Table/row.js +204 -0
- package/dist/src/components/Table/row.js.map +1 -0
- package/dist/src/components/Tabs/content.d.ts +8 -0
- package/dist/src/components/Tabs/content.d.ts.map +1 -0
- package/dist/src/components/Tabs/content.js +41 -0
- package/dist/src/components/Tabs/content.js.map +1 -0
- package/dist/src/components/Tabs/index.d.ts +39 -0
- package/dist/src/components/Tabs/index.d.ts.map +1 -0
- package/dist/src/components/Tabs/index.js +83 -0
- package/dist/src/components/Tabs/index.js.map +1 -0
- package/dist/src/components/Tabs/item.d.ts +23 -0
- package/dist/src/components/Tabs/item.d.ts.map +1 -0
- package/dist/src/components/Tabs/item.js +71 -0
- package/dist/src/components/Tabs/item.js.map +1 -0
- package/dist/src/components/Tabs/list.d.ts +17 -0
- package/dist/src/components/Tabs/list.d.ts.map +1 -0
- package/dist/src/components/Tabs/list.js +189 -0
- package/dist/src/components/Tabs/list.js.map +1 -0
- package/dist/src/components/Tag/group.d.ts +10 -0
- package/dist/src/components/Tag/group.d.ts.map +1 -0
- package/dist/src/components/Tag/group.js +50 -0
- package/dist/src/components/Tag/group.js.map +1 -0
- package/dist/src/components/Tag/index.d.ts +36 -0
- package/dist/src/components/Tag/index.d.ts.map +1 -0
- package/dist/src/components/Tag/index.js +136 -0
- package/dist/src/components/Tag/index.js.map +1 -0
- package/dist/src/components/Textarea/index.d.ts +26 -0
- package/dist/src/components/Textarea/index.d.ts.map +1 -0
- package/dist/src/components/Textarea/index.js +85 -0
- package/dist/src/components/Textarea/index.js.map +1 -0
- package/dist/src/components/TimeAgo/index.d.ts +4 -0
- package/dist/src/components/TimeAgo/index.d.ts.map +1 -0
- package/dist/src/components/TimeAgo/index.js +21 -0
- package/dist/src/components/TimeAgo/index.js.map +1 -0
- package/dist/src/components/Tree/index.d.ts +16 -0
- package/dist/src/components/Tree/index.d.ts.map +1 -0
- package/dist/src/components/Tree/index.js +155 -0
- package/dist/src/components/Tree/index.js.map +1 -0
- package/dist/src/constants/animations.d.ts +5 -0
- package/dist/src/constants/animations.d.ts.map +1 -0
- package/dist/src/constants/animations.js +8 -0
- package/dist/src/constants/animations.js.map +1 -0
- package/dist/src/constants/colors.d.ts +10 -0
- package/dist/src/constants/colors.d.ts.map +1 -0
- package/dist/src/constants/colors.js +13 -0
- package/dist/src/constants/colors.js.map +1 -0
- package/dist/src/constants/sizes.d.ts +59 -0
- package/dist/src/constants/sizes.d.ts.map +1 -0
- package/dist/src/constants/sizes.js +60 -0
- package/dist/src/constants/sizes.js.map +1 -0
- package/dist/src/constants/theme.d.ts +81 -0
- package/dist/src/constants/theme.d.ts.map +1 -0
- package/dist/src/constants/theme.js +20 -0
- package/dist/src/constants/theme.js.map +1 -0
- package/dist/src/containers/PopoverProvider.d.ts +13 -0
- package/dist/src/containers/PopoverProvider.d.ts.map +1 -0
- package/dist/src/containers/PopoverProvider.js +81 -0
- package/dist/src/containers/PopoverProvider.js.map +1 -0
- package/dist/src/containers/ReqoreProvider.d.ts +40 -0
- package/dist/src/containers/ReqoreProvider.d.ts.map +1 -0
- package/dist/src/containers/ReqoreProvider.js +125 -0
- package/dist/src/containers/ReqoreProvider.js.map +1 -0
- package/dist/src/containers/ThemeProvider.d.ts +8 -0
- package/dist/src/containers/ThemeProvider.d.ts.map +1 -0
- package/dist/src/containers/ThemeProvider.js +27 -0
- package/dist/src/containers/ThemeProvider.js.map +1 -0
- package/dist/src/containers/UIProvider.d.ts +13 -0
- package/dist/src/containers/UIProvider.d.ts.map +1 -0
- package/dist/src/containers/UIProvider.js +43 -0
- package/dist/src/containers/UIProvider.js.map +1 -0
- package/dist/src/context/PopoverContext.d.ts +11 -0
- package/dist/src/context/PopoverContext.d.ts.map +1 -0
- package/dist/src/context/PopoverContext.js +5 -0
- package/dist/src/context/PopoverContext.js.map +1 -0
- package/dist/src/context/ReqoreContext.d.ts +15 -0
- package/dist/src/context/ReqoreContext.d.ts.map +1 -0
- package/dist/src/context/ReqoreContext.js +10 -0
- package/dist/src/context/ReqoreContext.js.map +1 -0
- package/dist/src/context/ThemeContext.d.ts +5 -0
- package/dist/src/context/ThemeContext.d.ts.map +1 -0
- package/dist/src/context/ThemeContext.js +6 -0
- package/dist/src/context/ThemeContext.js.map +1 -0
- package/dist/src/helpers/animations.d.ts +2 -0
- package/dist/src/helpers/animations.d.ts.map +1 -0
- package/dist/src/helpers/animations.js +11 -0
- package/dist/src/helpers/animations.js.map +1 -0
- package/dist/src/helpers/colors.d.ts +14 -0
- package/dist/src/helpers/colors.d.ts.map +1 -0
- package/dist/src/helpers/colors.js +108 -0
- package/dist/src/helpers/colors.js.map +1 -0
- package/dist/src/helpers/sidebar.d.ts +4 -0
- package/dist/src/helpers/sidebar.d.ts.map +1 -0
- package/dist/src/helpers/sidebar.js +90 -0
- package/dist/src/helpers/sidebar.js.map +1 -0
- package/dist/src/helpers/time.d.ts +8 -0
- package/dist/src/helpers/time.d.ts.map +1 -0
- package/dist/src/helpers/time.js +25 -0
- package/dist/src/helpers/time.js.map +1 -0
- package/dist/src/helpers/utils.d.ts +5 -0
- package/dist/src/helpers/utils.d.ts.map +1 -0
- package/dist/src/helpers/utils.js +103 -0
- package/dist/src/helpers/utils.js.map +1 -0
- package/dist/src/hooks/useCombinedRefs.d.ts +3 -0
- package/dist/src/hooks/useCombinedRefs.d.ts.map +1 -0
- package/dist/src/hooks/useCombinedRefs.js +29 -0
- package/dist/src/hooks/useCombinedRefs.js.map +1 -0
- package/dist/src/hooks/useLatestZIndex.d.ts +3 -0
- package/dist/src/hooks/useLatestZIndex.d.ts.map +1 -0
- package/dist/src/hooks/useLatestZIndex.js +11 -0
- package/dist/src/hooks/useLatestZIndex.js.map +1 -0
- package/dist/src/hooks/useOutsideClick.d.ts +4 -0
- package/dist/src/hooks/useOutsideClick.d.ts.map +1 -0
- package/dist/src/hooks/useOutsideClick.js +19 -0
- package/dist/src/hooks/useOutsideClick.js.map +1 -0
- package/dist/src/hooks/usePopover.d.ts +19 -0
- package/dist/src/hooks/usePopover.d.ts.map +1 -0
- package/dist/src/hooks/usePopover.js +86 -0
- package/dist/src/hooks/usePopover.js.map +1 -0
- package/dist/src/hooks/useShareForwardedRef.d.ts +3 -0
- package/dist/src/hooks/useShareForwardedRef.d.ts.map +1 -0
- package/dist/src/hooks/useShareForwardedRef.js +25 -0
- package/dist/src/hooks/useShareForwardedRef.js.map +1 -0
- package/dist/src/hooks/useTheme.d.ts +3 -0
- package/dist/src/hooks/useTheme.d.ts.map +1 -0
- package/dist/src/hooks/useTheme.js +21 -0
- package/dist/src/hooks/useTheme.js.map +1 -0
- package/dist/src/hooks/useTooltip.d.ts +3 -0
- package/dist/src/hooks/useTooltip.d.ts.map +1 -0
- package/dist/src/hooks/useTooltip.js +24 -0
- package/dist/src/hooks/useTooltip.js.map +1 -0
- package/dist/src/icons.json +2295 -0
- package/dist/src/index.d.ts +50 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +122 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mock/breadcrumbs.d.ts +5 -0
- package/dist/src/mock/breadcrumbs.d.ts.map +1 -0
- package/dist/src/mock/breadcrumbs.js +94 -0
- package/dist/src/mock/breadcrumbs.js.map +1 -0
- package/dist/src/mock/icons.d.ts +5 -0
- package/dist/src/mock/icons.d.ts.map +1 -0
- package/dist/src/mock/icons.js +34 -0
- package/dist/src/mock/icons.js.map +1 -0
- package/dist/src/mock/menu.d.ts +3 -0
- package/dist/src/mock/menu.d.ts.map +1 -0
- package/dist/src/mock/menu.js +97 -0
- package/dist/src/mock/menu.js.map +1 -0
- package/dist/src/mock/object.json +317 -0
- package/dist/src/mock/tableData.d.ts +8 -0
- package/dist/src/mock/tableData.d.ts.map +1 -0
- package/dist/src/mock/tableData.js +53 -0
- package/dist/src/mock/tableData.js.map +1 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts +10 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js +72 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
- package/dist/src/stories/Button/Button.stories.d.ts +12 -0
- package/dist/src/stories/Button/Button.stories.d.ts.map +1 -0
- package/dist/src/stories/Button/Button.stories.js +57 -0
- package/dist/src/stories/Button/Button.stories.js.map +1 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.d.ts +7 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.d.ts.map +1 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.js +29 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.js.map +1 -0
- package/dist/src/stories/Columns/Columns.stories.d.ts +10 -0
- package/dist/src/stories/Columns/Columns.stories.d.ts.map +1 -0
- package/dist/src/stories/Columns/Columns.stories.js +49 -0
- package/dist/src/stories/Columns/Columns.stories.js.map +1 -0
- package/dist/src/stories/Comment/Comment.stories.d.ts +7 -0
- package/dist/src/stories/Comment/Comment.stories.d.ts.map +1 -0
- package/dist/src/stories/Comment/Comment.stories.js +43 -0
- package/dist/src/stories/Comment/Comment.stories.js.map +1 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts +8 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.js +44 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.js.map +1 -0
- package/dist/src/stories/Drawer/Drawer.stories.d.ts +8 -0
- package/dist/src/stories/Drawer/Drawer.stories.d.ts.map +1 -0
- package/dist/src/stories/Drawer/Drawer.stories.js +97 -0
- package/dist/src/stories/Drawer/Drawer.stories.js.map +1 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.d.ts +8 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.d.ts.map +1 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.js +141 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.js.map +1 -0
- package/dist/src/stories/Icon/Icon.stories.d.ts +6 -0
- package/dist/src/stories/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/src/stories/Icon/Icon.stories.js +13 -0
- package/dist/src/stories/Icon/Icon.stories.js.map +1 -0
- package/dist/src/stories/Input/Input.stories.d.ts +6 -0
- package/dist/src/stories/Input/Input.stories.d.ts.map +1 -0
- package/dist/src/stories/Input/Input.stories.js +38 -0
- package/dist/src/stories/Input/Input.stories.js.map +1 -0
- package/dist/src/stories/Menu/Menu.stories.d.ts +6 -0
- package/dist/src/stories/Menu/Menu.stories.d.ts.map +1 -0
- package/dist/src/stories/Menu/Menu.stories.js +48 -0
- package/dist/src/stories/Menu/Menu.stories.js.map +1 -0
- package/dist/src/stories/Message/Message.stories.d.ts +8 -0
- package/dist/src/stories/Message/Message.stories.d.ts.map +1 -0
- package/dist/src/stories/Message/Message.stories.js +50 -0
- package/dist/src/stories/Message/Message.stories.js.map +1 -0
- package/dist/src/stories/Modal/Modal.stories.d.ts +7 -0
- package/dist/src/stories/Modal/Modal.stories.d.ts.map +1 -0
- package/dist/src/stories/Modal/Modal.stories.js +77 -0
- package/dist/src/stories/Modal/Modal.stories.js.map +1 -0
- package/dist/src/stories/Navbar/Navbar.stories.d.ts +6 -0
- package/dist/src/stories/Navbar/Navbar.stories.d.ts.map +1 -0
- package/dist/src/stories/Navbar/Navbar.stories.js +33 -0
- package/dist/src/stories/Navbar/Navbar.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Interactive.stories.d.ts +9 -0
- package/dist/src/stories/Notifications/Interactive.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Interactive.stories.js +100 -0
- package/dist/src/stories/Notifications/Interactive.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Notification.stories.d.ts +9 -0
- package/dist/src/stories/Notifications/Notification.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Notification.stories.js +96 -0
- package/dist/src/stories/Notifications/Notification.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Notifications.stories.d.ts +10 -0
- package/dist/src/stories/Notifications/Notifications.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Notifications.stories.js +63 -0
- package/dist/src/stories/Notifications/Notifications.stories.js.map +1 -0
- package/dist/src/stories/Panel/Panel.stories.d.ts +9 -0
- package/dist/src/stories/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/src/stories/Panel/Panel.stories.js +79 -0
- package/dist/src/stories/Panel/Panel.stories.js.map +1 -0
- package/dist/src/stories/Popover/Popover.stories.d.ts +6 -0
- package/dist/src/stories/Popover/Popover.stories.d.ts.map +1 -0
- package/dist/src/stories/Popover/Popover.stories.js +46 -0
- package/dist/src/stories/Popover/Popover.stories.js.map +1 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts +7 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.js +54 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.js.map +1 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.d.ts +6 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.d.ts.map +1 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.js +65 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.js.map +1 -0
- package/dist/src/stories/Table/Table.stories.d.ts +10 -0
- package/dist/src/stories/Table/Table.stories.d.ts.map +1 -0
- package/dist/src/stories/Table/Table.stories.js +157 -0
- package/dist/src/stories/Table/Table.stories.js.map +1 -0
- package/dist/src/stories/Tabs/Tabs.stories.d.ts +12 -0
- package/dist/src/stories/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/src/stories/Tabs/Tabs.stories.js +127 -0
- package/dist/src/stories/Tabs/Tabs.stories.js.map +1 -0
- package/dist/src/stories/Tag/Tag.stories.d.ts +8 -0
- package/dist/src/stories/Tag/Tag.stories.d.ts.map +1 -0
- package/dist/src/stories/Tag/Tag.stories.js +79 -0
- package/dist/src/stories/Tag/Tag.stories.js.map +1 -0
- package/dist/src/stories/TextArea/TextArea.stories.d.ts +8 -0
- package/dist/src/stories/TextArea/TextArea.stories.d.ts.map +1 -0
- package/dist/src/stories/TextArea/TextArea.stories.js +65 -0
- package/dist/src/stories/TextArea/TextArea.stories.js.map +1 -0
- package/dist/src/stories/Tree/Tree.stories.d.ts +7 -0
- package/dist/src/stories/Tree/Tree.stories.d.ts.map +1 -0
- package/dist/src/stories/Tree/Tree.stories.js +52 -0
- package/dist/src/stories/Tree/Tree.stories.js.map +1 -0
- package/dist/src/stories/Wrapper.d.ts +4 -0
- package/dist/src/stories/Wrapper.d.ts.map +1 -0
- package/dist/src/stories/Wrapper.js +38 -0
- package/dist/src/stories/Wrapper.js.map +1 -0
- package/dist/src/stories/utils/args.d.ts +61 -0
- package/dist/src/stories/utils/args.d.ts.map +1 -0
- package/dist/src/stories/utils/args.js +120 -0
- package/dist/src/stories/utils/args.js.map +1 -0
- package/dist/src/stories/utils.d.ts +11 -0
- package/dist/src/stories/utils.d.ts.map +1 -0
- package/dist/src/stories/utils.js +17 -0
- package/dist/src/stories/utils.js.map +1 -0
- package/dist/src/styles.d.ts +5 -0
- package/dist/src/styles.d.ts.map +1 -0
- package/dist/src/styles.js +16 -0
- package/dist/src/styles.js.map +1 -0
- package/dist/src/types/global.d.ts +9 -0
- package/dist/src/types/global.d.ts.map +1 -0
- package/dist/src/types/global.js +3 -0
- package/dist/src/types/global.js.map +1 -0
- package/dist/src/types/icons.d.ts +2 -0
- package/dist/src/types/icons.d.ts.map +1 -0
- package/dist/src/types/icons.js +3 -0
- package/dist/src/types/icons.js.map +1 -0
- package/dist/src/types/icons____.d.ts +2 -0
- package/dist/src/types/icons____.d.ts.map +1 -0
- package/dist/src/types/icons____.js +5 -0
- package/dist/src/types/icons____.js.map +1 -0
- package/dist/tests.json +1 -1
- package/package.json +2 -2
- package/src/components/Breadcrumbs/index.tsx +286 -0
- package/src/components/Breadcrumbs/item.tsx +162 -0
- package/src/components/Button/index.tsx +270 -0
- package/src/components/Checkbox/index.tsx +161 -0
- package/src/components/Columns/column.tsx +26 -0
- package/src/components/Columns/index.tsx +40 -0
- package/src/components/Comment/index.tsx +139 -0
- package/src/components/CommentFeed/index.tsx +34 -0
- package/src/components/Content/index.tsx +39 -0
- package/src/components/Content/wrapper.tsx +37 -0
- package/src/components/ControlGroup/index.tsx +81 -0
- package/src/components/Drawer/index.tsx +387 -0
- package/src/components/Dropdown/index.tsx +81 -0
- package/src/components/Dropdown/item.tsx +20 -0
- package/src/components/Dropdown/list.tsx +76 -0
- package/src/components/Header/index.tsx +38 -0
- package/src/components/Icon/index.tsx +83 -0
- package/src/components/Input/index.tsx +185 -0
- package/src/components/InputClearButton/index.tsx +34 -0
- package/src/components/InternalPopover/index.tsx +185 -0
- package/src/components/Layout/content.tsx +31 -0
- package/src/components/Layout/index.tsx +55 -0
- package/src/components/Menu/divider.tsx +36 -0
- package/src/components/Menu/index.tsx +64 -0
- package/src/components/Menu/item.tsx +219 -0
- package/src/components/Message/index.tsx +136 -0
- package/src/components/Modal/index.tsx +26 -0
- package/src/components/Navbar/divider.tsx +51 -0
- package/src/components/Navbar/group.tsx +57 -0
- package/src/components/Navbar/index.tsx +81 -0
- package/src/components/Navbar/item.tsx +75 -0
- package/src/components/Notifications/index.tsx +56 -0
- package/src/components/Notifications/notification.tsx +288 -0
- package/src/components/Panel/__screenshots__/linux/panel-SomePanel.png +0 -0
- package/src/components/Panel/index.tsx +333 -0
- package/src/components/Panel/panel.screenshot.tsx +29 -0
- package/src/components/Paragraph/index.tsx +25 -0
- package/src/components/Popover/index.tsx +65 -0
- package/src/components/RadioGroup/index.tsx +52 -0
- package/src/components/Sidebar/index.tsx +526 -0
- package/src/components/Sidebar/item.tsx +269 -0
- package/src/components/Table/body.tsx +46 -0
- package/src/components/Table/header.tsx +173 -0
- package/src/components/Table/headerCell.tsx +117 -0
- package/src/components/Table/helpers.ts +19 -0
- package/src/components/Table/index.tsx +265 -0
- package/src/components/Table/row.tsx +355 -0
- package/src/components/Tabs/content.tsx +23 -0
- package/src/components/Tabs/index.tsx +117 -0
- package/src/components/Tabs/item.tsx +151 -0
- package/src/components/Tabs/list.tsx +281 -0
- package/src/components/Tag/group.tsx +32 -0
- package/src/components/Tag/index.tsx +237 -0
- package/src/components/Textarea/index.tsx +121 -0
- package/src/components/TimeAgo/index.tsx +15 -0
- package/src/components/Tree/index.tsx +255 -0
- package/src/constants/animations.ts +4 -0
- package/src/constants/colors.ts +9 -0
- package/src/constants/sizes.ts +66 -0
- package/src/constants/theme.ts +102 -0
- package/src/containers/PopoverProvider.tsx +85 -0
- package/src/containers/ReqoreProvider.tsx +194 -0
- package/src/containers/ThemeProvider.tsx +22 -0
- package/src/containers/UIProvider.tsx +54 -0
- package/src/context/PopoverContext.tsx +10 -0
- package/src/context/ReqoreContext.tsx +20 -0
- package/src/context/ThemeContext.tsx +4 -0
- package/src/helpers/animations.ts +13 -0
- package/src/helpers/colors.ts +127 -0
- package/src/helpers/sidebar.ts +105 -0
- package/src/helpers/time.ts +21 -0
- package/src/helpers/utils.ts +75 -0
- package/src/hooks/useCombinedRefs.ts +19 -0
- package/src/hooks/useLatestZIndex.ts +11 -0
- package/src/hooks/useOutsideClick.ts +29 -0
- package/src/hooks/usePopover.tsx +118 -0
- package/src/hooks/useShareForwardedRef.ts +23 -0
- package/src/hooks/useTheme.ts +20 -0
- package/src/hooks/useTooltip.ts +15 -0
- package/src/icons.json +2295 -0
- package/src/index.tsx +49 -0
- package/src/mock/breadcrumbs.ts +93 -0
- package/src/mock/icons.ts +32 -0
- package/src/mock/menu.ts +95 -0
- package/src/mock/object.json +317 -0
- package/src/mock/styleMock.js +1 -0
- package/src/mock/tableData.ts +40 -0
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +38 -0
- package/src/stories/Button/Button.stories.tsx +69 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +26 -0
- package/src/stories/Columns/Columns.stories.tsx +71 -0
- package/src/stories/Comment/Comment.stories.tsx +127 -0
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +43 -0
- package/src/stories/Drawer/Drawer.stories.tsx +181 -0
- package/src/stories/Dropdown/Dropdown.stories.tsx +160 -0
- package/src/stories/Icon/Icon.stories.tsx +35 -0
- package/src/stories/Input/Input.stories.tsx +77 -0
- package/src/stories/Menu/Menu.stories.tsx +94 -0
- package/src/stories/Message/Message.stories.tsx +52 -0
- package/src/stories/Modal/Modal.stories.tsx +148 -0
- package/src/stories/Navbar/Navbar.stories.tsx +109 -0
- package/src/stories/Notifications/Interactive.stories.tsx +105 -0
- package/src/stories/Notifications/Notification.stories.tsx +200 -0
- package/src/stories/Notifications/Notifications.stories.tsx +65 -0
- package/src/stories/Panel/Panel.stories.tsx +107 -0
- package/src/stories/Popover/Popover.stories.tsx +54 -0
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +51 -0
- package/src/stories/Sidebar/Sidebar.stories.tsx +78 -0
- package/src/stories/Table/Table.stories.tsx +151 -0
- package/src/stories/Tabs/Tabs.stories.tsx +233 -0
- package/src/stories/Tag/Tag.stories.tsx +72 -0
- package/src/stories/TextArea/TextArea.stories.tsx +74 -0
- package/src/stories/Tree/Tree.stories.tsx +43 -0
- package/src/stories/Wrapper.tsx +13 -0
- package/src/stories/utils/args.ts +138 -0
- package/src/stories/utils.ts +17 -0
- package/src/styles.ts +38 -0
- package/src/types/global.ts +9 -0
- package/src/types/icons.ts +2272 -0
- package/src/types/icons____.ts +5 -0
- package/tests.json +1 -1
- package/tsconfig.prod.json +26 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export interface IReqoreSidebarTheme {
|
|
2
|
+
main?: string;
|
|
3
|
+
color?: string;
|
|
4
|
+
border?: string;
|
|
5
|
+
item?: {
|
|
6
|
+
color?: string;
|
|
7
|
+
background?: string;
|
|
8
|
+
border?: string;
|
|
9
|
+
hoverColor?: string;
|
|
10
|
+
hoverBackground?: string;
|
|
11
|
+
activeColor?: string;
|
|
12
|
+
activeBackground?: string;
|
|
13
|
+
};
|
|
14
|
+
subItem?: {
|
|
15
|
+
color?: string;
|
|
16
|
+
border?: string;
|
|
17
|
+
background?: string;
|
|
18
|
+
hoverColor?: string;
|
|
19
|
+
hoverBackground?: string;
|
|
20
|
+
activeColor?: string;
|
|
21
|
+
activeBackground?: string;
|
|
22
|
+
};
|
|
23
|
+
icon?: {
|
|
24
|
+
color?: string;
|
|
25
|
+
hoverColor?: string;
|
|
26
|
+
activeColor?: string;
|
|
27
|
+
};
|
|
28
|
+
section?: {
|
|
29
|
+
background?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IReqoreBreadcrumbsTheme {
|
|
34
|
+
main?: string;
|
|
35
|
+
item?: {
|
|
36
|
+
color?: string;
|
|
37
|
+
hoverColor?: string;
|
|
38
|
+
activeColor?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IReqoreNavbarTheme {
|
|
43
|
+
main?: string;
|
|
44
|
+
color?: string;
|
|
45
|
+
border?: string;
|
|
46
|
+
background?: string;
|
|
47
|
+
hoverColor?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IReqoreTheme {
|
|
51
|
+
main: string;
|
|
52
|
+
text?: {
|
|
53
|
+
color?: string;
|
|
54
|
+
dim?: boolean;
|
|
55
|
+
};
|
|
56
|
+
intents: IReqoreIntents;
|
|
57
|
+
sidebar?: IReqoreSidebarTheme;
|
|
58
|
+
notifications: IReqoreIntents;
|
|
59
|
+
popover?: {
|
|
60
|
+
main: string;
|
|
61
|
+
};
|
|
62
|
+
header?: IReqoreNavbarTheme;
|
|
63
|
+
footer?: IReqoreNavbarTheme;
|
|
64
|
+
breadcrumbs?: IReqoreBreadcrumbsTheme;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface IReqoreCustomTheme {
|
|
68
|
+
main?: string;
|
|
69
|
+
text?: {
|
|
70
|
+
color?: string;
|
|
71
|
+
dim?: boolean;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface IReqoreIntents {
|
|
76
|
+
info?: string;
|
|
77
|
+
success?: string;
|
|
78
|
+
pending?: string;
|
|
79
|
+
warning?: string;
|
|
80
|
+
danger?: string;
|
|
81
|
+
muted?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type IReqoreIntent = 'info' | 'success' | 'pending' | 'warning' | 'danger' | 'muted';
|
|
85
|
+
|
|
86
|
+
export const DEFAULT_INTENTS: IReqoreIntents = {
|
|
87
|
+
info: '#0E5A8A',
|
|
88
|
+
success: '#0A6640',
|
|
89
|
+
pending: '#d1a036',
|
|
90
|
+
warning: '#A66321',
|
|
91
|
+
danger: '#A82A2A',
|
|
92
|
+
muted: '#444444',
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const DEFAULT_THEME: IReqoreTheme = {
|
|
96
|
+
main: '#333333',
|
|
97
|
+
text: {
|
|
98
|
+
dim: true,
|
|
99
|
+
},
|
|
100
|
+
intents: DEFAULT_INTENTS,
|
|
101
|
+
notifications: {},
|
|
102
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { size } from 'lodash';
|
|
2
|
+
import React, { MutableRefObject, useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import Popover from '../components/InternalPopover';
|
|
4
|
+
import PopoverContext from '../context/PopoverContext';
|
|
5
|
+
import { IPopoverOptions } from '../hooks/usePopover';
|
|
6
|
+
|
|
7
|
+
export interface IReqorePopoverProviderProps {
|
|
8
|
+
children: any;
|
|
9
|
+
uiScale?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IPopoverData extends IPopoverOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
popperRef?: MutableRefObject<any>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiScale }) => {
|
|
18
|
+
const [popovers, setPopovers] = useState<IPopoverData[]>([]);
|
|
19
|
+
|
|
20
|
+
const handleClick = useCallback(
|
|
21
|
+
(event: MouseEvent) => {
|
|
22
|
+
popovers.forEach(({ popperRef, closeOnAnyClick, closeOnOutsideClick, id, targetElement }) => {
|
|
23
|
+
if (
|
|
24
|
+
closeOnAnyClick ||
|
|
25
|
+
(closeOnOutsideClick &&
|
|
26
|
+
popperRef?.current &&
|
|
27
|
+
!popperRef.current.contains(event.target) &&
|
|
28
|
+
!targetElement?.contains(event.target as Node))
|
|
29
|
+
) {
|
|
30
|
+
removePopover(id);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
[popovers]
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const removePopover = (id: string) => {
|
|
38
|
+
setPopovers((cur: IPopoverData[]) => [...cur].filter((p) => p.id !== id));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
document.addEventListener('click', handleClick);
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
document.removeEventListener('click', handleClick);
|
|
46
|
+
};
|
|
47
|
+
}, [popovers]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!size(popovers)) {
|
|
51
|
+
document.removeEventListener('click', handleClick);
|
|
52
|
+
}
|
|
53
|
+
}, [popovers]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<PopoverContext.Provider
|
|
57
|
+
value={{
|
|
58
|
+
uiScale,
|
|
59
|
+
addPopover: (popoverData: IPopoverData) => {
|
|
60
|
+
setPopovers((cur: IPopoverData[]) => [...cur, popoverData]);
|
|
61
|
+
},
|
|
62
|
+
updatePopover: (popoverId: string, popoverData: Partial<IPopoverData>) => {
|
|
63
|
+
setPopovers((cur: IPopoverData[]) =>
|
|
64
|
+
[...cur].reduce<IPopoverData[]>((newPopovers, popover) => {
|
|
65
|
+
if (popover.id === popoverId) {
|
|
66
|
+
return [...newPopovers, { ...popover, ...popoverData }];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return [...newPopovers, popover];
|
|
70
|
+
}, [])
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
removePopover,
|
|
74
|
+
popovers,
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{popovers.map((popover: IPopoverData) => (
|
|
78
|
+
<Popover {...popover} key={popover.id} />
|
|
79
|
+
))}
|
|
80
|
+
{children}
|
|
81
|
+
</PopoverContext.Provider>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default PopoverProvider;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { size } from 'lodash';
|
|
2
|
+
import React, { useRef, useState } from 'react';
|
|
3
|
+
import { useMedia } from 'react-use';
|
|
4
|
+
import shortid from 'shortid';
|
|
5
|
+
import { ReqoreModal } from '..';
|
|
6
|
+
import ReqoreNotificationsWrapper, {
|
|
7
|
+
IReqoreNotificationsPosition,
|
|
8
|
+
} from '../components/Notifications';
|
|
9
|
+
import ReqoreNotification, {
|
|
10
|
+
IReqoreNotificationType,
|
|
11
|
+
} from '../components/Notifications/notification';
|
|
12
|
+
import { TSizes } from '../constants/sizes';
|
|
13
|
+
import { IReqoreIntent } from '../constants/theme';
|
|
14
|
+
import ReqoreContext from '../context/ReqoreContext';
|
|
15
|
+
import { IReqoreIconName } from '../types/icons';
|
|
16
|
+
|
|
17
|
+
export interface IReqoreNotificationData {
|
|
18
|
+
title?: string;
|
|
19
|
+
content: string;
|
|
20
|
+
duration?: number;
|
|
21
|
+
icon?: IReqoreIconName;
|
|
22
|
+
onClick?: (id?: string) => any;
|
|
23
|
+
onClose?: (id?: string) => any;
|
|
24
|
+
onFinish?: (id?: string) => any;
|
|
25
|
+
id?: string;
|
|
26
|
+
type?: IReqoreNotificationType;
|
|
27
|
+
intent?: IReqoreIntent;
|
|
28
|
+
flat?: boolean;
|
|
29
|
+
inverted?: boolean;
|
|
30
|
+
size?: TSizes;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IReqoreNotifications {
|
|
34
|
+
children: any;
|
|
35
|
+
position?: IReqoreNotificationsPosition;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IReqoreConfirmationModal {
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
onConfirm?: () => void;
|
|
42
|
+
onCancel?: () => void;
|
|
43
|
+
confirmButtonIntent?: IReqoreIntent;
|
|
44
|
+
confirmLabel?: string;
|
|
45
|
+
confirmIcon?: IReqoreIconName;
|
|
46
|
+
cancelLabel?: string;
|
|
47
|
+
isOpen?: boolean;
|
|
48
|
+
intent?: IReqoreIntent;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, position }) => {
|
|
52
|
+
const [notifications, setNotifications] = useState<IReqoreNotificationData[] | null>([]);
|
|
53
|
+
const [confirmationModal, setConfirmationModal] = useState<IReqoreConfirmationModal>({});
|
|
54
|
+
const latestZIndex = useRef<number>(9000);
|
|
55
|
+
|
|
56
|
+
const isMobile = process.env.NODE_ENV === 'test' ? false : useMedia('(max-width: 480px)');
|
|
57
|
+
const isTablet =
|
|
58
|
+
process.env.NODE_ENV === 'test'
|
|
59
|
+
? false
|
|
60
|
+
: useMedia('(min-width: 480px) and (max-width: 1200px)');
|
|
61
|
+
const isMobileOrTablet = isMobile || isTablet;
|
|
62
|
+
|
|
63
|
+
const getAndIncreaseZIndex = (): number => {
|
|
64
|
+
latestZIndex.current += 1;
|
|
65
|
+
|
|
66
|
+
return latestZIndex.current;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const confirmAction = (data: IReqoreConfirmationModal): void => {
|
|
70
|
+
setConfirmationModal({
|
|
71
|
+
...data,
|
|
72
|
+
isOpen: true,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// FUnction that closes the confirmation modal
|
|
77
|
+
const closeConfirmationModal = (): void => {
|
|
78
|
+
setConfirmationModal((cur: IReqoreConfirmationModal) => ({
|
|
79
|
+
...cur,
|
|
80
|
+
isOpen: false,
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const addNotification = (data: IReqoreNotificationData) => {
|
|
85
|
+
setNotifications((cur) => {
|
|
86
|
+
let newNotifications = [...cur];
|
|
87
|
+
|
|
88
|
+
const index = cur.findIndex(
|
|
89
|
+
(notification) => notification.id === (data.id || shortid.generate())
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
if (index >= 0) {
|
|
93
|
+
newNotifications[index] = data;
|
|
94
|
+
} else {
|
|
95
|
+
newNotifications = [...newNotifications, data];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// If the length of the array is larger than 5, remove the first oldest notification
|
|
99
|
+
if (newNotifications.length > 5) {
|
|
100
|
+
newNotifications.shift();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return newNotifications;
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const removeNotification = (id: string | number) => {
|
|
108
|
+
setNotifications((cur) => {
|
|
109
|
+
return [...cur].filter((notification) => notification.id !== id);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<>
|
|
115
|
+
<ReqoreContext.Provider
|
|
116
|
+
value={{
|
|
117
|
+
notifications,
|
|
118
|
+
addNotification,
|
|
119
|
+
removeNotification,
|
|
120
|
+
confirmAction,
|
|
121
|
+
isMobile,
|
|
122
|
+
isTablet,
|
|
123
|
+
isMobileOrTablet,
|
|
124
|
+
getAndIncreaseZIndex,
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
{size(notifications) > 0 ? (
|
|
128
|
+
<ReqoreNotificationsWrapper position={position}>
|
|
129
|
+
{notifications.map((notification) => (
|
|
130
|
+
<ReqoreNotification
|
|
131
|
+
{...notification}
|
|
132
|
+
key={notification.id}
|
|
133
|
+
onClick={
|
|
134
|
+
notification?.onClick
|
|
135
|
+
? () => void notification.onClick(notification.id)
|
|
136
|
+
: undefined
|
|
137
|
+
}
|
|
138
|
+
onClose={() => {
|
|
139
|
+
if (notification.onClose) {
|
|
140
|
+
notification.onClose(notification.id);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
removeNotification(notification.id);
|
|
144
|
+
}}
|
|
145
|
+
onFinish={() => {
|
|
146
|
+
if (notification.onFinish) {
|
|
147
|
+
notification.onFinish(notification.id);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
removeNotification(notification.id);
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
))}
|
|
154
|
+
</ReqoreNotificationsWrapper>
|
|
155
|
+
) : null}
|
|
156
|
+
{children}
|
|
157
|
+
<ReqoreModal
|
|
158
|
+
isOpen={confirmationModal.isOpen}
|
|
159
|
+
flat
|
|
160
|
+
opacity={0.9}
|
|
161
|
+
blur={2}
|
|
162
|
+
intent={confirmationModal.intent}
|
|
163
|
+
label={confirmationModal.title || 'Confirm your action'}
|
|
164
|
+
icon='ErrorWarningFill'
|
|
165
|
+
bottomActions={[
|
|
166
|
+
{
|
|
167
|
+
label: confirmationModal.cancelLabel || 'Cancel',
|
|
168
|
+
icon: 'CloseLine',
|
|
169
|
+
onClick: () => {
|
|
170
|
+
confirmationModal?.onCancel?.();
|
|
171
|
+
closeConfirmationModal();
|
|
172
|
+
},
|
|
173
|
+
position: 'left',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: confirmationModal.confirmLabel || 'Confirm',
|
|
177
|
+
intent: confirmationModal.confirmButtonIntent || 'success',
|
|
178
|
+
icon: confirmationModal.confirmIcon || 'CheckLine',
|
|
179
|
+
onClick: () => {
|
|
180
|
+
confirmationModal?.onConfirm?.();
|
|
181
|
+
closeConfirmationModal();
|
|
182
|
+
},
|
|
183
|
+
position: 'right',
|
|
184
|
+
},
|
|
185
|
+
]}
|
|
186
|
+
>
|
|
187
|
+
{confirmationModal.description || 'Are you sure you want to proceed?'}
|
|
188
|
+
</ReqoreModal>
|
|
189
|
+
</ReqoreContext.Provider>
|
|
190
|
+
</>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export default ReqoreProvider;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ThemeProvider } from 'styled-components';
|
|
3
|
+
import { IReqoreTheme } from '../constants/theme';
|
|
4
|
+
import ThemeContext from '../context/ThemeContext';
|
|
5
|
+
|
|
6
|
+
const ReqoreThemeProvider = ({
|
|
7
|
+
children,
|
|
8
|
+
theme,
|
|
9
|
+
}: {
|
|
10
|
+
children: any;
|
|
11
|
+
theme?: IReqoreTheme;
|
|
12
|
+
}) => {
|
|
13
|
+
const _theme: IReqoreTheme = useContext(ThemeContext);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<ThemeProvider theme={theme || _theme}>
|
|
17
|
+
<>{children}</>
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default ReqoreThemeProvider;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cloneDeep } from 'lodash';
|
|
2
|
+
import merge from 'lodash/merge';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import ReqoreLayoutWrapper from '../components/Layout';
|
|
6
|
+
import { IReqoreNotificationsPosition } from '../components/Notifications';
|
|
7
|
+
import { DEFAULT_THEME, IReqoreTheme } from '../constants/theme';
|
|
8
|
+
import ThemeContext from '../context/ThemeContext';
|
|
9
|
+
import { buildTheme } from '../helpers/colors';
|
|
10
|
+
import PopoverProvider from './PopoverProvider';
|
|
11
|
+
import ReqoreProvider from './ReqoreProvider';
|
|
12
|
+
|
|
13
|
+
export interface IReqoreUIProviderProps {
|
|
14
|
+
children: any;
|
|
15
|
+
theme?: Partial<IReqoreTheme>;
|
|
16
|
+
notificationsPosition?: IReqoreNotificationsPosition;
|
|
17
|
+
withSidebar?: boolean;
|
|
18
|
+
uiScale?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const StyledPortal = styled.div`
|
|
22
|
+
z-index: 9999;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const ReqoreUIProvider: React.FC<IReqoreUIProviderProps> = ({
|
|
26
|
+
children,
|
|
27
|
+
theme,
|
|
28
|
+
notificationsPosition,
|
|
29
|
+
withSidebar,
|
|
30
|
+
uiScale,
|
|
31
|
+
}) => {
|
|
32
|
+
const [modalPortal, setModalPortal] = useState<any>(false);
|
|
33
|
+
|
|
34
|
+
const _theme: Partial<IReqoreTheme> = cloneDeep(theme || {});
|
|
35
|
+
const _defaultTheme: IReqoreTheme = cloneDeep(DEFAULT_THEME);
|
|
36
|
+
const rebuiltTheme: IReqoreTheme = buildTheme(merge(_defaultTheme, _theme));
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<ThemeContext.Provider value={{ ...rebuiltTheme }}>
|
|
41
|
+
<ReqoreLayoutWrapper withSidebar={withSidebar}>
|
|
42
|
+
{modalPortal ? (
|
|
43
|
+
<ReqoreProvider position={notificationsPosition}>
|
|
44
|
+
<PopoverProvider uiScale={uiScale}>{children}</PopoverProvider>
|
|
45
|
+
</ReqoreProvider>
|
|
46
|
+
) : null}
|
|
47
|
+
</ReqoreLayoutWrapper>
|
|
48
|
+
</ThemeContext.Provider>
|
|
49
|
+
<StyledPortal id='reqore-portal' ref={setModalPortal} />
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default ReqoreUIProvider;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { IPopoverData } from '../containers/PopoverProvider';
|
|
3
|
+
|
|
4
|
+
export default createContext<{
|
|
5
|
+
addPopover?: (popoverData: IPopoverData) => void;
|
|
6
|
+
removePopover?: (popoverId: string) => void;
|
|
7
|
+
updatePopover?: (popoverId: string, popoverData: Partial<IPopoverData>) => void;
|
|
8
|
+
popovers?: IPopoverData[];
|
|
9
|
+
uiScale?: number;
|
|
10
|
+
}>({});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { IReqoreConfirmationModal, IReqoreNotificationData } from '../containers/ReqoreProvider';
|
|
3
|
+
|
|
4
|
+
export interface IReqoreContext {
|
|
5
|
+
readonly confirmAction: (data: IReqoreConfirmationModal) => void;
|
|
6
|
+
readonly notifications?: IReqoreNotificationData[] | null;
|
|
7
|
+
readonly addNotification?: (data: IReqoreNotificationData) => any;
|
|
8
|
+
readonly removeNotification?: (id: string) => any;
|
|
9
|
+
readonly isMobile?: boolean;
|
|
10
|
+
readonly isTablet?: boolean;
|
|
11
|
+
readonly isMobileOrTablet?: boolean;
|
|
12
|
+
readonly getAndIncreaseZIndex?: () => number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default createContext<IReqoreContext>({
|
|
16
|
+
confirmAction: null,
|
|
17
|
+
notifications: null,
|
|
18
|
+
addNotification: null,
|
|
19
|
+
removeNotification: null,
|
|
20
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { cloneDeep, merge } from 'lodash';
|
|
2
|
+
import { darken, lighten, readableColor } from 'polished';
|
|
3
|
+
import { Colors } from '../constants/colors';
|
|
4
|
+
import { DEFAULT_INTENTS, IReqoreIntent, IReqoreTheme } from '../constants/theme';
|
|
5
|
+
|
|
6
|
+
export const getReadableColor: (
|
|
7
|
+
theme: Partial<IReqoreTheme>,
|
|
8
|
+
ifLight?: string,
|
|
9
|
+
ifDark?: string,
|
|
10
|
+
dimmed?: boolean,
|
|
11
|
+
fallback?: string
|
|
12
|
+
) => string = (theme, ifLight, ifDark, dimmed, fallback) => {
|
|
13
|
+
if (theme.text?.color) {
|
|
14
|
+
return theme.text.dim
|
|
15
|
+
? dimmed
|
|
16
|
+
? changeDarkness(theme.text.color, 0.05)
|
|
17
|
+
: theme.text.color
|
|
18
|
+
: theme.text.color;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const shouldDim = theme.text?.dim && dimmed;
|
|
22
|
+
const from = fallback || theme.main!;
|
|
23
|
+
|
|
24
|
+
return getReadableColorFrom(from, shouldDim, ifLight, ifDark);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const getReadableColorFrom = (
|
|
28
|
+
from: string,
|
|
29
|
+
dim?: boolean,
|
|
30
|
+
ifLight?: string,
|
|
31
|
+
ifDark?: string
|
|
32
|
+
) => {
|
|
33
|
+
const returnIfLight = ifLight || lighten(dim ? 0.05 : 0, Colors.DARK);
|
|
34
|
+
const returnIfDark = ifDark || darken(dim ? 0.05 : 0, Colors.LIGHT);
|
|
35
|
+
|
|
36
|
+
return readableColor(from, returnIfLight, returnIfDark, false);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const shouldDarken = (mainColor: string) => {
|
|
40
|
+
const contrast = getColorByBgColor(mainColor);
|
|
41
|
+
|
|
42
|
+
return contrast === '#000000';
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const getMainColor: (theme: IReqoreTheme, component: string) => string = (
|
|
46
|
+
theme,
|
|
47
|
+
component
|
|
48
|
+
) => theme[component]?.main || theme.main;
|
|
49
|
+
|
|
50
|
+
export const changeLightness = (color: string, lightness?: number): string =>
|
|
51
|
+
lightness ? (shouldDarken(color) ? darken(lightness, color) : lighten(lightness, color)) : color;
|
|
52
|
+
|
|
53
|
+
export const changeDarkness = (color: string, lightness?: number): string =>
|
|
54
|
+
lightness ? (shouldDarken(color) ? lighten(lightness, color) : darken(lightness, color)) : color;
|
|
55
|
+
|
|
56
|
+
export const getColorByBgColor = (bgColor) => {
|
|
57
|
+
if (!bgColor) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
return parseInt(bgColor.replace('#', ''), 16) > 0xffffff / 2 ? '#000000' : '#ffffff';
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const isValidSixCharHex = (hex: string): boolean => {
|
|
64
|
+
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(hex);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const buildTheme = (theme: IReqoreTheme): IReqoreTheme => {
|
|
68
|
+
const newTheme: IReqoreTheme = cloneDeep(theme);
|
|
69
|
+
|
|
70
|
+
// Check if the main color is a valid hex color
|
|
71
|
+
if (!isValidSixCharHex(newTheme.main)) {
|
|
72
|
+
newTheme.main = '#333333';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!newTheme.notifications?.info) {
|
|
76
|
+
newTheme.notifications.info = newTheme.intents.info || DEFAULT_INTENTS.info;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!newTheme.notifications?.success) {
|
|
80
|
+
newTheme.notifications.success = newTheme.intents.success || DEFAULT_INTENTS.success;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (!newTheme.notifications?.pending) {
|
|
84
|
+
newTheme.notifications.pending = newTheme.intents.pending || DEFAULT_INTENTS.pending;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!newTheme.notifications?.warning) {
|
|
88
|
+
newTheme.notifications.warning = newTheme.intents.warning || DEFAULT_INTENTS.warning;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!newTheme.notifications?.danger) {
|
|
92
|
+
newTheme.notifications.danger = newTheme.intents.danger || DEFAULT_INTENTS.danger;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!newTheme.notifications?.muted) {
|
|
96
|
+
newTheme.notifications.muted = newTheme.intents.muted || DEFAULT_INTENTS.muted;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return newTheme;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const mergeThemes = (element: string, theme: IReqoreTheme, customTheme: any) => {
|
|
103
|
+
const clonedTheme = cloneDeep(theme);
|
|
104
|
+
|
|
105
|
+
if (!customTheme) {
|
|
106
|
+
return clonedTheme;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (element === 'main' && customTheme) {
|
|
110
|
+
merge(clonedTheme, { main: customTheme.main });
|
|
111
|
+
} else {
|
|
112
|
+
merge(clonedTheme, { [element]: customTheme || {} });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return clonedTheme;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const getNotificationIntent = (theme: IReqoreTheme, intent?: IReqoreIntent) => {
|
|
119
|
+
if (intent) {
|
|
120
|
+
return theme.notifications[intent];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return theme.main;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const getMainBackgroundColor = (theme: IReqoreTheme): string =>
|
|
127
|
+
changeLightness(theme.main, 0.02);
|