carbon-react 162.10.0 → 162.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/__internal__/character-count/character-count.style.js +1 -1
- package/esm/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/esm/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
- package/esm/__internal__/error-border/error-border.style.js +1 -1
- package/esm/__internal__/field-help/field-help.style.js +1 -1
- package/esm/__internal__/fieldset/__next__/fieldset.style.js +1 -1
- package/esm/__internal__/fieldset/fieldset.style.js +1 -1
- package/esm/__internal__/form-field/form-field.style.js +1 -1
- package/esm/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
- package/esm/__internal__/hint-text/hint-text.style.js +1 -1
- package/esm/__internal__/input/input-style-overrides.style.d.ts +0 -1
- package/esm/__internal__/input/input-style-overrides.style.js +1 -1
- package/esm/__internal__/input/input.style.js +1 -1
- package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/esm/__internal__/label/label.style.js +1 -1
- package/esm/__internal__/legacy-error-border/error-border.style.js +1 -1
- package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -1
- package/esm/__internal__/legacy-input/input-presentation.style.js +1 -1
- package/esm/__internal__/legacy-input/input.style.js +1 -1
- package/esm/__internal__/legacy-label/icon-wrapper.style.js +1 -1
- package/esm/__internal__/legacy-label/label.style.js +1 -1
- package/esm/__internal__/modal/modal.style.js +1 -1
- package/esm/__internal__/popover/popover.style.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
- package/esm/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
- package/esm/__internal__/popover-menu/popover-menu.component.js +1 -1
- package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -1
- package/esm/__internal__/validation-message/validation-message.style.js +1 -1
- package/esm/__internal__/validations/validation-icon.style.js +1 -1
- package/esm/components/accordion/accordion.style.js +1 -1
- package/esm/components/action-popover/action-popover.style.js +1 -1
- package/esm/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
- package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
- package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-navigation.style.js +1 -1
- package/esm/components/anchor-navigation/anchor-section-divider.component.js +1 -1
- package/esm/components/badge/badge.style.js +1 -1
- package/esm/components/batch-selection/batch-selection.style.js +1 -1
- package/esm/components/box/box.style.js +1 -1
- package/esm/components/breadcrumbs/breadcrumbs.style.js +1 -1
- package/esm/components/breadcrumbs/crumb/crumb.style.js +1 -1
- package/esm/components/button/__next__/button.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__/date-picker/day-picker.style.js +1 -1
- package/esm/components/date/__internal__/navbar/button.style.js +1 -1
- package/esm/components/date/__internal__/navbar/navbar.style.js +1 -1
- package/esm/components/date/__internal__/weekday/abbr.style.js +1 -1
- package/esm/components/date/__internal__/weekday/weekday.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.component.d.ts +4 -1
- package/esm/components/divider/divider.component.js +1 -1
- package/esm/components/divider/divider.style.js +1 -1
- package/esm/components/draggable/draggable-item/draggable-item.style.js +1 -1
- package/esm/components/drawer/drawer.style.js +1 -1
- package/esm/components/duelling-picklist/duelling-picklist.style.js +1 -1
- package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
- package/esm/components/fieldset/fieldset.style.js +1 -1
- package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/esm/components/file-input/file-input.style.js +1 -1
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
- package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
- package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
- package/esm/components/flat-table/flat-table.style.js +1 -1
- package/esm/components/flat-table/sort/sort.style.js +1 -1
- package/esm/components/form/__internal__/form-summary.style.js +1 -1
- package/esm/components/form/form.style.js +1 -1
- package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
- package/esm/components/global-header/global-header.component.js +1 -1
- package/esm/components/grid/grid-container/grid-container.style.js +1 -1
- package/esm/components/grid/grid-item/grid-item.style.js +1 -1
- package/esm/components/heading/heading.style.js +1 -1
- package/esm/components/help/help.style.js +1 -1
- package/esm/components/hr/hr.style.js +1 -1
- package/esm/components/icon/icon.style.js +1 -1
- package/esm/components/icon-button/icon-button.style.js +1 -1
- package/esm/components/image/image.style.js +1 -1
- package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
- package/esm/components/link/link.component.d.ts +0 -2
- package/esm/components/link/link.component.js +1 -1
- package/esm/components/link/link.style.d.ts +0 -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__/menu-item-variant.context.d.ts +6 -0
- package/esm/components/menu/__internal__/menu-item-variant.context.js +1 -0
- package/esm/components/menu/__internal__/strict-menu.context.d.ts +2 -2
- package/esm/components/menu/__internal__/strict-menu.context.js +1 -1
- package/esm/components/menu/__internal__/submenu/submenu.component.d.ts +3 -11
- package/esm/components/menu/__internal__/submenu/submenu.component.js +1 -1
- package/esm/components/menu/__internal__/submenu/submenu.context.d.ts +1 -1
- package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +15 -18
- package/esm/components/menu/__internal__/submenu/submenu.style.js +1 -1
- package/esm/components/menu/index.d.ts +1 -1
- package/esm/components/menu/menu-divider/menu-divider.component.js +1 -1
- package/esm/components/menu/menu-divider/menu-divider.style.d.ts +6 -4
- package/esm/components/menu/menu-divider/menu-divider.style.js +1 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +1 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.d.ts +14 -14
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/esm/components/menu/menu-item/menu-item.component.d.ts +10 -10
- package/esm/components/menu/menu-item/menu-item.component.js +1 -1
- package/esm/components/menu/menu-item/menu-item.style.d.ts +30 -21
- package/esm/components/menu/menu-item/menu-item.style.js +1 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +4 -3
- package/esm/components/menu/menu-segment-title/menu-segment-title.component.js +1 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.style.d.ts +6 -8
- package/esm/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
- package/esm/components/menu/menu.component.d.ts +16 -2
- package/esm/components/menu/menu.component.js +1 -1
- package/esm/components/menu/menu.config.d.ts +10 -50
- package/esm/components/menu/menu.config.js +1 -1
- package/esm/components/menu/menu.style.d.ts +4 -13
- package/esm/components/menu/menu.style.js +1 -1
- package/esm/components/menu/scrollable-block/scrollable-block.component.d.ts +1 -1
- package/esm/components/menu/scrollable-block/scrollable-block.component.js +1 -1
- package/esm/components/menu/scrollable-block/scrollable-block.style.d.ts +5 -7
- 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.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.component.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.d.ts +1 -0
- 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.style.js +1 -1
- package/esm/components/step-flow/step-flow.style.js +1 -1
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
- package/esm/components/step-sequence/step-sequence.style.js +1 -1
- package/esm/components/switch/switch.style.js +1 -1
- package/esm/components/tabs/__next__/tabs.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
- package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
- package/esm/components/text-editor/text-editor.style.js +1 -1
- package/esm/components/textarea/textarea.style.js +1 -1
- package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -1
- package/esm/components/tile/tile-footer/tile-footer.style.js +1 -1
- package/esm/components/tile/tile.style.js +1 -1
- package/esm/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
- package/esm/components/tile-select/tile-select.style.js +1 -1
- package/esm/components/time/time.style.js +1 -1
- package/esm/components/toast/toast.style.js +1 -1
- package/esm/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
- package/esm/components/tooltip/tooltip-pointer.style.js +1 -1
- package/esm/components/tooltip/tooltip.style.js +1 -1
- package/esm/components/typography/__internal__/__next__/typography.style.js +1 -1
- package/esm/components/typography/typography.style.js +1 -1
- package/esm/components/vertical-divider/vertical-divider.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
- package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
- package/esm/components/vertical-menu/vertical-menu.style.js +1 -1
- package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/lib/__internal__/character-count/character-count.style.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
- package/lib/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
- package/lib/__internal__/error-border/error-border.style.js +1 -1
- package/lib/__internal__/field-help/field-help.style.js +1 -1
- package/lib/__internal__/fieldset/__next__/fieldset.style.js +1 -1
- package/lib/__internal__/fieldset/fieldset.style.js +1 -1
- package/lib/__internal__/form-field/form-field.style.js +1 -1
- package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
- package/lib/__internal__/hint-text/hint-text.style.js +1 -1
- package/lib/__internal__/input/input-style-overrides.style.d.ts +0 -1
- package/lib/__internal__/input/input-style-overrides.style.js +1 -1
- package/lib/__internal__/input/input.style.js +1 -1
- package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
- package/lib/__internal__/label/label.style.js +1 -1
- package/lib/__internal__/legacy-error-border/error-border.style.js +1 -1
- package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -1
- package/lib/__internal__/legacy-input/input-presentation.style.js +1 -1
- package/lib/__internal__/legacy-input/input.style.js +1 -1
- package/lib/__internal__/legacy-label/icon-wrapper.style.js +1 -1
- package/lib/__internal__/legacy-label/label.style.js +1 -1
- package/lib/__internal__/modal/modal.style.js +1 -1
- package/lib/__internal__/popover/popover.style.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
- package/lib/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
- package/lib/__internal__/popover-menu/popover-menu.component.js +1 -1
- package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -1
- package/lib/__internal__/validation-message/validation-message.style.js +1 -1
- package/lib/__internal__/validations/validation-icon.style.js +1 -1
- package/lib/components/accordion/accordion.style.js +1 -1
- package/lib/components/action-popover/action-popover.style.js +1 -1
- package/lib/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
- package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
- package/lib/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-navigation.style.js +1 -1
- package/lib/components/anchor-navigation/anchor-section-divider.component.js +1 -1
- package/lib/components/badge/badge.style.js +1 -1
- package/lib/components/batch-selection/batch-selection.style.js +1 -1
- package/lib/components/box/box.style.js +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.style.js +1 -1
- package/lib/components/breadcrumbs/crumb/crumb.style.js +1 -1
- package/lib/components/button/__next__/button.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__/date-picker/day-picker.style.js +1 -1
- package/lib/components/date/__internal__/navbar/button.style.js +1 -1
- package/lib/components/date/__internal__/navbar/navbar.style.js +1 -1
- package/lib/components/date/__internal__/weekday/abbr.style.js +1 -1
- package/lib/components/date/__internal__/weekday/weekday.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.component.d.ts +4 -1
- package/lib/components/divider/divider.component.js +1 -1
- package/lib/components/divider/divider.style.js +1 -1
- package/lib/components/draggable/draggable-item/draggable-item.style.js +1 -1
- package/lib/components/drawer/drawer.style.js +1 -1
- package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
- package/lib/components/fieldset/fieldset.style.js +1 -1
- package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
- package/lib/components/file-input/file-input.style.js +1 -1
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
- package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
- package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
- package/lib/components/flat-table/flat-table.style.js +1 -1
- package/lib/components/flat-table/sort/sort.style.js +1 -1
- package/lib/components/form/__internal__/form-summary.style.js +1 -1
- package/lib/components/form/form.style.js +1 -1
- package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
- package/lib/components/global-header/global-header.component.js +1 -1
- package/lib/components/grid/grid-container/grid-container.style.js +1 -1
- package/lib/components/grid/grid-item/grid-item.style.js +1 -1
- package/lib/components/heading/heading.style.js +1 -1
- package/lib/components/help/help.style.js +1 -1
- package/lib/components/hr/hr.style.js +1 -1
- package/lib/components/icon/icon.style.js +1 -1
- package/lib/components/icon-button/icon-button.style.js +1 -1
- package/lib/components/image/image.style.js +1 -1
- package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
- package/lib/components/link/link.component.d.ts +0 -2
- package/lib/components/link/link.component.js +1 -1
- package/lib/components/link/link.style.d.ts +0 -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__/menu-item-variant.context.d.ts +6 -0
- package/lib/components/menu/__internal__/menu-item-variant.context.js +1 -0
- package/lib/components/menu/__internal__/strict-menu.context.d.ts +2 -2
- package/lib/components/menu/__internal__/strict-menu.context.js +1 -1
- package/lib/components/menu/__internal__/submenu/submenu.component.d.ts +3 -11
- package/lib/components/menu/__internal__/submenu/submenu.component.js +1 -1
- package/lib/components/menu/__internal__/submenu/submenu.context.d.ts +1 -1
- package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +15 -18
- package/lib/components/menu/__internal__/submenu/submenu.style.js +1 -1
- package/lib/components/menu/index.d.ts +1 -1
- package/lib/components/menu/menu-divider/menu-divider.component.js +1 -1
- package/lib/components/menu/menu-divider/menu-divider.style.d.ts +6 -4
- 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.d.ts +14 -14
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
- package/lib/components/menu/menu-item/menu-item.component.d.ts +10 -10
- package/lib/components/menu/menu-item/menu-item.component.js +1 -1
- package/lib/components/menu/menu-item/menu-item.style.d.ts +30 -21
- package/lib/components/menu/menu-item/menu-item.style.js +1 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +4 -3
- 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.d.ts +6 -8
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
- package/lib/components/menu/menu.component.d.ts +16 -2
- package/lib/components/menu/menu.component.js +1 -1
- package/lib/components/menu/menu.config.d.ts +10 -50
- package/lib/components/menu/menu.config.js +1 -1
- package/lib/components/menu/menu.style.d.ts +4 -13
- package/lib/components/menu/menu.style.js +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.component.d.ts +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +1 -1
- package/lib/components/menu/scrollable-block/scrollable-block.style.d.ts +5 -7
- 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.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.component.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.d.ts +1 -0
- 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.style.js +1 -1
- package/lib/components/step-flow/step-flow.style.js +1 -1
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
- package/lib/components/step-sequence/step-sequence.style.js +1 -1
- package/lib/components/switch/switch.style.js +1 -1
- package/lib/components/tabs/__next__/tabs.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
- package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
- package/lib/components/text-editor/text-editor.style.js +1 -1
- package/lib/components/textarea/textarea.style.js +1 -1
- package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -1
- package/lib/components/tile/tile-footer/tile-footer.style.js +1 -1
- package/lib/components/tile/tile.style.js +1 -1
- package/lib/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
- package/lib/components/tile-select/tile-select.style.js +1 -1
- package/lib/components/time/time.style.js +1 -1
- package/lib/components/toast/toast.style.js +1 -1
- package/lib/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
- package/lib/components/tooltip/tooltip-pointer.style.js +1 -1
- package/lib/components/tooltip/tooltip.style.js +1 -1
- package/lib/components/typography/__internal__/__next__/typography.style.js +1 -1
- package/lib/components/typography/typography.style.js +1 -1
- package/lib/components/vertical-divider/vertical-divider.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
- package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
- package/lib/components/vertical-menu/vertical-menu.style.js +1 -1
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
- package/package.json +1 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.context.d.ts +0 -7
- package/esm/components/menu/menu-segment-title/menu-segment-title.context.js +0 -1
- package/esm/components/menu/menu.types.d.ts +0 -9
- package/esm/components/search/__internal__/legacy/search-button.style.d.ts +0 -5
- package/esm/components/search/__internal__/legacy/search-button.style.js +0 -1
- package/esm/components/search/__internal__/legacy/search.component.d.ts +0 -71
- package/esm/components/search/__internal__/legacy/search.component.js +0 -1
- package/esm/components/search/__internal__/legacy/search.style.d.ts +0 -13
- package/esm/components/search/__internal__/legacy/search.style.js +0 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.context.d.ts +0 -7
- package/lib/components/menu/menu-segment-title/menu-segment-title.context.js +0 -1
- package/lib/components/menu/menu.types.d.ts +0 -9
- package/lib/components/search/__internal__/legacy/search-button.style.d.ts +0 -5
- package/lib/components/search/__internal__/legacy/search-button.style.js +0 -1
- package/lib/components/search/__internal__/legacy/search.component.d.ts +0 -71
- package/lib/components/search/__internal__/legacy/search.component.js +0 -1
- package/lib/components/search/__internal__/legacy/search.style.d.ts +0 -13
- package/lib/components/search/__internal__/legacy/search.style.js +0 -1
|
@@ -6,22 +6,14 @@ export interface SubmenuProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/** Custom className */
|
|
8
8
|
className?: string;
|
|
9
|
-
/**
|
|
10
|
-
* * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
|
|
11
|
-
*
|
|
12
|
-
* Adds an icon to the menu item.
|
|
13
|
-
* */
|
|
14
|
-
icon?: string;
|
|
15
9
|
/** Defines which direction the submenu will hang eg. left/right */
|
|
16
10
|
submenuDirection?: string;
|
|
17
11
|
/** A title for the menu item that has a submenu. */
|
|
18
12
|
title?: React.ReactNode;
|
|
19
13
|
/** onKeyDown handler */
|
|
20
14
|
onKeyDown?: (event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
21
|
-
/**
|
|
15
|
+
/** Set the variant of the Submenu */
|
|
22
16
|
variant?: VariantType;
|
|
23
|
-
/** Flag to display the dropdown arrow when an item has a submenu */
|
|
24
|
-
showDropdownArrow?: boolean;
|
|
25
17
|
/** When set the submenu opens by click instead of hover */
|
|
26
18
|
clickToOpen?: boolean;
|
|
27
19
|
/** The href to use for the menu item. */
|
|
@@ -36,12 +28,12 @@ export interface SubmenuProps {
|
|
|
36
28
|
onSubmenuClose?: () => void;
|
|
37
29
|
/** Callback triggered when the top-level menu item is clicked */
|
|
38
30
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
|
|
39
|
-
/** Accessible label for when no text children are passed to menu item */
|
|
40
|
-
ariaLabel?: string;
|
|
41
31
|
/** Sets the max-width of the submenu container element */
|
|
42
32
|
submenuMaxWidth?: string;
|
|
43
33
|
/** Sets the min-width of the submenu container element */
|
|
44
34
|
submenuMinWidth?: string;
|
|
35
|
+
/** Is the menu item the currently selected item. */
|
|
36
|
+
selected?: boolean;
|
|
45
37
|
}
|
|
46
38
|
declare const Submenu: React.ForwardRefExoticComponent<SubmenuProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
47
39
|
export default Submenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../menu-item/menu-item.style.js"),r=require("./submenu.style.js"),u=require("../../../../__internal__/utils/helpers/events/events.js"),a=require("../strict-menu.context.js"),l=require("../keyboard-navigation/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../menu-item/menu-item.style.js"),r=require("./submenu.style.js"),u=require("../../../../__internal__/utils/helpers/events/events.js"),a=require("../strict-menu.context.js"),l=require("../keyboard-navigation/index.js"),i=require("./submenu.context.js"),s=require("../../../../__internal__/utils/helpers/guid/index.js"),o=require("../locators.js"),c=require("../../../../hooks/__internal__/useStableCallback/useStableCallback.js"),d=require("../../../navigation-bar/__internal__/fixed-navigation-bar.context.js"),m=require("../../../../__internal__/focus-trap/focus-trap-utils.js");function f(e){return e&&e.__esModule?e:{default:e}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}function y(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const S=f(t).default.forwardRef(((f,b)=>{var{children:S,className:h,title:O,submenuDirection:v="right",onKeyDown:j,variant:g="default",clickToOpen:x,href:_,maxWidth:w,asPassiveItem:E,onSubmenuOpen:C,onSubmenuClose:D,onClick:$,submenuMaxWidth:k,submenuMinWidth:P,selected:L}=f,q=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(f,["children","className","title","submenuDirection","onKeyDown","variant","clickToOpen","href","maxWidth","asPassiveItem","onSubmenuOpen","onSubmenuClose","onClick","submenuMaxWidth","submenuMinWidth","selected"]);const[K,I]=t.useState(null),A=t.useRef(s.default()),{inFullscreenView:M,openSubmenuId:T,setOpenSubmenuId:W,menuVariant:R}=a.useStrictMenuContext(),[V,N]=t.useState(!1),[F,B]=t.useState(null),[H,U]=t.useState([]),[X,z]=t.useState(""),G=H.length,{submenuMaxHeight:J}=t.useContext(d.default),Q=c.default(C),Y=t.useMemo((()=>{const e=null==K?void 0:K.querySelectorAll(o.BLOCK_INDEX_SELECTOR);if(e&&V&&G){const t=Array.from(e),n=null==K?void 0:K.querySelector(`[data-component='${o.SCROLLABLE_BLOCK}']`),r=n?t.indexOf(n):-1;return(null==n?void 0:n.querySelector(`[data-component='${o.SCROLLABLE_BLOCK_PARENT}']`))?r+1:r}return-1}),[V,G,K]),Z=t.useRef(null),ee=t.useCallback((()=>{Z.current=setTimeout((()=>{z("")}),1500)}),[]),te=t.useCallback((()=>{Z.current&&clearTimeout(Z.current),ee()}),[ee]);t.useEffect((()=>()=>{Z.current&&clearTimeout(Z.current)}),[]);const ne=t.useCallback((()=>{N(!0),W(A.current)}),[W]);t.useEffect((()=>{V&&Q&&Q()}),[V,Q]);const re=t.useCallback((()=>{N(!1),B(null),D&&D(),z("")}),[D]);t.useEffect((()=>{T&&T!==A.current&&re()}),[T,re]);const ue=t.useCallback((e=>H.findIndex((t=>t===e))),[H]),ae=t.useCallback((e=>{const t=u.default.isEnterKey(e)||u.default.isSpaceKey(e);if(!t&&!u.default.isDownKey(e)||V||(e.preventDefault(),ne()),V){const n=ue(F);let r=n;if(F||((t&&!_||u.default.isSpaceKey(e)&&_)&&(e.preventDefault(),re()),u.default.isShiftKey(e)&&u.default.isTabKey(e)&&re()),u.default.isDownKey(e)&&(e.preventDefault(),r<G-1&&(r+=1)),u.default.isUpKey(e)&&(e.preventDefault(),r>0&&(r-=1)),u.default.isEscKey(e))return null==j||j(e),void re();u.default.isHomeKey(e)&&(e.preventDefault(),e.stopPropagation(),r=0),u.default.isEndKey(e)&&(e.preventDefault(),e.stopPropagation(),r=G-1);const a=u.default.composedPath(e.nativeEvent).find((e=>e instanceof HTMLElement&&("input"===e.getAttribute("data-element")||"input-icon-toggle"===e.getAttribute("data-element"))));1!==e.key.length||a?z(""):(e.stopPropagation(),Z.current?te():ee(),z(`${X}${e.key.toLowerCase()}`)),a||u.default.isEnterKey(e)&&setTimeout((()=>re()),0),r!==n&&B(H[r])}}),[H,V,_,G,F,ue,ne,re,j,X,te,ee]);return t.useEffect((()=>{if(K&&S){const e=null==K?void 0:K.querySelectorAll(o.ALL_CHILDREN_SELECTOR);e&&U(Array.from(e).filter((e=>e.querySelector(m.defaultFocusableSelectors))).map((e=>e.getAttribute("id"))))}}),[S,V,K]),t.useEffect((()=>{const e=null==K?void 0:K.querySelectorAll(o.ALL_CHILDREN_SELECTOR);if(e&&""!==X){const t=Array.from(e),n=l.characterNavigation(X,t);n&&B(n.id)}}),[K,X,H]),t.useLayoutEffect((()=>{const e=null==K?void 0:K.querySelectorAll('[data-element="menu-item-wrapper"]');null==e||e.forEach(((t,n)=>{n===e.length-1?t.setAttribute("data-last-menu-item","true"):t.removeAttribute("data-last-menu-item")}))}),[K,V,G]),M?e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper",$inFullscreenView:M,children:[e.jsx(n.StyledMenuItemWrapper,y(p({},q),{as:$&&!_?"button":"a",onClick:E?void 0:$,className:h,$menuVariant:R,ref:b,href:_,$menuItemVariant:g,$inFullscreenView:M,$asDiv:E,$hasSubmenu:!0,$selected:L,children:O})),e.jsx(r.StyledSubmenu,{"data-component":"submenu",$menuVariant:R,$inFullscreenView:M,ref:I,children:e.jsx(i.default.Provider,{value:{handleKeyDown:ae,blockIndex:Y,updateFocusId:B},children:S})})]}):e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper","data-role":"submenu-wrapper",onMouseOver:x?void 0:()=>ne(),onMouseLeave:()=>re(),ref:I,children:[e.jsx(n.StyledMenuItemWrapper,y(p({},q),{as:_?"a":"button",className:h,$menuVariant:R,ref:b,$menuItemVariant:g,$isOpen:V,$hasSubmenu:!0,onKeyDown:ae,onClick:e=>{ne(),$&&$(e)},href:_,$maxWidth:w,$selected:L,"aria-expanded":V,"data-element":"submenu-parent-item","data-role":"submenu-parent-item",children:O})),V&&e.jsx(r.StyledSubmenu,{"data-component":"submenu","data-role":"submenu",$submenuDirection:v,$menuVariant:R,role:0===Y?"presentation":"list",$maxHeight:J,$submenuMaxWidth:k,$submenuMinWidth:P,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||re()},children:e.jsx(i.default.Provider,{value:{submenuFocusId:F,handleKeyDown:ae,blockIndex:Y,updateFocusId:B,submenuMaxWidth:k,closeSubmenu:re},children:S})})]})}));S.displayName="submenu",exports.default=S;
|
|
@@ -4,7 +4,7 @@ export interface SubmenuContextProps {
|
|
|
4
4
|
updateFocusId?: (id: string) => void;
|
|
5
5
|
handleKeyDown?: (event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
6
6
|
blockIndex?: number;
|
|
7
|
-
|
|
7
|
+
submenuMaxWidth?: string;
|
|
8
8
|
closeSubmenu?: () => void;
|
|
9
9
|
}
|
|
10
10
|
declare const SubmenuContext: React.Context<SubmenuContextProps>;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface SharedStyleProps {
|
|
4
|
-
inFullscreenView?: boolean;
|
|
5
|
-
menuType?: MenuType;
|
|
1
|
+
interface StyledSubmenuWrapperProps {
|
|
2
|
+
$inFullscreenView?: boolean;
|
|
6
3
|
}
|
|
7
|
-
|
|
8
|
-
isSubmenuOpen?: boolean;
|
|
9
|
-
asPassiveItem?: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface StyledSubmenuProps extends SharedStyleProps, Pick<SubmenuProps, "variant" | "submenuMaxWidth" | "submenuMinWidth"> {
|
|
12
|
-
submenuDirection?: string;
|
|
13
|
-
maxHeight?: string;
|
|
14
|
-
applyFocusRadiusStyling: boolean;
|
|
15
|
-
applyFocusRadiusStylingToLastItem: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const StyledSubmenuWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
export declare const StyledSubmenuWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
18
5
|
theme: object;
|
|
19
6
|
} & StyledSubmenuWrapperProps, "theme">;
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
interface StyledSubmenuProps {
|
|
8
|
+
$submenuDirection?: string;
|
|
9
|
+
$maxHeight?: string;
|
|
10
|
+
$inFullscreenView?: boolean;
|
|
11
|
+
$menuVariant: "white" | "black";
|
|
12
|
+
$submenuMaxWidth?: string;
|
|
13
|
+
$submenuMinWidth?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const StyledSubmenu: import("styled-components").StyledComponent<"ul", any, {
|
|
16
|
+
theme: object;
|
|
17
|
+
} & StyledSubmenuProps, "theme">;
|
|
18
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../../../style/themes/apply-base-theme.js"),i=require("../../menu.config.js");function r(e){return e&&e.__esModule?e:{default:e}}var a=r(e);const s=a.default.div.attrs(t.default).withConfig({displayName:"submenu.style__StyledSubmenuWrapper",componentId:"carbon_v162_10_0__sc-92487cd8-0"})(["position:relative;width:fit-content;max-width:inherit;height:inherit;",""],(({$inFullscreenView:t})=>e.css([""," ",""],t&&e.css(["width:100%;"]),!t&&e.css(["display:flex;"])))),n=a.default.ul.attrs(t.default).withConfig({displayName:"submenu.style__StyledSubmenu",componentId:"carbon_v162_10_0__sc-92487cd8-1"})(["",""],(({$menuVariant:t,$submenuDirection:r,$inFullscreenView:a,$maxHeight:s,$submenuMaxWidth:n,$submenuMinWidth:o,theme:d})=>e.css(["display:block;list-style:none;margin:0;padding:0;background-color:",";"," ",""],i.default[t].submenuItemBackground,!a&&e.css(["position:absolute;top:100%;z-index:",";box-shadow:var(--global-depth-lvl1);width:max-content;min-width:100%;box-sizing:border-box;border-radius:var(--global-radius-none) var(--global-radius-none) var(--global-radius-container-m) var(--global-radius-container-m);overflow-y:auto;"," "," "," "," "," [data-last-menu-item='true']{border-bottom-left-radius:var(--global-radius-container-m);border-bottom-right-radius:var(--global-radius-container-m);}"],d.zIndex.popover,"white"===t&&e.css(["margin-top:-1px;border:var(--global-borderwidth-xs) solid var(--nav-tertiary-border-default);"]),n&&e.css(["max-width:",";"],n),o&&e.css(["min-width:",";"],o),"left"===r&&e.css(["right:0;"]),s&&`max-height: ${s};`),a&&e.css(["min-width:100%;"]))));exports.StyledSubmenu=n,exports.StyledSubmenuWrapper=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Menu } from "./menu.component";
|
|
2
|
-
export type { MenuProps } from "./menu.
|
|
2
|
+
export type { MenuProps } from "./menu.component";
|
|
3
3
|
export { default as MenuItem } from "./menu-item";
|
|
4
4
|
export type { MenuWithIcon, MenuWithChildren, MenuItemHandle, } from "./menu-item";
|
|
5
5
|
export { default as MenuDivider } from "./menu-divider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./menu-divider.style.js"),n=require("../__internal__/strict-menu.context.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./menu-divider.style.js"),n=require("../__internal__/strict-menu.context.js"),i=require("../menu-item/menu-item.style.js"),u=require("../../../__internal__/utils/helpers/tags/tags.js");function o(e){return e&&e.__esModule?e:{default:e}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(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){c(e,r,t[r])}))}return e}const s=o(r).default.forwardRef(((r,o)=>{var{size:c="default"}=r,s=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(r,["size"]);const{menuVariant:a,inFullscreenView:f}=n.useStrictMenuContext();return e.jsx(i.StyledMenuItem,{$inSubmenu:!0,$removeHeight:!0,"aria-hidden":"true","data-role":"divider-container",children:e.jsx(t.default,(b=l({$size:c},u.default("menu-divider",s)),O={$menuVariant:a,$inFullscreenView:f,ref:o},O=null!=O?O:{},Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(O)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(O)).forEach((function(e){Object.defineProperty(b,e,Object.getOwnPropertyDescriptor(O,e))})),b))});var b,O}));s.displayName="MenuDivider",exports.default=s;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { MenuDividerProps } from "./menu-divider.component";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface StyledDividerProps {
|
|
3
|
+
$menuVariant: "white" | "black";
|
|
4
|
+
$size: MenuDividerProps["size"];
|
|
5
|
+
$inFullscreenView?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const StyledDivider: import("styled-components").StyledComponent<"div", any, StyledDividerProps, never>;
|
|
6
8
|
export default StyledDivider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=require("../menu.config.js");function r(e){return e&&e.__esModule?e:{default:e}}const l=r(e).default.div.withConfig({displayName:"menu-divider.style__StyledDivider",componentId:"carbon_v162_10_0__sc-b48c8639-0"})(["",""],(({$menuVariant:r,$size:l,$inFullscreenView:o})=>e.css(["background-color:",";margin:var(--global-space-none) var(--global-space-comp-l);height:1px;"," ",""],a.default[r].divider,o&&e.css(["margin:var(--global-space-comp-s) var(--global-space-comp-l);"]),"large"===l&&e.css(["margin:var(--global-space-none);height:4px;"]))));exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("react-transition-group"),t=require("./menu-full-screen.style.js"),l=require("../menu.style.js"),a=require("../__internal__/strict-menu.context.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),i=require("../../button/__next__/button.component.js"),u=require("../../icon/icon.component.js");require("../../icon/icon.style.js");var s=require("../../portal/portal.js"),c=require("../../../__internal__/focus-trap/focus-trap.component.js"),d=require("../menu-divider/menu-divider.component.js"),m=require("../../../__internal__/dom/globals.js"),f=require("../../../hooks/__internal__/useLocale/useLocale.js"),p=require("../../../hooks/__internal__/useModalAria/useModalAria.js"),j=require("../../../hooks/__internal__/useModalManager/useModalManager.js");function _(e){return e&&e.__esModule?e:{default:e}}var b=_(n);function x(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function v(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){x(e,n,r[n])}))}return e}const h=({"aria-label":s="Fullscreen menu","data-element":_,"data-role":x,children:v,isOpen:h=!1,onClose:y,startPosition:M="left",topModalOverride:q})=>{var O;const g=n.useRef(null),S=n.useRef(null),P=n.useRef(null),C=p.default(S),{menuVariant:F}=a.useStrictMenuContext(),k=f.default(),w=b.default.Children.toArray(v),R=b.default.Children.toArray(w.map(((n,r)=>r<w.length-1?e.jsxs(e.Fragment,{children:[n,e.jsx(d.default,{"data-role":"divider"})]}):n))),V=n.useCallback((e=>{y&&o.default.isEscKey(e)&&(e.stopImmediatePropagation(),y(e))}),[y]);return j.default({open:h,closeModal:V,modalRef:g,topModalOverride:q,focusCallToActionElement:null===(O=m.getDocument())||void 0===O?void 0:O.activeElement}),e.jsx(r.CSSTransition,{nodeRef:g,in:h,timeout:200,unmountOnExit:!0,children:e.jsx(t.StyledMenuFullscreen,{ref:g,$startPosition:M,$transitionDuration:200,children:e.jsx(c.default,{wrapperRef:S,isOpen:h,children:e.jsxs(t.StyledMenuModal,{"aria-label":s,"aria-modal":!!C||void 0,"data-component":"menu-fullscreen","data-element":_,"data-role":x,$menuVariant:F,ref:S,role:"dialog",tabIndex:-1,children:[e.jsx(t.StyledMenuFullscreenHeader,{$menuVariant:F,children:e.jsx(i.Button,{variantType:"subtle",size:"small",inverse:Boolean("black"===F),"aria-label":k.menuFullscreen.ariaLabels.closeButton(),onClick:e=>y(e),"data-element":"close",children:e.jsx(u.default,{type:"close"})})}),e.jsx(t.StyledMenuFullscreenContent,{children:e.jsx(l.StyledMenuWrapper,{"data-component":"menu",ref:P,role:"list",$inFullscreenView:!0,children:e.jsx(a.StrictMenuProvider,{value:{inFullscreenView:!0,menuVariant:F,openSubmenuId:null,setOpenSubmenuId:()=>{}},children:R})})})]})})})})},y=n=>e.jsx("li",{children:e.jsx(s.Portal,{children:e.jsx(h,v({},n))})});exports.MenuFullscreen=y,exports.default=y;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface StyledMenuFullscreenProps {
|
|
2
|
+
$transitionDuration: number;
|
|
3
|
+
$startPosition: "left" | "right";
|
|
4
|
+
}
|
|
5
|
+
export declare const StyledMenuFullscreen: import("styled-components").StyledComponent<"div", any, {
|
|
3
6
|
theme: object;
|
|
4
|
-
} &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare const StyledMenuModal: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
+
} & StyledMenuFullscreenProps, "theme">;
|
|
8
|
+
interface StyledMenuModalProps {
|
|
9
|
+
$menuVariant: "white" | "black";
|
|
10
|
+
}
|
|
11
|
+
export declare const StyledMenuModal: import("styled-components").StyledComponent<"div", any, {
|
|
9
12
|
theme: object;
|
|
10
|
-
} &
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
menuType: MenuType;
|
|
15
|
-
}, never>;
|
|
16
|
-
export { StyledMenuModal, StyledMenuFullscreen, StyledMenuFullscreenHeader };
|
|
13
|
+
} & StyledMenuModalProps, "theme">;
|
|
14
|
+
export declare const StyledMenuFullscreenHeader: import("styled-components").StyledComponent<"div", any, StyledMenuModalProps, never>;
|
|
15
|
+
export declare const StyledMenuFullscreenContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../../../style/themes/apply-base-theme.js"),
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../../style/themes/apply-base-theme.js"),l=require("../menu.config.js");function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e);const a=i.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreen",componentId:"carbon_v162_10_0__sc-9603f910-0"})(["",""],(({$startPosition:t,$transitionDuration:l,theme:n})=>e.css(["position:fixed;top:0;bottom:0;z-index:",";&.enter{visibility:hidden;",":-100%;}&.enter-active{visibility:visible;",":0;transition:all ","ms ease;}&.exit{visibility:visible;",":0;}&.exit-active{visibility:hidden;",":-100%;transition:all ","ms ease;}"],n.zIndex.fullScreenModal,t,t,l,t,t,l))),s=i.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuModal",componentId:"carbon_v162_10_0__sc-9603f910-1"})(["",""],(({$menuVariant:t})=>e.css(["height:100vh;width:100vw;outline:none;background-color:",";"],l.default[t].background))),o=i.default.div.withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreenHeader",componentId:"carbon_v162_10_0__sc-9603f910-2"})(["",""],(({$menuVariant:t})=>e.css(["height:var(--global-size-m);display:flex;justify-content:flex-end;align-items:center;padding:var(--global-space-none) var(--global-space-comp-l);margin-bottom:var(--global-space-comp-s);background-color:",";"],l.default[t].fullScreenHeader))),r=i.default.div.withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreenContent",componentId:"carbon_v162_10_0__sc-9603f910-3"})(["overflow-y:auto;width:100%;height:calc(100% - var(--global-size-m) - var(--global-space-comp-s));"]);exports.StyledMenuFullscreen=a,exports.StyledMenuFullscreenContent=r,exports.StyledMenuFullscreenHeader=o,exports.StyledMenuModal=s;
|
|
@@ -21,7 +21,7 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
|
|
|
21
21
|
target?: string;
|
|
22
22
|
/** The rel attribute to be used for the underlying <a> tag */
|
|
23
23
|
rel?: string;
|
|
24
|
-
/**
|
|
24
|
+
/** Set the variant of the MenuItem */
|
|
25
25
|
variant?: VariantType;
|
|
26
26
|
/** Flag to display the dropdown arrow when an item has a submenu */
|
|
27
27
|
showDropdownArrow?: boolean;
|
|
@@ -33,12 +33,6 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
|
|
|
33
33
|
onSubmenuOpen?: () => void;
|
|
34
34
|
/** Callback triggered when submenu closes. Only valid with submenu prop */
|
|
35
35
|
onSubmenuClose?: () => void;
|
|
36
|
-
/**
|
|
37
|
-
@ignore @private
|
|
38
|
-
private prop, used inside ScrollableBlock to ensure the MenuItem's color variant overrides the CSS
|
|
39
|
-
for other MenuItems inside the block
|
|
40
|
-
*/
|
|
41
|
-
overrideColor?: boolean;
|
|
42
36
|
/** When set the submenu opens by click instead of hover */
|
|
43
37
|
clickToOpen?: boolean;
|
|
44
38
|
/**
|
|
@@ -47,7 +41,7 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
|
|
|
47
41
|
* */
|
|
48
42
|
maxWidth?: MaxWidthProps["maxWidth"];
|
|
49
43
|
/**
|
|
50
|
-
* @private @ignore
|
|
44
|
+
* @private @ignore @internal
|
|
51
45
|
* Renders MenuItem as a div element
|
|
52
46
|
* */
|
|
53
47
|
as?: "div";
|
|
@@ -67,11 +61,17 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
|
|
|
67
61
|
}
|
|
68
62
|
export interface MenuWithChildren extends MenuItemBaseProps {
|
|
69
63
|
children?: React.ReactNode;
|
|
70
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated Please pass any desired icons as children instead.
|
|
66
|
+
* Either prop `icon` must be defined or this node must have children.
|
|
67
|
+
*/
|
|
71
68
|
icon?: IconType;
|
|
72
69
|
}
|
|
73
70
|
export interface MenuWithIcon extends MenuItemBaseProps {
|
|
74
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Please pass any desired icons as children instead.
|
|
73
|
+
* Either prop `icon` must be defined or this node must have children.
|
|
74
|
+
*/
|
|
75
75
|
icon: IconType;
|
|
76
76
|
children?: React.ReactNode;
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("../../../__internal__/focus-trap/focus-trap-utils.js"),u=require("../../../style/utils/filter-styled-system-padding-props.js"),i=require("./menu-item.style.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("../../../__internal__/focus-trap/focus-trap-utils.js"),u=require("../../../style/utils/filter-styled-system-padding-props.js"),i=require("./menu-item.style.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),a=require("../__internal__/strict-menu.context.js"),l=require("../__internal__/submenu/submenu.component.js"),s=require("../__internal__/submenu/submenu.context.js"),c=require("../../../__internal__/utils/helpers/guid/index.js"),d=require("../../icon/icon.component.js");require("../../icon/icon.style.js");var m=require("../__internal__/menu-item-variant.context.js");function f(e){return e&&e.__esModule?e:{default:e}}var p=f(t),b=f(n);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e}function j(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const v=t.forwardRef(((n,f)=>{var{submenu:h,submenuMaxWidth:v,submenuMinWidth:x,children:O,href:g,onClick:_,target:w,submenuDirection:S="right",icon:I,selected:M,onKeyDown:P,variant:W="default",showDropdownArrow:q=!0,ariaLabel:$,ariaCurrent:D,clickToOpen:C,maxWidth:k,onSubmenuOpen:F,onSubmenuClose:E,rel:V,as:K,"data-element":L,"data-role":T}=n,A=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(n,["submenu","submenuMaxWidth","submenuMinWidth","children","href","onClick","target","submenuDirection","icon","selected","onKeyDown","variant","showDropdownArrow","ariaLabel","ariaCurrent","clickToOpen","maxWidth","onSubmenuOpen","onSubmenuClose","rel","as","data-element","data-role"]);b.default(I||O,"Either prop `icon` must be defined or this node must have `children`."),b.default(O||$||h||"string"==typeof h&&h.length,"If no text or node is provided via the `submenu` prop, an `ariaLabel` should be given to facilitate accessibility."),b.default("boolean"==typeof h||void 0===h||p.default.isValidElement(h)||O&&"string"==typeof h&&h.length,"You should not pass `children` when `submenu` is an empty string");const R=t.useRef(c.default()),{inFullscreenView:H,registerItem:N,unregisterItem:Y,focusId:z,updateFocusId:B,menuVariant:G}=a.useStrictMenuContext(),J=t.useContext(s.default),Q=Object.keys(J).length>0,{submenuFocusId:U,updateFocusId:X,handleKeyDown:Z,submenuMaxWidth:ee,closeSubmenu:te}=J,{menuItemVariant:ne}=t.useContext(m.default),re=z===R.current,ue=U?U===R.current:void 0,[ie,oe]=t.useState(null),[ae,le]=t.useState(null);t.useLayoutEffect((()=>{var e;const t=null!==(e=null==ie?void 0:ie.querySelector(r.defaultFocusableSelectors))&&void 0!==e?e:null;t!==ae&&le(t)}),[ae,ie]),t.useEffect((()=>{const e=R.current;return N&&N(e),()=>{Y&&Y(e)}}),[N,Y]),t.useEffect((()=>{if(re&&!ue||ue){if(ae)return void ae.focus();null==ie||ie.focus()}}),[ae,re,ue,ie]),t.useImperativeHandle(f,(()=>({focus(){null==ie||ie.focus()}})),[ie]);const se=e=>{Q?(e.stopPropagation(),null==X||X(R.current)):null==B||B(R.current)},ce={className:g||_?"carbon-menu-item--has-link":"",href:ae?void 0:g,onClick:ae||!g&&!_?void 0:e=>{null==_||_(e),null==te||te()},target:w,rel:V,onKeyDown:H?void 0:e=>{null==P||P(e),o.default.isEscKey(e)&&(null==ie||ie.focus()),null==Z||Z(e)},ref:oe},de=e=>k&&"string"==typeof e?e:void 0,me=H?void 0:k,fe=!(_||g||ae);if(h){const t=e.jsxs(e.Fragment,{children:[e.jsxs(i.StyledMenuItemContent,{$hasMaxWidth:!!me,children:[I&&e.jsx(d.default,{type:I}),h]}),q&&!H&&e.jsx(d.default,{ml:"4px",type:"dropdown"})]});return e.jsx(i.StyledMenuItem,j(y({"data-component":"menu-item","data-element":L,"data-role":T,title:de(h),$maxWidth:me},A),{$inFullscreenView:H,id:R.current,as:K,onFocus:se,children:e.jsx(l.default,j(y(j(y({title:t,submenuDirection:S,clickToOpen:C,maxWidth:k,asPassiveItem:fe,"aria-label":$,onSubmenuOpen:F,onSubmenuClose:E,submenuMaxWidth:v,submenuMinWidth:x,selected:M},ce),{variant:W}),A),{children:O}))}))}const pe=u.default(A),be=!!(null==ie?void 0:ie.querySelector("[data-element='input']"));return e.jsx(i.StyledMenuItem,j(y({"data-component":"menu-item","data-element":L,"data-role":T,$inSubmenu:Q,title:de(O),$maxWidth:me},A),{$inFullscreenView:H,id:R.current,as:K,onFocus:se,children:e.jsx(i.StyledMenuItemWrapper,j(y(j(y({as:_&&!g?"button":"a",$menuVariant:G,"data-element":"menu-item-wrapper","data-role":"menu-item-wrapper"},ce),{$menuItemVariant:ne||W,"aria-label":$,"aria-current":D,$maxWidth:me,$submenuMaxWidth:ee,$inFullscreenView:H,$asPassiveItem:fe}),pe),{$asDiv:be||"div"===K,$inSubmenu:Q,$selected:M,children:e.jsxs(i.StyledMenuItemContent,{$hasMaxWidth:!!me,children:[I&&e.jsx(d.default,{type:I}),O]})}))}))}));exports.MenuItem=v,exports.default=v;
|
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
inFullscreenView?: boolean;
|
|
10
|
-
asPassiveItem?: boolean;
|
|
11
|
-
icon?: string;
|
|
12
|
-
ariaLabel?: string;
|
|
13
|
-
asDiv?: boolean;
|
|
14
|
-
hasFocusableChild?: boolean;
|
|
15
|
-
hasInput?: boolean;
|
|
16
|
-
menuItemVariant?: Pick<MenuWithChildren, "variant">["variant"];
|
|
17
|
-
inSubmenu?: boolean;
|
|
1
|
+
import { MaxWidthProps } from "styled-system";
|
|
2
|
+
import { MenuVariantType } from "../menu.component";
|
|
3
|
+
import { VariantType } from "./menu-item.component";
|
|
4
|
+
export interface StyledMenuItemProps {
|
|
5
|
+
$maxWidth?: MaxWidthProps["maxWidth"];
|
|
6
|
+
$inFullscreenView?: boolean;
|
|
7
|
+
$inSubmenu?: boolean;
|
|
8
|
+
$removeHeight?: boolean;
|
|
18
9
|
}
|
|
19
|
-
declare const
|
|
10
|
+
export declare const StyledMenuItem: import("styled-components").StyledComponent<"li", any, {
|
|
20
11
|
theme: object;
|
|
21
|
-
} &
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
} & StyledMenuItemProps, "theme">;
|
|
13
|
+
export interface StyledMenuItemWrapperProps {
|
|
14
|
+
$menuVariant: MenuVariantType;
|
|
15
|
+
$selected?: boolean;
|
|
16
|
+
$hasSubmenu?: boolean;
|
|
17
|
+
$isOpen?: boolean;
|
|
18
|
+
$inFullscreenView?: boolean;
|
|
19
|
+
$asPassiveItem?: boolean;
|
|
20
|
+
$asDiv?: boolean;
|
|
21
|
+
$menuItemVariant?: VariantType;
|
|
22
|
+
$inSubmenu?: boolean;
|
|
23
|
+
$submenuMaxWidth?: string;
|
|
24
|
+
$maxWidth?: MaxWidthProps["maxWidth"];
|
|
25
|
+
}
|
|
26
|
+
export declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"a", any, {
|
|
27
|
+
theme: object;
|
|
28
|
+
} & StyledMenuItemWrapperProps, "theme">;
|
|
29
|
+
interface StyledMenuItemContentProps {
|
|
30
|
+
$hasMaxWidth?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const StyledMenuItemContent: import("styled-components").StyledComponent<"span", any, StyledMenuItemContentProps, never>;
|
|
24
33
|
export default StyledMenuItemWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),o=require("../menu.config.js"),a=require("../../../style/themes/apply-base-theme.js"),s=require("../../../style/utils/add-focus-styling.js");function r(e){return e&&e.__esModule?e:{default:e}}var l=r(e);const n=l.default.li.attrs(a.default).withConfig({displayName:"menu-item.style__StyledMenuItem",componentId:"carbon_v162_10_0__sc-338885db-0"})(["display:flex;list-style:none;align-items:stretch;min-height:var(--global-size-m);"," "," ",""],t.layout,t.flexbox,(({$inSubmenu:t,$removeHeight:o,$inFullscreenView:a,$maxWidth:s})=>e.css([""," "," ",""],t&&e.css(["display:list-item;",""],a&&e.css(["width:100%;"])),o&&e.css(["min-height:0;"]),s&&e.css(["max-width:",";"],s)))),i=e.css(['padding:0;.popover-open-component{[data-component="button"]{background-color:inherit;color:inherit;border-radius:inherit;border:none;padding:var(--global-space-comp-xs) var(--global-space-comp-l);&:focus{','}}[data-popover-container-button="true"]{background-color:var(--colorsActionMajor500);&:focus{background-color:var(--colorsActionMajor500);}}}'],s.default(!0)),c=l.default.a.attrs(a.default).withConfig({displayName:"menu-item.style__StyledMenuItemWrapper",componentId:"carbon_v162_10_0__sc-338885db-1"})(["",""],(({$menuVariant:a,$selected:r,$hasSubmenu:l,$isOpen:n,$menuItemVariant:c,$maxWidth:d,$inFullscreenView:u,$asPassiveItem:m,$asDiv:p,$inSubmenu:b,$submenuMaxWidth:g,theme:f})=>e.css(["position:relative;display:flex;align-items:center;box-sizing:border-box;min-height:var(--global-size-m);text-decoration:none;text-align:left;font:var(--global-font-static-comp-medium-m);padding:var(--global-space-comp-xs) var(--global-space-comp-l);background-color:",";color:",";border:none;"," "," "," "," "," "," &:has([data-component='popover-container']){","}"],o.default[a].background,o.default[a].color,t.padding,d&&e.css(["max-width:",";"],d),u&&e.css(["width:100%;font:var(--global-font-static-comp-medium-l);",""],l&&e.css(["color:",";"],o.default[a].title)),!m&&!p&&e.css(["&:hover{cursor:pointer;background-color:",";color:",";}&:focus{","}&:active{background-color:",";color:",";}"],o.default[a].backgroundHover,o.default[a].colorHover,s.default(!0),o.default[a].backgroundActive,o.default[a].colorActive),r&&e.css(['&::before{content:"";position:absolute;width:var(--global-size-xs);height:var(--global-size-6-xs);background-color:var(--nav-primary-bg-selected);'," ","}"],!u&&e.css(["bottom:0px;left:50%;transform:translate(-50%,0%);width:var(--global-size-xs);height:var(--global-size-6-xs);"]),u&&e.css(["left:0px;top:50%;transform:translate(0%,-50%);height:var(--global-size-xs);width:var(--global-size-6-xs);"])),!u&&e.css([""," ",""],l&&n&&e.css(["z-index:calc("," + 1);background-color:",";",""],f.zIndex.popover,o.default[a].submenuOpenedBackground,"white"===a&&e.css(["box-shadow:inset 1px 0 0 var(--nav-tertiary-border-default),inset -1px 0 0 var(--nav-tertiary-border-default);"])),b&&e.css(["width:100%;background-color:",";"," ",""],o.default[a].submenuItemBackground,"alternate"===c&&e.css(["background-color:",";"],o.default[a].alternate),g&&e.css(["max-width:",";"],g))),i))),d=l.default.span.withConfig({displayName:"menu-item.style__StyledMenuItemContent",componentId:"carbon_v162_10_0__sc-338885db-2"})(["",""],(({$hasMaxWidth:t})=>e.css(["display:flex;align-items:center;gap:var(--global-space-comp-s);width:100%;"," .search{width:100%;}"],t&&e.css(["display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;vertical-align:middle;"]))));exports.StyledMenuItem=n,exports.StyledMenuItemContent=d,exports.StyledMenuItemWrapper=c,exports.default=c;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { VariantType } from "../menu-item";
|
|
3
3
|
import { TagProps } from "../../../__internal__/utils/helpers/tags";
|
|
4
|
-
|
|
5
|
-
type AllowedAsValues = (typeof AS_VALUES)[number];
|
|
4
|
+
type AllowedAsValues = "h2" | "h3" | "h4" | "h5" | "h6";
|
|
6
5
|
export interface MenuTitleProps extends TagProps {
|
|
6
|
+
/** MenuItem children to be rendered within the segment */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
/** The text content for the segment title */
|
|
8
9
|
text: string;
|
|
9
|
-
/** Set the
|
|
10
|
+
/** Set the variant of the MenuSegmentTitle */
|
|
10
11
|
variant?: VariantType;
|
|
11
12
|
/** Set the heading level for the segment title */
|
|
12
13
|
as?: AllowedAsValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./menu-segment-title.style.js"),n=require("../__internal__/strict-menu.context.js"),u=require("../menu.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./menu-segment-title.style.js"),n=require("../__internal__/strict-menu.context.js"),u=require("../__internal__/menu-item-variant.context.js"),i=require("../menu-item/menu-item.style.js"),l=require("../../../__internal__/utils/helpers/tags/tags.js"),s=require("../__internal__/submenu/submenu.context.js");function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){a(e,t,r[t])}))}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const m=o(t).default.forwardRef(((o,a)=>{var{children:m,variant:p="default",text:b,as:d="h2",segmentWrapperProps:y}=o,O=function(e,t){if(null==e)return{};var r,n,u=function(e,t){if(null==e)return{};var r,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(u[r]=e[r]);return u}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(u[r]=e[r])}return u}(o,["children","variant","text","as","segmentWrapperProps"]);const{menuVariant:j,inFullscreenView:g}=n.useStrictMenuContext(),{submenuMaxWidth:_}=t.useContext(s.default);return e.jsxs(i.StyledMenuItem,{$inSubmenu:!0,$removeHeight:!0,children:[e.jsx(r.StyledTitle,f(c({as:d},l.default("menu-segment-title",O)),{$menuVariant:j,ref:a,$variant:g?void 0:p,$shouldWrap:!!_,$isInFullscreen:g,children:b})),m&&e.jsx(r.StyledSegmentChildren,f(c({},l.default("menu-segment-title",c({"data-role":"menu-segment-children"},y))),{children:e.jsx(u.default.Provider,{value:{menuItemVariant:p},children:m})}))]})}));m.displayName="MenuSegmentTitle",exports.default=m;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import { MenuVariantType } from "../menu.component";
|
|
1
2
|
import { VariantType } from "../menu-item";
|
|
2
|
-
import type { MenuType } from "../menu.types";
|
|
3
3
|
interface StyledTitleProps {
|
|
4
|
-
variant?: VariantType;
|
|
5
|
-
|
|
6
|
-
shouldWrap?: boolean;
|
|
4
|
+
$variant?: VariantType;
|
|
5
|
+
$menuVariant: MenuVariantType;
|
|
6
|
+
$shouldWrap?: boolean;
|
|
7
|
+
$isInFullscreen?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const StyledTitle: import("styled-components").StyledComponent<"h2", any, StyledTitleProps, never>;
|
|
9
|
-
declare const StyledSegmentChildren: import("styled-components").StyledComponent<"ul", any, {
|
|
10
|
-
variant?: VariantType;
|
|
11
|
-
menuType: MenuType;
|
|
12
|
-
}, never>;
|
|
10
|
+
declare const StyledSegmentChildren: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
13
11
|
export { StyledTitle, StyledSegmentChildren };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),
|
|
1
|
+
"use strict";var e=require("styled-components"),a=require("../menu.config.js");function t(e){return e&&e.__esModule?e:{default:e}}var l=t(e);const n=l.default.h2.withConfig({displayName:"menu-segment-title.style__StyledTitle",componentId:"carbon_v162_10_0__sc-6f99340f-0"})(["",""],(({$menuVariant:t,$variant:l,$shouldWrap:n,$isInFullscreen:o})=>e.css(["margin:var(--global-space-none);padding:var(--global-space-comp-s) var(--global-space-comp-l) var(--global-space-none);text-transform:uppercase;cursor:default;white-space:",";font-size:12px;font-weight:500;line-height:150%;color:",";background-color:",";"," ",""],n?"normal":"nowrap",a.default[t].title,a.default[t].submenuItemBackground,"alternate"===l&&e.css(["background-color:",";"],a.default[t].alternate),o&&e.css(["background-color:",";padding:var(--global-space-comp-s) var(--global-space-comp-l);"],a.default[t].background)))),o=l.default.ul.withConfig({displayName:"menu-segment-title.style__StyledSegmentChildren",componentId:"carbon_v162_10_0__sc-6f99340f-1"})(["padding:0;"]);exports.StyledSegmentChildren=o,exports.StyledTitle=n;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { FlexboxProps, LayoutProps } from "styled-system";
|
|
3
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
|
+
/** @deprecated */
|
|
5
|
+
export type MenuType = "light" | "dark" | "white" | "black";
|
|
6
|
+
export type MenuVariantType = "white" | "black";
|
|
7
|
+
export interface MenuProps extends TagProps, Pick<LayoutProps, "width" | "minWidth" | "maxWidth" | "overflow" | "overflowX" | "verticalAlign">, FlexboxProps {
|
|
8
|
+
/** Children elements */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Please use the `variant` prop instead.
|
|
12
|
+
*/
|
|
13
|
+
menuType?: MenuType;
|
|
14
|
+
/** Set the color variant of the component */
|
|
15
|
+
variant?: MenuVariantType;
|
|
16
|
+
}
|
|
17
|
+
export declare const Menu: ({ menuType, variant, children, ...rest }: MenuProps) => React.JSX.Element;
|
|
4
18
|
export default Menu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),n=require("./menu.style.js"),u=require("./__internal__/strict-menu.context.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),n=require("./menu.style.js"),u=require("./__internal__/strict-menu.context.js"),i=require("./__internal__/menu.context.js"),o=require("./__internal__/keyboard-navigation/index.js"),l=require("./__internal__/locators.js");function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const a=a=>{var{menuType:s,variant:b="white",children:f}=a,p=function(e,r){if(null==e)return{};var t,n,u=function(e,r){if(null==e)return{};var t,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(u[t]=e[t]);return u}(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)&&(u[t]=e[t])}return u}(a,["menuType","variant","children"]);const[y,O]=r.useState(null),d=r.useRef(null),[j,_]=r.useState(void 0),[m,v]=r.useState([]);let g=b;"light"===s||"white"===s?g="white":"dark"!==s&&"black"!==s||(g="black");const h=r.useCallback((e=>{v((r=>[...r,e]))}),[]),P=r.useCallback((e=>{v((r=>r.filter((r=>r!==e))))}),[]);return e.jsx(n.StyledMenuWrapper,(w=function(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){c(e,r,t[r])}))}return e}({},p,t.default("menu",p)),S=null!=(S={ref:d,role:"list",onKeyDown:e=>{if(d.current){const r=d.current.querySelectorAll(l.MENU_ITEM_CHILDREN_LOCATOR);if(r){const t=o.menuKeyboardNavigation(e,Array.from(r));void 0!==t&&_(m[t])}}},children:e.jsx(u.StrictMenuProvider,{value:{menuVariant:g,openSubmenuId:y,setOpenSubmenuId:O,focusId:j,updateFocusId:_,registerItem:h,unregisterItem:P},children:e.jsx(i.default.Provider,{value:{inMenu:!0},children:f})})})?S:{},Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(S)).forEach((function(e){Object.defineProperty(w,e,Object.getOwnPropertyDescriptor(S,e))})),w));var w,S};exports.Menu=a,exports.default=a;
|