@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,117 @@
|
|
|
1
|
+
import React, { ReactElement, useEffect, useState } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { TSizes } from '../../constants/sizes';
|
|
4
|
+
import { IReqoreCustomTheme, IReqoreIntent } from '../../constants/theme';
|
|
5
|
+
import { TReqoreTooltipProp } from '../../types/global';
|
|
6
|
+
import { IReqoreIconName } from '../../types/icons';
|
|
7
|
+
import ReqoreTabsList from './list';
|
|
8
|
+
|
|
9
|
+
export interface IReqoreTabsListItem {
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: IReqoreIconName;
|
|
12
|
+
as?: any;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
id: string | number;
|
|
15
|
+
tooltip?: TReqoreTooltipProp;
|
|
16
|
+
props?: React.HTMLAttributes<any>;
|
|
17
|
+
onClick?: (event: any) => any;
|
|
18
|
+
onCloseClick?: (id: string | number) => any;
|
|
19
|
+
activeIntent?: IReqoreIntent;
|
|
20
|
+
intent?: IReqoreIntent;
|
|
21
|
+
closeIcon?: IReqoreIconName;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IReqoreTabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
tabs: IReqoreTabsListItem[];
|
|
26
|
+
activeTab?: string | number;
|
|
27
|
+
onTabChange?: (tabId: string | number) => any;
|
|
28
|
+
children?: ReactElement<any>[] | ReactElement<any>;
|
|
29
|
+
fill?: boolean;
|
|
30
|
+
fillParent?: boolean;
|
|
31
|
+
vertical?: boolean;
|
|
32
|
+
activeTabIntent?: IReqoreIntent;
|
|
33
|
+
wrapTabNames?: boolean;
|
|
34
|
+
flat?: boolean;
|
|
35
|
+
size?: TSizes;
|
|
36
|
+
width?: string;
|
|
37
|
+
customTheme?: IReqoreCustomTheme;
|
|
38
|
+
intent?: IReqoreIntent;
|
|
39
|
+
// Internal prop, ignore!
|
|
40
|
+
_testWidth?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const StyledTabs = styled.div<Partial<IReqoreTabsProps>>`
|
|
44
|
+
display: flex;
|
|
45
|
+
${({ vertical, fillParent, width }) => css`
|
|
46
|
+
width: ${width ? `${width}px` : '100%'};
|
|
47
|
+
height: ${fillParent ? '100%' : undefined};
|
|
48
|
+
flex-flow: ${vertical ? 'row' : 'column'};
|
|
49
|
+
`}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const ReqoreTabs = ({
|
|
53
|
+
tabs,
|
|
54
|
+
activeTab,
|
|
55
|
+
children,
|
|
56
|
+
className,
|
|
57
|
+
onTabChange,
|
|
58
|
+
fill,
|
|
59
|
+
_testWidth,
|
|
60
|
+
vertical,
|
|
61
|
+
activeTabIntent,
|
|
62
|
+
flat,
|
|
63
|
+
size = 'normal',
|
|
64
|
+
width,
|
|
65
|
+
wrapTabNames,
|
|
66
|
+
customTheme,
|
|
67
|
+
intent,
|
|
68
|
+
...rest
|
|
69
|
+
}: IReqoreTabsProps) => {
|
|
70
|
+
const [_activeTab, setActiveTab] = useState<string | number>(activeTab || tabs[0].id);
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (activeTab || activeTab === 0) {
|
|
74
|
+
setActiveTab(activeTab);
|
|
75
|
+
|
|
76
|
+
if (onTabChange) {
|
|
77
|
+
onTabChange(activeTab);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [activeTab]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<StyledTabs
|
|
84
|
+
{...rest}
|
|
85
|
+
width={width}
|
|
86
|
+
vertical={vertical}
|
|
87
|
+
className={`${className || ''} reqore-tabs`}
|
|
88
|
+
>
|
|
89
|
+
<ReqoreTabsList
|
|
90
|
+
tabs={tabs}
|
|
91
|
+
flat={flat}
|
|
92
|
+
fill={fill}
|
|
93
|
+
size={size}
|
|
94
|
+
width={width}
|
|
95
|
+
vertical={vertical}
|
|
96
|
+
_testWidth={_testWidth}
|
|
97
|
+
activeTab={_activeTab}
|
|
98
|
+
wrapTabNames={wrapTabNames}
|
|
99
|
+
activeTabIntent={activeTabIntent}
|
|
100
|
+
customTheme={customTheme}
|
|
101
|
+
intent={intent}
|
|
102
|
+
onTabChange={(tabId: string | number) => {
|
|
103
|
+
setActiveTab(tabId);
|
|
104
|
+
|
|
105
|
+
if (onTabChange) {
|
|
106
|
+
onTabChange(tabId);
|
|
107
|
+
}
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
{React.Children.map(children, (child) =>
|
|
111
|
+
child && child.props?.tabId === _activeTab ? child : null
|
|
112
|
+
)}
|
|
113
|
+
</StyledTabs>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default ReqoreTabs;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { forwardRef, useRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { IReqoreTabsListItem } from '.';
|
|
4
|
+
import { TABS_PADDING_TO_PX, TSizes } from '../../constants/sizes';
|
|
5
|
+
import { IReqoreCustomTheme, IReqoreTheme } from '../../constants/theme';
|
|
6
|
+
import { useCombinedRefs } from '../../hooks/useCombinedRefs';
|
|
7
|
+
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
8
|
+
import ReqoreButton from '../Button';
|
|
9
|
+
import ReqoreControlGroup from '../ControlGroup';
|
|
10
|
+
|
|
11
|
+
export interface IReqoreTabListItemProps extends IReqoreTabsListItem {
|
|
12
|
+
active?: boolean;
|
|
13
|
+
vertical?: boolean;
|
|
14
|
+
onCloseClick?: any;
|
|
15
|
+
customTheme?: IReqoreCustomTheme;
|
|
16
|
+
size?: TSizes;
|
|
17
|
+
wrapTabNames?: boolean;
|
|
18
|
+
fill?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IReqoreTabListItemStyle extends IReqoreTabListItemProps {
|
|
23
|
+
theme: IReqoreTheme;
|
|
24
|
+
closable?: boolean;
|
|
25
|
+
activeColor: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const StyledTabListItem = styled.div<IReqoreTabListItemStyle>`
|
|
29
|
+
${({ active, disabled, vertical, activeColor, size, fill }: IReqoreTabListItemStyle) => {
|
|
30
|
+
return css`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
position: relative;
|
|
35
|
+
align-items: center;
|
|
36
|
+
width: ${vertical ? `100%` : undefined};
|
|
37
|
+
padding: ${vertical ? `${TABS_PADDING_TO_PX[size!]}px` : `${TABS_PADDING_TO_PX[size!]}px`};
|
|
38
|
+
${active &&
|
|
39
|
+
css`
|
|
40
|
+
background-color: ${activeColor}60;
|
|
41
|
+
`}
|
|
42
|
+
|
|
43
|
+
${fill &&
|
|
44
|
+
css`
|
|
45
|
+
flex: 1;
|
|
46
|
+
`}
|
|
47
|
+
|
|
48
|
+
${disabled &&
|
|
49
|
+
css`
|
|
50
|
+
cursor: not-allowed;
|
|
51
|
+
> * {
|
|
52
|
+
opacity: 0.5;
|
|
53
|
+
}
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
56
|
+
}}
|
|
57
|
+
|
|
58
|
+
a {
|
|
59
|
+
text-decoration: none;
|
|
60
|
+
|
|
61
|
+
&:hover > * {
|
|
62
|
+
text-decoration: underline;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const ReqoreTabsListItem = forwardRef(
|
|
68
|
+
(
|
|
69
|
+
{
|
|
70
|
+
tooltip,
|
|
71
|
+
label,
|
|
72
|
+
props,
|
|
73
|
+
icon,
|
|
74
|
+
active,
|
|
75
|
+
as,
|
|
76
|
+
disabled,
|
|
77
|
+
vertical,
|
|
78
|
+
onClick,
|
|
79
|
+
activeIntent,
|
|
80
|
+
onCloseClick,
|
|
81
|
+
fill,
|
|
82
|
+
intent,
|
|
83
|
+
size = 'normal',
|
|
84
|
+
closeIcon,
|
|
85
|
+
customTheme,
|
|
86
|
+
className,
|
|
87
|
+
}: IReqoreTabListItemProps,
|
|
88
|
+
ref
|
|
89
|
+
) => {
|
|
90
|
+
const innerRef = useRef(null);
|
|
91
|
+
const combinedRef = useCombinedRefs(innerRef, ref);
|
|
92
|
+
const theme = useReqoreTheme('main', customTheme);
|
|
93
|
+
const _intent = activeIntent || intent;
|
|
94
|
+
const activeColor = _intent ? theme.intents[_intent] : theme.main;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<StyledTabListItem
|
|
98
|
+
ref={combinedRef}
|
|
99
|
+
{...props}
|
|
100
|
+
className={className}
|
|
101
|
+
intent={intent}
|
|
102
|
+
activeIntent={activeIntent}
|
|
103
|
+
activeColor={activeColor}
|
|
104
|
+
as={as}
|
|
105
|
+
size={size}
|
|
106
|
+
active={active}
|
|
107
|
+
disabled={disabled}
|
|
108
|
+
vertical={vertical}
|
|
109
|
+
theme={theme}
|
|
110
|
+
fill={fill}
|
|
111
|
+
>
|
|
112
|
+
{label || icon ? (
|
|
113
|
+
<ReqoreControlGroup stack size={size} fluid={fill || vertical}>
|
|
114
|
+
<ReqoreButton
|
|
115
|
+
flat
|
|
116
|
+
fluid={fill || vertical}
|
|
117
|
+
icon={icon}
|
|
118
|
+
minimal
|
|
119
|
+
intent={active ? activeIntent || intent : intent}
|
|
120
|
+
active={active}
|
|
121
|
+
disabled={disabled}
|
|
122
|
+
onClick={onClick}
|
|
123
|
+
tooltip={tooltip}
|
|
124
|
+
customTheme={customTheme}
|
|
125
|
+
className={`reqore-tabs-list-item ${active ? 'reqore-tabs-list-item-active' : ''}`}
|
|
126
|
+
>
|
|
127
|
+
{label}
|
|
128
|
+
</ReqoreButton>
|
|
129
|
+
{onCloseClick && !disabled ? (
|
|
130
|
+
<ReqoreButton
|
|
131
|
+
fixed
|
|
132
|
+
flat
|
|
133
|
+
icon={closeIcon || 'CloseLine'}
|
|
134
|
+
intent={active ? activeIntent || intent : intent}
|
|
135
|
+
minimal
|
|
136
|
+
className='reqore-tabs-list-item-close'
|
|
137
|
+
customTheme={customTheme}
|
|
138
|
+
onClick={(event) => {
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
onCloseClick?.();
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
) : null}
|
|
144
|
+
</ReqoreControlGroup>
|
|
145
|
+
) : null}
|
|
146
|
+
</StyledTabListItem>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
export default ReqoreTabsListItem;
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { isArray } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useMeasure } from 'react-use';
|
|
4
|
+
import styled, { css } from 'styled-components';
|
|
5
|
+
import { IReqoreTabsListItem, IReqoreTabsProps } from '.';
|
|
6
|
+
import { ReqorePopover } from '../..';
|
|
7
|
+
import { TABS_SIZE_TO_PX, TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
8
|
+
import { IReqoreBreadcrumbsTheme, IReqoreCustomTheme, IReqoreTheme } from '../../constants/theme';
|
|
9
|
+
import ReqoreThemeProvider from '../../containers/ThemeProvider';
|
|
10
|
+
import { changeLightness } from '../../helpers/colors';
|
|
11
|
+
import { calculateStringSizeInPixels } from '../../helpers/utils';
|
|
12
|
+
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
13
|
+
import ReqoreMenu from '../Menu';
|
|
14
|
+
import ReqoreMenuItem, { IReqoreMenuItemProps } from '../Menu/item';
|
|
15
|
+
import { StyledPopover } from '../Popover';
|
|
16
|
+
import ReqoreTabsListItem, { IReqoreTabListItemProps, StyledTabListItem } from './item';
|
|
17
|
+
|
|
18
|
+
export interface IReqoreTabsListProps
|
|
19
|
+
extends IReqoreTabsProps,
|
|
20
|
+
React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
onTabChange?: (tabId: string | number) => any;
|
|
22
|
+
children?: any;
|
|
23
|
+
customTheme?: IReqoreCustomTheme | IReqoreBreadcrumbsTheme;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IReqoreTabsListStyle extends Omit<IReqoreTabsListProps, 'tabs'> {
|
|
27
|
+
theme: IReqoreTheme;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const StyledReqoreTabsList = styled.div<IReqoreTabsListStyle>`
|
|
31
|
+
${({ theme, fill, vertical, size, width }) => css`
|
|
32
|
+
height: ${vertical ? '100%' : `${TABS_SIZE_TO_PX[size]}px`};
|
|
33
|
+
width: ${vertical ? width || '200px' : '100%'};
|
|
34
|
+
flex-flow: ${vertical ? 'column' : 'row'};
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
border-${vertical ? 'right' : 'bottom'}: 1px solid ${changeLightness(theme.main, 0.05)};
|
|
38
|
+
|
|
39
|
+
${
|
|
40
|
+
fill &&
|
|
41
|
+
css`
|
|
42
|
+
justify-content: space-around;
|
|
43
|
+
`
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
${StyledPopover} {
|
|
47
|
+
> ${StyledTabListItem} {
|
|
48
|
+
height: 100%;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`}
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
const isTabHidden = (items: IReqoreTabsListItem[], activeTab?: string | number) =>
|
|
55
|
+
items.find((item) => item?.id === activeTab);
|
|
56
|
+
|
|
57
|
+
const getMoreLabel = (items: IReqoreTabsListItem[], activeTab?: string | number) => {
|
|
58
|
+
if (isTabHidden(items, activeTab)) {
|
|
59
|
+
return isTabHidden(items, activeTab)?.label;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return 'More';
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const getLabel = (
|
|
66
|
+
item: IReqoreTabsListItem | IReqoreTabsListItem[],
|
|
67
|
+
activeTab?: string | number,
|
|
68
|
+
tabsSize: TSizes = 'normal'
|
|
69
|
+
) => {
|
|
70
|
+
if (!item) {
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const label: string = isArray(item) ? getMoreLabel(item, activeTab) : item.label;
|
|
75
|
+
const icon: number = isArray(item) || item.icon ? TEXT_FROM_SIZE[tabsSize] : 0;
|
|
76
|
+
const closeIconSize = isArray(item) || !item.onCloseClick ? 0 : 30;
|
|
77
|
+
|
|
78
|
+
return calculateStringSizeInPixels(label, TEXT_FROM_SIZE[tabsSize]) + icon + closeIconSize;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const getTabsLength = (
|
|
82
|
+
items: (IReqoreTabsListItem | IReqoreTabsListItem[])[],
|
|
83
|
+
type: 'width' | 'height' = 'width',
|
|
84
|
+
activeTab?: string | number,
|
|
85
|
+
tabsSize?: TSizes
|
|
86
|
+
): number =>
|
|
87
|
+
items.reduce((len, item) => {
|
|
88
|
+
if (type === 'height') {
|
|
89
|
+
const rows = getLabel(item, activeTab, tabsSize) / 4 || 1;
|
|
90
|
+
|
|
91
|
+
return len + rows * 15 + 10;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return len + 36 + getLabel(item, activeTab, tabsSize);
|
|
95
|
+
}, 0);
|
|
96
|
+
|
|
97
|
+
const getTransformedItems = (
|
|
98
|
+
items: (IReqoreTabsListItem | IReqoreTabsListItem[])[],
|
|
99
|
+
size: number,
|
|
100
|
+
type: 'width' | 'height' = 'width',
|
|
101
|
+
activeTab?: string | number,
|
|
102
|
+
tabsSize?: TSizes
|
|
103
|
+
): (IReqoreTabsListItem | IReqoreTabsListItem[])[] => {
|
|
104
|
+
if (!size) {
|
|
105
|
+
return items;
|
|
106
|
+
}
|
|
107
|
+
let newItems = [...items];
|
|
108
|
+
|
|
109
|
+
console.log('SIZES', getTabsLength(newItems, type, activeTab, tabsSize), size);
|
|
110
|
+
|
|
111
|
+
while (getTabsLength(newItems, type, activeTab, tabsSize) > size && newItems.length > 1) {
|
|
112
|
+
if (isArray(newItems[newItems.length - 1])) {
|
|
113
|
+
(newItems[newItems.length - 1] as IReqoreTabsListItem[]).unshift(
|
|
114
|
+
newItems[newItems.length - 2] as IReqoreTabsListItem
|
|
115
|
+
);
|
|
116
|
+
newItems[newItems.length - 2] = undefined!;
|
|
117
|
+
} else {
|
|
118
|
+
const lastItem = newItems[newItems.length - 1];
|
|
119
|
+
(newItems[newItems.length - 1] as IReqoreTabsListItem[]) = [
|
|
120
|
+
lastItem,
|
|
121
|
+
] as IReqoreTabsListItem[];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
newItems = newItems.filter((i) => i);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return newItems.filter((i) => i);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const ReqoreTabsList = ({
|
|
131
|
+
tabs,
|
|
132
|
+
onTabChange,
|
|
133
|
+
activeTab,
|
|
134
|
+
_testWidth,
|
|
135
|
+
fill,
|
|
136
|
+
vertical,
|
|
137
|
+
activeTabIntent,
|
|
138
|
+
customTheme,
|
|
139
|
+
wrapTabNames,
|
|
140
|
+
flat,
|
|
141
|
+
size,
|
|
142
|
+
intent,
|
|
143
|
+
...rest
|
|
144
|
+
}: IReqoreTabsListProps) => {
|
|
145
|
+
const [ref, { width, height }] = useMeasure();
|
|
146
|
+
const theme = useReqoreTheme('main', customTheme, intent);
|
|
147
|
+
|
|
148
|
+
const transformedItems = vertical
|
|
149
|
+
? tabs
|
|
150
|
+
: getTransformedItems(
|
|
151
|
+
tabs,
|
|
152
|
+
vertical ? height : _testWidth || width,
|
|
153
|
+
vertical ? 'height' : 'width',
|
|
154
|
+
activeTab,
|
|
155
|
+
size
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<ReqoreThemeProvider theme={theme}>
|
|
160
|
+
<StyledReqoreTabsList
|
|
161
|
+
{...rest}
|
|
162
|
+
size={size}
|
|
163
|
+
fill={fill}
|
|
164
|
+
vertical={vertical}
|
|
165
|
+
className={`${rest.className || ''} reqore-tabs-list`}
|
|
166
|
+
ref={ref}
|
|
167
|
+
flat={flat}
|
|
168
|
+
theme={theme}
|
|
169
|
+
>
|
|
170
|
+
{transformedItems.map((item: IReqoreTabsListItem | IReqoreTabsListItem[], index: number) =>
|
|
171
|
+
isArray(item) ? (
|
|
172
|
+
<React.Fragment key={index}>
|
|
173
|
+
<ReqorePopover
|
|
174
|
+
key={index}
|
|
175
|
+
component={ReqoreTabsListItem}
|
|
176
|
+
componentProps={
|
|
177
|
+
{
|
|
178
|
+
icon: 'ArrowDownSLine',
|
|
179
|
+
id: 'showMore',
|
|
180
|
+
label: getMoreLabel(item, activeTab),
|
|
181
|
+
active: !!isTabHidden(item, activeTab),
|
|
182
|
+
activeIntent: activeTabIntent,
|
|
183
|
+
customTheme: theme,
|
|
184
|
+
vertical,
|
|
185
|
+
flat,
|
|
186
|
+
size,
|
|
187
|
+
className: 'reqore-tabs-list-item-menu',
|
|
188
|
+
} as IReqoreTabListItemProps
|
|
189
|
+
}
|
|
190
|
+
closeOnOutsideClick
|
|
191
|
+
isReqoreComponent
|
|
192
|
+
handler='hoverStay'
|
|
193
|
+
content={
|
|
194
|
+
<ReqoreMenu customTheme={theme}>
|
|
195
|
+
{item.map(
|
|
196
|
+
({
|
|
197
|
+
icon,
|
|
198
|
+
label,
|
|
199
|
+
as,
|
|
200
|
+
tooltip,
|
|
201
|
+
props,
|
|
202
|
+
disabled,
|
|
203
|
+
id,
|
|
204
|
+
onCloseClick,
|
|
205
|
+
intent,
|
|
206
|
+
activeIntent,
|
|
207
|
+
closeIcon,
|
|
208
|
+
}) => (
|
|
209
|
+
<ReqoreMenuItem
|
|
210
|
+
{...({
|
|
211
|
+
...props,
|
|
212
|
+
icon,
|
|
213
|
+
as,
|
|
214
|
+
intent: activeTab === id ? activeIntent || intent : intent,
|
|
215
|
+
disabled,
|
|
216
|
+
rightIcon: onCloseClick ? closeIcon || 'CloseLine' : undefined,
|
|
217
|
+
onRightIconClick: onCloseClick
|
|
218
|
+
? () => {
|
|
219
|
+
onCloseClick(id);
|
|
220
|
+
}
|
|
221
|
+
: undefined,
|
|
222
|
+
selected: activeTab === id,
|
|
223
|
+
onClick: (_id, event: React.MouseEvent<any>) => {
|
|
224
|
+
if (!disabled) {
|
|
225
|
+
onTabChange?.(id);
|
|
226
|
+
|
|
227
|
+
if (props?.onClick) {
|
|
228
|
+
props.onClick(event);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
} as IReqoreMenuItemProps)}
|
|
233
|
+
tooltip={tooltip}
|
|
234
|
+
key={index + label}
|
|
235
|
+
>
|
|
236
|
+
{label}
|
|
237
|
+
</ReqoreMenuItem>
|
|
238
|
+
)
|
|
239
|
+
)}
|
|
240
|
+
</ReqoreMenu>
|
|
241
|
+
}
|
|
242
|
+
/>
|
|
243
|
+
</React.Fragment>
|
|
244
|
+
) : (
|
|
245
|
+
<React.Fragment key={index}>
|
|
246
|
+
<ReqoreTabsListItem
|
|
247
|
+
{...item}
|
|
248
|
+
fill={fill}
|
|
249
|
+
size={size}
|
|
250
|
+
activeIntent={activeTabIntent}
|
|
251
|
+
customTheme={theme}
|
|
252
|
+
wrapTabNames={wrapTabNames}
|
|
253
|
+
key={index}
|
|
254
|
+
vertical={vertical}
|
|
255
|
+
active={activeTab === item.id}
|
|
256
|
+
onClick={(event: React.MouseEvent<any>) => {
|
|
257
|
+
if (!item.disabled) {
|
|
258
|
+
onTabChange?.(item.id);
|
|
259
|
+
|
|
260
|
+
if (item.props?.onClick) {
|
|
261
|
+
item.props.onClick(event);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}}
|
|
265
|
+
onCloseClick={
|
|
266
|
+
item.onCloseClick
|
|
267
|
+
? () => {
|
|
268
|
+
item.onCloseClick?.(item.id);
|
|
269
|
+
}
|
|
270
|
+
: undefined
|
|
271
|
+
}
|
|
272
|
+
/>
|
|
273
|
+
</React.Fragment>
|
|
274
|
+
)
|
|
275
|
+
)}
|
|
276
|
+
</StyledReqoreTabsList>
|
|
277
|
+
</ReqoreThemeProvider>
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export default ReqoreTabsList;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { StyledTag } from '.';
|
|
4
|
+
import { TSizes } from '../../constants/sizes';
|
|
5
|
+
|
|
6
|
+
export interface IReqoreTagGroup extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
children: any;
|
|
8
|
+
size?: TSizes;
|
|
9
|
+
columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const StyledTagGroup = styled.div`
|
|
13
|
+
${StyledTag} {
|
|
14
|
+
margin-right: 5px;
|
|
15
|
+
margin-bottom: 5px;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const ReqoreTagGroup = ({ children, size, className, columns, ...rest }: IReqoreTagGroup) => (
|
|
20
|
+
<StyledTagGroup {...rest} className={`${className || ''} reqore-tag-group`}>
|
|
21
|
+
{React.Children.map(children, (child) =>
|
|
22
|
+
child
|
|
23
|
+
? React.cloneElement(child, {
|
|
24
|
+
size,
|
|
25
|
+
width: columns ? `calc(${100 / columns}% - 5px)` : child.props.width,
|
|
26
|
+
})
|
|
27
|
+
: null
|
|
28
|
+
)}
|
|
29
|
+
</StyledTagGroup>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export default ReqoreTagGroup;
|