-
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(button): simplify ts types in Button, Banner, ButtonIcon and…
… InputDropdown components
- Loading branch information
1 parent
982d85b
commit ddf8bb8
Showing
10 changed files
with
64 additions
and
133 deletions.
There are no files selected for viewing
10 changes: 4 additions & 6 deletions
10
packages/components/src/core/Banner/__tests__/Banner.namespace-test.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,13 +1,11 @@ | ||
import { Banner, BannerProps } from "@czi-sds/components"; | ||
import React from "react"; | ||
import { Banner, BannerProps } from "@czi-sds/components"; | ||
import { LONG_LOREM_IPSUM } from "src/common/storybook/loremIpsum"; | ||
|
||
const BannerNameSpaceTest = (props: BannerProps<"medium">) => { | ||
const BannerNameSpaceTest = (props: BannerProps) => { | ||
return ( | ||
<Banner {...props} dismissible sdsType="primary"> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nesciunt aliquid | ||
maxime soluta voluptas expedita molestias neque saepe aperiam amet enim | ||
natus placeat, tempore doloribus odio reiciendis repellat? Dolorem, | ||
voluptatem tempore. | ||
{LONG_LOREM_IPSUM} | ||
</Banner> | ||
); | ||
}; |
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
4 changes: 2 additions & 2 deletions
4
packages/components/src/core/Button/__tests__/Button.namespace-test.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
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
13 changes: 2 additions & 11 deletions
13
packages/components/src/core/ButtonIcon/__storybook__/types.ts
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,14 +1,5 @@ | ||
import { | ||
ButtonIconExtraProps, | ||
ButtonIconSizeToTypes, | ||
} from "src/core/ButtonIcon/style"; | ||
|
||
export type SDSTypes = NonNullable< | ||
| ButtonIconExtraProps<"small">["sdsType"] | ||
| ButtonIconExtraProps<"medium">["sdsType"] | ||
| ButtonIconExtraProps<"large">["sdsType"] | ||
>[]; | ||
export type SDSTypes = NonNullable<"primary" | "secondary" | "tertiary">[]; | ||
|
||
export type SDSStyles = NonNullable<"icon">[]; | ||
|
||
export type SDSSizes = (keyof ButtonIconSizeToTypes)[]; | ||
export type SDSSizes = NonNullable<"small" | "medium" | "large">[]; |
6 changes: 2 additions & 4 deletions
6
packages/components/src/core/ButtonIcon/__tests__/ButtonIcon.namespace-test.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
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
Oops, something went wrong.