-
Notifications
You must be signed in to change notification settings - Fork 5
Implementacion de cardComponent #49
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e9e5219
Implementacion de cardComponent
Franco-Pertusati fc95e73
Merge branch 'main' into react/card
Brayan-724 9e5aaaf
fix(react/showcase): syntax error
Brayan-724 2d04f97
fix(react/card): clickable styles over clickable card
Brayan-724 0e43262
remove unused file
Brayan-724 2ec61a7
refactor(react/card): split styles into `@rustlanges/styles`
Brayan-724 06fe3cf
styles: `pnpm fmt`
Brayan-724 0951da8
fix(react/card): match styles to figma design
Brayan-724 a26f7b8
feat(react/showcase): Add onClick callback to card
Brayan-724 b5abd35
styles: `pnpm fmt`
Brayan-724 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,25 @@ | ||
| import { withAs } from "@/utils/hoc"; | ||
| import { cn } from "@/utils/tw-merge"; | ||
| import { CARD_GROUP_VARIANTS } from "./card.const"; | ||
|
|
||
| export type CardProps = { | ||
| clickable?: boolean; | ||
| className?: string; | ||
| disabled?: boolean; | ||
| }; | ||
|
|
||
| export const Card = withAs((Component, props: CardProps) => { | ||
| const { clickable = false, disabled = false, className, ...attr } = props; | ||
|
|
||
| return ( | ||
| <Component | ||
| className={cn( | ||
| ...CARD_GROUP_VARIANTS.default, | ||
| clickable && "cursor-pointer", | ||
| disabled && "pointer-events-none", | ||
| className | ||
| )} | ||
| {...attr} | ||
| ></Component> | ||
| ); | ||
| }, "div"); |
This file contains hidden or 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,14 @@ | ||
| export const CARD_GROUP_VARIANTS = { | ||
| default: [ | ||
| "min-w-96 min-h-96", | ||
| "border-1 shadow-brutal rounded-lg border-black p-4 bg-light", | ||
| "hover:shadow-rb-violet-700 hover:border-violet-700", | ||
| "disabled:bg-neutral-100 disabled:shadow-none disabled:border-neutral-400 disabled:text-neutral-400", | ||
| "active:shadow-none", | ||
|
|
||
| "dark:active:shadow-none", | ||
| "hover:dark:border-primary-600 hover:dark:shadow-rb-primary-600", | ||
| "dark:bg-neutral-800", | ||
| "dark:disabled:shadow-none dar:disabled:border-neutral-100" | ||
| ], | ||
| }; |
This file contains hidden or 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,8 @@ | ||
| import { CARD_GROUP_VARIANTS } from "./card.const"; | ||
|
|
||
| export interface CardGroupProps { | ||
| variant?: keyof typeof CARD_GROUP_VARIANTS; | ||
| disabled?: boolean; | ||
| children: React.ReactNode; | ||
| className?: string; | ||
| } |
This file contains hidden or 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 @@ | ||
| export * from "./card.component"; |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.