-
Notifications
You must be signed in to change notification settings - Fork 72
[LG-5747] feat: Card - update styles, deprecate clickability #3318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| --- | ||||||
| '@leafygreen-ui/card': minor | ||||||
| --- | ||||||
|
|
||||||
| deprecated clickable stlying and functionality, updated styles (removed shadows and added border) | ||||||
|
||||||
| deprecated clickable stlying and functionality, updated styles (removed shadows and added border) | |
| deprecated clickable styling and functionality, updated styles (removed shadows and updated border color) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ import { | |||||
| useInferredPolymorphic, | ||||||
| } from '@leafygreen-ui/polymorphic'; | ||||||
|
|
||||||
| import { colorSet, containerStyle } from './styles'; | ||||||
| import { getCardStyles } from './styles'; | ||||||
| import { ContentStyle, InternalCardProps } from './types'; | ||||||
|
|
||||||
| /** | ||||||
|
|
@@ -40,15 +40,7 @@ export const Card = InferredPolymorphic<InternalCardProps, 'div'>( | |||||
| return ( | ||||||
| <Component | ||||||
| ref={ref} | ||||||
| className={cx( | ||||||
| containerStyle, | ||||||
| colorSet[theme].containerStyle, | ||||||
| { | ||||||
| [colorSet[theme].clickableStyle]: | ||||||
| contentStyle === ContentStyle.Clickable, | ||||||
| }, | ||||||
| className, | ||||||
| )} | ||||||
| className={cx(getCardStyles({ theme, contentStyle, className }))} | ||||||
|
||||||
| className={cx(getCardStyles({ theme, contentStyle, className }))} | |
| className={getCardStyles({ theme, contentStyle, className })} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,11 +4,17 @@ import { | |||||||||||||||||||||||
| PolymorphicAs, | ||||||||||||||||||||||||
| } from '@leafygreen-ui/polymorphic'; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| export const ContentStyle = { | ||||||||||||||||||||||||
| None: 'none', | ||||||||||||||||||||||||
| Clickable: 'clickable', | ||||||||||||||||||||||||
| } as const; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| export type ContentStyle = (typeof ContentStyle)[keyof typeof ContentStyle]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| export interface InternalCardProps extends DarkModeProps { | ||||||||||||||||||||||||
|
|
@@ -23,6 +29,7 @@ export interface InternalCardProps extends DarkModeProps { | |||||||||||||||||||||||
| * Defaults to `'clickable'` (when a valid `onClick` handler or `href` link is provided | ||||||||||||||||||||||||
| * | ||||||||||||||||||||||||
| * @default 'clickable' | 'none' | ||||||||||||||||||||||||
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| contentStyle?: ContentStyle; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -31,6 +38,20 @@ export interface InternalCardProps extends DarkModeProps { | |||||||||||||||||||||||
| * | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| title?: string; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
| * Click handler for the Card component. | ||||||||||||||||||||||||
| * | ||||||||||||||||||||||||
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| onClick?: React.MouseEventHandler<any>; | ||||||||||||||||||||||||
|
Comment on lines
43
to
47
|
||||||||||||||||||||||||
| * Click handler for the Card component. | |
| * | |
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | |
| */ | |
| onClick?: React.MouseEventHandler<any>; | |
| * Click handler for the Card component. Receives a MouseEvent. | |
| * | |
| * @param event - The mouse event triggered by clicking the Card. | |
| * @deprecated No longer supported. We don't want card to be clickable from a root level. | |
| */ | |
| onClick?: React.MouseEventHandler<HTMLDivElement>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the changeset description: "stlying" should be "styling".