Skip to content

Commit

Permalink
fix(/src/lib/components/*): allow theme={} to contain partials (#649)
Browse files Browse the repository at this point in the history
Thanks @Ncookiez -- All components that can have a `theme={}` should let you pass a partial theme rather than the entire object. See #646
  • Loading branch information
Ncookiez authored Mar 4, 2023
1 parent ed74d13 commit 863a789
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import classNames from 'classnames';
import { forwardRef, type ComponentProps, type ReactNode } from 'react';
import type { DeepPartial } from '..';
import { mergeDeep } from '../../helpers/mergeDeep';
import type {
FlowbiteBoolean,
Expand Down Expand Up @@ -70,7 +71,7 @@ export interface ButtonProps extends Omit<ComponentProps<'button'>, 'color' | 'r
pill?: boolean;
positionInGroup?: keyof PositionInButtonGroup;
size?: keyof ButtonSizes;
theme?: FlowbiteButtonTheme;
theme?: DeepPartial<FlowbiteButtonTheme>;
}

const ButtonComponent = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ComponentProps, FC, PropsWithChildren, ReactElement, ReactNode } f
import { Children, cloneElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { HiOutlineChevronLeft, HiOutlineChevronRight } from 'react-icons/hi';
import ScrollContainer from 'react-indiana-drag-scroll';
import type { DeepPartial } from '..';
import { mergeDeep } from '../../helpers/mergeDeep';
import windowExists from '../../helpers/window-exists';
import type { FlowbiteBoolean } from '../Flowbite/FlowbiteTheme';
Expand Down Expand Up @@ -49,7 +50,7 @@ export interface CarouselProps extends PropsWithChildren<ComponentProps<'div'>>
rightControl?: ReactNode;
slide?: boolean;
slideInterval?: number;
theme?: FlowbiteCarouselTheme;
theme?: DeepPartial<FlowbiteCarouselTheme>;
}

export const Carousel: FC<CarouselProps> = ({
Expand Down

0 comments on commit 863a789

Please sign in to comment.