@salesforce/design-system-react 11.0.0-alpha.6 → 11.0.0-alpha.8
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/dist/cjs/components/accordion/panel.cjs +1 -1
- package/dist/cjs/components/accordion/panel.cjs.map +1 -1
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/badge/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/check-props.cjs +2 -0
- package/dist/cjs/components/builder-header/check-props.cjs.map +1 -0
- package/dist/cjs/components/builder-header/component.cjs +2 -0
- package/dist/cjs/components/builder-header/component.cjs.map +1 -0
- package/dist/cjs/components/builder-header/toolbar.cjs +1 -1
- package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
- package/dist/cjs/components/carousel/check-props.cjs +2 -0
- package/dist/cjs/components/carousel/check-props.cjs.map +1 -0
- package/dist/cjs/components/carousel/component.cjs +2 -0
- package/dist/cjs/components/carousel/component.cjs.map +1 -0
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs +1 -1
- package/dist/cjs/components/carousel/private/carousel-item.cjs.map +1 -1
- package/dist/cjs/components/checkbox/check-props.cjs +2 -0
- package/dist/cjs/components/checkbox/check-props.cjs.map +1 -0
- package/dist/cjs/components/checkbox/component.cjs +2 -0
- package/dist/cjs/components/checkbox/component.cjs.map +1 -0
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/combobox/check-props.cjs +1 -1
- package/dist/cjs/components/combobox/check-props.cjs.map +1 -1
- package/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/combobox/index.cjs.map +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs +1 -1
- package/dist/cjs/components/combobox/private/menu.cjs.map +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs.map +1 -1
- package/dist/cjs/components/filter/filter.cjs +1 -1
- package/dist/cjs/components/filter/filter.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/check-props.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/check-props.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/check-props.cjs +2 -0
- package/dist/cjs/components/modal/check-props.cjs.map +1 -0
- package/dist/cjs/components/modal/component.cjs +2 -0
- package/dist/cjs/components/modal/component.cjs.map +1 -0
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/check-props.cjs +2 -0
- package/dist/cjs/components/page-header/check-props.cjs.map +1 -0
- package/dist/cjs/components/page-header/component.cjs +2 -0
- package/dist/cjs/components/page-header/component.cjs.map +1 -0
- package/dist/cjs/components/page-header/index.cjs +1 -1
- package/dist/cjs/components/page-header/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/base/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs +1 -1
- package/dist/cjs/components/page-header/private/controls.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/object-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/record-home/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs +1 -1
- package/dist/cjs/components/page-header/private/related-list/index.cjs.map +1 -1
- package/dist/cjs/components/popover/component.cjs +2 -0
- package/dist/cjs/components/popover/component.cjs.map +1 -0
- package/dist/cjs/components/popover/edit-dialog.cjs +1 -1
- package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/component.cjs +2 -0
- package/dist/cjs/components/progress-indicator/component.cjs.map +1 -0
- package/dist/cjs/components/progress-indicator/index.cjs +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/step-vertical.cjs.map +1 -1
- package/dist/cjs/components/radio/check-props.cjs +2 -0
- package/dist/cjs/components/radio/check-props.cjs.map +1 -0
- package/dist/cjs/components/radio/component.cjs +2 -0
- package/dist/cjs/components/radio/component.cjs.map +1 -0
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/check-props.cjs +1 -1
- package/dist/cjs/components/setup-assistant/check-props.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs +1 -1
- package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/slider/check-props.cjs +2 -0
- package/dist/cjs/components/slider/check-props.cjs.map +1 -0
- package/dist/cjs/components/slider/component.cjs +2 -0
- package/dist/cjs/components/slider/component.cjs.map +1 -0
- package/dist/cjs/components/slider/index.cjs +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/spinner/check-props.cjs +2 -0
- package/dist/cjs/components/spinner/check-props.cjs.map +1 -0
- package/dist/cjs/components/spinner/component.cjs +2 -0
- package/dist/cjs/components/spinner/component.cjs.map +1 -0
- package/dist/cjs/components/spinner/index.cjs +1 -1
- package/dist/cjs/components/spinner/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/check-props.cjs +1 -1
- package/dist/cjs/components/split-view/check-props.cjs.map +1 -1
- package/dist/cjs/components/split-view/index.cjs +1 -1
- package/dist/cjs/components/split-view/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/listbox-check-props.cjs +2 -0
- package/dist/cjs/components/split-view/listbox-check-props.cjs.map +1 -0
- package/dist/cjs/components/split-view/listbox.cjs +1 -1
- package/dist/cjs/components/split-view/listbox.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-content.cjs +1 -1
- package/dist/cjs/components/split-view/private/list-item-content.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs +1 -1
- package/dist/cjs/components/split-view/private/list-item-with-content.cjs.map +1 -1
- package/dist/cjs/components/split-view/private/toggle-button.cjs +1 -1
- package/dist/cjs/components/split-view/private/toggle-button.cjs.map +1 -1
- package/dist/cjs/components/tabs/panel.cjs.map +1 -1
- package/dist/cjs/components/textarea/check-props.cjs +1 -1
- package/dist/cjs/components/textarea/check-props.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/tree/check-props.cjs +1 -1
- package/dist/cjs/components/tree/check-props.cjs.map +1 -1
- package/dist/cjs/components/tree/component.cjs +2 -0
- package/dist/cjs/components/tree/component.cjs.map +1 -0
- package/dist/cjs/components/tree/tree.cjs +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/trial-bar/check-props.cjs +2 -0
- package/dist/cjs/components/trial-bar/check-props.cjs.map +1 -0
- package/dist/cjs/components/trial-bar/component.cjs +2 -0
- package/dist/cjs/components/trial-bar/component.cjs.map +1 -0
- package/dist/cjs/components/trial-bar/index.cjs +1 -1
- package/dist/cjs/components/trial-bar/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/index.cjs.map +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs +1 -1
- package/dist/cjs/components/utilities/menu-list/item.cjs.map +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs +1 -1
- package/dist/cjs/components/utilities/utility-icon/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/private/item.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/check-props.cjs +2 -0
- package/dist/cjs/components/welcome-mat/check-props.cjs.map +1 -0
- package/dist/cjs/components/welcome-mat/component.cjs +2 -0
- package/dist/cjs/components/welcome-mat/component.cjs.map +1 -0
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs +1 -1
- package/dist/cjs/components/welcome-mat/info-badge.cjs.map +1 -1
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs +2 -0
- package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -0
- package/dist/es/components/accordion/panel.js +1 -1
- package/dist/es/components/accordion/panel.js.map +1 -1
- package/dist/es/components/badge/index.js +6 -5
- package/dist/es/components/badge/index.js.map +1 -1
- package/dist/es/components/builder-header/check-props.js +13 -0
- package/dist/es/components/builder-header/check-props.js.map +1 -0
- package/dist/es/components/builder-header/component.js +65 -0
- package/dist/es/components/builder-header/component.js.map +1 -0
- package/dist/es/components/builder-header/toolbar.js +18 -13
- package/dist/es/components/builder-header/toolbar.js.map +1 -1
- package/dist/es/components/carousel/check-props.js +13 -0
- package/dist/es/components/carousel/check-props.js.map +1 -0
- package/dist/es/components/carousel/component.js +27 -0
- package/dist/es/components/carousel/component.js.map +1 -0
- package/dist/es/components/carousel/index.js +121 -109
- package/dist/es/components/carousel/index.js.map +1 -1
- package/dist/es/components/carousel/private/carousel-item.js +1 -2
- package/dist/es/components/carousel/private/carousel-item.js.map +1 -1
- package/dist/es/components/checkbox/check-props.js +14 -0
- package/dist/es/components/checkbox/check-props.js.map +1 -0
- package/dist/es/components/checkbox/component.js +35 -0
- package/dist/es/components/checkbox/component.js.map +1 -0
- package/dist/es/components/checkbox/index.js +124 -112
- package/dist/es/components/checkbox/index.js.map +1 -1
- package/dist/es/components/color-picker/color-picker.js +1 -1
- package/dist/es/components/color-picker/color-picker.js.map +1 -1
- package/dist/es/components/combobox/check-props.js +1 -1
- package/dist/es/components/combobox/check-props.js.map +1 -1
- package/dist/es/components/combobox/combobox.js +210 -202
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/combobox/index.js.map +1 -1
- package/dist/es/components/combobox/private/menu.js +5 -7
- package/dist/es/components/combobox/private/menu.js.map +1 -1
- package/dist/es/components/dynamic-icon/index.js +1 -1
- package/dist/es/components/dynamic-icon/index.js.map +1 -1
- package/dist/es/components/filter/filter.js +1 -1
- package/dist/es/components/filter/filter.js.map +1 -1
- package/dist/es/components/input/index.js +138 -136
- package/dist/es/components/input/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/check-props.js +1 -1
- package/dist/es/components/menu-dropdown/check-props.js.map +1 -1
- package/dist/es/components/menu-dropdown/index.js.map +1 -1
- package/dist/es/components/menu-dropdown/menu-dropdown.js +192 -185
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/modal/check-props.js +22 -0
- package/dist/es/components/modal/check-props.js.map +1 -0
- package/dist/es/components/modal/component.js +35 -0
- package/dist/es/components/modal/component.js.map +1 -0
- package/dist/es/components/modal/index.js +118 -104
- package/dist/es/components/modal/index.js.map +1 -1
- package/dist/es/components/page-header/check-props.js +31 -0
- package/dist/es/components/page-header/check-props.js.map +1 -0
- package/dist/es/components/page-header/component.js +35 -0
- package/dist/es/components/page-header/component.js.map +1 -0
- package/dist/es/components/page-header/index.js +56 -38
- package/dist/es/components/page-header/index.js.map +1 -1
- package/dist/es/components/page-header/private/base/index.js +1 -1
- package/dist/es/components/page-header/private/base/index.js.map +1 -1
- package/dist/es/components/page-header/private/controls.js +1 -1
- package/dist/es/components/page-header/private/controls.js.map +1 -1
- package/dist/es/components/page-header/private/object-home/index.js +4 -4
- package/dist/es/components/page-header/private/object-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/record-home/index.js +1 -1
- package/dist/es/components/page-header/private/record-home/index.js.map +1 -1
- package/dist/es/components/page-header/private/related-list/index.js +2 -2
- package/dist/es/components/page-header/private/related-list/index.js.map +1 -1
- package/dist/es/components/popover/component.js +59 -0
- package/dist/es/components/popover/component.js.map +1 -0
- package/dist/es/components/popover/edit-dialog.js +1 -1
- package/dist/es/components/popover/edit-dialog.js.map +1 -1
- package/dist/es/components/popover/popover.js +247 -203
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/check-props.js +11 -8
- package/dist/es/components/progress-indicator/check-props.js.map +1 -1
- package/dist/es/components/progress-indicator/component.js +35 -0
- package/dist/es/components/progress-indicator/component.js.map +1 -0
- package/dist/es/components/progress-indicator/index.js +74 -71
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-indicator/private/step-vertical.js +23 -20
- package/dist/es/components/progress-indicator/private/step-vertical.js.map +1 -1
- package/dist/es/components/radio/check-props.js +13 -0
- package/dist/es/components/radio/check-props.js.map +1 -0
- package/dist/es/components/radio/component.js +24 -0
- package/dist/es/components/radio/component.js.map +1 -0
- package/dist/es/components/radio/index.js +94 -80
- package/dist/es/components/radio/index.js.map +1 -1
- package/dist/es/components/setup-assistant/check-props.js +12 -7
- package/dist/es/components/setup-assistant/check-props.js.map +1 -1
- package/dist/es/components/setup-assistant/step.js +7 -7
- package/dist/es/components/setup-assistant/step.js.map +1 -1
- package/dist/es/components/simple-data-table/check-props.js +1 -1
- package/dist/es/components/simple-data-table/check-props.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +17 -10
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/slider/check-props.js +17 -0
- package/dist/es/components/slider/check-props.js.map +1 -0
- package/dist/es/components/slider/component.js +35 -0
- package/dist/es/components/slider/component.js.map +1 -0
- package/dist/es/components/slider/index.js +73 -54
- package/dist/es/components/slider/index.js.map +1 -1
- package/dist/es/components/spinner/check-props.js +13 -0
- package/dist/es/components/spinner/check-props.js.map +1 -0
- package/dist/es/components/spinner/component.js +17 -0
- package/dist/es/components/spinner/component.js.map +1 -0
- package/dist/es/components/spinner/index.js +43 -29
- package/dist/es/components/spinner/index.js.map +1 -1
- package/dist/es/components/split-view/check-props.js +2 -2
- package/dist/es/components/split-view/check-props.js.map +1 -1
- package/dist/es/components/split-view/index.js +8 -5
- package/dist/es/components/split-view/index.js.map +1 -1
- package/dist/es/components/split-view/listbox-check-props.js +13 -0
- package/dist/es/components/split-view/listbox-check-props.js.map +1 -0
- package/dist/es/components/split-view/listbox.js +41 -35
- package/dist/es/components/split-view/listbox.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-content.js +1 -1
- package/dist/es/components/split-view/private/list-item-content.js.map +1 -1
- package/dist/es/components/split-view/private/list-item-with-content.js +6 -1
- package/dist/es/components/split-view/private/list-item-with-content.js.map +1 -1
- package/dist/es/components/split-view/private/toggle-button.js +2 -2
- package/dist/es/components/split-view/private/toggle-button.js.map +1 -1
- package/dist/es/components/tabs/panel.js.map +1 -1
- package/dist/es/components/textarea/check-props.js +11 -10
- package/dist/es/components/textarea/check-props.js.map +1 -1
- package/dist/es/components/textarea/index.js +59 -47
- package/dist/es/components/textarea/index.js.map +1 -1
- package/dist/es/components/tree/check-props.js +10 -9
- package/dist/es/components/tree/check-props.js.map +1 -1
- package/dist/es/components/tree/component.js +25 -0
- package/dist/es/components/tree/component.js.map +1 -0
- package/dist/es/components/tree/tree.js +83 -75
- package/dist/es/components/tree/tree.js.map +1 -1
- package/dist/es/components/trial-bar/check-props.js +13 -0
- package/dist/es/components/trial-bar/check-props.js.map +1 -0
- package/dist/es/components/trial-bar/component.js +24 -0
- package/dist/es/components/trial-bar/component.js.map +1 -0
- package/dist/es/components/trial-bar/index.js +27 -21
- package/dist/es/components/trial-bar/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/index.js +1 -0
- package/dist/es/components/utilities/menu-list/index.js.map +1 -1
- package/dist/es/components/utilities/menu-list/item.js +5 -3
- package/dist/es/components/utilities/menu-list/item.js.map +1 -1
- package/dist/es/components/utilities/utility-icon/index.js +2 -1
- package/dist/es/components/utilities/utility-icon/index.js.map +1 -1
- package/dist/es/components/vertical-navigation/index.js +17 -16
- package/dist/es/components/vertical-navigation/index.js.map +1 -1
- package/dist/es/components/vertical-navigation/private/item.js +1 -1
- package/dist/es/components/vertical-navigation/private/item.js.map +1 -1
- package/dist/es/components/welcome-mat/check-props.js +13 -0
- package/dist/es/components/welcome-mat/check-props.js.map +1 -0
- package/dist/es/components/welcome-mat/component.js +46 -0
- package/dist/es/components/welcome-mat/component.js.map +1 -0
- package/dist/es/components/welcome-mat/index.js +64 -57
- package/dist/es/components/welcome-mat/index.js.map +1 -1
- package/dist/es/components/welcome-mat/info-badge.js +19 -11
- package/dist/es/components/welcome-mat/info-badge.js.map +1 -1
- package/dist/es/utilities/warning/deprecated-property-value.js +18 -0
- package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -0
- package/dist/types/components/accordion/panel.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +4 -2
- package/dist/types/components/badge/index.d.ts.map +1 -1
- package/dist/types/components/builder-header/check-props.d.ts +3 -0
- package/dist/types/components/builder-header/check-props.d.ts.map +1 -0
- package/dist/types/components/builder-header/toolbar.d.ts +6 -4
- package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
- package/dist/types/components/carousel/check-props.d.ts +3 -0
- package/dist/types/components/carousel/check-props.d.ts.map +1 -0
- package/dist/types/components/carousel/index.d.ts +9 -7
- package/dist/types/components/carousel/index.d.ts.map +1 -1
- package/dist/types/components/carousel/private/carousel-item.d.ts +4 -4
- package/dist/types/components/carousel/private/carousel-item.d.ts.map +1 -1
- package/dist/types/components/checkbox/check-props.d.ts +1 -0
- package/dist/types/components/checkbox/check-props.d.ts.map +1 -1
- package/dist/types/components/checkbox/index.d.ts +9 -3
- package/dist/types/components/checkbox/index.d.ts.map +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/types/components/combobox/check-props.d.ts.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts +29 -15
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/combobox/index.d.ts +1 -1
- package/dist/types/components/combobox/index.d.ts.map +1 -1
- package/dist/types/components/combobox/private/menu.d.ts +11 -6
- package/dist/types/components/combobox/private/menu.d.ts.map +1 -1
- package/dist/types/components/dynamic-icon/index.d.ts.map +1 -1
- package/dist/types/components/input/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/check-props.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts +1 -1
- package/dist/types/components/menu-dropdown/index.d.ts.map +1 -1
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +22 -3
- package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
- package/dist/types/components/modal/check-props.d.ts +3 -0
- package/dist/types/components/modal/check-props.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +21 -13
- package/dist/types/components/modal/index.d.ts.map +1 -1
- package/dist/types/components/page-header/check-props.d.ts.map +1 -1
- package/dist/types/components/page-header/index.d.ts +15 -4
- package/dist/types/components/page-header/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/base/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/controls.d.ts +4 -4
- package/dist/types/components/page-header/private/controls.d.ts.map +1 -1
- package/dist/types/components/page-header/private/object-home/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/record-home/index.d.ts.map +1 -1
- package/dist/types/components/page-header/private/types.d.ts +6 -6
- package/dist/types/components/page-header/private/types.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +24 -14
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/index.d.ts +7 -1
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts +4 -7
- package/dist/types/components/progress-indicator/private/step-vertical.d.ts.map +1 -1
- package/dist/types/components/radio/check-props.d.ts +1 -0
- package/dist/types/components/radio/check-props.d.ts.map +1 -1
- package/dist/types/components/radio/index.d.ts +10 -4
- package/dist/types/components/radio/index.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/check-props.d.ts.map +1 -1
- package/dist/types/components/setup-assistant/step.d.ts +12 -6
- package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/simple-data-table/types.d.ts +21 -8
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
- package/dist/types/components/slider/check-props.d.ts +3 -0
- package/dist/types/components/slider/check-props.d.ts.map +1 -0
- package/dist/types/components/slider/index.d.ts +33 -10
- package/dist/types/components/slider/index.d.ts.map +1 -1
- package/dist/types/components/spinner/check-props.d.ts +3 -0
- package/dist/types/components/spinner/check-props.d.ts.map +1 -0
- package/dist/types/components/spinner/index.d.ts +18 -9
- package/dist/types/components/spinner/index.d.ts.map +1 -1
- package/dist/types/components/split-view/check-props.d.ts.map +1 -1
- package/dist/types/components/split-view/index.d.ts +9 -5
- package/dist/types/components/split-view/index.d.ts.map +1 -1
- package/dist/types/components/split-view/listbox-check-props.d.ts +3 -0
- package/dist/types/components/split-view/listbox-check-props.d.ts.map +1 -0
- package/dist/types/components/split-view/listbox.d.ts +19 -3
- package/dist/types/components/split-view/listbox.d.ts.map +1 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts +10 -1
- package/dist/types/components/split-view/private/list-item-with-content.d.ts.map +1 -1
- package/dist/types/components/split-view/private/toggle-button.d.ts +3 -3
- package/dist/types/components/split-view/private/toggle-button.d.ts.map +1 -1
- package/dist/types/components/tabs/panel.d.ts +5 -1
- package/dist/types/components/tabs/panel.d.ts.map +1 -1
- package/dist/types/components/textarea/check-props.d.ts.map +1 -1
- package/dist/types/components/textarea/index.d.ts +23 -3
- package/dist/types/components/textarea/index.d.ts.map +1 -1
- package/dist/types/components/tree/check-props.d.ts.map +1 -1
- package/dist/types/components/tree/index.d.ts +1 -1
- package/dist/types/components/tree/index.d.ts.map +1 -1
- package/dist/types/components/tree/tree.d.ts +20 -8
- package/dist/types/components/tree/tree.d.ts.map +1 -1
- package/dist/types/components/tree/types.d.ts +7 -1
- package/dist/types/components/tree/types.d.ts.map +1 -1
- package/dist/types/components/trial-bar/check-props.d.ts +3 -0
- package/dist/types/components/trial-bar/check-props.d.ts.map +1 -0
- package/dist/types/components/trial-bar/index.d.ts +15 -7
- package/dist/types/components/trial-bar/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/index.d.ts +5 -1
- package/dist/types/components/utilities/menu-list/index.d.ts.map +1 -1
- package/dist/types/components/utilities/menu-list/item.d.ts +3 -1
- package/dist/types/components/utilities/menu-list/item.d.ts.map +1 -1
- package/dist/types/components/utilities/utility-icon/index.d.ts.map +1 -1
- package/dist/types/components/vertical-navigation/index.d.ts +7 -7
- package/dist/types/components/vertical-navigation/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/check-props.d.ts +3 -0
- package/dist/types/components/welcome-mat/check-props.d.ts.map +1 -0
- package/dist/types/components/welcome-mat/index.d.ts +13 -8
- package/dist/types/components/welcome-mat/index.d.ts.map +1 -1
- package/dist/types/components/welcome-mat/info-badge.d.ts +7 -3
- package/dist/types/components/welcome-mat/info-badge.d.ts.map +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dropdown.js","names":[],"sources":["../../../../components/menu-dropdown/menu-dropdown.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Dropdown design pattern](https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown) in React.\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\tuseMemo,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\n// Children\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - Legacy JS module\nimport Dialog from '../utilities/dialog';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - Legacy JS module\nimport BaseList from '../utilities/menu-list';\nimport ListItem from '../utilities/menu-list/item';\nimport ListItemLabel from '../utilities/menu-list/item-label';\n\n// The menu-list `List` accepts additional legacy consumer props (`onCancel`) and\n// is passed a callback `ref` typed against the DOM element by historical callers.\n// Alias to a permissive type here rather than widen the public MenuListProps.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst List = BaseList as unknown as React.ComponentType<any>;\n\n// This is the default Dropdown Trigger, which expects one button as a child.\nimport DefaultTrigger from './button-trigger';\n\n// This component's `checkProps` which issues warnings to developers about properties\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport generateId from '../../utilities/generate-id';\nimport keyboardNavigate from '../../utilities/keyboard-navigate';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport KEYS from '../../utilities/key-code';\nimport {\n\tMENU_DROPDOWN,\n\tMENU_DROPDOWN_TRIGGER,\n\tLIST,\n} from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport type { IconCategory } from '../../types/common';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// The overlay is an optional way to allow the dropdown to close on outside\n// clicks even when those clicks are over areas that wouldn't normally fire\n// click or touch events (for example, iframes).\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\n\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Global state for tracking open dropdown\nlet currentOpenDropdown:\n\t{ handleClose: (event?: MenuDropdownCloseEvent) => void } | undefined;\n\nconst DropdownNubbinPositionsArray = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n] as const;\n\nexport type DropdownNubbinPosition =\n\t(typeof DropdownNubbinPositionsArray)[number];\n\nexport const DropdownNubbinPositions: readonly DropdownNubbinPosition[] =\n\tDropdownNubbinPositionsArray;\n\nconst noop = () => {};\n\nexport interface MenuDropdownOptionIcon {\n\tname: string;\n\tcategory: IconCategory;\n}\n\n/** A selectable menu item. `type` may be omitted. */\nexport interface MenuDropdownItemOption {\n\ttype?: 'item';\n\tclassName?: string;\n\tdisabled?: boolean;\n\tdivider?: never;\n\thref?: string;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: MenuDropdownOptionIcon;\n\trightIcon?: MenuDropdownOptionIcon;\n\ttooltipContent?: string;\n\tvalue?: string | number;\n}\n\n/** A non-selectable group heading */\nexport interface MenuDropdownHeaderOption {\n\ttype: 'header';\n\tclassName?: string;\n\tdisabled?: never;\n\t/** Adds a divider above or below the heading */\n\tdivider?: 'top' | 'bottom';\n\thref?: never;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: never;\n\trightIcon?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\n/** A separator line between items */\nexport interface MenuDropdownDividerOption {\n\ttype: 'divider';\n\tclassName?: string;\n\tdisabled?: never;\n\tdivider?: never;\n\thref?: never;\n\tid?: string;\n\tlabel?: never;\n\tleftIcon?: never;\n\trightIcon?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\nexport type MenuDropdownOption =\n\tMenuDropdownItemOption | MenuDropdownHeaderOption | MenuDropdownDividerOption;\n\n/**\n * Data passed as the second argument of `onSelect`.\n */\nexport interface MenuDropdownSelectData {\n\t/** The selected item object from `options`. */\n\toption: MenuDropdownOption;\n\t/** Index of the selected item within `options`. */\n\toptionIndex: number;\n}\n\n/**\n * Data passed as the second argument of `onOpen`. Currently has no fields; it\n * is an object so fields can be added without changing the callback shape.\n */\nexport type MenuDropdownOpenData = Record<string, never>;\n\n/**\n * Data passed as the second argument of `onClose`. Currently has no fields; it\n * is an object so fields can be added without changing the callback shape.\n */\nexport type MenuDropdownCloseData = Record<string, never>;\n\n/**\n * Event passed to `onOpen`: the trigger click, hover (`mouseenter`) or keydown\n * that opened the menu.\n */\nexport type MenuDropdownOpenEvent = MouseEvent | KeyboardEvent | undefined;\n\n/**\n * Event passed to `onClose`: the React event that closed the menu, the native\n * DOM `mousedown`/`touchstart` event for an outside click, or `undefined` when\n * there is no event (hover-close timeout, unmount).\n */\nexport type MenuDropdownCloseEvent = React.SyntheticEvent | Event | undefined;\n\nexport interface MenuDropdownProps {\n\t/** Aligns the menu center, right, or left respective to the trigger */\n\talign?: 'center' | 'left' | 'right';\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** CSS classes to be added to triggering button */\n\tbuttonClassName?: string | string[] | Record<string, boolean>;\n\t/** If true, button/icon is white. Meant for buttons on dark backgrounds */\n\tbuttonInverse?: boolean;\n\t/** Determines variant of the Button component that triggers dropdown */\n\tbuttonVariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** If true, renders checkmark icon on the selected Menu Item */\n\tcheckmark?: boolean;\n\t/** Custom content to render in the dropdown */\n\tchildren?: ReactNode;\n\t/** CSS classes to be added to dropdown menu */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names added to the Dialog component */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Prevent dropdown menu from opening */\n\tdisabled?: boolean;\n\t/** Prevents the dropdown from changing position based on the viewport */\n\thasStaticAlignment?: boolean;\n\t/** Associates an icon button with another element on the page */\n\thint?: boolean;\n\t/** Delay on menu closing in milliseconds */\n\thoverCloseDelay?: number;\n\t/** Name of the icon category */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Name of the icon */\n\ticonName?: string;\n\t/** Icon position relative to label */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Icon variant. `bare-inverse` and `border-inverse` match `lightning-button-menu`'s variants and are\n\t * equivalent to `bare` or `border` with `buttonInverse`. Meant for icon buttons on dark backgrounds.\n\t */\n\ticonVariant?:\n\t\t| 'bare'\n\t\t| 'bare-inverse'\n\t\t| 'container'\n\t\t| 'border'\n\t\t| 'border-filled'\n\t\t| 'border-inverse'\n\t\t| 'small'\n\t\t| 'more';\n\t/** Determines the size of the icon. `xx-small` requires an `iconVariant`. */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** A unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** Whether to inherit target width */\n\tinheritTargetWidth?: boolean;\n\t/** Adds inverse class to the dropdown */\n\tinverse?: boolean;\n\t/** @deprecated Use menuPosition=\"relative\" instead */\n\tisInline?: boolean;\n\t/** Forces the dropdown to be open or closed */\n\tisOpen?: boolean;\n\t/** Text within the trigger button */\n\tlabel?: string | ReactNode;\n\t/** Custom element that overrides the default Menu Item component */\n\tlistItemRenderer?: (props: Record<string, unknown>) => ReactElement;\n\t/** Menu list length */\n\tlength?: null | '5' | '7' | '10' | 5 | 7 | 10;\n\t/** Position strategy for the menu */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Style applied to menu element */\n\tmenuStyle?: React.CSSProperties;\n\t/** Whether this dropdown supports multi select */\n\tmultiple?: boolean;\n\t/** Positions dropdown menu with a nubbin */\n\tnubbinPosition?: DropdownNubbinPosition;\n\t/** @deprecated */\n\toffset?: string;\n\t/** Called when the triggering button loses focus */\n\tonBlur?: (event: FocusEvent) => void;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: (event: MouseEvent) => void;\n\t/**\n\t * Triggered when the dropdown is closed. Receives the event that closed it\n\t * (see `MenuDropdownCloseEvent`; `undefined` for the hover-close timeout and\n\t * unmount) and a `MenuDropdownCloseData` object.\n\t */\n\tonClose?: (\n\t\tevent: MenuDropdownCloseEvent,\n\t\tdata: MenuDropdownCloseData\n\t) => void;\n\t/** Called when the triggering button gains focus */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Called when a key is pressed */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/**\n\t * Triggered when the dropdown is opened. Receives the click, `mouseenter` or\n\t * keydown event that opened it and a `MenuDropdownOpenData` object.\n\t */\n\tonOpen?: (event: MenuDropdownOpenEvent, data: MenuDropdownOpenData) => void;\n\t/**\n\t * Triggered when an item in the menu is selected by mouse or keyboard.\n\t * Receives the triggering event and `{ option, optionIndex }`. Clicking\n\t * custom (non-`List`) content does not call `onSelect`; use `onClose`.\n\t */\n\tonSelect?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: MenuDropdownSelectData\n\t) => void;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** An array of menu item objects */\n\toptions?: MenuDropdownOption[];\n\t/** If true, adds a transparent overlay when menu is open */\n\toverlay?: boolean | ((isOpen: boolean, overlayEl: HTMLSpanElement) => void);\n\t/** An object of CSS styles for the triggering button */\n\tstyle?: React.CSSProperties;\n\t/** Write \"-1\" if you don't want the user to tab to the button */\n\ttabIndex?: string;\n\t/** Tooltip for the trigger button */\n\ttooltip?: ReactNode;\n\t/** Tooltip component template for menu items */\n\ttooltipMenuItem?: ReactNode;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Current selected menu item */\n\tvalue?: number | string | (number | string)[];\n\t/** Width of the menu dropdown */\n\twidth?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'bottom' | 'large';\n\t/** Internal: Used for requesting focus */\n\trequestFocus?: boolean;\n\t/** Internal: Callback for focus request */\n\tonRequestFocus?: (trigger: HTMLElement) => void;\n}\n\ninterface NavigableItem {\n\tindex: number;\n\ttext: string;\n}\n\ninterface NavigableItems extends Array<NavigableItem> {\n\tindexes: number[];\n\tkeyBuffer: ReturnType<typeof KeyBuffer>;\n}\n\nconst itemIsSelectable = (item: MenuDropdownOption): boolean =>\n\titem.type !== 'header' && item.type !== 'divider' && !item.disabled;\n\nconst getNavigableItems = (items?: MenuDropdownOption[]): NavigableItems => {\n\tconst navigableItems: NavigableItems = [] as unknown as NavigableItems;\n\tnavigableItems.indexes = [];\n\tnavigableItems.keyBuffer = new KeyBuffer();\n\n\tif (Array.isArray(items)) {\n\t\titems.forEach((item, index) => {\n\t\t\tif (itemIsSelectable(item)) {\n\t\t\t\tnavigableItems.push({\n\t\t\t\t\tindex,\n\t\t\t\t\ttext: `${item.label}`.toLowerCase(),\n\t\t\t\t});\n\t\t\t\tnavigableItems.indexes.push(index);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn navigableItems;\n};\n\n// Nubbin position mapping\nconst DropdownToDialogNubbinMapping: Record<string, string> = {\n\ttop: 'bottom',\n\t'top left': 'bottom left',\n\t'top right': 'bottom right',\n\tbottom: 'top',\n\t'bottom left': 'top left',\n\t'bottom right': 'top right',\n};\n\n/**\n * The MenuDropdown component is a variant of the Lightning Design System Menu component.\n * This is a React 19 compatible functional component that replaces the deprecated\n * react-onclickoutside HOC with a custom click outside handler.\n */\nconst MenuDropdown: React.FC<MenuDropdownProps> & {\n\tdisplayName: string;\n} = (props) => {\n\tconst {\n\t\talign = 'left',\n\t\tassistiveText,\n\t\tbuttonClassName,\n\t\tbuttonInverse,\n\t\tbuttonVariant,\n\t\tcheckmark,\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\tdisabled,\n\t\thasStaticAlignment,\n\t\thint,\n\t\thoverCloseDelay = 300,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinheritTargetWidth,\n\t\tinverse = false,\n\t\tisInline,\n\t\tisOpen: isOpenProp,\n\t\tlabel,\n\t\tlength = '5',\n\t\tlistItemRenderer,\n\t\tmenuPosition: menuPositionProp = 'absolute',\n\t\tmenuStyle,\n\t\tmultiple,\n\t\tnubbinPosition,\n\t\toffset,\n\t\tonBlur,\n\t\tonClick,\n\t\tonClose,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\tonOpen,\n\t\tonSelect,\n\t\topenOn = 'click',\n\t\toptions,\n\t\toverlay: overlayProp,\n\t\trequestFocus,\n\t\tonRequestFocus,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttooltip,\n\t\ttooltipMenuItem,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\twidth = 'medium',\n\t} = props;\n\n\tconst context = useContext(IconSettingsContext);\n\n\t// Generate stable IDs\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst getId = useCallback(() => id || generatedId, [id, generatedId]);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [focusedIndex, setFocusedIndex] = useState(-1);\n\tconst [selectedIndex, setSelectedIndex] = useState(-1);\n\tconst [selectedIndices, setSelectedIndices] = useState<number[]>([]);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLButtonElement | null>(null);\n\tconst triggerContainerRef = useRef<HTMLDivElement | null>(null);\n\tconst listRef = useRef<HTMLUListElement | null>(null);\n\tconst listItemsRef = useRef<Record<number, HTMLLIElement | null>>({});\n\tconst isHoverRef = useRef(false);\n\tconst isUnmountingRef = useRef(false);\n\tconst closingTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\n\t// Navigable items\n\tconst navigableItems = useMemo(() => getNavigableItems(options), [options]);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(MENU_DROPDOWN, props, componentDoc);\n\t}, [props]);\n\n\t// Calculate isOpen\n\tconst getIsOpen = useCallback((): boolean => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst isOpen = !disabled && getIsOpen() && triggerRendered;\n\n\t// Helper to get index by value\n\tconst getIndexByValue = useCallback(\n\t\t(val: string | number | undefined, opts?: MenuDropdownOption[]): number => {\n\t\t\tlet foundIndex = -1;\n\t\t\tif (opts && opts.length) {\n\t\t\t\topts.some((element, index) => {\n\t\t\t\t\tif (element && element.value === val) {\n\t\t\t\t\t\tfoundIndex = index;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn foundIndex;\n\t\t},\n\t\t[]\n\t);\n\n\t// Update selected indices when value changes\n\tuseEffect(() => {\n\t\tif (multiple) {\n\t\t\tlet values: (string | number)[] = [];\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\tvalues = [value];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalues = value;\n\t\t\t}\n\t\t\tvalues = values.filter((v) => getIndexByValue(v, options) !== -1);\n\t\t\tconst currentIndices = values.map((v) => getIndexByValue(v, options));\n\t\t\tsetSelectedIndices(currentIndices);\n\t\t} else {\n\t\t\tsetSelectedIndex(getIndexByValue(value as string | number, options));\n\t\t}\n\t}, [value, options, multiple, getIndexByValue]);\n\n\t// Menu position (for backwards compatibility)\n\tconst menuPosition = isInline ? 'relative' : menuPositionProp;\n\n\t// Get list item ID\n\tconst getListItemId = useCallback(\n\t\t(index?: number): string | undefined => {\n\t\t\tif (index !== undefined) {\n\t\t\t\treturn `${getId()}-item-${index}`;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\t[getId]\n\t);\n\n\t// Get list item renderer\n\tconst getListItemRenderer = useCallback(() => {\n\t\treturn listItemRenderer ? listItemRenderer : ListItemLabel;\n\t}, [listItemRenderer]);\n\n\t// Focus trigger\n\tconst setFocus = useCallback(() => {\n\t\tif (!isHoverRef.current && !isUnmountingRef.current && triggerRef.current) {\n\t\t\ttriggerRef.current.focus();\n\t\t}\n\t}, []);\n\n\t// Get menu element\n\tconst getMenu = useCallback((): HTMLUListElement | null => {\n\t\treturn listRef.current;\n\t}, []);\n\n\t// Get menu item element\n\tconst getMenuItem = useCallback((index: number): HTMLLIElement | null => {\n\t\tif (index !== undefined && listItemsRef.current) {\n\t\t\treturn listItemsRef.current[index] || null;\n\t\t}\n\t\treturn null;\n\t}, []);\n\n\t// Handle close\n\tconst handleCloseRef = useRef<(event?: MenuDropdownCloseEvent) => void>(\n\t\t() => {}\n\t);\n\n\t// Whether `onClose` has already fired for the current open cycle. The Dialog\n\t// calls its `onClose` again when it unmounts after a close (with a stale\n\t// `isOpen`), which would otherwise report every close twice.\n\tconst closeNotifiedRef = useRef(false);\n\n\tconst handleClose = useCallback(\n\t\t(event?: MenuDropdownCloseEvent) => {\n\t\t\tif (getIsOpen()) {\n\t\t\t\tif (currentOpenDropdown?.handleClose === handleCloseRef.current) {\n\t\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t\t}\n\t\t\t\tsetIsOpenState(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t\tcloseNotifiedRef.current = true;\n\t\t\t\tonClose?.(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, onClose]\n\t);\n\n\t// Dialog `onClose` fires for the Tab key and on Dialog unmount. Tab is\n\t// already handled by `handleKeyDown` (the Dialog forwards the keydown), so\n\t// only the unmount call is used, and only when this open cycle's close has\n\t// not been reported yet (e.g. MenuDropdown unmounting while open).\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent: MenuDropdownCloseEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tif (data?.componentWillUnmount && !closeNotifiedRef.current) {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Update the ref so we can compare in cleanup\n\thandleCloseRef.current = handleClose;\n\n\t// Handle open\n\tconst handleOpen = useCallback(\n\t\t(event?: MenuDropdownOpenEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\tif (\n\t\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\t\tisFunction(currentOpenDropdown.handleClose)\n\t\t\t\t) {\n\t\t\t\t\tcurrentOpenDropdown.handleClose(event);\n\t\t\t\t}\n\t\t\t\tcurrentOpenDropdown = { handleClose };\n\t\t\t\tsetIsOpenState(true);\n\t\t\t\tonOpen?.(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleClose, onOpen]\n\t);\n\n\t// Handle click outside - called via document event listener\n\tconst handleClickOutside = useCallback(\n\t\t(event: Event) => {\n\t\t\tconst target = event.target as Node;\n\t\t\tconst container = triggerContainerRef.current;\n\n\t\t\t// Check if click is outside the trigger container\n\t\t\tif (container && !container.contains(target)) {\n\t\t\t\t// Also check if it's in the dialog (for portal-rendered menus)\n\t\t\t\tconst outsideClickIgnoreClass = `ignore-click-${getId()}`;\n\t\t\t\tif (target instanceof Element) {\n\t\t\t\t\tif (target.classList?.contains(outsideClickIgnoreClass)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (target.closest(`.${outsideClickIgnoreClass}`)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (target.closest('.ignore-react-onclickoutside')) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t},\n\t\t[getId, handleClose]\n\t);\n\n\t// Set up click outside listener\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tdocument.addEventListener('mousedown', handleClickOutside);\n\t\t\tdocument.addEventListener('touchstart', handleClickOutside);\n\t\t}\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleClickOutside);\n\t\t\tdocument.removeEventListener('touchstart', handleClickOutside);\n\t\t};\n\t}, [isOpen, handleClickOutside]);\n\n\t// Toggle open\n\tconst toggleOpen = useCallback(\n\t\t(event?: KeyboardEvent) => {\n\t\t\tsetFocus();\n\t\t\tif (getIsOpen()) {\n\t\t\t\thandleClose(event);\n\t\t\t} else {\n\t\t\t\thandleOpen(event);\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleClose, handleOpen, setFocus]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\thandleOpen(event);\n\t\t\t\tsetFocus();\n\t\t\t} else {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\t[getIsOpen, handleOpen, handleClose, setFocus, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tonFocus?.(event);\n\t\t},\n\t\t[onFocus]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\t\t\tif (!getIsOpen() && openOn === 'hover') {\n\t\t\t\thandleOpen(event);\n\t\t\t} else {\n\t\t\t\tif (closingTimeoutRef.current) {\n\t\t\t\t\tclearTimeout(closingTimeoutRef.current);\n\t\t\t\t}\n\t\t\t}\n\t\t\tonMouseEnter?.(event);\n\t\t},\n\t\t[getIsOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (getIsOpen()) {\n\t\t\t\tclosingTimeoutRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose();\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\t\t\tonMouseLeave?.(event);\n\t\t},\n\t\t[getIsOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle select\n\t// `event` is the keydown from keyboard selection, or the click forwarded by\n\t// the menu-list item.\n\tconst handleSelect = useCallback(\n\t\t(index: number, event?: MouseEvent | KeyboardEvent) => {\n\t\t\tif (!multiple) {\n\t\t\t\tsetSelectedIndex(index);\n\t\t\t\thandleClose(event);\n\t\t\t\tsetFocus();\n\t\t\t} else if (selectedIndices.indexOf(index) === -1) {\n\t\t\t\tsetSelectedIndices((prev) => [...prev, index]);\n\t\t\t} else {\n\t\t\t\tsetSelectedIndices((prev) => prev.filter((i) => i !== index));\n\t\t\t}\n\n\t\t\tif (onSelect && options) {\n\t\t\t\tconst option = options[index];\n\t\t\t\tonSelect(event, { option, optionIndex: index });\n\t\t\t}\n\t\t},\n\t\t[multiple, selectedIndices, handleClose, setFocus, onSelect, options]\n\t);\n\n\t// Focus menu item\n\tconst focusMenuItem = useCallback((menuItem: HTMLLIElement) => {\n\t\tconst anchor = menuItem.getElementsByTagName('a')[0];\n\t\tif (anchor) {\n\t\t\tanchor.focus();\n\t\t}\n\t}, []);\n\n\t// Scroll to menu item\n\tconst scrollToMenuItem = useCallback(\n\t\t(menu: HTMLUListElement | null, menuItem: HTMLLIElement | null) => {\n\t\t\tif (menu && menuItem) {\n\t\t\t\tconst menuHeight = menu.offsetHeight;\n\t\t\t\tconst menuTop = menu.scrollTop;\n\t\t\t\tconst menuItemTop = menuItem.offsetTop - menu.offsetTop;\n\n\t\t\t\tif (menuItemTop < menuTop) {\n\t\t\t\t\tmenu.scrollTop = menuItemTop;\n\t\t\t\t} else {\n\t\t\t\t\tconst menuBottom = menuTop + menuHeight + menu.offsetTop;\n\t\t\t\t\tconst menuItemBottom =\n\t\t\t\t\t\tmenuItemTop + menuItem.offsetHeight + menu.offsetTop;\n\t\t\t\t\tif (menuItemBottom > menuBottom) {\n\t\t\t\t\t\tmenu.scrollTop = menuItemBottom - menuHeight - menu.offsetTop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// Handle keyboard focus\n\tconst handleKeyboardFocus = useCallback(\n\t\t(newFocusedIndex: number | undefined) => {\n\t\t\tif (focusedIndex !== newFocusedIndex && newFocusedIndex !== undefined) {\n\t\t\t\tsetFocusedIndex(newFocusedIndex);\n\t\t\t}\n\n\t\t\tconst menu = getMenu();\n\t\t\tconst menuItem = getMenuItem(newFocusedIndex ?? -1);\n\n\t\t\tif (menuItem) {\n\t\t\t\tfocusMenuItem(menuItem);\n\t\t\t\tscrollToMenuItem(menu, menuItem);\n\t\t\t}\n\t\t},\n\t\t[focusedIndex, getMenu, getMenuItem, focusMenuItem, scrollToMenuItem]\n\t);\n\n\t// Create a context object for keyboard navigation\n\tconst componentContext = useMemo(\n\t\t() => ({\n\t\t\ttrigger: triggerRef.current,\n\t\t\thandleClick: (event: Event) => {\n\t\t\t\thandleClick(event as unknown as MouseEvent);\n\t\t\t},\n\t\t}),\n\t\t[handleClick]\n\t);\n\n\t// Handle keyboard navigate\n\tconst handleKeyboardNavigate = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tisOpen: menuIsOpen = true,\n\t\t\tkeyCode,\n\t\t\tonFocus: focusCallback = handleKeyboardFocus,\n\t\t\tonSelect: selectCallback,\n\t\t\ttarget,\n\t\t\ttoggleOpen: toggleCallback = noop,\n\t\t}: {\n\t\t\tevent: KeyboardEvent;\n\t\t\tisOpen?: boolean;\n\t\t\tkeyCode: number;\n\t\t\tonFocus?: (index: number | undefined) => void;\n\t\t\tonSelect: (index: number) => void;\n\t\t\ttarget: EventTarget | null;\n\t\t\ttoggleOpen?: () => void;\n\t\t}) => {\n\t\t\tkeyboardNavigate({\n\t\t\t\tcomponentContext,\n\t\t\t\tcurrentFocusedIndex: focusedIndex,\n\t\t\t\tevent,\n\t\t\t\tisOpen: menuIsOpen,\n\t\t\t\tkey: (event as unknown as { key?: string }).key,\n\t\t\t\tkeyCode,\n\t\t\t\tnavigableItems,\n\t\t\t\tonFocus: focusCallback,\n\t\t\t\tonSelect: selectCallback,\n\t\t\t\ttarget,\n\t\t\t\ttoggleOpen: toggleCallback,\n\t\t\t});\n\t\t},\n\t\t[componentContext, focusedIndex, handleKeyboardFocus, navigableItems]\n\t);\n\n\t// Handle cancel\n\tconst handleCancel = useCallback(\n\t\t(event?: KeyboardEvent) => {\n\t\t\tsetFocus();\n\t\t\thandleClose(event);\n\t\t},\n\t\t[setFocus, handleClose]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode === KEYS.TAB) {\n\t\t\t\t\thandleCancel(event);\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.ENTER ||\n\t\t\t\t\tevent.keyCode === KEYS.SPACE ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN ||\n\t\t\t\t\tevent.keyCode === KEYS.UP ||\n\t\t\t\t\tevent.keyCode === KEYS.ESCAPE\n\t\t\t\t) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\thandleKeyboardNavigate({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen: getIsOpen(),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\tonSelect: (index: number) => handleSelect(index, event),\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\ttoggleOpen: () => toggleOpen(event),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonKeyDown?.(event);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thandleCancel,\n\t\t\thandleKeyboardNavigate,\n\t\t\tgetIsOpen,\n\t\t\thandleSelect,\n\t\t\ttoggleOpen,\n\t\t\tonKeyDown,\n\t\t]\n\t);\n\n\t// Handle click custom content. This closes the menu but is not an option\n\t// selection, so `onSelect` is not called (there is no option to report).\n\tconst handleClickCustomContent = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tsetFocus();\n\t\t\thandleClose(event);\n\t\t},\n\t\t[setFocus, handleClose]\n\t);\n\n\t// Save ref to trigger\n\tconst saveRefToTrigger = useCallback(\n\t\t(trigger: HTMLButtonElement | null) => {\n\t\t\ttriggerRef.current = trigger;\n\t\t\tif (!triggerRendered && trigger) {\n\t\t\t\tsetTriggerRendered(true);\n\t\t\t}\n\t\t\tif (trigger && requestFocus && onRequestFocus) {\n\t\t\t\tonRequestFocus(trigger);\n\t\t\t}\n\t\t},\n\t\t[triggerRendered, requestFocus, onRequestFocus]\n\t);\n\n\t// Save ref to trigger container\n\tconst saveRefToTriggerContainer = useCallback(\n\t\t(container: HTMLDivElement | null) => {\n\t\t\ttriggerContainerRef.current = container;\n\t\t\tif (!triggerRef.current) {\n\t\t\t\ttriggerRef.current = container?.querySelector('button') || null;\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// Save ref to list\n\tconst saveRefToList = useCallback((list: HTMLUListElement | null) => {\n\t\tlistRef.current = list;\n\t}, []);\n\n\t// Save ref to list item\n\tconst saveRefToListItem = useCallback(\n\t\t(listItem: HTMLLIElement | null, index: number) => {\n\t\t\tlistItemsRef.current[index] = listItem;\n\t\t\tif (index === focusedIndex && listItem) {\n\t\t\t\thandleKeyboardFocus(focusedIndex);\n\t\t\t}\n\t\t},\n\t\t[focusedIndex, handleKeyboardFocus]\n\t);\n\n\t// Render overlay\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (isFunction(overlayProp) && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (\n\t\t\t\toverlayProp &&\n\t\t\t\tshouldShow &&\n\t\t\t\t!overlayRef.current &&\n\t\t\t\tdocumentDefined\n\t\t\t) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Effect for overlay\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// A new open cycle starts whenever the menu is shown.\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tcloseNotifiedRef.current = false;\n\t\t}\n\t}, [isOpen]);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenDropdown?.handleClose === handleCloseRef.current) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t\tif (closingTimeoutRef.current) {\n\t\t\t\tclearTimeout(closingTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, [renderOverlay]);\n\n\t// Render default menu content\n\tconst renderDefaultMenuContent = useCallback(\n\t\t(customListProps?: Record<string, unknown>) => (\n\t\t\t<List\n\t\t\t\tkey={`${getId()}-dropdown-list`}\n\t\t\t\tcheckmark={checkmark}\n\t\t\t\tgetListItemId={getListItemId}\n\t\t\t\titemRefs={saveRefToListItem}\n\t\t\t\titemRenderer={getListItemRenderer()}\n\t\t\t\tonCancel={handleCancel}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t\toptions={options}\n\t\t\t\tref={saveRefToList}\n\t\t\t\tselectedIndex={!multiple ? selectedIndex : undefined}\n\t\t\t\tselectedIndices={multiple ? selectedIndices : undefined}\n\t\t\t\ttooltipMenuItem={tooltipMenuItem}\n\t\t\t\ttriggerId={getId()}\n\t\t\t\tlength={length}\n\t\t\t\t{...customListProps}\n\t\t\t/>\n\t\t),\n\t\t[\n\t\t\tgetId,\n\t\t\tcheckmark,\n\t\t\tgetListItemId,\n\t\t\tsaveRefToListItem,\n\t\t\tgetListItemRenderer,\n\t\t\thandleCancel,\n\t\t\thandleSelect,\n\t\t\toptions,\n\t\t\tsaveRefToList,\n\t\t\tmultiple,\n\t\t\tselectedIndex,\n\t\t\tselectedIndices,\n\t\t\ttooltipMenuItem,\n\t\t\tlength,\n\t\t]\n\t);\n\n\t// Render menu content\n\tconst renderMenuContent = useCallback(\n\t\t(customContent: ReactNode[] | null) => {\n\t\t\tconst customContentWithListPropInjection: ReactNode[] = [];\n\n\t\t\tif (customContent) {\n\t\t\t\tReact.Children.forEach(customContent, (child) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tchild &&\n\t\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t\t'type' in child &&\n\t\t\t\t\t\t(child.type as { displayName?: string })?.displayName === LIST\n\t\t\t\t\t) {\n\t\t\t\t\t\tcustomContentWithListPropInjection.push(\n\t\t\t\t\t\t\trenderDefaultMenuContent(\n\t\t\t\t\t\t\t\t(child as ReactElement).props as Record<string, unknown>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (child) {\n\t\t\t\t\t\tconst clonedCustomContent = React.cloneElement(\n\t\t\t\t\t\t\tchild as ReactElement<{\n\t\t\t\t\t\t\t\tonClick?: (event?: React.SyntheticEvent) => void;\n\t\t\t\t\t\t\t\tkey?: string;\n\t\t\t\t\t\t\t}>,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonClick: handleClickCustomContent,\n\t\t\t\t\t\t\t\tkey: generateId(),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcustomContentWithListPropInjection.push(clonedCustomContent);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn customContentWithListPropInjection.length > 0\n\t\t\t\t? customContentWithListPropInjection\n\t\t\t\t: renderDefaultMenuContent();\n\t\t},\n\t\t[renderDefaultMenuContent, handleClickCustomContent]\n\t);\n\n\t// Render dialog\n\tconst renderDialog = useCallback(\n\t\t(\n\t\t\tcustomContent: ReactNode[] | null,\n\t\t\tshouldShow: boolean,\n\t\t\toutsideClickIgnoreClass: string\n\t\t) => {\n\t\t\tlet dialogAlign = 'bottom';\n\t\t\tlet hasNubbin = false;\n\t\t\tlet positionClassName = '';\n\n\t\t\tif (nubbinPosition) {\n\t\t\t\thasNubbin = true;\n\t\t\t\tdialogAlign = DropdownToDialogNubbinMapping[nubbinPosition];\n\t\t\t} else if (align) {\n\t\t\t\tdialogAlign = align === 'center' ? 'bottom' : `bottom ${align}`;\n\t\t\t}\n\n\t\t\tconst positions =\n\t\t\t\tDropdownToDialogNubbinMapping[dialogAlign]?.split(' ') || [];\n\t\t\tpositionClassName = classNames(\n\t\t\t\tpositions.map((position) => `slds-dropdown_${position}`)\n\t\t\t);\n\n\t\t\tconst menuStylesBase: React.CSSProperties = {};\n\t\t\tif (align === 'center' && !hasNubbin) {\n\t\t\t\tmenuStylesBase.transform = 'none';\n\t\t\t}\n\n\t\t\treturn shouldShow ? (\n\t\t\t\t<Dialog\n\t\t\t\t\talign={\n\t\t\t\t\t\tdialogAlign as\n\t\t\t\t\t\t\t| 'top'\n\t\t\t\t\t\t\t| 'top left'\n\t\t\t\t\t\t\t| 'top right'\n\t\t\t\t\t\t\t| 'bottom'\n\t\t\t\t\t\t\t| 'bottom left'\n\t\t\t\t\t\t\t| 'bottom right'\n\t\t\t\t\t}\n\t\t\t\t\tclassName={classNames(containerClassName)}\n\t\t\t\t\tcloseOnTabKey\n\t\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t\t'slds-dropdown',\n\t\t\t\t\t\t`slds-dropdown_${width}`,\n\t\t\t\t\t\t'slds-text-align_left',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tpositionClassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-dropdown_inverse': inverse,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tcontext={context}\n\t\t\t\t\thasNubbin={hasNubbin}\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tinheritWidthOf={inheritTargetWidth ? 'target' : 'none'}\n\t\t\t\t\toffset={offset}\n\t\t\t\t\tonClose={handleDialogClose}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t...menuStylesBase,\n\t\t\t\t\t\t...menuStyle,\n\t\t\t\t\t}}\n\t\t\t\t\tonRequestTargetElement={() => triggerRef.current}\n\t\t\t\t>\n\t\t\t\t\t{renderMenuContent(customContent)}\n\t\t\t\t</Dialog>\n\t\t\t) : null;\n\t\t},\n\t\t[\n\t\t\tnubbinPosition,\n\t\t\talign,\n\t\t\tcontainerClassName,\n\t\t\tclassName,\n\t\t\tinverse,\n\t\t\tcontext,\n\t\t\thasStaticAlignment,\n\t\t\tinheritTargetWidth,\n\t\t\toffset,\n\t\t\thandleDialogClose,\n\t\t\thandleKeyDown,\n\t\t\tmenuPosition,\n\t\t\tmenuStyle,\n\t\t\twidth,\n\t\t\trenderMenuContent,\n\t\t]\n\t);\n\n\t// Find custom trigger and content from children\n\tlet CurrentTrigger: React.ElementType = DefaultTrigger;\n\tlet CustomTriggerChildProps: Record<string, unknown> = {};\n\tconst customContent: ReactNode[] = [];\n\n\tReact.Children.forEach(children, (child) => {\n\t\tif (\n\t\t\tchild &&\n\t\t\ttypeof child === 'object' &&\n\t\t\t'type' in child &&\n\t\t\t(child.type as { displayName?: string })?.displayName ===\n\t\t\t\tMENU_DROPDOWN_TRIGGER\n\t\t) {\n\t\t\tCustomTriggerChildProps = (child as ReactElement).props as Record<\n\t\t\t\tstring,\n\t\t\t\tunknown\n\t\t\t>;\n\t\t\tCurrentTrigger = (child as ReactElement).type as React.ElementType;\n\t\t} else if (child) {\n\t\t\tcustomContent.push(child);\n\t\t}\n\t});\n\n\tconst outsideClickIgnoreClass = `ignore-click-${getId()}`;\n\n\t// `bare-inverse` and `border-inverse` are the inverse forms of `bare` and `border`\n\tconst isInverseIconVariant =\n\t\ticonVariant === 'bare-inverse' || iconVariant === 'border-inverse';\n\tconst triggerIconVariant =\n\t\ticonVariant === 'bare-inverse'\n\t\t\t? 'bare'\n\t\t\t: iconVariant === 'border-inverse'\n\t\t\t\t? 'border'\n\t\t\t\t: iconVariant;\n\n\treturn (\n\t\t<CurrentTrigger\n\t\t\tref={saveRefToTriggerContainer}\n\t\t\taria-haspopup\n\t\t\tassistiveText={assistiveText}\n\t\t\tclassName={classNames(outsideClickIgnoreClass, buttonClassName)}\n\t\t\tdisabled={disabled}\n\t\t\thint={hint}\n\t\t\ticonCategory={iconCategory}\n\t\t\ticonName={iconName}\n\t\t\ticonPosition={iconPosition}\n\t\t\ticonSize={iconSize}\n\t\t\ticonVariant={triggerIconVariant}\n\t\t\tid={getId()}\n\t\t\tinverse={buttonInverse || isInverseIconVariant}\n\t\t\tisOpen={isOpen}\n\t\t\tlabel={label}\n\t\t\tmenu={renderDialog(\n\t\t\t\tcustomContent.length > 0 ? customContent : null,\n\t\t\t\tisOpen,\n\t\t\t\toutsideClickIgnoreClass\n\t\t\t)}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={\n\t\t\t\topenOn === 'click' || openOn === 'hybrid' ? handleClick : onClick\n\t\t\t}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={\n\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseEnter : undefined\n\t\t\t}\n\t\t\tonMouseLeave={\n\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseLeave : undefined\n\t\t\t}\n\t\t\topenOn={openOn}\n\t\t\tstyle={style}\n\t\t\ttabIndex={tabIndex || (isOpen ? '-1' : '0')}\n\t\t\ttooltip={tooltip}\n\t\t\ttriggerClassName={triggerClassName}\n\t\t\ttriggerRef={saveRefToTrigger}\n\t\t\tvariant={buttonVariant}\n\t\t\t{...CustomTriggerChildProps}\n\t\t/>\n\t);\n};\n\nMenuDropdown.displayName = MENU_DROPDOWN;\n\nexport default MenuDropdown;\nexport { ListItem, ListItemLabel };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,IAAM,KAAO,GAsBP,IAAkB,OAAO,WAAa,KAKtC,IAAU,IACb,SAAS,cAAc,MAAM,IAC5B,EAAE,OAAO,CAAC,EAAE;AAEZ,MACH,EAAQ,MAAM,MAAM,KACpB,EAAQ,MAAM,OAAO,KACrB,EAAQ,MAAM,QAAQ,QACtB,EAAQ,MAAM,SAAS,QACvB,EAAQ,MAAM,WAAW;AAI1B,IAAI,GAeS,KACZ;CAZA;CACA;CACA;CACA;CACA;CACA;AAOA,GAEK,WAAa,CAAC,GA8Od,MAAoB,MACzB,EAAK,SAAS,YAAY,EAAK,SAAS,aAAa,CAAC,EAAK,UAEtD,MAAqB,MAAiD;CAC3E,IAAM,IAAi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D;EACP,MAAM,GACL,EAAc,SAAS,IAAI,IAAgB,MAC3C,GACA,EACD;EACQ;EACR,SACC,MAAW,WAAW,MAAW,WAAW,KAAc;EAE3D,SAAS;EACT,WAAW;EACE;EACb,cACC,MAAW,WAAW,MAAW,WAAW,KAAmB,KAAA;EAEhE,cACC,MAAW,WAAW,MAAW,WAAW,KAAmB,KAAA;EAExD;EACD;EACP,UAAU,OAAa,IAAS,OAAO;EAC9B;EACS;EAClB,YAAY;EACZ,SAAS;EACT,GAAI;CACJ,CAAA;AAEH;AAEA,EAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"menu-dropdown.js","names":[],"sources":["../../../../components/menu-dropdown/menu-dropdown.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// Implements the [Dropdown design pattern](https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown) in React.\n\nimport React, {\n\tuseState,\n\tuseRef,\n\tuseCallback,\n\tuseEffect,\n\tuseContext,\n\tuseMemo,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\n// Children\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - Legacy JS module\nimport Dialog from '../utilities/dialog';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - Legacy JS module\nimport BaseList from '../utilities/menu-list';\nimport ListItem from '../utilities/menu-list/item';\nimport ListItemLabel, {\n\ttype ListItemLabelProps,\n} from '../utilities/menu-list/item-label';\n\n// The menu-list `List` accepts additional legacy consumer props (`onCancel`) and\n// is passed a callback `ref` typed against the DOM element by historical callers.\n// Alias to a permissive type here rather than widen the public MenuListProps.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst List = BaseList as unknown as React.ComponentType<any>;\n\n// This is the default Dropdown Trigger, which expects one button as a child.\nimport DefaultTrigger from './button-trigger';\n\n// This component's `checkProps` which issues warnings to developers about properties\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport EventUtil from '../../utilities/event';\nimport generateId from '../../utilities/generate-id';\nimport keyboardNavigate from '../../utilities/keyboard-navigate';\nimport KeyBuffer from '../../utilities/key-buffer';\nimport KEYS from '../../utilities/key-code';\nimport {\n\tMENU_DROPDOWN,\n\tMENU_DROPDOWN_TRIGGER,\n\tLIST,\n} from '../../utilities/constants';\nimport { IconSettingsContext } from '../icon-settings';\nimport type { IconCategory } from '../../types/common';\n\nconst documentDefined = typeof document !== 'undefined';\n\n// The overlay is an optional way to allow the dropdown to close on outside\n// clicks even when those clicks are over areas that wouldn't normally fire\n// click or touch events (for example, iframes).\nconst overlay = documentDefined\n\t? document.createElement('span')\n\t: ({ style: {} } as HTMLSpanElement);\n\nif (documentDefined) {\n\toverlay.style.top = '0';\n\toverlay.style.left = '0';\n\toverlay.style.width = '100%';\n\toverlay.style.height = '100%';\n\toverlay.style.position = 'absolute';\n}\n\n// Global state for tracking open dropdown\nlet currentOpenDropdown:\n\t{ handleClose: (event?: MenuDropdownCloseEvent) => void } | undefined;\n\nconst DropdownNubbinPositionsArray = [\n\t'top left',\n\t'top',\n\t'top right',\n\t'bottom left',\n\t'bottom',\n\t'bottom right',\n] as const;\n\nexport type DropdownNubbinPosition =\n\t(typeof DropdownNubbinPositionsArray)[number];\n\nexport const DropdownNubbinPositions: readonly DropdownNubbinPosition[] =\n\tDropdownNubbinPositionsArray;\n\nconst noop = () => {};\n\nexport interface MenuDropdownOptionIcon {\n\tname: string;\n\tcategory: IconCategory;\n}\n\n/** A selectable menu item. `type` may be omitted. */\nexport interface MenuDropdownItemOption {\n\ttype?: 'item';\n\tclassName?: string;\n\tdisabled?: boolean;\n\tdivider?: never;\n\thref?: string;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: MenuDropdownOptionIcon;\n\trightIcon?: MenuDropdownOptionIcon;\n\ttooltipContent?: string;\n\tvalue?: string | number;\n}\n\n/** A non-selectable group heading */\nexport interface MenuDropdownHeaderOption {\n\ttype: 'header';\n\tclassName?: string;\n\tdisabled?: never;\n\t/** Adds a divider above or below the heading */\n\tdivider?: 'top' | 'bottom';\n\thref?: never;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: never;\n\trightIcon?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\n/** A separator line between items */\nexport interface MenuDropdownDividerOption {\n\ttype: 'divider';\n\tclassName?: string;\n\tdisabled?: never;\n\tdivider?: never;\n\thref?: never;\n\tid?: string;\n\tlabel?: never;\n\tleftIcon?: never;\n\trightIcon?: never;\n\ttooltipContent?: never;\n\tvalue?: never;\n}\n\nexport type MenuDropdownOption =\n\tMenuDropdownItemOption | MenuDropdownHeaderOption | MenuDropdownDividerOption;\n\n/**\n * Data passed as the second argument of `onSelect`.\n */\nexport interface MenuDropdownSelectData {\n\t/** The selected item object from `options`. */\n\toption: MenuDropdownOption;\n\t/** Index of the selected item within `options`. */\n\toptionIndex: number;\n}\n\n/**\n * Data passed to `renderMenuItem`.\n */\nexport interface MenuDropdownRenderMenuItemData {\n\t/** The item's left icon, or the checkmark when `checkmark` is set. Render it to keep the default layout. */\n\ticon: ReactNode;\n\t/** Whether the item is selected (`value`). */\n\tisSelected: boolean;\n\t/** The item object from `options`. */\n\toption: MenuDropdownOption;\n\t/** Index of the item within `options`. */\n\toptionIndex: number;\n}\n\n/**\n * Data passed as the second argument of `onOpen`. Currently has no fields; it\n * is an object so fields can be added without changing the callback shape.\n */\nexport type MenuDropdownOpenData = Record<string, never>;\n\n/**\n * Data passed as the second argument of `onClose`. Currently has no fields; it\n * is an object so fields can be added without changing the callback shape.\n */\nexport type MenuDropdownCloseData = Record<string, never>;\n\n/**\n * Event passed to `onOpen`: the trigger click, hover (`mouseenter`) or keydown\n * that opened the menu.\n */\nexport type MenuDropdownOpenEvent = MouseEvent | KeyboardEvent | undefined;\n\n/**\n * Event passed to `onClose`: the React event that closed the menu, the native\n * DOM `mousedown`/`touchstart` event for an outside click, or `undefined` when\n * there is no event (hover-close timeout, unmount).\n */\nexport type MenuDropdownCloseEvent = React.SyntheticEvent | Event | undefined;\n\nexport interface MenuDropdownProps {\n\t/** Aligns the menu center, right, or left respective to the trigger */\n\talign?: 'center' | 'left' | 'right';\n\t/** Text that is visually hidden but read aloud by screenreaders */\n\tassistiveText?: Record<string, unknown>;\n\t/** CSS classes to be added to triggering button */\n\tbuttonClassName?: string | string[] | Record<string, boolean>;\n\t/** If true, button/icon is white. Meant for buttons on dark backgrounds */\n\tbuttonInverse?: boolean;\n\t/** Determines variant of the Button component that triggers dropdown */\n\tbuttonVariant?: 'base' | 'neutral' | 'brand' | 'destructive' | 'icon';\n\t/** If true, renders checkmark icon on the selected Menu Item */\n\tcheckmark?: boolean;\n\t/** Custom content to render in the dropdown */\n\tchildren?: ReactNode;\n\t/** CSS classes to be added to dropdown menu */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Class names added to the Dialog component */\n\tcontainerClassName?: string | string[] | Record<string, boolean>;\n\t/** Prevent dropdown menu from opening */\n\tdisabled?: boolean;\n\t/** Prevents the dropdown from changing position based on the viewport */\n\thasStaticAlignment?: boolean;\n\t/** Associates an icon button with another element on the page */\n\thint?: boolean;\n\t/** Delay on menu closing in milliseconds */\n\thoverCloseDelay?: number;\n\t/** Name of the icon category */\n\ticonCategory?: 'action' | 'custom' | 'doctype' | 'standard' | 'utility';\n\t/** Name of the icon */\n\ticonName?: string;\n\t/** Icon position relative to label */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * Icon variant. `bare-inverse` and `border-inverse` match `lightning-button-menu`'s variants and are\n\t * equivalent to `bare` or `border` with `buttonInverse`. Meant for icon buttons on dark backgrounds.\n\t */\n\ticonVariant?:\n\t\t| 'bare'\n\t\t| 'bare-inverse'\n\t\t| 'container'\n\t\t| 'border'\n\t\t| 'border-filled'\n\t\t| 'border-inverse'\n\t\t| 'small'\n\t\t| 'more';\n\t/** Determines the size of the icon. `xx-small` requires an `iconVariant`. */\n\ticonSize?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\t/** A unique ID for keyboard navigation and ARIA support */\n\tid?: string;\n\t/** Whether to inherit target width */\n\tinheritTargetWidth?: boolean;\n\t/** Adds inverse class to the dropdown */\n\tinverse?: boolean;\n\t/** @deprecated Use menuPosition=\"relative\" instead */\n\tisInline?: boolean;\n\t/** Forces the dropdown to be open or closed */\n\tisOpen?: boolean;\n\t/** Text within the trigger button */\n\tlabel?: string | ReactNode;\n\t/**\n\t * @deprecated Use `renderMenuItem` instead, which is called as a function with `{ icon, isSelected, option, optionIndex }`.\n\t */\n\tlistItemRenderer?: (props: Record<string, unknown>) => ReactNode;\n\t/** Menu list length */\n\tlength?: null | '5' | '7' | '10' | 5 | 7 | 10;\n\t/** Position strategy for the menu */\n\tmenuPosition?: 'absolute' | 'overflowBoundaryElement' | 'relative';\n\t/** Style applied to menu element */\n\tmenuStyle?: React.CSSProperties;\n\t/** Whether this dropdown supports multi select */\n\tmultiple?: boolean;\n\t/** Positions dropdown menu with a nubbin */\n\tnubbinPosition?: DropdownNubbinPosition;\n\t/** @deprecated */\n\toffset?: string;\n\t/** Called when the triggering button loses focus */\n\tonBlur?: (event: FocusEvent) => void;\n\t/** Triggered when the trigger button is clicked */\n\tonClick?: (event: MouseEvent) => void;\n\t/**\n\t * Triggered when the dropdown is closed. Receives the event that closed it\n\t * (see `MenuDropdownCloseEvent`; `undefined` for the hover-close timeout and\n\t * unmount) and a `MenuDropdownCloseData` object.\n\t */\n\tonClose?: (\n\t\tevent: MenuDropdownCloseEvent,\n\t\tdata: MenuDropdownCloseData\n\t) => void;\n\t/** Called when the triggering button gains focus */\n\tonFocus?: (event: FocusEvent) => void;\n\t/** Called when a key is pressed */\n\tonKeyDown?: (event: KeyboardEvent) => void;\n\t/** Called when mouse clicks down on the trigger button */\n\tonMouseDown?: (event: MouseEvent) => void;\n\t/** Called when mouse hovers over the trigger button */\n\tonMouseEnter?: (event: MouseEvent) => void;\n\t/** Called when mouse hover leaves the trigger button */\n\tonMouseLeave?: (event: MouseEvent) => void;\n\t/**\n\t * Triggered when the dropdown is opened. Receives the click, `mouseenter` or\n\t * keydown event that opened it and a `MenuDropdownOpenData` object.\n\t */\n\tonOpen?: (event: MenuDropdownOpenEvent, data: MenuDropdownOpenData) => void;\n\t/**\n\t * Triggered when an item in the menu is selected by mouse or keyboard.\n\t * Receives the triggering event and `{ option, optionIndex }`. Clicking\n\t * custom (non-`List`) content does not call `onSelect`; use `onClose`.\n\t */\n\tonSelect?: (\n\t\tevent: MouseEvent | KeyboardEvent | undefined,\n\t\tdata: MenuDropdownSelectData\n\t) => void;\n\t/** Determines if mouse hover or click opens the dropdown menu */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/** An array of menu item objects */\n\toptions?: MenuDropdownOption[];\n\t/** If true, adds a transparent overlay when menu is open */\n\toverlay?: boolean | ((isOpen: boolean, overlayEl: HTMLSpanElement) => void);\n\t/**\n\t * Renders the contents of each menu item in place of the default label. Receives `{ icon, isSelected, option, optionIndex }`; render `icon` to keep the left icon or checkmark.\n\t */\n\trenderMenuItem?: (data: MenuDropdownRenderMenuItemData) => ReactNode;\n\t/** An object of CSS styles for the triggering button */\n\tstyle?: React.CSSProperties;\n\t/** Write \"-1\" if you don't want the user to tab to the button */\n\ttabIndex?: string;\n\t/** Tooltip for the trigger button */\n\ttooltip?: ReactNode;\n\t/** Tooltip component template for menu items */\n\ttooltipMenuItem?: ReactNode;\n\t/** CSS classes to be added to wrapping trigger div */\n\ttriggerClassName?: string | string[] | Record<string, boolean>;\n\t/** Current selected menu item */\n\tvalue?: number | string | (number | string)[];\n\t/** Width of the menu dropdown */\n\twidth?: 'xx-small' | 'x-small' | 'small' | 'medium' | 'bottom' | 'large';\n\t/** Internal: Used for requesting focus */\n\trequestFocus?: boolean;\n\t/** Internal: Callback for focus request */\n\tonRequestFocus?: (trigger: HTMLElement) => void;\n}\n\ninterface NavigableItem {\n\tindex: number;\n\ttext: string;\n}\n\ninterface NavigableItems extends Array<NavigableItem> {\n\tindexes: number[];\n\tkeyBuffer: ReturnType<typeof KeyBuffer>;\n}\n\nconst itemIsSelectable = (item: MenuDropdownOption): boolean =>\n\titem.type !== 'header' && item.type !== 'divider' && !item.disabled;\n\nconst getNavigableItems = (items?: MenuDropdownOption[]): NavigableItems => {\n\tconst navigableItems: NavigableItems = [] as unknown as NavigableItems;\n\tnavigableItems.indexes = [];\n\tnavigableItems.keyBuffer = new KeyBuffer();\n\n\tif (Array.isArray(items)) {\n\t\titems.forEach((item, index) => {\n\t\t\tif (itemIsSelectable(item)) {\n\t\t\t\tnavigableItems.push({\n\t\t\t\t\tindex,\n\t\t\t\t\ttext: `${item.label}`.toLowerCase(),\n\t\t\t\t});\n\t\t\t\tnavigableItems.indexes.push(index);\n\t\t\t}\n\t\t});\n\t}\n\n\treturn navigableItems;\n};\n\n// Nubbin position mapping\nconst DropdownToDialogNubbinMapping: Record<string, string> = {\n\ttop: 'bottom',\n\t'top left': 'bottom left',\n\t'top right': 'bottom right',\n\tbottom: 'top',\n\t'bottom left': 'top left',\n\t'bottom right': 'top right',\n};\n\n/**\n * The MenuDropdown component is a variant of the Lightning Design System Menu component.\n * This is a React 19 compatible functional component that replaces the deprecated\n * react-onclickoutside HOC with a custom click outside handler.\n */\nconst MenuDropdown: React.FC<MenuDropdownProps> & {\n\tdisplayName: string;\n} = (props) => {\n\tconst {\n\t\talign = 'left',\n\t\tassistiveText,\n\t\tbuttonClassName,\n\t\tbuttonInverse,\n\t\tbuttonVariant,\n\t\tcheckmark,\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\tdisabled,\n\t\thasStaticAlignment,\n\t\thint,\n\t\thoverCloseDelay = 300,\n\t\ticonCategory,\n\t\ticonName,\n\t\ticonPosition,\n\t\ticonSize,\n\t\ticonVariant,\n\t\tid,\n\t\tinheritTargetWidth,\n\t\tinverse = false,\n\t\tisInline,\n\t\tisOpen: isOpenProp,\n\t\tlabel,\n\t\tlength = '5',\n\t\tlistItemRenderer,\n\t\trenderMenuItem,\n\t\tmenuPosition: menuPositionProp = 'absolute',\n\t\tmenuStyle,\n\t\tmultiple,\n\t\tnubbinPosition,\n\t\toffset,\n\t\tonBlur,\n\t\tonClick,\n\t\tonClose,\n\t\tonFocus,\n\t\tonKeyDown,\n\t\tonMouseDown,\n\t\tonMouseEnter,\n\t\tonMouseLeave,\n\t\tonOpen,\n\t\tonSelect,\n\t\topenOn = 'click',\n\t\toptions,\n\t\toverlay: overlayProp,\n\t\trequestFocus,\n\t\tonRequestFocus,\n\t\tstyle,\n\t\ttabIndex,\n\t\ttooltip,\n\t\ttooltipMenuItem,\n\t\ttriggerClassName,\n\t\tvalue,\n\t\twidth = 'medium',\n\t} = props;\n\n\tconst context = useContext(IconSettingsContext);\n\n\t// Generate stable IDs\n\tconst generatedId = useMemo(() => generateId(), []);\n\tconst getId = useCallback(() => id || generatedId, [id, generatedId]);\n\n\t// State\n\tconst [isOpenState, setIsOpenState] = useState(false);\n\tconst [focusedIndex, setFocusedIndex] = useState(-1);\n\tconst [selectedIndex, setSelectedIndex] = useState(-1);\n\tconst [selectedIndices, setSelectedIndices] = useState<number[]>([]);\n\tconst [triggerRendered, setTriggerRendered] = useState(false);\n\n\t// Refs\n\tconst triggerRef = useRef<HTMLButtonElement | null>(null);\n\tconst triggerContainerRef = useRef<HTMLDivElement | null>(null);\n\tconst listRef = useRef<HTMLUListElement | null>(null);\n\tconst listItemsRef = useRef<Record<number, HTMLLIElement | null>>({});\n\tconst isHoverRef = useRef(false);\n\tconst isUnmountingRef = useRef(false);\n\tconst closingTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\tconst overlayRef = useRef<HTMLSpanElement | null>(null);\n\n\t// Navigable items\n\tconst navigableItems = useMemo(() => getNavigableItems(options), [options]);\n\n\t// Check props in development\n\tuseEffect(() => {\n\t\tcheckProps(MENU_DROPDOWN, props, componentDoc);\n\t}, [props]);\n\n\t// Calculate isOpen\n\tconst getIsOpen = useCallback((): boolean => {\n\t\treturn !!(typeof isOpenProp === 'boolean' ? isOpenProp : isOpenState);\n\t}, [isOpenProp, isOpenState]);\n\n\tconst isOpen = !disabled && getIsOpen() && triggerRendered;\n\n\t// Helper to get index by value\n\tconst getIndexByValue = useCallback(\n\t\t(val: string | number | undefined, opts?: MenuDropdownOption[]): number => {\n\t\t\tlet foundIndex = -1;\n\t\t\tif (opts && opts.length) {\n\t\t\t\topts.some((element, index) => {\n\t\t\t\t\tif (element && element.value === val) {\n\t\t\t\t\t\tfoundIndex = index;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn foundIndex;\n\t\t},\n\t\t[]\n\t);\n\n\t// Update selected indices when value changes\n\tuseEffect(() => {\n\t\tif (multiple) {\n\t\t\tlet values: (string | number)[] = [];\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tif (value !== undefined) {\n\t\t\t\t\tvalues = [value];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalues = value;\n\t\t\t}\n\t\t\tvalues = values.filter((v) => getIndexByValue(v, options) !== -1);\n\t\t\tconst currentIndices = values.map((v) => getIndexByValue(v, options));\n\t\t\tsetSelectedIndices(currentIndices);\n\t\t} else {\n\t\t\tsetSelectedIndex(getIndexByValue(value as string | number, options));\n\t\t}\n\t}, [value, options, multiple, getIndexByValue]);\n\n\t// Menu position (for backwards compatibility)\n\tconst menuPosition = isInline ? 'relative' : menuPositionProp;\n\n\t// Get list item ID\n\tconst getListItemId = useCallback(\n\t\t(index?: number): string | undefined => {\n\t\t\tif (index !== undefined) {\n\t\t\t\treturn `${getId()}-item-${index}`;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\t[getId]\n\t);\n\n\t// Get list item renderer\n\tconst getListItemRenderer = useCallback(() => {\n\t\treturn listItemRenderer ? listItemRenderer : ListItemLabel;\n\t}, [listItemRenderer]);\n\n\tconst renderItemLabel = useMemo(\n\t\t() =>\n\t\t\trenderMenuItem\n\t\t\t\t? ({ data, icon, index, isSelected }: ListItemLabelProps) =>\n\t\t\t\t\t\trenderMenuItem({\n\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t\tisSelected: Boolean(isSelected),\n\t\t\t\t\t\t\toption: data as MenuDropdownOption,\n\t\t\t\t\t\t\toptionIndex: index ?? 0,\n\t\t\t\t\t\t})\n\t\t\t\t: undefined,\n\t\t[renderMenuItem]\n\t);\n\n\t// Focus trigger\n\tconst setFocus = useCallback(() => {\n\t\tif (!isHoverRef.current && !isUnmountingRef.current && triggerRef.current) {\n\t\t\ttriggerRef.current.focus();\n\t\t}\n\t}, []);\n\n\t// Get menu element\n\tconst getMenu = useCallback((): HTMLUListElement | null => {\n\t\treturn listRef.current;\n\t}, []);\n\n\t// Get menu item element\n\tconst getMenuItem = useCallback((index: number): HTMLLIElement | null => {\n\t\tif (index !== undefined && listItemsRef.current) {\n\t\t\treturn listItemsRef.current[index] || null;\n\t\t}\n\t\treturn null;\n\t}, []);\n\n\t// Handle close\n\tconst handleCloseRef = useRef<(event?: MenuDropdownCloseEvent) => void>(\n\t\t() => {}\n\t);\n\n\t// Stable entry stored in `currentOpenDropdown`. It always calls the latest\n\t// `handleClose`, so another dropdown can still close this one after\n\t// re-renders have replaced the callback.\n\tconst openDropdownEntryRef = useRef({\n\t\thandleClose: (event?: MenuDropdownCloseEvent) =>\n\t\t\thandleCloseRef.current(event),\n\t});\n\n\t// Whether `onClose` has already fired for the current open cycle. The Dialog\n\t// calls its `onClose` again when it unmounts after a close (with a stale\n\t// `isOpen`), which would otherwise report every close twice.\n\tconst closeNotifiedRef = useRef(false);\n\n\tconst handleClose = useCallback(\n\t\t(event?: MenuDropdownCloseEvent) => {\n\t\t\tif (getIsOpen()) {\n\t\t\t\tif (currentOpenDropdown === openDropdownEntryRef.current) {\n\t\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t\t}\n\t\t\t\tsetIsOpenState(false);\n\t\t\t\tisHoverRef.current = false;\n\t\t\t\tcloseNotifiedRef.current = true;\n\t\t\t\tonClose?.(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, onClose]\n\t);\n\n\t// Dialog `onClose` fires for the Tab key and on Dialog unmount. Tab is\n\t// already handled by `handleKeyDown` (the Dialog forwards the keydown), so\n\t// only the unmount call is used, and only when this open cycle's close has\n\t// not been reported yet (e.g. MenuDropdown unmounting while open).\n\tconst handleDialogClose = useCallback(\n\t\t(\n\t\t\tevent: MenuDropdownCloseEvent,\n\t\t\tdata?: { componentWillUnmount?: boolean }\n\t\t) => {\n\t\t\tif (data?.componentWillUnmount && !closeNotifiedRef.current) {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t},\n\t\t[handleClose]\n\t);\n\n\t// Keep the ref current so `openDropdownEntryRef` calls the latest handler\n\thandleCloseRef.current = handleClose;\n\n\t// Handle open\n\tconst handleOpen = useCallback(\n\t\t(event?: MenuDropdownOpenEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\tif (\n\t\t\t\t\tcurrentOpenDropdown &&\n\t\t\t\t\tisFunction(currentOpenDropdown.handleClose)\n\t\t\t\t) {\n\t\t\t\t\tcurrentOpenDropdown.handleClose(event);\n\t\t\t\t}\n\t\t\t\tcurrentOpenDropdown = openDropdownEntryRef.current;\n\t\t\t\tsetIsOpenState(true);\n\t\t\t\tonOpen?.(event, {});\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleClose, onOpen]\n\t);\n\n\t// Handle click outside - called via document event listener\n\tconst handleClickOutside = useCallback(\n\t\t(event: Event) => {\n\t\t\tconst target = event.target as Node;\n\t\t\tconst container = triggerContainerRef.current;\n\n\t\t\t// Check if click is outside the trigger container\n\t\t\tif (container && !container.contains(target)) {\n\t\t\t\t// Also check if it's in the dialog (for portal-rendered menus)\n\t\t\t\tconst outsideClickIgnoreClass = `ignore-click-${getId()}`;\n\t\t\t\tif (target instanceof Element) {\n\t\t\t\t\tif (target.classList?.contains(outsideClickIgnoreClass)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (target.closest(`.${outsideClickIgnoreClass}`)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (target.closest('.ignore-react-onclickoutside')) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t},\n\t\t[getId, handleClose]\n\t);\n\n\t// Set up click outside listener\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tdocument.addEventListener('mousedown', handleClickOutside);\n\t\t\tdocument.addEventListener('touchstart', handleClickOutside);\n\t\t}\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('mousedown', handleClickOutside);\n\t\t\tdocument.removeEventListener('touchstart', handleClickOutside);\n\t\t};\n\t}, [isOpen, handleClickOutside]);\n\n\t// Toggle open\n\tconst toggleOpen = useCallback(\n\t\t(event?: KeyboardEvent) => {\n\t\t\tsetFocus();\n\t\t\tif (getIsOpen()) {\n\t\t\t\thandleClose(event);\n\t\t\t} else {\n\t\t\t\thandleOpen(event);\n\t\t\t}\n\t\t},\n\t\t[getIsOpen, handleClose, handleOpen, setFocus]\n\t);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\thandleOpen(event);\n\t\t\t\tsetFocus();\n\t\t\t} else {\n\t\t\t\thandleClose(event);\n\t\t\t}\n\t\t\tonClick?.(event);\n\t\t},\n\t\t[getIsOpen, handleOpen, handleClose, setFocus, onClick]\n\t);\n\n\t// Handle focus\n\tconst handleFocus = useCallback(\n\t\t(event: FocusEvent) => {\n\t\t\tonFocus?.(event);\n\t\t},\n\t\t[onFocus]\n\t);\n\n\t// Handle mouse enter\n\tconst handleMouseEnter = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tisHoverRef.current = true;\n\t\t\tif (!getIsOpen() && openOn === 'hover') {\n\t\t\t\thandleOpen(event);\n\t\t\t} else {\n\t\t\t\tif (closingTimeoutRef.current) {\n\t\t\t\t\tclearTimeout(closingTimeoutRef.current);\n\t\t\t\t}\n\t\t\t}\n\t\t\tonMouseEnter?.(event);\n\t\t},\n\t\t[getIsOpen, openOn, handleOpen, onMouseEnter]\n\t);\n\n\t// Handle mouse leave\n\tconst handleMouseLeave = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (getIsOpen()) {\n\t\t\t\tclosingTimeoutRef.current = setTimeout(() => {\n\t\t\t\t\thandleClose();\n\t\t\t\t}, hoverCloseDelay);\n\t\t\t}\n\t\t\tonMouseLeave?.(event);\n\t\t},\n\t\t[getIsOpen, hoverCloseDelay, handleClose, onMouseLeave]\n\t);\n\n\t// Handle select\n\t// `event` is the keydown from keyboard selection, or the click forwarded by\n\t// the menu-list item.\n\tconst handleSelect = useCallback(\n\t\t(index: number, event?: MouseEvent | KeyboardEvent) => {\n\t\t\tif (!multiple) {\n\t\t\t\tsetSelectedIndex(index);\n\t\t\t\thandleClose(event);\n\t\t\t\tsetFocus();\n\t\t\t} else if (selectedIndices.indexOf(index) === -1) {\n\t\t\t\tsetSelectedIndices((prev) => [...prev, index]);\n\t\t\t} else {\n\t\t\t\tsetSelectedIndices((prev) => prev.filter((i) => i !== index));\n\t\t\t}\n\n\t\t\tif (onSelect && options) {\n\t\t\t\tconst option = options[index];\n\t\t\t\tonSelect(event, { option, optionIndex: index });\n\t\t\t}\n\t\t},\n\t\t[multiple, selectedIndices, handleClose, setFocus, onSelect, options]\n\t);\n\n\t// Focus menu item\n\tconst focusMenuItem = useCallback((menuItem: HTMLLIElement) => {\n\t\tconst anchor = menuItem.getElementsByTagName('a')[0];\n\t\tif (anchor) {\n\t\t\tanchor.focus();\n\t\t}\n\t}, []);\n\n\t// Scroll to menu item\n\tconst scrollToMenuItem = useCallback(\n\t\t(menu: HTMLUListElement | null, menuItem: HTMLLIElement | null) => {\n\t\t\tif (menu && menuItem) {\n\t\t\t\tconst menuHeight = menu.offsetHeight;\n\t\t\t\tconst menuTop = menu.scrollTop;\n\t\t\t\tconst menuItemTop = menuItem.offsetTop - menu.offsetTop;\n\n\t\t\t\tif (menuItemTop < menuTop) {\n\t\t\t\t\tmenu.scrollTop = menuItemTop;\n\t\t\t\t} else {\n\t\t\t\t\tconst menuBottom = menuTop + menuHeight + menu.offsetTop;\n\t\t\t\t\tconst menuItemBottom =\n\t\t\t\t\t\tmenuItemTop + menuItem.offsetHeight + menu.offsetTop;\n\t\t\t\t\tif (menuItemBottom > menuBottom) {\n\t\t\t\t\t\tmenu.scrollTop = menuItemBottom - menuHeight - menu.offsetTop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// Handle keyboard focus\n\tconst handleKeyboardFocus = useCallback(\n\t\t(newFocusedIndex: number | undefined) => {\n\t\t\tif (focusedIndex !== newFocusedIndex && newFocusedIndex !== undefined) {\n\t\t\t\tsetFocusedIndex(newFocusedIndex);\n\t\t\t}\n\n\t\t\tconst menu = getMenu();\n\t\t\tconst menuItem = getMenuItem(newFocusedIndex ?? -1);\n\n\t\t\tif (menuItem) {\n\t\t\t\tfocusMenuItem(menuItem);\n\t\t\t\tscrollToMenuItem(menu, menuItem);\n\t\t\t}\n\t\t},\n\t\t[focusedIndex, getMenu, getMenuItem, focusMenuItem, scrollToMenuItem]\n\t);\n\n\t// Create a context object for keyboard navigation\n\tconst componentContext = useMemo(\n\t\t() => ({\n\t\t\ttrigger: triggerRef.current,\n\t\t\thandleClick: (event: Event) => {\n\t\t\t\thandleClick(event as unknown as MouseEvent);\n\t\t\t},\n\t\t}),\n\t\t[handleClick]\n\t);\n\n\t// Handle keyboard navigate\n\tconst handleKeyboardNavigate = useCallback(\n\t\t({\n\t\t\tevent,\n\t\t\tisOpen: menuIsOpen = true,\n\t\t\tkeyCode,\n\t\t\tonFocus: focusCallback = handleKeyboardFocus,\n\t\t\tonSelect: selectCallback,\n\t\t\ttarget,\n\t\t\ttoggleOpen: toggleCallback = noop,\n\t\t}: {\n\t\t\tevent: KeyboardEvent;\n\t\t\tisOpen?: boolean;\n\t\t\tkeyCode: number;\n\t\t\tonFocus?: (index: number | undefined) => void;\n\t\t\tonSelect: (index: number) => void;\n\t\t\ttarget: EventTarget | null;\n\t\t\ttoggleOpen?: () => void;\n\t\t}) => {\n\t\t\tkeyboardNavigate({\n\t\t\t\tcomponentContext,\n\t\t\t\tcurrentFocusedIndex: focusedIndex,\n\t\t\t\tevent,\n\t\t\t\tisOpen: menuIsOpen,\n\t\t\t\tkey: (event as unknown as { key?: string }).key,\n\t\t\t\tkeyCode,\n\t\t\t\tnavigableItems,\n\t\t\t\tonFocus: focusCallback,\n\t\t\t\tonSelect: selectCallback,\n\t\t\t\ttarget,\n\t\t\t\ttoggleOpen: toggleCallback,\n\t\t\t});\n\t\t},\n\t\t[componentContext, focusedIndex, handleKeyboardFocus, navigableItems]\n\t);\n\n\t// Handle cancel\n\tconst handleCancel = useCallback(\n\t\t(event?: KeyboardEvent) => {\n\t\t\tsetFocus();\n\t\t\thandleClose(event);\n\t\t},\n\t\t[setFocus, handleClose]\n\t);\n\n\t// Handle key down\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tif (event.keyCode) {\n\t\t\t\tif (event.keyCode === KEYS.TAB) {\n\t\t\t\t\thandleCancel(event);\n\t\t\t\t} else if (\n\t\t\t\t\tevent.keyCode === KEYS.ENTER ||\n\t\t\t\t\tevent.keyCode === KEYS.SPACE ||\n\t\t\t\t\tevent.keyCode === KEYS.DOWN ||\n\t\t\t\t\tevent.keyCode === KEYS.UP ||\n\t\t\t\t\tevent.keyCode === KEYS.ESCAPE\n\t\t\t\t) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\thandleKeyboardNavigate({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tisOpen: getIsOpen(),\n\t\t\t\t\t\tkeyCode: event.keyCode,\n\t\t\t\t\t\tonSelect: (index: number) => handleSelect(index, event),\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\ttoggleOpen: () => toggleOpen(event),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonKeyDown?.(event);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thandleCancel,\n\t\t\thandleKeyboardNavigate,\n\t\t\tgetIsOpen,\n\t\t\thandleSelect,\n\t\t\ttoggleOpen,\n\t\t\tonKeyDown,\n\t\t]\n\t);\n\n\t// Handle click custom content. This closes the menu but is not an option\n\t// selection, so `onSelect` is not called (there is no option to report).\n\tconst handleClickCustomContent = useCallback(\n\t\t(event?: React.SyntheticEvent) => {\n\t\t\tsetFocus();\n\t\t\thandleClose(event);\n\t\t},\n\t\t[setFocus, handleClose]\n\t);\n\n\t// Save ref to trigger\n\tconst saveRefToTrigger = useCallback(\n\t\t(trigger: HTMLButtonElement | null) => {\n\t\t\ttriggerRef.current = trigger;\n\t\t\tif (!triggerRendered && trigger) {\n\t\t\t\tsetTriggerRendered(true);\n\t\t\t}\n\t\t\tif (trigger && requestFocus && onRequestFocus) {\n\t\t\t\tonRequestFocus(trigger);\n\t\t\t}\n\t\t},\n\t\t[triggerRendered, requestFocus, onRequestFocus]\n\t);\n\n\t// Save ref to trigger container\n\tconst saveRefToTriggerContainer = useCallback(\n\t\t(container: HTMLDivElement | null) => {\n\t\t\ttriggerContainerRef.current = container;\n\t\t\tif (!triggerRef.current) {\n\t\t\t\ttriggerRef.current = container?.querySelector('button') || null;\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\t// Save ref to list\n\tconst saveRefToList = useCallback((list: HTMLUListElement | null) => {\n\t\tlistRef.current = list;\n\t}, []);\n\n\t// Save ref to list item\n\tconst saveRefToListItem = useCallback(\n\t\t(listItem: HTMLLIElement | null, index: number) => {\n\t\t\tlistItemsRef.current[index] = listItem;\n\t\t\tif (index === focusedIndex && listItem) {\n\t\t\t\thandleKeyboardFocus(focusedIndex);\n\t\t\t}\n\t\t},\n\t\t[focusedIndex, handleKeyboardFocus]\n\t);\n\n\t// Render overlay\n\tconst renderOverlay = useCallback(\n\t\t(shouldShow: boolean) => {\n\t\t\tif (isFunction(overlayProp) && documentDefined) {\n\t\t\t\toverlayProp(shouldShow, overlay);\n\t\t\t} else if (\n\t\t\t\toverlayProp &&\n\t\t\t\tshouldShow &&\n\t\t\t\t!overlayRef.current &&\n\t\t\t\tdocumentDefined\n\t\t\t) {\n\t\t\t\toverlayRef.current = overlay;\n\t\t\t\tdocument.querySelector('body')?.appendChild(overlay);\n\t\t\t} else if (!shouldShow && overlayRef.current?.parentNode) {\n\t\t\t\toverlayRef.current.parentNode.removeChild(overlayRef.current);\n\t\t\t\toverlayRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[overlayProp]\n\t);\n\n\t// Effect for overlay\n\tuseEffect(() => {\n\t\trenderOverlay(isOpen);\n\t}, [isOpen, renderOverlay]);\n\n\t// A new open cycle starts whenever the menu is shown.\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tcloseNotifiedRef.current = false;\n\t\t}\n\t}, [isOpen]);\n\n\t// Cleanup on unmount\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tisUnmountingRef.current = true;\n\t\t\tif (currentOpenDropdown === openDropdownEntryRef.current) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t\trenderOverlay(false);\n\t\t\tif (closingTimeoutRef.current) {\n\t\t\t\tclearTimeout(closingTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, [renderOverlay]);\n\n\t// Render default menu content\n\tconst renderDefaultMenuContent = useCallback(\n\t\t(customListProps?: Record<string, unknown>) => (\n\t\t\t<List\n\t\t\t\tkey={`${getId()}-dropdown-list`}\n\t\t\t\tcheckmark={checkmark}\n\t\t\t\tgetListItemId={getListItemId}\n\t\t\t\titemRefs={saveRefToListItem}\n\t\t\t\titemRenderer={getListItemRenderer()}\n\t\t\t\trenderItemLabel={renderItemLabel}\n\t\t\t\tonCancel={handleCancel}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t\toptions={options}\n\t\t\t\tref={saveRefToList}\n\t\t\t\tselectedIndex={!multiple ? selectedIndex : undefined}\n\t\t\t\tselectedIndices={multiple ? selectedIndices : undefined}\n\t\t\t\ttooltipMenuItem={tooltipMenuItem}\n\t\t\t\ttriggerId={getId()}\n\t\t\t\tlength={length}\n\t\t\t\t{...customListProps}\n\t\t\t/>\n\t\t),\n\t\t[\n\t\t\tgetId,\n\t\t\tcheckmark,\n\t\t\tgetListItemId,\n\t\t\tsaveRefToListItem,\n\t\t\tgetListItemRenderer,\n\t\t\trenderItemLabel,\n\t\t\thandleCancel,\n\t\t\thandleSelect,\n\t\t\toptions,\n\t\t\tsaveRefToList,\n\t\t\tmultiple,\n\t\t\tselectedIndex,\n\t\t\tselectedIndices,\n\t\t\ttooltipMenuItem,\n\t\t\tlength,\n\t\t]\n\t);\n\n\t// Render menu content\n\tconst renderMenuContent = useCallback(\n\t\t(customContent: ReactNode[] | null) => {\n\t\t\tconst customContentWithListPropInjection: ReactNode[] = [];\n\n\t\t\tif (customContent) {\n\t\t\t\tReact.Children.forEach(customContent, (child) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tchild &&\n\t\t\t\t\t\ttypeof child === 'object' &&\n\t\t\t\t\t\t'type' in child &&\n\t\t\t\t\t\t(child.type as { displayName?: string })?.displayName === LIST\n\t\t\t\t\t) {\n\t\t\t\t\t\tcustomContentWithListPropInjection.push(\n\t\t\t\t\t\t\trenderDefaultMenuContent(\n\t\t\t\t\t\t\t\t(child as ReactElement).props as Record<string, unknown>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (child) {\n\t\t\t\t\t\tconst clonedCustomContent = React.cloneElement(\n\t\t\t\t\t\t\tchild as ReactElement<{\n\t\t\t\t\t\t\t\tonClick?: (event?: React.SyntheticEvent) => void;\n\t\t\t\t\t\t\t\tkey?: string;\n\t\t\t\t\t\t\t}>,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonClick: handleClickCustomContent,\n\t\t\t\t\t\t\t\tkey: generateId(),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcustomContentWithListPropInjection.push(clonedCustomContent);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn customContentWithListPropInjection.length > 0\n\t\t\t\t? customContentWithListPropInjection\n\t\t\t\t: renderDefaultMenuContent();\n\t\t},\n\t\t[renderDefaultMenuContent, handleClickCustomContent]\n\t);\n\n\t// Render dialog\n\tconst renderDialog = useCallback(\n\t\t(\n\t\t\tcustomContent: ReactNode[] | null,\n\t\t\tshouldShow: boolean,\n\t\t\toutsideClickIgnoreClass: string\n\t\t) => {\n\t\t\tlet dialogAlign = 'bottom';\n\t\t\tlet hasNubbin = false;\n\t\t\tlet positionClassName = '';\n\n\t\t\tif (nubbinPosition) {\n\t\t\t\thasNubbin = true;\n\t\t\t\tdialogAlign = DropdownToDialogNubbinMapping[nubbinPosition];\n\t\t\t} else if (align) {\n\t\t\t\tdialogAlign = align === 'center' ? 'bottom' : `bottom ${align}`;\n\t\t\t}\n\n\t\t\tconst positions =\n\t\t\t\tDropdownToDialogNubbinMapping[dialogAlign]?.split(' ') || [];\n\t\t\tpositionClassName = classNames(\n\t\t\t\tpositions.map((position) => `slds-dropdown_${position}`)\n\t\t\t);\n\n\t\t\tconst menuStylesBase: React.CSSProperties = {};\n\t\t\tif (align === 'center' && !hasNubbin) {\n\t\t\t\tmenuStylesBase.transform = 'none';\n\t\t\t}\n\n\t\t\treturn shouldShow ? (\n\t\t\t\t<Dialog\n\t\t\t\t\talign={\n\t\t\t\t\t\tdialogAlign as\n\t\t\t\t\t\t\t| 'top'\n\t\t\t\t\t\t\t| 'top left'\n\t\t\t\t\t\t\t| 'top right'\n\t\t\t\t\t\t\t| 'bottom'\n\t\t\t\t\t\t\t| 'bottom left'\n\t\t\t\t\t\t\t| 'bottom right'\n\t\t\t\t\t}\n\t\t\t\t\tclassName={classNames(containerClassName)}\n\t\t\t\t\tcloseOnTabKey\n\t\t\t\t\tcontentsClassName={classNames(\n\t\t\t\t\t\t'slds-dropdown',\n\t\t\t\t\t\t`slds-dropdown_${width}`,\n\t\t\t\t\t\t'slds-text-align_left',\n\t\t\t\t\t\t'ignore-react-onclickoutside',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tpositionClassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-dropdown_inverse': inverse,\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t\tcontext={context}\n\t\t\t\t\thasNubbin={hasNubbin}\n\t\t\t\t\thasStaticAlignment={hasStaticAlignment}\n\t\t\t\t\tinheritWidthOf={inheritTargetWidth ? 'target' : 'none'}\n\t\t\t\t\toffset={offset}\n\t\t\t\t\tonClose={handleDialogClose}\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\toutsideClickIgnoreClass={outsideClickIgnoreClass}\n\t\t\t\t\tposition={menuPosition}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t...menuStylesBase,\n\t\t\t\t\t\t...menuStyle,\n\t\t\t\t\t}}\n\t\t\t\t\tonRequestTargetElement={() => triggerRef.current}\n\t\t\t\t>\n\t\t\t\t\t{renderMenuContent(customContent)}\n\t\t\t\t</Dialog>\n\t\t\t) : null;\n\t\t},\n\t\t[\n\t\t\tnubbinPosition,\n\t\t\talign,\n\t\t\tcontainerClassName,\n\t\t\tclassName,\n\t\t\tinverse,\n\t\t\tcontext,\n\t\t\thasStaticAlignment,\n\t\t\tinheritTargetWidth,\n\t\t\toffset,\n\t\t\thandleDialogClose,\n\t\t\thandleKeyDown,\n\t\t\tmenuPosition,\n\t\t\tmenuStyle,\n\t\t\twidth,\n\t\t\trenderMenuContent,\n\t\t]\n\t);\n\n\t// Find custom trigger and content from children\n\tlet CurrentTrigger: React.ElementType = DefaultTrigger;\n\tlet CustomTriggerChildProps: Record<string, unknown> = {};\n\tconst customContent: ReactNode[] = [];\n\n\tReact.Children.forEach(children, (child) => {\n\t\tif (\n\t\t\tchild &&\n\t\t\ttypeof child === 'object' &&\n\t\t\t'type' in child &&\n\t\t\t(child.type as { displayName?: string })?.displayName ===\n\t\t\t\tMENU_DROPDOWN_TRIGGER\n\t\t) {\n\t\t\tCustomTriggerChildProps = (child as ReactElement).props as Record<\n\t\t\t\tstring,\n\t\t\t\tunknown\n\t\t\t>;\n\t\t\tCurrentTrigger = (child as ReactElement).type as React.ElementType;\n\t\t} else if (child) {\n\t\t\tcustomContent.push(child);\n\t\t}\n\t});\n\n\tconst outsideClickIgnoreClass = `ignore-click-${getId()}`;\n\n\t// `bare-inverse` and `border-inverse` are the inverse forms of `bare` and `border`\n\tconst isInverseIconVariant =\n\t\ticonVariant === 'bare-inverse' || iconVariant === 'border-inverse';\n\tconst triggerIconVariant =\n\t\ticonVariant === 'bare-inverse'\n\t\t\t? 'bare'\n\t\t\t: iconVariant === 'border-inverse'\n\t\t\t\t? 'border'\n\t\t\t\t: iconVariant;\n\n\treturn (\n\t\t<CurrentTrigger\n\t\t\tref={saveRefToTriggerContainer}\n\t\t\taria-haspopup\n\t\t\tassistiveText={assistiveText}\n\t\t\tclassName={classNames(outsideClickIgnoreClass, buttonClassName)}\n\t\t\tdisabled={disabled}\n\t\t\thint={hint}\n\t\t\ticonCategory={iconCategory}\n\t\t\ticonName={iconName}\n\t\t\ticonPosition={iconPosition}\n\t\t\ticonSize={iconSize}\n\t\t\ticonVariant={triggerIconVariant}\n\t\t\tid={getId()}\n\t\t\tinverse={buttonInverse || isInverseIconVariant}\n\t\t\tisOpen={isOpen}\n\t\t\tlabel={label}\n\t\t\tmenu={renderDialog(\n\t\t\t\tcustomContent.length > 0 ? customContent : null,\n\t\t\t\tisOpen,\n\t\t\t\toutsideClickIgnoreClass\n\t\t\t)}\n\t\t\tonBlur={onBlur}\n\t\t\tonClick={\n\t\t\t\topenOn === 'click' || openOn === 'hybrid' ? handleClick : onClick\n\t\t\t}\n\t\t\tonFocus={handleFocus}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonMouseEnter={\n\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseEnter : undefined\n\t\t\t}\n\t\t\tonMouseLeave={\n\t\t\t\topenOn === 'hover' || openOn === 'hybrid' ? handleMouseLeave : undefined\n\t\t\t}\n\t\t\topenOn={openOn}\n\t\t\tstyle={style}\n\t\t\ttabIndex={tabIndex || (isOpen ? '-1' : '0')}\n\t\t\ttooltip={tooltip}\n\t\t\ttriggerClassName={triggerClassName}\n\t\t\ttriggerRef={saveRefToTrigger}\n\t\t\tvariant={buttonVariant}\n\t\t\t{...CustomTriggerChildProps}\n\t\t/>\n\t);\n};\n\nMenuDropdown.displayName = MENU_DROPDOWN;\n\nexport default MenuDropdown;\nexport { ListItem, ListItemLabel };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,IAAM,KAAO,GAsBP,IAAkB,OAAO,WAAa,KAKtC,IAAU,IACb,SAAS,cAAc,MAAM,IAC5B,EAAE,OAAO,CAAC,EAAE;AAEZ,MACH,EAAQ,MAAM,MAAM,KACpB,EAAQ,MAAM,OAAO,KACrB,EAAQ,MAAM,QAAQ,QACtB,EAAQ,MAAM,SAAS,QACvB,EAAQ,MAAM,WAAW;AAI1B,IAAI,GAeS,KACZ;CAZA;CACA;CACA;CACA;CACA;CACA;AAOA,GAEK,WAAa,CAAC,GAkQd,MAAoB,MACzB,EAAK,SAAS,YAAY,EAAK,SAAS,aAAa,CAAC,EAAK,UAEtD,MAAqB,MAAiD;CAC3E,IAAM,IAAiC,CAAC;CAgBxC,OAfA,EAAe,UAAU,CAAC,GAC1B,EAAe,YAAY,IAAI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EL,OACC,kBAAC,IAAD;EACC,KAAK;EACL,iBAAA;EACe;EACf,WAAW,EAAW,IAAyB,EAAe;EACpD;EACJ;EACQ;EACJ;EACI;EACJ;EACV,aAAa;EACb,IAAI,EAAM;EACV,SAAS,MAAiB;EAClB;EACD;EACP,MAAM,GACL,EAAc,SAAS,IAAI,IAAgB,MAC3C,GACA,EACD;EACQ;EACR,SACC,MAAW,WAAW,MAAW,WAAW,KAAc;EAE3D,SAAS;EACT,WAAW;EACE;EACb,cACC,MAAW,WAAW,MAAW,WAAW,KAAmB,KAAA;EAEhE,cACC,MAAW,WAAW,MAAW,WAAW,KAAmB,KAAA;EAExD;EACD;EACP,UAAU,OAAa,IAAS,OAAO;EAC9B;EACS;EAClB,YAAY;EACZ,SAAS;EACT,GAAI;CACJ,CAAA;AAEH;AAEA,GAAa,cAAc"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import e from "../../utilities/get-component-doc.js";
|
|
2
|
+
import t from "../../utilities/warning/deprecated-property.js";
|
|
3
|
+
//#region components/modal/check-props.js
|
|
4
|
+
var n = [
|
|
5
|
+
["containerClassName", "classNameContainer"],
|
|
6
|
+
["contentClassName", "classNameContent"],
|
|
7
|
+
["contentStyle", "styleContent"],
|
|
8
|
+
["footerClassName", "classNameFooter"],
|
|
9
|
+
["headerClassName", "classNameHeader"],
|
|
10
|
+
["portalClassName", "classNamePortal"]
|
|
11
|
+
], r = function() {};
|
|
12
|
+
process.env.NODE_ENV !== "production" && (r = function(r, i = {}, a) {
|
|
13
|
+
let o = e(a);
|
|
14
|
+
n.forEach(([e, n]) => {
|
|
15
|
+
t(r, i[e], e, n, o(n));
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
var i = r;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as default };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=check-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/modal/check-props.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nimport deprecatedProperty from '../../utilities/warning/deprecated-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nconst renamedProps = [\n\t['containerClassName', 'classNameContainer'],\n\t['contentClassName', 'classNameContent'],\n\t['contentStyle', 'styleContent'],\n\t['footerClassName', 'classNameFooter'],\n\t['headerClassName', 'classNameHeader'],\n\t['portalClassName', 'classNamePortal'],\n];\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props = {}, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\trenamedProps.forEach(([oldProp, newProp]) => {\n\t\t\tdeprecatedProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops[oldProp],\n\t\t\t\toldProp,\n\t\t\t\tnewProp,\n\t\t\t\tcreateDocUrl(newProp)\n\t\t\t);\n\t\t});\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAM,IAAe;CACpB,CAAC,sBAAsB,oBAAoB;CAC3C,CAAC,oBAAoB,kBAAkB;CACvC,CAAC,gBAAgB,cAAc;CAC/B,CAAC,mBAAmB,iBAAiB;CACrC,CAAC,mBAAmB,iBAAiB;CACrC,CAAC,mBAAmB,iBAAiB;AACtC,GAEI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,IAAQ,CAAC,GAAG,GAAS;CACxE,IAAM,IAAe,EAAkB,CAAO;CAE9C,EAAa,SAAS,CAAC,GAAS,OAAa;EAC5C,EACC,GACA,EAAM,IACN,GACA,GACA,EAAa,CAAO,CACrB;CACD,CAAC;AACF;AAGD,IAAA,IAAe"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region components/modal/component.json
|
|
2
|
+
var e = "modal", t = "prod", n = "Modal", r = {
|
|
3
|
+
component: e,
|
|
4
|
+
status: t,
|
|
5
|
+
"display-name": "Modals and Prompts",
|
|
6
|
+
classKey: n,
|
|
7
|
+
"SLDS-component-path": "/components/modals",
|
|
8
|
+
"site-stories": [
|
|
9
|
+
{
|
|
10
|
+
heading: "Default",
|
|
11
|
+
path: "/__examples__/menu-contents.jsx"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
heading: "With header and footer",
|
|
15
|
+
path: "/__examples__/header-footer.jsx"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
heading: "With Tagline",
|
|
19
|
+
path: "/__examples__/taglines.jsx"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
heading: "Prompt",
|
|
23
|
+
path: "/__examples__/prompt.jsx"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
heading: "Various sizes",
|
|
27
|
+
path: "/__examples__/sizes.jsx"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"url-slug": "modals"
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { n as classKey, e as component, r as default, t as status };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","names":[],"sources":["../../../../components/modal/component.json"],"sourcesContent":["{\n\t\"component\": \"modal\",\n\t\"status\": \"prod\",\n\t\"display-name\": \"Modals and Prompts\",\n\t\"classKey\": \"Modal\",\n\t\"SLDS-component-path\": \"/components/modals\",\n\t\"site-stories\": [\n\t\t{\n\t\t\t\"heading\": \"Default\",\n\t\t\t\"path\": \"/__examples__/menu-contents.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"With header and footer\",\n\t\t\t\"path\": \"/__examples__/header-footer.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"With Tagline\",\n\t\t\t\"path\": \"/__examples__/taglines.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Prompt\",\n\t\t\t\"path\": \"/__examples__/prompt.jsx\"\n\t\t},\n\t\t{\n\t\t\t\"heading\": \"Various sizes\",\n\t\t\t\"path\": \"/__examples__/sizes.jsx\"\n\t\t}\n\t],\n\t\"url-slug\": \"modals\"\n}\n"],"mappings":""}
|
|
@@ -2,47 +2,59 @@ import { MODAL as e } from "../../utilities/constants.js";
|
|
|
2
2
|
import t from "../../utilities/generate-id.js";
|
|
3
3
|
import n from "../button/index.js";
|
|
4
4
|
import r from "../../utilities/warning/check-app-element-set.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import f from "
|
|
5
|
+
import i from "./check-props.js";
|
|
6
|
+
import a from "./component.js";
|
|
7
|
+
import { forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
8
|
+
import f from "classnames";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import h from "react-modal";
|
|
9
11
|
//#region components/modal/index.tsx
|
|
10
|
-
var
|
|
12
|
+
var g = typeof document < "u", _ = typeof window < "u", v = {
|
|
11
13
|
dialogLabelledBy: "",
|
|
12
14
|
closeButton: "Close"
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
}, y = o(({ align: o = "center", ariaHideApp: y = !0, assistiveText: b, children: x, className: ee, classNameContainer: te, classNameContent: ne, classNameFooter: re, classNameHeader: ie, classNamePortal: S, containerClassName: C, contentClassName: w, contentStyle: T, directional: E, disableClose: D, dismissOnClickOutside: O, onRequestClose: k, footer: A, footerClassName: j, header: M, headerClassName: N, id: P, isOpen: F, parentSelector: I, portalClassName: L, prompt: R, size: z, styleContent: B, tagline: V, heading: H, toast: U }, W) => {
|
|
16
|
+
c(() => {
|
|
17
|
+
i(e, {
|
|
18
|
+
containerClassName: C,
|
|
19
|
+
contentClassName: w,
|
|
20
|
+
contentStyle: T,
|
|
21
|
+
footerClassName: j,
|
|
22
|
+
headerClassName: N,
|
|
23
|
+
portalClassName: L
|
|
24
|
+
}, a);
|
|
25
|
+
}, []);
|
|
26
|
+
let [G, K] = d(null), q = u(t()), J = l(() => ({
|
|
27
|
+
...v,
|
|
28
|
+
...b
|
|
29
|
+
}), [b]), Y = s(() => P || q.current, [P]), X = R !== void 0;
|
|
30
|
+
c(() => {
|
|
31
|
+
y && r();
|
|
32
|
+
}, []), c(() => {
|
|
33
|
+
g && K(document.activeElement);
|
|
34
|
+
}, []), c(() => (_ && g && document.body && (F ? document.body.style.overflow = "hidden" : document.body.style.overflow = "inherit"), () => {
|
|
35
|
+
_ && g && document.body && (document.body.style.overflow = "inherit");
|
|
36
|
+
}), [F]);
|
|
37
|
+
let Z = s((e, t) => {
|
|
38
|
+
G && "focus" in G && typeof G.focus == "function" && G.focus(), k && k(e, t);
|
|
39
|
+
}, [G, k]), Q = s((e, t) => {
|
|
40
|
+
D || Z(e, t);
|
|
41
|
+
}, [D, Z]), ae = s((e) => {
|
|
42
|
+
Q(e, { trigger: "close-button" });
|
|
43
|
+
}, [Q]), oe = s((e) => {
|
|
44
|
+
Q(e, { trigger: e.type === "keydown" ? "escape" : "click-outside" });
|
|
45
|
+
}, [Q]), se = s((e) => {
|
|
46
|
+
(O === void 0 ? !D : O) && Z(e, { trigger: "click-outside" });
|
|
35
47
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
48
|
+
O,
|
|
49
|
+
D,
|
|
50
|
+
Z
|
|
51
|
+
]), $ = s((e) => {
|
|
40
52
|
e && e.stopPropagation && e.stopPropagation();
|
|
41
|
-
}, []),
|
|
42
|
-
let e = ".25rem", t =
|
|
53
|
+
}, []), ce = s(() => {
|
|
54
|
+
let e = ".25rem", t = H || M ? {} : {
|
|
43
55
|
borderTopLeftRadius: e,
|
|
44
56
|
borderTopRightRadius: e
|
|
45
|
-
}, n =
|
|
57
|
+
}, n = A ? {} : {
|
|
46
58
|
borderBottomLeftRadius: e,
|
|
47
59
|
borderBottomRightRadius: e
|
|
48
60
|
};
|
|
@@ -51,88 +63,90 @@ var p = typeof document < "u", m = typeof window < "u", h = {
|
|
|
51
63
|
...n
|
|
52
64
|
};
|
|
53
65
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]),
|
|
58
|
-
let e =
|
|
66
|
+
H,
|
|
67
|
+
M,
|
|
68
|
+
A
|
|
69
|
+
]), le = s(() => {
|
|
70
|
+
let e = Y(), t = {
|
|
59
71
|
describedby: `${e}-modal-content`,
|
|
60
72
|
modal: !0
|
|
61
73
|
};
|
|
62
|
-
if (
|
|
74
|
+
if (J.dialogLabel) return t.label = J.dialogLabel, t;
|
|
63
75
|
let n;
|
|
64
|
-
return
|
|
76
|
+
return J.dialogLabelledBy ? n = J.dialogLabelledBy : H && (n = `${e}-heading`), n && (t.labelledby = n), t;
|
|
65
77
|
}, [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]),
|
|
70
|
-
let e =
|
|
78
|
+
Y,
|
|
79
|
+
J,
|
|
80
|
+
H
|
|
81
|
+
]), ue = () => {
|
|
82
|
+
let e = M, t = !e && !H && !V, r = J.closeButton, i = /* @__PURE__ */ p(n, {
|
|
71
83
|
assistiveText: { icon: r },
|
|
72
84
|
iconCategory: "utility",
|
|
73
85
|
iconName: "close",
|
|
74
86
|
iconSize: "large",
|
|
75
87
|
className: "slds-button_icon slds-modal__close",
|
|
76
|
-
onClick:
|
|
88
|
+
onClick: ae,
|
|
77
89
|
title: r,
|
|
78
90
|
variant: "icon"
|
|
79
91
|
});
|
|
80
|
-
return (!e &&
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className:
|
|
84
|
-
"slds-text-heading_small":
|
|
85
|
-
"slds-text-heading_medium": !
|
|
92
|
+
return (!e && H || V) && (e = /* @__PURE__ */ m("div", { children: [
|
|
93
|
+
U,
|
|
94
|
+
/* @__PURE__ */ p("h1", {
|
|
95
|
+
className: f({
|
|
96
|
+
"slds-text-heading_small": X,
|
|
97
|
+
"slds-text-heading_medium": !X
|
|
86
98
|
}),
|
|
87
|
-
id: `${
|
|
88
|
-
children:
|
|
99
|
+
id: `${Y()}-heading`,
|
|
100
|
+
children: H
|
|
89
101
|
}),
|
|
90
|
-
|
|
102
|
+
V ? /* @__PURE__ */ p("p", {
|
|
91
103
|
className: "slds-m-top_x-small",
|
|
92
|
-
children:
|
|
104
|
+
children: V
|
|
93
105
|
}) : null
|
|
94
|
-
] })), /* @__PURE__ */
|
|
95
|
-
className:
|
|
106
|
+
] })), /* @__PURE__ */ m("header", {
|
|
107
|
+
className: f("slds-modal__header", {
|
|
96
108
|
"slds-modal__header_empty": t,
|
|
97
|
-
[`slds-theme_${
|
|
98
|
-
"slds-theme_alert-texture":
|
|
99
|
-
},
|
|
100
|
-
onClick:
|
|
101
|
-
children: [
|
|
109
|
+
[`slds-theme_${R}`]: X,
|
|
110
|
+
"slds-theme_alert-texture": X
|
|
111
|
+
}, N, ie),
|
|
112
|
+
onClick: $,
|
|
113
|
+
children: [D ? null : i, e]
|
|
102
114
|
});
|
|
103
|
-
},
|
|
104
|
-
className:
|
|
115
|
+
}, de = () => A ? /* @__PURE__ */ p("footer", {
|
|
116
|
+
className: f({
|
|
105
117
|
"slds-modal__footer": !0,
|
|
106
|
-
"slds-modal__footer_directional":
|
|
107
|
-
"slds-theme_default":
|
|
108
|
-
},
|
|
109
|
-
onClick:
|
|
110
|
-
children:
|
|
111
|
-
}) : null,
|
|
112
|
-
let
|
|
113
|
-
...
|
|
114
|
-
...
|
|
118
|
+
"slds-modal__footer_directional": E,
|
|
119
|
+
"slds-theme_default": X
|
|
120
|
+
}, j, re),
|
|
121
|
+
onClick: $,
|
|
122
|
+
children: A
|
|
123
|
+
}) : null, fe = () => {
|
|
124
|
+
let e = o === "top" ? { justifyContent: "flex-start" } : void 0, t = {
|
|
125
|
+
...ce(),
|
|
126
|
+
...T,
|
|
127
|
+
...B
|
|
115
128
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
className:
|
|
118
|
-
onClick:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
return /* @__PURE__ */ p("section", {
|
|
130
|
+
className: f("slds-modal", "slds-fade-in-open", z ? `slds-modal_${z}` : null, { "slds-modal_prompt": X }, ee),
|
|
131
|
+
onClick: se,
|
|
132
|
+
ref: W,
|
|
133
|
+
children: /* @__PURE__ */ m("div", {
|
|
134
|
+
className: f("slds-modal__container", C, te),
|
|
135
|
+
style: e,
|
|
122
136
|
children: [
|
|
123
|
-
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
className:
|
|
126
|
-
id: `${
|
|
127
|
-
style:
|
|
128
|
-
onClick:
|
|
129
|
-
children:
|
|
137
|
+
ue(),
|
|
138
|
+
/* @__PURE__ */ p("div", {
|
|
139
|
+
className: f("slds-modal__content", w, ne),
|
|
140
|
+
id: `${Y()}-modal-content`,
|
|
141
|
+
style: t,
|
|
142
|
+
onClick: $,
|
|
143
|
+
children: x
|
|
130
144
|
}),
|
|
131
|
-
|
|
145
|
+
de()
|
|
132
146
|
]
|
|
133
147
|
})
|
|
134
148
|
});
|
|
135
|
-
},
|
|
149
|
+
}, pe = {
|
|
136
150
|
content: {
|
|
137
151
|
position: void 0,
|
|
138
152
|
top: void 0,
|
|
@@ -151,21 +165,21 @@ var p = typeof document < "u", m = typeof window < "u", h = {
|
|
|
151
165
|
zIndex: 8e3,
|
|
152
166
|
backgroundColor: void 0
|
|
153
167
|
}
|
|
154
|
-
},
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
aria:
|
|
157
|
-
ariaHideApp:
|
|
158
|
-
isOpen:
|
|
159
|
-
onRequestClose:
|
|
160
|
-
role:
|
|
161
|
-
style:
|
|
162
|
-
parentSelector:
|
|
163
|
-
portalClassName:
|
|
164
|
-
children: [
|
|
168
|
+
}, me = le();
|
|
169
|
+
return /* @__PURE__ */ m(h, {
|
|
170
|
+
aria: me,
|
|
171
|
+
ariaHideApp: y,
|
|
172
|
+
isOpen: F,
|
|
173
|
+
onRequestClose: oe,
|
|
174
|
+
role: D ? "alertdialog" : "dialog",
|
|
175
|
+
style: pe,
|
|
176
|
+
parentSelector: I,
|
|
177
|
+
portalClassName: f("ReactModalPortal", L, S),
|
|
178
|
+
children: [fe(), /* @__PURE__ */ p("div", { className: "slds-backdrop slds-backdrop_open" })]
|
|
165
179
|
});
|
|
166
|
-
};
|
|
167
|
-
|
|
180
|
+
});
|
|
181
|
+
y.displayName = e;
|
|
168
182
|
//#endregion
|
|
169
|
-
export {
|
|
183
|
+
export { y as default };
|
|
170
184
|
|
|
171
185
|
//# sourceMappingURL=index.js.map
|