@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
1 lines • 1.5 kB
Source Map (JSON)
{"version":3,"file":"TimeGridControl.mjs","names":[],"sources":["../../../src/components/TimeGrid/TimeGridControl.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { UnstyledButton, useMantineTheme } from '@mantine/core';\nimport type { TimePickerAmPmLabels, TimePickerFormat } from '../TimePicker';\nimport { TimeValue } from '../TimeValue';\nimport { useTimeGridContext } from './TimeGrid.context';\n\ninterface TimeGridControlProps extends React.ComponentProps<'button'> {\n time: string;\n active: boolean;\n format: TimePickerFormat;\n amPmLabels: TimePickerAmPmLabels;\n withSeconds: boolean | undefined;\n}\n\nexport function TimeGridControl({\n time,\n active,\n className,\n amPmLabels,\n format,\n withSeconds,\n ...others\n}: TimeGridControlProps) {\n const ctx = useTimeGridContext();\n const theme = useMantineTheme();\n\n return (\n <UnstyledButton\n mod={[{ active }]}\n {...ctx.getStyles('control', { className: cx(theme.activeClassName, className) })}\n {...others}\n >\n <TimeValue value={time} format={format} amPmLabels={amPmLabels} withSeconds={withSeconds} />\n </UnstyledButton>\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,gBAAgB,EAC9B,MACA,QACA,WACA,YACA,QACA,aACA,GAAG,UACoB;CACvB,MAAM,MAAM,mBAAmB;CAC/B,MAAM,QAAQ,gBAAgB;CAE9B,OACE,oBAAC,gBAAD;EACE,KAAK,CAAC,EAAE,OAAO,CAAC;EAChB,GAAI,IAAI,UAAU,WAAW,EAAE,WAAW,GAAG,MAAM,iBAAiB,SAAS,EAAE,CAAC;EAChF,GAAI;YAEJ,oBAAC,WAAD;GAAW,OAAO;GAAc;GAAoB;GAAyB;EAAc,CAAA;CAC7E,CAAA;AAEpB"}