diff --git a/package.json b/package.json index 856ff19..a3a619d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@raidguild/design-system", - "version": "0.5.7", + "version": "0.5.8", "license": "MIT", "author": "Raid Guild", "main": "./dist/src/index.js", diff --git a/src/components/forms/DatePicker/CustomDatePickerButton.tsx b/src/components/forms/DatePicker/CustomDatePickerButton.tsx index 7eb294d..28f0e66 100644 --- a/src/components/forms/DatePicker/CustomDatePickerButton.tsx +++ b/src/components/forms/DatePicker/CustomDatePickerButton.tsx @@ -5,6 +5,7 @@ export type CustomDatePickerButtonProps = ChakraButtonProps & { value?: React.ReactNode; onClick?: () => void; ref?: HTMLInputElement; + placeholder?: string; }; export type CustomDatePickerButton = CustomDatePickerButtonProps & { @@ -13,9 +14,12 @@ export type CustomDatePickerButton = CustomDatePickerButtonProps & { export const CustomDatePickerButton: React.FC = forwardRef( - ({ value, onClick, variant = 'outline' }, ref) => ( + ( + { value, onClick, placeholder = 'Select Date', variant = 'outline' }, + ref + ) => ( ) ); diff --git a/src/components/forms/DatePicker/DatePicker.tsx b/src/components/forms/DatePicker/DatePicker.tsx index 0321bd1..b0b0b4d 100644 --- a/src/components/forms/DatePicker/DatePicker.tsx +++ b/src/components/forms/DatePicker/DatePicker.tsx @@ -26,6 +26,7 @@ export type DatePickerProps = { localForm: Pick; registerOptions?: RegisterOptions; tooltip?: string; + placeholder?: string; variant?: string; spacing?: number | string; } & Omit; @@ -36,6 +37,8 @@ const DatePicker: React.FC = ({ localForm, registerOptions, tooltip, + placeholderText, // default prop from react-datepicker + placeholder, // match rest of inputs for consistency, takes priority variant = 'ghost', spacing, ...props @@ -89,7 +92,12 @@ const DatePicker: React.FC = ({ {...props} {...field} selected={watch?.(name)} - customInput={} + customInput={ + + } ref={(ref) => { field.ref({ focus: ref?.setFocus, diff --git a/src/stories/forms/DatePicker.stories.tsx b/src/stories/forms/DatePicker.stories.tsx index 642ecc8..65f8798 100644 --- a/src/stories/forms/DatePicker.stories.tsx +++ b/src/stories/forms/DatePicker.stories.tsx @@ -24,6 +24,7 @@ const DatePicker: StoryFn = () => { diff --git a/src/theme/components/Tabs.ts b/src/theme/components/Tabs.ts index 953d4c1..d808250 100644 --- a/src/theme/components/Tabs.ts +++ b/src/theme/components/Tabs.ts @@ -25,5 +25,8 @@ const Tabs = { }, }, }, + defaultProps: { + variant: 'default', + }, }; export default Tabs;