@cube-dev/ui-kit 0.161.0 → 0.163.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/CHANGELOG.md +74 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -2
- package/dist/components/actions/use-anchored-menu.js.map +1 -1
- package/dist/components/actions/use-context-menu.js +1 -2
- package/dist/components/actions/use-context-menu.js.map +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +28 -28
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -2
- package/dist/components/data/ItemTable/ItemTableToolbar.js.map +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +2 -2
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.d.ts +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +39 -23
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -2
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -4
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +31 -9
- package/dist/components/fields/RadioGroup/Radio.js +57 -14
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -3
- package/dist/components/fields/Slider/HueSlider.js.map +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/ColorSwatch.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -2
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +13 -43
- package/dist/components/other/Calendar/Calendar.js.map +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +10 -30
- package/dist/components/other/Calendar/CalendarCell.js.map +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +9 -5
- package/dist/components/other/Calendar/CalendarGrid.js.map +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +62 -0
- package/dist/components/other/Calendar/CalendarHeader.js.map +1 -0
- package/dist/components/other/Calendar/CalendarPanel.js +196 -0
- package/dist/components/other/Calendar/CalendarPanel.js.map +1 -0
- package/dist/components/other/Calendar/PeriodCalendar.js +160 -196
- package/dist/components/other/Calendar/PeriodCalendar.js.map +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +144 -0
- package/dist/components/other/Calendar/PeriodGrid.js.map +1 -0
- package/dist/components/other/Calendar/RangeCalendar.js +11 -40
- package/dist/components/other/Calendar/RangeCalendar.js.map +1 -1
- package/dist/components/other/Calendar/styled.js +64 -0
- package/dist/components/other/Calendar/styled.js.map +1 -0
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -2
- package/dist/components/overlays/Modal/Overlay.js.map +1 -1
- package/dist/components/overlays/Modal/Popover.js +11 -13
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -2
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +59 -30
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +2006 -1970
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.d.ts +6 -0
- package/dist/eslint-plugin/index.js +9 -5
- package/dist/eslint-plugin/index.js.map +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.d.ts +17 -0
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +17 -11
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js.map +1 -1
- package/dist/eslint-plugin/types.d.ts +22 -3
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +15 -2
- package/dist/i18n/locales/en-US/uikit.js +15 -2
- package/dist/i18n/locales/en-US/uikit.json.d.ts +14 -1
- package/dist/i18n/locales/es-ES/uikit.js +15 -2
- package/dist/i18n/locales/es-MX/uikit.js +15 -2
- package/dist/i18n/locales/fr-FR/uikit.js +15 -2
- package/dist/i18n/locales/it-IT/uikit.js +15 -2
- package/dist/i18n/locales/ja-JP/uikit.js +15 -2
- package/dist/i18n/locales/nb-NO/uikit.js +15 -2
- package/dist/i18n/locales/pt-BR/uikit.js +15 -2
- package/dist/i18n/locales/pt-PT/uikit.js +15 -2
- package/dist/i18n/locales/sv-SE/uikit.js +15 -2
- package/dist/i18n/locales/vi-VN/uikit.js +15 -2
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/fields/PeriodPicker.md +44 -4
- package/docs/components/fields/RadioGroup.md +39 -5
- package/docs/components/other/Calendar.md +187 -0
- package/package.json +4 -1
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
2
|
-
import { _Title } from "../../content/Title.js";
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.163.0 | Cube Dev Team */
|
|
3
2
|
import { useProviderProps } from "../../../provider.js";
|
|
4
|
-
import {
|
|
5
|
-
import { LeftIcon } from "../../../icons/LeftIcon.js";
|
|
6
|
-
import { RightIcon } from "../../../icons/RightIcon.js";
|
|
7
|
-
import { Button } from "../../actions/index.js";
|
|
8
|
-
import { CalendarGrid } from "./CalendarGrid.js";
|
|
9
|
-
import { tasty } from "@tenphi/tasty";
|
|
3
|
+
import { CalendarPanel } from "./CalendarPanel.js";
|
|
10
4
|
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
11
|
-
import { jsx
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
6
|
import { useCalendar, useLocale } from "react-aria";
|
|
13
7
|
import { createDOMRef } from "@react-spectrum/utils";
|
|
14
8
|
import { useCalendarState } from "react-stately";
|
|
15
9
|
import { createCalendar, startOfWeek, toCalendarDate } from "@internationalized/date";
|
|
16
10
|
|
|
17
11
|
//#region src/components/other/Calendar/Calendar.tsx
|
|
18
|
-
const CalendarElement = tasty({ styles: {
|
|
19
|
-
padding: "1x",
|
|
20
|
-
gap: "1x"
|
|
21
|
-
} });
|
|
22
|
-
const CalendarHeaderElement = tasty({ styles: {
|
|
23
|
-
display: "flex",
|
|
24
|
-
placeContent: "center space-between",
|
|
25
|
-
placeItems: "center",
|
|
26
|
-
gap: "1.5x"
|
|
27
|
-
} });
|
|
28
12
|
function Calendar(props, ref) {
|
|
29
13
|
props = useProviderProps(props);
|
|
30
14
|
let { locale } = useLocale();
|
|
@@ -49,30 +33,16 @@ function Calendar(props, ref) {
|
|
|
49
33
|
end: start.add({ days: 6 })
|
|
50
34
|
};
|
|
51
35
|
}
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
size: "xsmall",
|
|
63
|
-
...prevButtonProps,
|
|
64
|
-
icon: /* @__PURE__ */ jsx(LeftIcon, {})
|
|
65
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
66
|
-
"data-popover-keep": true,
|
|
67
|
-
size: "xsmall",
|
|
68
|
-
...nextButtonProps,
|
|
69
|
-
icon: /* @__PURE__ */ jsx(RightIcon, {})
|
|
70
|
-
})]
|
|
71
|
-
})] }), /* @__PURE__ */ jsx(CalendarGrid, {
|
|
72
|
-
state,
|
|
73
|
-
selectedRange,
|
|
74
|
-
pickerMode: props.pickerMode
|
|
75
|
-
})]
|
|
36
|
+
return /* @__PURE__ */ jsx(CalendarPanel, {
|
|
37
|
+
elementRef: domRef,
|
|
38
|
+
state,
|
|
39
|
+
title,
|
|
40
|
+
calendarProps,
|
|
41
|
+
prevButtonProps,
|
|
42
|
+
nextButtonProps,
|
|
43
|
+
hasMonthYearNavigation: props.hasMonthYearNavigation,
|
|
44
|
+
selectedRange,
|
|
45
|
+
pickerMode: props.pickerMode
|
|
76
46
|
});
|
|
77
47
|
}
|
|
78
48
|
const _Calendar = forwardRef(Calendar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","names":[
|
|
1
|
+
{"version":3,"file":"Calendar.js","names":[],"sources":["../../../../src/components/other/Calendar/Calendar.tsx"],"sourcesContent":["import {\n createCalendar,\n startOfWeek,\n toCalendarDate,\n} from '@internationalized/date';\nimport { createDOMRef } from '@react-spectrum/utils';\nimport { FocusableRef } from '@react-types/shared';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nimport {\n AriaCalendarProps,\n DateValue,\n useCalendar,\n useLocale,\n} from 'react-aria';\nimport { useCalendarState } from 'react-stately';\n\nimport { useProviderProps } from '../../../provider';\n\nimport { CalendarPanel } from './CalendarPanel';\nimport { CalendarCoreProps, CalendarValueProps } from './types';\n\nexport interface CubeCalendarProps\n extends AriaCalendarProps<DateValue>,\n CalendarCoreProps,\n CalendarValueProps {\n /** Highlights a range that lives outside the calendar's own state. */\n selectedRange?: {\n start: DateValue;\n end: DateValue;\n };\n /**\n * When set to `week`, the grid shows a leading week-number column and\n * highlights the whole week that the selected value belongs to.\n */\n pickerMode?: 'day' | 'week';\n}\n\nfunction Calendar(props: CubeCalendarProps, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let { locale } = useLocale();\n let state = useCalendarState({\n ...props,\n locale,\n createCalendar,\n });\n\n let domRef = useRef(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n state.setFocused(true);\n },\n }));\n\n let { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(\n props,\n state,\n );\n\n let selectedRange = props.selectedRange;\n if (props.pickerMode === 'week' && state.value) {\n let start = startOfWeek(toCalendarDate(state.value), locale);\n selectedRange = { start, end: start.add({ days: 6 }) };\n }\n\n return (\n <CalendarPanel\n elementRef={domRef}\n state={state}\n title={title}\n calendarProps={calendarProps}\n prevButtonProps={prevButtonProps}\n nextButtonProps={nextButtonProps}\n hasMonthYearNavigation={props.hasMonthYearNavigation}\n selectedRange={selectedRange}\n pickerMode={props.pickerMode}\n />\n );\n}\n\nconst _Calendar = forwardRef(Calendar);\n\n_Calendar.displayName = 'Calendar';\n\nexport { _Calendar as Calendar };\n"],"mappings":";;;;;;;;;;;AAqCA,SAAS,SAAS,OAA0B,KAAgC;AAC1E,SAAQ,iBAAiB,MAAM;CAE/B,IAAI,EAAE,WAAW,WAAW;CAC5B,IAAI,QAAQ,iBAAiB;EAC3B,GAAG;EACH;EACA;EACD,CAAC;CAEF,IAAI,SAAS,OAAO,KAAK;AACzB,qBAAoB,YAAY;EAC9B,GAAG,aAAa,OAAO;EACvB,QAAQ;AACN,SAAM,WAAW,KAAK;;EAEzB,EAAE;CAEH,IAAI,EAAE,eAAe,iBAAiB,iBAAiB,UAAU,YAC/D,OACA,MACD;CAED,IAAI,gBAAgB,MAAM;AAC1B,KAAI,MAAM,eAAe,UAAU,MAAM,OAAO;EAC9C,IAAI,QAAQ,YAAY,eAAe,MAAM,MAAM,EAAE,OAAO;AAC5D,kBAAgB;GAAE;GAAO,KAAK,MAAM,IAAI,EAAE,MAAM,GAAG,CAAC;GAAE;;AAGxD,QACE,oBAAC;EACC,YAAY;EACL;EACA;EACQ;EACE;EACA;EACjB,wBAAwB,MAAM;EACf;EACf,YAAY,MAAM;GAClB;;AAIN,MAAM,YAAY,WAAW,SAAS;AAEtC,UAAU,cAAc"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.163.0 | Cube Dev Team */
|
|
2
|
+
import { CALENDAR_CELL_STYLES } from "./styled.js";
|
|
2
3
|
import { tasty } from "@tenphi/tasty";
|
|
3
4
|
import { useRef } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { useCalendarCell } from "react-aria";
|
|
7
|
+
import { isSameDay } from "@internationalized/date";
|
|
6
8
|
|
|
7
9
|
//#region src/components/other/Calendar/CalendarCell.tsx
|
|
8
10
|
const CalendarCellElement = tasty({
|
|
9
11
|
as: "td",
|
|
10
12
|
styles: {
|
|
11
|
-
preset: "t3m",
|
|
12
13
|
margin: 0,
|
|
13
14
|
padding: "2bw right bottom"
|
|
14
15
|
}
|
|
@@ -16,46 +17,25 @@ const CalendarCellElement = tasty({
|
|
|
16
17
|
const CalendarButtonElement = tasty({
|
|
17
18
|
"data-popover-keep": true,
|
|
18
19
|
styles: {
|
|
19
|
-
|
|
20
|
-
placeItems: "center",
|
|
20
|
+
...CALENDAR_CELL_STYLES,
|
|
21
21
|
width: "3x",
|
|
22
|
-
height: "3x"
|
|
23
|
-
fill: {
|
|
24
|
-
"": "#primary.0",
|
|
25
|
-
":hover": "#primary.16",
|
|
26
|
-
rangeHover: "#primary.16",
|
|
27
|
-
pressed: "#primary.10",
|
|
28
|
-
selected: "#primary",
|
|
29
|
-
"selected & :hover": "#primary-text",
|
|
30
|
-
"selected & pressed": "#primary",
|
|
31
|
-
"disabled | unavailable": "#primary.0"
|
|
32
|
-
},
|
|
33
|
-
color: {
|
|
34
|
-
"": "#dark",
|
|
35
|
-
selected: "#white",
|
|
36
|
-
"disabled | unavailable": "#dark.30"
|
|
37
|
-
},
|
|
38
|
-
outline: {
|
|
39
|
-
"": "1bw #primary-text.0",
|
|
40
|
-
focused: "1bw #primary-text"
|
|
41
|
-
},
|
|
42
|
-
outlineOffset: .5,
|
|
43
|
-
radius: true,
|
|
44
|
-
cursor: "$pointer"
|
|
22
|
+
height: "3x"
|
|
45
23
|
}
|
|
46
24
|
});
|
|
47
|
-
function CalendarCell(
|
|
25
|
+
function CalendarCell(props) {
|
|
26
|
+
let { state, selectedRange, date, today, rangeHover } = props;
|
|
48
27
|
let ref = useRef(null);
|
|
49
28
|
let { cellProps, buttonProps, isSelected, isPressed, isFocused, isInvalid, isOutsideVisibleRange, isDisabled, isUnavailable, formattedDate } = useCalendarCell({ date }, state, ref);
|
|
50
|
-
const isFinalSelected = selectedRange ? date.compare(selectedRange.start) >= 0 && date.compare(selectedRange.end) <= 0 : isSelected;
|
|
29
|
+
const isFinalSelected = !isOutsideVisibleRange && (selectedRange ? date.compare(selectedRange.start) >= 0 && date.compare(selectedRange.end) <= 0 : isSelected);
|
|
51
30
|
return /* @__PURE__ */ jsx(CalendarCellElement, {
|
|
52
31
|
...cellProps,
|
|
53
32
|
children: /* @__PURE__ */ jsx(CalendarButtonElement, {
|
|
54
33
|
...buttonProps,
|
|
55
34
|
ref,
|
|
56
|
-
hidden: isOutsideVisibleRange,
|
|
57
35
|
mods: {
|
|
58
36
|
selected: isFinalSelected,
|
|
37
|
+
current: !!today && !isOutsideVisibleRange && isSameDay(date, today),
|
|
38
|
+
outside: isOutsideVisibleRange,
|
|
59
39
|
rangeHover: rangeHover && !isFinalSelected,
|
|
60
40
|
pressed: isPressed,
|
|
61
41
|
focused: isFocused,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarCell.js","names":[],"sources":["../../../../src/components/other/Calendar/CalendarCell.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { useRef } from 'react';\nimport { useCalendarCell } from 'react-aria';\n\nconst CalendarCellElement = tasty({\n as: 'td',\n styles: {\n
|
|
1
|
+
{"version":3,"file":"CalendarCell.js","names":[],"sources":["../../../../src/components/other/Calendar/CalendarCell.tsx"],"sourcesContent":["import { CalendarDate, isSameDay } from '@internationalized/date';\nimport { tasty } from '@tenphi/tasty';\nimport { useRef } from 'react';\nimport { DateValue, useCalendarCell } from 'react-aria';\nimport { CalendarState, RangeCalendarState } from 'react-stately';\n\nimport { CALENDAR_CELL_STYLES } from './styled';\n\nconst CalendarCellElement = tasty({\n as: 'td',\n styles: {\n margin: 0,\n padding: '2bw right bottom',\n },\n});\n\nconst CalendarButtonElement = tasty({\n 'data-popover-keep': true,\n styles: {\n ...CALENDAR_CELL_STYLES,\n width: '3x',\n height: '3x',\n },\n});\n\nexport interface CubeCalendarCellProps {\n state: CalendarState | RangeCalendarState;\n date: CalendarDate;\n /** Today, expressed in the calendar system of the grid. */\n today?: CalendarDate;\n /** Explicit range highlight, used when the range lives outside the state. */\n selectedRange?: { start: DateValue; end: DateValue };\n /** Whether the whole row is highlighted (week picker mode). */\n rangeHover?: boolean;\n}\n\nexport function CalendarCell(props: CubeCalendarCellProps) {\n let { state, selectedRange, date, today, rangeHover } = props;\n let ref = useRef(null);\n let {\n cellProps,\n buttonProps,\n isSelected,\n isPressed,\n isFocused,\n isInvalid,\n isOutsideVisibleRange,\n isDisabled,\n isUnavailable,\n formattedDate,\n } = useCalendarCell({ date }, state, ref);\n\n const isFinalSelected =\n !isOutsideVisibleRange &&\n (selectedRange\n ? date.compare(selectedRange.start) >= 0 &&\n date.compare(selectedRange.end) <= 0\n : isSelected);\n\n return (\n <CalendarCellElement {...cellProps}>\n <CalendarButtonElement\n {...buttonProps}\n ref={ref}\n mods={{\n selected: isFinalSelected,\n current: !!today && !isOutsideVisibleRange && isSameDay(date, today),\n outside: isOutsideVisibleRange,\n rangeHover: rangeHover && !isFinalSelected,\n pressed: isPressed,\n focused: isFocused,\n invalid: isInvalid,\n disabled: isDisabled,\n unavailable: isUnavailable,\n }}\n >\n {formattedDate}\n </CalendarButtonElement>\n </CalendarCellElement>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,sBAAsB,MAAM;CAChC,IAAI;CACJ,QAAQ;EACN,QAAQ;EACR,SAAS;EACV;CACF,CAAC;AAEF,MAAM,wBAAwB,MAAM;CAClC,qBAAqB;CACrB,QAAQ;EACN,GAAG;EACH,OAAO;EACP,QAAQ;EACT;CACF,CAAC;AAaF,SAAgB,aAAa,OAA8B;CACzD,IAAI,EAAE,OAAO,eAAe,MAAM,OAAO,eAAe;CACxD,IAAI,MAAM,OAAO,KAAK;CACtB,IAAI,EACF,WACA,aACA,YACA,WACA,WACA,WACA,uBACA,YACA,eACA,kBACE,gBAAgB,EAAE,MAAM,EAAE,OAAO,IAAI;CAEzC,MAAM,kBACJ,CAAC,0BACA,gBACG,KAAK,QAAQ,cAAc,MAAM,IAAI,KACrC,KAAK,QAAQ,cAAc,IAAI,IAAI,IACnC;AAEN,QACE,oBAAC;EAAoB,GAAI;YACvB,oBAAC;GACC,GAAI;GACC;GACL,MAAM;IACJ,UAAU;IACV,SAAS,CAAC,CAAC,SAAS,CAAC,yBAAyB,UAAU,MAAM,MAAM;IACpE,SAAS;IACT,YAAY,cAAc,CAAC;IAC3B,SAAS;IACT,SAAS;IACT,SAAS;IACT,UAAU;IACV,aAAa;IACd;aAEA;IACqB;GACJ"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.163.0 | Cube Dev Team */
|
|
2
2
|
import { getWeekNumber } from "../../fields/DatePicker/period.js";
|
|
3
3
|
import { CalendarCell } from "./CalendarCell.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
5
|
-
import { useState } from "react";
|
|
5
|
+
import { useMemo, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useCalendarGrid, useLocale } from "react-aria";
|
|
8
|
-
import { getWeeksInMonth } from "@internationalized/date";
|
|
8
|
+
import { getWeeksInMonth, toCalendar, today } from "@internationalized/date";
|
|
9
9
|
|
|
10
10
|
//#region src/components/other/Calendar/CalendarGrid.tsx
|
|
11
11
|
const TableElement = tasty({
|
|
12
12
|
as: "table",
|
|
13
13
|
styles: {
|
|
14
14
|
borderCollapse: "collapse",
|
|
15
|
+
borderSpacing: 0,
|
|
15
16
|
HeadRow: { color: "#dark-04" },
|
|
16
17
|
WeekNumber: {
|
|
17
18
|
preset: "t3m",
|
|
@@ -21,11 +22,13 @@ const TableElement = tasty({
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
function CalendarGrid(
|
|
25
|
+
function CalendarGrid(props) {
|
|
26
|
+
let { state, selectedRange, pickerMode = "day" } = props;
|
|
25
27
|
let { locale } = useLocale();
|
|
26
28
|
let { gridProps, headerProps, weekDays } = useCalendarGrid(props, state);
|
|
27
29
|
let weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale);
|
|
28
30
|
let showWeekNumbers = pickerMode === "week";
|
|
31
|
+
let today$1 = useMemo(() => toCalendar(today(state.timeZone), state.visibleRange.start.calendar), [state.timeZone, state.visibleRange.start.calendar]);
|
|
29
32
|
let [hoveredWeek, setHoveredWeek] = useState(null);
|
|
30
33
|
return /* @__PURE__ */ jsxs(TableElement, {
|
|
31
34
|
...gridProps,
|
|
@@ -53,7 +56,8 @@ function CalendarGrid({ state, pickerMode = "day", ...props }) {
|
|
|
53
56
|
}), datesInWeek.map((date, i) => date ? /* @__PURE__ */ jsx(CalendarCell, {
|
|
54
57
|
state,
|
|
55
58
|
date,
|
|
56
|
-
|
|
59
|
+
today: today$1,
|
|
60
|
+
selectedRange,
|
|
57
61
|
rangeHover: isRowHovered
|
|
58
62
|
}, i) : /* @__PURE__ */ jsx("td", {}, i))]
|
|
59
63
|
}, weekIndex);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarGrid.js","names":[],"sources":["../../../../src/components/other/Calendar/CalendarGrid.tsx"],"sourcesContent":["import { getWeeksInMonth
|
|
1
|
+
{"version":3,"file":"CalendarGrid.js","names":["today","getToday"],"sources":["../../../../src/components/other/Calendar/CalendarGrid.tsx"],"sourcesContent":["import {\n today as getToday,\n getWeeksInMonth,\n toCalendar,\n} from '@internationalized/date';\nimport { tasty } from '@tenphi/tasty';\nimport { useMemo, useState } from 'react';\nimport { DateValue, useCalendarGrid, useLocale } from 'react-aria';\nimport { CalendarState, RangeCalendarState } from 'react-stately';\n\nimport { getWeekNumber } from '../../fields/DatePicker/period';\n\nimport { CalendarCell } from './CalendarCell';\n\nconst TableElement = tasty({\n as: 'table',\n styles: {\n borderCollapse: 'collapse',\n borderSpacing: 0,\n\n HeadRow: {\n color: '#dark-04',\n },\n\n WeekNumber: {\n preset: 't3m',\n color: '#dark-04',\n textAlign: 'center',\n padding: '0 1x',\n },\n },\n});\n\nexport interface CubeCalendarGridProps {\n state: CalendarState | RangeCalendarState;\n /** Explicit range highlight, used when the range lives outside the state. */\n selectedRange?: { start: DateValue; end: DateValue };\n /**\n * When set to `week`, the grid shows a leading week-number column and\n * highlights the whole week under the pointer.\n */\n pickerMode?: 'day' | 'week';\n}\n\nexport function CalendarGrid(props: CubeCalendarGridProps) {\n let { state, selectedRange, pickerMode = 'day' } = props;\n let { locale } = useLocale();\n let { gridProps, headerProps, weekDays } = useCalendarGrid(props, state);\n\n // Get the number of weeks in the month, so we can render the proper number of rows.\n let weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale);\n let showWeekNumbers = pickerMode === 'week';\n\n let today = useMemo(\n () =>\n toCalendar(getToday(state.timeZone), state.visibleRange.start.calendar),\n [state.timeZone, state.visibleRange.start.calendar],\n );\n\n // In week mode, hovering any day highlights the whole week row.\n let [hoveredWeek, setHoveredWeek] = useState<number | null>(null);\n\n return (\n <TableElement {...gridProps}>\n <thead data-element=\"Head\" {...headerProps}>\n <tr data-element=\"HeadRow\">\n {showWeekNumbers && <th aria-hidden=\"true\" />}\n {weekDays.map((day, index) => (\n <th key={index}>{day}</th>\n ))}\n </tr>\n </thead>\n <tbody data-element=\"Body\">\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => {\n let datesInWeek = state.getDatesInWeek(weekIndex);\n let firstDate = datesInWeek.find(Boolean);\n let isRowHovered = showWeekNumbers && hoveredWeek === weekIndex;\n\n return (\n <tr\n key={weekIndex}\n data-element=\"Row\"\n onMouseEnter={\n showWeekNumbers ? () => setHoveredWeek(weekIndex) : undefined\n }\n onMouseLeave={\n showWeekNumbers ? () => setHoveredWeek(null) : undefined\n }\n >\n {showWeekNumbers && (\n <td data-element=\"WeekNumber\" aria-hidden=\"true\">\n {firstDate ? getWeekNumber(firstDate, locale) : ''}\n </td>\n )}\n {datesInWeek.map((date, i) =>\n date ? (\n <CalendarCell\n key={i}\n state={state}\n date={date}\n today={today}\n selectedRange={selectedRange}\n rangeHover={isRowHovered}\n />\n ) : (\n <td key={i} />\n ),\n )}\n </tr>\n );\n })}\n </tbody>\n </TableElement>\n );\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAM,eAAe,MAAM;CACzB,IAAI;CACJ,QAAQ;EACN,gBAAgB;EAChB,eAAe;EAEf,SAAS,EACP,OAAO,YACR;EAED,YAAY;GACV,QAAQ;GACR,OAAO;GACP,WAAW;GACX,SAAS;GACV;EACF;CACF,CAAC;AAaF,SAAgB,aAAa,OAA8B;CACzD,IAAI,EAAE,OAAO,eAAe,aAAa,UAAU;CACnD,IAAI,EAAE,WAAW,WAAW;CAC5B,IAAI,EAAE,WAAW,aAAa,aAAa,gBAAgB,OAAO,MAAM;CAGxE,IAAI,eAAe,gBAAgB,MAAM,aAAa,OAAO,OAAO;CACpE,IAAI,kBAAkB,eAAe;CAErC,IAAIA,UAAQ,cAER,WAAWC,MAAS,MAAM,SAAS,EAAE,MAAM,aAAa,MAAM,SAAS,EACzE,CAAC,MAAM,UAAU,MAAM,aAAa,MAAM,SAAS,CACpD;CAGD,IAAI,CAAC,aAAa,kBAAkB,SAAwB,KAAK;AAEjE,QACE,qBAAC;EAAa,GAAI;aAChB,oBAAC;GAAM,gBAAa;GAAO,GAAI;aAC7B,qBAAC;IAAG,gBAAa;eACd,mBAAmB,oBAAC,QAAG,eAAY,SAAS,EAC5C,SAAS,KAAK,KAAK,UAClB,oBAAC,kBAAgB,OAAR,MAAiB,CAC1B;KACC;IACC,EACR,oBAAC;GAAM,gBAAa;aACjB,CAAC,GAAG,IAAI,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC,KAAK,cAAc;IACtD,IAAI,cAAc,MAAM,eAAe,UAAU;IACjD,IAAI,YAAY,YAAY,KAAK,QAAQ;IACzC,IAAI,eAAe,mBAAmB,gBAAgB;AAEtD,WACE,qBAAC;KAEC,gBAAa;KACb,cACE,wBAAwB,eAAe,UAAU,GAAG;KAEtD,cACE,wBAAwB,eAAe,KAAK,GAAG;gBAGhD,mBACC,oBAAC;MAAG,gBAAa;MAAa,eAAY;gBACvC,YAAY,cAAc,WAAW,OAAO,GAAG;OAC7C,EAEN,YAAY,KAAK,MAAM,MACtB,OACE,oBAAC;MAEQ;MACD;MACN,OAAOD;MACQ;MACf,YAAY;QALP,EAML,GAEF,oBAAC,UAAQ,EAAK,CAEjB;OA3BI,UA4BF;KAEP;IACI;GACK"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.163.0 | Cube Dev Team */
|
|
2
|
+
import { _Title } from "../../content/Title.js";
|
|
3
|
+
import { Space } from "../../layout/Space.js";
|
|
4
|
+
import { LeftIcon } from "../../../icons/LeftIcon.js";
|
|
5
|
+
import { RightIcon } from "../../../icons/RightIcon.js";
|
|
6
|
+
import { Button } from "../../actions/index.js";
|
|
7
|
+
import { CalendarHeaderElement } from "./styled.js";
|
|
8
|
+
import { tasty } from "@tenphi/tasty";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/components/other/Calendar/CalendarHeader.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A heading that holds the view switcher. Its own preset matches the type scale
|
|
14
|
+
* of an `xsmall` button so the plain-title fallback (a decade range, or a
|
|
15
|
+
* calendar with navigation turned off) doesn't outweigh the interactive one.
|
|
16
|
+
*/
|
|
17
|
+
const CalendarTitleElement = tasty(_Title, {
|
|
18
|
+
level: 6,
|
|
19
|
+
preset: "t4",
|
|
20
|
+
styles: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
placeItems: "center",
|
|
23
|
+
gap: ".25x",
|
|
24
|
+
padding: {
|
|
25
|
+
"": "0 (1x - 1bw)",
|
|
26
|
+
interactive: 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const CalendarTitleButton = tasty(Button, {
|
|
31
|
+
"data-popover-keep": true,
|
|
32
|
+
type: "clear",
|
|
33
|
+
size: "xsmall"
|
|
34
|
+
});
|
|
35
|
+
function CalendarHeader(props) {
|
|
36
|
+
let { segments, title, prevButtonProps, nextButtonProps } = props;
|
|
37
|
+
return /* @__PURE__ */ jsxs(CalendarHeaderElement, { children: [/* @__PURE__ */ jsx(CalendarTitleElement, {
|
|
38
|
+
mods: { interactive: !!segments?.length },
|
|
39
|
+
children: segments?.length ? segments.map(({ key, label, onPress, isDisabled }) => /* @__PURE__ */ jsx(CalendarTitleButton, {
|
|
40
|
+
isDisabled,
|
|
41
|
+
onPress,
|
|
42
|
+
children: label
|
|
43
|
+
}, key)) : title
|
|
44
|
+
}), /* @__PURE__ */ jsxs(Space, {
|
|
45
|
+
gap: ".5x",
|
|
46
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
47
|
+
"data-popover-keep": true,
|
|
48
|
+
size: "xsmall",
|
|
49
|
+
...prevButtonProps,
|
|
50
|
+
icon: /* @__PURE__ */ jsx(LeftIcon, {})
|
|
51
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
52
|
+
"data-popover-keep": true,
|
|
53
|
+
size: "xsmall",
|
|
54
|
+
...nextButtonProps,
|
|
55
|
+
icon: /* @__PURE__ */ jsx(RightIcon, {})
|
|
56
|
+
})]
|
|
57
|
+
})] });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { CalendarHeader };
|
|
62
|
+
//# sourceMappingURL=CalendarHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarHeader.js","names":["Title"],"sources":["../../../../src/components/other/Calendar/CalendarHeader.tsx"],"sourcesContent":["import { tasty } from '@tenphi/tasty';\nimport { ReactNode } from 'react';\n\nimport { LeftIcon, RightIcon } from '../../../icons';\nimport { Button } from '../../actions';\nimport { Title } from '../../content/Title';\nimport { Space } from '../../layout/Space';\n\nimport { CalendarHeaderElement } from './styled';\n\nimport type { Props } from '../../../props';\n\n/**\n * A heading that holds the view switcher. Its own preset matches the type scale\n * of an `xsmall` button so the plain-title fallback (a decade range, or a\n * calendar with navigation turned off) doesn't outweigh the interactive one.\n */\nconst CalendarTitleElement = tasty(Title, {\n level: 6,\n preset: 't4',\n styles: {\n display: 'flex',\n placeItems: 'center',\n gap: '.25x',\n // Line the plain title up with the label inside a button.\n padding: {\n '': '0 (1x - 1bw)',\n interactive: 0,\n },\n },\n});\n\nconst CalendarTitleButton = tasty(Button, {\n 'data-popover-keep': true,\n type: 'clear',\n size: 'xsmall',\n});\n\nexport interface CubeCalendarHeaderSegment {\n key: string;\n label: string;\n onPress: () => void;\n isDisabled?: boolean;\n}\n\nexport interface CubeCalendarHeaderProps {\n /**\n * Interactive title segments (month / year). When omitted the header falls\n * back to a plain `title` — e.g. for a multi-month range.\n */\n segments?: CubeCalendarHeaderSegment[];\n title?: ReactNode;\n prevButtonProps?: Props;\n nextButtonProps?: Props;\n}\n\nexport function CalendarHeader(props: CubeCalendarHeaderProps) {\n let { segments, title, prevButtonProps, nextButtonProps } = props;\n\n return (\n <CalendarHeaderElement>\n <CalendarTitleElement mods={{ interactive: !!segments?.length }}>\n {segments?.length\n ? segments.map(({ key, label, onPress, isDisabled }) => (\n <CalendarTitleButton\n key={key}\n isDisabled={isDisabled}\n onPress={onPress}\n >\n {label}\n </CalendarTitleButton>\n ))\n : title}\n </CalendarTitleElement>\n <Space gap=\".5x\">\n <Button\n data-popover-keep\n size=\"xsmall\"\n {...prevButtonProps}\n icon={<LeftIcon />}\n />\n <Button\n data-popover-keep\n size=\"xsmall\"\n {...nextButtonProps}\n icon={<RightIcon />}\n />\n </Space>\n </CalendarHeaderElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,uBAAuB,MAAMA,QAAO;CACxC,OAAO;CACP,QAAQ;CACR,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,KAAK;EAEL,SAAS;GACP,IAAI;GACJ,aAAa;GACd;EACF;CACF,CAAC;AAEF,MAAM,sBAAsB,MAAM,QAAQ;CACxC,qBAAqB;CACrB,MAAM;CACN,MAAM;CACP,CAAC;AAoBF,SAAgB,eAAe,OAAgC;CAC7D,IAAI,EAAE,UAAU,OAAO,iBAAiB,oBAAoB;AAE5D,QACE,qBAAC,oCACC,oBAAC;EAAqB,MAAM,EAAE,aAAa,CAAC,CAAC,UAAU,QAAQ;YAC5D,UAAU,SACP,SAAS,KAAK,EAAE,KAAK,OAAO,SAAS,iBACnC,oBAAC;GAEa;GACH;aAER;KAJI,IAKe,CACtB,GACF;GACiB,EACvB,qBAAC;EAAM,KAAI;aACT,oBAAC;GACC;GACA,MAAK;GACL,GAAI;GACJ,MAAM,oBAAC,aAAW;IAClB,EACF,oBAAC;GACC;GACA,MAAK;GACL,GAAI;GACJ,MAAM,oBAAC,cAAY;IACnB;GACI,IACc"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.163.0 | Cube Dev Team */
|
|
2
|
+
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
|
+
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
|
+
import { CalendarElement } from "./styled.js";
|
|
5
|
+
import { CalendarGrid } from "./CalendarGrid.js";
|
|
6
|
+
import { CalendarHeader } from "./CalendarHeader.js";
|
|
7
|
+
import { PeriodGrid } from "./PeriodGrid.js";
|
|
8
|
+
import { useMemo, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useDateFormatter } from "react-aria";
|
|
11
|
+
import { endOfMonth, endOfYear, isSameMonth, startOfMonth, startOfYear, toCalendar, today } from "@internationalized/date";
|
|
12
|
+
|
|
13
|
+
//#region src/components/other/Calendar/CalendarPanel.tsx
|
|
14
|
+
/** The year grid shows a decade plus one adjacent year on either side. */
|
|
15
|
+
const YEAR_CELLS = 12;
|
|
16
|
+
const MONTH_COLUMNS = 3;
|
|
17
|
+
const YEAR_COLUMNS = 3;
|
|
18
|
+
/**
|
|
19
|
+
* Exactly as wide as seven day cells (`3x` cell + a `2bw` gutter), so switching
|
|
20
|
+
* between the day, month and year panels keeps the popover roughly in place.
|
|
21
|
+
*/
|
|
22
|
+
const PERIOD_GRID_STYLES = { width: "(7 * (3x + 2bw))" };
|
|
23
|
+
/**
|
|
24
|
+
* The body shared by `Calendar` and `RangeCalendar`: a header plus one of three
|
|
25
|
+
* panels. The month and year panels only *navigate* — they move the focused
|
|
26
|
+
* date and never select a value, so a range selection in progress survives a
|
|
27
|
+
* jump to another month.
|
|
28
|
+
*/
|
|
29
|
+
function CalendarPanel(props) {
|
|
30
|
+
const { t } = useI18n();
|
|
31
|
+
let { state, title, calendarProps, prevButtonProps, nextButtonProps, hasMonthYearNavigation = true, selectedRange, pickerMode, elementRef } = props;
|
|
32
|
+
let [view, setView] = useState("day");
|
|
33
|
+
let [anchor, setAnchor] = useState(state.focusedDate);
|
|
34
|
+
let visibleStart = state.visibleRange.start;
|
|
35
|
+
let calendar = visibleStart.calendar;
|
|
36
|
+
let timeZone = state.timeZone;
|
|
37
|
+
let calendarId = calendar.identifier;
|
|
38
|
+
let monthFormatter = useDateFormatter({
|
|
39
|
+
month: "long",
|
|
40
|
+
timeZone,
|
|
41
|
+
calendar: calendarId
|
|
42
|
+
});
|
|
43
|
+
let shortMonthFormatter = useDateFormatter({
|
|
44
|
+
month: "short",
|
|
45
|
+
timeZone,
|
|
46
|
+
calendar: calendarId
|
|
47
|
+
});
|
|
48
|
+
let yearFormatter = useDateFormatter({
|
|
49
|
+
year: "numeric",
|
|
50
|
+
timeZone,
|
|
51
|
+
calendar: calendarId
|
|
52
|
+
});
|
|
53
|
+
let todayDate = useMemo(() => toCalendar(today(timeZone), calendar), [timeZone, calendar]);
|
|
54
|
+
let format = (formatter, date) => formatter.format(date.toDate(timeZone));
|
|
55
|
+
/** Whether a whole period lies outside the calendar's allowed range. */
|
|
56
|
+
let isPeriodDisabled = (start, end) => state.isDisabled || state.minValue != null && end.compare(state.minValue) < 0 || state.maxValue != null && start.compare(state.maxValue) > 0;
|
|
57
|
+
let hasNavigation = hasMonthYearNavigation && isSameMonth(visibleStart, state.visibleRange.end);
|
|
58
|
+
let openView = (next) => {
|
|
59
|
+
setAnchor(state.focusedDate);
|
|
60
|
+
setView(next);
|
|
61
|
+
};
|
|
62
|
+
let onKeyDown = (e) => {
|
|
63
|
+
if (view !== "day" && e.key === "Escape") {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
setView("day");
|
|
67
|
+
state.setFocused(true);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
let header;
|
|
71
|
+
let body;
|
|
72
|
+
if (view === "month") {
|
|
73
|
+
let monthDate = (month) => startOfMonth(anchor.set({ month }));
|
|
74
|
+
let monthCount = calendar.getMonthsInYear(anchor);
|
|
75
|
+
let cells = Array.from({ length: monthCount }, (_, index) => {
|
|
76
|
+
let date = monthDate(index + 1);
|
|
77
|
+
return {
|
|
78
|
+
key: `month-${index + 1}`,
|
|
79
|
+
label: format(shortMonthFormatter, date),
|
|
80
|
+
isSelected: isSameMonth(date, visibleStart),
|
|
81
|
+
isCurrent: isSameMonth(date, todayDate),
|
|
82
|
+
isDisabled: isPeriodDisabled(date, endOfMonth(date))
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
let prevYear = anchor.subtract({ years: 1 });
|
|
86
|
+
let nextYear = anchor.add({ years: 1 });
|
|
87
|
+
header = /* @__PURE__ */ jsx(CalendarHeader, {
|
|
88
|
+
segments: [{
|
|
89
|
+
key: "year",
|
|
90
|
+
label: format(yearFormatter, anchor),
|
|
91
|
+
isDisabled: state.isDisabled,
|
|
92
|
+
onPress: () => setView("year")
|
|
93
|
+
}],
|
|
94
|
+
prevButtonProps: {
|
|
95
|
+
"aria-label": t("calendar.previousYear", "Previous year"),
|
|
96
|
+
isDisabled: isPeriodDisabled(startOfYear(prevYear), endOfYear(prevYear)),
|
|
97
|
+
onPress: () => setAnchor(prevYear)
|
|
98
|
+
},
|
|
99
|
+
nextButtonProps: {
|
|
100
|
+
"aria-label": t("calendar.nextYear", "Next year"),
|
|
101
|
+
isDisabled: isPeriodDisabled(startOfYear(nextYear), endOfYear(nextYear)),
|
|
102
|
+
onPress: () => setAnchor(nextYear)
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
body = /* @__PURE__ */ jsx(PeriodGrid, {
|
|
106
|
+
autoFocus: true,
|
|
107
|
+
"aria-label": t("calendar.months", "Months"),
|
|
108
|
+
cells,
|
|
109
|
+
styles: PERIOD_GRID_STYLES,
|
|
110
|
+
columns: MONTH_COLUMNS,
|
|
111
|
+
focusedIndex: anchor.month - 1,
|
|
112
|
+
onCellPress: (index) => {
|
|
113
|
+
state.setFocusedDate(anchor.set({ month: index + 1 }));
|
|
114
|
+
setView("day");
|
|
115
|
+
},
|
|
116
|
+
onCellFocus: (index) => setAnchor(anchor.set({ month: index + 1 })),
|
|
117
|
+
onMoveFocus: (delta) => setAnchor(anchor.add({ months: delta })),
|
|
118
|
+
onMovePage: (delta) => setAnchor(anchor.add({ years: delta }))
|
|
119
|
+
}, "month");
|
|
120
|
+
} else if (view === "year") {
|
|
121
|
+
let yearDate = (year) => startOfYear(anchor.set({ year }));
|
|
122
|
+
let decadeStart = Math.floor(anchor.year / 10) * 10;
|
|
123
|
+
let firstYear = decadeStart - 1;
|
|
124
|
+
let cells = Array.from({ length: YEAR_CELLS }, (_, index) => {
|
|
125
|
+
let year = firstYear + index;
|
|
126
|
+
let date = yearDate(year);
|
|
127
|
+
return {
|
|
128
|
+
key: `year-${year}`,
|
|
129
|
+
label: format(yearFormatter, date),
|
|
130
|
+
isSelected: year === visibleStart.year,
|
|
131
|
+
isCurrent: year === todayDate.year,
|
|
132
|
+
isOutside: year < decadeStart || year > decadeStart + 9,
|
|
133
|
+
isDisabled: isPeriodDisabled(date, endOfYear(date))
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
header = /* @__PURE__ */ jsx(CalendarHeader, {
|
|
137
|
+
title: `${format(yearFormatter, yearDate(decadeStart))} – ${format(yearFormatter, yearDate(decadeStart + 9))}`,
|
|
138
|
+
prevButtonProps: {
|
|
139
|
+
"aria-label": t("calendar.previousYears", "Previous years"),
|
|
140
|
+
isDisabled: isPeriodDisabled(yearDate(decadeStart - 10), endOfYear(yearDate(decadeStart - 1))),
|
|
141
|
+
onPress: () => setAnchor(anchor.subtract({ years: 10 }))
|
|
142
|
+
},
|
|
143
|
+
nextButtonProps: {
|
|
144
|
+
"aria-label": t("calendar.nextYears", "Next years"),
|
|
145
|
+
isDisabled: isPeriodDisabled(yearDate(decadeStart + 10), endOfYear(yearDate(decadeStart + 19))),
|
|
146
|
+
onPress: () => setAnchor(anchor.add({ years: 10 }))
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
body = /* @__PURE__ */ jsx(PeriodGrid, {
|
|
150
|
+
autoFocus: true,
|
|
151
|
+
"aria-label": t("calendar.years", "Years"),
|
|
152
|
+
cells,
|
|
153
|
+
styles: PERIOD_GRID_STYLES,
|
|
154
|
+
columns: YEAR_COLUMNS,
|
|
155
|
+
focusedIndex: anchor.year - firstYear,
|
|
156
|
+
onCellPress: (index) => {
|
|
157
|
+
setAnchor(anchor.set({ year: firstYear + index }));
|
|
158
|
+
setView("month");
|
|
159
|
+
},
|
|
160
|
+
onCellFocus: (index) => setAnchor(anchor.set({ year: firstYear + index })),
|
|
161
|
+
onMoveFocus: (delta) => setAnchor(anchor.add({ years: delta })),
|
|
162
|
+
onMovePage: (delta) => setAnchor(anchor.add({ years: delta * 10 }))
|
|
163
|
+
}, "year");
|
|
164
|
+
} else {
|
|
165
|
+
header = /* @__PURE__ */ jsx(CalendarHeader, {
|
|
166
|
+
title,
|
|
167
|
+
segments: hasNavigation ? [{
|
|
168
|
+
key: "month",
|
|
169
|
+
label: format(monthFormatter, visibleStart),
|
|
170
|
+
isDisabled: state.isDisabled,
|
|
171
|
+
onPress: () => openView("month")
|
|
172
|
+
}, {
|
|
173
|
+
key: "year",
|
|
174
|
+
label: format(yearFormatter, visibleStart),
|
|
175
|
+
isDisabled: state.isDisabled,
|
|
176
|
+
onPress: () => openView("year")
|
|
177
|
+
}] : void 0,
|
|
178
|
+
prevButtonProps,
|
|
179
|
+
nextButtonProps
|
|
180
|
+
});
|
|
181
|
+
body = /* @__PURE__ */ jsx(CalendarGrid, {
|
|
182
|
+
state,
|
|
183
|
+
selectedRange,
|
|
184
|
+
pickerMode
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ jsxs(CalendarElement, {
|
|
188
|
+
ref: elementRef,
|
|
189
|
+
...mergeProps$1(calendarProps, { onKeyDown }),
|
|
190
|
+
children: [header, body]
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
export { CalendarPanel };
|
|
196
|
+
//# sourceMappingURL=CalendarPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarPanel.js","names":["mergeProps"],"sources":["../../../../src/components/other/Calendar/CalendarPanel.tsx"],"sourcesContent":["import {\n CalendarDate,\n endOfMonth,\n endOfYear,\n isSameMonth,\n startOfMonth,\n startOfYear,\n toCalendar,\n today,\n} from '@internationalized/date';\nimport { KeyboardEvent, ReactElement, Ref, useMemo, useState } from 'react';\nimport { DateValue, useDateFormatter } from 'react-aria';\nimport { CalendarState, RangeCalendarState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n';\nimport { mergeProps } from '../../../utils/react';\n\nimport { CalendarGrid } from './CalendarGrid';\nimport { CalendarHeader } from './CalendarHeader';\nimport { CubePeriodGridCell, PeriodGrid } from './PeriodGrid';\nimport { CalendarElement } from './styled';\n\nimport type { Props } from '../../../props';\n\n/** Which panel the calendar currently shows. */\nexport type CubeCalendarView = 'day' | 'month' | 'year';\n\n/** The year grid shows a decade plus one adjacent year on either side. */\nconst YEAR_CELLS = 12;\nconst MONTH_COLUMNS = 3;\nconst YEAR_COLUMNS = 3;\n\n/**\n * Exactly as wide as seven day cells (`3x` cell + a `2bw` gutter), so switching\n * between the day, month and year panels keeps the popover roughly in place.\n */\nconst PERIOD_GRID_STYLES = { width: '(7 * (3x + 2bw))' } as const;\n\ninterface Formatter {\n format(date: Date): string;\n}\n\nexport interface CubeCalendarPanelProps {\n state: CalendarState | RangeCalendarState;\n /** The visible range title provided by React Aria. */\n title: string;\n calendarProps: Props;\n prevButtonProps: Props;\n nextButtonProps: Props;\n /**\n * Whether the header lets the user jump straight to a month or a year.\n * @default true\n */\n hasMonthYearNavigation?: boolean;\n selectedRange?: { start: DateValue; end: DateValue };\n pickerMode?: 'day' | 'week';\n elementRef?: Ref<HTMLElement>;\n}\n\n/**\n * The body shared by `Calendar` and `RangeCalendar`: a header plus one of three\n * panels. The month and year panels only *navigate* — they move the focused\n * date and never select a value, so a range selection in progress survives a\n * jump to another month.\n */\nexport function CalendarPanel(props: CubeCalendarPanelProps) {\n const { t } = useI18n();\n\n let {\n state,\n title,\n calendarProps,\n prevButtonProps,\n nextButtonProps,\n hasMonthYearNavigation = true,\n selectedRange,\n pickerMode,\n elementRef,\n } = props;\n\n let [view, setView] = useState<CubeCalendarView>('day');\n // The period the month / year panels navigate around. Seeded from the\n // focused date every time the user leaves the day panel.\n let [anchor, setAnchor] = useState<CalendarDate>(state.focusedDate);\n\n let visibleStart = state.visibleRange.start;\n let calendar = visibleStart.calendar;\n let timeZone = state.timeZone;\n let calendarId = calendar.identifier;\n\n let monthFormatter = useDateFormatter({\n month: 'long',\n timeZone,\n calendar: calendarId,\n });\n let shortMonthFormatter = useDateFormatter({\n month: 'short',\n timeZone,\n calendar: calendarId,\n });\n let yearFormatter = useDateFormatter({\n year: 'numeric',\n timeZone,\n calendar: calendarId,\n });\n\n let todayDate = useMemo(\n () => toCalendar(today(timeZone), calendar),\n [timeZone, calendar],\n );\n\n let format = (formatter: Formatter, date: CalendarDate) =>\n formatter.format(date.toDate(timeZone));\n\n /** Whether a whole period lies outside the calendar's allowed range. */\n let isPeriodDisabled = (start: CalendarDate, end: CalendarDate) =>\n state.isDisabled ||\n (state.minValue != null && end.compare(state.minValue) < 0) ||\n (state.maxValue != null && start.compare(state.maxValue) > 0);\n\n // A multi-month view has no single month or year to drill into.\n let hasNavigation =\n hasMonthYearNavigation && isSameMonth(visibleStart, state.visibleRange.end);\n\n let openView = (next: CubeCalendarView) => {\n setAnchor(state.focusedDate);\n setView(next);\n };\n\n let onKeyDown = (e: KeyboardEvent) => {\n // Step back to the day panel rather than closing the surrounding popover.\n if (view !== 'day' && e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n setView('day');\n // The grid the user was in is about to unmount. Claim focus for the day\n // cell, or it falls out of the popover and the next `Escape` is lost.\n state.setFocused(true);\n }\n };\n\n let header: ReactElement;\n let body: ReactElement;\n\n if (view === 'month') {\n let monthDate = (month: number) => startOfMonth(anchor.set({ month }));\n let monthCount = calendar.getMonthsInYear(anchor);\n\n let cells: CubePeriodGridCell[] = Array.from(\n { length: monthCount },\n (_, index) => {\n let date = monthDate(index + 1);\n\n return {\n key: `month-${index + 1}`,\n label: format(shortMonthFormatter, date),\n isSelected: isSameMonth(date, visibleStart),\n isCurrent: isSameMonth(date, todayDate),\n isDisabled: isPeriodDisabled(date, endOfMonth(date)),\n };\n },\n );\n\n let prevYear = anchor.subtract({ years: 1 });\n let nextYear = anchor.add({ years: 1 });\n\n header = (\n <CalendarHeader\n segments={[\n {\n key: 'year',\n label: format(yearFormatter, anchor),\n isDisabled: state.isDisabled,\n onPress: () => setView('year'),\n },\n ]}\n prevButtonProps={{\n 'aria-label': t('calendar.previousYear', 'Previous year'),\n isDisabled: isPeriodDisabled(\n startOfYear(prevYear),\n endOfYear(prevYear),\n ),\n onPress: () => setAnchor(prevYear),\n }}\n nextButtonProps={{\n 'aria-label': t('calendar.nextYear', 'Next year'),\n isDisabled: isPeriodDisabled(\n startOfYear(nextYear),\n endOfYear(nextYear),\n ),\n onPress: () => setAnchor(nextYear),\n }}\n />\n );\n\n body = (\n <PeriodGrid\n // Remount per view so focus follows the user into the new grid.\n key=\"month\"\n autoFocus\n aria-label={t('calendar.months', 'Months')}\n cells={cells}\n styles={PERIOD_GRID_STYLES}\n columns={MONTH_COLUMNS}\n focusedIndex={anchor.month - 1}\n onCellPress={(index) => {\n state.setFocusedDate(anchor.set({ month: index + 1 }));\n setView('day');\n }}\n onCellFocus={(index) => setAnchor(anchor.set({ month: index + 1 }))}\n onMoveFocus={(delta) => setAnchor(anchor.add({ months: delta }))}\n onMovePage={(delta) => setAnchor(anchor.add({ years: delta }))}\n />\n );\n } else if (view === 'year') {\n let yearDate = (year: number) => startOfYear(anchor.set({ year }));\n let decadeStart = Math.floor(anchor.year / 10) * 10;\n let firstYear = decadeStart - 1;\n\n let cells: CubePeriodGridCell[] = Array.from(\n { length: YEAR_CELLS },\n (_, index) => {\n let year = firstYear + index;\n let date = yearDate(year);\n\n return {\n key: `year-${year}`,\n label: format(yearFormatter, date),\n isSelected: year === visibleStart.year,\n isCurrent: year === todayDate.year,\n isOutside: year < decadeStart || year > decadeStart + 9,\n isDisabled: isPeriodDisabled(date, endOfYear(date)),\n };\n },\n );\n\n header = (\n <CalendarHeader\n title={`${format(yearFormatter, yearDate(decadeStart))} – ${format(\n yearFormatter,\n yearDate(decadeStart + 9),\n )}`}\n prevButtonProps={{\n 'aria-label': t('calendar.previousYears', 'Previous years'),\n isDisabled: isPeriodDisabled(\n yearDate(decadeStart - 10),\n endOfYear(yearDate(decadeStart - 1)),\n ),\n onPress: () => setAnchor(anchor.subtract({ years: 10 })),\n }}\n nextButtonProps={{\n 'aria-label': t('calendar.nextYears', 'Next years'),\n isDisabled: isPeriodDisabled(\n yearDate(decadeStart + 10),\n endOfYear(yearDate(decadeStart + 19)),\n ),\n onPress: () => setAnchor(anchor.add({ years: 10 })),\n }}\n />\n );\n\n body = (\n <PeriodGrid\n key=\"year\"\n autoFocus\n aria-label={t('calendar.years', 'Years')}\n cells={cells}\n styles={PERIOD_GRID_STYLES}\n columns={YEAR_COLUMNS}\n focusedIndex={anchor.year - firstYear}\n onCellPress={(index) => {\n setAnchor(anchor.set({ year: firstYear + index }));\n setView('month');\n }}\n onCellFocus={(index) =>\n setAnchor(anchor.set({ year: firstYear + index }))\n }\n onMoveFocus={(delta) => setAnchor(anchor.add({ years: delta }))}\n onMovePage={(delta) => setAnchor(anchor.add({ years: delta * 10 }))}\n />\n );\n } else {\n header = (\n <CalendarHeader\n title={title}\n segments={\n hasNavigation\n ? [\n {\n key: 'month',\n label: format(monthFormatter, visibleStart),\n isDisabled: state.isDisabled,\n onPress: () => openView('month'),\n },\n {\n key: 'year',\n label: format(yearFormatter, visibleStart),\n isDisabled: state.isDisabled,\n onPress: () => openView('year'),\n },\n ]\n : undefined\n }\n prevButtonProps={prevButtonProps}\n nextButtonProps={nextButtonProps}\n />\n );\n\n body = (\n <CalendarGrid\n state={state}\n selectedRange={selectedRange}\n pickerMode={pickerMode}\n />\n );\n }\n\n return (\n <CalendarElement\n ref={elementRef}\n {...mergeProps(calendarProps, { onKeyDown })}\n >\n {header}\n {body}\n </CalendarElement>\n );\n}\n"],"mappings":"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"}
|