carbon-react 132.1.0 → 132.2.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__/focus-trap/focus-trap.component.js +1 -1
- package/esm/components/loader-spinner/index.d.ts +2 -0
- package/esm/components/loader-spinner/index.js +1 -0
- package/esm/components/loader-spinner/loader-spinner.component.d.ts +36 -0
- package/esm/components/loader-spinner/loader-spinner.component.js +60 -0
- package/esm/components/loader-spinner/loader-spinner.config.d.ts +11 -0
- package/esm/components/loader-spinner/loader-spinner.config.js +25 -0
- package/esm/components/loader-spinner/loader-spinner.style.d.ts +13 -0
- package/esm/components/loader-spinner/loader-spinner.style.js +127 -0
- package/esm/components/menu/__internal__/submenu/submenu.component.js +45 -12
- package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
- package/esm/components/menu/__internal__/submenu/submenu.style.js +31 -1
- package/esm/components/modal/__internal__/modal-manager.js +2 -3
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +2 -3
- package/esm/locales/__internal__/es-es.js +3 -0
- package/esm/locales/en-gb.js +3 -0
- package/esm/locales/locale.d.ts +3 -0
- package/lib/__internal__/character-count/character-count.style.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.component.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/lib/__internal__/checkable-input/hidden-checkable-input.component.js +1 -1
- package/lib/__internal__/field-help/field-help.style.js +1 -1
- package/lib/__internal__/fieldset/fieldset.component.js +1 -1
- package/lib/__internal__/fieldset/fieldset.style.js +1 -1
- package/lib/__internal__/focus-trap/focus-trap.component.js +2 -2
- package/lib/__internal__/form-field/form-field.component.js +1 -1
- package/lib/__internal__/form-field/form-field.style.js +1 -1
- package/lib/__internal__/full-screen-heading/full-screen-heading.component.js +1 -1
- package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
- package/lib/__internal__/input/input-presentation.component.js +1 -1
- package/lib/__internal__/input/input-presentation.style.js +1 -1
- package/lib/__internal__/input/input.component.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.component.js +1 -1
- package/lib/__internal__/label/label.style.js +1 -1
- package/lib/__internal__/popover/popover.component.js +1 -1
- package/lib/__internal__/radio-button-mapper/radio-button-mapper.component.js +1 -1
- package/lib/__internal__/sticky-footer/sticky-footer.component.js +1 -1
- package/lib/__internal__/sticky-footer/sticky-footer.style.js +1 -1
- package/lib/__internal__/tooltip-provider/index.js +1 -1
- package/lib/__internal__/validation-message/validation-message.style.js +1 -1
- package/lib/__internal__/validations/validation-icon.component.js +1 -1
- package/lib/__internal__/validations/validation-icon.style.js +1 -1
- package/lib/components/accordion/accordion-group/accordion-group.component.js +1 -1
- package/lib/components/accordion/accordion.component.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-menu/action-popover-menu.component.js +1 -1
- package/lib/components/action-popover/action-popover.component.js +1 -1
- package/lib/components/action-popover/action-popover.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.component.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.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/crumb/crumb.style.js +1 -1
- package/lib/components/button/button.component.js +1 -1
- package/lib/components/button/button.style.js +1 -1
- package/lib/components/button/index.js +1 -1
- package/lib/components/button-bar/button-bar.style.js +1 -1
- package/lib/components/button-minor/button-minor.component.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.component.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.component.js +1 -1
- package/lib/components/button-toggle/button-toggle.style.js +1 -1
- package/lib/components/carbon-provider/carbon-provider.component.js +1 -1
- package/lib/components/carbon-provider/top-modal-context.js +1 -1
- package/lib/components/card/card-footer/card-footer.component.js +1 -1
- package/lib/components/card/card-footer/card-footer.style.js +1 -1
- package/lib/components/card/card-row/card-row.component.js +1 -1
- package/lib/components/card/card-row/card-row.style.js +1 -1
- package/lib/components/card/card.component.js +1 -1
- package/lib/components/card/card.style.js +1 -1
- package/lib/components/carousel/carousel.component.js +1 -1
- package/lib/components/carousel/carousel.style.js +1 -1
- package/lib/components/carousel/slide/slide.style.js +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.js +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
- package/lib/components/checkbox/checkbox.component.js +1 -1
- package/lib/components/checkbox/checkbox.style.js +1 -1
- package/lib/components/confirm/confirm.component.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__/date-picker/date-picker.component.js +1 -1
- package/lib/components/date/__internal__/date-picker/day-picker.style.js +1 -1
- package/lib/components/date/date.component.js +1 -1
- package/lib/components/date/date.style.js +1 -1
- package/lib/components/date-range/date-range.component.js +1 -1
- package/lib/components/decimal/decimal.component.js +1 -1
- package/lib/components/definition-list/dd/dd.component.js +1 -1
- package/lib/components/definition-list/definition-list.style.js +1 -1
- package/lib/components/definition-list/dt/dt.component.js +1 -1
- package/lib/components/detail/detail.style.js +1 -1
- package/lib/components/dialog/dialog.component.js +1 -1
- package/lib/components/dialog/dialog.style.js +1 -1
- package/lib/components/dialog-full-screen/content.style.js +1 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -1
- package/lib/components/dialog-full-screen/dialog-full-screen.style.js +1 -1
- package/lib/components/dismissible-box/dismissible-box.style.js +1 -1
- package/lib/components/draggable/draggable-container.component.js +1 -1
- package/lib/components/drawer/drawer.component.js +1 -1
- package/lib/components/drawer/drawer.style.js +1 -1
- package/lib/components/drawer/index.js +1 -1
- package/lib/components/duelling-picklist/duelling-picklist.component.js +1 -1
- package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist/picklist.component.js +1 -1
- package/lib/components/duelling-picklist/picklist-group/picklist-group.component.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.component.js +1 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
- package/lib/components/fieldset/fieldset.component.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.component.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.component.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.component.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.component.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.component.js +1 -1
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.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/__internal__/sub-row-provider.js +1 -1
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.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.component.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.component.js +1 -1
- package/lib/components/flat-table/flat-table.style.js +1 -1
- package/lib/components/flat-table/sort/sort.component.js +1 -1
- package/lib/components/form/__internal__/form-summary.component.js +1 -1
- package/lib/components/form/__internal__/form-summary.style.js +1 -1
- package/lib/components/form/form.component.js +1 -1
- package/lib/components/form/form.style.js +1 -1
- package/lib/components/grid/grid-item/grid-item.style.js +1 -1
- package/lib/components/grouped-character/grouped-character.component.js +1 -1
- package/lib/components/heading/heading.style.js +1 -1
- package/lib/components/help/help.component.js +1 -1
- package/lib/components/help/help.style.js +1 -1
- package/lib/components/icon/icon.component.js +1 -1
- package/lib/components/icon/icon.style.js +1 -1
- package/lib/components/icon-button/icon-button.component.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.component.js +1 -1
- package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
- package/lib/components/link/link.component.js +1 -1
- package/lib/components/link/link.style.js +1 -1
- package/lib/components/link-preview/link-preview.style.js +1 -1
- package/lib/components/loader/loader-square.style.js +1 -1
- package/lib/components/loader-bar/loader-bar.component.js +1 -1
- package/lib/components/loader-bar/loader-bar.style.js +1 -1
- package/lib/components/loader-spinner/index.d.ts +2 -0
- package/lib/components/loader-spinner/index.js +13 -0
- package/lib/components/loader-spinner/loader-spinner.component.d.ts +36 -0
- package/lib/components/loader-spinner/loader-spinner.component.js +68 -0
- package/lib/components/loader-spinner/loader-spinner.config.d.ts +11 -0
- package/lib/components/loader-spinner/loader-spinner.config.js +30 -0
- package/lib/components/loader-spinner/loader-spinner.style.d.ts +13 -0
- package/lib/components/loader-spinner/loader-spinner.style.js +136 -0
- package/lib/components/loader-spinner/package.json +6 -0
- package/lib/components/menu/__internal__/submenu/submenu.component.js +46 -13
- package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
- package/lib/components/menu/__internal__/submenu/submenu.style.js +32 -2
- package/lib/components/menu/menu-divider/menu-divider.component.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.component.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.component.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.component.js +1 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
- package/lib/components/menu/menu.component.js +1 -1
- package/lib/components/menu/menu.style.js +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
- package/lib/components/message/message.component.js +1 -1
- package/lib/components/message/message.style.js +1 -1
- package/lib/components/message/type-icon/type-icon.style.js +1 -1
- package/lib/components/modal/__internal__/modal-manager.js +2 -3
- package/lib/components/modal/index.js +1 -1
- package/lib/components/modal/modal.component.js +1 -1
- package/lib/components/modal/modal.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/fixed-navigation-bar.context.js +1 -1
- package/lib/components/navigation-bar/navigation-bar.component.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/number/number.component.js +1 -1
- package/lib/components/numeral-date/numeral-date.component.js +1 -1
- package/lib/components/numeral-date/numeral-date.style.js +1 -1
- package/lib/components/pager/__internal__/pager-navigation-link.component.js +1 -1
- package/lib/components/pager/__internal__/pager-navigation.component.js +1 -1
- package/lib/components/pager/pager.component.js +1 -1
- package/lib/components/pager/pager.style.js +1 -1
- package/lib/components/pages/page/page.component.js +1 -1
- package/lib/components/pages/pages.component.js +1 -1
- package/lib/components/password/password.component.js +1 -1
- package/lib/components/pill/pill.style.js +1 -1
- package/lib/components/pod/pod.component.js +1 -1
- package/lib/components/pod/pod.style.js +1 -1
- package/lib/components/popover-container/popover-container.component.js +1 -1
- package/lib/components/portal/portal.js +1 -1
- package/lib/components/portrait/portrait.component.js +1 -1
- package/lib/components/preview/__internal__/preview-placeholder.style.js +1 -1
- package/lib/components/progress-tracker/progress-tracker.component.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.component.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.component.js +1 -1
- package/lib/components/radio-button/radio-button.style.js +1 -1
- package/lib/components/search/search.component.js +1 -1
- package/lib/components/search/search.style.js +1 -1
- package/lib/components/select/__internal__/select-text/select-text.style.js +1 -1
- package/lib/components/select/filterable-select/filterable-select.component.js +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +1 -1
- package/lib/components/select/option/option.component.js +1 -1
- package/lib/components/select/option/option.style.js +1 -1
- package/lib/components/select/option-group-header/option-group-header.component.js +1 -1
- package/lib/components/select/option-row/option-row.component.js +1 -1
- package/lib/components/select/option-row/option-row.style.js +1 -1
- package/lib/components/select/select-list/select-list.component.js +1 -1
- package/lib/components/select/select-list/select-list.style.js +1 -1
- package/lib/components/select/select-textbox/select-textbox.component.js +1 -1
- package/lib/components/select/select.style.js +1 -1
- package/lib/components/select/simple-select/simple-select.component.js +1 -1
- package/lib/components/select/utils/with-filter.hoc.js +1 -1
- package/lib/components/settings-row/settings-row.style.js +1 -1
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/lib/components/sidebar/index.js +1 -1
- package/lib/components/sidebar/sidebar.component.js +1 -1
- package/lib/components/sidebar/sidebar.style.js +1 -1
- package/lib/components/simple-color-picker/simple-color/simple-color.component.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.component.js +1 -1
- package/lib/components/simple-color-picker/simple-color-picker.style.js +1 -1
- package/lib/components/split-button/split-button-children.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.component.js +1 -1
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.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/__internal__/switch-slider-panel.style.js +1 -1
- package/lib/components/switch/__internal__/switch-slider.style.js +1 -1
- package/lib/components/switch/switch.component.js +1 -1
- package/lib/components/switch/switch.style.js +1 -1
- package/lib/components/tabs/__internal__/tab-title/index.js +1 -1
- package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +1 -1
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +1 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.component.js +1 -1
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +1 -1
- package/lib/components/tabs/tab/index.js +1 -1
- package/lib/components/tabs/tab/tab.component.js +1 -1
- package/lib/components/tabs/tab/tab.style.js +1 -1
- package/lib/components/tabs/tabs.component.js +1 -1
- package/lib/components/tabs/tabs.style.js +1 -1
- package/lib/components/text-editor/__internal__/editor-link/editor-link.component.js +1 -1
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +1 -1
- package/lib/components/text-editor/__internal__/toolbar/toolbar.component.js +1 -1
- package/lib/components/text-editor/index.js +1 -1
- package/lib/components/text-editor/text-editor.component.js +1 -1
- package/lib/components/text-editor/text-editor.style.js +1 -1
- package/lib/components/textarea/textarea.component.js +1 -1
- package/lib/components/textarea/textarea.style.js +1 -1
- package/lib/components/textbox/textbox.component.js +1 -1
- package/lib/components/textbox/textbox.style.js +1 -1
- package/lib/components/tile/tile-content/tile-content.component.js +1 -1
- package/lib/components/tile/tile-content/tile-content.style.js +1 -1
- package/lib/components/tile/tile-footer/tile-footer.style.js +1 -1
- package/lib/components/tile/tile-header/tile-header.style.js +1 -1
- package/lib/components/tile/tile.style.js +1 -1
- package/lib/components/tile-select/__internal__/accordion/accordion.component.js +1 -1
- package/lib/components/tile-select/tile-select.component.js +1 -1
- package/lib/components/tile-select/tile-select.style.js +1 -1
- package/lib/components/time/__internal__/time-toggle/time-toggle.component.js +1 -1
- package/lib/components/time/time.component.js +1 -1
- package/lib/components/toast/toast.component.js +1 -1
- package/lib/components/toast/toast.style.js +1 -1
- package/lib/components/tooltip/tooltip-pointer.style.js +1 -1
- package/lib/components/tooltip/tooltip.component.js +1 -1
- package/lib/components/tooltip/tooltip.style.js +1 -1
- package/lib/components/typography/typography.style.js +1 -1
- package/lib/components/vertical-divider/vertical-divider.component.js +1 -1
- package/lib/components/vertical-divider/vertical-divider.style.js +1 -1
- package/lib/components/vertical-menu/vertical-menu-full-screen/vertical-menu-full-screen.component.js +1 -1
- package/lib/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.js +1 -1
- package/lib/components/vertical-menu/vertical-menu.style.js +1 -1
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +1 -1
- package/lib/hooks/__internal__/useIsStickyFooterForm/useIsStickyFooterForm.js +1 -1
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +2 -3
- package/lib/locales/__internal__/es-es.js +3 -0
- package/lib/locales/en-gb.js +3 -0
- package/lib/locales/locale.d.ts +3 -0
- package/package.json +6 -14
|
@@ -137,7 +137,7 @@ const FocusTrap = ({
|
|
|
137
137
|
}, [triggerRefocusFlag, refocusTrap]);
|
|
138
138
|
const [tabIndex, setTabIndex] = useState(0);
|
|
139
139
|
useEffect(() => {
|
|
140
|
-
//
|
|
140
|
+
// tabIndex is set to 0 and removed on blur.
|
|
141
141
|
if (!isOpen) {
|
|
142
142
|
setTabIndex(0);
|
|
143
143
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LoaderSpinner } from "./loader-spinner.component";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
3
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
4
|
+
import { LoaderSpinnerSizes, LoaderSpinnerVariants } from "./loader-spinner.config";
|
|
5
|
+
export interface LoaderSpinnerProps extends MarginProps, TagProps {
|
|
6
|
+
/**
|
|
7
|
+
* The size prop allows a specific size to be set, ranging from
|
|
8
|
+
* `extra-small` to `extra-large`
|
|
9
|
+
*/
|
|
10
|
+
size?: LoaderSpinnerSizes;
|
|
11
|
+
/**
|
|
12
|
+
* If set to `false` no visual label will be displayed, however
|
|
13
|
+
* a visually hidden label will still be available for assistive technologies
|
|
14
|
+
*/
|
|
15
|
+
showSpinnerLabel?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The variant prop can be used to change the appearance of the component.
|
|
18
|
+
* Typically both the outer and inner spinner will change color,
|
|
19
|
+
* however there will still be sufficient contrast between them
|
|
20
|
+
*/
|
|
21
|
+
variant?: LoaderSpinnerVariants;
|
|
22
|
+
/** If set to `false` all motion will be suspended */
|
|
23
|
+
hasMotion?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If set to `true` the animation type will become tracked, this is
|
|
26
|
+
* used specifically for when wait times are predictable
|
|
27
|
+
*/
|
|
28
|
+
isTracked?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The total animation time (in seconds). Default animation is time `1` second.
|
|
31
|
+
* For any gradient variants the default animation time is `2` seconds
|
|
32
|
+
*/
|
|
33
|
+
animationTime?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const LoaderSpinner: ({ size, showSpinnerLabel, variant, isTracked, hasMotion, animationTime, ...rest }: LoaderSpinnerProps) => React.JSX.Element;
|
|
36
|
+
export default LoaderSpinner;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
5
|
+
import { StyledSpinnerWrapper, StyledLabel, StyledSpinnerCircleSvg } from "./loader-spinner.style";
|
|
6
|
+
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
7
|
+
import useLocale from "../../hooks/__internal__/useLocale";
|
|
8
|
+
import useMediaQuery from "../../hooks/useMediaQuery";
|
|
9
|
+
import Typography from "../typography";
|
|
10
|
+
export const LoaderSpinner = ({
|
|
11
|
+
size = "medium",
|
|
12
|
+
showSpinnerLabel = true,
|
|
13
|
+
variant = "action",
|
|
14
|
+
isTracked = false,
|
|
15
|
+
hasMotion = true,
|
|
16
|
+
animationTime,
|
|
17
|
+
...rest
|
|
18
|
+
}) => {
|
|
19
|
+
const locale = useLocale();
|
|
20
|
+
const reduceMotion = !useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
21
|
+
const isLabelDark = variant !== "inverse" && variant !== "gradient-white";
|
|
22
|
+
const spinnerLabel = /*#__PURE__*/React.createElement(StyledLabel, {
|
|
23
|
+
"data-role": "visible-label",
|
|
24
|
+
variant: "span",
|
|
25
|
+
fontWeight: "500",
|
|
26
|
+
size: size,
|
|
27
|
+
color: isLabelDark ? "var(--colorsUtilityYin090);" : "var(--colorsActionMajorYang100);",
|
|
28
|
+
fontSize: size === "extra-large" ? "var(--sizing200)" : "var(--sizing175)",
|
|
29
|
+
lineHeight: size === "extra-large" ? "var(--sizing300)" : "var(--sizing250)"
|
|
30
|
+
}, locale.loaderSpinner.loading());
|
|
31
|
+
const isGradientVariant = variant === "gradient-white" || variant === "gradient-grey";
|
|
32
|
+
const calculateDefaultAnimationTime = () => {
|
|
33
|
+
if (animationTime) {
|
|
34
|
+
return animationTime;
|
|
35
|
+
}
|
|
36
|
+
return isGradientVariant ? 2 : 1;
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement(StyledSpinnerWrapper, _extends({
|
|
39
|
+
size: size,
|
|
40
|
+
role: "status"
|
|
41
|
+
}, tagComponent("loader-spinner", rest), filterStyledSystemMarginProps(rest)), reduceMotion ? spinnerLabel : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledSpinnerCircleSvg, {
|
|
42
|
+
role: "presentation",
|
|
43
|
+
size: size,
|
|
44
|
+
variant: variant,
|
|
45
|
+
hasMotion: hasMotion,
|
|
46
|
+
isTracked: isTracked,
|
|
47
|
+
isGradientVariant: isGradientVariant,
|
|
48
|
+
animationTime: calculateDefaultAnimationTime(),
|
|
49
|
+
viewBox: "0 0 24 24"
|
|
50
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
51
|
+
"data-role": "outer-arc"
|
|
52
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
53
|
+
"data-role": "inner-arc"
|
|
54
|
+
})), showSpinnerLabel ? spinnerLabel : /*#__PURE__*/React.createElement(Typography, {
|
|
55
|
+
"data-role": "hidden-label",
|
|
56
|
+
variant: "span",
|
|
57
|
+
screenReaderOnly: true
|
|
58
|
+
}, locale.loaderSpinner.loading())));
|
|
59
|
+
};
|
|
60
|
+
export default LoaderSpinner;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const LOADER_SPINNER_VARIANTS: readonly ["action", "neutral", "inverse", "gradient-grey", "gradient-white"];
|
|
2
|
+
declare type LoaderSpinnerVariants = typeof LOADER_SPINNER_VARIANTS[number];
|
|
3
|
+
declare const LOADER_SPINNER_SIZES: readonly ["extra-small", "small", "medium", "large", "extra-large"];
|
|
4
|
+
declare type LoaderSpinnerSizes = typeof LOADER_SPINNER_SIZES[number];
|
|
5
|
+
declare type LoaderSpinnerSizeParams = Record<LoaderSpinnerSizes, {
|
|
6
|
+
wrapperDimensions: number;
|
|
7
|
+
strokeWidth: number;
|
|
8
|
+
}>;
|
|
9
|
+
declare const LOADER_SPINNER_SIZE_PARAMS: LoaderSpinnerSizeParams;
|
|
10
|
+
export type { LoaderSpinnerSizes, LoaderSpinnerVariants };
|
|
11
|
+
export { LOADER_SPINNER_SIZES, LOADER_SPINNER_VARIANTS, LOADER_SPINNER_SIZE_PARAMS, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const LOADER_SPINNER_VARIANTS = ["action", "neutral", "inverse", "gradient-grey", "gradient-white"];
|
|
2
|
+
const LOADER_SPINNER_SIZES = ["extra-small", "small", "medium", "large", "extra-large"];
|
|
3
|
+
const LOADER_SPINNER_SIZE_PARAMS = {
|
|
4
|
+
"extra-small": {
|
|
5
|
+
wrapperDimensions: 20,
|
|
6
|
+
strokeWidth: 4
|
|
7
|
+
},
|
|
8
|
+
small: {
|
|
9
|
+
wrapperDimensions: 32,
|
|
10
|
+
strokeWidth: 4
|
|
11
|
+
},
|
|
12
|
+
medium: {
|
|
13
|
+
wrapperDimensions: 56,
|
|
14
|
+
strokeWidth: 3.3
|
|
15
|
+
},
|
|
16
|
+
large: {
|
|
17
|
+
wrapperDimensions: 80,
|
|
18
|
+
strokeWidth: 3.7
|
|
19
|
+
},
|
|
20
|
+
"extra-large": {
|
|
21
|
+
wrapperDimensions: 104,
|
|
22
|
+
strokeWidth: 3.7
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export { LOADER_SPINNER_SIZES, LOADER_SPINNER_VARIANTS, LOADER_SPINNER_SIZE_PARAMS };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LoaderSpinnerProps } from "./loader-spinner.component";
|
|
3
|
+
export declare const StyledSpinnerWrapper: import("styled-components").StyledComponent<"div", any, Pick<LoaderSpinnerProps, "size">, never>;
|
|
4
|
+
export declare const StyledLabel: import("styled-components").StyledComponent<{
|
|
5
|
+
({ "data-component": dataComponent, variant, as, id, fontSize, fontWeight, textTransform, lineHeight, textDecoration, display, listStyleType, whiteSpace, wordWrap, textAlign, textOverflow, truncate, color, backgroundColor, bg, opacity, children, className, screenReaderOnly, isDisabled, "aria-hidden": ariaHidden, ...rest }: import("../typography").TypographyProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
}, any, Required<Pick<LoaderSpinnerProps, "size">>, never>;
|
|
8
|
+
interface StyledSpinnerCircleSvgProps extends Omit<LoaderSpinnerProps, "showSpinnerLabel"> {
|
|
9
|
+
isGradientVariant?: boolean;
|
|
10
|
+
size: Required<LoaderSpinnerProps>["size"];
|
|
11
|
+
}
|
|
12
|
+
export declare const StyledSpinnerCircleSvg: import("styled-components").StyledComponent<"svg", any, StyledSpinnerCircleSvgProps, never>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { margin } from "styled-system";
|
|
3
|
+
import { LOADER_SPINNER_SIZE_PARAMS } from "./loader-spinner.config";
|
|
4
|
+
import Typography from "../typography";
|
|
5
|
+
const calculateColors = (isWheel, variant) => {
|
|
6
|
+
switch (variant) {
|
|
7
|
+
case "neutral":
|
|
8
|
+
return isWheel ? "var(--colorsSemanticNeutral500)" : "var(--colorsSemanticNeutral200)";
|
|
9
|
+
case "gradient-grey":
|
|
10
|
+
return isWheel ? "#00D639" : "#0000001A";
|
|
11
|
+
case "gradient-white":
|
|
12
|
+
return isWheel ? "#00D639" : "var(--colorsActionMajorYang100)";
|
|
13
|
+
case "inverse":
|
|
14
|
+
return "var(--colorsActionMajorYang100)";
|
|
15
|
+
default:
|
|
16
|
+
return isWheel ? "var(--colorsActionMajor500)" : "var(--colorsActionMajor150)";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const StyledSpinnerWrapper = styled.div`
|
|
20
|
+
${margin}
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: ${({
|
|
23
|
+
size
|
|
24
|
+
}) => size === "extra-small" ? "row" : "column"};
|
|
25
|
+
`;
|
|
26
|
+
export const StyledLabel = styled(Typography)`
|
|
27
|
+
${({
|
|
28
|
+
size
|
|
29
|
+
}) => css`
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
${size !== "extra-small" && `width: ${LOADER_SPINNER_SIZE_PARAMS[size].wrapperDimensions}px`};
|
|
33
|
+
${size === "extra-small" && `margin-left: var(--spacing100)`};
|
|
34
|
+
`}
|
|
35
|
+
`;
|
|
36
|
+
export const StyledSpinnerCircleSvg = styled.svg`
|
|
37
|
+
${({
|
|
38
|
+
size,
|
|
39
|
+
isTracked,
|
|
40
|
+
hasMotion,
|
|
41
|
+
isGradientVariant,
|
|
42
|
+
animationTime,
|
|
43
|
+
variant
|
|
44
|
+
}) => {
|
|
45
|
+
const dimensions = `${LOADER_SPINNER_SIZE_PARAMS[size].wrapperDimensions}px`;
|
|
46
|
+
return size && css`
|
|
47
|
+
width: ${dimensions};
|
|
48
|
+
height: ${dimensions};
|
|
49
|
+
min-width: ${dimensions};
|
|
50
|
+
min-height: ${dimensions};
|
|
51
|
+
|
|
52
|
+
circle[data-role="outer-arc"] {
|
|
53
|
+
fill: transparent;
|
|
54
|
+
stroke-width: ${LOADER_SPINNER_SIZE_PARAMS[size].strokeWidth}px;
|
|
55
|
+
stroke: ${calculateColors(false, variant)};
|
|
56
|
+
${variant === "inverse" && `stroke-opacity: 0.3`}
|
|
57
|
+
cx: 12px;
|
|
58
|
+
cy: 12px;
|
|
59
|
+
r: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
circle[data-role="inner-arc"] {
|
|
63
|
+
fill: transparent;
|
|
64
|
+
stroke-width: ${LOADER_SPINNER_SIZE_PARAMS[size].strokeWidth}px;
|
|
65
|
+
stroke: ${calculateColors(true, variant)};
|
|
66
|
+
stroke-linecap: round;
|
|
67
|
+
stroke-dasharray: 100px;
|
|
68
|
+
stroke-dashoffset: 80px;
|
|
69
|
+
transform-origin: 12px 12px 0px;
|
|
70
|
+
cx: 12px;
|
|
71
|
+
cy: 12px;
|
|
72
|
+
r: 10px;
|
|
73
|
+
transform: rotate(270deg);
|
|
74
|
+
|
|
75
|
+
@keyframes gradientAnimation {
|
|
76
|
+
0% {
|
|
77
|
+
stroke: #00d639;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
33% {
|
|
81
|
+
stroke: #11afff;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
66% {
|
|
85
|
+
stroke: #8f49fe;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes trackedAnimation {
|
|
90
|
+
from {
|
|
91
|
+
stroke-dasharray: 100;
|
|
92
|
+
stroke-dashoffset: 100;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
to {
|
|
96
|
+
stroke-dasharray: 100;
|
|
97
|
+
stroke-dashoffset: 20;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes untrackedAnimation {
|
|
102
|
+
0% {
|
|
103
|
+
transform: rotate(0deg);
|
|
104
|
+
stroke-dasharray: 100;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
40% {
|
|
108
|
+
stroke-dasharray: 80;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
80% {
|
|
112
|
+
stroke-dasharray: 100;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
100% {
|
|
116
|
+
transform: rotate(360deg);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
animation-name: ${isTracked && !isGradientVariant ? "trackedAnimation" : "untrackedAnimation"},
|
|
121
|
+
${variant === "gradient-grey" || variant === "gradient-white" && "gradientAnimation" ? "gradientAnimation" : "none"};
|
|
122
|
+
${hasMotion && `animation-duration: ${animationTime}s`};
|
|
123
|
+
animation-timing-function: cubic-bezier(0.2, 0.1, 0.8, 1);
|
|
124
|
+
animation-iteration-count: ${hasMotion ? "infinite" : "none"};
|
|
125
|
+
`;
|
|
126
|
+
}};
|
|
127
|
+
`;
|
|
@@ -30,7 +30,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
30
30
|
onClick,
|
|
31
31
|
...rest
|
|
32
32
|
}, ref) => {
|
|
33
|
-
const submenuRef =
|
|
33
|
+
const [submenuRef, setSubmenuRef] = useState(null);
|
|
34
34
|
const submenuId = useRef(guid());
|
|
35
35
|
const menuContext = useContext(MenuContext);
|
|
36
36
|
const {
|
|
@@ -43,6 +43,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
43
43
|
const [submenuFocusId, setSubmenuFocusId] = useState(null);
|
|
44
44
|
const [submenuItemIds, setSubmenuItemIds] = useState([]);
|
|
45
45
|
const [characterString, setCharacterString] = useState("");
|
|
46
|
+
const [applyFocusRadius, setApplyFocusRadius] = useState(false);
|
|
46
47
|
const shiftTabPressed = useRef(false);
|
|
47
48
|
const focusFirstMenuItemOnOpen = useRef(false);
|
|
48
49
|
const numberOfChildren = submenuItemIds.length;
|
|
@@ -51,15 +52,15 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
51
52
|
} = useContext(FixedNavigationBarContext);
|
|
52
53
|
const onSubmenuOpen = useStableCallback(onSubmenuOpenProp);
|
|
53
54
|
const blockIndex = useMemo(() => {
|
|
54
|
-
const items = submenuRef
|
|
55
|
+
const items = submenuRef?.querySelectorAll(BLOCK_INDEX_SELECTOR);
|
|
55
56
|
if (items && submenuOpen && numberOfChildren) {
|
|
56
57
|
const childrenArray = Array.from(items);
|
|
57
|
-
const scrollableBlock = submenuRef
|
|
58
|
+
const scrollableBlock = submenuRef?.querySelector(`[data-component='${SCROLLABLE_BLOCK}']`);
|
|
58
59
|
const index = scrollableBlock ? childrenArray.indexOf(scrollableBlock) : -1;
|
|
59
60
|
return scrollableBlock?.querySelector(`[data-component='${SCROLLABLE_BLOCK_PARENT}']`) ? index + 1 : index;
|
|
60
61
|
}
|
|
61
62
|
return -1;
|
|
62
|
-
}, [submenuOpen, numberOfChildren]);
|
|
63
|
+
}, [submenuOpen, numberOfChildren, submenuRef]);
|
|
63
64
|
const characterTimer = useRef(null);
|
|
64
65
|
const startCharacterTimeout = useCallback(() => {
|
|
65
66
|
characterTimer.current = setTimeout(() => {
|
|
@@ -77,6 +78,35 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
77
78
|
setSubmenuOpen(true);
|
|
78
79
|
setOpenSubmenuId(submenuId.current);
|
|
79
80
|
}, [setOpenSubmenuId]);
|
|
81
|
+
const lastMenuItemElement = useRef();
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const handleBorderRadiusStyling = () => {
|
|
84
|
+
// Finds all ul elements that are not submenus
|
|
85
|
+
const ulElements = Array.from(submenuRef?.querySelectorAll("ul:not([data-component='submenu'])") || /* istanbul ignore next */[]);
|
|
86
|
+
|
|
87
|
+
// Terminate early if there are no ul elements as we have nothing we need to apply styles to.
|
|
88
|
+
if (ulElements.length === 0) return;
|
|
89
|
+
|
|
90
|
+
// Get the last menu item in the submenu
|
|
91
|
+
const lastMenuItem = Array.from(submenuRef?.querySelectorAll("[data-component='menu-item']") || /* istanbul ignore next */[]).pop();
|
|
92
|
+
lastMenuItemElement.current = lastMenuItem;
|
|
93
|
+
|
|
94
|
+
// Get the last segment block
|
|
95
|
+
const lastSegmentBlock = ulElements.pop();
|
|
96
|
+
|
|
97
|
+
// Get all the menu items from the last segment block
|
|
98
|
+
const segmentBlockMenuItems = Array.from(lastSegmentBlock?.querySelectorAll("[data-component='menu-item']") || /* istanbul ignore next */[]);
|
|
99
|
+
|
|
100
|
+
// Get the last menu item in the last segment block
|
|
101
|
+
const lastMenuItemInSegmentBlock = segmentBlockMenuItems.pop();
|
|
102
|
+
// Check if the last item in the segment block is the same as the last MenuItem in the submenu
|
|
103
|
+
const menuItemsMatch = !!lastMenuItemInSegmentBlock && lastMenuItemInSegmentBlock === lastMenuItem;
|
|
104
|
+
setApplyFocusRadius(menuItemsMatch);
|
|
105
|
+
};
|
|
106
|
+
if (submenuOpen && submenuRef) {
|
|
107
|
+
handleBorderRadiusStyling();
|
|
108
|
+
}
|
|
109
|
+
}, [submenuOpen, submenuRef]);
|
|
80
110
|
useEffect(() => {
|
|
81
111
|
if (submenuOpen && onSubmenuOpen) {
|
|
82
112
|
onSubmenuOpen();
|
|
@@ -144,6 +174,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
144
174
|
if (Events.isUpKey(event)) {
|
|
145
175
|
event.preventDefault();
|
|
146
176
|
shiftTabPressed.current = false;
|
|
177
|
+
setApplyFocusRadius(false);
|
|
147
178
|
if (nextIndex > 0) {
|
|
148
179
|
nextIndex -= 1;
|
|
149
180
|
}
|
|
@@ -194,15 +225,15 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
194
225
|
}, [submenuItemIds, submenuOpen, href, numberOfChildren, submenuFocusId, findCurrentIndex, openSubmenu, closeSubmenu, onKeyDown, characterString, restartCharacterTimeout, startCharacterTimeout]);
|
|
195
226
|
useEffect(() => {
|
|
196
227
|
/* istanbul ignore else */
|
|
197
|
-
if (submenuRef
|
|
198
|
-
const items = submenuRef
|
|
228
|
+
if (submenuRef && children) {
|
|
229
|
+
const items = submenuRef?.querySelectorAll(ALL_CHILDREN_SELECTOR);
|
|
199
230
|
|
|
200
231
|
/* istanbul ignore else */
|
|
201
232
|
if (items) {
|
|
202
233
|
setSubmenuItemIds(Array.from(items).map(item => item.getAttribute("id")));
|
|
203
234
|
}
|
|
204
235
|
}
|
|
205
|
-
}, [children, submenuOpen]);
|
|
236
|
+
}, [children, submenuOpen, submenuRef]);
|
|
206
237
|
useEffect(() => {
|
|
207
238
|
if (focusFirstMenuItemOnOpen.current && submenuOpen && !submenuFocusId && submenuItemIds.length) {
|
|
208
239
|
focusFirstMenuItemOnOpen.current = false;
|
|
@@ -221,7 +252,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
221
252
|
}
|
|
222
253
|
};
|
|
223
254
|
useEffect(() => {
|
|
224
|
-
const items = submenuRef
|
|
255
|
+
const items = submenuRef?.querySelectorAll(ALL_CHILDREN_SELECTOR);
|
|
225
256
|
if (items && characterString !== "") {
|
|
226
257
|
const submenuChildren = Array.from(items);
|
|
227
258
|
const nextItem = characterNavigation(characterString, submenuChildren);
|
|
@@ -229,7 +260,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
229
260
|
setSubmenuFocusId(nextItem.id);
|
|
230
261
|
}
|
|
231
262
|
}
|
|
232
|
-
}, [characterString, submenuItemIds]);
|
|
263
|
+
}, [submenuRef, characterString, submenuItemIds]);
|
|
233
264
|
if (inFullscreenView) {
|
|
234
265
|
return /*#__PURE__*/React.createElement(StyledSubmenuWrapper, {
|
|
235
266
|
"data-component": "submenu-wrapper",
|
|
@@ -251,7 +282,8 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
251
282
|
variant: variant,
|
|
252
283
|
menuType: menuType,
|
|
253
284
|
inFullscreenView: inFullscreenView,
|
|
254
|
-
ref:
|
|
285
|
+
ref: setSubmenuRef,
|
|
286
|
+
applyFocusRadiusStyling: false
|
|
255
287
|
}, /*#__PURE__*/React.createElement(SubmenuContext.Provider, {
|
|
256
288
|
value: {
|
|
257
289
|
handleKeyDown,
|
|
@@ -266,7 +298,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
266
298
|
onMouseLeave: () => closeSubmenu(),
|
|
267
299
|
isSubmenuOpen: submenuOpen,
|
|
268
300
|
onClick: handleClickInside,
|
|
269
|
-
ref:
|
|
301
|
+
ref: setSubmenuRef
|
|
270
302
|
}, /*#__PURE__*/React.createElement(StyledMenuItemWrapper, _extends({}, rest, {
|
|
271
303
|
className: className,
|
|
272
304
|
menuType: menuType,
|
|
@@ -289,7 +321,8 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
|
|
|
289
321
|
variant: variant,
|
|
290
322
|
menuType: menuType,
|
|
291
323
|
role: blockIndex === 0 ? "presentation" : "list",
|
|
292
|
-
maxHeight: submenuMaxHeight
|
|
324
|
+
maxHeight: submenuMaxHeight,
|
|
325
|
+
applyFocusRadiusStyling: applyFocusRadius
|
|
293
326
|
}, /*#__PURE__*/React.createElement(SubmenuContext.Provider, {
|
|
294
327
|
value: {
|
|
295
328
|
submenuFocusId,
|
|
@@ -11,6 +11,7 @@ interface StyledSubmenuWrapperProps extends SharedStyleProps {
|
|
|
11
11
|
interface StyledSubmenuProps extends SharedStyleProps, Pick<SubmenuProps, "variant"> {
|
|
12
12
|
submenuDirection?: string;
|
|
13
13
|
maxHeight?: string;
|
|
14
|
+
applyFocusRadiusStyling: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const StyledSubmenuWrapper: import("styled-components").StyledComponent<"div", any, StyledSubmenuWrapperProps, never>;
|
|
16
17
|
declare const StyledSubmenu: import("styled-components").StyledComponent<"ul", any, StyledSubmenuProps, never>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import StyledScrollableBlock from "../../../menu/scrollable-block/scrollable-block.style";
|
|
2
3
|
import { baseTheme } from "../../../../style/themes";
|
|
3
4
|
import { StyledLink } from "../../../link/link.style";
|
|
4
5
|
import { StyledMenuItem } from "../../menu.style";
|
|
6
|
+
import StyledBox from "../../../box/box.style";
|
|
5
7
|
import StyledMenuItemWrapper from "../../menu-item/menu-item.style";
|
|
6
8
|
import StyledIcon from "../../../icon/icon.style";
|
|
7
9
|
import menuConfigVariants from "../../menu.config";
|
|
10
|
+
import { StyledSegmentChildren } from "../../menu-segment-title/menu-segment-title.style";
|
|
8
11
|
const StyledSubmenuWrapper = styled.div`
|
|
9
12
|
position: relative;
|
|
10
13
|
width: fit-content;
|
|
@@ -38,7 +41,8 @@ const StyledSubmenu = styled.ul`
|
|
|
38
41
|
submenuDirection,
|
|
39
42
|
variant,
|
|
40
43
|
inFullscreenView,
|
|
41
|
-
maxHeight
|
|
44
|
+
maxHeight,
|
|
45
|
+
applyFocusRadiusStyling
|
|
42
46
|
}) => css`
|
|
43
47
|
${!inFullscreenView && menuType && css`
|
|
44
48
|
box-shadow: var(--boxShadow100);
|
|
@@ -71,6 +75,32 @@ const StyledSubmenu = styled.ul`
|
|
|
71
75
|
border-bottom-left-radius: var(--borderRadius100);
|
|
72
76
|
border-bottom-right-radius: var(--borderRadius100);
|
|
73
77
|
}
|
|
78
|
+
|
|
79
|
+
& ${StyledSegmentChildren} > ${StyledMenuItem}:last-of-type a,
|
|
80
|
+
${StyledSegmentChildren} > ${StyledMenuItem}:last-of-type button,
|
|
81
|
+
${StyledSegmentChildren} > ${StyledMenuItem}:last-of-type > span,
|
|
82
|
+
${StyledSegmentChildren} > ${StyledMenuItem}:last-of-type > div {
|
|
83
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
84
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
85
|
+
|
|
86
|
+
:focus {
|
|
87
|
+
border-bottom-right-radius: ${applyFocusRadiusStyling ? "var(--borderRadius100)" : "var(--borderRadius000)"};
|
|
88
|
+
border-bottom-left-radius: ${applyFocusRadiusStyling ? "var(--borderRadius100)" : "var(--borderRadius000)"};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&&&& ${StyledScrollableBlock} {
|
|
93
|
+
${StyledBox} {
|
|
94
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
95
|
+
border-bottom-left-radius: ${applyFocusRadiusStyling ? "var(--borderRadius100)" : "var(--borderRadius000)"};
|
|
96
|
+
|
|
97
|
+
${StyledMenuItem}:last-child ${StyledLink}, ${StyledMenuItem}:last-child a,
|
|
98
|
+
${StyledMenuItem}:last-child button {
|
|
99
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
100
|
+
border-bottom-left-radius: ${applyFocusRadiusStyling ? "var(--borderRadius100)" : "var(--borderRadius000)"};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
74
104
|
`}
|
|
75
105
|
|
|
76
106
|
display: block;
|
|
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
let ModalManagerInstance = /*#__PURE__*/function () {
|
|
8
8
|
function ModalManagerInstance() {
|
|
@@ -34,7 +34,7 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
34
34
|
}
|
|
35
35
|
this.modalList = window.__CARBON_INTERNALS_MODAL_LIST;
|
|
36
36
|
}
|
|
37
|
-
_createClass(ModalManagerInstance, [{
|
|
37
|
+
return _createClass(ModalManagerInstance, [{
|
|
38
38
|
key: "getTopModal",
|
|
39
39
|
value: function getTopModal() {
|
|
40
40
|
if (!this.modalList.length) {
|
|
@@ -93,7 +93,6 @@ let ModalManagerInstance = /*#__PURE__*/function () {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}]);
|
|
96
|
-
return ModalManagerInstance;
|
|
97
96
|
}();
|
|
98
97
|
const ModalManager = new ModalManagerInstance();
|
|
99
98
|
export { ModalManagerInstance };
|
|
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
// TODO: This component can be refactored to remove redundant code
|
|
8
8
|
// once we can confirm that all Sage products use version 105.0.0^
|
|
@@ -25,7 +25,7 @@ let ScrollBlockManager = /*#__PURE__*/function () {
|
|
|
25
25
|
// TODO: originalValues can be removed
|
|
26
26
|
this.originalValues = window.__CARBON_INTERNALS_SCROLL_BLOCKERS.originalValues;
|
|
27
27
|
}
|
|
28
|
-
_createClass(ScrollBlockManager, [{
|
|
28
|
+
return _createClass(ScrollBlockManager, [{
|
|
29
29
|
key: "registerComponent",
|
|
30
30
|
value: function registerComponent(id) {
|
|
31
31
|
this.components[id] = true;
|
|
@@ -69,6 +69,5 @@ let ScrollBlockManager = /*#__PURE__*/function () {
|
|
|
69
69
|
return Object.entries(this.components).length !== 0;
|
|
70
70
|
}
|
|
71
71
|
}]);
|
|
72
|
-
return ScrollBlockManager;
|
|
73
72
|
}();
|
|
74
73
|
export default ScrollBlockManager;
|
package/esm/locales/en-gb.js
CHANGED
package/esm/locales/locale.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
|
9
9
|
var _visuallyHidden = _interopRequireDefault(require("../../style/utils/visually-hidden"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
const StyledCharacterCountWrapper = exports.StyledCharacterCountWrapper = _styledComponents.default.div``;
|
|
14
14
|
const StyledCharacterCount = exports.StyledCharacterCount = _styledComponents.default.div`
|
|
15
15
|
text-align: left;
|
|
@@ -14,7 +14,7 @@ var _guid = _interopRequireDefault(require("../utils/helpers/guid"));
|
|
|
14
14
|
var _useInputAccessibility = _interopRequireDefault(require("../../hooks/__internal__/useInputAccessibility"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
const CheckableInput = /*#__PURE__*/_react.default.forwardRef(({
|
|
20
20
|
ariaLabelledBy,
|
|
@@ -13,7 +13,7 @@ var _help = _interopRequireDefault(require("../../components/help/help.style"));
|
|
|
13
13
|
var _validationIcon = _interopRequireDefault(require("../validations/validation-icon.style"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
const StyledCheckableInput = exports.StyledCheckableInput = _styledComponents.default.div`
|
|
18
18
|
display: inline-block;
|
|
19
19
|
position: relative;
|
|
@@ -10,7 +10,7 @@ var _hiddenCheckableInput = _interopRequireDefault(require("./hidden-checkable-i
|
|
|
10
10
|
var _inputBehaviour = require("../input-behaviour");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
const HiddenCheckableInput = /*#__PURE__*/_react.default.forwardRef(({
|
|
16
16
|
ariaDescribedBy,
|