carbon-react 162.25.0 → 163.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.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/hooks/useHandleDropdownMenuKeyDown.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.d.ts +4 -0
- 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-item/action-popover-item.component.js +1 -1
- package/esm/components/action-popover/action-popover.component.js +1 -1
- package/esm/components/action-popover/action-popover.style.d.ts +1 -0
- 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.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.style.js +1 -1
- package/esm/components/date/__internal__/calendar/calendar-navigation.style.js +1 -1
- package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -1
- package/esm/components/date/__internal__/calendar/calendar-weekday.style.js +1 -1
- package/esm/components/date/__internal__/date-picker/date-picker.style.js +1 -1
- package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -1
- package/esm/components/date/date.style.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-input-validation/file-input-validation.component.d.ts +8 -0
- package/esm/components/file-input/__internal__/file-input-validation/file-input-validation.component.js +1 -0
- package/esm/components/file-input/__internal__/file-input-validation/index.d.ts +1 -0
- package/esm/components/file-input/__internal__/file-input-validation/index.js +1 -0
- package/esm/components/file-input/__internal__/file-input.types.d.ts +5 -0
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +110 -28
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.js +1 -1
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts +30 -11
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/esm/components/file-input/__internal__/file-upload-status/thumbnail-content.component.d.ts +24 -0
- package/esm/components/file-input/__internal__/file-upload-status/thumbnail-content.component.js +1 -0
- package/esm/components/file-input/__internal__/file-upload-status-list/file-upload-status-list.component.d.ts +17 -0
- package/esm/components/file-input/__internal__/file-upload-status-list/file-upload-status-list.component.js +1 -0
- package/esm/components/file-input/__internal__/file-upload-status-list/index.d.ts +1 -0
- package/esm/components/file-input/__internal__/file-upload-status-list/index.js +1 -0
- package/esm/components/file-input/__internal__/hooks/useFileDropZone.d.ts +20 -0
- package/esm/components/file-input/__internal__/hooks/useFileDropZone.js +1 -0
- package/esm/components/file-input/__internal__/hooks/useMoveFocusAfterFileRemoval.d.ts +19 -0
- package/esm/components/file-input/__internal__/hooks/useMoveFocusAfterFileRemoval.js +1 -0
- package/esm/components/file-input/__internal__/hooks/useMoveFocusAfterFileSelection.d.ts +19 -0
- package/esm/components/file-input/__internal__/hooks/useMoveFocusAfterFileSelection.js +1 -0
- package/esm/components/file-input/__internal__/hooks/useStatusAnnouncement.d.ts +11 -0
- package/esm/components/file-input/__internal__/hooks/useStatusAnnouncement.js +1 -0
- package/esm/components/file-input/__internal__/hooks/useUploadCompletionAnnouncement.d.ts +11 -0
- package/esm/components/file-input/__internal__/hooks/useUploadCompletionAnnouncement.js +1 -0
- package/esm/components/file-input/__internal__/utils/focus-next-action.d.ts +18 -0
- package/esm/components/file-input/__internal__/utils/focus-next-action.js +1 -0
- package/esm/components/file-input/__internal__/utils/split-statuses.d.ts +12 -0
- package/esm/components/file-input/__internal__/utils/split-statuses.js +1 -0
- package/esm/components/file-input/file-input.component.d.ts +83 -22
- package/esm/components/file-input/file-input.component.js +1 -1
- package/esm/components/file-input/file-input.style.d.ts +47 -15
- 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/multi-action-button.component.js +1 -1
- 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.js +1 -1
- package/esm/components/split-button/split-button.component.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/table/table-body/table-body.component.js +1 -1
- package/esm/components/table/table-cell/table-cell.style.js +1 -1
- package/esm/components/table/table-foot/table-foot.component.js +1 -1
- package/esm/components/table/table-head/table-head.component.js +1 -1
- package/esm/components/table/table-header/__internal__/sort/sort.style.js +1 -1
- package/esm/components/table/table-header/table-header.style.js +1 -1
- package/esm/components/table/table-row/table-row.style.js +1 -1
- package/esm/components/table/table.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/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.d.ts +1 -1
- package/esm/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.js +1 -1
- package/esm/hooks/__internal__/useIsFileDraggedOverDocument/index.d.ts +1 -0
- package/esm/hooks/__internal__/useIsFileDraggedOverDocument/index.js +1 -0
- package/esm/hooks/__internal__/useIsFileDraggedOverDocument/useIsFileDraggedOverDocument.d.ts +10 -0
- package/esm/hooks/__internal__/useIsFileDraggedOverDocument/useIsFileDraggedOverDocument.js +1 -0
- package/esm/locales/de-de.js +1 -1
- package/esm/locales/en-gb.js +1 -1
- package/esm/locales/es-es.js +1 -1
- package/esm/locales/fr-ca.js +1 -1
- package/esm/locales/fr-fr.js +1 -1
- package/esm/locales/locale.d.ts +38 -4
- package/esm/locales/pt-pt.js +1 -1
- 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.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/hooks/useHandleDropdownMenuKeyDown.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.d.ts +4 -0
- 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-item/action-popover-item.component.js +1 -1
- package/lib/components/action-popover/action-popover.component.js +1 -1
- package/lib/components/action-popover/action-popover.style.d.ts +1 -0
- 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.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.style.js +1 -1
- package/lib/components/date/__internal__/calendar/calendar-navigation.style.js +1 -1
- package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -1
- package/lib/components/date/__internal__/calendar/calendar-weekday.style.js +1 -1
- package/lib/components/date/__internal__/date-picker/date-picker.style.js +1 -1
- package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -1
- package/lib/components/date/date.style.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-input-validation/file-input-validation.component.d.ts +8 -0
- package/lib/components/file-input/__internal__/file-input-validation/file-input-validation.component.js +1 -0
- package/lib/components/file-input/__internal__/file-input-validation/index.d.ts +1 -0
- package/lib/components/file-input/__internal__/file-input-validation/index.js +1 -0
- package/lib/components/file-input/__internal__/file-input-validation/package.json +5 -0
- package/lib/components/file-input/__internal__/file-input.types.d.ts +5 -0
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +110 -28
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.component.js +1 -1
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts +30 -11
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/lib/components/file-input/__internal__/file-upload-status/thumbnail-content.component.d.ts +24 -0
- package/lib/components/file-input/__internal__/file-upload-status/thumbnail-content.component.js +1 -0
- package/lib/components/file-input/__internal__/file-upload-status-list/file-upload-status-list.component.d.ts +17 -0
- package/lib/components/file-input/__internal__/file-upload-status-list/file-upload-status-list.component.js +1 -0
- package/lib/components/file-input/__internal__/file-upload-status-list/index.d.ts +1 -0
- package/lib/components/file-input/__internal__/file-upload-status-list/index.js +1 -0
- package/lib/components/file-input/__internal__/file-upload-status-list/package.json +5 -0
- package/lib/components/file-input/__internal__/hooks/useFileDropZone.d.ts +20 -0
- package/lib/components/file-input/__internal__/hooks/useFileDropZone.js +1 -0
- package/lib/components/file-input/__internal__/hooks/useMoveFocusAfterFileRemoval.d.ts +19 -0
- package/lib/components/file-input/__internal__/hooks/useMoveFocusAfterFileRemoval.js +1 -0
- package/lib/components/file-input/__internal__/hooks/useMoveFocusAfterFileSelection.d.ts +19 -0
- package/lib/components/file-input/__internal__/hooks/useMoveFocusAfterFileSelection.js +1 -0
- package/lib/components/file-input/__internal__/hooks/useStatusAnnouncement.d.ts +11 -0
- package/lib/components/file-input/__internal__/hooks/useStatusAnnouncement.js +1 -0
- package/lib/components/file-input/__internal__/hooks/useUploadCompletionAnnouncement.d.ts +11 -0
- package/lib/components/file-input/__internal__/hooks/useUploadCompletionAnnouncement.js +1 -0
- package/lib/components/file-input/__internal__/utils/focus-next-action.d.ts +18 -0
- package/lib/components/file-input/__internal__/utils/focus-next-action.js +1 -0
- package/lib/components/file-input/__internal__/utils/split-statuses.d.ts +12 -0
- package/lib/components/file-input/__internal__/utils/split-statuses.js +1 -0
- package/lib/components/file-input/file-input.component.d.ts +83 -22
- package/lib/components/file-input/file-input.component.js +1 -1
- package/lib/components/file-input/file-input.style.d.ts +47 -15
- 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/multi-action-button.component.js +1 -1
- 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.js +1 -1
- package/lib/components/split-button/split-button.component.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/table/table-body/table-body.component.js +1 -1
- package/lib/components/table/table-cell/table-cell.style.js +1 -1
- package/lib/components/table/table-foot/table-foot.component.js +1 -1
- package/lib/components/table/table-head/table-head.component.js +1 -1
- package/lib/components/table/table-header/__internal__/sort/sort.style.js +1 -1
- package/lib/components/table/table-header/table-header.style.js +1 -1
- package/lib/components/table/table-row/table-row.style.js +1 -1
- package/lib/components/table/table.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/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.d.ts +1 -1
- package/lib/hooks/__internal__/useFocusPortalContent/useFocusPortalContent.js +1 -1
- package/lib/hooks/__internal__/useIsFileDraggedOverDocument/index.d.ts +1 -0
- package/lib/hooks/__internal__/useIsFileDraggedOverDocument/index.js +1 -0
- package/lib/hooks/__internal__/useIsFileDraggedOverDocument/package.json +5 -0
- package/lib/hooks/__internal__/useIsFileDraggedOverDocument/useIsFileDraggedOverDocument.d.ts +10 -0
- package/lib/hooks/__internal__/useIsFileDraggedOverDocument/useIsFileDraggedOverDocument.js +1 -0
- package/lib/locales/de-de.js +1 -1
- package/lib/locales/en-gb.js +1 -1
- package/lib/locales/es-es.js +1 -1
- package/lib/locales/fr-ca.js +1 -1
- package/lib/locales/fr-fr.js +1 -1
- package/lib/locales/locale.d.ts +38 -4
- package/lib/locales/pt-pt.js +1 -1
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{css as t}from"styled-components";import{margin as i}from"styled-system";import n from"../../style/themes/apply-base-theme.js";const l=e.div.attrs(n).withConfig({displayName:"duelling-picklist.style__StyledDuellingPicklistOverlay",componentId:"
|
|
1
|
+
import e,{css as t}from"styled-components";import{margin as i}from"styled-system";import n from"../../style/themes/apply-base-theme.js";const l=e.div.attrs(n).withConfig({displayName:"duelling-picklist.style__StyledDuellingPicklistOverlay",componentId:"carbon_v163_0_0__sc-c5d06e9c-0"})([""," transition:opacity 0.3s;",""],i,(({disabled:e})=>e&&t(["opacity:0.2;pointer-events:none;user-select:none;"]))),o=e.div.withConfig({displayName:"duelling-picklist.style__StyledDuellingPicklist",componentId:"carbon_v163_0_0__sc-c5d06e9c-1"})(["display:flex;justify-content:space-between;align-items:stretch;position:relative;"]),s=e.div.withConfig({displayName:"duelling-picklist.style__StyledLabelContainer",componentId:"carbon_v163_0_0__sc-c5d06e9c-2"})(["display:flex;justify-content:space-around;margin-top:40px;margin-bottom:16px;"]),c=e.p.withConfig({displayName:"duelling-picklist.style__StyledLabel",componentId:"carbon_v163_0_0__sc-c5d06e9c-3"})(["font-weight:500;font-size:12px;letter-spacing:1;margin:0;"]),d=e.div.withConfig({displayName:"duelling-picklist.style__StyledControlsContainer",componentId:"carbon_v163_0_0__sc-c5d06e9c-4"})(["display:flex;justify-content:space-around;margin-bottom:16px;"]),a=e.div.withConfig({displayName:"duelling-picklist.style__StyledControl",componentId:"carbon_v163_0_0__sc-c5d06e9c-5"})(["width:50%;padding-right:40px;& ~ &{padding-right:0;padding-left:40px;}"]),p=e.div.withConfig({displayName:"duelling-picklist.style__StyledPicklistPlaceholder",componentId:"carbon_v163_0_0__sc-c5d06e9c-6"})(["height:100%;display:flex;justify-content:center;align-items:center;"]);export{a as StyledControl,d as StyledControlsContainer,o as StyledDuellingPicklist,l as StyledDuellingPicklistOverlay,c as StyledLabel,s as StyledLabelContainer,p as StyledPicklistPlaceholder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"styled-components";const i=t.ul.withConfig({displayName:"picklist.style__StyledPicklist",componentId:"
|
|
1
|
+
import t from"styled-components";const i=t.ul.withConfig({displayName:"picklist.style__StyledPicklist",componentId:"carbon_v163_0_0__sc-4711ec38-0"})(["position:relative;list-style:none;margin:0;padding:8px 8px 8px 8px;width:100%;box-sizing:border-box;overflow-y:auto;height:400px;scrollbar-color:rgb(102,132,148) rgb(242,245,246);&::-webkit-scrollbar{width:8px;}&::-webkit-scrollbar-track{background-color:rgb(242,245,246);}&::-webkit-scrollbar-thumb{background-color:rgb(102,132,148);}& + &{margin-left:32px;}.picklist-item-enter{opacity:0;transform:translate(-16px);transition:all 300ms ease-in;}.picklist-item-enter-active{opacity:1;transform:translate(0px);transition:all 300ms ease-in;}.picklist-group-enter{opacity:0;transform:translate(-16px);transition:all 300ms ease-in;}.picklist-group-enter-active{opacity:1;transform:translate(0px);transition:all 300ms ease-in;}"]),o=t.li.withConfig({displayName:"picklist.style__StyledEmptyContainer",componentId:"carbon_v163_0_0__sc-4711ec38-1"})(["position:absolute;top:0;bottom:0;left:0;right:0;height:100%;"]);export{o as StyledEmptyContainer,i as StyledPicklist};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"styled-components";const e=i.div.withConfig({displayName:"picklist-divider.style__StyledPicklistDivider",componentId:"
|
|
1
|
+
import i from"styled-components";const e=i.div.withConfig({displayName:"picklist-divider.style__StyledPicklistDivider",componentId:"carbon_v163_0_0__sc-6d9e8575-0"})(["min-width:2px;background-image:linear-gradient( 180deg,#bfcbd1 0%,rgba(191,203,209,0) 99.9% );margin-left:16px;margin-right:16px;"]);export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o,{css as t}from"styled-components";import i from"../../button/button.component.js";import{StyledButton as n}from"../picklist-item/picklist-item.style.js";const r=o.li.withConfig({displayName:"picklist-group.style__StyledGroupWrapper",componentId:"
|
|
1
|
+
import o,{css as t}from"styled-components";import i from"../../button/button.component.js";import{StyledButton as n}from"../picklist-item/picklist-item.style.js";const r=o.li.withConfig({displayName:"picklist-group.style__StyledGroupWrapper",componentId:"carbon_v163_0_0__sc-4f863755-0"})(["",""],(({highlighted:o,type:i})=>t(["&:not(:first-of-type){margin-top:16px;}",""],o&&t(["","{background:",""],n,"add"===i?"var(--colorsActionMajor600)":"var(--colorsSemanticNegative600)")))),e=o.ul.withConfig({displayName:"picklist-group.style__StyledPicklistGroupUl",componentId:"carbon_v163_0_0__sc-4f863755-1"})(["padding:0;"]),p=o.li.withConfig({displayName:"picklist-group.style__StyledPicklistGroup",componentId:"carbon_v163_0_0__sc-4f863755-2"})(["display:flex;align-items:center;width:100%;margin-bottom:4px;"]),a=o(i).withConfig({displayName:"picklist-group.style__StyledGroupButton",componentId:"carbon_v163_0_0__sc-4f863755-3"})(["",""],(({iconType:o})=>t(["padding:0;margin-right:0;margin-left:auto;height:40px;min-width:40px;border:none;&:focus{> span{color:var(--colorsActionMajorYang100);}background:",""],"add"===o?"var(--colorsActionMajor600)":"var(--colorsSemanticNegative600)")));export{a as StyledGroupButton,r as StyledGroupWrapper,p as StyledPicklistGroup,e as StyledPicklistGroupUl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{css as o}from"styled-components";import i from"../../button/button.component.js";import t from"../../icon/icon.component.js";import d from"../../icon/icon.style.js";const a=r.li.withConfig({displayName:"picklist-item.style__StyledPicklistItem",componentId:"
|
|
1
|
+
import r,{css as o}from"styled-components";import i from"../../button/button.component.js";import t from"../../icon/icon.component.js";import d from"../../icon/icon.style.js";const a=r.li.withConfig({displayName:"picklist-item.style__StyledPicklistItem",componentId:"carbon_v163_0_0__sc-eb1e700a-0"})(["border-radius:var(--borderRadius100);",""],(({locked:r})=>o(["display:flex;align-items:center;width:100%;background-color:",";"," "," & + &{margin-top:8px;}"],r?"var(--colorsUtilityMajor025)":"var(--colorsUtilityYang100)",!r&&o(["box-shadow:var(--boxShadow050);"]),r&&o(["border:1px solid var(--colorsUtilityMajor200);color:var(--colorsUtilityYin065);","{color:var(--colorsUtilityMajor200);}"],d)))),e=r(i).withConfig({displayName:"picklist-item.style__StyledButton",componentId:"carbon_v163_0_0__sc-eb1e700a-1"})(["border-bottom-right-radius:var(--borderRadius100);border-top-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);:hover{border-bottom-right-radius:var(--borderRadius100);border-top-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);}:focus{border-bottom-right-radius:var(--borderRadius100);border-top-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);}",""],(({iconType:r})=>o(["padding:0;margin-right:0;margin-left:auto;height:40px;min-width:40px;&:focus{background:",";"],"add"===r?"var(--colorsActionMajor600)":"var(--colorsSemanticNegative600)"))),s=r(t).withConfig({displayName:"picklist-item.style__StyledLockIcon",componentId:"carbon_v163_0_0__sc-eb1e700a-2"})(["margin-right:0;height:40px;min-width:40px;:focus{border-bottom-right-radius:var(--borderRadius100);border-top-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);}"]);export{e as StyledButton,s as StyledLockIcon,a as StyledPicklistItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{css as a}from"styled-components";import{margin as l}from"styled-system";import o from"../../style/themes/apply-base-theme.js";import t from"../../style/utils/required-indicator.js";const n={small:{contentMargin:"var(--global-space-comp-xs)",validationGap:"var(--global-space-comp-xs)",childrenGap:"var(--global-space-comp-m)",legendFont:"var(--global-font-static-comp-medium-s)",regularLabelFont:"var(--global-font-static-comp-regular-s)",boldLabelFont:"var(--global-font-static-comp-medium-s)"},medium:{contentMargin:"var(--global-space-comp-s)",validationGap:"var(--global-space-comp-s)",childrenGap:"var(--global-space-comp-l)",legendFont:"var(--global-font-static-comp-medium-m)",regularLabelFont:"var(--global-font-static-comp-regular-m)",boldLabelFont:"var(--global-font-static-comp-medium-m)"},large:{contentMargin:"var(--global-space-comp-m)",validationGap:"var(--global-space-comp-s)",childrenGap:"var(--global-space-comp-xl)",legendFont:"var(--global-font-static-comp-medium-l)",regularLabelFont:"var(--global-font-static-comp-regular-l)",boldLabelFont:"var(--global-font-static-comp-medium-l)"}},i=e.fieldset.attrs(o).withConfig({displayName:"fieldset.style__StyledFieldset",componentId:"
|
|
1
|
+
import e,{css as a}from"styled-components";import{margin as l}from"styled-system";import o from"../../style/themes/apply-base-theme.js";import t from"../../style/utils/required-indicator.js";const n={small:{contentMargin:"var(--global-space-comp-xs)",validationGap:"var(--global-space-comp-xs)",childrenGap:"var(--global-space-comp-m)",legendFont:"var(--global-font-static-comp-medium-s)",regularLabelFont:"var(--global-font-static-comp-regular-s)",boldLabelFont:"var(--global-font-static-comp-medium-s)"},medium:{contentMargin:"var(--global-space-comp-s)",validationGap:"var(--global-space-comp-s)",childrenGap:"var(--global-space-comp-l)",legendFont:"var(--global-font-static-comp-medium-m)",regularLabelFont:"var(--global-font-static-comp-regular-m)",boldLabelFont:"var(--global-font-static-comp-medium-m)"},large:{contentMargin:"var(--global-space-comp-m)",validationGap:"var(--global-space-comp-s)",childrenGap:"var(--global-space-comp-xl)",legendFont:"var(--global-font-static-comp-medium-l)",regularLabelFont:"var(--global-font-static-comp-regular-l)",boldLabelFont:"var(--global-font-static-comp-medium-l)"}},i=e.fieldset.attrs(o).withConfig({displayName:"fieldset.style__StyledFieldset",componentId:"carbon_v163_0_0__sc-58abed49-0"})(["border:none;padding:0;min-width:0;min-inline-size:0;margin:0;margin-bottom:var(--fieldSpacing);"," & *{--fieldSpacing:0;}"],l),r=e.legend.withConfig({displayName:"fieldset.style__StyledLegend",componentId:"carbon_v163_0_0__sc-58abed49-1"})(["",";"],(({$isRequired:e,$size:l})=>a(["padding:0;font:",";color:var(--input-labelset-label-default);",""],n[l].legendFont,e&&t({font:n[l].legendFont})))),d=e.div.withConfig({displayName:"fieldset.style__StyledFieldsetContentWrapper",componentId:"carbon_v163_0_0__sc-58abed49-2"})(["",";"],(({$size:e,$hasLegend:l})=>a(["display:flex;flex-direction:column;position:relative;gap:",";",""],n[e].validationGap,l&&a(["margin-top:",";"],n[e].contentMargin)))),s=e.div.withConfig({displayName:"fieldset.style__StyledFieldsetContent",componentId:"carbon_v163_0_0__sc-58abed49-3"})(["",";"],(({$orientation:e,$size:l,$labelWeight:o})=>a(["display:flex;flex-direction:column;gap:",";"," label{font:",";}",""],n[l].childrenGap,"horizontal"===e&&a(["flex-direction:row;flex-wrap:wrap;"]),n[l].regularLabelFont,"bold"===o&&a(["label{font:",";}"],n[l].boldLabelFont))));export{i as StyledFieldset,s as StyledFieldsetContent,d as StyledFieldsetContentWrapper,r as StyledLegend};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FileInputValidationProps {
|
|
3
|
+
error?: boolean | string;
|
|
4
|
+
validationId?: string;
|
|
5
|
+
validationMessagePositionTop?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const FileInputValidation: ({ error, validationId, validationMessagePositionTop, }: FileInputValidationProps) => React.JSX.Element;
|
|
8
|
+
export default FileInputValidation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as o,jsx as e}from"react/jsx-runtime";import"react";import i,{css as t}from"styled-components";import a from"../../../../__internal__/validation-message/__next__/validation-message.component.js";import r from"../../../../__internal__/error-border/error-border.style.js";const n=i.div.withConfig({displayName:"file-input-validation.component__StyledFileInputValidationWrapper",componentId:"carbon_v163_0_0__sc-2e12021c-0"})(["",""],(({$hasMessage:o,$validationMessagePositionTop:e})=>o&&t(["margin-",":var(--global-space-comp-s);"],e?"bottom":"top"))),s=({error:i,validationId:t,validationMessagePositionTop:s=!0})=>o(n,{role:"status",$hasMessage:"string"==typeof i,$validationMessagePositionTop:s,children:[e(a,{id:t,error:i,size:"medium"}),i&&e(r,{$warning:!1})]});export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./file-input-validation.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default}from"./file-input-validation.component.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type Locale from "../../../locales/locale";
|
|
2
|
+
export type ResolvedFileInputLocale = Omit<Required<Locale["fileInput"]>, "actions" | "announcements"> & {
|
|
3
|
+
actions: Required<Locale["fileInput"]["actions"]>;
|
|
4
|
+
announcements: Required<NonNullable<Locale["fileInput"]["announcements"]>>;
|
|
5
|
+
};
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts
CHANGED
|
@@ -1,35 +1,117 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { IconType } from "../../../icon";
|
|
4
|
-
interface
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* If the progress prop is not specified in the `uploading` status, a loading animation will be shown instead
|
|
9
|
-
* (or text equivalent for users with a reduced-motion operating system preference).
|
|
2
|
+
import { type ButtonProps } from "../../../button/__next__";
|
|
3
|
+
import { type IconType } from "../../../icon";
|
|
4
|
+
interface SharedStatusProps {
|
|
5
|
+
/**
|
|
6
|
+
* Name shown on the status card and used in action labels and
|
|
7
|
+
* announcements.
|
|
10
8
|
*/
|
|
11
|
-
progress?: number;
|
|
12
|
-
}
|
|
13
|
-
interface StatusDoneProps extends LinkProps {
|
|
14
|
-
/** the status of the upload */
|
|
15
|
-
status: "completed" | "previously";
|
|
16
|
-
/** the URL opened by the file link. Must be provided for only the `completed` and `previously` statuses. */
|
|
17
|
-
href: string;
|
|
18
|
-
}
|
|
19
|
-
interface StatusErrorProps {
|
|
20
|
-
/** the status of the upload */
|
|
21
|
-
status: "error";
|
|
22
|
-
}
|
|
23
|
-
interface MandatoryStatusProps {
|
|
24
|
-
/** the name of the file */
|
|
25
9
|
filename: string;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Stable unique id. Use it when filenames can repeat, so each file keeps its
|
|
12
|
+
* card and completion announcements match the right file.
|
|
13
|
+
*/
|
|
14
|
+
id?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Replaces the default status text ("Uploading…", "File uploaded" or "Error
|
|
17
|
+
* details"). Previously uploaded files have no default text. For failed
|
|
18
|
+
* files, the text is also announced. Include the file's state in a custom
|
|
19
|
+
* message (for example "Uploading… 2.4 MB of 10 MB"), as it is the only
|
|
20
|
+
* text that tells screen reader users the state.
|
|
21
|
+
*/
|
|
29
22
|
message?: string;
|
|
30
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Icon for the file. Shown before the filename when there is no thumbnail
|
|
25
|
+
* column (uploading files show the loader instead), and in the thumbnail
|
|
26
|
+
* column for failed files or when the image fails to load. Defaults to
|
|
27
|
+
* `error` for failed files and a generic file icon otherwise.
|
|
28
|
+
*/
|
|
31
29
|
iconType?: IconType;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a thumbnail column. Completed and previously uploaded files show this
|
|
32
|
+
* image, or the icon if it fails to load. Uploading files show the loader,
|
|
33
|
+
* and failed files show the error icon.
|
|
34
|
+
*/
|
|
35
|
+
thumbnailSrc?: string;
|
|
36
|
+
}
|
|
37
|
+
interface DeprecatedPrimaryAction {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `onCancel`, `onDelete` or `onRemove`, depending on
|
|
40
|
+
* `status`.
|
|
41
|
+
*/
|
|
42
|
+
onAction: () => void;
|
|
43
|
+
}
|
|
44
|
+
interface CancelAction {
|
|
45
|
+
/** Cancels the upload. Adds a Cancel button to the status card. */
|
|
46
|
+
onCancel: () => void;
|
|
47
|
+
}
|
|
48
|
+
interface DeleteAction {
|
|
49
|
+
/** Deletes the uploaded file. Adds a Delete button to the status card. */
|
|
50
|
+
onDelete: () => void;
|
|
51
|
+
}
|
|
52
|
+
interface RemoveAction {
|
|
53
|
+
/** Removes the failed file. Adds a Remove button to the status card. */
|
|
54
|
+
onRemove: () => void;
|
|
55
|
+
}
|
|
56
|
+
type PrimaryAction<Action> = (DeprecatedPrimaryAction & Partial<Action>) | ({
|
|
57
|
+
onAction?: never;
|
|
58
|
+
} & Action);
|
|
59
|
+
type StatusUploadingProps = SharedStatusProps & PrimaryAction<CancelAction> & {
|
|
60
|
+
/** Upload state. `"previously"` is a file uploaded before this session. */
|
|
61
|
+
status: "uploading";
|
|
62
|
+
/**
|
|
63
|
+
* Upload progress from 0 to 100, exposed to assistive technology. The
|
|
64
|
+
* spinner does not yet show the value visually. Omit when unknown.
|
|
65
|
+
*/
|
|
66
|
+
progress?: number;
|
|
67
|
+
};
|
|
68
|
+
type StatusCompletedProps = SharedStatusProps & Omit<ButtonProps, "href" | "aria-label"> & PrimaryAction<DeleteAction> & {
|
|
69
|
+
/** Upload state. `"previously"` is a file uploaded before this session. */
|
|
70
|
+
status: "completed";
|
|
71
|
+
/** URL of the file. Adds a Preview link to the status card. */
|
|
72
|
+
href?: string;
|
|
73
|
+
};
|
|
74
|
+
type StatusPreviouslyProps = SharedStatusProps & Omit<ButtonProps, "href" | "aria-label"> & {
|
|
75
|
+
/** Upload state. `"previously"` is a file uploaded before this session. */
|
|
76
|
+
status: "previously";
|
|
77
|
+
/** URL of the file. Adds a Preview link to the status card. */
|
|
78
|
+
href?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Deletes the file. Single-file mode only; previously uploaded files are
|
|
81
|
+
* read-only in multiple-file mode.
|
|
82
|
+
*/
|
|
83
|
+
onDelete?: () => void;
|
|
84
|
+
/** @deprecated Use `onDelete`. */
|
|
85
|
+
onAction?: () => void;
|
|
86
|
+
};
|
|
87
|
+
type StatusErrorProps = SharedStatusProps & PrimaryAction<RemoveAction> & {
|
|
88
|
+
/** Upload state. `"previously"` is a file uploaded before this session. */
|
|
89
|
+
status: "error";
|
|
90
|
+
/** Adds a Retry button to the status card. */
|
|
91
|
+
onRetry?: () => void;
|
|
92
|
+
};
|
|
93
|
+
export type FileUploadStatusProps = StatusUploadingProps | StatusCompletedProps | StatusPreviouslyProps | StatusErrorProps;
|
|
94
|
+
interface InternalProps {
|
|
95
|
+
/** @ignore @private */
|
|
96
|
+
moveFocusAfterAction?: (element: HTMLElement, removalAnnouncement?: string) => void;
|
|
97
|
+
/** @ignore @private */
|
|
98
|
+
isInMultiItemList?: boolean;
|
|
99
|
+
/** @ignore @private */
|
|
100
|
+
maxHeight?: string;
|
|
101
|
+
/** @ignore @private */
|
|
102
|
+
minHeight?: string;
|
|
103
|
+
/** @ignore @private */
|
|
104
|
+
multiple?: boolean;
|
|
105
|
+
/** @ignore @private */
|
|
106
|
+
removalAnnouncementId?: string;
|
|
107
|
+
/** @ignore @private */
|
|
108
|
+
onPreviewActivate?: () => void;
|
|
109
|
+
/**
|
|
110
|
+
* @ignore @private
|
|
111
|
+
* Whether an error present when this status mounts should be announced.
|
|
112
|
+
* False for statuses rendered with the field, so page load stays silent.
|
|
113
|
+
*/
|
|
114
|
+
announceInitialError?: boolean;
|
|
32
115
|
}
|
|
33
|
-
export
|
|
34
|
-
export declare const FileUploadStatus: ({ status, filename, message, onAction, iconType, ...statusProps }: FileUploadStatusProps) => React.JSX.Element;
|
|
116
|
+
export declare const FileUploadStatus: (props: FileUploadStatusProps & InternalProps) => React.JSX.Element;
|
|
35
117
|
export default FileUploadStatus;
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as n,useEffect as o}from"react";import{Button as i}from"../../../button/__next__/button.component.js";import l from"../../../icon/icon.component.js";import"../../../icon/icon.style.js";import{StyledFileUploadStatus as a,StyledLeadingColumn as c,StyledStatusContent as s,StyledErrorStatus as u,StyledFileDetails as m,StyledFileName as p,StyledFileNameRow as d,StyledStatusIcon as b,StyledStatusMessage as f,StyledActions as v}from"./file-upload-status.style.js";import h from"../../../../hooks/__internal__/useLocale/useLocale.js";import y,{UploadingIndicator as g}from"./thumbnail-content.component.js";function O(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function j(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){O(e,r,t[r])}))}return e}function P(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}const A=(e,r,t)=>e?{callback:e,text:r,removalAnnouncement:t}:void 0,I=O=>{const{status:I,filename:$,message:w,iconType:k,thumbnailSrc:x,onAction:D,moveFocusAfterAction:S,isInMultiItemList:T,maxHeight:E,minHeight:H,multiple:_,removalAnnouncementId:C,onPreviewActivate:L,announceInitialError:M}=O,F=null!=k?k:"error"===I?"error":"file_generic",z=h().fileInput,[R,q]=n(),[B,G]=n(!M);o((()=>{if(B)return;const e=requestAnimationFrame((()=>G(!0)));return()=>cancelAnimationFrame(e)}),[B]);const J=void 0!==x;let K,N;switch(I){case"uploading":var Q;K=A(null!==(Q=O.onCancel)&&void 0!==Q?Q:D,z.actions.cancel(),z.announcements.uploadCancelled($)),N=z.uploading();break;case"error":var U;K=A(null!==(U=O.onRemove)&&void 0!==U?U:D,z.actions.remove(),z.announcements.fileRemoved($)),N=z.uploadErrorDetails();break;case"completed":var V;K=A(null!==(V=O.onDelete)&&void 0!==V?V:D,z.actions.delete(),z.announcements.fileDeleted($)),N=z.uploaded();break;case"previously":var W;K=_?void 0:A(null!==(W=O.onDelete)&&void 0!==W?W:D,z.actions.delete(),z.announcements.fileDeleted($)),N=void 0}const X=null!=w?w:N,Y=z.actions.retry(),Z=z.actions.preview(),ee=(e,r)=>t=>{null==e||e(),null==S||S(t.currentTarget,r)},re=(e=>{if("completed"!==e.status&&"previously"!==e.status||!e.href)return;const{id:r,filename:t,message:n,iconType:o,thumbnailSrc:i,onAction:l,onDelete:a,moveFocusAfterAction:c,isInMultiItemList:s,maxHeight:u,minHeight:m,multiple:p,removalAnnouncementId:d,onPreviewActivate:b,announceInitialError:f,status:v,href:h}=e;return{href:h,buttonProps:P(e,["id","filename","message","iconType","thumbnailSrc","onAction","onDelete","moveFocusAfterAction","isInMultiItemList","maxHeight","minHeight","multiple","removalAnnouncementId","onPreviewActivate","announceInitialError","status","href"])}})(O),te="uploading"===I?O.progress:void 0;return e(a,{"data-role":"file-upload-status",$hasError:"error"===I,$hasThumbnail:J,$isInMultiItemList:T,$maxHeight:E,$minHeight:H,$multiple:_,children:[J?r(t,{children:r(c,{children:r(y,{status:I,filename:$,thumbnailSrc:x,failedThumbnailSrc:R,fallbackIconType:F,progress:te,statusMessage:X,onThumbnailError:()=>q(x)})})}):null,e(s,{$multiple:_,$minHeight:H,children:[r(u,{role:"status","data-role":"file-upload-error-status",children:"error"===I&&B?`${$}: ${X}`:null}),e(m,{"aria-hidden":"error"===I||void 0,children:[J?r(p,{variant:"span",children:$}):e(d,{children:["uploading"===I?r(g,{as:b,filename:$,size:"extra-small",progress:te,statusMessage:X}):r(b,{children:r(l,{type:F,"aria-hidden":!0,color:"error"===I?"negative":"neutral"})}),r(p,{variant:"span",children:$})]}),X&&r(f,{variant:"p",$hasError:"error"===I,children:X})]}),e(v,{children:[K&&r(i,{variantType:"subtle",size:"small",onClick:ee(K.callback,K.removalAnnouncement),"aria-label":`${K.text} ${$}`,"aria-describedby":C,children:K.text}),"error"===I&&O.onRetry&&r(i,{variantType:"tertiary",size:"small",onClick:ee(O.onRetry),"aria-label":`${Y} ${$}`,"aria-describedby":C,children:Y}),re&&r(i,(ne=j({},re.buttonProps),oe={variantType:"tertiary",size:"small",href:re.href,"aria-label":`${Z} ${$}`,"aria-describedby":[C,re.buttonProps["aria-describedby"]].filter(Boolean).join(" ")||void 0,onClick:e=>{var r,t;null==L||L(),null===(r=(t=re.buttonProps).onClick)||void 0===r||r.call(t,e)},children:Z},oe=null!=oe?oe:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ne,Object.getOwnPropertyDescriptors(oe)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(oe)).forEach((function(e){Object.defineProperty(ne,e,Object.getOwnPropertyDescriptor(oe,e))})),ne))]})]})]});var ne,oe};export{I as FileUploadStatus,I as default};
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.d.ts
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface FileUploadStatusStyleProps {
|
|
2
|
+
$hasError: boolean;
|
|
3
|
+
$hasThumbnail?: boolean;
|
|
4
|
+
$isInMultiItemList?: boolean;
|
|
5
|
+
$maxHeight?: string;
|
|
6
|
+
$minHeight?: string;
|
|
7
|
+
$multiple?: boolean;
|
|
6
8
|
}
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export declare const
|
|
9
|
+
export declare const StyledFileUploadStatus: import("styled-components").StyledComponent<"div", any, FileUploadStatusStyleProps, never>;
|
|
10
|
+
export declare const StyledStatusIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
11
|
+
export declare const StyledFileNameRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const StyledLeadingColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const StyledThumbnail: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
14
|
+
export declare const StyledUploadingIcon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
15
|
+
export declare const StyledStatusContent: import("styled-components").StyledComponent<"div", any, {
|
|
16
|
+
$multiple?: boolean;
|
|
17
|
+
$minHeight?: string;
|
|
18
|
+
}, never>;
|
|
19
|
+
export declare const StyledFileDetails: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const StyledErrorStatus: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
export declare const StyledFileName: import("styled-components").StyledComponent<{
|
|
22
|
+
({ variant, as, id, fluid, inverse, size, color, tint, weight, truncate, children, screenReaderOnly, "aria-live": ariaLive, "aria-hidden": ariaHidden, ...rest }: import("../../../typography").TypographyProps): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
}, any, {}, never>;
|
|
25
|
+
export declare const StyledStatusMessage: import("styled-components").StyledComponent<{
|
|
26
|
+
({ variant, as, id, fluid, inverse, size, color, tint, weight, truncate, children, screenReaderOnly, "aria-live": ariaLive, "aria-hidden": ariaHidden, ...rest }: import("../../../typography").TypographyProps): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
}, any, {
|
|
29
|
+
$hasError?: boolean;
|
|
30
|
+
}, never>;
|
|
31
|
+
export declare const StyledActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
32
|
export {};
|
package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a,{css as t}from"styled-components";import{Typography as i}from"../../../typography/typography.component.js";import"react/jsx-runtime";import"react";import{DEFAULT_FILE_INPUT_MIN_HEIGHT as l}from"../../file-input.style.js";import e from"../../../../style/utils/visually-hidden.js";const o=a.div.withConfig({displayName:"file-upload-status.style__StyledFileUploadStatus",componentId:"carbon_v163_0_0__sc-d044d4c9-0"})(["box-sizing:border-box;display:grid;grid-template-columns:",";align-items:stretch;min-width:0;max-height:",";min-height:",";overflow:hidden;background:var(--input-typical-bg-default);border:"," solid var( "," );border-radius:",";"],(({$hasThumbnail:a})=>a?"auto minmax(0, 1fr)":"minmax(0, 1fr)"),(({$multiple:a,$maxHeight:t})=>a?void 0:t),(({$multiple:a,$minHeight:t})=>a?void 0:t||l),(({$hasError:a,$isInMultiItemList:t})=>t?"var(--global-borderwidth-none)":a?"var(--global-borderwidth-s)":"var(--global-borderwidth-xs)"),(({$hasError:a})=>a?"--input-validation-border-error":"--input-typical-border-default"),(({$isInMultiItemList:a})=>a?"var(--global-radius-none)":"var(--global-radius-container-m)")),s=a.span.withConfig({displayName:"file-upload-status.style__StyledStatusIcon",componentId:"carbon_v163_0_0__sc-d044d4c9-1"})(["display:inline-flex;flex:none;align-items:center;justify-content:center;width:var(--global-size-2-xs);height:var(--global-size-2-xs);overflow:hidden;"]),d=a.div.withConfig({displayName:"file-upload-status.style__StyledFileNameRow",componentId:"carbon_v163_0_0__sc-d044d4c9-2"})(["display:flex;align-items:center;min-width:0;gap:var(--global-space-comp-s);"]),n=a.div.withConfig({displayName:"file-upload-status.style__StyledLeadingColumn",componentId:"carbon_v163_0_0__sc-d044d4c9-3"})(["min-width:var(--global-size-2-xl);width:var(--global-size-3-xl);min-height:var(--global-size-3-xl);height:100%;display:grid;place-items:center;border-right:var(--global-borderwidth-xs) solid var(--input-typical-border-default);"]),r=a.img.withConfig({displayName:"file-upload-status.style__StyledThumbnail",componentId:"carbon_v163_0_0__sc-d044d4c9-4"})(["display:block;width:100%;height:100%;min-height:var(--global-size-3-xl);object-fit:cover;"]),p=a.span.withConfig({displayName:"file-upload-status.style__StyledUploadingIcon",componentId:"carbon_v163_0_0__sc-d044d4c9-5"})(["display:inline-flex;width:var(--global-size-s);height:var(--global-size-s);"]),c=a.div.withConfig({displayName:"file-upload-status.style__StyledStatusContent",componentId:"carbon_v163_0_0__sc-d044d4c9-6"})(["min-width:0;display:flex;flex-direction:column;justify-content:center;gap:",";padding:",";"],(({$multiple:a})=>a?"var(--global-space-comp-s)":"var(--global-space-comp-xs)"),(({$multiple:a})=>a?"var(--global-space-comp-s) var(--global-space-comp-m)":"var(--global-space-comp-xs) var(--global-space-comp-m)")),m=a.div.withConfig({displayName:"file-upload-status.style__StyledFileDetails",componentId:"carbon_v163_0_0__sc-d044d4c9-7"})(["min-width:0;display:grid;gap:var(--global-space-comp-xs);"]),_=a.div.withConfig({displayName:"file-upload-status.style__StyledErrorStatus",componentId:"carbon_v163_0_0__sc-d044d4c9-8"})(["",""],e),g=a(i).withConfig({displayName:"file-upload-status.style__StyledFileName",componentId:"carbon_v163_0_0__sc-d044d4c9-9"})(["margin:var(--global-space-none);min-width:0;font:var(--global-font-static-comp-regular-m);color:var(--input-typical-txt-default);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]),u=a(i).withConfig({displayName:"file-upload-status.style__StyledStatusMessage",componentId:"carbon_v163_0_0__sc-d044d4c9-10"})(["margin:var(--global-space-none);font:var(--global-font-static-comp-regular-m);color:var(--input-typical-txt-alt);",""],(({$hasError:a})=>a&&t(["font:var(--global-font-static-comp-medium-m);color:var(--input-validation-label-error);"]))),v=a.div.withConfig({displayName:"file-upload-status.style__StyledActions",componentId:"carbon_v163_0_0__sc-d044d4c9-11"})(["display:flex;align-items:center;gap:var(--global-space-comp-s);flex-wrap:wrap;justify-content:flex-end;"]);export{v as StyledActions,_ as StyledErrorStatus,m as StyledFileDetails,g as StyledFileName,d as StyledFileNameRow,o as StyledFileUploadStatus,n as StyledLeadingColumn,c as StyledStatusContent,s as StyledStatusIcon,u as StyledStatusMessage,r as StyledThumbnail,p as StyledUploadingIcon};
|
package/esm/components/file-input/__internal__/file-upload-status/thumbnail-content.component.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type IconType } from "../../../icon";
|
|
3
|
+
import type { FileUploadStatusProps } from "./file-upload-status.component";
|
|
4
|
+
import { StyledStatusIcon, StyledUploadingIcon } from "./file-upload-status.style";
|
|
5
|
+
interface UploadingIndicatorProps {
|
|
6
|
+
as: typeof StyledUploadingIcon | typeof StyledStatusIcon;
|
|
7
|
+
filename: string;
|
|
8
|
+
size: "small" | "extra-small";
|
|
9
|
+
progress?: number;
|
|
10
|
+
statusMessage?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const UploadingIndicator: ({ as: Wrapper, filename, size, progress, statusMessage, }: UploadingIndicatorProps) => React.JSX.Element;
|
|
13
|
+
interface ThumbnailContentProps {
|
|
14
|
+
status: FileUploadStatusProps["status"];
|
|
15
|
+
filename: string;
|
|
16
|
+
thumbnailSrc?: string;
|
|
17
|
+
failedThumbnailSrc?: string;
|
|
18
|
+
fallbackIconType: IconType;
|
|
19
|
+
progress?: number;
|
|
20
|
+
statusMessage?: string;
|
|
21
|
+
onThumbnailError: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const ThumbnailContent: ({ status, filename, thumbnailSrc, failedThumbnailSrc, fallbackIconType, progress, statusMessage, onThumbnailError, }: ThumbnailContentProps) => React.JSX.Element;
|
|
24
|
+
export default ThumbnailContent;
|
package/esm/components/file-input/__internal__/file-upload-status/thumbnail-content.component.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import"react";import a from"../../../icon/icon.component.js";import"../../../icon/icon.style.js";import{Loader as r}from"../../../loader/__next__/loader.component.js";import{StyledUploadingIcon as i,StyledThumbnail as o}from"./file-upload-status.style.js";import s from"../../../../hooks/__internal__/useLocale/useLocale.js";const l=({as:a,filename:i,size:o,progress:l,statusMessage:n})=>{const t=s().fileInput;return void 0===l?(null==n?void 0:n.trim())?e(a,{"aria-hidden":!0,children:e(r,{loaderType:"ring",size:o,showLabel:!1})}):e(a,{role:"img","aria-label":`${i}: ${t.uploading()}`,children:e("span",{"aria-hidden":!0,children:e(r,{loaderType:"ring",size:o,showLabel:!1})})}):e(a,{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":l,"aria-label":i,children:e("span",{"aria-hidden":!0,children:e(r,{loaderType:"ring",isTracked:!0,size:o,showLabel:!1})})})},n=({status:r,filename:s,thumbnailSrc:n,failedThumbnailSrc:t,fallbackIconType:d,progress:m,statusMessage:p,onThumbnailError:c})=>"uploading"===r?e(l,{as:i,filename:s,size:"small",progress:m,statusMessage:p}):"error"===r?e(a,{type:d,size:"large","aria-hidden":!0,color:"negative"}):n&&n!==t?e(o,{src:n,alt:"",onError:c}):e(a,{type:d,"aria-hidden":!0,color:"neutral"});export{l as UploadingIndicator,n as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type FileUploadStatusProps } from "../file-upload-status";
|
|
3
|
+
export interface FileUploadStatusListProps {
|
|
4
|
+
items: FileUploadStatusProps[];
|
|
5
|
+
label: string;
|
|
6
|
+
statusSummary?: string;
|
|
7
|
+
errorSummary?: string;
|
|
8
|
+
moveFocusAfterAction: (element: HTMLElement, removalAnnouncement?: string) => void;
|
|
9
|
+
maxHeight?: string;
|
|
10
|
+
minHeight?: string;
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
removalAnnouncementId?: string;
|
|
13
|
+
onPreviewActivate?: () => void;
|
|
14
|
+
announceInitialErrors?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const FileUploadStatusList: ({ items, label, statusSummary, errorSummary, moveFocusAfterAction, maxHeight, minHeight, multiple, removalAnnouncementId, onPreviewActivate, announceInitialErrors, }: FileUploadStatusListProps) => React.JSX.Element;
|
|
17
|
+
export default FileUploadStatusList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r}from"react";import n from"../../../../__internal__/utils/helpers/guid/index.js";import{FileUploadStatus as i}from"../file-upload-status/file-upload-status.component.js";import{StyledFileUploadStatusListContainer as o,StyledFileUploadStatusListLabelSet as l,StyledFileUploadStatusListLabel as a,StyledFileUploadStatusListErrorSummary as c,StyledFileUploadStatusList as u}from"../../file-input.style.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 m(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 p=({items:s,label:p,statusSummary:d,errorSummary:f,moveFocusAfterAction:b,maxHeight:y,minHeight:v,multiple:O,removalAnnouncementId:h,onPreviewActivate:j,announceInitialErrors:g})=>{const P=r(n()),w=r(n()),A=r(n());return e(o,{$multiple:O,children:[e(l,{children:[t(a,{variant:"p",id:P.current,$visuallyHidden:!O,children:p}),d&&t(a,{variant:"p",id:w.current,$visuallyHidden:!O,children:d}),f&&t(c,{variant:"p",id:A.current,children:f})]}),t(u,{"data-role":"file-upload-status-list",tabIndex:-1,"aria-labelledby":[P.current,d?w.current:void 0,f?A.current:void 0].filter(Boolean).join(" "),"aria-describedby":h,$hasMultipleItems:s.length>1,children:s.map(((e,r)=>{var n,o,l;return t("li",{children:t(i,(o=m({},e),l={isInMultiItemList:s.length>1,moveFocusAfterAction:b,maxHeight:y,minHeight:v,multiple:O,removalAnnouncementId:h,onPreviewActivate:j,announceInitialError:g},l=null!=l?l:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(l)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(l,e))})),o))},null!==(n=e.id)&&void 0!==n?n:`${e.filename}-${s.slice(0,r).filter((({filename:t})=>t===e.filename)).length}`)}))})]})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./file-upload-status-list.component";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default}from"./file-upload-status-list.component.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface UseFileDropZoneArgs {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onFilesDropped: (files: FileList) => void;
|
|
5
|
+
onDropComplete?: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface UseFileDropZoneResult {
|
|
8
|
+
isDraggedOver: boolean;
|
|
9
|
+
onDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
10
|
+
onDragLeave: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
11
|
+
onDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Drop-zone handlers for FileInput. `isDraggedOver` is true while files are
|
|
15
|
+
* dragged over the zone. A drop passes the files to `onFilesDropped`, then
|
|
16
|
+
* calls `onDropComplete`. Nothing happens while `disabled` or when no files
|
|
17
|
+
* were dropped.
|
|
18
|
+
*/
|
|
19
|
+
export default function useFileDropZone({ disabled, onFilesDropped, onDropComplete, }: UseFileDropZoneArgs): UseFileDropZoneResult;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as e}from"react";function r({disabled:r,onFilesDropped:t,onDropComplete:a}){const[n,o]=e(!1);return{isDraggedOver:n,onDragOver:e=>{e.preventDefault(),!r&&e.dataTransfer.types.includes("Files")&&o(!0)},onDragLeave:e=>{e.preventDefault();const{currentTarget:r,relatedTarget:t}=e;t instanceof Node&&r.contains(t)||o(!1)},onDrop:e=>{e.preventDefault(),o(!1),!r&&e.dataTransfer.files.length&&(t(e.dataTransfer.files),null==a||a())}}}export{r as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
interface UseMoveFocusAfterFileRemovalProps {
|
|
3
|
+
statusListRef: RefObject<HTMLElement>;
|
|
4
|
+
fallbackRef: RefObject<HTMLElement | null>;
|
|
5
|
+
/** Runs just before the removal announcement is shown, e.g. to clear the live region. */
|
|
6
|
+
onRemovalAnnouncement: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Keeps focus in the field when a status action (such as Delete) removes its
|
|
10
|
+
* card. Call `moveFocusAfterAction` from the action. When it is given an
|
|
11
|
+
* announcement, that text is exposed as `removalAnnouncement` for the caller
|
|
12
|
+
* to add to the newly focused element's accessible description.
|
|
13
|
+
*/
|
|
14
|
+
export default function useMoveFocusAfterFileRemoval({ statusListRef, fallbackRef, onRemovalAnnouncement, }: UseMoveFocusAfterFileRemovalProps): {
|
|
15
|
+
removalAnnouncement: string;
|
|
16
|
+
clearRemovalAnnouncement: () => void;
|
|
17
|
+
moveFocusAfterAction: (element: HTMLElement, announcement?: string) => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as o,useCallback as t}from"react";import{flushSync as e}from"react-dom";import n,{getStatusFocusTarget as r}from"../utils/focus-next-action.js";function c({statusListRef:c,fallbackRef:m,onRemovalAnnouncement:a}){const[u,f]=o("");return{removalAnnouncement:u,clearRemovalAnnouncement:t((()=>f("")),[]),moveFocusAfterAction:(o,t)=>n(o,(()=>r(c.current,m.current)),t?(o=>t=>{t&&e((()=>{a(),f(o)}))})(t):void 0)}}export{c as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
interface UseMoveFocusAfterFileSelectionProps {
|
|
3
|
+
multiple?: boolean;
|
|
4
|
+
hasFiles: boolean;
|
|
5
|
+
fallbackRef: RefObject<HTMLButtonElement | null>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* In single-file mode, moves focus to the file's status card after a file is
|
|
9
|
+
* selected: its first action, else the status list. Until the consumer
|
|
10
|
+
* renders the status, focus is kept on the Select file button, and the move
|
|
11
|
+
* is canceled if focus leaves that button. Does nothing in multiple-file
|
|
12
|
+
* mode.
|
|
13
|
+
*/
|
|
14
|
+
export default function useMoveFocusAfterFileSelection({ multiple, hasFiles, fallbackRef, }: UseMoveFocusAfterFileSelectionProps): {
|
|
15
|
+
statusListRef: RefObject<HTMLDivElement>;
|
|
16
|
+
requestFileStatusFocus: () => void;
|
|
17
|
+
cancelFileStatusFocus: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as r,useState as t,useEffect as e}from"react";import{getStatusFocusTarget as u}from"../utils/focus-next-action.js";function n({multiple:n,hasFiles:c,fallbackRef:s}){const o=r(null),a=r(!1),[i,l]=t(0);return e((()=>{n?a.current=!1:a.current&&(c?(a.current=!1,requestAnimationFrame((()=>{var r;null===(r=u(o.current,s.current))||void 0===r||r.focus()}))):requestAnimationFrame((()=>{var r;return null===(r=s.current)||void 0===r?void 0:r.focus()})))}),[s,i,c,n]),{statusListRef:o,cancelFileStatusFocus:()=>{a.current=!1},requestFileStatusFocus:()=>{a.current=!0,l((r=>r+1))}}}export{n as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drives the file input's polite live region. Announcing the same message
|
|
3
|
+
* twice in a row clears the region first and refills it two frames later,
|
|
4
|
+
* so screen readers treat the repeat as a new announcement. A message stays
|
|
5
|
+
* until the next announcement or `clearStatusAnnouncement`.
|
|
6
|
+
*/
|
|
7
|
+
export default function useStatusAnnouncement(): {
|
|
8
|
+
statusAnnouncement: string;
|
|
9
|
+
announceStatus: (message: string) => void;
|
|
10
|
+
clearStatusAnnouncement: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as n,useRef as r,useCallback as t,useEffect as e}from"react";function u(){const[u,c]=n(""),a=r(""),o=r(),i=t((()=>{void 0!==o.current&&(cancelAnimationFrame(o.current),o.current=void 0)}),[]),m=t((()=>{i(),a.current="",c("")}),[i]),s=t((n=>{if(i(),a.current!==n)return a.current=n,void c(n);c(""),o.current=requestAnimationFrame((()=>{o.current=requestAnimationFrame((()=>{c(n),o.current=void 0}))}))}),[i]);return e((()=>i),[i]),{statusAnnouncement:u,announceStatus:s,clearStatusAnnouncement:m}}export{u as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FileUploadStatusProps } from "../file-upload-status";
|
|
2
|
+
/**
|
|
3
|
+
* Calls `onFilesCompleted` with the filenames that have newly transitioned
|
|
4
|
+
* to `"completed"` since the last render, so the caller can announce them
|
|
5
|
+
* through one persistent live region.
|
|
6
|
+
*
|
|
7
|
+
* Statuses that are already `"completed"` on the first render are treated as a
|
|
8
|
+
* starting snapshot, so mounting a `FileInput` with existing statuses never
|
|
9
|
+
* fires an announcement.
|
|
10
|
+
*/
|
|
11
|
+
export default function useUploadCompletionAnnouncement(currentStatuses: FileUploadStatusProps[], onFilesCompleted: (filenames: string[]) => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as t,useEffect as e}from"react";function r(r,n){const a=t(!0),c=t([]);e((()=>{const t=r.filter((({status:t})=>"completed"===t)),e=new Set(c.current.flatMap((({id:t})=>t?[t]:[]))),l=new Map;c.current.forEach((({id:t,filename:e})=>{var r;t||l.set(e,(null!==(r=l.get(e))&&void 0!==r?r:0)+1)}));const o=t.flatMap((({id:t,filename:r})=>{if(t)return e.has(t)?[]:[r];var n;const a=null!==(n=l.get(r))&&void 0!==n?n:0;return 0===a?[r]:(l.set(r,a-1),[])}));!a.current&&o.length&&n(o),c.current=t,a.current=!1}),[r,n])}export{r as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picks where focus should land inside the status lists: the first status
|
|
3
|
+
* action, else the first status list, else `fallback` (the Select file
|
|
4
|
+
* button).
|
|
5
|
+
*/
|
|
6
|
+
export declare const getStatusFocusTarget: (container: HTMLElement | null, fallback: HTMLElement | null) => HTMLElement | null;
|
|
7
|
+
/**
|
|
8
|
+
* Keeps focus in the field when a status action removes its own card.
|
|
9
|
+
*
|
|
10
|
+
* Call it from the action's click handler. On the next frame, if `element`
|
|
11
|
+
* has been removed, focus moves to the nearest action still in the same
|
|
12
|
+
* list: the next one, else the previous one, else whatever `getFallback`
|
|
13
|
+
* returns. If `element` is still in the DOM, nothing happens.
|
|
14
|
+
*
|
|
15
|
+
* `onRemoved` receives the target before focus moves, so the caller can add
|
|
16
|
+
* the removal announcement to the target's description first.
|
|
17
|
+
*/
|
|
18
|
+
export default function focusNextAction(element: HTMLElement, getFallback: () => HTMLElement | null, onRemoved?: (focusTarget: HTMLElement | null) => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="button, a[href]",n=(n,o)=>{var t,l;return null!==(l=null!==(t=null==n?void 0:n.querySelector(e))&&void 0!==t?t:null==n?void 0:n.querySelector('[data-role="file-upload-status-list"]'))&&void 0!==l?l:o};function o(n,o,t){var l;const r=Array.from((null===(l=n.closest('[role="list"], ul'))||void 0===l?void 0:l.querySelectorAll(e))||[]),i=r.indexOf(n),u=e=>{t?(t(e),requestAnimationFrame((()=>null==e?void 0:e.focus()))):null==e||e.focus()};requestAnimationFrame((()=>{if(document.contains(n))return;const e=r.slice(i+1).find((e=>document.contains(e))),t=r.slice(0,i).reverse().find((e=>document.contains(e)));e?u(e):t?u(t):requestAnimationFrame((()=>u(o())))}))}export{o as default,n as getStatusFocusTarget};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CurrentFileStatusCounts } from "../../../../locales/locale";
|
|
2
|
+
import { type FileUploadStatusProps } from "../file-upload-status";
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes the `uploadStatus` prop to an array and splits it into current
|
|
5
|
+
* and previously uploaded statuses, each in their original order.
|
|
6
|
+
*/
|
|
7
|
+
export default function splitStatuses(uploadStatus: FileUploadStatusProps | FileUploadStatusProps[] | undefined): {
|
|
8
|
+
currentStatuses: FileUploadStatusProps[];
|
|
9
|
+
previouslyUploadedStatuses: FileUploadStatusProps[];
|
|
10
|
+
};
|
|
11
|
+
/** Counts statuses by state, for the current files error summary. */
|
|
12
|
+
export declare function countStatuses(statuses: FileUploadStatusProps[]): CurrentFileStatusCounts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){const e=(Array.isArray(t)?t:[t]).filter(Boolean);return{currentStatuses:e.filter((({status:t})=>"previously"!==t)),previouslyUploadedStatuses:e.filter((({status:t})=>"previously"===t))}}function e(t){const e=e=>t.filter((({status:t})=>t===e)).length;return{totalCount:t.length,uploadingCount:e("uploading"),completedCount:e("completed"),errorCount:e("error")}}export{e as countStatuses,t as default};
|