Latest repo

This commit is contained in:
Marc
2025-06-02 16:42:16 +00:00
parent 53ddf1a329
commit cde5fae175
27907 changed files with 3875388 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
import { customRender } from 'test/render';
import { Months } from './Months';
let root: HTMLElement;
test('should use the default class name', () => {
const view = customRender(<Months>foo</Months>, {});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveClass('rdp-months');
});
test('should use a custom class name', () => {
const view = customRender(<Months>foo</Months>, {
classNames: { months: 'foo' }
});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveClass('foo');
});
test('should use a custom style', () => {
const view = customRender(<Months>foo</Months>, {
styles: { months: { color: 'red' } }
});
root = view.container.firstChild as HTMLElement;
expect(root).toHaveStyle({ color: 'red' });
});

View File

@@ -0,0 +1,19 @@
import { ReactNode } from 'react';
import { useDayPicker } from 'contexts/DayPicker';
/** The props for the {@link Months} component. */
export type MonthsProps = { children: ReactNode };
/**
* Render the wrapper for the month grids.
*/
export function Months(props: MonthsProps): JSX.Element {
const { classNames, styles } = useDayPicker();
return (
<div className={classNames.months} style={styles.months}>
{props.children}
</div>
);
}

View File

@@ -0,0 +1 @@
export * from './Months';