react-aria-components 1.10.0 → 1.11.0
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.
- package/dist/Breadcrumbs.main.js +9 -2
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +10 -3
- package/dist/Breadcrumbs.module.js +10 -3
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +20 -13
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +21 -14
- package/dist/GridList.module.js +21 -14
- package/dist/GridList.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +22 -19
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +23 -20
- package/dist/ListBox.module.js +23 -20
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +15 -8
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +16 -9
- package/dist/Menu.module.js +16 -9
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +3 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -1
- package/dist/Popover.module.js +3 -1
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +3 -1
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -1
- package/dist/SearchField.module.js +3 -1
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +4 -2
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +5 -3
- package/dist/Separator.module.js +5 -3
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +47 -26
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +48 -27
- package/dist/Table.module.js +48 -27
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +22 -11
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +23 -12
- package/dist/Tabs.module.js +23 -12
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +14 -8
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +14 -8
- package/dist/TagGroup.module.js +14 -8
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +13 -1
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +13 -1
- package/dist/TextField.module.js +13 -1
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +5 -3
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +5 -3
- package/dist/Tooltip.module.js +5 -3
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +73 -26
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +74 -27
- package/dist/Tree.module.js +74 -27
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.module.js.map +1 -1
- package/dist/import.mjs +5 -5
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -5
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +212 -203
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +25 -25
- package/src/Breadcrumbs.tsx +10 -6
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +25 -18
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +30 -26
- package/src/Menu.tsx +15 -12
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +3 -3
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +3 -2
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +6 -4
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +58 -56
- package/src/Tabs.tsx +20 -16
- package/src/TagGroup.tsx +13 -12
- package/src/TextField.tsx +5 -2
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +6 -5
- package/src/Tree.tsx +90 -42
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/index.ts +8 -8
- package/src/useDragAndDrop.tsx +2 -2
- package/src/utils.tsx +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,0BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,oCAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,2CAAa;IACvD;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,4BAAU,EAAE,OAAO;IAErG,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU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Aa;QACrC,kBAAkB;QAClB,QAAQ;kBACN;uBACA;4BACA;4BACA;8BACA;4BACA;YACA,GAAG,MAAM;QACX;IACF;IAEA,IAAI,YAAY;QACd,gBAAgB,OAAO,SAAS,IAAI;QACpC,gBAAgB,aAAa;QAC7B,gBAAgB,OAAO,SAAS,IAAI;QACpC,oBAAoB,OAAO,aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,0DAAC;QAAK,GAAG,CAAA,GAAA,2BAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,0BAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO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kB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;QACpC,cAAc,WAAW;IAC3B;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,YAAY;QAAC,QAAQ;IAAI;IAEvD,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,0DAAC;QAAK,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.main.js.map"}
|
package/dist/Calendar.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Butt
|
|
|
2
2
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
3
3
|
import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.mjs";
|
|
4
4
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
5
|
-
import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing
|
|
6
|
-
import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
|
|
5
|
+
import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, mergeProps as $dCiKx$mergeProps, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing} from "react-aria";
|
|
6
|
+
import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isToday as $dCiKx$isToday, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
|
|
7
7
|
import {useCalendarState as $dCiKx$useCalendarState, useRangeCalendarState as $dCiKx$useRangeCalendarState} from "react-stately";
|
|
8
8
|
import {filterDOMProps as $dCiKx$filterDOMProps} from "@react-aria/utils";
|
|
9
9
|
import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiKx$forwardRef, useContext as $dCiKx$useContext, useRef as $dCiKx$useRef} from "react";
|
|
@@ -49,9 +49,11 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
49
49
|
},
|
|
50
50
|
defaultClassName: 'react-aria-Calendar'
|
|
51
51
|
});
|
|
52
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
53
|
+
global: true
|
|
54
|
+
});
|
|
52
55
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
53
|
-
...renderProps,
|
|
54
|
-
...calendarProps,
|
|
56
|
+
...(0, $dCiKx$mergeProps)(DOMProps, renderProps, calendarProps),
|
|
55
57
|
ref: ref,
|
|
56
58
|
slot: props.slot || undefined,
|
|
57
59
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -117,9 +119,11 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
117
119
|
},
|
|
118
120
|
defaultClassName: 'react-aria-RangeCalendar'
|
|
119
121
|
});
|
|
122
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
123
|
+
global: true
|
|
124
|
+
});
|
|
120
125
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
121
|
-
...renderProps,
|
|
122
|
-
...calendarProps,
|
|
126
|
+
...(0, $dCiKx$mergeProps)(renderProps, DOMProps, calendarProps),
|
|
123
127
|
ref: ref,
|
|
124
128
|
slot: props.slot || undefined,
|
|
125
129
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -184,6 +188,9 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
184
188
|
weekdayStyle: props.weekdayStyle,
|
|
185
189
|
firstDayOfWeek: firstDayOfWeek
|
|
186
190
|
}, state);
|
|
191
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
192
|
+
global: true
|
|
193
|
+
});
|
|
187
194
|
var _props_className;
|
|
188
195
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$var$InternalCalendarGridContext.Provider, {
|
|
189
196
|
value: {
|
|
@@ -193,19 +200,21 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
193
200
|
weeksInMonth: weeksInMonth
|
|
194
201
|
}
|
|
195
202
|
}, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
|
|
196
|
-
...(0, $dCiKx$
|
|
197
|
-
...gridProps,
|
|
203
|
+
...(0, $dCiKx$mergeProps)(DOMProps, gridProps),
|
|
198
204
|
ref: ref,
|
|
199
205
|
style: props.style,
|
|
206
|
+
cellPadding: 0,
|
|
200
207
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-CalendarGrid'
|
|
201
208
|
}, typeof props.children !== 'function' ? props.children : /*#__PURE__*/ (0, $dCiKx$react).createElement((0, $dCiKx$react).Fragment, null, /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$22e2d15eaa4d2377, null, (day)=>/*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$ad2135cac3a11b3d, null, day)), /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$e11f8ba65d857bff, null, props.children))));
|
|
202
209
|
});
|
|
203
210
|
function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
|
|
204
211
|
let { children: children, style: style, className: className } = props;
|
|
205
212
|
let { headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
|
|
213
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
214
|
+
global: true
|
|
215
|
+
});
|
|
206
216
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("thead", {
|
|
207
|
-
...(0, $dCiKx$
|
|
208
|
-
...headerProps,
|
|
217
|
+
...(0, $dCiKx$mergeProps)(DOMProps, headerProps),
|
|
209
218
|
ref: ref,
|
|
210
219
|
style: style,
|
|
211
220
|
className: className || 'react-aria-CalendarGridHeader'
|
|
@@ -218,8 +227,11 @@ function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
|
|
|
218
227
|
*/ const $dfd62f934fc76fed$export$22e2d15eaa4d2377 = /*#__PURE__*/ (0, $dCiKx$forwardRef)($dfd62f934fc76fed$var$CalendarGridHeader);
|
|
219
228
|
function $dfd62f934fc76fed$var$CalendarHeaderCell(props, ref) {
|
|
220
229
|
let { children: children, style: style, className: className } = props;
|
|
230
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
231
|
+
global: true
|
|
232
|
+
});
|
|
221
233
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("th", {
|
|
222
|
-
...
|
|
234
|
+
...DOMProps,
|
|
223
235
|
ref: ref,
|
|
224
236
|
style: style,
|
|
225
237
|
className: className || 'react-aria-CalendarHeaderCell'
|
|
@@ -234,8 +246,11 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
|
|
|
234
246
|
let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
|
|
235
247
|
let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
|
|
236
248
|
let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
|
|
249
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
250
|
+
global: true
|
|
251
|
+
});
|
|
237
252
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
|
|
238
|
-
...
|
|
253
|
+
...DOMProps,
|
|
239
254
|
ref: ref,
|
|
240
255
|
style: style,
|
|
241
256
|
className: className || 'react-aria-CalendarGridBody'
|
|
@@ -260,9 +275,12 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
260
275
|
let { startDate: currentMonth } = (_useContext = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext)) !== null && _useContext !== void 0 ? _useContext : {
|
|
261
276
|
startDate: state.visibleRange.start
|
|
262
277
|
};
|
|
278
|
+
let isOutsideMonth = !(0, $dCiKx$isSameMonth)(currentMonth, date);
|
|
279
|
+
let istoday = (0, $dCiKx$isToday)(date, state.timeZone);
|
|
263
280
|
let buttonRef = (0, $dCiKx$useRef)(null);
|
|
264
281
|
let { cellProps: cellProps, buttonProps: buttonProps, ...states } = (0, $dCiKx$useCalendarCell)({
|
|
265
|
-
date: date
|
|
282
|
+
date: date,
|
|
283
|
+
isOutsideMonth: isOutsideMonth
|
|
266
284
|
}, state, buttonRef);
|
|
267
285
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dCiKx$useHover)({
|
|
268
286
|
...otherProps,
|
|
@@ -270,7 +288,6 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
270
288
|
});
|
|
271
289
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $dCiKx$useFocusRing)();
|
|
272
290
|
isFocusVisible && (isFocusVisible = states.isFocused);
|
|
273
|
-
let isOutsideMonth = !(0, $dCiKx$isSameMonth)(currentMonth, date);
|
|
274
291
|
let isSelectionStart = false;
|
|
275
292
|
let isSelectionEnd = false;
|
|
276
293
|
if ('highlightedRange' in state && state.highlightedRange) {
|
|
@@ -288,6 +305,7 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
288
305
|
isFocusVisible: isFocusVisible,
|
|
289
306
|
isSelectionStart: isSelectionStart,
|
|
290
307
|
isSelectionEnd: isSelectionEnd,
|
|
308
|
+
isToday: istoday,
|
|
291
309
|
...states
|
|
292
310
|
}
|
|
293
311
|
});
|
|
@@ -303,13 +321,17 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
303
321
|
'data-selected': states.isSelected || undefined,
|
|
304
322
|
'data-selection-start': isSelectionStart || undefined,
|
|
305
323
|
'data-selection-end': isSelectionEnd || undefined,
|
|
306
|
-
'data-invalid': states.isInvalid || undefined
|
|
324
|
+
'data-invalid': states.isInvalid || undefined,
|
|
325
|
+
'data-today': istoday || undefined
|
|
307
326
|
};
|
|
327
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(otherProps, {
|
|
328
|
+
global: true
|
|
329
|
+
});
|
|
308
330
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("td", {
|
|
309
331
|
...cellProps,
|
|
310
332
|
ref: ref
|
|
311
333
|
}, /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
312
|
-
...(0, $dCiKx$mergeProps)(
|
|
334
|
+
...(0, $dCiKx$mergeProps)(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps),
|
|
313
335
|
ref: buttonRef
|
|
314
336
|
}));
|
|
315
337
|
});
|
package/dist/Calendar.module.js
CHANGED
|
@@ -2,8 +2,8 @@ import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Butt
|
|
|
2
2
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
3
3
|
import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.module.js";
|
|
4
4
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
5
|
-
import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing
|
|
6
|
-
import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
|
|
5
|
+
import {useLocale as $dCiKx$useLocale, useCalendar as $dCiKx$useCalendar, mergeProps as $dCiKx$mergeProps, VisuallyHidden as $dCiKx$VisuallyHidden, useRangeCalendar as $dCiKx$useRangeCalendar, useCalendarGrid as $dCiKx$useCalendarGrid, useCalendarCell as $dCiKx$useCalendarCell, useHover as $dCiKx$useHover, useFocusRing as $dCiKx$useFocusRing} from "react-aria";
|
|
6
|
+
import {createCalendar as $dCiKx$createCalendar, endOfMonth as $dCiKx$endOfMonth, isSameMonth as $dCiKx$isSameMonth, isToday as $dCiKx$isToday, isSameDay as $dCiKx$isSameDay} from "@internationalized/date";
|
|
7
7
|
import {useCalendarState as $dCiKx$useCalendarState, useRangeCalendarState as $dCiKx$useRangeCalendarState} from "react-stately";
|
|
8
8
|
import {filterDOMProps as $dCiKx$filterDOMProps} from "@react-aria/utils";
|
|
9
9
|
import $dCiKx$react, {createContext as $dCiKx$createContext, forwardRef as $dCiKx$forwardRef, useContext as $dCiKx$useContext, useRef as $dCiKx$useRef} from "react";
|
|
@@ -49,9 +49,11 @@ const $dfd62f934fc76fed$export$e1aef45b828286de = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
49
49
|
},
|
|
50
50
|
defaultClassName: 'react-aria-Calendar'
|
|
51
51
|
});
|
|
52
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
53
|
+
global: true
|
|
54
|
+
});
|
|
52
55
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
53
|
-
...renderProps,
|
|
54
|
-
...calendarProps,
|
|
56
|
+
...(0, $dCiKx$mergeProps)(DOMProps, renderProps, calendarProps),
|
|
55
57
|
ref: ref,
|
|
56
58
|
slot: props.slot || undefined,
|
|
57
59
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -117,9 +119,11 @@ const $dfd62f934fc76fed$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
117
119
|
},
|
|
118
120
|
defaultClassName: 'react-aria-RangeCalendar'
|
|
119
121
|
});
|
|
122
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
123
|
+
global: true
|
|
124
|
+
});
|
|
120
125
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
121
|
-
...renderProps,
|
|
122
|
-
...calendarProps,
|
|
126
|
+
...(0, $dCiKx$mergeProps)(renderProps, DOMProps, calendarProps),
|
|
123
127
|
ref: ref,
|
|
124
128
|
slot: props.slot || undefined,
|
|
125
129
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -184,6 +188,9 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
184
188
|
weekdayStyle: props.weekdayStyle,
|
|
185
189
|
firstDayOfWeek: firstDayOfWeek
|
|
186
190
|
}, state);
|
|
191
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
192
|
+
global: true
|
|
193
|
+
});
|
|
187
194
|
var _props_className;
|
|
188
195
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$var$InternalCalendarGridContext.Provider, {
|
|
189
196
|
value: {
|
|
@@ -193,19 +200,21 @@ const $dfd62f934fc76fed$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
193
200
|
weeksInMonth: weeksInMonth
|
|
194
201
|
}
|
|
195
202
|
}, /*#__PURE__*/ (0, $dCiKx$react).createElement("table", {
|
|
196
|
-
...(0, $dCiKx$
|
|
197
|
-
...gridProps,
|
|
203
|
+
...(0, $dCiKx$mergeProps)(DOMProps, gridProps),
|
|
198
204
|
ref: ref,
|
|
199
205
|
style: props.style,
|
|
206
|
+
cellPadding: 0,
|
|
200
207
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-CalendarGrid'
|
|
201
208
|
}, typeof props.children !== 'function' ? props.children : /*#__PURE__*/ (0, $dCiKx$react).createElement((0, $dCiKx$react).Fragment, null, /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$22e2d15eaa4d2377, null, (day)=>/*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$ad2135cac3a11b3d, null, day)), /*#__PURE__*/ (0, $dCiKx$react).createElement($dfd62f934fc76fed$export$e11f8ba65d857bff, null, props.children))));
|
|
202
209
|
});
|
|
203
210
|
function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
|
|
204
211
|
let { children: children, style: style, className: className } = props;
|
|
205
212
|
let { headerProps: headerProps, weekDays: weekDays } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
|
|
213
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
214
|
+
global: true
|
|
215
|
+
});
|
|
206
216
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("thead", {
|
|
207
|
-
...(0, $dCiKx$
|
|
208
|
-
...headerProps,
|
|
217
|
+
...(0, $dCiKx$mergeProps)(DOMProps, headerProps),
|
|
209
218
|
ref: ref,
|
|
210
219
|
style: style,
|
|
211
220
|
className: className || 'react-aria-CalendarGridHeader'
|
|
@@ -218,8 +227,11 @@ function $dfd62f934fc76fed$var$CalendarGridHeader(props, ref) {
|
|
|
218
227
|
*/ const $dfd62f934fc76fed$export$22e2d15eaa4d2377 = /*#__PURE__*/ (0, $dCiKx$forwardRef)($dfd62f934fc76fed$var$CalendarGridHeader);
|
|
219
228
|
function $dfd62f934fc76fed$var$CalendarHeaderCell(props, ref) {
|
|
220
229
|
let { children: children, style: style, className: className } = props;
|
|
230
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
231
|
+
global: true
|
|
232
|
+
});
|
|
221
233
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("th", {
|
|
222
|
-
...
|
|
234
|
+
...DOMProps,
|
|
223
235
|
ref: ref,
|
|
224
236
|
style: style,
|
|
225
237
|
className: className || 'react-aria-CalendarHeaderCell'
|
|
@@ -234,8 +246,11 @@ function $dfd62f934fc76fed$var$CalendarGridBody(props, ref) {
|
|
|
234
246
|
let rangeCalendarState = (0, $dCiKx$useContext)($dfd62f934fc76fed$export$5e0fc348c00f87a0);
|
|
235
247
|
let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
|
|
236
248
|
let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext);
|
|
249
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(props, {
|
|
250
|
+
global: true
|
|
251
|
+
});
|
|
237
252
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("tbody", {
|
|
238
|
-
...
|
|
253
|
+
...DOMProps,
|
|
239
254
|
ref: ref,
|
|
240
255
|
style: style,
|
|
241
256
|
className: className || 'react-aria-CalendarGridBody'
|
|
@@ -260,9 +275,12 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
260
275
|
let { startDate: currentMonth } = (_useContext = (0, $dCiKx$useContext)($dfd62f934fc76fed$var$InternalCalendarGridContext)) !== null && _useContext !== void 0 ? _useContext : {
|
|
261
276
|
startDate: state.visibleRange.start
|
|
262
277
|
};
|
|
278
|
+
let isOutsideMonth = !(0, $dCiKx$isSameMonth)(currentMonth, date);
|
|
279
|
+
let istoday = (0, $dCiKx$isToday)(date, state.timeZone);
|
|
263
280
|
let buttonRef = (0, $dCiKx$useRef)(null);
|
|
264
281
|
let { cellProps: cellProps, buttonProps: buttonProps, ...states } = (0, $dCiKx$useCalendarCell)({
|
|
265
|
-
date: date
|
|
282
|
+
date: date,
|
|
283
|
+
isOutsideMonth: isOutsideMonth
|
|
266
284
|
}, state, buttonRef);
|
|
267
285
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dCiKx$useHover)({
|
|
268
286
|
...otherProps,
|
|
@@ -270,7 +288,6 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
270
288
|
});
|
|
271
289
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $dCiKx$useFocusRing)();
|
|
272
290
|
isFocusVisible && (isFocusVisible = states.isFocused);
|
|
273
|
-
let isOutsideMonth = !(0, $dCiKx$isSameMonth)(currentMonth, date);
|
|
274
291
|
let isSelectionStart = false;
|
|
275
292
|
let isSelectionEnd = false;
|
|
276
293
|
if ('highlightedRange' in state && state.highlightedRange) {
|
|
@@ -288,6 +305,7 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
288
305
|
isFocusVisible: isFocusVisible,
|
|
289
306
|
isSelectionStart: isSelectionStart,
|
|
290
307
|
isSelectionEnd: isSelectionEnd,
|
|
308
|
+
isToday: istoday,
|
|
291
309
|
...states
|
|
292
310
|
}
|
|
293
311
|
});
|
|
@@ -303,13 +321,17 @@ const $dfd62f934fc76fed$export$5d847498420df57b = /*#__PURE__*/ (0, $dCiKx$forwa
|
|
|
303
321
|
'data-selected': states.isSelected || undefined,
|
|
304
322
|
'data-selection-start': isSelectionStart || undefined,
|
|
305
323
|
'data-selection-end': isSelectionEnd || undefined,
|
|
306
|
-
'data-invalid': states.isInvalid || undefined
|
|
324
|
+
'data-invalid': states.isInvalid || undefined,
|
|
325
|
+
'data-today': istoday || undefined
|
|
307
326
|
};
|
|
327
|
+
let DOMProps = (0, $dCiKx$filterDOMProps)(otherProps, {
|
|
328
|
+
global: true
|
|
329
|
+
});
|
|
308
330
|
return /*#__PURE__*/ (0, $dCiKx$react).createElement("td", {
|
|
309
331
|
...cellProps,
|
|
310
332
|
ref: ref
|
|
311
333
|
}, /*#__PURE__*/ (0, $dCiKx$react).createElement("div", {
|
|
312
|
-
...(0, $dCiKx$mergeProps)(
|
|
334
|
+
...(0, $dCiKx$mergeProps)(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps),
|
|
313
335
|
ref: buttonRef
|
|
314
336
|
}));
|
|
315
337
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,qBAAa;IACvD;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe,qBAAE,iBAAiB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO;IAErG,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU,IAAI;YAChC,WAAW,MAAM,cAAc;QACjC;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,WAAW;QACd,GAAG,aAAa;QACjB,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,cAAc,IAAI;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aAAa,IAAI;QAC5C,iBAAiB,OAAO,UAAU,IAAI;QACtC,sBAAsB,kBAAkB;QACxC,8BAA8B,OAAO,qBAAqB,IAAI;QAC9D,sBAAsB,kBAAkB;QACxC,iBAAiB,OAAO,UAAU,IAAI;QACtC,wBAAwB,oBAAoB;QAC5C,sBAAsB,kBAAkB;QACxC,gBAAgB,OAAO,SAAS,IAAI;IACtC;IAEA,qBACE,gCAAC;QAAI,GAAG,SAAS;QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,aAAoB,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGhI","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n return (\n <div\n {...renderProps}\n {...calendarProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...filterDOMProps(props as any)}\n {...gridProps}\n ref={ref}\n style={props.style}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n\n return (\n <thead\n {...filterDOMProps(props as any)}\n {...headerProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n return (\n <th\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n\n return (\n <tbody\n {...filterDOMProps(props as any)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined\n };\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(filterDOMProps(otherProps as any), buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA+EM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AACxF,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAyD;AAClG,MAAM,0DAAuB,CAAA,GAAA,oBAAY,EAAwB;AACjE,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAA6B;AAK3E,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA8B,KAAuB,EAAE,GAAiC;IACpK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uBAAe,EAAE;QAC3B,GAAG,KAAK;gBACR;QACA,gBAAgB,MAAM,cAAc,IAAI,CAAA,GAAA,qBAAa;IACvD;IAEA,IAAI,iBAAC,aAAa,mBAAE,eAAe,mBAAE,eAAe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QAAE,KAAK;qBACtB,gCAAC;QAAK,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,YAAY,YAAY,WAAW,YAAY;QAAE,KAAK;;AAGvG","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n AriaCalendarProps,\n AriaRangeCalendarProps,\n DateValue,\n mergeProps,\n useCalendar,\n useCalendarCell,\n useCalendarGrid,\n useFocusRing,\n useHover,\n useLocale,\n useRangeCalendar,\n VisuallyHidden\n} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarDate, CalendarIdentifier, createCalendar, DateDuration, endOfMonth, Calendar as ICalendar, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarState} from 'react-stately';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {DOMAttributes, FocusableElement, forwardRefType, GlobalDOMAttributes, HoverEvents} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {HeadingContext} from './RSPContexts';\nimport React, {createContext, ForwardedRef, forwardRef, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface CalendarRenderProps {\n /**\n * Whether the calendar is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the calendar.\n */\n state: CalendarState,\n /**\n * Whether the calendar is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n /**\n * State of the range calendar.\n */\n state: RangeCalendarState\n}\n\nexport interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The amount of days that will be displayed at once. This affects how pagination works.\n * @default {months: 1}\n */\n visibleDuration?: DateDuration,\n\n /**\n * A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html)\n * object for a given calendar identifier. If not provided, the `createCalendar` function\n * from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar\n}\n\nexport const CalendarContext = createContext<ContextValue<CalendarProps<any>, HTMLDivElement>>(null);\nexport const RangeCalendarContext = createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState | null>(null);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<T extends DateValue>(props: CalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CalendarContext);\n let {locale} = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(props, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-Calendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [CalendarStateContext, state],\n [CalendarContext, props as CalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<T extends DateValue>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n let {locale} = useLocale();\n let state = useRangeCalendarState({\n ...props,\n locale,\n createCalendar: props.createCalendar || createCalendar\n });\n\n let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useRangeCalendar(\n props,\n state,\n ref\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isValueInvalid\n },\n defaultClassName: 'react-aria-RangeCalendar'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(renderProps, DOMProps, calendarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={state.isValueInvalid || undefined}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n previous: prevButtonProps,\n next: nextButtonProps\n }\n }],\n [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n [RangeCalendarStateContext, state],\n [RangeCalendarContext, props as RangeCalendarProps<any>],\n [TextContext, {\n slots: {\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {/* Add a screen reader only description of the entire visible range rather than\n * a separate heading above each month grid. This is placed first in the DOM order\n * so that it is the first thing a touch screen reader user encounters.\n * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n * elements, so the aria-label of the Calendar is included here as well. */}\n <VisuallyHidden>\n <h2>{calendarProps['aria-label']}</h2>\n </VisuallyHidden>\n {renderProps.children}\n {/* For touch screen readers, add a visually hidden next button after the month grid\n * so it's easy to navigate after reaching the end without going all the way\n * back to the start of the month. */}\n <VisuallyHidden>\n <button\n aria-label={nextButtonProps['aria-label']}\n disabled={nextButtonProps.isDisabled}\n onClick={() => state.focusNextPage()}\n tabIndex={-1} />\n </VisuallyHidden>\n </Provider>\n </div>\n );\n});\n\nexport interface CalendarCellRenderProps {\n /** The date that the cell represents. */\n date: CalendarDate,\n /** The day number formatted according to the current locale. */\n formattedDate: string,\n /**\n * Whether the cell is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the cell is currently being pressed.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the cell is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the cell is the first date in a range selection.\n * @selector [data-selection-start]\n */\n isSelectionStart: boolean,\n /**\n * Whether the cell is the last date in a range selection.\n * @selector [data-selection-end]\n */\n isSelectionEnd: boolean,\n /**\n * Whether the cell is focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the cell is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and `isDisabled` props.\n * Disabled dates are not focusable, and cannot be selected by the user. They are typically\n * displayed with a dimmed appearance.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the cell is outside the visible range of the calendar.\n * For example, dates before the first day of a month in the same week.\n * @selector [data-outside-visible-range]\n */\n isOutsideVisibleRange: boolean,\n /**\n * Whether the cell is outside the current month.\n * @selector [data-outside-month]\n */\n isOutsideMonth: boolean,\n /**\n * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop. Unavailable dates remain\n * focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they\n * are unavailable, such as a different color or a strikethrough.\n *\n * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n *\n * @selector [data-unavailable]\n */\n isUnavailable: boolean,\n /**\n * Whether the cell is part of an invalid selection.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the cell is today.\n * @selector [data-today]\n */\n isToday: boolean\n}\n\nexport interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {\n /**\n * Either a function to render calendar cells for each date in the month,\n * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n * when additional customization is needed.\n */\n children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement),\n /**\n * An offset from the beginning of the visible date range that this\n * CalendarGrid should display. Useful when displaying more than one\n * month at a time.\n */\n offset?: DateDuration,\n /**\n * The style of weekday names to display in the calendar grid header,\n * e.g. single letter, abbreviation, or full day name.\n * @default \"narrow\"\n */\n weekdayStyle?: 'narrow' | 'short' | 'long'\n}\n\ninterface InternalCalendarGridContextValue {\n headerProps: DOMAttributes<FocusableElement>,\n weekDays: string[],\n startDate: CalendarDate,\n weeksInMonth: number\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(props: CalendarGridProps, ref: ForwardedRef<HTMLTableElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let calenderProps = useSlottedContext(CalendarContext)!;\n let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n let state = calendarState ?? rangeCalendarState!;\n let startDate = state.visibleRange.start;\n if (props.offset) {\n startDate = startDate.add(props.offset);\n }\n\n let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid({\n startDate,\n endDate: endOfMonth(startDate),\n weekdayStyle: props.weekdayStyle,\n firstDayOfWeek\n }, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n <table\n {...mergeProps(DOMProps, gridProps)}\n ref={ref}\n style={props.style}\n cellPadding={0}\n className={props.className ?? 'react-aria-CalendarGrid'}>\n {typeof props.children !== 'function'\n ? props.children\n : (<>\n <CalendarGridHeaderForwardRef>\n {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n </CalendarGridHeaderForwardRef>\n <CalendarGridBodyForwardRef>\n {props.children}\n </CalendarGridBodyForwardRef>\n </>)\n }\n </table>\n </InternalCalendarGridContext.Provider>\n );\n});\n\nexport interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n children: (day: string) => ReactElement\n}\n\nfunction CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <thead\n {...mergeProps(DOMProps, headerProps)}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridHeader'}>\n <tr>\n {weekDays.map((day, key) => React.cloneElement(children(day), {key}))}\n </tr>\n </thead>\n );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {}\n\nfunction CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let {children, style, className} = props;\n let DOMProps = filterDOMProps(props, {global: true});\n return (\n <th\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarHeaderCell'}>\n {children}\n </th>\n );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {\n /** A function to render a `<CalendarCell>` for a given date. */\n children: (date: CalendarDate) => ReactElement\n}\n\nfunction CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTableSectionElement>) {\n let {children, style, className} = props;\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <tbody\n {...DOMProps}\n ref={ref}\n style={style}\n className={className || 'react-aria-CalendarGridBody'}>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state.getDatesInWeek(weekIndex, startDate).map((date, i) => (\n date\n ? React.cloneElement(children(date), {key: i})\n : <td key={i} />\n ))}\n </tr>\n ))}\n </tbody>\n );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {\n /** The date to render in the cell. */\n date: CalendarDate\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell({date, ...otherProps}: CalendarCellProps, ref: ForwardedRef<HTMLTableCellElement>) {\n let calendarState = useContext(CalendarStateContext);\n let rangeCalendarState = useContext(RangeCalendarStateContext);\n let state = calendarState ?? rangeCalendarState!;\n let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};\n let isOutsideMonth = !isSameMonth(currentMonth, date);\n let istoday = isToday(date, state.timeZone);\n\n let buttonRef = useRef<HTMLDivElement>(null);\n let {cellProps, buttonProps, ...states} = useCalendarCell(\n {date, isOutsideMonth},\n state,\n buttonRef\n );\n\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: states.isDisabled});\n let {focusProps, isFocusVisible} = useFocusRing();\n isFocusVisible &&= states.isFocused;\n let isSelectionStart = false;\n let isSelectionEnd = false;\n if ('highlightedRange' in state && state.highlightedRange) {\n isSelectionStart = isSameDay(date, state.highlightedRange.start);\n isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n }\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultChildren: states.formattedDate,\n defaultClassName: 'react-aria-CalendarCell',\n values: {\n date,\n isHovered,\n isOutsideMonth,\n isFocusVisible,\n isSelectionStart,\n isSelectionEnd,\n isToday: istoday,\n ...states\n }\n });\n\n let dataAttrs = {\n 'data-focused': states.isFocused || undefined,\n 'data-hovered': isHovered || undefined,\n 'data-pressed': states.isPressed || undefined,\n 'data-unavailable': states.isUnavailable || undefined,\n 'data-disabled': states.isDisabled || undefined,\n 'data-focus-visible': isFocusVisible || undefined,\n 'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n 'data-outside-month': isOutsideMonth || undefined,\n 'data-selected': states.isSelected || undefined,\n 'data-selection-start': isSelectionStart || undefined,\n 'data-selection-end': isSelectionEnd || undefined,\n 'data-invalid': states.isInvalid || undefined,\n 'data-today': istoday || undefined\n };\n\n let DOMProps = filterDOMProps(otherProps, {global: true});\n\n return (\n <td {...cellProps} ref={ref}>\n <div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />\n </td>\n );\n});\n"],"names":[],"version":3,"file":"Calendar.module.js.map"}
|
package/dist/Checkbox.main.js
CHANGED
|
@@ -70,9 +70,11 @@ const $e733553516d848a9$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, $72alD$react
|
|
|
70
70
|
},
|
|
71
71
|
defaultClassName: 'react-aria-CheckboxGroup'
|
|
72
72
|
});
|
|
73
|
+
let DOMProps = (0, $72alD$reactariautils.filterDOMProps)(props, {
|
|
74
|
+
global: true
|
|
75
|
+
});
|
|
73
76
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($72alD$react))).createElement("div", {
|
|
74
|
-
...groupProps,
|
|
75
|
-
...renderProps,
|
|
77
|
+
...(0, $72alD$reactaria.mergeProps)(DOMProps, renderProps, groupProps),
|
|
76
78
|
ref: ref,
|
|
77
79
|
slot: props.slot || undefined,
|
|
78
80
|
"data-readonly": state.isReadOnly || undefined,
|
|
@@ -155,8 +157,11 @@ const $e733553516d848a9$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, $72alD$react
|
|
|
155
157
|
isRequired: props.isRequired || false
|
|
156
158
|
}
|
|
157
159
|
});
|
|
158
|
-
let DOMProps = (0, $72alD$reactariautils.filterDOMProps)(props
|
|
160
|
+
let DOMProps = (0, $72alD$reactariautils.filterDOMProps)(props, {
|
|
161
|
+
global: true
|
|
162
|
+
});
|
|
159
163
|
delete DOMProps.id;
|
|
164
|
+
delete DOMProps.onClick;
|
|
160
165
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($72alD$react))).createElement("label", {
|
|
161
166
|
...(0, $72alD$reactaria.mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
|
|
162
167
|
ref: ref,
|