From 6bf2f15696ecca0abdeaea80aaedecdf87b15a04 Mon Sep 17 00:00:00 2001 From: xiexiejie Date: Fri, 6 Dec 2024 16:25:27 +0800 Subject: [PATCH] feat: add default content-padding --- packages/bui-core/src/Popover/Popover.less | 2 +- packages/bui-core/src/Popover/index.en-US.md | 84 +++++--------------- packages/bui-core/src/Popover/index.zh-CN.md | 84 +++++--------------- 3 files changed, 39 insertions(+), 131 deletions(-) diff --git a/packages/bui-core/src/Popover/Popover.less b/packages/bui-core/src/Popover/Popover.less index 616f390..a9d3175 100644 --- a/packages/bui-core/src/Popover/Popover.less +++ b/packages/bui-core/src/Popover/Popover.less @@ -40,7 +40,7 @@ --localtion-position: var(--bui-popover-localtion-position, 8PX); --max-width: var(--bui-popover-max-width, 350px); --content-min-width: var(--bui-popover-content-min-width, 30px); - --content-padding: var(--bui-popover-content-padding, 0); + --content-padding: var(--bui-popover-content-padding, 6px 8px); max-width: var(--max-width); font-size: var(--bui-text-size-1); position: absolute; diff --git a/packages/bui-core/src/Popover/index.en-US.md b/packages/bui-core/src/Popover/index.en-US.md index 3dbcf20..66ffe8e 100644 --- a/packages/bui-core/src/Popover/index.en-US.md +++ b/packages/bui-core/src/Popover/index.en-US.md @@ -19,10 +19,7 @@ import React from 'react'; export default () => { return ( - This is a title} - content={
This is a content
} - > + click显示 ); @@ -40,10 +37,7 @@ import React, { useState } from 'react'; export default () => { const [open, setOpen] = useState(true); return ( - This is a popover} - open={open} - > + setOpen(!open)}>open控制显隐 ); @@ -60,10 +54,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - defaultOpen - > + defaultOpen默认显示 ); @@ -80,11 +71,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - defaultOpen - hideArrow - > + defaultOpen默认显示 ); @@ -118,25 +105,13 @@ export default () => { justifyContent: 'space-between', }} > - This is a popover} - placement="topLeft" - > + {packageButton(topLeft)} - This is a popover} - placement="top" - > + {packageButton(top)} - This is a popover} - placement="topRight" - > + {packageButton(topRight)} @@ -148,23 +123,15 @@ export default () => { flexDirection: 'column', }} > - This is a popover} - placement="leftTop" - > + {packageButton(leftTop)} - This is a popover} - placement="left" - > + {packageButton(left)} This is a popover} + title="This is a popover" placement="leftBottom" > {packageButton(leftBottom)} @@ -178,23 +145,15 @@ export default () => { flexDirection: 'column', }} > - This is a popover} - placement="rightTop" - > + {packageButton(rightTop)} - This is a popover} - placement="right" - > + {packageButton(right)} This is a popover} + title="This is a popover" placement="rightBottom" > {packageButton(rightBottom)} @@ -211,21 +170,17 @@ export default () => { > This is a popover} + title="This is a popover" placement="bottomLeft" > {packageButton(bottomLeft)} - This is a popover} - placement="bottom" - > + {packageButton(bottom)} This is a popover} + title="This is a popover" placement="bottomRight" > {packageButton(bottomRight)} @@ -246,10 +201,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - trigger="hover" - > + hover触发方式 ); @@ -268,7 +220,7 @@ export default () => { }; return ( This is a popover} + title="This is a popover" trigger="hover" onOpenChange={onOpenChange} > diff --git a/packages/bui-core/src/Popover/index.zh-CN.md b/packages/bui-core/src/Popover/index.zh-CN.md index 977106c..db08a59 100644 --- a/packages/bui-core/src/Popover/index.zh-CN.md +++ b/packages/bui-core/src/Popover/index.zh-CN.md @@ -20,8 +20,9 @@ import React from 'react'; export default () => { return ( This is a title} - content={
This is a content
} + title="This is a title" + content="This is a content" + placement="topLeft" > click显示
@@ -40,10 +41,7 @@ import React, { useState } from 'react'; export default () => { const [open, setOpen] = useState(true); return ( - This is a popover} - open={open} - > + setOpen(!open)}>open控制显隐 ); @@ -60,10 +58,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - defaultOpen - > + defaultOpen默认显示 ); @@ -80,11 +75,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - defaultOpen - hideArrow - > + defaultOpen默认显示 ); @@ -118,25 +109,13 @@ export default () => { justifyContent: 'space-between', }} > - This is a popover} - placement="topLeft" - > + {packageButton(topLeft)} - This is a popover} - placement="top" - > + {packageButton(top)} - This is a popover} - placement="topRight" - > + {packageButton(topRight)} @@ -148,23 +127,15 @@ export default () => { flexDirection: 'column', }} > - This is a popover} - placement="leftTop" - > + {packageButton(leftTop)} - This is a popover} - placement="left" - > + {packageButton(left)} This is a popover} + title="This is a popover" placement="leftBottom" > {packageButton(leftBottom)} @@ -178,23 +149,15 @@ export default () => { flexDirection: 'column', }} > - This is a popover} - placement="rightTop" - > + {packageButton(rightTop)} - This is a popover} - placement="right" - > + {packageButton(right)} This is a popover} + title="This is a popover" placement="rightBottom" > {packageButton(rightBottom)} @@ -211,21 +174,17 @@ export default () => { > This is a popover} + title="This is a popover" placement="bottomLeft" > {packageButton(bottomLeft)} - This is a popover} - placement="bottom" - > + {packageButton(bottom)} This is a popover} + title="This is a popover" placement="bottomRight" > {packageButton(bottomRight)} @@ -246,10 +205,7 @@ import React from 'react'; export default () => { return ( - This is a popover} - trigger="hover" - > + hover触发方式 ); @@ -268,7 +224,7 @@ export default () => { }; return ( This is a popover} + title="This is a popover" trigger="hover" onOpenChange={onOpenChange} >