@cimpress/react-components
Version:
React components to support the MCP styleguide
41 lines • 1.08 kB
JavaScript
import * as React from 'react';
import { DatePicker } from '../DatePicker';
import { Button } from '../Button';
const meta = {
title: 'Components/DatePicker',
component: DatePicker,
argTypes: {
value: {
control: {
type: 'date',
},
},
initialValue: {
control: {
type: 'date',
},
},
},
};
export default meta;
export const Default = {
args: {
label: 'Date',
},
};
export const CustomFormat = {
args: {
label: 'Date',
dateFormat: 'D MMMM YYYY',
timeFormat: 'h:mm A',
},
};
export const Controlled = {
render() {
const [date, setDate] = React.useState(() => new Date());
return (React.createElement(React.Fragment, null,
React.createElement(DatePicker, { label: "Date", value: date, onChange: d => setDate(d) }),
React.createElement(Button, { onClick: () => setDate(new Date()) }, "Set date to today")));
},
};
//# sourceMappingURL=DatePicker.stories.js.map