import React from 'react' import { autoPlacement, offset, size } from '@floating-ui/react-dom' import { type Meta } from '@storybook/react' import { StickerSheet, type StickerSheetStory } from '~storybook/components/StickerSheet' import { CalendarRange } from '../../CalendarRange' import { CalendarSingle } from '../../CalendarSingle' import { CalendarPopover, type CalendarPopoverProps } from '../index' export default { title: 'Components/Datepickers/Calendars (primitives)/CalendarPopover (primitive)', parameters: { chromatic: { disable: false, }, controls: { disable: true }, a11y: { config: { rules: [ { // Built with no label on purpose, to be used within Date(Range)Picker where label is present id: 'aria-dialog-name', enabled: false, }, ], }, }, viewport: { viewports: { ViewportFull: { name: 'Viewport full size', styles: { width: '1024px', height: '1500px', }, }, }, defaultViewport: 'ViewportFull', }, }, } satisfies Meta const CalendarPopoverExample = ({ children, rowHeight = 300, /** this is here as a convenient way to test overlap */ strategy = 'fixed', }: Partial< CalendarPopoverProps & { rowHeight: number /** this is here as a convenient way to test overlap */ strategy?: 'absolute' | 'fixed' } >): JSX.Element => { const [referenceElement, setReferenceElement] = React.useState(null) return ( <>
Reference element
{children} ) } const StickerSheetTemplate: StickerSheetStory = { render: ({ isReversed }) => ( <> CalendarPopover
Content goes in here.
), } export const StickerSheetDefault: StickerSheetStory = { ...StickerSheetTemplate, name: 'Sticker Sheet (Default)', } export const StickerSheetRTL: StickerSheetStory = { ...StickerSheetTemplate, name: 'Sticker Sheet (RTL)', parameters: { ...StickerSheetTemplate.parameters, textDirection: 'rtl', }, }