-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2198 from d-koppenhagen/missing-showcases
docs(react-components): add missing showcases for DBBrand, DBHeader and DBPage
- Loading branch information
Showing
7 changed files
with
333 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { DBBrand } from '../../../../../output/react/src'; | ||
import { type DBBrandProps } from '../../../../../output/react/src/components/brand/model'; | ||
import defaultComponentVariants from '../../../../shared/brand.json'; | ||
import { getVariants } from '../data'; | ||
import DefaultComponent from '../index'; | ||
|
||
const getBrand = ({ | ||
imgAlt, | ||
imgHeight, | ||
imgSrc, | ||
imgWidth, | ||
anchorChildren, | ||
anchorRef, | ||
anchorTitle, | ||
anchorRelation, | ||
hideDefaultAsset, | ||
children, | ||
className, | ||
describedbyid, | ||
id, | ||
key, | ||
stylePath, | ||
tabIndex, | ||
title | ||
}: DBBrandProps) => ( | ||
<DBBrand | ||
imgAlt={imgAlt} | ||
imgHeight={imgHeight} | ||
imgSrc="https://db-ui.github.io/images/db_logo.svg" | ||
imgWidth={imgWidth} | ||
anchorChildren={anchorChildren} | ||
anchorRef={anchorRef} | ||
anchorTitle={anchorTitle} | ||
anchorRelation={anchorRelation} | ||
hideDefaultAsset={hideDefaultAsset} | ||
className={className} | ||
describedbyid={describedbyid} | ||
id={id} | ||
key={key} | ||
stylePath={stylePath} | ||
tabIndex={tabIndex} | ||
title={title}> | ||
{children} | ||
</DBBrand> | ||
); | ||
|
||
const BrandComponent = () => { | ||
return ( | ||
<DefaultComponent | ||
title="DBBrand" | ||
variants={getVariants( | ||
defaultComponentVariants, | ||
getBrand | ||
)}></DefaultComponent> | ||
); | ||
}; | ||
|
||
export default BrandComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { | ||
DBBrand, | ||
DBButton, | ||
DBHeader, | ||
DBLink, | ||
DBMainNavigation, | ||
DBNavigationItem | ||
} from '../../../../../output/react/src'; | ||
import { type DBHeaderProps } from '../../../../../output/react/src/components/header/model'; | ||
import defaultComponentVariants from '../../../../shared/header.json'; | ||
import { getVariants } from '../data'; | ||
import DefaultComponent from '../index'; | ||
|
||
const getHeader = ({ | ||
drawerOpen, | ||
forceMobile, | ||
burgerMenuLabel, | ||
children, | ||
className, | ||
describedbyid, | ||
id, | ||
key, | ||
stylePath, | ||
tabIndex, | ||
title, | ||
onToggle | ||
}: DBHeaderProps) => ( | ||
<DBHeader | ||
slotBrand={ | ||
<DBBrand | ||
title="DBHeader" | ||
imgSrc="https://db-ui.github.io/images/db_logo.svg"> | ||
DBHeader | ||
</DBBrand> | ||
} | ||
slotMetaNavigation={ | ||
<> | ||
<DBLink href="#">Imprint</DBLink> | ||
<DBLink href="#">Help</DBLink> | ||
</> | ||
} | ||
slotCallToAction={ | ||
<DBButton icon="search" variant="text" noText> | ||
Search | ||
</DBButton> | ||
} | ||
slotActionBar={ | ||
<> | ||
<DBButton icon="account" variant="text" noText> | ||
Profile | ||
</DBButton> | ||
<DBButton icon="alert" variant="text" noText> | ||
Notification | ||
</DBButton> | ||
<DBButton icon="help" variant="text" noText> | ||
Help | ||
</DBButton> | ||
</> | ||
} | ||
drawerOpen={drawerOpen} | ||
forceMobile={forceMobile} | ||
burgerMenuLabel={burgerMenuLabel} | ||
className={className} | ||
describedbyid={describedbyid} | ||
id={id} | ||
key={key} | ||
stylePath={stylePath} | ||
tabIndex={tabIndex} | ||
title={title} | ||
onToggle={onToggle}> | ||
<DBMainNavigation> | ||
<DBNavigationItem icon="account"> | ||
<a href="#">{children}</a> | ||
</DBNavigationItem> | ||
<DBNavigationItem disabled> | ||
<a href="#">{children} disabled</a> | ||
</DBNavigationItem> | ||
</DBMainNavigation> | ||
</DBHeader> | ||
); | ||
|
||
const HeaderComponent = () => { | ||
return ( | ||
<DefaultComponent | ||
title="DBHeader" | ||
variants={getVariants( | ||
defaultComponentVariants, | ||
getHeader | ||
)}></DefaultComponent> | ||
); | ||
}; | ||
|
||
export default HeaderComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { | ||
DBPage, | ||
DBBrand, | ||
DBButton, | ||
DBHeader, | ||
DBLink, | ||
DBMainNavigation, | ||
DBNavigationItem | ||
} from '../../../../../output/react/src'; | ||
import { type DBPageProps } from '../../../../../output/react/src/components/page/model'; | ||
import defaultComponentVariants from '../../../../shared/page.json'; | ||
import { getVariants } from '../data'; | ||
import DefaultComponent from '../index'; | ||
|
||
const getPage = ({ | ||
type, | ||
fadeIn, | ||
children, | ||
className, | ||
describedbyid, | ||
id, | ||
key, | ||
stylePath, | ||
tabIndex, | ||
title | ||
}: DBPageProps) => ( | ||
<DBPage | ||
type={type} | ||
fadeIn={fadeIn} | ||
className={className} | ||
describedbyid={describedbyid} | ||
id={id} | ||
key={key} | ||
stylePath={stylePath} | ||
tabIndex={tabIndex} | ||
slotHeader={ | ||
<DBHeader | ||
slotBrand={ | ||
<DBBrand | ||
title="DBHeader" | ||
imgSrc="https://db-ui.github.io/images/db_logo.svg"> | ||
DBHeader | ||
</DBBrand> | ||
} | ||
slotMetaNavigation={ | ||
<> | ||
<DBLink href="#">Imprint</DBLink> | ||
<DBLink href="#">Help</DBLink> | ||
</> | ||
} | ||
slotCallToAction={ | ||
<DBButton icon="search" variant="text" noText> | ||
Search | ||
</DBButton> | ||
} | ||
slotActionBar={ | ||
<> | ||
<DBButton icon="account" variant="text" noText> | ||
Profile | ||
</DBButton> | ||
<DBButton icon="alert" variant="text" noText> | ||
Notification | ||
</DBButton> | ||
<DBButton icon="help" variant="text" noText> | ||
Help | ||
</DBButton> | ||
</> | ||
} | ||
title={title}> | ||
<DBMainNavigation> | ||
<DBNavigationItem icon="account"> | ||
<a href="#">{children}</a> | ||
</DBNavigationItem> | ||
<DBNavigationItem disabled> | ||
<a href="#">{children} disabled</a> | ||
</DBNavigationItem> | ||
</DBMainNavigation> | ||
</DBHeader> | ||
} | ||
slotFooter={<>Footer Content</>}> | ||
My Page Content | ||
</DBPage> | ||
); | ||
|
||
const PageComponent = () => { | ||
return ( | ||
<DefaultComponent | ||
title="DBPage" | ||
variants={getVariants( | ||
defaultComponentVariants, | ||
getPage | ||
)}></DefaultComponent> | ||
); | ||
}; | ||
|
||
export default PageComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"name": "Tonality", | ||
"examples": [ | ||
{ | ||
"name": "functional", | ||
"className": "db-ui-functional", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "regular (Default)", | ||
"className": "db-ui-regular", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "expressive", | ||
"className": "db-ui-expressive", | ||
"props": {} | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
{ | ||
"name": "Tonality", | ||
"examples": [ | ||
{ | ||
"name": "functional", | ||
"className": "db-ui-functional", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "regular (Default)", | ||
"className": "db-ui-regular", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "expressive", | ||
"className": "db-ui-expressive", | ||
"props": {} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Behaviour", | ||
"examples": [ | ||
{ | ||
"name": "Desktop (full width)", | ||
"style": { | ||
"width": "100%", | ||
"display": "block" | ||
} | ||
}, | ||
{ | ||
"name": "Mobile", | ||
"props": { | ||
"forceMobile": "true" | ||
} | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"name": "Tonality", | ||
"examples": [ | ||
{ | ||
"name": "functional", | ||
"className": "db-ui-functional", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "regular (Default)", | ||
"className": "db-ui-regular", | ||
"props": {} | ||
}, | ||
{ | ||
"name": "expressive", | ||
"className": "db-ui-expressive", | ||
"props": {} | ||
} | ||
] | ||
} | ||
] |