-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Card): using type namespace (#781)
- Loading branch information
Showing
5 changed files
with
518 additions
and
500 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,10 @@ | |
}, | ||
"devDependencies": { | ||
"@node-cli/bundlesize": "4.2.1", | ||
"@versini/dev-dependencies-client": "7.0.2", | ||
"@versini/dev-dependencies-types": "3.0.0", | ||
"@versini/dev-dependencies-common": "5.0.2", | ||
"@versini/dev-dependencies-client": "7.0.3", | ||
"@versini/dev-dependencies-types": "3.0.1", | ||
"@versini/ui-styles": "workspace:./packages/ui-styles" | ||
}, | ||
"packageManager": "[email protected].0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c" | ||
"packageManager": "[email protected].1" | ||
} |
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,59 +1,61 @@ | ||
import type { SpacingProps } from "@versini/ui-private/dist/utilities"; | ||
import React from "react"; | ||
|
||
export type CardProps = { | ||
/** | ||
* The children to render. | ||
*/ | ||
children: React.ReactNode; | ||
/** | ||
* If the header prop is not provided, the Card must be | ||
* described via aria-labelledby. | ||
*/ | ||
"aria-labelledby"?: string; | ||
/** | ||
* CSS class(es) to add to the body. | ||
*/ | ||
bodyClassName?: string; | ||
/** | ||
* CSS class(es) to add to the main component wrapper. | ||
*/ | ||
className?: string; | ||
/** | ||
* If true, the card will be smaller. | ||
*/ | ||
compact?: boolean; | ||
/** | ||
* The content to render in the footer. | ||
*/ | ||
footer?: React.ReactNode; | ||
/** | ||
* CSS class(es) to add to the footer. | ||
*/ | ||
footerClassName?: string; | ||
/** | ||
* The content to render in the header. | ||
*/ | ||
header?: React.ReactNode; | ||
/** | ||
* CSS class(es) to add to the header. | ||
*/ | ||
headerClassName?: string; | ||
/** | ||
* The mode of Card. This will change the color of the Card. | ||
*/ | ||
mode?: "darker" | "dark" | "light" | "system" | "alt-system"; | ||
/** | ||
* Whether or not to render the Card with a border. | ||
* @default false | ||
*/ | ||
noBorder?: boolean; | ||
} & SpacingProps; | ||
declare namespace CardTypes { | ||
export type Props = { | ||
/** | ||
* The children to render. | ||
*/ | ||
children: React.ReactNode; | ||
/** | ||
* If the header prop is not provided, the Card must be | ||
* described via aria-labelledby. | ||
*/ | ||
"aria-labelledby"?: string; | ||
/** | ||
* CSS class(es) to add to the body. | ||
*/ | ||
bodyClassName?: string; | ||
/** | ||
* CSS class(es) to add to the main component wrapper. | ||
*/ | ||
className?: string; | ||
/** | ||
* If true, the card will be smaller. | ||
*/ | ||
compact?: boolean; | ||
/** | ||
* The content to render in the footer. | ||
*/ | ||
footer?: React.ReactNode; | ||
/** | ||
* CSS class(es) to add to the footer. | ||
*/ | ||
footerClassName?: string; | ||
/** | ||
* The content to render in the header. | ||
*/ | ||
header?: React.ReactNode; | ||
/** | ||
* CSS class(es) to add to the header. | ||
*/ | ||
headerClassName?: string; | ||
/** | ||
* The mode of Card. This will change the color of the Card. | ||
*/ | ||
mode?: "darker" | "dark" | "light" | "system" | "alt-system"; | ||
/** | ||
* Whether or not to render the Card with a border. | ||
* @default false | ||
*/ | ||
noBorder?: boolean; | ||
} & SpacingProps; | ||
|
||
export type CardHeaderProps = { | ||
className: string; | ||
content: React.ReactNode; | ||
export type HeaderProps = { | ||
className: string; | ||
content: React.ReactNode; | ||
|
||
id?: string; | ||
userAriaLabelledby?: string; | ||
}; | ||
id?: string; | ||
userAriaLabelledby?: string; | ||
}; | ||
} |
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.