-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-317] - Visual Guidelines Improvements (#2055)
* PLAY-317- fixed spacing example styling * Fixed overflow and wrapping issue in spacing, lineheight,positioning
- Loading branch information
Showing
5 changed files
with
113 additions
and
28 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
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
69 changes: 69 additions & 0 deletions
69
playbook-website/app/javascript/components/VisualGuidelines/Templates/SpacingProps.tsx
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,69 @@ | ||
/* eslint-disable flowtype/no-types-missing-file-annotation */ | ||
// React Pure component - do not use state! | ||
|
||
// This template is specifically for props section of the Spacing example. | ||
// All other examples use PropsValues.tsx | ||
// This template does not have a Visual Guide section. | ||
|
||
import React from "react"; | ||
import { | ||
Caption, | ||
Card, | ||
Flex, | ||
FlexItem, | ||
Pill, | ||
SectionSeparator, | ||
} from "playbook-ui"; | ||
|
||
type Props = { | ||
propValues: string[]; | ||
propNames: string[]; | ||
}; | ||
|
||
const SpacingProps = ({ propNames, propValues }: Props): React.ReactElement => { | ||
return ( | ||
<Flex | ||
inline="flex-container" | ||
justifyContent="center" | ||
orientation="row" | ||
vertical="stretch" | ||
> | ||
<FlexItem flex={1}> | ||
<Card.Body> | ||
<Caption marginBottom="sm" text="Props" /> | ||
{propNames.map((prop) => ( | ||
<Pill | ||
key={prop} | ||
text={prop} | ||
marginRight="xs" | ||
textTransform="none" | ||
/> | ||
))} | ||
</Card.Body> | ||
</FlexItem> | ||
<SectionSeparator | ||
marginBottom="md" | ||
marginTop="md" | ||
orientation="vertical" | ||
variant="card" | ||
/> | ||
|
||
<FlexItem flex={1}> | ||
<Card.Body> | ||
<Caption marginBottom="sm" text="Values" /> | ||
{propValues.map((value) => ( | ||
<Pill | ||
key={value} | ||
text={value} | ||
marginRight="xs" | ||
textTransform="none" | ||
variant="warning" | ||
/> | ||
))} | ||
</Card.Body> | ||
</FlexItem> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default SpacingProps; |
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