File tree 2 files changed +49
-41
lines changed
2 files changed +49
-41
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @near-pagoda/ui" ,
3
- "version" : " 3.1.9 " ,
3
+ "version" : " 3.1.10 " ,
4
4
"description" : " A React component library that implements the official NEAR design system." ,
5
5
"license" : " MIT" ,
6
6
"repository" : {
Original file line number Diff line number Diff line change 1
- import { type CSSProperties , type ReactNode } from 'react' ;
1
+ import { type CSSProperties , forwardRef , type ReactNode } from 'react' ;
2
2
3
3
import { type ThemeColor , type ThemeGap } from '../utils/theme' ;
4
4
import { Container } from './Container' ;
@@ -18,46 +18,54 @@ export type SectionProps = {
18
18
tabs ?: boolean ;
19
19
} ;
20
20
21
- export const Section = ( {
22
- background,
23
- bleed, // No container
24
- children,
25
- className = '' ,
26
- gap = 'l' ,
27
- grow,
28
- padding,
29
- style,
30
- tabs,
31
- ...props
32
- } : SectionProps ) => {
33
- const variables = {
34
- '--section-background-color' : `var(--${ background } )` ,
35
- } ;
21
+ export const Section = forwardRef < HTMLElement , SectionProps > (
22
+ (
23
+ {
24
+ background,
25
+ bleed, // No container
26
+ children,
27
+ className = '' ,
28
+ gap = 'l' ,
29
+ grow,
30
+ padding,
31
+ style,
32
+ tabs,
33
+ ...props
34
+ } ,
35
+ ref ,
36
+ ) => {
37
+ const variables = {
38
+ '--section-background-color' : `var(--${ background } )` ,
39
+ } ;
36
40
37
- return (
38
- < section
39
- className = { `${ s . section } ${ className } ` }
40
- data-background = { background }
41
- data-grow = { grow }
42
- data-padding = { padding }
43
- data-tabs = { tabs }
44
- style = { {
45
- ...style ,
46
- ...variables ,
47
- } }
48
- { ...props }
49
- >
50
- { bleed ? (
51
- < Flex direction = "column" gap = { gap } >
52
- { children }
53
- </ Flex >
54
- ) : (
55
- < Container >
41
+ return (
42
+ < section
43
+ className = { `${ s . section } ${ className } ` }
44
+ data-background = { background }
45
+ data-grow = { grow }
46
+ data-padding = { padding }
47
+ data-tabs = { tabs }
48
+ style = { {
49
+ ...style ,
50
+ ...variables ,
51
+ } }
52
+ ref = { ref }
53
+ { ...props }
54
+ >
55
+ { bleed ? (
56
56
< Flex direction = "column" gap = { gap } >
57
57
{ children }
58
58
</ Flex >
59
- </ Container >
60
- ) }
61
- </ section >
62
- ) ;
63
- } ;
59
+ ) : (
60
+ < Container >
61
+ < Flex direction = "column" gap = { gap } >
62
+ { children }
63
+ </ Flex >
64
+ </ Container >
65
+ ) }
66
+ </ section >
67
+ ) ;
68
+ } ,
69
+ ) ;
70
+
71
+ Section . displayName = 'Section' ;
You can’t perform that action at this time.
0 commit comments