carbon-react 162.12.0 → 162.14.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/esm/__internal__/character-count/character-count.style.js +1 -1
- package/esm/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/esm/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
- package/esm/__internal__/error-border/error-border.style.js +1 -1
- package/esm/__internal__/field-help/field-help.style.js +1 -1
- package/esm/__internal__/fieldset/__next__/fieldset.style.js +1 -1
- package/esm/__internal__/fieldset/fieldset.style.js +1 -1
- package/esm/__internal__/form-field/form-field.style.js +1 -1
- package/esm/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
- package/esm/__internal__/hint-text/hint-text.style.js +1 -1
- package/esm/__internal__/input/input-style-overrides.style.js +1 -1
- package/esm/__internal__/input/input.style.js +1 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/esm/__internal__/label/label.style.js +1 -1
- package/esm/__internal__/legacy-error-border/error-border.style.js +1 -1
- package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -1
- package/esm/__internal__/legacy-input/input-presentation.style.js +1 -1
- package/esm/__internal__/legacy-input/input.style.js +1 -1
- package/esm/__internal__/legacy-label/icon-wrapper.style.js +1 -1
- package/esm/__internal__/legacy-label/label.style.js +1 -1
- package/esm/__internal__/modal/modal.style.js +1 -1
- package/esm/__internal__/popover/popover.style.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
- package/esm/__internal__/popover-menu/popover-menu.component.js +1 -1
- package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -1
- package/esm/__internal__/validation-message/validation-message.style.js +1 -1
- package/esm/__internal__/validations/validation-icon.style.js +1 -1
- package/esm/components/accordion/accordion.style.js +1 -1
- package/esm/components/action-popover/action-popover.style.js +1 -1
- package/esm/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
- package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
- package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-navigation.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-section-divider.component.js +1 -1
- package/esm/components/badge/badge.style.js +1 -1
- package/esm/components/batch-selection/batch-selection.style.js +1 -1
- package/esm/components/box/box.style.js +1 -1
- package/esm/components/breadcrumbs/breadcrumbs.style.js +1 -1
- package/esm/components/breadcrumbs/crumb/crumb.style.js +1 -1
- package/esm/components/button/__next__/button.component.js +1 -1
- package/esm/components/button/__next__/button.style.d.ts +1 -0
- package/esm/components/button/__next__/button.style.js +1 -1
- package/esm/components/button/button.style.js +1 -1
- package/esm/components/button-bar/button-bar.style.js +1 -1
- package/esm/components/button-minor/button-minor.style.js +1 -1
- package/esm/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
- package/esm/components/button-toggle/button-toggle.style.js +1 -1
- package/esm/components/card/card-column/card-column.style.js +1 -1
- package/esm/components/card/card-footer/card-footer.style.js +1 -1
- package/esm/components/card/card-row/card-row.style.js +1 -1
- package/esm/components/card/card.style.js +1 -1
- package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
- package/esm/components/checkbox/checkbox.style.js +1 -1
- package/esm/components/confirm/confirm.style.js +1 -1
- package/esm/components/content/content.style.js +1 -1
- package/esm/components/date/__internal__/calendar/calendar-close-button.component.d.ts +7 -0
- package/esm/components/date/__internal__/calendar/calendar-close-button.component.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-close-button.style.d.ts +2 -0
- package/esm/components/date/__internal__/calendar/calendar-close-button.style.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-day-button.component.d.ts +5 -0
- package/esm/components/date/__internal__/calendar/calendar-day-button.component.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-navigation.component.d.ts +17 -0
- package/esm/components/date/__internal__/calendar/calendar-navigation.component.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-navigation.style.d.ts +2 -0
- package/esm/components/date/__internal__/calendar/calendar-navigation.style.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.component.d.ts +12 -0
- package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.component.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.style.d.ts +7 -0
- package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-select/index.d.ts +2 -0
- package/esm/components/date/__internal__/calendar/calendar-select/index.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-select/useCustomizableSelectMarkup.d.ts +3 -0
- package/esm/components/date/__internal__/calendar/calendar-select/useCustomizableSelectMarkup.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-weekday.component.d.ts +8 -0
- package/esm/components/date/__internal__/calendar/calendar-weekday.component.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar-weekday.style.d.ts +8 -0
- package/esm/components/date/__internal__/calendar/calendar-weekday.style.js +1 -0
- package/esm/components/date/__internal__/calendar/calendar.component.d.ts +21 -0
- package/esm/components/date/__internal__/calendar/calendar.component.js +1 -0
- package/esm/components/date/__internal__/date-picker/date-picker.component.d.ts +3 -42
- package/esm/components/date/__internal__/date-picker/date-picker.component.js +1 -1
- package/esm/components/date/__internal__/date-picker/date-picker.style.d.ts +6 -0
- package/esm/components/date/__internal__/date-picker/date-picker.style.js +1 -0
- package/esm/components/date/__internal__/date-picker/date-picker.types.d.ts +42 -0
- package/esm/components/date/__internal__/date-picker/date-picker.utils.d.ts +34 -0
- package/esm/components/date/__internal__/date-picker/date-picker.utils.js +1 -0
- package/esm/components/date/__internal__/date-picker/index.d.ts +2 -2
- package/esm/components/date/__internal__/date-picker/index.js +1 -1
- package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.component.d.ts +14 -0
- package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.component.js +1 -0
- package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.d.ts +23 -0
- package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -0
- package/esm/components/date/__internal__/hooks/focusDayWithPickerDescription.d.ts +8 -0
- package/esm/components/date/__internal__/hooks/focusDayWithPickerDescription.js +1 -0
- package/esm/components/date/__internal__/hooks/useDateInputState.d.ts +25 -0
- package/esm/components/date/__internal__/hooks/useDateInputState.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerFocus.d.ts +9 -0
- package/esm/components/date/__internal__/hooks/useDatePickerFocus.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerInFlatTable.d.ts +5 -0
- package/esm/components/date/__internal__/hooks/useDatePickerInFlatTable.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerKeyboardNavigation.d.ts +19 -0
- package/esm/components/date/__internal__/hooks/useDatePickerKeyboardNavigation.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerLocale.d.ts +12 -0
- package/esm/components/date/__internal__/hooks/useDatePickerLocale.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerMonthSync.d.ts +10 -0
- package/esm/components/date/__internal__/hooks/useDatePickerMonthSync.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerMonthYearSelection.d.ts +21 -0
- package/esm/components/date/__internal__/hooks/useDatePickerMonthYearSelection.js +1 -0
- package/esm/components/date/__internal__/hooks/useDatePickerState.d.ts +15 -0
- package/esm/components/date/__internal__/hooks/useDatePickerState.js +1 -0
- package/esm/components/date/__internal__/utils/date-input-value.utils.d.ts +34 -0
- package/esm/components/date/__internal__/utils/date-input-value.utils.js +1 -0
- package/esm/components/date/date.component.d.ts +16 -2
- package/esm/components/date/date.component.js +1 -1
- package/esm/components/date/date.style.d.ts +1 -1
- package/esm/components/date/date.style.js +1 -1
- package/esm/components/date-range/date-range.component.d.ts +16 -4
- package/esm/components/date-range/date-range.component.js +1 -1
- package/esm/components/date-range/date-range.style.js +1 -1
- package/esm/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
- package/esm/components/decimal/decimal.style.js +1 -1
- package/esm/components/definition-list/definition-list.style.js +1 -1
- package/esm/components/detail/detail.style.js +1 -1
- package/esm/components/dialog/__internal__/__next__/dialog.style.js +1 -1
- package/esm/components/dismissible-box/dismissible-box.style.js +1 -1
- package/esm/components/divider/divider.style.js +1 -1
- package/esm/components/draggable/draggable-item/draggable-item.style.js +1 -1
- package/esm/components/drawer/drawer.style.js +1 -1
- package/esm/components/duelling-picklist/duelling-picklist.style.js +1 -1
- package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
- package/esm/components/fieldset/fieldset.style.js +1 -1
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/esm/components/file-input/file-input.style.js +1 -1
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
- package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
- package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
- package/esm/components/flat-table/flat-table.style.js +1 -1
- package/esm/components/flat-table/sort/sort.style.js +1 -1
- package/esm/components/form/__internal__/form-summary.style.js +1 -1
- package/esm/components/form/form.style.js +1 -1
- package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
- package/esm/components/global-header/global-header.component.js +1 -1
- package/esm/components/grid/grid-container/grid-container.style.js +1 -1
- package/esm/components/grid/grid-item/grid-item.style.js +1 -1
- package/esm/components/heading/heading.style.js +1 -1
- package/esm/components/help/help.style.js +1 -1
- package/esm/components/hr/hr.style.js +1 -1
- package/esm/components/icon/icon.style.js +1 -1
- package/esm/components/icon-button/icon-button.style.js +1 -1
- package/esm/components/image/image.style.js +1 -1
- package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
- package/esm/components/link/link.style.js +1 -1
- package/esm/components/link-preview/__internal__/placeholder.component.js +1 -1
- package/esm/components/link-preview/link-preview.style.js +1 -1
- package/esm/components/loader/__next__/internal/star.style.js +1 -1
- package/esm/components/loader/__next__/loader.style.js +1 -1
- package/esm/components/loader/loader-square.style.js +1 -1
- package/esm/components/loader/loader.style.js +1 -1
- package/esm/components/loader-bar/loader-bar.style.js +1 -1
- package/esm/components/loader-spinner/loader-spinner.style.js +1 -1
- package/esm/components/loader-star/internal/star.style.js +1 -1
- package/esm/components/loader-star/loader-star.style.js +1 -1
- package/esm/components/menu/__internal__/submenu/submenu.style.js +1 -1
- package/esm/components/menu/menu-divider/menu-divider.style.js +1 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/esm/components/menu/menu-item/menu-item.style.js +1 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
- package/esm/components/menu/menu.style.js +1 -1
- package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/esm/components/message/message.style.js +1 -1
- package/esm/components/multi-action-button/__internal__/multi-action-button.context.d.ts +6 -0
- package/esm/components/multi-action-button/__internal__/multi-action-button.context.js +1 -0
- package/esm/components/multi-action-button/__internal__/tokens/index.d.ts +3 -0
- package/esm/components/multi-action-button/__internal__/tokens/index.js +1 -0
- package/esm/components/multi-action-button/index.d.ts +1 -0
- package/esm/components/multi-action-button/index.js +1 -1
- package/esm/components/multi-action-button/multi-action-button-divider/multi-action-button-divider.component.d.ts +2 -0
- package/esm/components/multi-action-button/multi-action-button-divider/multi-action-button-divider.component.js +1 -0
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +23 -3
- package/esm/components/multi-action-button/multi-action-button.component.js +1 -1
- package/esm/components/multi-action-button/multi-action-button.config.d.ts +1 -0
- package/esm/components/multi-action-button/multi-action-button.config.js +1 -1
- package/esm/components/multi-action-button/multi-action-button.style.d.ts +2 -9
- package/esm/components/multi-action-button/multi-action-button.style.js +1 -1
- package/esm/components/navigation-bar/navigation-bar.style.js +1 -1
- package/esm/components/note/note.style.js +1 -1
- package/esm/components/numeral-date/numeral-date.style.js +1 -1
- package/esm/components/option-tile/option-tile.style.js +1 -1
- package/esm/components/pager/__internal__/pagination-navigation.style.js +1 -1
- package/esm/components/pager/pager.style.js +1 -1
- package/esm/components/pages/page/page.style.js +1 -1
- package/esm/components/pages/pages.style.js +1 -1
- package/esm/components/password/password.style.js +1 -1
- package/esm/components/pill/pill.style.js +1 -1
- package/esm/components/pod/pod.style.js +1 -1
- package/esm/components/popover-container/popover-container.style.js +1 -1
- package/esm/components/portal/portal.js +1 -1
- package/esm/components/portal/portal.style.js +1 -1
- package/esm/components/portrait/portrait.style.js +1 -1
- package/esm/components/preview/preview.style.js +1 -1
- package/esm/components/profile/profile.style.js +1 -1
- package/esm/components/progress-tracker/progress-tracker.style.js +1 -1
- package/esm/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
- package/esm/components/radio-button/radio-button.style.js +1 -1
- package/esm/components/search/__internal__/results-announcement.component.js +1 -1
- package/esm/components/search/search.component.js +1 -1
- package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
- package/esm/components/select/__internal__/select-list/select-list.style.js +1 -1
- package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
- package/esm/components/select/__internal__/utils/matching-text.style.js +1 -1
- package/esm/components/select/multi-select/multi-select.style.js +1 -1
- package/esm/components/select/option/option.style.js +1 -1
- package/esm/components/select/option-group-header/option-group-header.style.js +1 -1
- package/esm/components/select/option-row/option-row.style.js +1 -1
- package/esm/components/select/select.style.js +1 -1
- package/esm/components/settings-row/settings-row.style.js +1 -1
- package/esm/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
- package/esm/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/esm/components/sidebar/sidebar.style.js +1 -1
- package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
- package/esm/components/simple-color-picker/simple-color-picker.style.js +1 -1
- package/esm/components/split-button/split-button-toggle.style.d.ts +1 -0
- package/esm/components/split-button/split-button-toggle.style.js +1 -1
- package/esm/components/split-button/split-button.style.js +1 -1
- package/esm/components/step-flow/step-flow.style.js +1 -1
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
- package/esm/components/step-sequence/step-sequence.style.js +1 -1
- package/esm/components/switch/switch.style.js +1 -1
- package/esm/components/tabs/__next__/tabs.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
- package/esm/components/text-editor/text-editor.style.js +1 -1
- package/esm/components/textarea/textarea.style.js +1 -1
- package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -1
- package/esm/components/tile/tile-footer/tile-footer.style.js +1 -1
- package/esm/components/tile/tile.style.js +1 -1
- package/esm/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
- package/esm/components/tile-select/tile-select.style.js +1 -1
- package/esm/components/time/time.style.js +1 -1
- package/esm/components/toast/toast.style.js +1 -1
- package/esm/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
- package/esm/components/tooltip/tooltip-pointer.style.js +1 -1
- package/esm/components/tooltip/tooltip.style.js +1 -1
- package/esm/components/typography/__internal__/__next__/typography.style.js +1 -1
- package/esm/components/typography/typography.style.js +1 -1
- package/esm/components/vertical-divider/vertical-divider.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
- package/esm/components/vertical-menu/vertical-menu.style.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/locales/en-gb.js +1 -1
- package/esm/locales/locale.d.ts +12 -0
- package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/lib/__internal__/character-count/character-count.style.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/lib/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
- package/lib/__internal__/error-border/error-border.style.js +1 -1
- package/lib/__internal__/field-help/field-help.style.js +1 -1
- package/lib/__internal__/fieldset/__next__/fieldset.style.js +1 -1
- package/lib/__internal__/fieldset/fieldset.style.js +1 -1
- package/lib/__internal__/form-field/form-field.style.js +1 -1
- package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
- package/lib/__internal__/hint-text/hint-text.style.js +1 -1
- package/lib/__internal__/input/input-style-overrides.style.js +1 -1
- package/lib/__internal__/input/input.style.js +1 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/lib/__internal__/label/label.style.js +1 -1
- package/lib/__internal__/legacy-error-border/error-border.style.js +1 -1
- package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -1
- package/lib/__internal__/legacy-input/input-presentation.style.js +1 -1
- package/lib/__internal__/legacy-input/input.style.js +1 -1
- package/lib/__internal__/legacy-label/icon-wrapper.style.js +1 -1
- package/lib/__internal__/legacy-label/label.style.js +1 -1
- package/lib/__internal__/modal/modal.style.js +1 -1
- package/lib/__internal__/popover/popover.style.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
- package/lib/__internal__/popover-menu/popover-menu.component.js +1 -1
- package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -1
- package/lib/__internal__/validation-message/validation-message.style.js +1 -1
- package/lib/__internal__/validations/validation-icon.style.js +1 -1
- package/lib/components/accordion/accordion.style.js +1 -1
- package/lib/components/action-popover/action-popover.style.js +1 -1
- package/lib/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
- package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
- package/lib/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-navigation.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-section-divider.component.js +1 -1
- package/lib/components/badge/badge.style.js +1 -1
- package/lib/components/batch-selection/batch-selection.style.js +1 -1
- package/lib/components/box/box.style.js +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.style.js +1 -1
- package/lib/components/breadcrumbs/crumb/crumb.style.js +1 -1
- package/lib/components/button/__next__/button.component.js +1 -1
- package/lib/components/button/__next__/button.style.d.ts +1 -0
- package/lib/components/button/__next__/button.style.js +1 -1
- package/lib/components/button/button.style.js +1 -1
- package/lib/components/button-bar/button-bar.style.js +1 -1
- package/lib/components/button-minor/button-minor.style.js +1 -1
- package/lib/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
- package/lib/components/button-toggle/button-toggle.style.js +1 -1
- package/lib/components/card/card-column/card-column.style.js +1 -1
- package/lib/components/card/card-footer/card-footer.style.js +1 -1
- package/lib/components/card/card-row/card-row.style.js +1 -1
- package/lib/components/card/card.style.js +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
- package/lib/components/checkbox/checkbox.style.js +1 -1
- package/lib/components/confirm/confirm.style.js +1 -1
- package/lib/components/content/content.style.js +1 -1
- package/lib/components/date/__internal__/calendar/calendar-close-button.component.d.ts +7 -0
- package/lib/components/date/__internal__/calendar/calendar-close-button.component.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-close-button.style.d.ts +2 -0
- package/lib/components/date/__internal__/calendar/calendar-close-button.style.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-day-button.component.d.ts +5 -0
- package/lib/components/date/__internal__/calendar/calendar-day-button.component.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-navigation.component.d.ts +17 -0
- package/lib/components/date/__internal__/calendar/calendar-navigation.component.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-navigation.style.d.ts +2 -0
- package/lib/components/date/__internal__/calendar/calendar-navigation.style.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.component.d.ts +12 -0
- package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.component.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.style.d.ts +7 -0
- package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-select/index.d.ts +2 -0
- package/lib/components/date/__internal__/calendar/calendar-select/index.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-select/package.json +5 -0
- package/lib/components/date/__internal__/calendar/calendar-select/useCustomizableSelectMarkup.d.ts +3 -0
- package/lib/components/date/__internal__/calendar/calendar-select/useCustomizableSelectMarkup.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-weekday.component.d.ts +8 -0
- package/lib/components/date/__internal__/calendar/calendar-weekday.component.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar-weekday.style.d.ts +8 -0
- package/lib/components/date/__internal__/calendar/calendar-weekday.style.js +1 -0
- package/lib/components/date/__internal__/calendar/calendar.component.d.ts +21 -0
- package/lib/components/date/__internal__/calendar/calendar.component.js +1 -0
- package/lib/components/date/__internal__/date-picker/date-picker.component.d.ts +3 -42
- package/lib/components/date/__internal__/date-picker/date-picker.component.js +1 -1
- package/lib/components/date/__internal__/date-picker/date-picker.style.d.ts +6 -0
- package/lib/components/date/__internal__/date-picker/date-picker.style.js +1 -0
- package/lib/components/date/__internal__/date-picker/date-picker.types.d.ts +42 -0
- package/lib/components/date/__internal__/date-picker/date-picker.utils.d.ts +34 -0
- package/lib/components/date/__internal__/date-picker/date-picker.utils.js +1 -0
- package/lib/components/date/__internal__/date-picker/index.d.ts +2 -2
- package/lib/components/date/__internal__/date-picker/index.js +1 -1
- package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.component.d.ts +14 -0
- package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.component.js +1 -0
- package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.d.ts +23 -0
- package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -0
- package/lib/components/date/__internal__/hooks/focusDayWithPickerDescription.d.ts +8 -0
- package/lib/components/date/__internal__/hooks/focusDayWithPickerDescription.js +1 -0
- package/lib/components/date/__internal__/hooks/useDateInputState.d.ts +25 -0
- package/lib/components/date/__internal__/hooks/useDateInputState.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerFocus.d.ts +9 -0
- package/lib/components/date/__internal__/hooks/useDatePickerFocus.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerInFlatTable.d.ts +5 -0
- package/lib/components/date/__internal__/hooks/useDatePickerInFlatTable.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerKeyboardNavigation.d.ts +19 -0
- package/lib/components/date/__internal__/hooks/useDatePickerKeyboardNavigation.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerLocale.d.ts +12 -0
- package/lib/components/date/__internal__/hooks/useDatePickerLocale.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerMonthSync.d.ts +10 -0
- package/lib/components/date/__internal__/hooks/useDatePickerMonthSync.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerMonthYearSelection.d.ts +21 -0
- package/lib/components/date/__internal__/hooks/useDatePickerMonthYearSelection.js +1 -0
- package/lib/components/date/__internal__/hooks/useDatePickerState.d.ts +15 -0
- package/lib/components/date/__internal__/hooks/useDatePickerState.js +1 -0
- package/lib/components/date/__internal__/utils/date-input-value.utils.d.ts +34 -0
- package/lib/components/date/__internal__/utils/date-input-value.utils.js +1 -0
- package/lib/components/date/date.component.d.ts +16 -2
- package/lib/components/date/date.component.js +1 -1
- package/lib/components/date/date.style.d.ts +1 -1
- package/lib/components/date/date.style.js +1 -1
- package/lib/components/date-range/date-range.component.d.ts +16 -4
- package/lib/components/date-range/date-range.component.js +1 -1
- package/lib/components/date-range/date-range.style.js +1 -1
- package/lib/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
- package/lib/components/decimal/decimal.style.js +1 -1
- package/lib/components/definition-list/definition-list.style.js +1 -1
- package/lib/components/detail/detail.style.js +1 -1
- package/lib/components/dialog/__internal__/__next__/dialog.style.js +1 -1
- package/lib/components/dismissible-box/dismissible-box.style.js +1 -1
- package/lib/components/divider/divider.style.js +1 -1
- package/lib/components/draggable/draggable-item/draggable-item.style.js +1 -1
- package/lib/components/drawer/drawer.style.js +1 -1
- package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
- package/lib/components/fieldset/fieldset.style.js +1 -1
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/lib/components/file-input/file-input.style.js +1 -1
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
- package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
- package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
- package/lib/components/flat-table/flat-table.style.js +1 -1
- package/lib/components/flat-table/sort/sort.style.js +1 -1
- package/lib/components/form/__internal__/form-summary.style.js +1 -1
- package/lib/components/form/form.style.js +1 -1
- package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
- package/lib/components/global-header/global-header.component.js +1 -1
- package/lib/components/grid/grid-container/grid-container.style.js +1 -1
- package/lib/components/grid/grid-item/grid-item.style.js +1 -1
- package/lib/components/heading/heading.style.js +1 -1
- package/lib/components/help/help.style.js +1 -1
- package/lib/components/hr/hr.style.js +1 -1
- package/lib/components/icon/icon.style.js +1 -1
- package/lib/components/icon-button/icon-button.style.js +1 -1
- package/lib/components/image/image.style.js +1 -1
- package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
- package/lib/components/link/link.style.js +1 -1
- package/lib/components/link-preview/__internal__/placeholder.component.js +1 -1
- package/lib/components/link-preview/link-preview.style.js +1 -1
- package/lib/components/loader/__next__/internal/star.style.js +1 -1
- package/lib/components/loader/__next__/loader.style.js +1 -1
- package/lib/components/loader/loader-square.style.js +1 -1
- package/lib/components/loader/loader.style.js +1 -1
- package/lib/components/loader-bar/loader-bar.style.js +1 -1
- package/lib/components/loader-spinner/loader-spinner.style.js +1 -1
- package/lib/components/loader-star/internal/star.style.js +1 -1
- package/lib/components/loader-star/loader-star.style.js +1 -1
- package/lib/components/menu/__internal__/submenu/submenu.style.js +1 -1
- package/lib/components/menu/menu-divider/menu-divider.style.js +1 -1
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/lib/components/menu/menu-item/menu-item.style.js +1 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
- package/lib/components/menu/menu.style.js +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/lib/components/message/message.style.js +1 -1
- package/lib/components/multi-action-button/__internal__/multi-action-button.context.d.ts +6 -0
- package/lib/components/multi-action-button/__internal__/multi-action-button.context.js +1 -0
- package/lib/components/multi-action-button/__internal__/tokens/index.d.ts +3 -0
- package/lib/components/multi-action-button/__internal__/tokens/index.js +1 -0
- package/lib/components/multi-action-button/__internal__/tokens/package.json +5 -0
- package/lib/components/multi-action-button/index.d.ts +1 -0
- package/lib/components/multi-action-button/index.js +1 -1
- package/lib/components/multi-action-button/multi-action-button-divider/multi-action-button-divider.component.d.ts +2 -0
- package/lib/components/multi-action-button/multi-action-button-divider/multi-action-button-divider.component.js +1 -0
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +23 -3
- package/lib/components/multi-action-button/multi-action-button.component.js +1 -1
- package/lib/components/multi-action-button/multi-action-button.config.d.ts +1 -0
- package/lib/components/multi-action-button/multi-action-button.config.js +1 -1
- package/lib/components/multi-action-button/multi-action-button.style.d.ts +2 -9
- package/lib/components/multi-action-button/multi-action-button.style.js +1 -1
- package/lib/components/navigation-bar/navigation-bar.style.js +1 -1
- package/lib/components/note/note.style.js +1 -1
- package/lib/components/numeral-date/numeral-date.style.js +1 -1
- package/lib/components/option-tile/option-tile.style.js +1 -1
- package/lib/components/pager/__internal__/pagination-navigation.style.js +1 -1
- package/lib/components/pager/pager.style.js +1 -1
- package/lib/components/pages/page/page.style.js +1 -1
- package/lib/components/pages/pages.style.js +1 -1
- package/lib/components/password/password.style.js +1 -1
- package/lib/components/pill/pill.style.js +1 -1
- package/lib/components/pod/pod.style.js +1 -1
- package/lib/components/popover-container/popover-container.style.js +1 -1
- package/lib/components/portal/portal.js +1 -1
- package/lib/components/portal/portal.style.js +1 -1
- package/lib/components/portrait/portrait.style.js +1 -1
- package/lib/components/preview/preview.style.js +1 -1
- package/lib/components/profile/profile.style.js +1 -1
- package/lib/components/progress-tracker/progress-tracker.style.js +1 -1
- package/lib/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
- package/lib/components/radio-button/radio-button.style.js +1 -1
- package/lib/components/search/__internal__/results-announcement.component.js +1 -1
- package/lib/components/search/search.component.js +1 -1
- package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
- package/lib/components/select/__internal__/select-list/select-list.style.js +1 -1
- package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
- package/lib/components/select/__internal__/utils/matching-text.style.js +1 -1
- package/lib/components/select/multi-select/multi-select.style.js +1 -1
- package/lib/components/select/option/option.style.js +1 -1
- package/lib/components/select/option-group-header/option-group-header.style.js +1 -1
- package/lib/components/select/option-row/option-row.style.js +1 -1
- package/lib/components/select/select.style.js +1 -1
- package/lib/components/settings-row/settings-row.style.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/lib/components/sidebar/sidebar.style.js +1 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
- package/lib/components/simple-color-picker/simple-color-picker.style.js +1 -1
- package/lib/components/split-button/split-button-toggle.style.d.ts +1 -0
- package/lib/components/split-button/split-button-toggle.style.js +1 -1
- package/lib/components/split-button/split-button.style.js +1 -1
- package/lib/components/step-flow/step-flow.style.js +1 -1
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
- package/lib/components/step-sequence/step-sequence.style.js +1 -1
- package/lib/components/switch/switch.style.js +1 -1
- package/lib/components/tabs/__next__/tabs.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
- package/lib/components/text-editor/text-editor.style.js +1 -1
- package/lib/components/textarea/textarea.style.js +1 -1
- package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -1
- package/lib/components/tile/tile-footer/tile-footer.style.js +1 -1
- package/lib/components/tile/tile.style.js +1 -1
- package/lib/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
- package/lib/components/tile-select/tile-select.style.js +1 -1
- package/lib/components/time/time.style.js +1 -1
- package/lib/components/toast/toast.style.js +1 -1
- package/lib/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
- package/lib/components/tooltip/tooltip-pointer.style.js +1 -1
- package/lib/components/tooltip/tooltip.style.js +1 -1
- package/lib/components/typography/__internal__/__next__/typography.style.js +1 -1
- package/lib/components/typography/typography.style.js +1 -1
- package/lib/components/vertical-divider/vertical-divider.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
- package/lib/components/vertical-menu/vertical-menu.style.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locales/en-gb.js +1 -1
- package/lib/locales/locale.d.ts +12 -0
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/package.json +1 -1
- package/esm/components/date/__internal__/date-picker/day-picker.style.d.ts +0 -4
- package/esm/components/date/__internal__/date-picker/day-picker.style.js +0 -1
- package/esm/components/date/__internal__/navbar/button.style.d.ts +0 -6
- package/esm/components/date/__internal__/navbar/button.style.js +0 -1
- package/esm/components/date/__internal__/navbar/index.d.ts +0 -2
- package/esm/components/date/__internal__/navbar/index.js +0 -1
- package/esm/components/date/__internal__/navbar/navbar.component.d.ts +0 -9
- package/esm/components/date/__internal__/navbar/navbar.component.js +0 -1
- package/esm/components/date/__internal__/navbar/navbar.style.d.ts +0 -2
- package/esm/components/date/__internal__/navbar/navbar.style.js +0 -1
- package/esm/components/date/__internal__/weekday/abbr.style.d.ts +0 -2
- package/esm/components/date/__internal__/weekday/abbr.style.js +0 -1
- package/esm/components/date/__internal__/weekday/index.d.ts +0 -2
- package/esm/components/date/__internal__/weekday/index.js +0 -1
- package/esm/components/date/__internal__/weekday/weekday.component.d.ts +0 -8
- package/esm/components/date/__internal__/weekday/weekday.component.js +0 -1
- package/esm/components/date/__internal__/weekday/weekday.style.d.ts +0 -2
- package/esm/components/date/__internal__/weekday/weekday.style.js +0 -1
- package/lib/components/date/__internal__/date-picker/day-picker.style.d.ts +0 -4
- package/lib/components/date/__internal__/date-picker/day-picker.style.js +0 -1
- package/lib/components/date/__internal__/navbar/button.style.d.ts +0 -6
- package/lib/components/date/__internal__/navbar/button.style.js +0 -1
- package/lib/components/date/__internal__/navbar/index.d.ts +0 -2
- package/lib/components/date/__internal__/navbar/index.js +0 -1
- package/lib/components/date/__internal__/navbar/navbar.component.d.ts +0 -9
- package/lib/components/date/__internal__/navbar/navbar.component.js +0 -1
- package/lib/components/date/__internal__/navbar/navbar.style.d.ts +0 -2
- package/lib/components/date/__internal__/navbar/navbar.style.js +0 -1
- package/lib/components/date/__internal__/navbar/package.json +0 -5
- package/lib/components/date/__internal__/weekday/abbr.style.d.ts +0 -2
- package/lib/components/date/__internal__/weekday/abbr.style.js +0 -1
- package/lib/components/date/__internal__/weekday/index.d.ts +0 -2
- package/lib/components/date/__internal__/weekday/index.js +0 -1
- package/lib/components/date/__internal__/weekday/package.json +0 -5
- package/lib/components/date/__internal__/weekday/weekday.component.d.ts +0 -8
- package/lib/components/date/__internal__/weekday/weekday.component.js +0 -1
- package/lib/components/date/__internal__/weekday/weekday.style.d.ts +0 -2
- package/lib/components/date/__internal__/weekday/weekday.style.js +0 -1
- /package/esm/components/date/__internal__/{utils.d.ts → utils/utils.d.ts} +0 -0
- /package/esm/components/date/__internal__/{utils.js → utils/utils.js} +0 -0
- /package/lib/components/date/__internal__/{utils.d.ts → utils/utils.d.ts} +0 -0
- /package/lib/components/date/__internal__/{utils.js → utils/utils.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type DayPickerProps } from "react-day-picker";
|
|
3
|
+
type DayPickerWeekdayProps = Parameters<NonNullable<NonNullable<DayPickerProps["components"]>["Weekday"]>>[0];
|
|
4
|
+
export declare const CalendarWeekdayRenderer: ({ className, "aria-label": ariaLabel, children, }: DayPickerWeekdayProps) => React.JSX.Element;
|
|
5
|
+
export declare const mergeClassNames: (classNames: DayPickerProps["classNames"]) => {
|
|
6
|
+
[k: string]: string;
|
|
7
|
+
};
|
|
8
|
+
interface CalendarProps {
|
|
9
|
+
dayPickerProps?: Omit<DayPickerProps, "mode" | "selected">;
|
|
10
|
+
focusedMonth?: Date;
|
|
11
|
+
selectedDays?: Date;
|
|
12
|
+
minDate?: string;
|
|
13
|
+
maxDate?: string;
|
|
14
|
+
weekStartsOn?: DayPickerProps["weekStartsOn"];
|
|
15
|
+
weekdaysLong: (string | undefined)[];
|
|
16
|
+
weekdaysShort: (string | undefined)[];
|
|
17
|
+
setFocusedMonth: (month: Date) => void;
|
|
18
|
+
onDayClick: (date?: Date, ev?: React.MouseEvent<Element, MouseEvent>) => void;
|
|
19
|
+
}
|
|
20
|
+
declare const Calendar: ({ dayPickerProps, focusedMonth, selectedDays, minDate, maxDate, weekStartsOn, weekdaysLong, weekdaysShort, setFocusedMonth, onDayClick, }: CalendarProps) => React.JSX.Element;
|
|
21
|
+
export default Calendar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-day-picker"),n=require("../utils/utils.js"),o=require("./calendar-day-button.component.js"),a=require("./calendar-weekday.component.js");function s(e){return e&&e.__esModule?e:{default:e}}var l=s(t);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){c(e,t,r[t])}))}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const d={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},y=r.getDefaultClassNames(),f=l.default.createContext({long:[],short:[]}),p=({className:t,"aria-label":r,children:n})=>{const o=l.default.useContext(f),s=d[r];return e.jsx(a.default,{className:t,title:void 0!==s?o.long[s]:r,children:void 0!==s?o.short[s]:n})},b=e=>Object.fromEntries(Object.entries(e||{}).flatMap((([e,t])=>{if(!t)return[];const r=y[e];return[[e,r?`${r} ${t}`:t]]})));exports.CalendarWeekdayRenderer=p,exports.default=({dayPickerProps:t,focusedMonth:a,selectedDays:s,minDate:l,maxDate:c,weekStartsOn:d,weekdaysLong:y,weekdaysShort:O,setFocusedMonth:m,onDayClick:j})=>{var v,g;const h=b(null==t?void 0:t.classNames);var D,k;return e.jsx(f.Provider,{value:{long:y,short:O},children:e.jsx(r.DayPicker,u(i({hideNavigation:!0,required:!1,weekStartsOn:d,onMonthChange:m,disabled:n.getDisabledDays(l,c),locale:{localize:i({},r.defaultLocale.localize)},selected:s,month:a||new Date,onDayClick:(e,t,r)=>j(e,r),fixedWeeks:!0,defaultMonth:s},t),{classNames:h,components:u(i({},null==t?void 0:t.components),{DayButton:null!==(D=null==t||null===(v=t.components)||void 0===v?void 0:v.DayButton)&&void 0!==D?D:o.default,Weekday:null!==(k=null==t||null===(g=t.components)||void 0===g?void 0:g.Weekday)&&void 0!==k?k:p}),showOutsideDays:!0,mode:"single"}))})},exports.mergeClassNames=b;
|
|
@@ -1,46 +1,7 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
export interface PickerProps extends Omit<DayPickerProps, "mode" | "modifiers"> {
|
|
4
|
-
modifiers?: Partial<Modifiers>;
|
|
5
|
-
}
|
|
6
|
-
export interface DatePickerProps {
|
|
7
|
-
/**
|
|
8
|
-
* [Legacy] Boolean to toggle where DatePicker is rendered in relation to the Date Input
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
disablePortal?: boolean;
|
|
12
|
-
/** Minimum possible date YYYY-MM-DD */
|
|
13
|
-
minDate?: string;
|
|
14
|
-
/** Maximum possible date YYYY-MM-DD */
|
|
15
|
-
maxDate?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Pass any props that match the DayPickerProps interface to override default behaviors
|
|
18
|
-
* See [DayPickerProps](https://daypicker.dev/api/type-aliases/DayPickerProps) for a full list of available props
|
|
19
|
-
* */
|
|
20
|
-
pickerProps?: PickerProps;
|
|
21
|
-
/** Element that the DatePicker will be displayed under */
|
|
22
|
-
inputElement: RefObject<HTMLElement>;
|
|
23
|
-
/** Currently selected date */
|
|
24
|
-
selectedDays?: Date | undefined;
|
|
25
|
-
/** Callback to handle mousedown event on picker container */
|
|
26
|
-
pickerMouseDown?: () => void;
|
|
27
|
-
/** Sets whether the picker should be displayed */
|
|
28
|
-
open?: boolean;
|
|
29
|
-
/** Callback triggered when a Day is clicked */
|
|
30
|
-
onDayClick?: (date: Date, ev: React.MouseEvent<HTMLDivElement>) => void;
|
|
31
|
-
/** Sets the picker open state */
|
|
32
|
-
setOpen: (isOpen: boolean) => void;
|
|
33
|
-
/** Id passed to tab guard element */
|
|
34
|
-
pickerTabGuardId?: string;
|
|
35
|
-
/** Callback triggered when the picker is closed */
|
|
36
|
-
onPickerClose?: () => void;
|
|
37
|
-
/** Prop to specify the aria-label attribute of the date picker */
|
|
38
|
-
ariaLabel?: string;
|
|
39
|
-
/** Prop to specify the aria-labelledby attribute of the date picker */
|
|
40
|
-
ariaLabelledBy?: string;
|
|
41
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DatePickerProps } from "./date-picker.types";
|
|
42
3
|
export declare const DatePicker: {
|
|
43
|
-
({
|
|
4
|
+
({ inputContainerRef, datePickerTriggerRef, minDate, maxDate, selectedDate, disablePortal, onDayClick, onPickerMouseDown, dayPickerProps, open, onRequestPickerClose, pickerTabGuardId, pickerId, yearRangeOffset, }: DatePickerProps): React.JSX.Element | null;
|
|
44
5
|
displayName: string;
|
|
45
6
|
};
|
|
46
7
|
export default DatePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@floating-ui/dom"),r=require("react"),a=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@floating-ui/dom"),r=require("react"),a=require("../../../../__internal__/popover/popover.component.js"),o=require("../../../../__internal__/utils/helpers/guid/index.js"),n=require("../../../../__internal__/utils/logger/index.js"),c=require("./date-picker.style.js"),i=require("../calendar/calendar.component.js"),l=require("../calendar/calendar-close-button.component.js"),s=require("../calendar/calendar-navigation.component.js"),d=require("../hooks/useDatePickerFocus.js"),u=require("../hooks/useDatePickerInFlatTable.js"),p=require("../hooks/useDatePickerKeyboardNavigation.js"),f=require("../hooks/useDatePickerLocale.js"),y=require("../hooks/useDatePickerMonthSync.js"),k=require("../hooks/useDatePickerMonthYearSelection.js");function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),a.forEach((function(t){h(e,t,r[t])}))}return e}const g=[t.offset(3),t.flip({fallbackPlacements:["bottom-end","top-start","top-end"]})];let D=!1;const P=({inputContainerRef:t,datePickerTriggerRef:h,minDate:P,maxDate:j,selectedDate:m,disablePortal:O=!0,onDayClick:S,onPickerMouseDown:v,dayPickerProps:w,open:q,onRequestPickerClose:x,pickerTabGuardId:I,pickerId:C,yearRangeOffset:M})=>{!D&&O&&(D=!0,n.default.deprecate("`disablePortal` is deprecated in DateInput and DateRange, and support will soon be removed."));const[_,F]=r.useState(m||new Date),{datePickerDialogAriaLabel:R,datePickerDescription:T,closeButtonLabel:K,localize:L,weekStartsOn:B,weekdaysLong:E,weekdaysShort:U}=f.default(),Y=r.useRef(null),[{monthSelectId:$,yearSelectId:z,pickerDescriptionId:N}]=r.useState((()=>({monthSelectId:`date-picker-month-${o.default()}`,yearSelectId:`date-picker-year-${o.default()}`,pickerDescriptionId:`date-picker-description-${o.default()}`}))),A=r.useCallback((()=>{var e,r;const a=null===(e=t.current)||void 0===e?void 0:e.querySelector("input");null===(r=(null==h?void 0:h.current)||a)||void 0===r||r.focus(),x()}),[h,t,x]),G=r.useCallback((()=>{F(m),A()}),[A,m]),{getPickerDayFocusTarget:H,handleBlur:J,handleKeyDown:Q,handleKeyUp:V,markSelectorChanged:W,resetChangedSelector:X}=p.default({ref:Y,open:q,monthSelectId:$,yearSelectId:z,onEscape:G}),{displayedMonth:Z,years:ee,handleMonthChange:te,handleYearChange:re}=k.default({minDate:P,maxDate:j,dayPickerProps:w,focusedMonth:_,setFocusedMonth:F,markSelectorChanged:W,yearRangeOffset:M});y.default({open:q,selectedDate:m,focusedMonth:_,setFocusedMonth:F}),d.default({open:q,pickerDescriptionId:N,getPickerDayFocusTarget:H,resetChangedSelector:X});const{isInFlatTable:ae}=u.default(q);return q?e.jsx(a.default,{placement:"bottom-start",reference:t,middleware:g,disablePortal:O,disableBackgroundUI:ae,popoverStrategy:"fixed",children:e.jsxs(c.default,{id:C||"styled-day-picker","data-role":"date-picker",ref:Y,onMouseDown:v,onBlur:J,onKeyUp:V,onKeyDown:Q,role:"dialog","aria-label":R,"aria-describedby":N,children:[e.jsx(c.DatePickerDescription,{id:N,children:T}),!O&&e.jsx("div",{id:I,"data-role":"date-picker-tab-guard",tabIndex:0,onFocus:()=>{var e;null===(e=H())||void 0===e||e.focus()}}),e.jsx(s.default,{displayedMonth:Z,monthSelectId:$,yearSelectId:z,years:ee,localize:L,onMonthChange:te,onYearChange:re}),e.jsx(i.default,{dayPickerProps:(oe=b({},w),ne={autoFocus:!1},ne=null!=ne?ne:{},Object.getOwnPropertyDescriptors?Object.defineProperties(oe,Object.getOwnPropertyDescriptors(ne)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(ne)).forEach((function(e){Object.defineProperty(oe,e,Object.getOwnPropertyDescriptor(ne,e))})),oe),focusedMonth:Z,selectedDays:m,minDate:P,maxDate:j,weekStartsOn:B,weekdaysLong:E,weekdaysShort:U,setFocusedMonth:F,onDayClick:(e,t)=>{e&&(null==S||S(e,t),A())}}),e.jsx(l.default,{onClick:A,children:K})]})}):null;var oe,ne};P.displayName="DatePicker",exports.DatePicker=P,exports.default=P;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const datePickerPopoverHugBreakpoint = 368;
|
|
2
|
+
export declare const DatePickerDescription: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
+
declare const DatePickerPopover: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
theme: object;
|
|
5
|
+
}, "theme">;
|
|
6
|
+
export default DatePickerPopover;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("styled-components"),a=require("../../../../style/themes/apply-base-theme.js"),e=require("../../../../style/utils/add-focus-styling.js"),d=require("../../../../style/utils/visually-hidden.js");function t(r){return r&&r.__esModule?r:{default:r}}var o=t(r);const i=o.default.span.withConfig({displayName:"date-picker.style__DatePickerDescription",componentId:"carbon_v162_13_0__sc-c7869caf-0"})(["",""],d.default),n=o.default.div.attrs(a.default).withConfig({displayName:"date-picker.style__DatePickerPopover",componentId:"carbon_v162_13_0__sc-c7869caf-1"})(["--date-picker-day-cell-size:var(--global-size-m);--date-picker-grid-width:calc(7 * var(--date-picker-day-cell-size));--date-picker-day-button-size:var(--date-picker-day-cell-size);--date-picker-popover-width:320px;--date-picker-popover-min-width:288px;display:inline-flex;flex-direction:column;align-items:stretch;box-sizing:border-box;position:relative;z-index:2000;width:var(--date-picker-popover-width);min-width:var(--date-picker-popover-min-width);max-width:var(--date-picker-popover-width);padding:var(--global-space-layout-2-xs) var(--global-space-comp-xs);background:var(--popover-bg-default);box-shadow:var(--global-depth-lvl1);border-radius:var(--global-radius-action-m);@media screen and (max-width:","px){width:var(--date-picker-popover-min-width);}.rdp-root,.rdp-root *{box-sizing:border-box;}.rdp-root{width:100%;margin-bottom:var(--global-space-comp-s);padding:var(--global-space-none);background:transparent;box-shadow:none;border-radius:var(--global-radius-none);text-align:center;font:var(--global-font-static-body-medium-m);color:var(--input-calendar-txt-default);}.rdp-months{display:block;width:100%;max-width:none;padding:var(--global-space-none);}.rdp-month{width:100%;margin:0;}.rdp-month_caption{display:none;}.rdp-month_grid,.rdp-weeks,.rdp-weekdays,.rdp-week{width:var(--date-picker-grid-width);max-width:100%;}.rdp-month_grid{margin:0 auto;}.rdp-weeks{display:flex;flex-direction:column;gap:var(--global-space-comp-s);margin-top:0;}.rdp-weekday{opacity:1;color:var(--input-calendar-txt-alt);text-transform:none;}.rdp-weekdays{display:flex;height:var(--date-picker-day-cell-size);}.rdp-week{display:flex;align-items:center;justify-content:center;height:var(--date-picker-day-cell-size);}.rdp-day{display:flex;align-items:center;justify-content:center;width:var(--date-picker-day-cell-size);height:var(--date-picker-day-cell-size);padding:var(--global-space-none);color:var(--input-calendar-txt-default);border-radius:var(--global-radius-action-circle);}.rdp-day_button{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;width:var(--date-picker-day-button-size);min-width:var(--date-picker-day-button-size);height:var(--date-picker-day-button-size);margin:0;border:none;border-radius:var(--global-radius-action-circle);background:transparent;font:var(--global-font-static-body-medium-m);color:inherit;text-align:center;cursor:pointer;transform:rotate(0deg);&:focus{",' border-radius:var(--global-radius-action-circle);}}.rdp-selected:not(.rdp-outside),.rdp-today:not(.rdp-outside){background:transparent;border-radius:var(--global-radius-action-circle);color:inherit;font-weight:inherit;}.rdp-day:not(.rdp-selected):not(.rdp-range_start):not(.rdp-range_middle):not( .rdp-range_end ):not(.rdp-disabled):not(.rdp-outside):hover .rdp-day_button:not(:disabled){background:var(--input-calendar-bg-hover);color:var(--input-calendar-txt-hover);}.rdp-selected .rdp-day_button{z-index:2;background:var(--input-calendar-bg-active);color:var(--input-calendar-txt-active);border-radius:var(--global-radius-action-circle);}.rdp-selected{z-index:1;}.rdp-range_start,.rdp-range_middle,.rdp-range_end{position:relative;background:transparent;color:var(--input-calendar-txt-duration);&::before{content:"";position:absolute;z-index:0;inset:0;background:var(--input-calendar-bg-duration);border-block:var(--global-borderwidth-s) solid var(--input-calendar-border-duration);pointer-events:none;}}.rdp-range_start::before{border-inline-start:var(--global-borderwidth-s) solid var(--input-calendar-border-duration);border-radius:var(--global-radius-action-circle) 0 0 var(--global-radius-action-circle);}.rdp-range_middle.rdp-outside{color:var(--input-calendar-txt-duration);}.rdp-range_end::before{border-inline-end:var(--global-borderwidth-s) solid var(--input-calendar-border-duration);border-radius:0 var(--global-radius-action-circle) var(--global-radius-action-circle) 0;}.rdp-range_start .rdp-day_button,.rdp-range_end .rdp-day_button{z-index:2;background:var(--input-calendar-bg-active);color:var(--input-calendar-txt-active);}.rdp-range_start.rdp-range_end{background:transparent;border-radius:var(--global-radius-action-circle);&::before{content:"";border:var(--global-borderwidth-s) solid var(--input-calendar-border-duration);border-radius:var(--global-radius-action-circle);}}.rdp-disabled{color:var(--input-calendar-txt-disabled);}.rdp-disabled .rdp-day_button,.rdp-day_button:disabled{cursor:not-allowed;background:transparent;color:var(--input-calendar-txt-disabled);}.rdp-outside{color:var(--input-calendar-txt-alt);}.rdp-today:not(.rdp-selected):not(.rdp-range_start):not( .rdp-range_middle ):not(.rdp-range_end) .rdp-day_button{background:transparent;}.rdp-focused:not(.rdp-disabled):not(.rdp-outside){outline:none;box-shadow:none;}[data-role="date-picker-today-indicator"]{position:absolute;z-index:2;left:50%;bottom:var(--global-space-comp-s);transform:translateX(-50%);width:var(--global-size-3-xs);height:var(--global-size-5-xs);background:var(--input-calendar-txt-default);border-radius:var(--global-radius-action-circle);pointer-events:none;}.rdp-selected [data-role="date-picker-today-indicator"],.rdp-range_start [data-role="date-picker-today-indicator"],.rdp-range_end [data-role="date-picker-today-indicator"]{background:var(--input-calendar-bg-hover);}.rdp-outside [data-role="date-picker-today-indicator"]{background:var(--input-calendar-bg-duration);}.rdp-disabled [data-role="date-picker-today-indicator"]{background:var(--input-calendar-bg-disabled);}'],367,e.default(!0));exports.DatePickerDescription=i,exports.datePickerPopoverHugBreakpoint=368,exports.default=n;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { RefObject } from "react";
|
|
3
|
+
import type { DayPickerProps } from "react-day-picker";
|
|
4
|
+
export type PickerProps = Omit<DayPickerProps, "mode" | "modifiers"> & {
|
|
5
|
+
modifiers?: DayPickerProps["modifiers"];
|
|
6
|
+
};
|
|
7
|
+
export type DatePickerSize = "small" | "medium" | "large";
|
|
8
|
+
export interface DatePickerProps {
|
|
9
|
+
/** @deprecated Portal placement is retained for legacy API compatibility. */
|
|
10
|
+
disablePortal?: boolean;
|
|
11
|
+
/** Minimum possible date in YYYY-MM-DD format. */
|
|
12
|
+
minDate?: string;
|
|
13
|
+
/** Maximum possible date in YYYY-MM-DD format. */
|
|
14
|
+
maxDate?: string;
|
|
15
|
+
/** Legacy DayPicker configuration. DateInput remains single-select. */
|
|
16
|
+
dayPickerProps?: PickerProps;
|
|
17
|
+
/** Element that the DatePicker will be displayed under. */
|
|
18
|
+
inputContainerRef: RefObject<HTMLElement>;
|
|
19
|
+
/** Focusable control that opened the picker, when one is available. */
|
|
20
|
+
datePickerTriggerRef?: RefObject<HTMLButtonElement>;
|
|
21
|
+
/** Currently selected date. */
|
|
22
|
+
selectedDate?: Date;
|
|
23
|
+
/** Callback to handle mousedown on the picker container. */
|
|
24
|
+
onPickerMouseDown?: () => void;
|
|
25
|
+
/** Sets whether the picker should be displayed. */
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/** Callback triggered when a day is clicked. */
|
|
28
|
+
onDayClick?: (date: Date, ev: React.MouseEvent<HTMLDivElement>) => void;
|
|
29
|
+
/** Requests that the state owner close the picker. */
|
|
30
|
+
onRequestPickerClose: () => void;
|
|
31
|
+
/** Id passed to the tab guard element. */
|
|
32
|
+
pickerTabGuardId?: string;
|
|
33
|
+
/** Id for the date picker container. */
|
|
34
|
+
pickerId?: string;
|
|
35
|
+
/** Size of the associated date input. */
|
|
36
|
+
size?: DatePickerSize;
|
|
37
|
+
/**
|
|
38
|
+
* Number of years shown either side of the bounds/anchor year in the year
|
|
39
|
+
* selector. Defaults to 10.
|
|
40
|
+
*/
|
|
41
|
+
yearRangeOffset?: number;
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const parseDateBound: (value?: string) => Date | undefined;
|
|
2
|
+
export declare const parseSelectInteger: (value: string) => number | undefined;
|
|
3
|
+
export declare const normalizeDateBounds: ({ minDate, maxDate, startMonth, endMonth, }: {
|
|
4
|
+
minDate?: string;
|
|
5
|
+
maxDate?: string;
|
|
6
|
+
startMonth?: Date;
|
|
7
|
+
endMonth?: Date;
|
|
8
|
+
}) => {
|
|
9
|
+
minMonth: Date | undefined;
|
|
10
|
+
maxMonth: Date | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const buildYearRange: ({ minMonth, maxMonth, anchorYear, includedYear, offset, }: {
|
|
13
|
+
minMonth?: Date;
|
|
14
|
+
maxMonth?: Date;
|
|
15
|
+
anchorYear: number;
|
|
16
|
+
includedYear: number;
|
|
17
|
+
offset: number;
|
|
18
|
+
}) => number[];
|
|
19
|
+
export declare const getMonthYearTransition: ({ displayedMonth, month, year, }: {
|
|
20
|
+
displayedMonth: Date;
|
|
21
|
+
month: number;
|
|
22
|
+
year: number;
|
|
23
|
+
}) => {
|
|
24
|
+
date: Date;
|
|
25
|
+
month: number;
|
|
26
|
+
year: number;
|
|
27
|
+
};
|
|
28
|
+
export declare const getSelectedDateForMonth: ({ selectedDate, month, year, minMonth, maxMonth, }: {
|
|
29
|
+
selectedDate: Date;
|
|
30
|
+
month: number;
|
|
31
|
+
year: number;
|
|
32
|
+
minMonth?: Date;
|
|
33
|
+
maxMonth?: Date;
|
|
34
|
+
}) => Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../utils/utils.js");const t=t=>t&&e.checkISOFormatAndLength(t)?e.parseISODate(t):void 0;exports.buildYearRange=({minMonth:e,maxMonth:t,anchorYear:a,includedYear:n,offset:r})=>{var o,l;const s=Math.min(Math.max(a,null!==(o=null==e?void 0:e.getFullYear())&&void 0!==o?o:-1/0),null!==(l=null==t?void 0:t.getFullYear())&&void 0!==l?l:1/0),h=Math.min(Math.max(s,n-r),n+r),u=e?e.getFullYear()-r:h-r,g=t?t.getFullYear()+r:h+r;return Array.from({length:g-u+1},((e,t)=>u+t))},exports.getMonthYearTransition=({displayedMonth:e,month:t,year:a})=>{const n=new Date(e);return n.setDate(1),n.setFullYear(a),n.setMonth(t),{date:n,month:t,year:a}},exports.getSelectedDateForMonth=({selectedDate:e,month:t,year:a,minMonth:n,maxMonth:r})=>{const o=new Date(e),l=new Date(a,t+1,0).getDate();return o.setDate(1),o.setFullYear(a),o.setMonth(t),o.setDate(Math.min(e.getDate(),l)),n&&o.getFullYear()===n.getFullYear()&&o.getMonth()===n.getMonth()&&o.getDate()<n.getDate()&&o.setDate(n.getDate()),r&&o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()&&o.getDate()>r.getDate()&&o.setDate(r.getDate()),o},exports.normalizeDateBounds=({minDate:e,maxDate:a,startMonth:n,endMonth:r})=>{const o=n||t(e),l=r||t(a);return o&&l&&o>l?{minMonth:l,maxMonth:o}:{minMonth:o,maxMonth:l}},exports.parseDateBound=t,exports.parseSelectInteger=e=>{const t=Number(e);return Number.isSafeInteger(t)&&String(t)===e?t:void 0};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./date-picker.component";
|
|
2
|
-
export type { DatePickerProps, PickerProps } from "./date-picker.
|
|
1
|
+
export { default, DatePicker } from "./date-picker.component";
|
|
2
|
+
export type { DatePickerSize, DatePickerProps, PickerProps, } from "./date-picker.types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./date-picker.component.js");exports.default=e.DatePicker;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./date-picker.component.js");exports.DatePicker=e.DatePicker,exports.default=e.DatePicker;
|
package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.component.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DatePickerTriggerProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
open?: boolean;
|
|
5
|
+
pickerId: string;
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
size: "small" | "medium" | "large";
|
|
8
|
+
datePickerTriggerRef?: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
variant: "legacy" | "typical";
|
|
10
|
+
onClick: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
11
|
+
onMouseDown?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const DatePickerTrigger: ({ disabled, open, pickerId, readOnly, size, datePickerTriggerRef, variant, onClick, onMouseDown, }: DatePickerTriggerProps) => React.JSX.Element;
|
|
14
|
+
export default DatePickerTrigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("./date-picker-trigger.style.js"),a=require("../../../icon/icon.component.js");require("../../../icon/icon.style.js");var i=require("../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({disabled:t,open:n,pickerId:l,readOnly:o,size:d,datePickerTriggerRef:c,variant:s,onClick:u,onMouseDown:g})=>{var p,y;const v=i.default();return"legacy"===s?e.jsx(r.LegacyDatePickerTrigger,{"data-element":"calendar","data-role":"input-icon-toggle","aria-hidden":"true",$disabled:t,$readOnly:o,$size:d,onClick:u,onMouseDown:g,children:e.jsx(a.default,{type:"calendar_today"})}):e.jsxs(r.DatePickerTriggerContainer,{onMouseDown:g,children:[e.jsx(r.DatePickerTriggerDividerWrapper,{children:e.jsx(r.DatePickerTriggerDivider,{type:"vertical",p:0,$disabled:t,$readOnly:o})}),e.jsx(r.DatePickerTriggerButton,{ref:c,"data-element":"calendar","data-role":"input-icon-toggle",onClick:u,disabled:t||o,"aria-label":null===(p=(y=v.date.ariaLabels).openCalendarButton)||void 0===p?void 0:p.call(y),"aria-haspopup":"dialog","aria-controls":n?l:void 0,"aria-expanded":n,$size:d,$readOnly:o,size:d,variant:"default",variantType:"subtle",iconType:"calendar_today",m:0})]})};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DatePickerSize } from "../date-picker";
|
|
2
|
+
declare const DatePickerTriggerContainer: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
|
+
interface LegacyDatePickerTriggerProps {
|
|
4
|
+
$disabled?: boolean;
|
|
5
|
+
$readOnly?: boolean;
|
|
6
|
+
$size: DatePickerSize;
|
|
7
|
+
}
|
|
8
|
+
declare const LegacyDatePickerTrigger: import("styled-components").StyledComponent<"span", any, LegacyDatePickerTriggerProps, never>;
|
|
9
|
+
declare const DatePickerTriggerDividerWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
10
|
+
interface DatePickerTriggerDividerProps {
|
|
11
|
+
$disabled?: boolean;
|
|
12
|
+
$readOnly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const DatePickerTriggerDivider: import("styled-components").StyledComponent<{
|
|
15
|
+
({ type, h, height, displayInline, "aria-hidden": ariaHidden, variant, inverse, adaptiveMxBreakpoint, ml, mr, as, ...rest }: import("../../../divider").DividerProps): JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
}, any, DatePickerTriggerDividerProps, never>;
|
|
18
|
+
interface DatePickerTriggerButtonProps {
|
|
19
|
+
$size: DatePickerSize;
|
|
20
|
+
$readOnly?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const DatePickerTriggerButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../button/__next__").ButtonProps & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>, any, DatePickerTriggerButtonProps, never>;
|
|
23
|
+
export { DatePickerTriggerContainer, DatePickerTriggerDividerWrapper, DatePickerTriggerDivider, DatePickerTriggerButton, LegacyDatePickerTrigger, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("styled-components"),r=require("../../../button/__next__/button.component.js"),i=require("../../../divider/divider.component.js"),a=require("../../../icon/icon.style.js"),t=require("../../../button/__next__/button.config.js"),l=require("../../../../__internal__/legacy-input/input-sizes.style.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=o(e);const d=n.default.span.withConfig({displayName:"date-picker-trigger.style__DatePickerTriggerContainer",componentId:"carbon_v162_13_0__sc-ee413d0f-0"})(["align-self:stretch;display:inline-flex;align-items:center;"]),s=n.default.span.withConfig({displayName:"date-picker-trigger.style__LegacyDatePickerTrigger",componentId:"carbon_v162_13_0__sc-ee413d0f-1"})(["align-items:center;align-self:stretch;display:flex;justify-content:center;width:",";cursor:",";",""],(({$size:e})=>l.default[e].height),(({$disabled:e,$readOnly:r})=>e?"not-allowed":r?"default":"pointer"),(({$disabled:r,$readOnly:i})=>{let t="var(--input-typical-icon-default)";return i?t="var(--input-typical-icon-read-only)":r&&(t="var(--button-typical-subtle-label-disabled)"),e.css(["","{color:",";}"],a.default,t)})),c=n.default.span.withConfig({displayName:"date-picker-trigger.style__DatePickerTriggerDividerWrapper",componentId:"carbon_v162_13_0__sc-ee413d0f-2"})(["display:inline-flex;align-self:stretch;align-items:center;"]),g=n.default(i.Divider).withConfig({displayName:"date-picker-trigger.style__DatePickerTriggerDivider",componentId:"carbon_v162_13_0__sc-ee413d0f-3"})(["&&{align-self:stretch;box-sizing:border-box;display:inline-flex;height:100%;padding-inline:0;margin:0;padding-block:var(--global-space-comp-s);}",""],(({$disabled:r,$readOnly:i})=>{let a="var(--input-typical-border-default)";return r?a="var(--input-typical-border-disabled)":i&&(a="var(--input-typical-border-read-only)"),e.css(['&& [data-role="divider-content"]{border-inline-start-color:',";opacity:1;}"],a)})),u=n.default(r.Button).withConfig({displayName:"date-picker-trigger.style__DatePickerTriggerButton",componentId:"carbon_v162_13_0__sc-ee413d0f-4"})([""," &&{--date-picker-trigger-size:",';width:var(--date-picker-trigger-size);min-width:var(--date-picker-trigger-size);height:var(--date-picker-trigger-size);min-height:var(--date-picker-trigger-size);padding:var(--global-space-none);border-radius:var(--global-radius-none);border:none;}&&[aria-expanded="true"]:not(:disabled){background-color:var(--button-typical-subtle-bg-active);color:var(--button-typical-subtle-label-active);border-radius:var(--global-radius-none) var(--global-radius-action-m) var(--global-radius-action-m) var(--global-radius-none);',"{color:var(--button-typical-subtle-label-active);}}&&:not(:disabled){cursor:pointer;}&&:hover{border-radius:var(--global-radius-none) var(--global-radius-action-m) var(--global-radius-action-m) var(--global-radius-none);}&&:focus{border-color:var(--input-typical-border-default);border-style:solid;border-width:var(--global-borderwidth-xs) var(--global-borderwidth-xs) var(--global-borderwidth-xs) var(--global-borderwidth-none);border-radius:var(--global-radius-none) var(--global-radius-action-m) var(--global-radius-action-m) var(--global-radius-none);position:relative;z-index:2;}&&:disabled{cursor:not-allowed;}"],(({disabled:r,$readOnly:i})=>{let t="var(--input-typical-icon-default)";return i?t="var(--input-typical-icon-read-only)":r&&(t="var(--button-typical-subtle-label-disabled)"),e.css(["color:",";&& ","{color:",";}"],t,a.default,t)}),(({$size:e})=>t.propsForSize[e].height),a.default);exports.DatePickerTriggerButton=u,exports.DatePickerTriggerContainer=d,exports.DatePickerTriggerDivider=g,exports.DatePickerTriggerDividerWrapper=c,exports.LegacyDatePickerTrigger=s;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focuses a day and describes it until it loses focus. Screen readers can skip
|
|
3
|
+
* the dialog description when focus moves straight to a day, and the attribute
|
|
4
|
+
* must already be present when focus lands for it to be announced.
|
|
5
|
+
* Returns a cleanup function that removes the description.
|
|
6
|
+
*/
|
|
7
|
+
declare const focusDayWithPickerDescription: (day: HTMLElement, descriptionId: string) => () => void;
|
|
8
|
+
export default focusDayWithPickerDescription;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=(e,t)=>{const r=()=>e.removeAttribute("aria-describedby");e.setAttribute("aria-describedby",t),e.addEventListener("blur",r,{once:!0});const{activeElement:n}=document;return n instanceof HTMLElement&&n!==e&&n.blur(),e.focus(),()=>{e.removeEventListener("blur",r),r()}};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type DateInputEvent } from "../utils/date-input-value.utils";
|
|
2
|
+
interface UseDateInputStateProps {
|
|
3
|
+
allowEmptyValue?: boolean;
|
|
4
|
+
format: string;
|
|
5
|
+
formats: string[];
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/** Derives the selected date and display value while preserving in-progress input. */
|
|
9
|
+
declare const useDateInputState: ({ allowEmptyValue, format, formats, value, }: UseDateInputStateProps) => {
|
|
10
|
+
displayValue: string;
|
|
11
|
+
selectedDate: Date | undefined;
|
|
12
|
+
createDateChangeEvent: (event: DateInputEvent) => {
|
|
13
|
+
target: {
|
|
14
|
+
value: {
|
|
15
|
+
formattedValue: string;
|
|
16
|
+
rawValue: string | null;
|
|
17
|
+
};
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
name?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
valueNeedsFormatting: boolean;
|
|
23
|
+
trackEditedValue: (editedValue: string) => void;
|
|
24
|
+
};
|
|
25
|
+
export default useDateInputState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../utils/utils.js"),a=require("../utils/date-input-value.utils.js");exports.default=({allowEmptyValue:u,format:r,formats:l,value:d})=>{const[s,n]=e.useState(!0),i=e.useRef({}),o=s||d!==i.current.editedInputValue;e.useEffect((()=>{s||d===i.current.valuePropBeforeEdit||d===i.current.editedInputValue||(i.current={},n(!0))}),[s,d]);const{displayValue:c,selectedDate:p}=a.getDateInputState(d,r,l,o),f=t.checkISOFormatAndLength(d)?t.formattedValue(r,t.parseISODate(d)):d,[,m]=t.findMatchedFormatAndValue(f,l),V=t.formattedValue(r,p)!==m;return{displayValue:c,selectedDate:p,createDateChangeEvent:e=>a.buildDateChangeEvent({allowEmptyValue:u,event:e,format:r,formats:l,selectedDate:p}),valueNeedsFormatting:V,trackEditedValue:e=>{i.current={editedInputValue:e,valuePropBeforeEdit:d},n(!1)}}};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface UseDatePickerFocusProps {
|
|
2
|
+
open?: boolean;
|
|
3
|
+
pickerDescriptionId: string;
|
|
4
|
+
getPickerDayFocusTarget: () => HTMLElement | null | undefined;
|
|
5
|
+
resetChangedSelector: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Moves focus to the preferred day when the picker opens. */
|
|
8
|
+
declare const useDatePickerFocus: ({ open, pickerDescriptionId, getPickerDayFocusTarget, resetChangedSelector, }: UseDatePickerFocusProps) => void;
|
|
9
|
+
export default useDatePickerFocus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./focusDayWithPickerDescription.js");exports.default=({open:r,pickerDescriptionId:i,getPickerDayFocusTarget:c,resetChangedSelector:o})=>{e.useEffect((()=>{if(!r)return void o();let e;const s=setTimeout((()=>{const r=c();r&&(e=t.default(r,i))}),0);return()=>{clearTimeout(s),null==e||e()}}),[c,r,i,o])};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../flat-table/__internal__/flat-table.context.js");exports.default=l=>{const{isInFlatTable:r,setHasOpenDatePicker:a}=e.useContext(t.default);return e.useEffect((()=>{if(l)return null==a||a(!0),()=>null==a?void 0:a(!1)}),[l,a]),{isInFlatTable:r}};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type ChangedSelector = "month" | "year";
|
|
3
|
+
interface UseDatePickerKeyboardNavigationProps {
|
|
4
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
monthSelectId: string;
|
|
7
|
+
yearSelectId: string;
|
|
8
|
+
onEscape: () => void;
|
|
9
|
+
}
|
|
10
|
+
/** Cycles Tab focus within the picker, moves focus from changed selectors to the calendar, and closes on Escape. */
|
|
11
|
+
declare const useDatePickerKeyboardNavigation: ({ ref, open, monthSelectId, yearSelectId, onEscape, }: UseDatePickerKeyboardNavigationProps) => {
|
|
12
|
+
getPickerDayFocusTarget: () => HTMLElement | null;
|
|
13
|
+
handleBlur: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
14
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
15
|
+
handleKeyUp: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
16
|
+
markSelectorChanged: (selector: ChangedSelector) => void;
|
|
17
|
+
resetChangedSelector: () => void;
|
|
18
|
+
};
|
|
19
|
+
export default useDatePickerKeyboardNavigation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../../__internal__/utils/helpers/events/events.js");const r=[".rdp-day_button:focus",".rdp-selected .rdp-day_button",'.rdp-day_button[aria-selected="true"]'],n=[".rdp-today .rdp-day_button"],l=".rdp-day_button",a=e=>Boolean(e&&!e.matches(":disabled")&&"true"!==e.getAttribute("aria-disabled")&&-1!==e.tabIndex&&(e=>{if(e.closest("[hidden], [inert]"))return!1;let t=e;for(;t;){const{display:e,visibility:r}=window.getComputedStyle(t);if("none"===e||"hidden"===r)return!1;t=t.parentElement}return!0})(e)),u=(e,t)=>e&&t.flatMap((t=>Array.from(e.querySelectorAll(t)))).find(a)||null,o=(e,t)=>Array.from((null==e?void 0:e.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]'))||[]).filter((e=>a(e)&&!t.includes(e)&&!e.matches(l)&&!e.matches('[data-role="date-picker-tab-guard"]')));exports.default=({ref:d,open:c,monthSelectId:s,yearSelectId:i,onEscape:f})=>{const p=e.useRef(null),b=e.useCallback((()=>u(d.current,r)||u(d.current,n)||u(d.current,[l])),[d]),y=e.useCallback((e=>{var t;return null===(t=d.current)||void 0===t?void 0:t.querySelector(`[id="${e}"]`)}),[d]),h=e.useCallback((()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.querySelector('[data-role="date-picker-close"]')}),[d]),m=e.useCallback((e=>{c&&t.default.isEscKey(e)&&(e.stopPropagation(),f())}),[f,c]),v=e.useCallback((e=>{if(!t.default.isTabKey(e))return;const r=document.activeElement;if(!r)return;const n=Boolean(r.classList.contains("rdp-day_button")||r.closest(".rdp-day_button")),l=y(s),c=y(i),f=h(),m=b(),v=[m,f,l,c].filter(a),_=[...v,...o(d.current,v)],k=n?m:r,g=t=>{if(!k)return;const r=_.indexOf(k);if(-1===r)return;e.preventDefault();const n=(r+t+_.length)%_.length;_[n].focus()};if(t.default.isShiftKey(e))return p.current=null,void g(-1);if("month"===p.current&&r===l||"year"===p.current&&r===c){p.current=null;const t=u(d.current,[".rdp-day:not(.rdp-outside) .rdp-day_button"])||b();t?(e.preventDefault(),t.focus()):g(1)}else g(1)}),[h,b,y,s,d,i]),_=e.useCallback((e=>{const t=p.current;if(!t)return;const r="month"===t?s:i;e.target===y(r)&&(p.current=null)}),[y,s,i]),k=e.useCallback((e=>{p.current=e}),[]),g=e.useCallback((()=>{p.current=null}),[]);return{getPickerDayFocusTarget:b,handleBlur:_,handleKeyDown:v,handleKeyUp:m,markSelectorChanged:k,resetChangedSelector:g}};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Day } from "date-fns";
|
|
2
|
+
/** Derives localized picker labels and weekday names. */
|
|
3
|
+
declare const useDatePickerLocale: () => {
|
|
4
|
+
datePickerDialogAriaLabel: string | undefined;
|
|
5
|
+
datePickerDescription: string | undefined;
|
|
6
|
+
closeButtonLabel: string | undefined;
|
|
7
|
+
localize: import("date-fns").Localize;
|
|
8
|
+
weekStartsOn: Day | undefined;
|
|
9
|
+
weekdaysLong: string[];
|
|
10
|
+
weekdaysShort: string[];
|
|
11
|
+
};
|
|
12
|
+
export default useDatePickerLocale;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),a=require("../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=()=>{var o,t,l,r,s,d;const i=a.default(),n=i.date.dateFnsLocale(),{localize:c,options:u}=n,L=n.code.split("-")[0].toLowerCase(),{weekdaysLong:k,weekdaysShort:v}=e.useMemo((()=>{const e=["de","pl"].includes(L);return{weekdaysLong:Array.from({length:7},((e,a)=>c.day(a))),weekdaysShort:Array.from({length:7},((a,o)=>c.day(o,{width:e?"wide":"abbreviated"}).substring(0,"de"===L?2:3)))}}),[L,c]);return{datePickerDialogAriaLabel:null===(o=(t=i.date.ariaLabels).chooseDate)||void 0===o?void 0:o.call(t),datePickerDescription:null===(l=(r=i.date.ariaLabels).openCalendarDescription)||void 0===l?void 0:l.call(r),closeButtonLabel:null===(s=(d=i.date.ariaLabels).closeButton)||void 0===s?void 0:s.call(d),localize:c,weekStartsOn:null==u?void 0:u.weekStartsOn,weekdaysLong:k,weekdaysShort:v}};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface UseDatePickerMonthSyncProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
selectedDate?: Date;
|
|
5
|
+
focusedMonth?: Date;
|
|
6
|
+
setFocusedMonth: React.Dispatch<React.SetStateAction<Date | undefined>>;
|
|
7
|
+
}
|
|
8
|
+
/** Synchronizes the displayed month with committed date changes. */
|
|
9
|
+
declare const useDatePickerMonthSync: ({ open, selectedDate, focusedMonth, setFocusedMonth, }: UseDatePickerMonthSyncProps) => void;
|
|
10
|
+
export default useDatePickerMonthSync;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.default=({open:t,selectedDate:o,focusedMonth:r,setFocusedMonth:u})=>{const s=e.useRef();e.useEffect((()=>{const e=null==o?void 0:o.getTime(),l=s.current!==e;s.current=e,!o||t&&!l||(null==r?void 0:r.getMonth())===o.getMonth()&&r.getFullYear()===o.getFullYear()||u(o)}),[r,t,o,u])};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DatePickerProps } from "../date-picker";
|
|
3
|
+
export declare const DEFAULT_YEAR_RANGE_OFFSET = 10;
|
|
4
|
+
interface UseDatePickerMonthYearSelectionProps {
|
|
5
|
+
minDate?: string;
|
|
6
|
+
maxDate?: string;
|
|
7
|
+
dayPickerProps?: DatePickerProps["dayPickerProps"];
|
|
8
|
+
focusedMonth?: Date;
|
|
9
|
+
setFocusedMonth: React.Dispatch<React.SetStateAction<Date | undefined>>;
|
|
10
|
+
markSelectorChanged: (selector: "month" | "year") => void;
|
|
11
|
+
/** Number of years shown either side of the bounds/anchor year in the year selector. */
|
|
12
|
+
yearRangeOffset?: number;
|
|
13
|
+
}
|
|
14
|
+
/** Manages bounded month/year navigation and selector changes. */
|
|
15
|
+
declare const useDatePickerMonthYearSelection: ({ minDate, maxDate, dayPickerProps, focusedMonth, setFocusedMonth, markSelectorChanged, yearRangeOffset, }: UseDatePickerMonthYearSelectionProps) => {
|
|
16
|
+
displayedMonth: Date;
|
|
17
|
+
years: number[];
|
|
18
|
+
handleMonthChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
19
|
+
handleYearChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
20
|
+
};
|
|
21
|
+
export default useDatePickerMonthYearSelection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../date-picker/date-picker.utils.js");exports.DEFAULT_YEAR_RANGE_OFFSET=10,exports.default=({minDate:n,maxDate:r,dayPickerProps:o,focusedMonth:a,setFocusedMonth:l,markSelectorChanged:i,yearRangeOffset:u=10})=>{var d,s;const h=e.useMemo((()=>t.normalizeDateBounds({minDate:n,maxDate:r,startMonth:null==o?void 0:o.startMonth,endMonth:null==o?void 0:o.endMonth})),[n,r,null==o?void 0:o.startMonth,null==o?void 0:o.endMonth]),{minMonth:m,maxMonth:c}=h,M=null!=a?a:new Date,v=e.useRef(),g=(null===(d=v.current)||void 0===d?void 0:d.min)!==(null==m?void 0:m.getTime())||(null===(s=v.current)||void 0===s?void 0:s.max)!==(null==c?void 0:c.getTime());v.current={min:null==m?void 0:m.getTime(),max:null==c?void 0:c.getTime()};const p=g&&m&&M<m?m:g&&c&&M>c?c:M,y=p.getFullYear(),f=e.useRef(y),x=e.useMemo((()=>t.buildYearRange({minMonth:m,maxMonth:c,anchorYear:f.current,includedYear:y,offset:u})),[y,m,c,u]),Y=({month:e,year:n})=>{const r=t.getMonthYearTransition({displayedMonth:p,month:e,year:n});return l(r.date),r};return{displayedMonth:p,years:x,handleMonthChange:e=>{const n=t.parseSelectInteger(e.target.value);if(void 0===n||n<0||n>11)return;i("month");const r=p.getFullYear();Y({month:n,year:r})},handleYearChange:e=>{const n=t.parseSelectInteger(e.target.value);void 0!==n&&x.includes(n)&&(i("year"),Y({month:p.getMonth(),year:n}))}}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export interface UseDatePickerStateProps {
|
|
3
|
+
onPickerOpen?: () => void;
|
|
4
|
+
onPickerClose?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UseDatePickerStateReturn {
|
|
7
|
+
open: boolean;
|
|
8
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
9
|
+
openPicker: () => void;
|
|
10
|
+
closePicker: () => void;
|
|
11
|
+
togglePicker: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** Owns picker visibility and emits lifecycle callbacks on transitions. */
|
|
14
|
+
declare const useDatePickerState: ({ onPickerOpen, onPickerClose, }: UseDatePickerStateProps) => UseDatePickerStateReturn;
|
|
15
|
+
export default useDatePickerState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.default=({onPickerOpen:l,onPickerClose:r})=>{const[t,u]=e.useState(!1),c=e.useCallback((()=>{t||(u(!0),null==l||l())}),[l,t]),n=e.useCallback((()=>{t&&(u(!1),null==r||r())}),[r,t]),s=e.useCallback((()=>{t?(u(!1),null==r||r()):(u(!0),null==l||l())}),[r,l,t]);return{open:t,setOpen:u,openPicker:c,closePicker:n,togglePicker:s}};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Locale } from "react-day-picker";
|
|
2
|
+
export interface DateInputEvent {
|
|
3
|
+
type: "blur" | "change" | "click";
|
|
4
|
+
target: {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface BuildDateChangeEventOptions {
|
|
11
|
+
allowEmptyValue?: boolean;
|
|
12
|
+
event: DateInputEvent;
|
|
13
|
+
format: string;
|
|
14
|
+
formats: string[];
|
|
15
|
+
selectedDate?: Date;
|
|
16
|
+
}
|
|
17
|
+
export declare const getInitialSelectedDate: (value: string, dateFnsLocale: Locale, format: string) => Date | undefined;
|
|
18
|
+
export declare const getSelectedDate: (value: string, formats: string[], shouldParseISOValue: boolean) => Date | undefined;
|
|
19
|
+
export declare const getDisplayValue: (value: string, format: string, formats: string[], shouldFormatValue: boolean) => string;
|
|
20
|
+
export declare const getDateInputState: (value: string, format: string, formats: string[], shouldFormatValue: boolean) => {
|
|
21
|
+
displayValue: string;
|
|
22
|
+
selectedDate: Date | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare const buildDateChangeEvent: ({ allowEmptyValue, event, format, formats, selectedDate, }: BuildDateChangeEventOptions) => {
|
|
25
|
+
target: {
|
|
26
|
+
value: {
|
|
27
|
+
formattedValue: string;
|
|
28
|
+
rawValue: string | null;
|
|
29
|
+
};
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./utils.js");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{},n=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),n.forEach((function(r){t(e,r,a[r])}))}return e}const a=(t,r)=>{const[a,n]=e.findMatchedFormatAndValue(t,r);if(!a||!n)return{date:void 0,normalizedFormat:"",normalizedValue:""};const[o,l]=e.additionalYears(a,n),i=e.parseDate(o,l);return{date:e.isDateValid(i)?i:void 0,normalizedFormat:o,normalizedValue:l}},n=(t,r,n)=>{const{date:o}=a(t,r);return o||(e.checkISOFormatAndLength(t)&&n?e.parseISODate(t):void 0)},o=(t,r,a,n)=>{if(e.checkISOFormatAndLength(t)&&n)return e.formattedValue(r,e.parseISODate(t));const o=e.getSeparator(t),l=e.getSeparator(r),i=t.split("").map((e=>e===o?l:e)).join("");if(n&&o!==l&&e.isDateValid(e.parseDate(r,i))){const[t,n]=e.findMatchedFormatAndValue(i,a);return e.formattedValue(r,e.parseDate(...e.additionalYears(t,n)))}return t};exports.buildDateChangeEvent=({allowEmptyValue:t,event:n,format:o,formats:l,selectedDate:i})=>{const{type:c,target:{id:s,name:u,value:d}}=n,{date:p,normalizedFormat:m,normalizedValue:f}=a(d,l),O="blur"===c&&e.isDateValid(i)?e.formattedValue(o,i):d,b=p?e.formatToISO(m,f):((e,t)=>t&&!e.length?e:null)(d,t);return{target:(g=r({},u&&{name:u},s&&{id:s}),y={value:{formattedValue:O,rawValue:b}},y=null!=y?y:{},Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(y)).forEach((function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(y,e))})),g)};var g,y},exports.getDateInputState=(e,t,r,a)=>({displayValue:o(e,t,r,a),selectedDate:n(e,r,a)}),exports.getDisplayValue=o,exports.getInitialSelectedDate=(t,r,a)=>e.checkISOFormatAndLength(t)?e.parseISODate(t):e.isValidLocaleDate(t,r)?e.parseDate(a,t):void 0,exports.getSelectedDate=n;
|
|
@@ -44,10 +44,24 @@ export interface DateInputProps extends Omit<TextboxProps, "value" | "formattedV
|
|
|
44
44
|
onPickerClose?: () => void;
|
|
45
45
|
/** Date format string to be applied to the date inputs */
|
|
46
46
|
dateFormatOverride?: string;
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
49
|
+
* Remove this prop; it has no effect.
|
|
50
|
+
*/
|
|
48
51
|
datePickerAriaLabel?: string;
|
|
49
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
54
|
+
* Remove this prop; it has no effect.
|
|
55
|
+
*/
|
|
50
56
|
datePickerAriaLabelledBy?: string;
|
|
57
|
+
/** Date input presentation. Typical is the default; legacy retains its icon trigger. */
|
|
58
|
+
variant?: "legacy" | "typical";
|
|
59
|
+
/**
|
|
60
|
+
* Number of years shown either side of the bounds (`minDate`/`maxDate`, or
|
|
61
|
+
* `pickerProps.startMonth`/`endMonth`) or the anchor year in the year
|
|
62
|
+
* selector dropdown. Defaults to 10.
|
|
63
|
+
*/
|
|
64
|
+
yearRangeOffset?: number;
|
|
51
65
|
}
|
|
52
66
|
export declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
53
67
|
export default DateInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./__internal__/utils.js"),a=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../__internal__/utils/helpers/events/events.js");require("../../style/utils/filter-styled-system-padding-props.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./__internal__/utils/utils.js"),a=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../__internal__/utils/helpers/events/events.js");require("../../style/utils/filter-styled-system-padding-props.js");var i=require("../../style/utils/filter-styled-system-margin-props.js"),l=require("../../style/utils/filter-out-styled-system-spacing-props.js"),o=require("./__internal__/date-formats/index.js"),u=require("./date.style.js"),s=require("../textbox/__internal__/__next__/text-input.component.js"),d=require("./__internal__/date-picker/date-picker.component.js"),c=require("../date-range/__internal__/date-range.context.js"),p=require("../../hooks/__internal__/useClickAwayListener/useClickAwayListener.js"),f=require("../../__internal__/utils/helpers/guid/index.js"),b=require("../../__internal__/utils/helpers/tags/tags.js"),y=require("../fieldset/__internal__/fieldset.context.js"),_=require("./__internal__/date-picker-trigger/date-picker-trigger.component.js"),g=require("./__internal__/hooks/useDatePickerState.js"),m=require("./__internal__/hooks/useDateInputState.js"),v=require("../../hooks/__internal__/useUniqueId/index.js");function k(e){return e&&e.__esModule?e:{default:e}}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),a.forEach((function(t){O(e,t,r[t])}))}return e}function j(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const h=k(t).default.forwardRef(((k,O)=>{var{adaptiveLabelBreakpoint:h,allowEmptyValue:x,autoFocus:w,"aria-describedby":q,"aria-labelledby":D,className:I,"data-element":C,"data-role":R,disabled:S,disablePortal:L=!0,helpAriaLabel:M,error:F,fieldHelp:W,id:A,inputHint:B,info:E,label:T,labelAlign:z,labelHelp:H,labelInline:N,labelSpacing:V,minDate:K,maxDate:$,onBlur:G,onChange:U,onClick:J,onFocus:Q,onKeyDown:X,pickerProps:Y,prefix:Z,readOnly:ee,required:te,reverse:re,size:ae="medium",tooltipPosition:ne,tooltipId:ie,value:le,inputWidth:oe,labelWidth:ue,maxWidth:se,inputName:de,onPickerClose:ce,onPickerOpen:pe,dateFormatOverride:fe,datePickerAriaLabel:be,datePickerAriaLabelledBy:ye,validationMessagePositionTop:_e=!0,validationIconId:ge,validationOnLabel:me,variant:ve="typical",warning:ke,name:Oe,yearRangeOffset:Pe}=k,je=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(k,["adaptiveLabelBreakpoint","allowEmptyValue","autoFocus","aria-describedby","aria-labelledby","className","data-element","data-role","disabled","disablePortal","helpAriaLabel","error","fieldHelp","id","inputHint","info","label","labelAlign","labelHelp","labelInline","labelSpacing","minDate","maxDate","onBlur","onChange","onClick","onFocus","onKeyDown","pickerProps","prefix","readOnly","required","reverse","size","tooltipPosition","tooltipId","value","inputWidth","labelWidth","maxWidth","inputName","onPickerClose","onPickerOpen","dateFormatOverride","datePickerAriaLabel","datePickerAriaLabelledBy","validationMessagePositionTop","validationIconId","validationOnLabel","variant","warning","name","yearRangeOffset"]);const he=t.useRef(null),xe=t.useRef(null),we=t.useRef(null),qe=t.useRef(null),De=t.useRef(!1),Ie=t.useRef(!1),Ce=a.default(),{dateFnsLocale:Re,dateFormatOverride:Se}=Ce.date,{format:Le,formats:Me}=t.useMemo((()=>o.default(Re(),fe||Se)),[Re,Se,fe]),{inputRefMap:Fe,setInputRefMap:We,validationMessagePositionTop:Ae}=t.useContext(c.default),{open:Be,setOpen:Ee,closePicker:Te,togglePicker:ze}=g.default({onPickerOpen:pe,onPickerClose:ce}),{displayValue:He,selectedDate:Ne,createDateChangeEvent:Ve,valueNeedsFormatting:Ke,trackEditedValue:$e}=m.default({allowEmptyValue:x,format:Le,formats:Me,value:le}),[Ge]=t.useState((()=>f.default())),[Ue]=t.useState((()=>`date-picker-${f.default()}`)),Je=null!=Ae?Ae:_e,{size:Qe}=t.useContext(y.default),Xe=Qe||ae,[Ye,Ze]=v.default(A,Oe),et=p.default((()=>{var e,t;Be&&(De.current=!0,null===(e=we.current)||void 0===e||e.focus(),Ie.current=!1,null===(t=we.current)||void 0===t||t.blur(),Te(),De.current=!1)}),"mousedown"),tt=t.useCallback((e=>{var t;we.current=e,xe.current=null==e?void 0:e.parentElement,O&&("function"==typeof O?O(e):O.current=e),de&&(null==Fe||null===(t=Fe[de])||void 0===t?void 0:t.setOpen)!==Ee&&(null==We||We({[de]:{isBlurBlocked:Ie,setOpen:Ee}}))}),[de,Fe,We,O,Ee]),rt=i.default(je);return e.jsxs(u.default,j(P(j(P({ref:he,role:"presentation",size:Xe,labelInline:N},rt),{applyDateRangeStyling:!!Fe,maxWidth:se,inputWidth:oe}),b.default("date",{"data-element":C,"data-role":R})),{className:`date date-${ve}`,children:[e.jsx(s.TextInput,j(P({},l.default(je)),{"aria-describedby":q,"aria-labelledby":D,autoFocus:w,className:I,"data-component":"date-input","data-role":"date-input-wrapper",disabled:S,error:F,id:Ye,inputHint:B,inputIcon:e.jsx(_.default,{disabled:S,open:Be,pickerId:Ue,readOnly:ee,size:Xe,datePickerTriggerRef:qe,variant:ve,onClick:e=>{S||ee||(null==J||J(e),Ie.current=!0,De.current=!0,ze())},onMouseDown:()=>{et(),S||ee||(Ie.current=!0,De.current=!0)}}),inputWidth:oe,label:null!=T?T:"",labelInline:N,maxWidth:null!=se?se:u.dateInputWidthBySize[Xe],name:Ze,onBlur:e=>{if(S||ee)return;const t=Ve({type:"blur",target:e.target});r.isDateValid(Ne)&&Ke&&U(t),Ie.current||G&&G(t)},onChange:e=>{$e(e.target.value),U(Ve({type:"change",target:e.target}))},onClick:e=>{J&&J(e),"typical"===ve&&Be&&L&&Te()},onFocus:e=>{S||ee||(Ie.current=!1,Q&&Q(e))},onKeyDown:e=>{if(X&&X(e),Be&&n.default.isTabKey(e)){if(n.default.isShiftKey(e))Te();else if(!L){var t,r;e.preventDefault(),null===(r=document)||void 0===r||null===(t=r.querySelector(`[id="${Ge}"]`))||void 0===t||t.focus()}De.current=!1}},onMouseDown:()=>{et(),We&&(Ie.current=!0),Be||null==pe||pe()},prefix:Z,readOnly:ee,ref:tt,required:te,size:Xe,validationMessagePositionTop:Je,value:He,warning:ke})),e.jsx(d.DatePicker,{disablePortal:L,inputContainerRef:xe,datePickerTriggerRef:qe,dayPickerProps:Y,selectedDate:Ne,onDayClick:(e,t)=>{U(Ve({type:"click",target:j(P({},t.target),{value:r.formattedValue(Le,e)})}))},minDate:K,maxDate:$,onPickerMouseDown:()=>{et(),Ie.current=!0},open:Be,onRequestPickerClose:Te,pickerTabGuardId:Ge,pickerId:Ue,size:Xe,yearRangeOffset:Pe})]}))}));exports.DateInput=h,exports.default=h;
|