@@ -11,38 +11,60 @@ import {
1111
1212import { useMediaQuery } from "@axiscommunications/fluent-hooks" ;
1313
14- import { useStyles } from "./styles" ;
15- import { ContentProps , EmptyViewProps } from "./types" ;
14+ import { useContainerStyle , useStyles } from "./styles" ;
15+ import {
16+ ContentProps ,
17+ EmptyViewProps ,
18+ HtmlDivAttributesRestProps ,
19+ } from "./types" ;
1620import { Illustration } from "./constants" ;
1721
18- function ContainerSpacious ( { children } : PropsWithChildren ) {
19- const screenStyles = useStyles ( ) ;
22+ function ContainerSpacious (
23+ { children, className, ...rest } : PropsWithChildren <
24+ HtmlDivAttributesRestProps
25+ >
26+ ) {
27+ const styles = useStyles ( ) ;
28+ const containerStyle = useContainerStyle ( { className } ) ;
29+
2030 return (
21- < div className = { screenStyles . container } >
22- < div className = { screenStyles . spacer } />
31+ < div className = { containerStyle } { ... rest } >
32+ < div className = { styles . spacer } />
2333 { children }
24- < div className = { screenStyles . spacer } />
25- < div className = { screenStyles . spacer } />
34+ < div className = { styles . spacer } />
35+ < div className = { styles . spacer } />
2636 </ div >
2737 ) ;
2838}
2939
30- function ContainerCompact ( { children } : PropsWithChildren ) {
31- const screenStyles = useStyles ( ) ;
40+ function ContainerCompact (
41+ { children, className, ...rest } : PropsWithChildren <
42+ HtmlDivAttributesRestProps
43+ >
44+ ) {
45+ const styles = useStyles ( ) ;
46+ const containerStyle = useContainerStyle ( { className } ) ;
47+
3248 return (
33- < div className = { screenStyles . container } >
34- < div className = { screenStyles . spacer } />
49+ < div className = { containerStyle } { ... rest } >
50+ < div className = { styles . spacer } />
3551 { children }
36- < div className = { screenStyles . spacer } />
52+ < div className = { styles . spacer } />
3753 </ div >
3854 ) ;
3955}
4056
41- function ContainerTop ( { children } : PropsWithChildren ) {
42- const screenStyles = useStyles ( ) ;
57+ function ContainerTop (
58+ { children, className, ...rest } : PropsWithChildren <
59+ HtmlDivAttributesRestProps
60+ >
61+ ) {
62+ const styles = useStyles ( ) ;
63+ const containerStyle = useContainerStyle ( { className } ) ;
64+
4365 return (
44- < div className = { screenStyles . container } >
45- < div className = { screenStyles . fixedSpacer } />
66+ < div className = { containerStyle } { ... rest } >
67+ < div className = { styles . fixedSpacer } />
4668 { children }
4769 </ div >
4870 ) ;
@@ -97,12 +119,12 @@ function ContentExtraSmall(
97119}
98120
99121export function MainEmptyView (
100- { after, illustration, title, children } : EmptyViewProps
122+ { after, illustration, title, children, ... rest } : EmptyViewProps
101123) {
102124 const screenStyles = useStyles ( ) ;
103125 const media = useMediaQuery ( ) ;
104126 return (
105- < ContainerSpacious >
127+ < ContainerSpacious { ... rest } >
106128 { media === "small"
107129 ? (
108130 < ContentMedium
@@ -124,11 +146,11 @@ export function MainEmptyView(
124146}
125147
126148export function PanelEmptyView (
127- { after, illustration, title, children } : EmptyViewProps
149+ { after, illustration, title, children, ... rest } : EmptyViewProps
128150) {
129151 const screenStyles = useStyles ( ) ;
130152 return (
131- < ContainerTop >
153+ < ContainerTop { ... rest } >
132154 < ContentMedium
133155 illustration = { illustration }
134156 title = { title }
@@ -140,10 +162,10 @@ export function PanelEmptyView(
140162}
141163
142164export function SubmenuEmptyView (
143- { illustration, title, children } : Omit < EmptyViewProps , "after" >
165+ { illustration, title, children, ... rest } : Omit < EmptyViewProps , "after" >
144166) {
145167 return (
146- < ContainerTop >
168+ < ContainerTop { ... rest } >
147169 < ContentSmall illustration = { illustration } title = { title } body = { children } />
148170 </ ContainerTop >
149171 ) ;
@@ -163,11 +185,11 @@ export function SubmenuEmptyView(
163185 * ```
164186 */
165187export function DialogEmptyView (
166- { after, title, children } : Omit < EmptyViewProps , "illustration" >
188+ { after, title, children, ... rest } : Omit < EmptyViewProps , "illustration" >
167189) {
168190 const screenStyles = useStyles ( ) ;
169191 return (
170- < ContainerCompact >
192+ < ContainerCompact { ... rest } >
171193 < ContentExtraSmall title = { title } body = { children } />
172194 < div className = { screenStyles . after } > { after } </ div >
173195 </ ContainerCompact >
0 commit comments