-
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.
refactor(tag): add sdsSize to tag and fix Dialog close button styles
- Loading branch information
1 parent
b8e0283
commit df6e98a
Showing
13 changed files
with
193 additions
and
59 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
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
19 changes: 17 additions & 2 deletions
19
packages/components/src/core/Tag/__storybook__/stories/default.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 |
---|---|---|
@@ -1,7 +1,22 @@ | ||
import { Args } from "@storybook/react"; | ||
import Callout from "src/core/Callout"; | ||
import CalloutTitle from "src/core/Callout/components/CalloutTitle"; | ||
import RawTag from "src/core/Tag"; | ||
|
||
export const Tag = (props: Args): JSX.Element => { | ||
const { label } = props; | ||
return <RawTag label={label} {...props} />; | ||
const { label, sdsSize, icon } = props; | ||
|
||
if (sdsSize === "l" && !icon) { | ||
return ( | ||
<Callout intent="negative"> | ||
<CalloutTitle>Invalid Props!</CalloutTitle> | ||
<p> | ||
The large-size tag must include an icon. Please choose an icon from | ||
the controls section or switch the Tag size to small. | ||
</p> | ||
</Callout> | ||
); | ||
} | ||
|
||
return <RawTag label={label} {...props} sdsSize={sdsSize} icon={icon} />; | ||
}; |
Oops, something went wrong.