-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Button and Card variants * add docs * Revert "add docs" This reverts commit 3e04c70. * Revert "Revert "add docs"" This reverts commit b88affe. * Update fullWidth description
- Loading branch information
Showing
9 changed files
with
98 additions
and
5 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
export default { commitHash: "6f4399e" }; | ||
export default { commitHash: "f86f428" }; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@stellar/design-system", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"author": "Stellar Development Foundation <[email protected]>", | ||
"description": "Components for Stellar Development Foundation’s design system", | ||
"license": "Apache-2.0", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
import React from "react"; | ||
import "./styles.scss"; | ||
|
||
enum CardVariant { | ||
default = "default", | ||
highlight = "highlight", | ||
} | ||
|
||
interface CardComponent { | ||
variant: typeof CardVariant; | ||
} | ||
|
||
interface CardProps { | ||
variant?: CardVariant; | ||
children: React.ReactNode; | ||
noPadding?: boolean; | ||
noShadow?: boolean; | ||
} | ||
|
||
export const Card = ({ children, noPadding, noShadow }: CardProps) => { | ||
export const Card: React.FC<CardProps> & CardComponent = ({ | ||
variant = CardVariant.default, | ||
children, | ||
noPadding, | ||
noShadow, | ||
}: CardProps) => { | ||
const customStyle = { | ||
...(noPadding ? { "--Card-padding": 0 } : {}), | ||
...(noShadow ? { "--Card-shadow": "none" } : {}), | ||
} as React.CSSProperties; | ||
|
||
return ( | ||
<div className="Card" style={customStyle}> | ||
<div className={`Card Card--${variant}`} style={customStyle}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
Card.displayName = "Card"; | ||
Card.variant = CardVariant; |
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