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,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
|
+
import{checkISOFormatAndLength as t,parseISODate as e}from"../utils/utils.js";const a=a=>a&&t(a)?e(a):void 0,n=t=>{const e=Number(t);return Number.isSafeInteger(e)&&String(e)===t?e:void 0},o=({minDate:t,maxDate:e,startMonth:n,endMonth:o})=>{const r=n||a(t),l=o||a(e);return r&&l&&r>l?{minMonth:l,maxMonth:r}:{minMonth:r,maxMonth:l}},r=({minMonth:t,maxMonth:e,anchorYear:a,includedYear:n,offset:o})=>{var r,l;const h=Math.min(Math.max(a,null!==(r=null==t?void 0:t.getFullYear())&&void 0!==r?r:-1/0),null!==(l=null==e?void 0:e.getFullYear())&&void 0!==l?l:1/0),u=Math.min(Math.max(h,n-o),n+o),g=t?t.getFullYear()-o:u-o,m=e?e.getFullYear()+o:u+o;return Array.from({length:m-g+1},((t,e)=>g+e))},l=({displayedMonth:t,month:e,year:a})=>{const n=new Date(t);return n.setDate(1),n.setFullYear(a),n.setMonth(e),{date:n,month:e,year:a}},h=({selectedDate:t,month:e,year:a,minMonth:n,maxMonth:o})=>{const r=new Date(t),l=new Date(a,e+1,0).getDate();return r.setDate(1),r.setFullYear(a),r.setMonth(e),r.setDate(Math.min(t.getDate(),l)),n&&r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()&&r.getDate()<n.getDate()&&r.setDate(n.getDate()),o&&r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()&&r.getDate()>o.getDate()&&r.setDate(o.getDate()),r};export{r as buildYearRange,l as getMonthYearTransition,h as getSelectedDateForMonth,o as normalizeDateBounds,a as parseDateBound,n as parseSelectInteger};
|
|
@@ -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
|
-
export{DatePicker as default}from"./date-picker.component.js";
|
|
1
|
+
export{DatePicker,DatePicker as default}from"./date-picker.component.js";
|
package/esm/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
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import"react";import{LegacyDatePickerTrigger as o,DatePickerTriggerContainer as r,DatePickerTriggerDividerWrapper as i,DatePickerTriggerDivider as n,DatePickerTriggerButton as t}from"./date-picker-trigger.style.js";import l from"../../../icon/icon.component.js";import"../../../icon/icon.style.js";import d from"../../../../hooks/__internal__/useLocale/useLocale.js";const c=({disabled:c,open:s,pickerId:p,readOnly:u,size:m,datePickerTriggerRef:y,variant:g,onClick:f,onMouseDown:v})=>{var b,k;const $=d();return"legacy"===g?e(o,{"data-element":"calendar","data-role":"input-icon-toggle","aria-hidden":"true",$disabled:c,$readOnly:u,$size:m,onClick:f,onMouseDown:v,children:e(l,{type:"calendar_today"})}):a(r,{onMouseDown:v,children:[e(i,{children:e(n,{type:"vertical",p:0,$disabled:c,$readOnly:u})}),e(t,{ref:y,"data-element":"calendar","data-role":"input-icon-toggle",onClick:f,disabled:c||u,"aria-label":null===(b=(k=$.date.ariaLabels).openCalendarButton)||void 0===b?void 0:b.call(k),"aria-haspopup":"dialog","aria-controls":s?p:void 0,"aria-expanded":s,$size:m,$readOnly:u,size:m,variant:"default",variantType:"subtle",iconType:"calendar_today",m:0})]})};export{c as default};
|
|
@@ -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
|
+
import e,{css as r}from"styled-components";import{Button as i}from"../../../button/__next__/button.component.js";import{Divider as a}from"../../../divider/divider.component.js";import t from"../../../icon/icon.style.js";import{propsForSize as o}from"../../../button/__next__/button.config.js";import l from"../../../../__internal__/legacy-input/input-sizes.style.js";const n=e.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;"]),d=e.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[e].height),(({$disabled:e,$readOnly:r})=>e?"not-allowed":r?"default":"pointer"),(({$disabled:e,$readOnly:i})=>{let a="var(--input-typical-icon-default)";return i?a="var(--input-typical-icon-read-only)":e&&(a="var(--button-typical-subtle-label-disabled)"),r(["","{color:",";}"],t,a)})),s=e.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;"]),c=e(a).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:e,$readOnly:i})=>{let a="var(--input-typical-border-default)";return e?a="var(--input-typical-border-disabled)":i&&(a="var(--input-typical-border-read-only)"),r(['&& [data-role="divider-content"]{border-inline-start-color:',";opacity:1;}"],a)})),g=e(i).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:e,$readOnly:i})=>{let a="var(--input-typical-icon-default)";return i?a="var(--input-typical-icon-read-only)":e&&(a="var(--button-typical-subtle-label-disabled)"),r(["color:",";&& ","{color:",";}"],a,t,a)}),(({$size:e})=>o[e].height),t);export{g as DatePickerTriggerButton,n as DatePickerTriggerContainer,c as DatePickerTriggerDivider,s as DatePickerTriggerDividerWrapper,d as LegacyDatePickerTrigger};
|
|
@@ -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
|
+
const e=(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()}};export{e as default};
|
|
@@ -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
|
+
import{useState as e,useRef as t,useEffect as a}from"react";import{checkISOFormatAndLength as r,formattedValue as u,parseISODate as l,findMatchedFormatAndValue as o}from"../utils/utils.js";import{getDateInputState as d,buildDateChangeEvent as s}from"../utils/date-input-value.utils.js";const i=({allowEmptyValue:i,format:n,formats:c,value:p})=>{const[m,f]=e(!0),V=t({}),v=m||p!==V.current.editedInputValue;a((()=>{m||p===V.current.valuePropBeforeEdit||p===V.current.editedInputValue||(V.current={},f(!0))}),[m,p]);const{displayValue:E,selectedDate:y}=d(p,n,c,v),D=r(p)?u(n,l(p)):p,[,I]=o(D,c),g=u(n,y)!==I;return{displayValue:E,selectedDate:y,createDateChangeEvent:e=>s({allowEmptyValue:i,event:e,format:n,formats:c,selectedDate:y}),valueNeedsFormatting:g,trackEditedValue:e=>{V.current={editedInputValue:e,valuePropBeforeEdit:p},f(!1)}}};export{i as default};
|
|
@@ -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
|
+
import{useEffect as e}from"react";import t from"./focusDayWithPickerDescription.js";const r=({open:r,pickerDescriptionId:o,getPickerDayFocusTarget:i,resetChangedSelector:c})=>{e((()=>{if(!r)return void c();let e;const s=setTimeout((()=>{const r=i();r&&(e=t(r,o))}),0);return()=>{clearTimeout(s),null==e||e()}}),[i,r,o,c])};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useContext as t,useEffect as e}from"react";import a from"../../../flat-table/__internal__/flat-table.context.js";const l=l=>{const{isInFlatTable:n,setHasOpenDatePicker:r}=t(a);return e((()=>{if(l)return null==r||r(!0),()=>null==r?void 0:r(!1)}),[l,r]),{isInFlatTable:n}};export{l as default};
|
|
@@ -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
|
+
import{useRef as e,useCallback as t}from"react";import r from"../../../../__internal__/utils/helpers/events/events.js";const n=[".rdp-day_button:focus",".rdp-selected .rdp-day_button",'.rdp-day_button[aria-selected="true"]'],o=[".rdp-today .rdp-day_button"],a=".rdp-day_button",l=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)),d=(e,t)=>e&&t.flatMap((t=>Array.from(e.querySelectorAll(t)))).find(l)||null,u=(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=>l(e)&&!t.includes(e)&&!e.matches(a)&&!e.matches('[data-role="date-picker-tab-guard"]'))),c=({ref:c,open:i,monthSelectId:s,yearSelectId:p,onEscape:f})=>{const y=e(null),b=t((()=>d(c.current,n)||d(c.current,o)||d(c.current,[a])),[c]),m=t((e=>{var t;return null===(t=c.current)||void 0===t?void 0:t.querySelector(`[id="${e}"]`)}),[c]),h=t((()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.querySelector('[data-role="date-picker-close"]')}),[c]),v=t((e=>{i&&r.isEscKey(e)&&(e.stopPropagation(),f())}),[f,i]),_=t((e=>{if(!r.isTabKey(e))return;const t=document.activeElement;if(!t)return;const n=Boolean(t.classList.contains("rdp-day_button")||t.closest(".rdp-day_button")),o=m(s),a=m(p),i=h(),f=b(),v=[f,i,o,a].filter(l),_=[...v,...u(c.current,v)],g=n?f:t,S=t=>{if(!g)return;const r=_.indexOf(g);if(-1===r)return;e.preventDefault();const n=(r+t+_.length)%_.length;_[n].focus()};if(r.isShiftKey(e))return y.current=null,void S(-1);if("month"===y.current&&t===o||"year"===y.current&&t===a){y.current=null;const t=d(c.current,[".rdp-day:not(.rdp-outside) .rdp-day_button"])||b();t?(e.preventDefault(),t.focus()):S(1)}else S(1)}),[h,b,m,s,c,p]),g=t((e=>{const t=y.current;if(!t)return;const r="month"===t?s:p;e.target===m(r)&&(y.current=null)}),[m,s,p]),S=t((e=>{y.current=e}),[]),x=t((()=>{y.current=null}),[]);return{getPickerDayFocusTarget:b,handleBlur:g,handleKeyDown:_,handleKeyUp:v,markSelectorChanged:S,resetChangedSelector:x}};export{c as default};
|
|
@@ -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
|
+
import{useMemo as e}from"react";import a from"../../../../hooks/__internal__/useLocale/useLocale.js";const o=()=>{var o,t,l,r,d,s;const i=a(),n=i.date.dateFnsLocale(),{localize:c,options:u}=n,L=n.code.split("-")[0].toLowerCase(),{weekdaysLong:k,weekdaysShort:w}=e((()=>{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===(d=(s=i.date.ariaLabels).closeButton)||void 0===d?void 0:d.call(s),localize:c,weekStartsOn:null==u?void 0:u.weekStartsOn,weekdaysLong:k,weekdaysShort:w}};export{o as default};
|
|
@@ -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
|
+
import{useRef as e,useEffect as t}from"react";const o=({open:o,selectedDate:n,focusedMonth:l,setFocusedMonth:r})=>{const c=e();t((()=>{const e=null==n?void 0:n.getTime(),t=c.current!==e;c.current=e,!n||o&&!t||(null==l?void 0:l.getMonth())===n.getMonth()&&l.getFullYear()===n.getFullYear()||r(n)}),[l,o,n,r])};export{o as default};
|
|
@@ -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
|
+
import{useMemo as t,useRef as e}from"react";import{normalizeDateBounds as n,buildYearRange as o,parseSelectInteger as a,getMonthYearTransition as r}from"../date-picker/date-picker.utils.js";const l=10,i=({minDate:l,maxDate:i,dayPickerProps:d,focusedMonth:u,setFocusedMonth:h,markSelectorChanged:m,yearRangeOffset:s=10})=>{var c,v;const M=t((()=>n({minDate:l,maxDate:i,startMonth:null==d?void 0:d.startMonth,endMonth:null==d?void 0:d.endMonth})),[l,i,null==d?void 0:d.startMonth,null==d?void 0:d.endMonth]),{minMonth:g,maxMonth:y}=M,f=null!=u?u:new Date,p=e(),x=(null===(c=p.current)||void 0===c?void 0:c.min)!==(null==g?void 0:g.getTime())||(null===(v=p.current)||void 0===v?void 0:v.max)!==(null==y?void 0:y.getTime());p.current={min:null==g?void 0:g.getTime(),max:null==y?void 0:y.getTime()};const D=x&&g&&f<g?g:x&&y&&f>y?y:f,Y=D.getFullYear(),k=e(Y),T=t((()=>o({minMonth:g,maxMonth:y,anchorYear:k.current,includedYear:Y,offset:s})),[Y,g,y,s]),C=({month:t,year:e})=>{const n=r({displayedMonth:D,month:t,year:e});return h(n.date),n};return{displayedMonth:D,years:T,handleMonthChange:t=>{const e=a(t.target.value);if(void 0===e||e<0||e>11)return;m("month");const n=D.getFullYear();C({month:e,year:n})},handleYearChange:t=>{const e=a(t.target.value);void 0!==e&&T.includes(e)&&(m("year"),C({month:D.getMonth(),year:e}))}}};export{l as DEFAULT_YEAR_RANGE_OFFSET,i as default};
|
|
@@ -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
|
+
import{useState as e,useCallback as n}from"react";const l=({onPickerOpen:l,onPickerClose:o})=>{const[r,c]=e(!1),t=n((()=>{r||(c(!0),null==l||l())}),[l,r]),i=n((()=>{r&&(c(!1),null==o||o())}),[o,r]),p=n((()=>{r?(c(!1),null==o||o()):(c(!0),null==l||l())}),[o,l,r]);return{open:r,setOpen:c,openPicker:t,closePicker:i,togglePicker:p}};export{l as default};
|
|
@@ -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
|
+
import{isDateValid as e,formattedValue as t,formatToISO as r,checkISOFormatAndLength as n,parseISODate as o,getSeparator as a,parseDate as l,findMatchedFormatAndValue as i,additionalYears as c,isValidLocaleDate as u}from"./utils.js";function s(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]:{},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){s(e,t,r[t])}))}return e}const f=(t,r)=>{const[n,o]=i(t,r);if(!n||!o)return{date:void 0,normalizedFormat:"",normalizedValue:""};const[a,u]=c(n,o),s=l(a,u);return{date:e(s)?s:void 0,normalizedFormat:a,normalizedValue:u}},m=(e,t,r)=>n(e)?o(e):u(e,t)?l(r,e):void 0,b=(e,t,r)=>{const{date:a}=f(e,t);return a||(n(e)&&r?o(e):void 0)},d=(r,u,s,p)=>{if(n(r)&&p)return t(u,o(r));const f=a(r),m=a(u),b=r.split("").map((e=>e===f?m:e)).join("");if(p&&f!==m&&e(l(u,b))){const[e,r]=i(b,s);return t(u,l(...c(e,r)))}return r},O=(e,t,r,n)=>({displayValue:d(e,t,r,n),selectedDate:b(e,r,n)}),y=({allowEmptyValue:n,event:o,format:a,formats:l,selectedDate:i})=>{const{type:c,target:{id:u,name:s,value:m}}=o,{date:b,normalizedFormat:d,normalizedValue:O}=f(m,l),y="blur"===c&&e(i)?t(a,i):m,j=b?r(d,O):((e,t)=>t&&!e.length?e:null)(m,n);return{target:(g=p({},s&&{name:s},u&&{id:u}),v={value:{formattedValue:y,rawValue:j}},v=null!=v?v:{},Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(v)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(v)).forEach((function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(v,e))})),g)};var g,v};export{y as buildDateChangeEvent,O as getDateInputState,d as getDisplayValue,m as getInitialSelectedDate,b as getSelectedDate};
|
|
@@ -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
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useMemo as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useMemo as a,useContext as i,useState as l,useCallback as o}from"react";import{isDateValid as s,formattedValue as u}from"./__internal__/utils/utils.js";import p from"../../hooks/__internal__/useLocale/useLocale.js";import c from"../../__internal__/utils/helpers/events/events.js";import"../../style/utils/filter-styled-system-padding-props.js";import d from"../../style/utils/filter-styled-system-margin-props.js";import m from"../../style/utils/filter-out-styled-system-spacing-props.js";import f from"./__internal__/date-formats/index.js";import b,{dateInputWidthBySize as y}from"./date.style.js";import{TextInput as _}from"../textbox/__internal__/__next__/text-input.component.js";import{DatePicker as g}from"./__internal__/date-picker/date-picker.component.js";import k from"../date-range/__internal__/date-range.context.js";import v from"../../hooks/__internal__/useClickAwayListener/useClickAwayListener.js";import O from"../../__internal__/utils/helpers/guid/index.js";import P from"../../__internal__/utils/helpers/tags/tags.js";import j from"../fieldset/__internal__/fieldset.context.js";import h from"./__internal__/date-picker-trigger/date-picker-trigger.component.js";import w from"./__internal__/hooks/useDatePickerState.js";import D from"./__internal__/hooks/useDateInputState.js";import x from"../../hooks/__internal__/useUniqueId/index.js";function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(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){I(e,t,r[t])}))}return e}function L(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 S=r.forwardRef(((r,I)=>{var{adaptiveLabelBreakpoint:S,allowEmptyValue:F,autoFocus:R,"aria-describedby":A,"aria-labelledby":W,className:B,"data-element":E,"data-role":M,disabled:T,disablePortal:z=!0,helpAriaLabel:H,error:N,fieldHelp:q,id:K,inputHint:V,info:$,label:G,labelAlign:U,labelHelp:J,labelInline:Q,labelSpacing:X,minDate:Y,maxDate:Z,onBlur:ee,onChange:te,onClick:re,onFocus:ne,onKeyDown:ae,pickerProps:ie,prefix:le,readOnly:oe,required:se,reverse:ue,size:pe="medium",tooltipPosition:ce,tooltipId:de,value:me,inputWidth:fe,labelWidth:be,maxWidth:ye,inputName:_e,onPickerClose:ge,onPickerOpen:ke,dateFormatOverride:ve,datePickerAriaLabel:Oe,datePickerAriaLabelledBy:Pe,validationMessagePositionTop:je=!0,validationIconId:he,validationOnLabel:we,variant:De="typical",warning:xe,name:Ie,yearRangeOffset:Ce}=r,Le=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["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 Se=n(null),Fe=n(null),Re=n(null),Ae=n(null),We=n(!1),Be=n(!1),Ee=p(),{dateFnsLocale:Me,dateFormatOverride:Te}=Ee.date,{format:ze,formats:He}=a((()=>f(Me(),ve||Te)),[Me,Te,ve]),{inputRefMap:Ne,setInputRefMap:qe,validationMessagePositionTop:Ke}=i(k),{open:Ve,setOpen:$e,closePicker:Ge,togglePicker:Ue}=w({onPickerOpen:ke,onPickerClose:ge}),{displayValue:Je,selectedDate:Qe,createDateChangeEvent:Xe,valueNeedsFormatting:Ye,trackEditedValue:Ze}=D({allowEmptyValue:F,format:ze,formats:He,value:me}),[et]=l((()=>O())),[tt]=l((()=>`date-picker-${O()}`)),rt=null!=Ke?Ke:je,{size:nt}=i(j),at=nt||pe,[it,lt]=x(K,Ie),ot=v((()=>{var e,t;Ve&&(We.current=!0,null===(e=Re.current)||void 0===e||e.focus(),Be.current=!1,null===(t=Re.current)||void 0===t||t.blur(),Ge(),We.current=!1)}),"mousedown"),st=o((e=>{var t;Re.current=e,Fe.current=null==e?void 0:e.parentElement,I&&("function"==typeof I?I(e):I.current=e),_e&&(null==Ne||null===(t=Ne[_e])||void 0===t?void 0:t.setOpen)!==$e&&(null==qe||qe({[_e]:{isBlurBlocked:Be,setOpen:$e}}))}),[_e,Ne,qe,I,$e]),ut=d(Le);return e(b,L(C(L(C({ref:Se,role:"presentation",size:at,labelInline:Q},ut),{applyDateRangeStyling:!!Ne,maxWidth:ye,inputWidth:fe}),P("date",{"data-element":E,"data-role":M})),{className:`date date-${De}`,children:[t(_,L(C({},m(Le)),{"aria-describedby":A,"aria-labelledby":W,autoFocus:R,className:B,"data-component":"date-input","data-role":"date-input-wrapper",disabled:T,error:N,id:it,inputHint:V,inputIcon:t(h,{disabled:T,open:Ve,pickerId:tt,readOnly:oe,size:at,datePickerTriggerRef:Ae,variant:De,onClick:e=>{T||oe||(null==re||re(e),Be.current=!0,We.current=!0,Ue())},onMouseDown:()=>{ot(),T||oe||(Be.current=!0,We.current=!0)}}),inputWidth:fe,label:null!=G?G:"",labelInline:Q,maxWidth:null!=ye?ye:y[at],name:lt,onBlur:e=>{if(T||oe)return;const t=Xe({type:"blur",target:e.target});s(Qe)&&Ye&&te(t),Be.current||ee&&ee(t)},onChange:e=>{Ze(e.target.value),te(Xe({type:"change",target:e.target}))},onClick:e=>{re&&re(e),"typical"===De&&Ve&&z&&Ge()},onFocus:e=>{T||oe||(Be.current=!1,ne&&ne(e))},onKeyDown:e=>{if(ae&&ae(e),Ve&&c.isTabKey(e)){if(c.isShiftKey(e))Ge();else if(!z){var t,r;e.preventDefault(),null===(r=document)||void 0===r||null===(t=r.querySelector(`[id="${et}"]`))||void 0===t||t.focus()}We.current=!1}},onMouseDown:()=>{ot(),qe&&(Be.current=!0),Ve||null==ke||ke()},prefix:le,readOnly:oe,ref:st,required:se,size:at,validationMessagePositionTop:rt,value:Je,warning:xe})),t(g,{disablePortal:z,inputContainerRef:Fe,datePickerTriggerRef:Ae,dayPickerProps:ie,selectedDate:Qe,onDayClick:(e,t)=>{te(Xe({type:"click",target:L(C({},t.target),{value:u(ze,e)})}))},minDate:Y,maxDate:Z,onPickerMouseDown:()=>{ot(),Be.current=!0},open:Ve,onRequestPickerClose:Ge,pickerTabGuardId:et,pickerId:tt,size:at,yearRangeOffset:Ce})]}))}));export{S as DateInput,S as default};
|
|
@@ -3,7 +3,7 @@ interface StyledDateInputProps extends Pick<DateInputProps, "inputWidth" | "maxW
|
|
|
3
3
|
applyDateRangeStyling?: boolean;
|
|
4
4
|
size: Required<DateInputProps>["size"];
|
|
5
5
|
}
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const dateInputWidthBySize: {
|
|
7
7
|
large: string;
|
|
8
8
|
medium: string;
|
|
9
9
|
small: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a,{css as e}from"styled-components";import{margin as t}from"styled-system";import l from"../../style/themes/apply-base-theme.js";import i from"../../__internal__/validation-message/validation-message.style.js";import n from"../../__internal__/label/label.style.js";const o={large:"176px",medium:"144px",small:"128px"},p=a.div.attrs(l).withConfig({displayName:"date.style__StyledDateInput",componentId:"carbon_v162_13_0__sc-a4e372a9-0"})(["margin-bottom:var(--fieldSpacing);"," "," "," ",""],t,(({labelInline:a})=>a&&e(['[data-component="date-input"]{gap:var(--global-space-comp-m);}'])),(({inputWidth:a,maxWidth:t,size:l})=>!a&&e(['[data-role="input-wrapper"]{width:',";max-width:100%;}"],null!=t?t:o[l])),(({applyDateRangeStyling:a,labelInline:t,maxWidth:l,size:p})=>a&&e(['[data-role="input-wrapper"]{width:',";flex:0 0 auto;}",""],null!=l?l:o[p],!t&&e(["",",","{overflow-wrap:anywhere;}"],i,n))));export{o as dateInputWidthBySize,p as default};
|
|
@@ -85,13 +85,25 @@ export interface DateRangeProps extends StyledDateRangeProps, MarginProps, TagPr
|
|
|
85
85
|
required?: boolean;
|
|
86
86
|
/** Date format string to be applied to the date inputs */
|
|
87
87
|
dateFormatOverride?: string;
|
|
88
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
90
|
+
* Remove this prop; it has no effect.
|
|
91
|
+
*/
|
|
89
92
|
datePickerStartAriaLabel?: string;
|
|
90
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
95
|
+
* Remove this prop; it has no effect.
|
|
96
|
+
*/
|
|
91
97
|
datePickerStartAriaLabelledBy?: string;
|
|
92
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
100
|
+
* Remove this prop; it has no effect.
|
|
101
|
+
*/
|
|
93
102
|
datePickerEndAriaLabel?: string;
|
|
94
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* @deprecated The dialog label is now always derived from the locale (`date.ariaLabels.chooseDate`).
|
|
105
|
+
* Remove this prop; it has no effect.
|
|
106
|
+
*/
|
|
95
107
|
datePickerEndAriaLabelledBy?: string;
|
|
96
108
|
/** Render the ValidationMessage above the Date inputs when validationRedesignOptIn flag is set */
|
|
97
109
|
validationMessagePositionTop?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useContext as r,useMemo as a,useState as n,useCallback as l,useEffect as o}from"react";import{checkISOFormatAndLength as i,formattedValue as s,parseISODate as d,formatToISO as u}from"../date/__internal__/utils.js";import{DateInput as c}from"../date/date.component.js";import"../../style/utils/filter-styled-system-padding-props.js";import p from"../../style/utils/filter-styled-system-margin-props.js";import m from"../../__internal__/utils/helpers/tags/tags.js";import f from"./date-range.style.js";import b from"../../__internal__/utils/helpers/events/events.js";import y from"../../hooks/__internal__/useLocale/useLocale.js";import v from"../../hooks/__internal__/usePrevious/index.js";import O from"../date/__internal__/date-formats/index.js";import g from"./__internal__/date-range.context.js";import P from"../carbon-provider/__internal__/new-validation.context.js";function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(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){_(e,t,r[t])}))}return e}function k(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 w=_=>{var{endDateProps:w={},id:B,labelsInline:h,name:L,onBlur:V,onChange:E,startDateProps:A={},tooltipPosition:S,validationOnLabel:D,value:x,startRef:I,endRef:R,required:F,dateFormatOverride:M,datePickerStartAriaLabel:T,datePickerStartAriaLabelledBy:K,datePickerEndAriaLabel:$,datePickerEndAriaLabelledBy:q,validationMessagePositionTop:C=!0}=_,N=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},l=Object.keys(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(_,["endDateProps","id","labelsInline","name","onBlur","onChange","startDateProps","tooltipPosition","validationOnLabel","value","startRef","endRef","required","dateFormatOverride","datePickerStartAriaLabel","datePickerStartAriaLabelledBy","datePickerEndAriaLabel","datePickerEndAriaLabelledBy","validationMessagePositionTop"]);const{validationRedesignOptIn:W}=r(P),z=!W&&h,G=y(),{dateFnsLocale:H,dateFormatOverride:J}=G.date,{format:Q}=a((()=>O(H(),M||J)),[H,M,J]),[U,X]=n(""),Y=l((e=>i(e)?s(Q,d(e)):e),[Q]),Z=l((()=>{const{value:e}=A;return Y(e||x[0])}),[A,x,Y]),ee=l((()=>{const{value:e}=w;return Y(e||x[1])}),[w,x,Y]),[te,re]=n({start:{isBlurBlocked:{current:!1},setOpen:null},end:{isBlurBlocked:{current:!1},setOpen:null}});function ae(e,t){return e&&!t.length}const[ne,le]=n({formattedValue:Z(),rawValue:ae(!!A.allowEmptyValue,Z())?"":u(Q,Z())}),[oe,ie]=n({formattedValue:ee(),rawValue:ae(!!w.allowEmptyValue,ee())?"":u(Q,ee())}),se=v(x);o((()=>{(null==se?void 0:se.length)&&(x[0]!==se[0]||x[1]!==se[1])&&(le({formattedValue:Z(),rawValue:ae(!!A.allowEmptyValue,Z())?"":u(Q,Z())}),ie({formattedValue:ee(),rawValue:ae(!!w.allowEmptyValue,ee())?"":u(Q,ee())}))}),[x,se,w.allowEmptyValue,Q,ee,Z,A.allowEmptyValue]);const de=l(((e,t)=>{const r="start"===e?t:ne,a="end"===e?t:oe;return X(e),{target:k(j({},L&&{name:L},B&&{id:B}),{value:[r,a]})}}),[oe,B,L,ne]),ue=(e,t)=>{"start"===e?le(j({},t.target.value)):ie(j({},t.target.value));const r=de(e,t.target.value);E(r)},ce=e=>{ue("start",e)},pe=e=>{ue("end",e)},me=e=>{var t,r;if(!(null==te||null===(t=te.start)||void 0===t?void 0:t.isBlurBlocked.current)&&!(null==te||null===(r=te.end)||void 0===r?void 0:r.isBlurBlocked.current)&&V){const t=de(U,e.target.value);V(t)}},fe=e=>{(e=>{const t=null==te?void 0:te[e];var r;t&&(null===(r=t.setOpen)||void 0===r||r.call(t,!1),t.isBlurBlocked.current=!1)})(e),X("start"===e?"end":"start")},be=e=>{const t="start"===e?A:w,{formattedValue:r}="start"===e?ne:oe,a="start"===e?ce:pe;return k(j({label:N[`${e}Label`],labelInline:z,value:r,error:N[`${e}Error`],warning:N[`${e}Warning`],info:N[`${e}Info`],validationOnLabel:D,onBlur:me,onChange:a,onKeyDown:t=>((e,t)=>{b.isTabKey(e)&&b.isShiftKey(e)&&(null==te?void 0:te.start)?te.start.isBlurBlocked.current=!("start"===t):b.isTabKey(e)&&(null==te?void 0:te.end)&&(te.end.isBlurBlocked.current=!("end"===t))})(t,e)},t),{required:F})};return e(f,k(j(k(j({},m("date-range",N)),{labelsInline:z}),p(N)),{validationMessagePositionTop:C,children:t(g.Provider,{value:{inputRefMap:te,setInputRefMap:e=>{re((t=>j({},t,e)))},validationMessagePositionTop:C},children:[e(c,k(j({my:0},be("start")),{onFocus:()=>fe("end"),"data-element":"start-date",inputName:"start",labelWidth:40,tooltipPosition:S,ref:I,datePickerAriaLabel:T,datePickerAriaLabelledBy:K})),e(c,k(j({my:0},be("end")),{onFocus:()=>fe("start"),"data-element":"end-date",inputName:"end",labelWidth:40,tooltipPosition:S,ref:R,datePickerAriaLabel:$,datePickerAriaLabelledBy:q}))]})}))};w.displayName="DateRange";export{w as DateRange,w as default};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useContext as r,useMemo as a,useState as n,useCallback as l,useEffect as o}from"react";import{checkISOFormatAndLength as i,formattedValue as s,parseISODate as d,formatToISO as u}from"../date/__internal__/utils/utils.js";import{DateInput as c}from"../date/date.component.js";import"../../style/utils/filter-styled-system-padding-props.js";import p from"../../style/utils/filter-styled-system-margin-props.js";import m from"../../__internal__/utils/helpers/tags/tags.js";import f from"./date-range.style.js";import b from"../../__internal__/utils/helpers/events/events.js";import y from"../../hooks/__internal__/useLocale/useLocale.js";import v from"../../hooks/__internal__/usePrevious/index.js";import O from"../date/__internal__/date-formats/index.js";import g from"./__internal__/date-range.context.js";import P from"../carbon-provider/__internal__/new-validation.context.js";function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(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){_(e,t,r[t])}))}return e}function k(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 w=_=>{var{endDateProps:w={},id:B,labelsInline:h,name:L,onBlur:V,onChange:E,startDateProps:A={},tooltipPosition:S,validationOnLabel:D,value:x,startRef:I,endRef:R,required:F,dateFormatOverride:M,datePickerStartAriaLabel:T,datePickerStartAriaLabelledBy:K,datePickerEndAriaLabel:$,datePickerEndAriaLabelledBy:q,validationMessagePositionTop:C=!0}=_,N=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},l=Object.keys(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(_,["endDateProps","id","labelsInline","name","onBlur","onChange","startDateProps","tooltipPosition","validationOnLabel","value","startRef","endRef","required","dateFormatOverride","datePickerStartAriaLabel","datePickerStartAriaLabelledBy","datePickerEndAriaLabel","datePickerEndAriaLabelledBy","validationMessagePositionTop"]);const{validationRedesignOptIn:W}=r(P),z=!W&&h,G=y(),{dateFnsLocale:H,dateFormatOverride:J}=G.date,{format:Q}=a((()=>O(H(),M||J)),[H,M,J]),[U,X]=n(""),Y=l((e=>i(e)?s(Q,d(e)):e),[Q]),Z=l((()=>{const{value:e}=A;return Y(e||x[0])}),[A,x,Y]),ee=l((()=>{const{value:e}=w;return Y(e||x[1])}),[w,x,Y]),[te,re]=n({start:{isBlurBlocked:{current:!1},setOpen:null},end:{isBlurBlocked:{current:!1},setOpen:null}});function ae(e,t){return e&&!t.length}const[ne,le]=n({formattedValue:Z(),rawValue:ae(!!A.allowEmptyValue,Z())?"":u(Q,Z())}),[oe,ie]=n({formattedValue:ee(),rawValue:ae(!!w.allowEmptyValue,ee())?"":u(Q,ee())}),se=v(x);o((()=>{(null==se?void 0:se.length)&&(x[0]!==se[0]||x[1]!==se[1])&&(le({formattedValue:Z(),rawValue:ae(!!A.allowEmptyValue,Z())?"":u(Q,Z())}),ie({formattedValue:ee(),rawValue:ae(!!w.allowEmptyValue,ee())?"":u(Q,ee())}))}),[x,se,w.allowEmptyValue,Q,ee,Z,A.allowEmptyValue]);const de=l(((e,t)=>{const r="start"===e?t:ne,a="end"===e?t:oe;return X(e),{target:k(j({},L&&{name:L},B&&{id:B}),{value:[r,a]})}}),[oe,B,L,ne]),ue=(e,t)=>{"start"===e?le(j({},t.target.value)):ie(j({},t.target.value));const r=de(e,t.target.value);E(r)},ce=e=>{ue("start",e)},pe=e=>{ue("end",e)},me=e=>{var t,r;if(!(null==te||null===(t=te.start)||void 0===t?void 0:t.isBlurBlocked.current)&&!(null==te||null===(r=te.end)||void 0===r?void 0:r.isBlurBlocked.current)&&V){const t=de(U,e.target.value);V(t)}},fe=e=>{(e=>{const t=null==te?void 0:te[e];var r;t&&(null===(r=t.setOpen)||void 0===r||r.call(t,!1),t.isBlurBlocked.current=!1)})(e),X("start"===e?"end":"start")},be=e=>{const t="start"===e?A:w,{formattedValue:r}="start"===e?ne:oe,a="start"===e?ce:pe;return k(j({label:N[`${e}Label`],labelInline:z,value:r,error:N[`${e}Error`],warning:N[`${e}Warning`],info:N[`${e}Info`],validationOnLabel:D,onBlur:me,onChange:a,onKeyDown:t=>((e,t)=>{b.isTabKey(e)&&b.isShiftKey(e)&&(null==te?void 0:te.start)?te.start.isBlurBlocked.current=!("start"===t):b.isTabKey(e)&&(null==te?void 0:te.end)&&(te.end.isBlurBlocked.current=!("end"===t))})(t,e)},t),{required:F})};return e(f,k(j(k(j({},m("date-range",N)),{labelsInline:z}),p(N)),{validationMessagePositionTop:C,children:t(g.Provider,{value:{inputRefMap:te,setInputRefMap:e=>{re((t=>j({},t,e)))},validationMessagePositionTop:C},children:[e(c,k(j({my:0},be("start")),{onFocus:()=>fe("end"),"data-element":"start-date",inputName:"start",labelWidth:40,tooltipPosition:S,ref:I,datePickerAriaLabel:T,datePickerAriaLabelledBy:K})),e(c,k(j({my:0},be("end")),{onFocus:()=>fe("start"),"data-element":"end-date",inputName:"end",labelWidth:40,tooltipPosition:S,ref:R,datePickerAriaLabel:$,datePickerAriaLabelledBy:q}))]})}))};w.displayName="DateRange";export{w as DateRange,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"styled-components";import{margin as e}from"styled-system";import a from"../date/date.style.js";import i from"../../style/themes/apply-base-theme.js";const o=t.div.attrs(i).withConfig({displayName:"date-range.style__StyledDateRange",componentId:"
|
|
1
|
+
import t from"styled-components";import{margin as e}from"styled-system";import a from"../date/date.style.js";import i from"../../style/themes/apply-base-theme.js";const o=t.div.attrs(i).withConfig({displayName:"date-range.style__StyledDateRange",componentId:"carbon_v162_13_0__sc-91656d90-0"})([""," margin-bottom:var(--fieldSpacing);"," & ","{display:inline-block;vertical-align:",";}& ",":first-of-type{margin-right:var(--spacing300);}"],(({validationMessagePositionTop:t})=>`\n display: flex;\n align-items: ${t?"flex-end":"flex-start"};\n `),e,a,(({labelsInline:t})=>t?"top":"bottom"),a);export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"styled-components";import{Button as t}from"../../button/__next__/button.component.js";const e=o(t).withConfig({displayName:"decimal-popover-button.style__StyledDecimalPopoverButton",componentId:"
|
|
1
|
+
import o from"styled-components";import{Button as t}from"../../button/__next__/button.component.js";const e=o(t).withConfig({displayName:"decimal-popover-button.style__StyledDecimalPopoverButton",componentId:"carbon_v162_13_0__sc-2527bb44-0"})(["border-radius:0 var(--global-radius-action-m) var(--global-radius-action-m) 0;border-left:none;"]);export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"styled-components";const t=o.span.withConfig({displayName:"decimal.style__StyledSuffix",componentId:"
|
|
1
|
+
import o from"styled-components";const t=o.span.withConfig({displayName:"decimal.style__StyledSuffix",componentId:"carbon_v162_13_0__sc-821f41bb-0"})(["font:var(--global-font-static-comp-medium-m);margin-right:var(--global-space-comp-m);"]);export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{css as a}from"styled-components";import{space as e}from"styled-system";import i from"../../style/themes/apply-base-theme.js";const n=t.dl.attrs(i).withConfig({displayName:"definition-list.style__StyledDl",componentId:"
|
|
1
|
+
import t,{css as a}from"styled-components";import{space as e}from"styled-system";import i from"../../style/themes/apply-base-theme.js";const n=t.dl.attrs(i).withConfig({displayName:"definition-list.style__StyledDl",componentId:"carbon_v162_13_0__sc-4c92740a-0"})([""," width:100%;height:auto;background-color:transparent;"],e),l={small:"var(--global-space-comp-xs)",large:"var(--global-space-comp-m)"},o=t.div.attrs(i).withConfig({displayName:"definition-list.style__StyledDlPair",componentId:"carbon_v162_13_0__sc-4c92740a-1"})([""," "," ",""],(({asSingleColumn:t,w:e})=>t?a(["display:block;"]):a(["display:grid;grid-template-columns:","% minmax(0,1fr);"],e)),(({spacing:t,divider:e})=>a(["padding-bottom:",";",""],l[t||"large"],e&&a(["padding-top:",";"],l[t||"large"]))),(({divider:t,isLast:e})=>t&&!e&&a(["border-bottom:var(--global-borderwidth-xs) solid var(--container-standard-border-default);"]))),d=t.dt.attrs(i).withConfig({displayName:"definition-list.style__StyledDt",componentId:"carbon_v162_13_0__sc-4c92740a-2"})(["margin:var(--global-space-none);"," font:var(--global-font-static-comp-medium-s);color:var(--container-standard-txt-default);"," ",' > [data-element="dt-content"]{max-width:var(--container-size-layout-maxwidth-s);'," ","}"],e,(({asSingleColumn:t})=>!t&&a(["grid-column:1;"])),(({dtTextAlign:t})=>a(["text-align:",";"],t)),(({dtTextAlign:t})=>"center"===t&&a(["margin-inline:auto;"])),(({dtTextAlign:t})=>"right"===t&&a(["margin-left:auto;"]))),r=t.dd.withConfig({displayName:"definition-list.style__StyledDd",componentId:"carbon_v162_13_0__sc-4c92740a-3"})(["margin:var(--global-space-none);"," font:var(--global-font-static-comp-regular-s);color:var(--container-standard-txt-default);display:flex;align-items:flex-start;justify-content:space-between;gap:var(--global-space-comp-l);"," ",' > [data-element="dd-content"]{flex:1;min-width:0;max-width:var(--container-size-layout-maxwidth-s);'," ",'}> [data-element="dd-right-children"]{flex-shrink:0;}'],e,(({asSingleColumn:t})=>!t&&a(["grid-column:2;"])),(({ddTextAlign:t})=>a(["text-align:",";"],t)),(({ddTextAlign:t})=>"center"===t&&a(["margin-inline:auto;"])),(({ddTextAlign:t})=>"right"===t&&a(["margin-left:auto;"])));export{r as StyledDd,n as StyledDl,o as StyledDlPair,d as StyledDt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{css as i}from"styled-components";import{margin as e}from"styled-system";import o from"../../style/themes/apply-base-theme.js";import a from"../icon/icon.component.js";import"../icon/icon.style.js";const l="16px",n=t.div.attrs(o).withConfig({displayName:"detail.style__StyledDetail",componentId:"
|
|
1
|
+
import t,{css as i}from"styled-components";import{margin as e}from"styled-system";import o from"../../style/themes/apply-base-theme.js";import a from"../icon/icon.component.js";import"../icon/icon.style.js";const l="16px",n=t.div.attrs(o).withConfig({displayName:"detail.style__StyledDetail",componentId:"carbon_v162_13_0__sc-aaa150de-0"})(["position:relative;",";+ &{margin-top:20px;}"],e),s=t.div.withConfig({displayName:"detail.style__StyledDetailContent",componentId:"carbon_v162_13_0__sc-aaa150de-1"})(["",""],(({hasIcon:t})=>i(["display:inline-block;line-height:18px;white-space:pre-wrap;text-overflow:ellipsis;overflow:hidden;",""],t&&i(["margin-left:26px;"])))),p=t(a).withConfig({displayName:"detail.style__StyledDetailIcon",componentId:"carbon_v162_13_0__sc-aaa150de-2"})(["position:absolute;color:var(--colorsUtilityYin065);height:",";width:",";top:-1px;vertical-align:top;span{height:",";width:",";vertical-align:middle;}"],l,l,l,l),r=t.div.withConfig({displayName:"detail.style__StyledDetailFootnote",componentId:"carbon_v162_13_0__sc-aaa150de-3"})(["",""],(({hasIcon:t})=>i(["color:var(--colorsUtilityYin055);font-size:13px;position:relative;margin-top:-2px;",""],t&&i(["margin-left:26px;"]))));export{n as StyledDetail,s as StyledDetailContent,r as StyledDetailFootnote,p as StyledDetailIcon};
|