Skip to content

Commit

Permalink
update type, does this work??
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneeza committed Dec 15, 2023
1 parent 6776949 commit 0635a0b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ import { StoryContext } from '@storybook/react';
import { LeafyGreenProviderProps } from '@leafygreen-ui/leafygreen-provider';
import { pickAndOmit } from '@leafygreen-ui/lib';

import { contextPropNames, SharedDatePickerProviderProps } from '../../context';
import { BaseDatePickerProps } from '../../types';
import { DatePickerProps } from '../../../DatePicker/DatePicker.types';
import {
ContextPropKeys,
contextPropNames,
SharedDatePickerProviderProps,
} from '../../context';

export interface ProviderPropsObject<T> {
export interface ProviderPropsObject {
leafyGreenProviderProps: LeafyGreenProviderProps;
datePickerProviderProps: SharedDatePickerProviderProps;
storyProps: T;
storyProps: Partial<Omit<DatePickerProps, ContextPropKeys>>;
}

export const getProviderPropsFromStoryContext = <P = BaseDatePickerProps>(
export const getProviderPropsFromStoryContext = <P = DatePickerProps>(
ctx: StoryContext<Partial<P & SharedDatePickerProviderProps>>,
): ProviderPropsObject<Partial<SharedDatePickerProviderProps>> => {
): ProviderPropsObject => {
const [
{ darkMode, baseFontSize, ...datePickerProviderProps },
{ ...storyProps },
Expand Down

0 comments on commit 0635a0b

Please sign in to comment.