From 0a82bd5ac9683bf21297fa129482ca519b5fefc7 Mon Sep 17 00:00:00 2001 From: Foxhoundn Date: Thu, 13 Apr 2023 12:49:52 +0000 Subject: [PATCH] Added disabled prop to panel and fill to menu item --- package.json | 2 +- src/components/Menu/item.tsx | 2 +- src/components/Panel/index.tsx | 9 +++++++-- src/stories/Menu/Menu.stories.tsx | 10 ++++++++++ src/stories/Panel/Panel.stories.tsx | 7 ++++++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 11891190..e9a91e6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qoretechnologies/reqore", - "version": "0.34.7", + "version": "0.34.8", "description": "ReQore is a highly theme-able and modular UI library for React", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/components/Menu/item.tsx b/src/components/Menu/item.tsx index e3a18164..a221947a 100644 --- a/src/components/Menu/item.tsx +++ b/src/components/Menu/item.tsx @@ -91,7 +91,7 @@ const ReqoreMenuItem = forwardRef( }, [itemRef, scrollIntoView]); return ( - + void; closeButtonProps?: IReqoreButtonProps; @@ -226,6 +227,8 @@ export const StyledPanel = styled(StyledEffect)` flex: 1; ` : undefined} + + ${({ disabled }) => disabled && DisabledElement} `; export const StyledPanelTitle = styled.div` @@ -334,6 +337,7 @@ export const ReqorePanel = forwardRef( size: panelSize = 'normal', getContentRef, headerProps = {}, + disabled, ...rest }: IReqorePanelProps, ref @@ -608,6 +612,7 @@ export const ReqorePanel = forwardRef( effect={transformedContentEffect} opacity={opacity} fluid={fluid} + disabled={disabled} > {hasTitleBar && ( = (args) => { Delete + alert('Icon clicked')} + description='Button with right icon and description' + intent='info' + > + Some button + + This is a really long item that should wrap diff --git a/src/stories/Panel/Panel.stories.tsx b/src/stories/Panel/Panel.stories.tsx index 652a296f..951a6c8c 100644 --- a/src/stories/Panel/Panel.stories.tsx +++ b/src/stories/Panel/Panel.stories.tsx @@ -6,7 +6,7 @@ import { IReqorePanelAction, IReqorePanelProps, ReqorePanel } from '../../compon import { ReqoreVerticalSpacer } from '../../components/Spacer'; import ReqoreTag from '../../components/Tag'; import { IReqoreIconName } from '../../types/icons'; -import { argManager, FlatArg, IconArg, IntentArg, SizeArg } from '../utils/args'; +import { FlatArg, IconArg, IntentArg, SizeArg, argManager } from '../utils/args'; const { createArg } = argManager(); @@ -342,6 +342,11 @@ Minimal.args = { flat: true, }; +export const Disabled: Story = Template.bind({}); +Disabled.args = { + disabled: true, +}; + export const NonResponsiveActions: Story = Template.bind({}); NonResponsiveActions.args = { responsiveActions: false,