-
-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into introduce/add-right-icon-textfield
- Loading branch information
Showing
17 changed files
with
189 additions
and
65 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
Empty file.
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,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn prettier && yarn lint && yarn test run && yarn build | ||
yarn prettier:fix && yarn lint && yarn test run && yarn build |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
}; |
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,17 +1,24 @@ | ||
import classNames from 'classnames'; | ||
import type { ComponentProps } from 'react'; | ||
import { forwardRef } from 'react'; | ||
import { DeepPartial } from '..'; | ||
import { mergeDeep } from '../../helpers/mergeDeep'; | ||
import { useTheme } from '../Flowbite/ThemeContext'; | ||
|
||
export interface FlowbiteCheckboxTheme { | ||
base: string; | ||
} | ||
|
||
export type CheckboxProps = Omit<ComponentProps<'input'>, 'type' | 'ref'>; | ||
export interface CheckboxProps extends Omit<ComponentProps<'input'>, 'type' | 'ref'> { | ||
theme?: DeepPartial<FlowbiteCheckboxTheme>; | ||
} | ||
|
||
export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>( | ||
({ theme: customTheme = {}, className, ...props }, ref) => { | ||
const theme = mergeDeep(useTheme().theme.checkbox, customTheme); | ||
|
||
export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(({ className, ...props }, ref) => { | ||
const theme = useTheme().theme.checkbox; | ||
return <input ref={ref} className={classNames(theme.base, className)} type="checkbox" {...props} />; | ||
}); | ||
return <input ref={ref} className={classNames(theme.base, className)} type="checkbox" {...props} />; | ||
}, | ||
); | ||
|
||
Checkbox.displayName = 'Checkbox'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
import classNames from 'classnames'; | ||
import type { ComponentProps } from 'react'; | ||
import { forwardRef } from 'react'; | ||
import { DeepPartial } from '..'; | ||
import { mergeDeep } from '../../helpers/mergeDeep'; | ||
import { useTheme } from '../Flowbite/ThemeContext'; | ||
|
||
export interface FlowbiteRadioTheme { | ||
base: string; | ||
} | ||
|
||
export type RadioProps = Omit<ComponentProps<'input'>, 'type' | 'ref'>; | ||
export interface RadioProps extends Omit<ComponentProps<'input'>, 'type' | 'ref'> { | ||
theme?: DeepPartial<FlowbiteRadioTheme>; | ||
} | ||
|
||
export const Radio = forwardRef<HTMLInputElement, RadioProps>( | ||
({ theme: customTheme = {}, className, ...props }, ref) => { | ||
const theme = mergeDeep(useTheme().theme.radio, customTheme); | ||
|
||
export const Radio = forwardRef<HTMLInputElement, RadioProps>(({ className, ...props }, ref) => { | ||
const theme = useTheme().theme.radio; | ||
return <input ref={ref} className={classNames(theme.base, className)} type="radio" {...props} />; | ||
}); | ||
return <input ref={ref} className={classNames(theme.base, className)} type="radio" {...props} />; | ||
}, | ||
); | ||
|
||
Radio.displayName = 'Radio'; |
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.