diff --git a/.changeset/yellow-rules-repeat.md b/.changeset/yellow-rules-repeat.md new file mode 100644 index 0000000..e30b218 --- /dev/null +++ b/.changeset/yellow-rules-repeat.md @@ -0,0 +1,5 @@ +--- +"@openfun/cunningham-react": patch +--- + +export more types diff --git a/packages/react/src/components/Forms/Checkbox/index.tsx b/packages/react/src/components/Forms/Checkbox/index.tsx index b4edaa7..dafa649 100644 --- a/packages/react/src/components/Forms/Checkbox/index.tsx +++ b/packages/react/src/components/Forms/Checkbox/index.tsx @@ -9,13 +9,13 @@ import React, { import classNames from "classnames"; import { Field, FieldProps } from ":/components/Forms/Field"; -type Props = InputHTMLAttributes & +export type CheckboxProps = InputHTMLAttributes & FieldProps & { indeterminate?: boolean; label?: string; }; -export const Checkbox = forwardRef( +export const Checkbox = forwardRef( ( { indeterminate, @@ -26,7 +26,7 @@ export const Checkbox = forwardRef( rightText, state, ...props - }: Props, + }: CheckboxProps, ref, ) => { const inputRef = useRef(); diff --git a/packages/react/src/components/Forms/Input/index.tsx b/packages/react/src/components/Forms/Input/index.tsx index a1a6afe..d02c857 100644 --- a/packages/react/src/components/Forms/Input/index.tsx +++ b/packages/react/src/components/Forms/Input/index.tsx @@ -11,7 +11,7 @@ import { randomString } from ":/utils"; import { Field, FieldProps } from ":/components/Forms/Field"; import { LabelledBox } from ":/components/Forms/LabelledBox"; -type Props = InputHTMLAttributes & +export type InputProps = InputHTMLAttributes & FieldProps & { label?: string; icon?: ReactNode; @@ -20,7 +20,7 @@ type Props = InputHTMLAttributes & charCounterMax?: number; }; -export const Input = forwardRef( +export const Input = forwardRef( ( { className, @@ -36,7 +36,7 @@ export const Input = forwardRef( charCounter, charCounterMax, ...props - }: Props, + }: InputProps, ref, ) => { const classes = ["c__input"]; diff --git a/packages/react/src/components/Forms/Radio/index.tsx b/packages/react/src/components/Forms/Radio/index.tsx index 384de34..b58754f 100644 --- a/packages/react/src/components/Forms/Radio/index.tsx +++ b/packages/react/src/components/Forms/Radio/index.tsx @@ -6,13 +6,13 @@ import React, { import classNames from "classnames"; import { Field, FieldProps } from ":/components/Forms/Field"; -type Props = InputHTMLAttributes & +export type RadioProps = InputHTMLAttributes & FieldProps & { label?: string; }; -export const Radio = forwardRef( - ({ label, text, state, ...props }: Props, ref) => { +export const Radio = forwardRef( + ({ label, text, state, ...props }: RadioProps, ref) => { return (