Commit 8ab77d1 1 parent 7073558 commit 8ab77d1 Copy full SHA for 8ab77d1
File tree 3 files changed +45
-4
lines changed
website/src/routes/docs/_mdx/components
3 files changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ export const PopoverContent = (props: PrimitiveProps<"div">) => {
28
28
< PopperFloating
29
29
duration = { duration }
30
30
className = { tx (
31
- "border-bd-normal relative border shadow-md transition-opacity" ,
31
+ "relative border shadow-md transition-opacity" ,
32
32
status == "open" ? "opacity-100" : "opacity-0" ,
33
- ! hasBackgroundClass ( className ) && " bg-bg-normal",
33
+ hasBackgroundClass ( className ) ? "border-transparent" : " bg-bg-normal border-bd -normal",
34
34
className ,
35
35
) }
36
36
aria-labelledby = { labelId }
Original file line number Diff line number Diff line change 1
1
import { FloatingArrow , type FloatingArrowProps } from "@floating-ui/react" ;
2
- import { tx } from "../../utils" ;
3
2
import { usePopperArrow } from "./popper-arrow-context" ;
4
3
5
4
export type PopperArrowProps = Omit < FloatingArrowProps , "context" | "stroke" | "fill" > ;
@@ -12,7 +11,7 @@ export const PopperArrow = (props: PopperArrowProps) => {
12
11
return (
13
12
< FloatingArrow
14
13
ref = { setArrow }
15
- className = { tx ( arrowClassName , className ) }
14
+ className = { className ?. includes ( "fill-" ) ? className : arrowClassName }
16
15
strokeWidth = { strokeWidth }
17
16
width = { width }
18
17
height = { height }
Original file line number Diff line number Diff line change @@ -335,6 +335,48 @@ export default function App() {
335
335
}
336
336
` ` `
337
337
338
+ ### 背景颜色
339
+
340
+ ` ` ` jsx demo
341
+ import {
342
+ Button ,
343
+ Popover ,
344
+ PopoverArrow ,
345
+ PopoverClose ,
346
+ PopoverContent ,
347
+ PopoverDescription ,
348
+ PopoverTitle ,
349
+ PopoverTrigger ,
350
+ } from " @resolid/react-ui" ;
351
+
352
+ export default function App () {
353
+ return (
354
+ < div className= {" flex flex-row gap-3" }>
355
+ < Popover placement= {" bottom" }>
356
+ < PopoverTrigger render= {(props ) => < Button {... props} / > }> 打开弹出框< / PopoverTrigger>
357
+ < PopoverContent className= " bg-bg-primary-hovered max-w-96" >
358
+ < PopoverArrow
359
+ className= {" fill-bg-primary-hovered [&>path:first-of-type]:stroke-bg-primary-hovered" }
360
+ / >
361
+ < PopoverTitle className= {" p-4" }> 弹出框标题< / PopoverTitle>
362
+ < PopoverDescription className= {" p-4 pt-1" }>
363
+ 这是一个弹出框示例,你可以在这里放置相关的提示信息、确认内容或者操作说明。内容可以根据需求进行修改,以适应不同的业务场景。
364
+ < / PopoverDescription>
365
+ < div className= {" flex justify-end gap-4 p-4 pt-1" }>
366
+ < PopoverClose
367
+ render= {(props ) => < Button color= {" neutral" } variant= {" soft" } {... props} / > }
368
+ >
369
+ 取消
370
+ < / PopoverClose>
371
+ < Button color= {" neutral" }> 确定< / Button>
372
+ < / div>
373
+ < / PopoverContent>
374
+ < / Popover>
375
+ < / div>
376
+ );
377
+ }
378
+ ` ` `
379
+
338
380
### 放置位置
339
381
340
382
通过传递 ` placement` 属性来更改弹出框的放置位置。
You can’t perform that action at this time.
0 commit comments