@mantine/dates 9.0.0-alpha.7 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/cjs/components/Calendar/Calendar.cjs.map +1 -1
  2. package/cjs/components/CalendarHeader/CalendarHeader.cjs.map +1 -1
  3. package/cjs/components/DateInput/DateInput.cjs.map +1 -1
  4. package/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  5. package/cjs/components/DatePickerInput/DatePickerInput.cjs +1 -0
  6. package/cjs/components/DatePickerInput/DatePickerInput.cjs.map +1 -1
  7. package/cjs/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
  8. package/cjs/components/DatesProvider/DatesProvider.cjs.map +1 -1
  9. package/cjs/components/Day/Day.cjs.map +1 -1
  10. package/cjs/components/MiniCalendar/MiniCalendar.cjs.map +1 -1
  11. package/cjs/components/Month/Month.cjs.map +1 -1
  12. package/cjs/components/MonthPicker/MonthPicker.cjs.map +1 -1
  13. package/cjs/components/MonthPickerInput/MonthPickerInput.cjs +1 -0
  14. package/cjs/components/MonthPickerInput/MonthPickerInput.cjs.map +1 -1
  15. package/cjs/components/TimeGrid/TimeGrid.cjs.map +1 -1
  16. package/cjs/components/TimeInput/TimeInput.cjs +1 -1
  17. package/cjs/components/TimeInput/TimeInput.cjs.map +1 -1
  18. package/cjs/components/TimePicker/TimePicker.cjs.map +1 -1
  19. package/cjs/components/YearPicker/YearPicker.cjs.map +1 -1
  20. package/cjs/components/YearPickerInput/YearPickerInput.cjs +1 -0
  21. package/cjs/components/YearPickerInput/YearPickerInput.cjs.map +1 -1
  22. package/esm/components/Calendar/Calendar.mjs.map +1 -1
  23. package/esm/components/CalendarHeader/CalendarHeader.mjs.map +1 -1
  24. package/esm/components/DateInput/DateInput.mjs.map +1 -1
  25. package/esm/components/DatePicker/DatePicker.mjs.map +1 -1
  26. package/esm/components/DatePickerInput/DatePickerInput.mjs +1 -0
  27. package/esm/components/DatePickerInput/DatePickerInput.mjs.map +1 -1
  28. package/esm/components/DateTimePicker/DateTimePicker.mjs.map +1 -1
  29. package/esm/components/DatesProvider/DatesProvider.mjs.map +1 -1
  30. package/esm/components/Day/Day.mjs.map +1 -1
  31. package/esm/components/MiniCalendar/MiniCalendar.mjs.map +1 -1
  32. package/esm/components/Month/Month.mjs.map +1 -1
  33. package/esm/components/MonthPicker/MonthPicker.mjs.map +1 -1
  34. package/esm/components/MonthPickerInput/MonthPickerInput.mjs +1 -0
  35. package/esm/components/MonthPickerInput/MonthPickerInput.mjs.map +1 -1
  36. package/esm/components/TimeGrid/TimeGrid.mjs.map +1 -1
  37. package/esm/components/TimeInput/TimeInput.mjs +1 -1
  38. package/esm/components/TimeInput/TimeInput.mjs.map +1 -1
  39. package/esm/components/TimePicker/TimePicker.mjs.map +1 -1
  40. package/esm/components/YearPicker/YearPicker.mjs.map +1 -1
  41. package/esm/components/YearPickerInput/YearPickerInput.mjs +1 -0
  42. package/esm/components/YearPickerInput/YearPickerInput.mjs.map +1 -1
  43. package/lib/components/Calendar/Calendar.d.ts +8 -0
  44. package/lib/components/Calendar/index.d.ts +0 -8
  45. package/lib/components/CalendarHeader/CalendarHeader.d.ts +7 -0
  46. package/lib/components/CalendarHeader/index.d.ts +0 -7
  47. package/lib/components/DateInput/DateInput.d.ts +5 -0
  48. package/lib/components/DateInput/index.d.ts +0 -5
  49. package/lib/components/DatePicker/DatePicker.d.ts +8 -0
  50. package/lib/components/DatePicker/index.d.ts +0 -9
  51. package/lib/components/DatePickerInput/DatePickerInput.d.ts +5 -0
  52. package/lib/components/DatePickerInput/index.d.ts +0 -5
  53. package/lib/components/DateTimePicker/DateTimePicker.d.ts +5 -0
  54. package/lib/components/DateTimePicker/index.d.ts +0 -5
  55. package/lib/components/DatesProvider/DatesProvider.d.ts +4 -0
  56. package/lib/components/DatesProvider/index.d.ts +0 -4
  57. package/lib/components/Day/Day.d.ts +6 -0
  58. package/lib/components/Day/index.d.ts +0 -6
  59. package/lib/components/MiniCalendar/MiniCalendar.d.ts +6 -0
  60. package/lib/components/MiniCalendar/index.d.ts +0 -6
  61. package/lib/components/Month/Month.d.ts +6 -0
  62. package/lib/components/Month/index.d.ts +0 -6
  63. package/lib/components/MonthPicker/MonthPicker.d.ts +5 -0
  64. package/lib/components/MonthPicker/index.d.ts +0 -6
  65. package/lib/components/MonthPickerInput/MonthPickerInput.d.ts +5 -0
  66. package/lib/components/MonthPickerInput/index.d.ts +0 -6
  67. package/lib/components/TimeGrid/TimeGrid.d.ts +6 -0
  68. package/lib/components/TimeGrid/index.d.ts +0 -6
  69. package/lib/components/TimeInput/TimeInput.d.ts +4 -0
  70. package/lib/components/TimeInput/index.d.ts +0 -4
  71. package/lib/components/TimePicker/TimePicker.d.ts +10 -0
  72. package/lib/components/TimePicker/index.d.ts +0 -10
  73. package/lib/components/YearPicker/YearPicker.d.ts +6 -0
  74. package/lib/components/YearPicker/index.d.ts +0 -7
  75. package/lib/components/YearPickerInput/YearPickerInput.d.ts +5 -0
  76. package/lib/components/YearPickerInput/index.d.ts +0 -6
  77. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.mjs","names":["classes"],"sources":["../../../src/components/TimePicker/TimePicker.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n BoxProps,\n ClearSectionMode,\n CloseButton,\n CloseButtonProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n InputBase,\n InputVariant,\n Popover,\n PopoverProps,\n ScrollAreaProps,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useId, useMergedRef } from '@mantine/hooks';\nimport { SpinInput } from '../SpinInput';\nimport { AmPmInput } from './AmPmInput/AmPmInput';\nimport { AmPmControlsList } from './TimeControlsList/AmPmControlsList';\nimport { TimeControlsList } from './TimeControlsList/TimeControlsList';\nimport { TimePickerProvider } from './TimePicker.context';\nimport {\n TimePickerAmPmLabels,\n TimePickerFormat,\n TimePickerPasteSplit,\n TimePickerPresets,\n} from './TimePicker.types';\nimport { TimePresets } from './TimePresets/TimePresets';\nimport { useTimePicker } from './use-time-picker';\nimport { clampTime } from './utils/clamp-time/clamp-time';\nimport { getParsedTime } from './utils/get-parsed-time/get-parsed-time';\nimport { getTimeString } from './utils/get-time-string/get-time-string';\nimport classes from './TimePicker.module.css';\n\nexport type TimePickerStylesNames =\n | 'fieldsRoot'\n | 'fieldsGroup'\n | 'field'\n | 'controlsList'\n | 'controlsListGroup'\n | 'control'\n | 'dropdown'\n | 'presetsRoot'\n | 'presetsGroup'\n | 'presetsGroupLabel'\n | 'presetControl'\n | 'scrollarea'\n | __InputStylesNames;\n\nexport type TimePickerCssVariables = {\n dropdown: '--control-font-size';\n};\n\nexport interface TimePickerProps\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<TimePickerFactory>,\n ElementProps<'div', 'onChange' | 'defaultValue'> {\n /** Controlled component value */\n value?: string;\n\n /** Uncontrolled component default value */\n defaultValue?: string;\n\n /** Called when the value changes */\n onChange?: (value: string) => void;\n\n /** Determines whether the clear button should be displayed @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** `name` prop passed down to the hidden input */\n name?: string;\n\n /** `form` prop passed down to the hidden input */\n form?: string;\n\n /** Min possible time value in `hh:mm:ss` format */\n min?: string;\n\n /** Max possible time value in `hh:mm:ss` format */\n max?: string;\n\n /** Time format, `'24h'` by default */\n format?: TimePickerFormat;\n\n /** Number by which hours are incremented/decremented @default 1 */\n hoursStep?: number;\n\n /** Number by which minutes are incremented/decremented @default 1 */\n minutesStep?: number;\n\n /** Number by which seconds are incremented/decremented @default 1 */\n secondsStep?: number;\n\n /** Determines whether the seconds input should be displayed @default false */\n withSeconds?: boolean;\n\n /** `aria-label` of hours input */\n hoursInputLabel?: string;\n\n /** `aria-label` of minutes input */\n minutesInputLabel?: string;\n\n /** `aria-label` of seconds input */\n secondsInputLabel?: string;\n\n /** `aria-label` of am/pm input */\n amPmInputLabel?: string;\n\n /** Labels used for am/pm values @default { am: 'AM', pm: 'PM' } */\n amPmLabels?: TimePickerAmPmLabels;\n\n /** Determines whether the dropdown with time controls list should be visible when the input has focus @default false */\n withDropdown?: boolean;\n\n /** Props passed down to `Popover` component */\n popoverProps?: PopoverProps;\n\n /** Called once when one of the inputs is focused, not called when focused is shifted between hours, minutes, seconds and am/pm inputs */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /** Called once when the focus is no longer on any of the inputs */\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\n\n /** Props passed down to clear button */\n clearButtonProps?: CloseButtonProps & ElementProps<'button'> & DataAttributes;\n\n /** Props passed down to hours input */\n hoursInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to minutes input */\n minutesInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to seconds input */\n secondsInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to am/pm select */\n amPmSelectProps?: React.ComponentProps<'select'> & DataAttributes;\n\n /** If set, the value cannot be updated */\n readOnly?: boolean;\n\n /** If set, the component becomes disabled */\n disabled?: boolean;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** A function to transform paste values, by default time in 24h format can be parsed on paste for example `23:34:22` */\n pasteSplit?: TimePickerPasteSplit;\n\n /** A ref object to get node reference of the hours input */\n hoursRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the minutes input */\n minutesRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the seconds input */\n secondsRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the am/pm select */\n amPmRef?: React.Ref<HTMLSelectElement>;\n\n /** Time presets to display in the dropdown */\n presets?: TimePickerPresets;\n\n /** Maximum height of the content displayed in the dropdown in px @default 200 */\n maxDropdownContentHeight?: number;\n\n /** Props passed down to all underlying `ScrollArea` components */\n scrollAreaProps?: ScrollAreaProps;\n\n /** If set, the time controls list are reversed, @default false */\n reverseTimeControlsList?: boolean;\n\n /** Hours input placeholder, @default -- */\n hoursPlaceholder?: string;\n\n /** Minutes input placeholder, @default -- */\n minutesPlaceholder?: string;\n\n /** Seconds input placeholder, @default -- */\n secondsPlaceholder?: string;\n}\n\nexport type TimePickerFactory = Factory<{\n props: TimePickerProps;\n ref: HTMLDivElement;\n stylesNames: TimePickerStylesNames;\n vars: TimePickerCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n hoursStep: 1,\n minutesStep: 1,\n secondsStep: 1,\n format: '24h',\n amPmLabels: { am: 'AM', pm: 'PM' },\n pasteSplit: getParsedTime,\n maxDropdownContentHeight: 200,\n hoursPlaceholder: '--',\n minutesPlaceholder: '--',\n secondsPlaceholder: '--',\n} satisfies Partial<TimePickerProps>;\n\nconst varsResolver = createVarsResolver<TimePickerFactory>((_theme, { size }) => ({\n dropdown: {\n '--control-font-size': getFontSize(size),\n },\n}));\n\nexport const TimePicker = factory<TimePickerFactory>((_props) => {\n const props = useProps('TimePicker', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n onClick,\n format,\n value,\n defaultValue,\n onChange,\n hoursStep,\n minutesStep,\n secondsStep,\n withSeconds,\n hoursInputLabel,\n minutesInputLabel,\n secondsInputLabel,\n amPmInputLabel,\n amPmLabels,\n clearable,\n clearSectionMode,\n onMouseDown,\n onFocusCapture,\n onBlurCapture,\n min,\n max,\n popoverProps,\n withDropdown,\n rightSection,\n onFocus,\n onBlur,\n clearButtonProps,\n hoursInputProps,\n minutesInputProps,\n secondsInputProps,\n amPmSelectProps,\n readOnly,\n disabled,\n size,\n name,\n form,\n hiddenInputProps,\n labelProps,\n pasteSplit,\n hoursRef,\n minutesRef,\n secondsRef,\n amPmRef,\n presets,\n maxDropdownContentHeight,\n scrollAreaProps,\n attributes,\n reverseTimeControlsList,\n hoursPlaceholder,\n minutesPlaceholder,\n secondsPlaceholder,\n ...others\n } = props;\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<TimePickerFactory>({\n classNames,\n styles,\n props,\n });\n\n const getStyles = useStyles<TimePickerFactory>({\n name: 'TimePicker',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const controller = useTimePicker({\n value,\n defaultValue,\n onChange,\n format,\n amPmLabels,\n withSeconds,\n min,\n max,\n clearable,\n disabled,\n readOnly,\n pasteSplit,\n });\n\n const _hoursRef = useMergedRef(controller.refs.hours, hoursRef);\n const _minutesRef = useMergedRef(controller.refs.minutes, minutesRef);\n const _secondsRef = useMergedRef(controller.refs.seconds, secondsRef);\n const _amPmRef = useMergedRef(controller.refs.amPm, amPmRef);\n\n const hoursInputId = useId();\n const hasFocusRef = useRef(false);\n const [dropdownOpened, setDropdownOpened] = useState(false);\n\n const handleFocus = (event: React.FocusEvent<any>) => {\n if (!hasFocusRef.current) {\n hasFocusRef.current = true;\n onFocus?.(event);\n }\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n const computedValue = controller.values;\n const timeString = getTimeString({\n ...computedValue,\n format,\n amPmLabels,\n withSeconds: !!withSeconds,\n });\n\n if (timeString.valid && (min || max)) {\n const clamped = clampTime(timeString.value, min, max);\n\n if (clamped.timeString !== timeString.value) {\n controller.setTimeString(clamped.timeString);\n }\n }\n hasFocusRef.current = false;\n onBlur?.(event);\n }\n };\n\n return (\n <TimePickerProvider value={{ getStyles, scrollAreaProps, maxDropdownContentHeight }}>\n <Popover\n opened={dropdownOpened}\n transitionProps={{ duration: 0 }}\n position=\"bottom-start\"\n withRoles={false}\n disabled={disabled || readOnly || !withDropdown}\n {...popoverProps}\n >\n <Popover.Target>\n <InputBase\n component=\"div\"\n size={size}\n disabled={disabled}\n onClick={(event) => {\n onClick?.(event);\n controller.focus('hours');\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n }}\n onFocusCapture={(event) => {\n setDropdownOpened(true);\n onFocusCapture?.(event);\n }}\n onBlurCapture={(event) => {\n setDropdownOpened(false);\n onBlurCapture?.(event);\n }}\n rightSection={rightSection}\n __clearSection={\n <CloseButton\n {...clearButtonProps}\n size={size}\n onClick={(event) => {\n controller.clear();\n clearButtonProps?.onClick?.(event);\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n clearButtonProps?.onMouseDown?.(event);\n }}\n />\n }\n __clearable={controller.isClearable}\n __clearSectionMode={clearSectionMode}\n labelProps={{ htmlFor: hoursInputId, ...labelProps }}\n style={style}\n className={className}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n attributes={attributes}\n __staticSelector=\"TimePicker\"\n {...others}\n >\n <div {...getStyles('fieldsRoot')} dir=\"ltr\">\n <div {...getStyles('fieldsGroup')} onBlur={handleBlur}>\n <SpinInput\n id={hoursInputId}\n {...hoursInputProps}\n {...getStyles('field', {\n className: hoursInputProps?.className,\n style: hoursInputProps?.style,\n })}\n value={controller.values.hours}\n onChange={controller.setHours}\n onNextInput={() => controller.focus('minutes')}\n min={format === '12h' ? 1 : 0}\n max={format === '12h' ? 12 : 23}\n allowTemporaryZero={format === '12h'}\n focusable\n step={hoursStep}\n ref={_hoursRef}\n aria-label={hoursInputLabel}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n hoursInputProps?.onFocus?.(event);\n }}\n onBlur={(event) => {\n const actualInputValue = event.currentTarget.value;\n const numericValue = actualInputValue ? parseInt(actualInputValue, 10) : null;\n\n if (format === '12h' && numericValue === 0) {\n controller.setHours(12);\n }\n hoursInputProps?.onBlur?.(event);\n }}\n placeholder={hoursPlaceholder}\n />\n <span>:</span>\n <SpinInput\n {...minutesInputProps}\n {...getStyles('field', {\n className: minutesInputProps?.className,\n style: minutesInputProps?.style,\n })}\n value={controller.values.minutes}\n onChange={controller.setMinutes}\n min={0}\n max={59}\n focusable\n step={minutesStep}\n ref={_minutesRef}\n onPreviousInput={() => controller.focus('hours')}\n onNextInput={() =>\n withSeconds ? controller.focus('seconds') : controller.focus('amPm')\n }\n aria-label={minutesInputLabel}\n tabIndex={-1}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n minutesInputProps?.onFocus?.(event);\n }}\n placeholder={minutesPlaceholder}\n />\n\n {withSeconds && (\n <>\n <span>:</span>\n <SpinInput\n {...secondsInputProps}\n {...getStyles('field', {\n className: secondsInputProps?.className,\n style: secondsInputProps?.style,\n })}\n value={controller.values.seconds}\n onChange={controller.setSeconds}\n min={0}\n max={59}\n focusable\n step={secondsStep}\n ref={_secondsRef}\n onPreviousInput={() => controller.focus('minutes')}\n onNextInput={() => controller.focus('amPm')}\n aria-label={secondsInputLabel}\n tabIndex={-1}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n secondsInputProps?.onFocus?.(event);\n }}\n placeholder={secondsPlaceholder}\n />\n </>\n )}\n\n {format === '12h' && (\n <AmPmInput\n {...amPmSelectProps}\n inputType={withDropdown ? 'input' : 'select'}\n labels={amPmLabels}\n value={controller.values.amPm}\n onChange={controller.setAmPm}\n ref={_amPmRef}\n aria-label={amPmInputLabel}\n onPreviousInput={() =>\n withSeconds ? controller.focus('seconds') : controller.focus('minutes')\n }\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n amPmSelectProps?.onFocus?.(event);\n }}\n />\n )}\n </div>\n </div>\n\n <input\n type=\"hidden\"\n name={name}\n form={form}\n value={controller.hiddenInputValue}\n {...hiddenInputProps}\n />\n </InputBase>\n </Popover.Target>\n <Popover.Dropdown\n {...getStyles('dropdown')}\n onMouseDown={(event) => event.preventDefault()}\n >\n {presets ? (\n <TimePresets\n value={controller.hiddenInputValue}\n onChange={controller.setTimeString}\n format={format}\n presets={presets}\n amPmLabels={amPmLabels}\n withSeconds={withSeconds || false}\n />\n ) : (\n <div {...getStyles('controlsListGroup')}>\n <TimeControlsList\n min={format === '12h' ? 1 : 0}\n max={format === '12h' ? 12 : 23}\n step={hoursStep}\n value={controller.values.hours}\n onSelect={controller.setHours}\n reversed={reverseTimeControlsList}\n />\n <TimeControlsList\n min={0}\n max={59}\n step={minutesStep}\n value={controller.values.minutes}\n onSelect={controller.setMinutes}\n reversed={reverseTimeControlsList}\n />\n {withSeconds && (\n <TimeControlsList\n min={0}\n max={59}\n step={secondsStep}\n value={controller.values.seconds}\n onSelect={controller.setSeconds}\n reversed={reverseTimeControlsList}\n />\n )}\n {format === '12h' && (\n <AmPmControlsList\n labels={amPmLabels}\n value={controller.values.amPm}\n onSelect={controller.setAmPm}\n />\n )}\n </div>\n )}\n </Popover.Dropdown>\n </Popover>\n </TimePickerProvider>\n );\n});\n\nTimePicker.displayName = '@mantine/dates/TimePicker';\nTimePicker.classes = classes;\nTimePicker.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;AA8MA,MAAM,eAAe;CACnB,WAAW;CACX,aAAa;CACb,aAAa;CACb,QAAQ;CACR,YAAY;EAAE,IAAI;EAAM,IAAI;EAAM;CAClC,YAAY;CACZ,0BAA0B;CAC1B,kBAAkB;CAClB,oBAAoB;CACpB,oBAAoB;CACrB;AAED,MAAM,eAAe,oBAAuC,QAAQ,EAAE,YAAY,EAChF,UAAU,EACR,uBAAuB,YAAY,KAAK,EACzC,EACF,EAAE;AAEH,MAAa,aAAa,SAA4B,WAAW;CAC/D,MAAM,QAAQ,SAAS,cAAc,cAAc,OAAO;CAC1D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,QACA,OACA,cACA,UACA,WACA,aACA,aACA,aACA,iBACA,mBACA,mBACA,gBACA,YACA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,QAAQ;OACR,OAAO,WAAW,OAAO;OACzB,UAAU,WAAW;OACrB,CAAA;MAEA;;IAES,CAAA,CACX;;EACS,CAAA;EAEvB;AAEF,WAAW,cAAc;AACzB,WAAW,UAAUA;AACrB,WAAW,eAAe"}
1
+ {"version":3,"file":"TimePicker.mjs","names":["classes"],"sources":["../../../src/components/TimePicker/TimePicker.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n BoxProps,\n ClearSectionMode,\n CloseButton,\n CloseButtonProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n InputBase,\n InputVariant,\n Popover,\n PopoverProps,\n ScrollAreaProps,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useId, useMergedRef } from '@mantine/hooks';\nimport { SpinInput } from '../SpinInput';\nimport { AmPmInput } from './AmPmInput/AmPmInput';\nimport { AmPmControlsList } from './TimeControlsList/AmPmControlsList';\nimport { TimeControlsList } from './TimeControlsList/TimeControlsList';\nimport { TimePickerProvider } from './TimePicker.context';\nimport {\n TimePickerAmPmLabels,\n TimePickerFormat,\n TimePickerPasteSplit,\n TimePickerPresets,\n} from './TimePicker.types';\nimport { TimePresets } from './TimePresets/TimePresets';\nimport { useTimePicker } from './use-time-picker';\nimport { clampTime } from './utils/clamp-time/clamp-time';\nimport { getParsedTime } from './utils/get-parsed-time/get-parsed-time';\nimport { getTimeString } from './utils/get-time-string/get-time-string';\nimport classes from './TimePicker.module.css';\n\nexport type TimePickerStylesNames =\n | 'fieldsRoot'\n | 'fieldsGroup'\n | 'field'\n | 'controlsList'\n | 'controlsListGroup'\n | 'control'\n | 'dropdown'\n | 'presetsRoot'\n | 'presetsGroup'\n | 'presetsGroupLabel'\n | 'presetControl'\n | 'scrollarea'\n | __InputStylesNames;\n\nexport type TimePickerCssVariables = {\n dropdown: '--control-font-size';\n};\n\nexport interface TimePickerProps\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<TimePickerFactory>,\n ElementProps<'div', 'onChange' | 'defaultValue'> {\n /** Controlled component value */\n value?: string;\n\n /** Uncontrolled component default value */\n defaultValue?: string;\n\n /** Called when the value changes */\n onChange?: (value: string) => void;\n\n /** Determines whether the clear button should be displayed @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** `name` prop passed down to the hidden input */\n name?: string;\n\n /** `form` prop passed down to the hidden input */\n form?: string;\n\n /** Min possible time value in `hh:mm:ss` format */\n min?: string;\n\n /** Max possible time value in `hh:mm:ss` format */\n max?: string;\n\n /** Time format, `'24h'` by default */\n format?: TimePickerFormat;\n\n /** Number by which hours are incremented/decremented @default 1 */\n hoursStep?: number;\n\n /** Number by which minutes are incremented/decremented @default 1 */\n minutesStep?: number;\n\n /** Number by which seconds are incremented/decremented @default 1 */\n secondsStep?: number;\n\n /** Determines whether the seconds input should be displayed @default false */\n withSeconds?: boolean;\n\n /** `aria-label` of hours input */\n hoursInputLabel?: string;\n\n /** `aria-label` of minutes input */\n minutesInputLabel?: string;\n\n /** `aria-label` of seconds input */\n secondsInputLabel?: string;\n\n /** `aria-label` of am/pm input */\n amPmInputLabel?: string;\n\n /** Labels used for am/pm values @default { am: 'AM', pm: 'PM' } */\n amPmLabels?: TimePickerAmPmLabels;\n\n /** Determines whether the dropdown with time controls list should be visible when the input has focus @default false */\n withDropdown?: boolean;\n\n /** Props passed down to `Popover` component */\n popoverProps?: PopoverProps;\n\n /** Called once when one of the inputs is focused, not called when focused is shifted between hours, minutes, seconds and am/pm inputs */\n onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n /** Called once when the focus is no longer on any of the inputs */\n onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\n\n /** Props passed down to clear button */\n clearButtonProps?: CloseButtonProps & ElementProps<'button'> & DataAttributes;\n\n /** Props passed down to hours input */\n hoursInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to minutes input */\n minutesInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to seconds input */\n secondsInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** Props passed down to am/pm select */\n amPmSelectProps?: React.ComponentProps<'select'> & DataAttributes;\n\n /** If set, the value cannot be updated */\n readOnly?: boolean;\n\n /** If set, the component becomes disabled */\n disabled?: boolean;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n /** A function to transform paste values, by default time in 24h format can be parsed on paste for example `23:34:22` */\n pasteSplit?: TimePickerPasteSplit;\n\n /** A ref object to get node reference of the hours input */\n hoursRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the minutes input */\n minutesRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the seconds input */\n secondsRef?: React.Ref<HTMLInputElement>;\n\n /** A ref object to get node reference of the am/pm select */\n amPmRef?: React.Ref<HTMLSelectElement>;\n\n /** Time presets to display in the dropdown */\n presets?: TimePickerPresets;\n\n /** Maximum height of the content displayed in the dropdown in px @default 200 */\n maxDropdownContentHeight?: number;\n\n /** Props passed down to all underlying `ScrollArea` components */\n scrollAreaProps?: ScrollAreaProps;\n\n /** If set, the time controls list are reversed, @default false */\n reverseTimeControlsList?: boolean;\n\n /** Hours input placeholder, @default -- */\n hoursPlaceholder?: string;\n\n /** Minutes input placeholder, @default -- */\n minutesPlaceholder?: string;\n\n /** Seconds input placeholder, @default -- */\n secondsPlaceholder?: string;\n}\n\nexport type TimePickerFactory = Factory<{\n props: TimePickerProps;\n ref: HTMLDivElement;\n stylesNames: TimePickerStylesNames;\n vars: TimePickerCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n hoursStep: 1,\n minutesStep: 1,\n secondsStep: 1,\n format: '24h',\n amPmLabels: { am: 'AM', pm: 'PM' },\n pasteSplit: getParsedTime,\n maxDropdownContentHeight: 200,\n hoursPlaceholder: '--',\n minutesPlaceholder: '--',\n secondsPlaceholder: '--',\n} satisfies Partial<TimePickerProps>;\n\nconst varsResolver = createVarsResolver<TimePickerFactory>((_theme, { size }) => ({\n dropdown: {\n '--control-font-size': getFontSize(size),\n },\n}));\n\nexport const TimePicker = factory<TimePickerFactory>((_props) => {\n const props = useProps('TimePicker', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n onClick,\n format,\n value,\n defaultValue,\n onChange,\n hoursStep,\n minutesStep,\n secondsStep,\n withSeconds,\n hoursInputLabel,\n minutesInputLabel,\n secondsInputLabel,\n amPmInputLabel,\n amPmLabels,\n clearable,\n clearSectionMode,\n onMouseDown,\n onFocusCapture,\n onBlurCapture,\n min,\n max,\n popoverProps,\n withDropdown,\n rightSection,\n onFocus,\n onBlur,\n clearButtonProps,\n hoursInputProps,\n minutesInputProps,\n secondsInputProps,\n amPmSelectProps,\n readOnly,\n disabled,\n size,\n name,\n form,\n hiddenInputProps,\n labelProps,\n pasteSplit,\n hoursRef,\n minutesRef,\n secondsRef,\n amPmRef,\n presets,\n maxDropdownContentHeight,\n scrollAreaProps,\n attributes,\n reverseTimeControlsList,\n hoursPlaceholder,\n minutesPlaceholder,\n secondsPlaceholder,\n ...others\n } = props;\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<TimePickerFactory>({\n classNames,\n styles,\n props,\n });\n\n const getStyles = useStyles<TimePickerFactory>({\n name: 'TimePicker',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const controller = useTimePicker({\n value,\n defaultValue,\n onChange,\n format,\n amPmLabels,\n withSeconds,\n min,\n max,\n clearable,\n disabled,\n readOnly,\n pasteSplit,\n });\n\n const _hoursRef = useMergedRef(controller.refs.hours, hoursRef);\n const _minutesRef = useMergedRef(controller.refs.minutes, minutesRef);\n const _secondsRef = useMergedRef(controller.refs.seconds, secondsRef);\n const _amPmRef = useMergedRef(controller.refs.amPm, amPmRef);\n\n const hoursInputId = useId();\n const hasFocusRef = useRef(false);\n const [dropdownOpened, setDropdownOpened] = useState(false);\n\n const handleFocus = (event: React.FocusEvent<any>) => {\n if (!hasFocusRef.current) {\n hasFocusRef.current = true;\n onFocus?.(event);\n }\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n const computedValue = controller.values;\n const timeString = getTimeString({\n ...computedValue,\n format,\n amPmLabels,\n withSeconds: !!withSeconds,\n });\n\n if (timeString.valid && (min || max)) {\n const clamped = clampTime(timeString.value, min, max);\n\n if (clamped.timeString !== timeString.value) {\n controller.setTimeString(clamped.timeString);\n }\n }\n hasFocusRef.current = false;\n onBlur?.(event);\n }\n };\n\n return (\n <TimePickerProvider value={{ getStyles, scrollAreaProps, maxDropdownContentHeight }}>\n <Popover\n opened={dropdownOpened}\n transitionProps={{ duration: 0 }}\n position=\"bottom-start\"\n withRoles={false}\n disabled={disabled || readOnly || !withDropdown}\n {...popoverProps}\n >\n <Popover.Target>\n <InputBase\n component=\"div\"\n size={size}\n disabled={disabled}\n onClick={(event) => {\n onClick?.(event);\n controller.focus('hours');\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n }}\n onFocusCapture={(event) => {\n setDropdownOpened(true);\n onFocusCapture?.(event);\n }}\n onBlurCapture={(event) => {\n setDropdownOpened(false);\n onBlurCapture?.(event);\n }}\n rightSection={rightSection}\n __clearSection={\n <CloseButton\n {...clearButtonProps}\n size={size}\n onClick={(event) => {\n controller.clear();\n clearButtonProps?.onClick?.(event);\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n clearButtonProps?.onMouseDown?.(event);\n }}\n />\n }\n __clearable={controller.isClearable}\n __clearSectionMode={clearSectionMode}\n labelProps={{ htmlFor: hoursInputId, ...labelProps }}\n style={style}\n className={className}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n attributes={attributes}\n __staticSelector=\"TimePicker\"\n {...others}\n >\n <div {...getStyles('fieldsRoot')} dir=\"ltr\">\n <div {...getStyles('fieldsGroup')} onBlur={handleBlur}>\n <SpinInput\n id={hoursInputId}\n {...hoursInputProps}\n {...getStyles('field', {\n className: hoursInputProps?.className,\n style: hoursInputProps?.style,\n })}\n value={controller.values.hours}\n onChange={controller.setHours}\n onNextInput={() => controller.focus('minutes')}\n min={format === '12h' ? 1 : 0}\n max={format === '12h' ? 12 : 23}\n allowTemporaryZero={format === '12h'}\n focusable\n step={hoursStep}\n ref={_hoursRef}\n aria-label={hoursInputLabel}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n hoursInputProps?.onFocus?.(event);\n }}\n onBlur={(event) => {\n const actualInputValue = event.currentTarget.value;\n const numericValue = actualInputValue ? parseInt(actualInputValue, 10) : null;\n\n if (format === '12h' && numericValue === 0) {\n controller.setHours(12);\n }\n hoursInputProps?.onBlur?.(event);\n }}\n placeholder={hoursPlaceholder}\n />\n <span>:</span>\n <SpinInput\n {...minutesInputProps}\n {...getStyles('field', {\n className: minutesInputProps?.className,\n style: minutesInputProps?.style,\n })}\n value={controller.values.minutes}\n onChange={controller.setMinutes}\n min={0}\n max={59}\n focusable\n step={minutesStep}\n ref={_minutesRef}\n onPreviousInput={() => controller.focus('hours')}\n onNextInput={() =>\n withSeconds ? controller.focus('seconds') : controller.focus('amPm')\n }\n aria-label={minutesInputLabel}\n tabIndex={-1}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n minutesInputProps?.onFocus?.(event);\n }}\n placeholder={minutesPlaceholder}\n />\n\n {withSeconds && (\n <>\n <span>:</span>\n <SpinInput\n {...secondsInputProps}\n {...getStyles('field', {\n className: secondsInputProps?.className,\n style: secondsInputProps?.style,\n })}\n value={controller.values.seconds}\n onChange={controller.setSeconds}\n min={0}\n max={59}\n focusable\n step={secondsStep}\n ref={_secondsRef}\n onPreviousInput={() => controller.focus('minutes')}\n onNextInput={() => controller.focus('amPm')}\n aria-label={secondsInputLabel}\n tabIndex={-1}\n readOnly={readOnly}\n disabled={disabled}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n secondsInputProps?.onFocus?.(event);\n }}\n placeholder={secondsPlaceholder}\n />\n </>\n )}\n\n {format === '12h' && (\n <AmPmInput\n {...amPmSelectProps}\n inputType={withDropdown ? 'input' : 'select'}\n labels={amPmLabels}\n value={controller.values.amPm}\n onChange={controller.setAmPm}\n ref={_amPmRef}\n aria-label={amPmInputLabel}\n onPreviousInput={() =>\n withSeconds ? controller.focus('seconds') : controller.focus('minutes')\n }\n readOnly={readOnly}\n disabled={disabled}\n tabIndex={-1}\n onPaste={controller.onPaste}\n onFocus={(event) => {\n handleFocus(event);\n amPmSelectProps?.onFocus?.(event);\n }}\n />\n )}\n </div>\n </div>\n\n <input\n type=\"hidden\"\n name={name}\n form={form}\n value={controller.hiddenInputValue}\n {...hiddenInputProps}\n />\n </InputBase>\n </Popover.Target>\n <Popover.Dropdown\n {...getStyles('dropdown')}\n onMouseDown={(event) => event.preventDefault()}\n >\n {presets ? (\n <TimePresets\n value={controller.hiddenInputValue}\n onChange={controller.setTimeString}\n format={format}\n presets={presets}\n amPmLabels={amPmLabels}\n withSeconds={withSeconds || false}\n />\n ) : (\n <div {...getStyles('controlsListGroup')}>\n <TimeControlsList\n min={format === '12h' ? 1 : 0}\n max={format === '12h' ? 12 : 23}\n step={hoursStep}\n value={controller.values.hours}\n onSelect={controller.setHours}\n reversed={reverseTimeControlsList}\n />\n <TimeControlsList\n min={0}\n max={59}\n step={minutesStep}\n value={controller.values.minutes}\n onSelect={controller.setMinutes}\n reversed={reverseTimeControlsList}\n />\n {withSeconds && (\n <TimeControlsList\n min={0}\n max={59}\n step={secondsStep}\n value={controller.values.seconds}\n onSelect={controller.setSeconds}\n reversed={reverseTimeControlsList}\n />\n )}\n {format === '12h' && (\n <AmPmControlsList\n labels={amPmLabels}\n value={controller.values.amPm}\n onSelect={controller.setAmPm}\n />\n )}\n </div>\n )}\n </Popover.Dropdown>\n </Popover>\n </TimePickerProvider>\n );\n});\n\nTimePicker.displayName = '@mantine/dates/TimePicker';\nTimePicker.classes = classes;\nTimePicker.varsResolver = varsResolver;\n\nexport namespace TimePicker {\n export type Props = TimePickerProps;\n export type StylesNames = TimePickerStylesNames;\n export type Factory = TimePickerFactory;\n export type CssVariables = TimePickerCssVariables;\n export type Format = TimePickerFormat;\n export type AmPmLabels = TimePickerAmPmLabels;\n export type PasteSplit = TimePickerPasteSplit;\n export type Presets = TimePickerPresets;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8MA,MAAM,eAAe;CACnB,WAAW;CACX,aAAa;CACb,aAAa;CACb,QAAQ;CACR,YAAY;EAAE,IAAI;EAAM,IAAI;EAAM;CAClC,YAAY;CACZ,0BAA0B;CAC1B,kBAAkB;CAClB,oBAAoB;CACpB,oBAAoB;CACrB;AAED,MAAM,eAAe,oBAAuC,QAAQ,EAAE,YAAY,EAChF,UAAU,EACR,uBAAuB,YAAY,KAAK,EACzC,EACF,EAAE;AAEH,MAAa,aAAa,SAA4B,WAAW;CAC/D,MAAM,QAAQ,SAAS,cAAc,cAAc,OAAO;CAC1D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,QACA,OACA,cACA,UACA,WACA,aACA,aACA,aACA,iBACA,mBACA,mBACA,gBACA,YACA,WACA,kBACA,aACA,gBACA,eACA,KACA,KACA,cACA,cACA,cACA,SACA,QACA,kBACA,iBACA,mBACA,mBACA,iBACA,UACA,UACA,MACA,MACA,MACA,kBACA,YACA,YACA,UACA,YACA,YACA,SACA,SACA,0BACA,iBACA,YACA,yBACA,kBACA,oBACA,oBACA,GAAG,WACD;CAEJ,MAAM,EAAE,oBAAoB,mBAAmB,qBAAwC;EACrF;EACA;EACA;EACD,CAAC;CAEF,MAAM,YAAY,UAA6B;EAC7C,MAAM;EACN,SAAA;E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QAE/D;QACA;QACV,UAAU;QACV,SAAS,WAAW;QACpB,UAAU,UAAU;AAClB,qBAAY,MAAM;AAClB,0BAAiB,UAAU,MAAM;;QAEnC,CAAA;OAEA;;KACF,CAAA,EAEN,oBAAC,SAAD;KACE,MAAK;KACC;KACA;KACN,OAAO,WAAW;KAClB,GAAI;KACJ,CAAA,CACQ;OACG,CAAA,EACjB,oBAAC,QAAQ,UAAT;IACE,GAAI,UAAU,WAAW;IACzB,cAAc,UAAU,MAAM,gBAAgB;cAE7C,UACC,oBAAC,aAAD;KACE,OAAO,WAAW;KAClB,UAAU,WAAW;KACb;KACC;KACG;KACZ,aAAa,eAAe;KAC5B,CAAA,GAEF,qBAAC,OAAD;KAAK,GAAI,UAAU,oBAAoB;eAAvC;MACE,oBAAC,kBAAD;OACE,KAAK,WAAW,QAAQ,IAAI;OAC5B,KAAK,WAAW,QAAQ,KAAK;OAC7B,MAAM;OACN,OAAO,WAAW,OAAO;OACzB,UAAU,WAAW;OACrB,UAAU;OACV,CAAA;MACF,oBAAC,kBAAD;OACE,KAAK;OACL,KAAK;OACL,MAAM;OACN,OAAO,WAAW,OAAO;OACzB,UAAU,WAAW;OACrB,UAAU;OACV,CAAA;MACD,eACC,oBAAC,kBAAD;OACE,KAAK;OACL,KAAK;OACL,MAAM;OACN,OAAO,WAAW,OAAO;OACzB,UAAU,WAAW;OACrB,UAAU;OACV,CAAA;MAEH,WAAW,SACV,oBAAC,kBAAD;OACE,QAAQ;OACR,OAAO,WAAW,OAAO;OACzB,UAAU,WAAW;OACrB,CAAA;MAEA;;IAES,CAAA,CACX;;EACS,CAAA;EAEvB;AAEF,WAAW,cAAc;AACzB,WAAW,UAAUA;AACrB,WAAW,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"YearPicker.mjs","names":[],"sources":["../../../src/components/YearPicker/YearPicker.tsx"],"sourcesContent":["import {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineComponentStaticProperties,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '@mantine/core';\nimport { useDatesState } from '../../hooks';\nimport { DatePickerType, DateStringValue, PickerBaseProps } from '../../types';\nimport { Calendar, CalendarBaseProps } from '../Calendar';\nimport { DecadeLevelBaseSettings } from '../DecadeLevel';\nimport { DecadeLevelGroupStylesNames } from '../DecadeLevelGroup';\n\nexport type YearPickerStylesNames = DecadeLevelGroupStylesNames;\n\nexport interface YearPickerBaseProps<Type extends DatePickerType = 'default'>\n extends\n PickerBaseProps<Type>,\n DecadeLevelBaseSettings,\n Omit<\n CalendarBaseProps,\n 'onNextYear' | 'onPreviousYear' | 'onNextMonth' | 'onPreviousMonth' | 'hasNextLevel'\n > {}\n\nexport interface YearPickerProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n YearPickerBaseProps<Type>,\n StylesApiProps<YearPickerFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Called when year is selected */\n onYearSelect?: (date: DateStringValue) => void;\n}\n\nexport type YearPickerFactory = Factory<{\n props: YearPickerProps;\n ref: HTMLDivElement;\n stylesNames: YearPickerStylesNames;\n}>;\n\nconst defaultProps = {\n type: 'default',\n} satisfies Partial<YearPickerProps>;\n\ntype YearPickerComponent = (<Type extends DatePickerType = 'default'>(\n props: YearPickerProps<Type> & { ref?: React.Ref<HTMLDivElement> }\n) => React.JSX.Element) & {\n displayName?: string;\n} & MantineComponentStaticProperties<YearPickerFactory>;\n\nexport const YearPicker: YearPickerComponent = factory<YearPickerFactory>((_props) => {\n const props = useProps('YearPicker', defaultProps, _props);\n const {\n classNames,\n styles,\n vars,\n type,\n defaultValue,\n value,\n onChange,\n __staticSelector,\n getYearControlProps,\n allowSingleDateInRange,\n allowDeselect,\n onMouseLeave,\n onYearSelect,\n __updateDateOnYearSelect,\n ...others\n } = props;\n\n const { onDateChange, onRootMouseLeave, onHoveredDateChange, getControlProps } = useDatesState({\n type: type as any,\n level: 'year',\n allowDeselect,\n allowSingleDateInRange,\n value,\n defaultValue,\n onChange: onChange as any,\n onMouseLeave,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<YearPickerFactory>({\n classNames,\n styles,\n props,\n });\n\n return (\n <Calendar\n minLevel=\"decade\"\n __updateDateOnYearSelect={__updateDateOnYearSelect ?? false}\n __staticSelector={__staticSelector || 'YearPicker'}\n onMouseLeave={onRootMouseLeave}\n onYearMouseEnter={(_event, date) => onHoveredDateChange(date)}\n onYearSelect={(date) => {\n onDateChange(date);\n onYearSelect?.(date);\n }}\n getYearControlProps={(date) => ({\n ...getControlProps(date),\n ...getYearControlProps?.(date),\n })}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n {...others}\n />\n );\n}) as any;\n\nYearPicker.classes = Calendar.classes;\nYearPicker.displayName = '@mantine/dates/YearPicker';\n"],"mappings":";;;;;;AA2CA,MAAM,eAAe,EACnB,MAAM,WACP;AAQD,MAAa,aAAkC,SAA4B,WAAW;CACpF,MAAM,QAAQ,SAAS,cAAc,cAAc,OAAO;CAC1D,MAAM,EACJ,YACA,QACA,MACA,MACA,cACA,OACA,UACA,kBACA,qBACA,wBACA,eACA,cACA,cACA,0BACA,GAAG,WACD;CAEJ,MAAM,EAAE,cAAc,kBAAkB,qBAAqB,oBAAoB,cAAc;EACvF;EACN,OAAO;EACP;EACA;EACA;EACA;EACU;EACV;EACD,CAAC;CAEF,MAAM,EAAE,oBAAoB,mBAAmB,qBAAwC;EACrF;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,UAAD;EACE,UAAS;EACT,0BAA0B,4BAA4B;EACtD,kBAAkB,oBAAoB;EACtC,cAAc;EACd,mBAAmB,QAAQ,SAAS,oBAAoB,KAAK;EAC7D,eAAe,SAAS;AACtB,gBAAa,KAAK;AAClB,kBAAe,KAAK;;EAEtB,sBAAsB,UAAU;GAC9B,GAAG,gBAAgB,KAAK;GACxB,GAAG,sBAAsB,KAAK;GAC/B;EACD,YAAY;EACZ,QAAQ;EACR,GAAI;EACJ,CAAA;EAEJ;AAEF,WAAW,UAAU,SAAS;AAC9B,WAAW,cAAc"}
1
+ {"version":3,"file":"YearPicker.mjs","names":[],"sources":["../../../src/components/YearPicker/YearPicker.tsx"],"sourcesContent":["import {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineComponentStaticProperties,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '@mantine/core';\nimport { useDatesState } from '../../hooks';\nimport { DatePickerType, DateStringValue, PickerBaseProps } from '../../types';\nimport { Calendar, CalendarBaseProps } from '../Calendar';\nimport { DecadeLevelBaseSettings } from '../DecadeLevel';\nimport { DecadeLevelGroupStylesNames } from '../DecadeLevelGroup';\n\nexport type YearPickerStylesNames = DecadeLevelGroupStylesNames;\n\nexport interface YearPickerBaseProps<Type extends DatePickerType = 'default'>\n extends\n PickerBaseProps<Type>,\n DecadeLevelBaseSettings,\n Omit<\n CalendarBaseProps,\n 'onNextYear' | 'onPreviousYear' | 'onNextMonth' | 'onPreviousMonth' | 'hasNextLevel'\n > {}\n\nexport interface YearPickerProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n YearPickerBaseProps<Type>,\n StylesApiProps<YearPickerFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Called when year is selected */\n onYearSelect?: (date: DateStringValue) => void;\n}\n\nexport type YearPickerFactory = Factory<{\n props: YearPickerProps;\n ref: HTMLDivElement;\n stylesNames: YearPickerStylesNames;\n}>;\n\nconst defaultProps = {\n type: 'default',\n} satisfies Partial<YearPickerProps>;\n\ntype YearPickerComponent = (<Type extends DatePickerType = 'default'>(\n props: YearPickerProps<Type> & { ref?: React.Ref<HTMLDivElement> }\n) => React.JSX.Element) & {\n displayName?: string;\n} & MantineComponentStaticProperties<YearPickerFactory>;\n\nexport const YearPicker: YearPickerComponent = factory<YearPickerFactory>((_props) => {\n const props = useProps('YearPicker', defaultProps, _props);\n const {\n classNames,\n styles,\n vars,\n type,\n defaultValue,\n value,\n onChange,\n __staticSelector,\n getYearControlProps,\n allowSingleDateInRange,\n allowDeselect,\n onMouseLeave,\n onYearSelect,\n __updateDateOnYearSelect,\n ...others\n } = props;\n\n const { onDateChange, onRootMouseLeave, onHoveredDateChange, getControlProps } = useDatesState({\n type: type as any,\n level: 'year',\n allowDeselect,\n allowSingleDateInRange,\n value,\n defaultValue,\n onChange: onChange as any,\n onMouseLeave,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<YearPickerFactory>({\n classNames,\n styles,\n props,\n });\n\n return (\n <Calendar\n minLevel=\"decade\"\n __updateDateOnYearSelect={__updateDateOnYearSelect ?? false}\n __staticSelector={__staticSelector || 'YearPicker'}\n onMouseLeave={onRootMouseLeave}\n onYearMouseEnter={(_event, date) => onHoveredDateChange(date)}\n onYearSelect={(date) => {\n onDateChange(date);\n onYearSelect?.(date);\n }}\n getYearControlProps={(date) => ({\n ...getControlProps(date),\n ...getYearControlProps?.(date),\n })}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n {...others}\n />\n );\n}) as any;\n\nYearPicker.classes = Calendar.classes;\nYearPicker.displayName = '@mantine/dates/YearPicker';\n\nexport namespace YearPicker {\n export type Props<Type extends DatePickerType = 'default'> = YearPickerProps<Type>;\n export type BaseProps = YearPickerBaseProps;\n export type StylesNames = YearPickerStylesNames;\n export type Factory = YearPickerFactory;\n}\n"],"mappings":";;;;;;AA2CA,MAAM,eAAe,EACnB,MAAM,WACP;AAQD,MAAa,aAAkC,SAA4B,WAAW;CACpF,MAAM,QAAQ,SAAS,cAAc,cAAc,OAAO;CAC1D,MAAM,EACJ,YACA,QACA,MACA,MACA,cACA,OACA,UACA,kBACA,qBACA,wBACA,eACA,cACA,cACA,0BACA,GAAG,WACD;CAEJ,MAAM,EAAE,cAAc,kBAAkB,qBAAqB,oBAAoB,cAAc;EACvF;EACN,OAAO;EACP;EACA;EACA;EACA;EACU;EACV;EACD,CAAC;CAEF,MAAM,EAAE,oBAAoB,mBAAmB,qBAAwC;EACrF;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,UAAD;EACE,UAAS;EACT,0BAA0B,4BAA4B;EACtD,kBAAkB,oBAAoB;EACtC,cAAc;EACd,mBAAmB,QAAQ,SAAS,oBAAoB,KAAK;EAC7D,eAAe,SAAS;AACtB,gBAAa,KAAK;AAClB,kBAAe,KAAK;;EAEtB,sBAAsB,UAAU;GAC9B,GAAG,gBAAgB,KAAK;GACxB,GAAG,sBAAsB,KAAK;GAC/B;EACD,YAAY;EACZ,QAAQ;EACR,GAAI;EACJ,CAAA;EAEJ;AAEF,WAAW,UAAU,SAAS;AAC9B,WAAW,cAAc"}
@@ -9,6 +9,7 @@ import { factory, useProps, useResolvedStylesApi } from "@mantine/core";
9
9
  //#region packages/@mantine/dates/src/components/YearPickerInput/YearPickerInput.tsx
10
10
  const defaultProps = {
11
11
  type: "default",
12
+ size: "sm",
12
13
  valueFormat: "YYYY",
13
14
  closeOnChange: true,
14
15
  sortDates: true,
@@ -1 +1 @@
1
- {"version":3,"file":"YearPickerInput.mjs","names":[],"sources":["../../../src/components/YearPickerInput/YearPickerInput.tsx"],"sourcesContent":["import {\n __InputStylesNames,\n BoxProps,\n factory,\n Factory,\n InputVariant,\n MantineComponentStaticProperties,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '@mantine/core';\nimport { useDatesInput } from '../../hooks';\nimport { DatePickerType } from '../../types';\nimport { getDefaultClampedDate } from '../../utils';\nimport { pickCalendarProps } from '../Calendar';\nimport { DateInputSharedProps, PickerInputBase } from '../PickerInputBase';\nimport { YearPicker, YearPickerBaseProps, YearPickerStylesNames } from '../YearPicker';\n\nexport type YearPickerInputStylesNames = __InputStylesNames | 'placeholder' | YearPickerStylesNames;\n\nexport interface YearPickerInputProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n DateInputSharedProps,\n YearPickerBaseProps<Type>,\n StylesApiProps<YearPickerInputFactory> {\n /** `dayjs` format to display input value @default \"YYYY\" */\n valueFormat?: string;\n}\n\nexport type YearPickerInputFactory = Factory<{\n props: YearPickerInputProps;\n ref: HTMLButtonElement;\n stylesNames: YearPickerInputStylesNames;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n type: 'default',\n valueFormat: 'YYYY',\n closeOnChange: true,\n sortDates: true,\n dropdownType: 'popover',\n} satisfies Partial<YearPickerInputProps>;\n\ntype YearPickerInputComponent = (<Type extends DatePickerType = 'default'>(\n props: YearPickerInputProps<Type> & { ref?: React.Ref<HTMLButtonElement> }\n) => React.JSX.Element) & {\n displayName?: string;\n} & MantineComponentStaticProperties<YearPickerInputFactory>;\n\nexport const YearPickerInput: YearPickerInputComponent = factory<YearPickerInputFactory>(\n (_props) => {\n const props = useProps('YearPickerInput', defaultProps, _props);\n const {\n type,\n value,\n defaultValue,\n onChange,\n valueFormat,\n labelSeparator,\n locale,\n classNames,\n styles,\n unstyled,\n closeOnChange,\n size,\n variant,\n dropdownType,\n sortDates,\n minDate,\n maxDate,\n vars,\n valueFormatter,\n attributes,\n ...rest\n } = props;\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<YearPickerInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { calendarProps, others } = pickCalendarProps(rest);\n\n const {\n _value,\n setValue,\n formattedValue,\n dropdownHandlers,\n dropdownOpened,\n onClear,\n shouldClear,\n } = useDatesInput({\n type: type as any,\n value,\n defaultValue,\n onChange: onChange as any,\n locale,\n format: valueFormat,\n labelSeparator,\n closeOnChange,\n sortDates,\n valueFormatter,\n });\n\n return (\n <PickerInputBase\n formattedValue={formattedValue}\n dropdownOpened={dropdownOpened}\n dropdownHandlers={dropdownHandlers}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n onClear={onClear}\n shouldClear={shouldClear}\n value={_value}\n size={size}\n variant={variant}\n dropdownType={dropdownType}\n {...others}\n type={type as any}\n __staticSelector=\"YearPickerInput\"\n attributes={attributes}\n >\n <YearPicker\n {...calendarProps}\n size={size}\n variant={variant}\n type={type}\n value={_value}\n defaultDate={\n calendarProps.defaultDate ||\n (Array.isArray(_value)\n ? _value[0] || getDefaultClampedDate({ maxDate, minDate })\n : _value || getDefaultClampedDate({ maxDate, minDate }))\n }\n onChange={setValue}\n locale={locale}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector=\"YearPickerInput\"\n __stopPropagation={dropdownType === 'popover'}\n minDate={minDate}\n maxDate={maxDate}\n attributes={attributes}\n />\n </PickerInputBase>\n );\n }\n) as any;\n\nYearPickerInput.classes = { ...PickerInputBase.classes, ...YearPicker.classes };\nYearPickerInput.displayName = '@mantine/dates/YearPickerInput';\n"],"mappings":";;;;;;;;;AAqCA,MAAM,eAAe;CACnB,MAAM;CACN,aAAa;CACb,eAAe;CACf,WAAW;CACX,cAAc;CACf;AAQD,MAAa,kBAA4C,SACtD,WAAW;CACV,MAAM,QAAQ,SAAS,mBAAmB,cAAc,OAAO;CAC/D,MAAM,EACJ,MACA,OACA,cACA,UACA,aACA,gBACA,QACA,YACA,QACA,UACA,eACA,MACA,SACA,cACA,WACA,SACA,SACA,MACA,gBACA,YACA,GAAG,SACD;CAEJ,MAAM,EAAE,oBAAoB,mBAAmB,qBAA6C;EAC1F;EACA;EACA;EACD,CAAC;CAEF,MAAM,EAAE,eAAe,WAAW,kBAAkB,KAAK;CAEzD,MAAM,EACJ,QACA,UACA,gBACA,kBACA,gBACA,SACA,gBACE,cAAc;EACV;EACN;EACA;EACU;EACV;EACA,QAAQ;EACR;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,iBAAD;EACkB;EACA;EACE;EAClB,YAAY;EACZ,QAAQ;EACE;EACD;EACI;EACb,OAAO;EACD;EACG;EACK;EACd,GAAI;EACE;EACN,kBAAiB;EACL;YAEZ,oBAAC,YAAD;GACE,GAAI;GACE;GACG;GACH;GACN,OAAO;GACP,aACE,cAAc,gBACb,MAAM,QAAQ,OAAO,GAClB,OAAO,MAAM,sBAAsB;IAAE;IAAS;IAAS,CAAC,GACxD,UAAU,sBAAsB;IAAE;IAAS;IAAS,CAAC;GAE3D,UAAU;GACF;GACR,YAAY;GACZ,QAAQ;GACE;GACV,kBAAiB;GACjB,mBAAmB,iBAAiB;GAC3B;GACA;GACG;GACZ,CAAA;EACc,CAAA;EAGvB;AAED,gBAAgB,UAAU;CAAE,GAAG,gBAAgB;CAAS,GAAG,WAAW;CAAS;AAC/E,gBAAgB,cAAc"}
1
+ {"version":3,"file":"YearPickerInput.mjs","names":[],"sources":["../../../src/components/YearPickerInput/YearPickerInput.tsx"],"sourcesContent":["import {\n __InputStylesNames,\n BoxProps,\n factory,\n Factory,\n InputVariant,\n MantineComponentStaticProperties,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '@mantine/core';\nimport { useDatesInput } from '../../hooks';\nimport { DatePickerType } from '../../types';\nimport { getDefaultClampedDate } from '../../utils';\nimport { pickCalendarProps } from '../Calendar';\nimport { DateInputSharedProps, PickerInputBase } from '../PickerInputBase';\nimport { YearPicker, YearPickerBaseProps, YearPickerStylesNames } from '../YearPicker';\n\nexport type YearPickerInputStylesNames = __InputStylesNames | 'placeholder' | YearPickerStylesNames;\n\nexport interface YearPickerInputProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n DateInputSharedProps,\n YearPickerBaseProps<Type>,\n StylesApiProps<YearPickerInputFactory> {\n /** `dayjs` format to display input value @default \"YYYY\" */\n valueFormat?: string;\n}\n\nexport type YearPickerInputFactory = Factory<{\n props: YearPickerInputProps;\n ref: HTMLButtonElement;\n stylesNames: YearPickerInputStylesNames;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n type: 'default',\n size: 'sm',\n valueFormat: 'YYYY',\n closeOnChange: true,\n sortDates: true,\n dropdownType: 'popover',\n} satisfies Partial<YearPickerInputProps>;\n\ntype YearPickerInputComponent = (<Type extends DatePickerType = 'default'>(\n props: YearPickerInputProps<Type> & { ref?: React.Ref<HTMLButtonElement> }\n) => React.JSX.Element) & {\n displayName?: string;\n} & MantineComponentStaticProperties<YearPickerInputFactory>;\n\nexport const YearPickerInput: YearPickerInputComponent = factory<YearPickerInputFactory>(\n (_props) => {\n const props = useProps('YearPickerInput', defaultProps, _props);\n const {\n type,\n value,\n defaultValue,\n onChange,\n valueFormat,\n labelSeparator,\n locale,\n classNames,\n styles,\n unstyled,\n closeOnChange,\n size,\n variant,\n dropdownType,\n sortDates,\n minDate,\n maxDate,\n vars,\n valueFormatter,\n attributes,\n ...rest\n } = props;\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<YearPickerInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { calendarProps, others } = pickCalendarProps(rest);\n\n const {\n _value,\n setValue,\n formattedValue,\n dropdownHandlers,\n dropdownOpened,\n onClear,\n shouldClear,\n } = useDatesInput({\n type: type as any,\n value,\n defaultValue,\n onChange: onChange as any,\n locale,\n format: valueFormat,\n labelSeparator,\n closeOnChange,\n sortDates,\n valueFormatter,\n });\n\n return (\n <PickerInputBase\n formattedValue={formattedValue}\n dropdownOpened={dropdownOpened}\n dropdownHandlers={dropdownHandlers}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n onClear={onClear}\n shouldClear={shouldClear}\n value={_value}\n size={size}\n variant={variant}\n dropdownType={dropdownType}\n {...others}\n type={type as any}\n __staticSelector=\"YearPickerInput\"\n attributes={attributes}\n >\n <YearPicker\n {...calendarProps}\n size={size}\n variant={variant}\n type={type}\n value={_value}\n defaultDate={\n calendarProps.defaultDate ||\n (Array.isArray(_value)\n ? _value[0] || getDefaultClampedDate({ maxDate, minDate })\n : _value || getDefaultClampedDate({ maxDate, minDate }))\n }\n onChange={setValue}\n locale={locale}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector=\"YearPickerInput\"\n __stopPropagation={dropdownType === 'popover'}\n minDate={minDate}\n maxDate={maxDate}\n attributes={attributes}\n />\n </PickerInputBase>\n );\n }\n) as any;\n\nYearPickerInput.classes = { ...PickerInputBase.classes, ...YearPicker.classes };\nYearPickerInput.displayName = '@mantine/dates/YearPickerInput';\n\nexport namespace YearPickerInput {\n export type Props<Type extends DatePickerType = 'default'> = YearPickerInputProps<Type>;\n export type StylesNames = YearPickerInputStylesNames;\n export type Factory = YearPickerInputFactory;\n}\n"],"mappings":";;;;;;;;;AAqCA,MAAM,eAAe;CACnB,MAAM;CACN,MAAM;CACN,aAAa;CACb,eAAe;CACf,WAAW;CACX,cAAc;CACf;AAQD,MAAa,kBAA4C,SACtD,WAAW;CACV,MAAM,QAAQ,SAAS,mBAAmB,cAAc,OAAO;CAC/D,MAAM,EACJ,MACA,OACA,cACA,UACA,aACA,gBACA,QACA,YACA,QACA,UACA,eACA,MACA,SACA,cACA,WACA,SACA,SACA,MACA,gBACA,YACA,GAAG,SACD;CAEJ,MAAM,EAAE,oBAAoB,mBAAmB,qBAA6C;EAC1F;EACA;EACA;EACD,CAAC;CAEF,MAAM,EAAE,eAAe,WAAW,kBAAkB,KAAK;CAEzD,MAAM,EACJ,QACA,UACA,gBACA,kBACA,gBACA,SACA,gBACE,cAAc;EACV;EACN;EACA;EACU;EACV;EACA,QAAQ;EACR;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,iBAAD;EACkB;EACA;EACE;EAClB,YAAY;EACZ,QAAQ;EACE;EACD;EACI;EACb,OAAO;EACD;EACG;EACK;EACd,GAAI;EACE;EACN,kBAAiB;EACL;YAEZ,oBAAC,YAAD;GACE,GAAI;GACE;GACG;GACH;GACN,OAAO;GACP,aACE,cAAc,gBACb,MAAM,QAAQ,OAAO,GAClB,OAAO,MAAM,sBAAsB;IAAE;IAAS;IAAS,CAAC,GACxD,UAAU,sBAAsB;IAAE;IAAS;IAAS,CAAC;GAE3D,UAAU;GACF;GACR,YAAY;GACZ,QAAQ;GACE;GACV,kBAAiB;GACjB,mBAAmB,iBAAiB;GAC3B;GACA;GACG;GACZ,CAAA;EACc,CAAA;EAGvB;AAED,gBAAgB,UAAU;CAAE,GAAG,gBAAgB;CAAS,GAAG,WAAW;CAAS;AAC/E,gBAAgB,cAAc"}
@@ -97,4 +97,12 @@ export declare const Calendar: import("@mantine/core").MantineComponent<{
97
97
  ref: HTMLDivElement;
98
98
  stylesNames: CalendarStylesNames;
99
99
  }>;
100
+ export declare namespace Calendar {
101
+ type Props = CalendarProps;
102
+ type StylesNames = CalendarStylesNames;
103
+ type AriaLabels = CalendarAriaLabels;
104
+ type Settings = CalendarSettings;
105
+ type BaseProps = CalendarBaseProps;
106
+ type Factory = CalendarFactory;
107
+ }
100
108
  export {};
@@ -2,11 +2,3 @@ import type { CalendarAriaLabels, CalendarBaseProps, CalendarFactory, CalendarPr
2
2
  export { Calendar } from './Calendar';
3
3
  export { pickCalendarProps } from './pick-calendar-levels-props/pick-calendar-levels-props';
4
4
  export type { CalendarProps, CalendarStylesNames, CalendarAriaLabels, CalendarSettings, CalendarBaseProps, CalendarFactory, };
5
- export declare namespace Calendar {
6
- type Props = CalendarProps;
7
- type StylesNames = CalendarStylesNames;
8
- type AriaLabels = CalendarAriaLabels;
9
- type Settings = CalendarSettings;
10
- type BaseProps = CalendarBaseProps;
11
- type Factory = CalendarFactory;
12
- }
@@ -57,3 +57,10 @@ export declare const CalendarHeader: import("@mantine/core").MantineComponent<{
57
57
  stylesNames: CalendarHeaderStylesNames;
58
58
  vars: CalendarHeaderCssVariables;
59
59
  }>;
60
+ export declare namespace CalendarHeader {
61
+ type Props = CalendarHeaderProps;
62
+ type StylesNames = CalendarHeaderStylesNames;
63
+ type CssVariables = CalendarHeaderCssVariables;
64
+ type Settings = CalendarHeaderSettings;
65
+ type Factory = CalendarHeaderFactory;
66
+ }
@@ -1,10 +1,3 @@
1
1
  import type { CalendarHeaderCssVariables, CalendarHeaderFactory, CalendarHeaderProps, CalendarHeaderSettings, CalendarHeaderStylesNames } from './CalendarHeader';
2
2
  export { CalendarHeader } from './CalendarHeader';
3
3
  export type { CalendarHeaderProps, CalendarHeaderStylesNames, CalendarHeaderCssVariables, CalendarHeaderSettings, CalendarHeaderFactory, };
4
- export declare namespace CalendarHeader {
5
- type Props = CalendarHeaderProps;
6
- type StylesNames = CalendarHeaderStylesNames;
7
- type CssVariables = CalendarHeaderCssVariables;
8
- type Settings = CalendarHeaderSettings;
9
- type Factory = CalendarHeaderFactory;
10
- }
@@ -51,3 +51,8 @@ export declare const DateInput: import("@mantine/core").MantineComponent<{
51
51
  stylesNames: DateInputStylesNames;
52
52
  variant: InputVariant;
53
53
  }>;
54
+ export declare namespace DateInput {
55
+ type Props = DateInputProps;
56
+ type StylesNames = DateInputStylesNames;
57
+ type Factory = DateInputFactory;
58
+ }
@@ -1,8 +1,3 @@
1
1
  import type { DateInputFactory, DateInputProps, DateInputStylesNames } from './DateInput';
2
2
  export { DateInput } from './DateInput';
3
3
  export type { DateInputProps, DateInputStylesNames, DateInputFactory };
4
- export declare namespace DateInput {
5
- type Props = DateInputProps;
6
- type StylesNames = DateInputStylesNames;
7
- type Factory = DateInputFactory;
8
- }
@@ -39,4 +39,12 @@ type DatePickerComponent = (<Type extends DatePickerType = 'default'>(props: Dat
39
39
  displayName?: string;
40
40
  } & MantineComponentStaticProperties<DatePickerFactory>;
41
41
  export declare const DatePicker: DatePickerComponent;
42
+ export declare namespace DatePicker {
43
+ type Props<Type extends DatePickerType> = DatePickerProps<Type>;
44
+ type BaseProps = DatePickerBaseProps;
45
+ type StylesNames = DatePickerStylesNames;
46
+ type Factory = DatePickerFactory;
47
+ type Preset<Type extends DatePickerType> = DatePickerPreset<Type>;
48
+ type CssVariables = DatePickerCssVariables;
49
+ }
42
50
  export {};
@@ -1,12 +1,3 @@
1
- import { DatePickerType } from '../../types';
2
1
  import type { DatePickerBaseProps, DatePickerCssVariables, DatePickerFactory, DatePickerPreset, DatePickerProps, DatePickerStylesNames } from './DatePicker';
3
2
  export { DatePicker } from './DatePicker';
4
3
  export type { DatePickerProps, DatePickerBaseProps, DatePickerStylesNames, DatePickerFactory, DatePickerPreset, DatePickerCssVariables, };
5
- export declare namespace DatePicker {
6
- type Props<Type extends DatePickerType> = DatePickerProps<Type>;
7
- type BaseProps = DatePickerBaseProps;
8
- type StylesNames = DatePickerStylesNames;
9
- type Factory = DatePickerFactory;
10
- type Preset<Type extends DatePickerType> = DatePickerPreset<Type>;
11
- type CssVariables = DatePickerCssVariables;
12
- }
@@ -19,4 +19,9 @@ type DatePickerInputComponent = (<Type extends DatePickerType = 'default'>(props
19
19
  displayName?: string;
20
20
  } & MantineComponentStaticProperties<DatePickerInputFactory>;
21
21
  export declare const DatePickerInput: DatePickerInputComponent;
22
+ export declare namespace DatePickerInput {
23
+ type Props = DatePickerInputProps;
24
+ type StylesNames = DatePickerInputStylesNames;
25
+ type Factory = DatePickerInputFactory;
26
+ }
22
27
  export {};
@@ -1,8 +1,3 @@
1
1
  import type { DatePickerInputFactory, DatePickerInputProps, DatePickerInputStylesNames } from './DatePickerInput';
2
2
  export { DatePickerInput } from './DatePickerInput';
3
3
  export type { DatePickerInputProps, DatePickerInputStylesNames, DatePickerInputFactory };
4
- export declare namespace DatePickerInput {
5
- type Props = DatePickerInputProps;
6
- type StylesNames = DatePickerInputStylesNames;
7
- type Factory = DatePickerInputFactory;
8
- }
@@ -39,3 +39,8 @@ export declare const DateTimePicker: import("@mantine/core").MantineComponent<{
39
39
  stylesNames: DateTimePickerStylesNames;
40
40
  variant: InputVariant;
41
41
  }>;
42
+ export declare namespace DateTimePicker {
43
+ type Props = DateTimePickerProps;
44
+ type StylesNames = DateTimePickerStylesNames;
45
+ type Factory = DateTimePickerFactory;
46
+ }
@@ -1,8 +1,3 @@
1
1
  import type { DateTimePickerFactory, DateTimePickerProps, DateTimePickerStylesNames } from './DateTimePicker';
2
2
  export { DateTimePicker } from './DateTimePicker';
3
3
  export type { DateTimePickerProps, DateTimePickerStylesNames, DateTimePickerFactory };
4
- export declare namespace DateTimePicker {
5
- type Props = DateTimePickerProps;
6
- type StylesNames = DateTimePickerStylesNames;
7
- type Factory = DateTimePickerFactory;
8
- }
@@ -14,3 +14,7 @@ export interface DatesProviderProps {
14
14
  children?: React.ReactNode;
15
15
  }
16
16
  export declare function DatesProvider({ settings, children }: DatesProviderProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare namespace DatesProvider {
18
+ type Props = DatesProviderProps;
19
+ type Settings = DatesProviderSettings;
20
+ }
@@ -2,7 +2,3 @@ import type { DatesProviderProps, DatesProviderSettings } from './DatesProvider'
2
2
  export { DATES_PROVIDER_DEFAULT_SETTINGS, DatesProvider } from './DatesProvider';
3
3
  export { useDatesContext } from './use-dates-context';
4
4
  export type { DatesProviderProps, DatesProviderSettings };
5
- export declare namespace DatesProvider {
6
- type Props = DatesProviderProps;
7
- type Settings = DatesProviderSettings;
8
- }
@@ -46,3 +46,9 @@ export declare const Day: import("@mantine/core").MantineComponent<{
46
46
  stylesNames: DayStylesNames;
47
47
  vars: DayCssVariables;
48
48
  }>;
49
+ export declare namespace Day {
50
+ type Props = DayProps;
51
+ type StylesNames = DayStylesNames;
52
+ type Factory = DayFactory;
53
+ type CssVariables = DayCssVariables;
54
+ }
@@ -1,9 +1,3 @@
1
1
  import type { DayCssVariables, DayFactory, DayProps, DayStylesNames, RenderDay } from './Day';
2
2
  export { Day } from './Day';
3
3
  export type { DayProps, DayStylesNames, DayFactory, DayCssVariables, RenderDay };
4
- export declare namespace Day {
5
- type Props = DayProps;
6
- type StylesNames = DayStylesNames;
7
- type Factory = DayFactory;
8
- type CssVariables = DayCssVariables;
9
- }
@@ -49,3 +49,9 @@ export declare const MiniCalendar: import("@mantine/core").MantineComponent<{
49
49
  stylesNames: MiniCalendarStylesNames;
50
50
  vars: MiniCalendarCssVariables;
51
51
  }>;
52
+ export declare namespace MiniCalendar {
53
+ type Props = MiniCalendarProps;
54
+ type StylesNames = MiniCalendarStylesNames;
55
+ type Factory = MiniCalendarFactory;
56
+ type CssVariables = MiniCalendarCssVariables;
57
+ }
@@ -1,9 +1,3 @@
1
1
  import type { MiniCalendarCssVariables, MiniCalendarFactory, MiniCalendarProps, MiniCalendarStylesNames } from './MiniCalendar';
2
2
  export { MiniCalendar } from './MiniCalendar';
3
3
  export type { MiniCalendarProps, MiniCalendarStylesNames, MiniCalendarFactory, MiniCalendarCssVariables, };
4
- export declare namespace MiniCalendar {
5
- type Props = MiniCalendarProps;
6
- type StylesNames = MiniCalendarStylesNames;
7
- type Factory = MiniCalendarFactory;
8
- type CssVariables = MiniCalendarCssVariables;
9
- }
@@ -72,3 +72,9 @@ export declare const Month: import("@mantine/core").MantineComponent<{
72
72
  stylesNames: MonthStylesNames;
73
73
  vars: MonthCssVariables;
74
74
  }>;
75
+ export declare namespace Month {
76
+ type Props = MonthProps;
77
+ type Settings = MonthSettings;
78
+ type StylesNames = MonthStylesNames;
79
+ type Factory = MonthFactory;
80
+ }
@@ -5,9 +5,3 @@ export { getMonthDays } from './get-month-days/get-month-days';
5
5
  export { isSameMonth } from './is-same-month/is-same-month';
6
6
  export { Month } from './Month';
7
7
  export type { MonthProps, MonthSettings, MonthStylesNames, MonthFactory };
8
- export declare namespace Month {
9
- type Props = MonthProps;
10
- type Settings = MonthSettings;
11
- type StylesNames = MonthStylesNames;
12
- type Factory = MonthFactory;
13
- }
@@ -32,4 +32,9 @@ type MonthPickerComponent = (<Type extends DatePickerType = 'default'>(props: Mo
32
32
  displayName?: string;
33
33
  } & MantineComponentStaticProperties<MonthPickerFactory>;
34
34
  export declare const MonthPicker: MonthPickerComponent;
35
+ export declare namespace MonthPicker {
36
+ type Props<Type extends DatePickerType = 'default'> = MonthPickerProps<Type>;
37
+ type StylesNames = MonthPickerStylesNames;
38
+ type Factory = MonthPickerFactory;
39
+ }
35
40
  export {};
@@ -1,9 +1,3 @@
1
- import { DatePickerType } from '../../types';
2
1
  import type { MonthPickerBaseProps, MonthPickerFactory, MonthPickerProps, MonthPickerStylesNames } from './MonthPicker';
3
2
  export { MonthPicker } from './MonthPicker';
4
3
  export type { MonthPickerBaseProps, MonthPickerProps, MonthPickerStylesNames, MonthPickerFactory };
5
- export declare namespace MonthPicker {
6
- type Props<Type extends DatePickerType = 'default'> = MonthPickerProps<Type>;
7
- type StylesNames = MonthPickerStylesNames;
8
- type Factory = MonthPickerFactory;
9
- }
@@ -19,4 +19,9 @@ type MonthPickerInputComponent = (<Type extends DatePickerType = 'default'>(prop
19
19
  displayName?: string;
20
20
  } & MantineComponentStaticProperties<MonthPickerInputFactory>;
21
21
  export declare const MonthPickerInput: MonthPickerInputComponent;
22
+ export declare namespace MonthPickerInput {
23
+ type Props<Type extends DatePickerType = 'default'> = MonthPickerInputProps<Type>;
24
+ type StylesNames = MonthPickerInputStylesNames;
25
+ type Factory = MonthPickerInputFactory;
26
+ }
22
27
  export {};
@@ -1,9 +1,3 @@
1
- import { DatePickerType } from '../../types';
2
1
  import type { MonthPickerInputFactory, MonthPickerInputProps, MonthPickerInputStylesNames } from './MonthPickerInput';
3
2
  export { MonthPickerInput } from './MonthPickerInput';
4
3
  export type { MonthPickerInputProps, MonthPickerInputStylesNames, MonthPickerInputFactory };
5
- export declare namespace MonthPickerInput {
6
- type Props<Type extends DatePickerType = 'default'> = MonthPickerInputProps<Type>;
7
- type StylesNames = MonthPickerInputStylesNames;
8
- type Factory = MonthPickerInputFactory;
9
- }
@@ -50,3 +50,9 @@ export declare const TimeGrid: import("@mantine/core").MantineComponent<{
50
50
  stylesNames: TimeGridStylesNames;
51
51
  vars: TimeGridCssVariables;
52
52
  }>;
53
+ export declare namespace TimeGrid {
54
+ type Props = TimeGridProps;
55
+ type StylesNames = TimeGridStylesNames;
56
+ type Factory = TimeGridFactory;
57
+ type CssVariables = TimeGridCssVariables;
58
+ }
@@ -2,9 +2,3 @@ import type { TimeGridCssVariables, TimeGridFactory, TimeGridProps, TimeGridStyl
2
2
  export { TimeGrid } from './TimeGrid';
3
3
  export { isTimeBefore, isTimeAfter } from './compare-time';
4
4
  export type { TimeGridProps, TimeGridStylesNames, TimeGridFactory, TimeGridCssVariables };
5
- export declare namespace TimeGrid {
6
- type Props = TimeGridProps;
7
- type StylesNames = TimeGridStylesNames;
8
- type Factory = TimeGridFactory;
9
- type CssVariables = TimeGridCssVariables;
10
- }
@@ -17,3 +17,7 @@ export declare const TimeInput: import("@mantine/core").MantineComponent<{
17
17
  ref: HTMLInputElement;
18
18
  stylesNames: __InputStylesNames;
19
19
  }>;
20
+ export declare namespace TimeInput {
21
+ type Props = TimeInputProps;
22
+ type Factory = TimeInputFactory;
23
+ }
@@ -1,7 +1,3 @@
1
1
  import type { TimeInputFactory, TimeInputProps } from './TimeInput';
2
2
  export { TimeInput } from './TimeInput';
3
3
  export type { TimeInputProps, TimeInputFactory };
4
- export declare namespace TimeInput {
5
- type Props = TimeInputProps;
6
- type Factory = TimeInputFactory;
7
- }
@@ -106,3 +106,13 @@ export declare const TimePicker: import("@mantine/core").MantineComponent<{
106
106
  vars: TimePickerCssVariables;
107
107
  variant: InputVariant;
108
108
  }>;
109
+ export declare namespace TimePicker {
110
+ type Props = TimePickerProps;
111
+ type StylesNames = TimePickerStylesNames;
112
+ type Factory = TimePickerFactory;
113
+ type CssVariables = TimePickerCssVariables;
114
+ type Format = TimePickerFormat;
115
+ type AmPmLabels = TimePickerAmPmLabels;
116
+ type PasteSplit = TimePickerPasteSplit;
117
+ type Presets = TimePickerPresets;
118
+ }
@@ -3,13 +3,3 @@ import type { TimePickerAmPmLabels, TimePickerFormat, TimePickerPasteSplit, Time
3
3
  export { TimePicker } from './TimePicker';
4
4
  export { getTimeRange } from './utils/get-time-range/get-time-range';
5
5
  export type { TimePickerProps, TimePickerStylesNames, TimePickerFactory, TimePickerCssVariables, TimePickerFormat, TimePickerAmPmLabels, TimePickerPasteSplit, TimePickerPresets, };
6
- export declare namespace TimePicker {
7
- type Props = TimePickerProps;
8
- type StylesNames = TimePickerStylesNames;
9
- type Factory = TimePickerFactory;
10
- type CssVariables = TimePickerCssVariables;
11
- type Format = TimePickerFormat;
12
- type AmPmLabels = TimePickerAmPmLabels;
13
- type PasteSplit = TimePickerPasteSplit;
14
- type Presets = TimePickerPresets;
15
- }
@@ -21,4 +21,10 @@ type YearPickerComponent = (<Type extends DatePickerType = 'default'>(props: Yea
21
21
  displayName?: string;
22
22
  } & MantineComponentStaticProperties<YearPickerFactory>;
23
23
  export declare const YearPicker: YearPickerComponent;
24
+ export declare namespace YearPicker {
25
+ type Props<Type extends DatePickerType = 'default'> = YearPickerProps<Type>;
26
+ type BaseProps = YearPickerBaseProps;
27
+ type StylesNames = YearPickerStylesNames;
28
+ type Factory = YearPickerFactory;
29
+ }
24
30
  export {};
@@ -1,10 +1,3 @@
1
- import { DatePickerType } from '../../types';
2
1
  import type { YearPickerBaseProps, YearPickerFactory, YearPickerProps, YearPickerStylesNames } from './YearPicker';
3
2
  export { YearPicker } from './YearPicker';
4
3
  export type { YearPickerProps, YearPickerBaseProps, YearPickerFactory, YearPickerStylesNames };
5
- export declare namespace YearPicker {
6
- type Props<Type extends DatePickerType = 'default'> = YearPickerProps<Type>;
7
- type BaseProps = YearPickerBaseProps;
8
- type StylesNames = YearPickerStylesNames;
9
- type Factory = YearPickerFactory;
10
- }
@@ -19,4 +19,9 @@ type YearPickerInputComponent = (<Type extends DatePickerType = 'default'>(props
19
19
  displayName?: string;
20
20
  } & MantineComponentStaticProperties<YearPickerInputFactory>;
21
21
  export declare const YearPickerInput: YearPickerInputComponent;
22
+ export declare namespace YearPickerInput {
23
+ type Props<Type extends DatePickerType = 'default'> = YearPickerInputProps<Type>;
24
+ type StylesNames = YearPickerInputStylesNames;
25
+ type Factory = YearPickerInputFactory;
26
+ }
22
27
  export {};
@@ -1,9 +1,3 @@
1
- import { DatePickerType } from '../../types';
2
1
  import type { YearPickerInputFactory, YearPickerInputProps, YearPickerInputStylesNames } from './YearPickerInput';
3
2
  export { YearPickerInput } from './YearPickerInput';
4
3
  export type { YearPickerInputProps, YearPickerInputStylesNames, YearPickerInputFactory };
5
- export declare namespace YearPickerInput {
6
- type Props<Type extends DatePickerType = 'default'> = YearPickerInputProps<Type>;
7
- type StylesNames = YearPickerInputStylesNames;
8
- type Factory = YearPickerInputFactory;
9
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine/dates",
3
- "version": "9.0.0-alpha.7",
3
+ "version": "9.0.1",
4
4
  "description": "Calendars, date and time pickers based on Mantine components",
5
5
  "homepage": "https://mantine.dev/dates/getting-started/",
6
6
  "license": "MIT",
@@ -45,8 +45,8 @@
45
45
  "directory": "packages/@mantine/dates"
46
46
  },
47
47
  "peerDependencies": {
48
- "@mantine/core": "9.0.0-alpha.7",
49
- "@mantine/hooks": "9.0.0-alpha.7",
48
+ "@mantine/core": "9.0.1",
49
+ "@mantine/hooks": "9.0.1",
50
50
  "dayjs": ">=1.0.0",
51
51
  "react": "^19.2.0",
52
52
  "react-dom": "^19.2.0"