@salesforce/design-system-react 11.0.0-alpha.3 → 11.0.0-alpha.5
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/README.md +112 -70
- package/dist/cjs/components/accordion/index.cjs +1 -1
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/alert/index.cjs +1 -1
- package/dist/cjs/components/alert/index.cjs.map +1 -1
- package/dist/cjs/components/avatar/index.cjs +1 -1
- package/dist/cjs/components/avatar/index.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/breadcrumb/index.cjs +1 -1
- package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/index.cjs +1 -1
- package/dist/cjs/components/builder-header/index.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs +1 -1
- package/dist/cjs/components/button/index.cjs.map +1 -1
- package/dist/cjs/components/button-group/index.cjs +1 -1
- package/dist/cjs/components/button-group/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/index.cjs +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/card/index.cjs +1 -1
- package/dist/cjs/components/card/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- 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/index.cjs +1 -0
- package/dist/cjs/components/color-picker.cjs +1 -0
- package/dist/cjs/components/combobox/index.cjs +1 -1
- package/dist/cjs/components/combobox/index.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/docked-composer/index.cjs +1 -1
- package/dist/cjs/components/docked-composer/index.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/expandable-section/index.cjs +1 -1
- package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
- package/dist/cjs/components/files/index.cjs +1 -1
- package/dist/cjs/components/files/index.cjs.map +1 -1
- package/dist/cjs/components/filter/index.cjs +1 -0
- package/dist/cjs/components/filter.cjs +1 -0
- package/dist/cjs/components/grid/index.cjs +2 -0
- package/dist/cjs/components/grid/index.cjs.map +1 -0
- package/dist/cjs/components/grid.cjs +1 -0
- package/dist/cjs/components/icon/index.cjs +1 -1
- package/dist/cjs/components/icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon-settings/index.cjs +1 -1
- package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
- package/dist/cjs/components/illustration/index.cjs +1 -1
- package/dist/cjs/components/illustration/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +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/media-object/index.cjs +1 -1
- package/dist/cjs/components/media-object/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs +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/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- 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/panel/index.cjs +1 -1
- package/dist/cjs/components/panel/index.cjs.map +1 -1
- package/dist/cjs/components/pill/index.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/index.cjs +1 -1
- package/dist/cjs/components/pill-container/index.cjs.map +1 -1
- package/dist/cjs/components/popover/index.cjs +1 -1
- package/dist/cjs/components/popover/index.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/portal-settings/index.cjs +1 -1
- package/dist/cjs/components/portal-settings/index.cjs.map +1 -1
- package/dist/cjs/components/progress-bar/index.cjs +1 -1
- package/dist/cjs/components/progress-bar/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs +2 -0
- package/dist/cjs/components/progress-indicator/check-props.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/path.cjs +2 -0
- package/dist/cjs/components/progress-indicator/private/path.cjs.map +1 -0
- package/dist/cjs/components/progress-indicator/private/progress.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/progress.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs +2 -0
- package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs.map +1 -0
- package/dist/cjs/components/progress-ring/index.cjs +1 -1
- package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
- package/dist/cjs/components/radio-group/index.cjs +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
- package/dist/cjs/components/{data-table → simple-data-table}/cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/cell.cjs.map +1 -0
- package/dist/cjs/components/{data-table → simple-data-table}/check-props.cjs +1 -1
- package/dist/cjs/components/simple-data-table/check-props.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/column-check-props.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/column.cjs +2 -0
- package/dist/cjs/components/simple-data-table/column.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/component.cjs +2 -0
- package/dist/cjs/components/simple-data-table/component.cjs.map +1 -0
- package/dist/cjs/components/{data-table → simple-data-table}/highlight-cell.cjs +1 -1
- package/dist/cjs/components/simple-data-table/highlight-cell.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/index.cjs +2 -0
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/interactive-element.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/interactive-link.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/cell-context.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/cell-fixed.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/context-helper.cjs.map +1 -0
- package/dist/cjs/components/{data-table → simple-data-table}/private/head.cjs +1 -1
- package/dist/cjs/components/simple-data-table/private/head.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs +2 -0
- package/dist/cjs/components/simple-data-table/private/header-cell.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/link.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/mode.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/row.cjs +2 -0
- package/dist/cjs/components/simple-data-table/private/row.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table/private/table-context.cjs.map +1 -0
- package/dist/cjs/components/{data-table → simple-data-table}/row-actions.cjs +1 -1
- package/dist/cjs/components/simple-data-table/row-actions.cjs.map +1 -0
- package/dist/cjs/components/simple-data-table.cjs +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/index.cjs +1 -1
- package/dist/cjs/components/spinner/index.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/tabs/index.cjs +1 -1
- package/dist/cjs/components/tabs/index.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/toast/index.cjs +1 -1
- package/dist/cjs/components/toast/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +2 -2
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/index.cjs +1 -0
- package/dist/cjs/components/tree.cjs +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/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/visual-picker/index.cjs +1 -1
- package/dist/cjs/components/visual-picker/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/cjs/utilities/constants.cjs +1 -1
- package/dist/cjs/utilities/constants.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/index.cjs +1 -0
- package/dist/cjs/utilities/hooks.cjs +1 -0
- package/dist/cjs/utilities/warning/incompatible-props.cjs +2 -0
- package/dist/cjs/utilities/warning/incompatible-props.cjs.map +1 -0
- package/dist/es/components/accordion/index.js +28 -24
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/alert/index.js +14 -14
- package/dist/es/components/alert/index.js.map +1 -1
- package/dist/es/components/badge/index.js +1 -0
- package/dist/es/components/badge/index.js.map +1 -1
- package/dist/es/components/button/index.js +1 -1
- package/dist/es/components/button/index.js.map +1 -1
- package/dist/es/components/button-stateful/index.js +3 -2
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/color-picker/index.js +2 -0
- package/dist/es/components/color-picker.js +2 -0
- package/dist/es/components/filter/index.js +2 -0
- package/dist/es/components/filter.js +2 -0
- package/dist/es/components/grid/index.js +31 -0
- package/dist/es/components/grid/index.js.map +1 -0
- package/dist/es/components/grid.js +2 -0
- package/dist/es/components/index.js +78 -78
- package/dist/es/components/menu-dropdown/index.js +5 -5
- package/dist/es/components/menu-dropdown/menu-dropdown.js +47 -40
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/page-header/index.js +24 -24
- package/dist/es/components/page-header/index.js.map +1 -1
- package/dist/es/components/popover/index.js +3 -3
- package/dist/es/components/popover/popover.js +10 -3
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/check-props.js +24 -0
- package/dist/es/components/progress-indicator/check-props.js.map +1 -0
- package/dist/es/components/progress-indicator/index.js +80 -38
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-indicator/private/path.js +95 -0
- package/dist/es/components/progress-indicator/private/path.js.map +1 -0
- package/dist/es/components/progress-indicator/private/progress.js +1 -1
- package/dist/es/components/progress-indicator/private/progress.js.map +1 -1
- package/dist/es/components/progress-indicator/private/use-roving-tab-index.js +29 -0
- package/dist/es/components/progress-indicator/private/use-roving-tab-index.js.map +1 -0
- package/dist/es/components/progress-ring/index.js +8 -8
- package/dist/es/components/progress-ring/index.js.map +1 -1
- package/dist/es/components/{data-table → simple-data-table}/cell.js +2 -2
- package/dist/es/components/simple-data-table/cell.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/check-props.js +2 -2
- package/dist/es/components/simple-data-table/check-props.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/column-check-props.js +1 -1
- package/dist/es/components/simple-data-table/column-check-props.js.map +1 -0
- package/dist/es/components/simple-data-table/column.js +8 -0
- package/dist/es/components/simple-data-table/column.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/component.js +6 -10
- package/dist/es/components/simple-data-table/component.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/highlight-cell.js +2 -2
- package/dist/es/components/simple-data-table/highlight-cell.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/index.js +126 -233
- package/dist/es/components/simple-data-table/index.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/interactive-element.js +1 -1
- package/dist/es/components/simple-data-table/interactive-element.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/interactive-link.js +1 -1
- package/dist/es/components/simple-data-table/interactive-link.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/cell-context.js +1 -1
- package/dist/es/components/simple-data-table/private/cell-context.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/cell-fixed.js +1 -1
- package/dist/es/components/simple-data-table/private/cell-fixed.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/context-helper.js +1 -1
- package/dist/es/components/simple-data-table/private/context-helper.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/head.js +2 -2
- package/dist/es/components/simple-data-table/private/head.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/header-cell.js +2 -2
- package/dist/es/components/simple-data-table/private/header-cell.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/link.js +1 -1
- package/dist/es/components/simple-data-table/private/link.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/mode.js +1 -1
- package/dist/es/components/simple-data-table/private/mode.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/row.js +6 -6
- package/dist/es/components/simple-data-table/private/row.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/private/table-context.js +1 -1
- package/dist/es/components/simple-data-table/private/table-context.js.map +1 -0
- package/dist/es/components/{data-table → simple-data-table}/row-actions.js +2 -2
- package/dist/es/components/simple-data-table/row-actions.js.map +1 -0
- package/dist/es/components/simple-data-table.js +2 -0
- package/dist/es/components/tooltip/index.js +90 -84
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/index.js +2 -0
- package/dist/es/components/tree.js +2 -0
- package/dist/es/utilities/constants.js +2 -2
- package/dist/es/utilities/constants.js.map +1 -1
- package/dist/es/utilities/hooks/index.js +2 -0
- package/dist/es/utilities/hooks.js +1 -0
- package/dist/es/utilities/warning/incompatible-props.js +19 -0
- package/dist/es/utilities/warning/incompatible-props.js.map +1 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/alert/index.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +1 -1
- package/dist/types/components/badge/index.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +5 -2
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +2 -2
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +14 -14
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/page-header/index.d.ts +1 -1
- package/dist/types/components/page-header/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -0
- package/dist/types/components/progress-indicator/index.d.ts +39 -8
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/path.d.ts +48 -0
- package/dist/types/components/progress-indicator/private/path.d.ts.map +1 -0
- package/dist/types/components/progress-indicator/private/progress.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts +41 -0
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/cell.d.ts +5 -5
- package/dist/types/components/simple-data-table/cell.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/check-props.d.ts +3 -0
- package/dist/types/components/simple-data-table/check-props.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/column-check-props.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/column.d.ts +6 -6
- package/dist/types/components/simple-data-table/column.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/highlight-cell.d.ts +14 -0
- package/dist/types/components/simple-data-table/highlight-cell.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/index.d.ts +13 -40
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/interactive-element.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/interactive-link.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/cell-context.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/cell-fixed.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/context-helper.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/private/head.d.ts +6 -6
- package/dist/types/components/simple-data-table/private/head.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/private/header-cell.d.ts +3 -3
- package/dist/types/components/simple-data-table/private/header-cell.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/link.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/mode.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/private/row.d.ts +11 -11
- package/dist/types/components/simple-data-table/private/row.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/private/table-context.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/row-actions.d.ts +5 -5
- package/dist/types/components/simple-data-table/row-actions.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/simple-data-table.d.ts +15 -0
- package/dist/types/components/simple-data-table/simple-data-table.d.ts.map +1 -0
- package/dist/types/components/{data-table → simple-data-table}/types.d.ts +56 -71
- package/dist/types/components/simple-data-table/types.d.ts.map +1 -0
- package/dist/types/components/simple-data-table.d.ts +2 -0
- package/dist/types/components/tooltip/index.d.ts +10 -1
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/utilities/constants.d.ts +8 -7
- package/dist/types/utilities/constants.d.ts.map +1 -1
- package/dist/types/utilities/hooks/index.d.ts +1 -1
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks.d.ts +0 -1
- package/dist/types/utilities/sample-data/global-navigation-bar.d.ts +0 -1
- package/dist/types/utilities/sample-data/vertical-navigation.d.ts +0 -1
- package/dist/types/utilities/warning/incompatible-props.d.ts.map +1 -1
- package/package.json +6 -4
- package/dist/cjs/components/data-table/cell.cjs.map +0 -1
- package/dist/cjs/components/data-table/check-props.cjs.map +0 -1
- package/dist/cjs/components/data-table/column-check-props.cjs.map +0 -1
- package/dist/cjs/components/data-table/column.cjs +0 -2
- package/dist/cjs/components/data-table/column.cjs.map +0 -1
- package/dist/cjs/components/data-table/component.cjs +0 -2
- package/dist/cjs/components/data-table/component.cjs.map +0 -1
- package/dist/cjs/components/data-table/highlight-cell.cjs.map +0 -1
- package/dist/cjs/components/data-table/index.cjs +0 -2
- package/dist/cjs/components/data-table/index.cjs.map +0 -1
- package/dist/cjs/components/data-table/interactive-element.cjs.map +0 -1
- package/dist/cjs/components/data-table/interactive-link.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/cell-context.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/cell-fixed.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/context-helper.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/head.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/header-cell.cjs +0 -2
- package/dist/cjs/components/data-table/private/header-cell.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/link.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/mode.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/row.cjs +0 -2
- package/dist/cjs/components/data-table/private/row.cjs.map +0 -1
- package/dist/cjs/components/data-table/private/table-context.cjs.map +0 -1
- package/dist/cjs/components/data-table/row-actions.cjs.map +0 -1
- package/dist/cjs/components/data-table.cjs +0 -1
- package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs +0 -2
- package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs.map +0 -1
- package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs +0 -2
- package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs.map +0 -1
- package/dist/es/components/data-table/cell.js.map +0 -1
- package/dist/es/components/data-table/check-props.js.map +0 -1
- package/dist/es/components/data-table/column-check-props.js.map +0 -1
- package/dist/es/components/data-table/column.js +0 -8
- package/dist/es/components/data-table/column.js.map +0 -1
- package/dist/es/components/data-table/component.js.map +0 -1
- package/dist/es/components/data-table/highlight-cell.js.map +0 -1
- package/dist/es/components/data-table/index.js.map +0 -1
- package/dist/es/components/data-table/interactive-element.js.map +0 -1
- package/dist/es/components/data-table/interactive-link.js.map +0 -1
- package/dist/es/components/data-table/private/cell-context.js.map +0 -1
- package/dist/es/components/data-table/private/cell-fixed.js.map +0 -1
- package/dist/es/components/data-table/private/context-helper.js.map +0 -1
- package/dist/es/components/data-table/private/head.js.map +0 -1
- package/dist/es/components/data-table/private/header-cell.js.map +0 -1
- package/dist/es/components/data-table/private/link.js.map +0 -1
- package/dist/es/components/data-table/private/mode.js.map +0 -1
- package/dist/es/components/data-table/private/row.js.map +0 -1
- package/dist/es/components/data-table/private/table-context.js.map +0 -1
- package/dist/es/components/data-table/row-actions.js.map +0 -1
- package/dist/es/components/data-table.js +0 -2
- package/dist/es/utilities/design-tokens/dist/palette-colors.common.js +0 -6
- package/dist/es/utilities/design-tokens/dist/palette-colors.common.js.map +0 -1
- package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js +0 -286
- package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js.map +0 -1
- package/dist/types/components/data-table/cell.d.ts.map +0 -1
- package/dist/types/components/data-table/check-props.d.ts.map +0 -1
- package/dist/types/components/data-table/column-check-props.d.ts.map +0 -1
- package/dist/types/components/data-table/column.d.ts.map +0 -1
- package/dist/types/components/data-table/data-table.d.ts +0 -15
- package/dist/types/components/data-table/data-table.d.ts.map +0 -1
- package/dist/types/components/data-table/highlight-cell.d.ts +0 -14
- package/dist/types/components/data-table/highlight-cell.d.ts.map +0 -1
- package/dist/types/components/data-table/index.d.ts.map +0 -1
- package/dist/types/components/data-table/interactive-element.d.ts.map +0 -1
- package/dist/types/components/data-table/interactive-link.d.ts.map +0 -1
- package/dist/types/components/data-table/private/cell-context.d.ts.map +0 -1
- package/dist/types/components/data-table/private/cell-fixed.d.ts.map +0 -1
- package/dist/types/components/data-table/private/context-helper.d.ts.map +0 -1
- package/dist/types/components/data-table/private/head.d.ts.map +0 -1
- package/dist/types/components/data-table/private/header-cell.d.ts.map +0 -1
- package/dist/types/components/data-table/private/link.d.ts.map +0 -1
- package/dist/types/components/data-table/private/mode.d.ts.map +0 -1
- package/dist/types/components/data-table/private/row.d.ts.map +0 -1
- package/dist/types/components/data-table/private/table-context.d.ts.map +0 -1
- package/dist/types/components/data-table/row-actions.d.ts.map +0 -1
- package/dist/types/components/data-table/types.d.ts.map +0 -1
- package/dist/types/components/data-table.d.ts +0 -2
- package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts +0 -81
- package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts +0 -201
- package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts +0 -117
- package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts +0 -5
- package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts +0 -204
- package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts +0 -3
- package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/components.common.d.ts +0 -249
- package/dist/types/utilities/design-tokens/dist/components.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts +0 -9
- package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts +0 -647
- package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts +0 -14
- package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts +0 -10
- package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts +0 -9
- package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts +0 -7
- package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts +0 -12
- package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts +0 -35
- package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts +0 -98
- package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts +0 -15
- package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts +0 -5
- package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts +0 -11
- package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts +0 -21
- package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts +0 -283
- package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts.map +0 -1
- /package/dist/cjs/components/{data-table → simple-data-table}/column-check-props.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/interactive-element.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/interactive-link.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/cell-context.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/cell-fixed.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/context-helper.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/link.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/mode.cjs +0 -0
- /package/dist/cjs/components/{data-table → simple-data-table}/private/table-context.cjs +0 -0
- /package/dist/types/components/{data-table → progress-indicator}/check-props.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/column-check-props.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/interactive-element.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/interactive-link.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/cell-context.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/cell-fixed.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/context-helper.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/link.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/mode.d.ts +0 -0
- /package/dist/types/components/{data-table → simple-data-table}/private/table-context.d.ts +0 -0
|
@@ -3,42 +3,49 @@ import { IconSettingsContext as t } from "../icon-settings/index.js";
|
|
|
3
3
|
import n from "../../utilities/event.js";
|
|
4
4
|
import r from "../../utilities/generate-id.js";
|
|
5
5
|
import i from "../../utilities/key-code.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import "../utilities/menu-list/item.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import a from "../utilities/dialog/index.js";
|
|
7
|
+
import o from "../utilities/menu-list/item-label.js";
|
|
8
|
+
import s from "../utilities/menu-list/item.js";
|
|
9
|
+
import c from "../utilities/menu-list/index.js";
|
|
10
|
+
import ee from "./button-trigger.js";
|
|
11
11
|
import te from "./check-props.js";
|
|
12
12
|
import ne from "./component.js";
|
|
13
13
|
import re from "../../utilities/keyboard-navigate.js";
|
|
14
|
-
import
|
|
15
|
-
import l, { useCallback as u, useContext as
|
|
14
|
+
import ie from "../../utilities/key-buffer.js";
|
|
15
|
+
import l, { useCallback as u, useContext as ae, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
16
16
|
import h from "classnames";
|
|
17
17
|
import { jsx as g } from "react/jsx-runtime";
|
|
18
|
-
import
|
|
18
|
+
import oe from "lodash.isfunction";
|
|
19
19
|
//#region components/menu-dropdown/menu-dropdown.tsx
|
|
20
|
-
var
|
|
20
|
+
var se = c, _ = typeof document < "u", v = _ ? document.createElement("span") : { style: {} };
|
|
21
21
|
_ && (v.style.top = "0", v.style.left = "0", v.style.width = "100%", v.style.height = "100%", v.style.position = "absolute");
|
|
22
|
-
var y,
|
|
22
|
+
var y, ce = [
|
|
23
|
+
"top left",
|
|
24
|
+
"top",
|
|
25
|
+
"top right",
|
|
26
|
+
"bottom left",
|
|
27
|
+
"bottom",
|
|
28
|
+
"bottom right"
|
|
29
|
+
], le = () => {}, ue = (e) => e.type !== "header" && e.type !== "divider" && !e.disabled, de = (e) => {
|
|
23
30
|
let t = [];
|
|
24
|
-
return t.indexes = [], t.keyBuffer = new
|
|
25
|
-
|
|
31
|
+
return t.indexes = [], t.keyBuffer = new ie(), Array.isArray(e) && e.forEach((e, n) => {
|
|
32
|
+
ue(e) && (t.push({
|
|
26
33
|
index: n,
|
|
27
34
|
text: `${e.label}`.toLowerCase()
|
|
28
35
|
}), t.indexes.push(n));
|
|
29
36
|
}), t;
|
|
30
|
-
},
|
|
37
|
+
}, fe = {
|
|
31
38
|
top: "bottom",
|
|
32
39
|
"top left": "bottom left",
|
|
33
40
|
"top right": "bottom right",
|
|
34
41
|
bottom: "top",
|
|
35
42
|
"bottom left": "top left",
|
|
36
43
|
"bottom right": "top right"
|
|
37
|
-
}, b = (
|
|
38
|
-
let { align: c = "left", assistiveText:
|
|
44
|
+
}, b = (s) => {
|
|
45
|
+
let { align: c = "left", assistiveText: ie, buttonClassName: ce, buttonInverse: ue, buttonVariant: b, checkmark: pe, children: me, className: he, containerClassName: ge, disabled: _e, hasStaticAlignment: ve, hint: ye, hoverCloseDelay: be = 300, iconCategory: xe, iconName: Se, iconPosition: Ce, iconSize: we, iconVariant: Te, id: Ee, inheritTargetWidth: De, inverse: Oe = !1, isInline: ke, isOpen: x, label: Ae, length: je = "5", listItemRenderer: Me, menuPosition: Ne = "absolute", menuStyle: Pe, multiple: S, nubbinPosition: C, offset: Fe, onBlur: Ie, onClick: w, onClose: Le, onFocus: Re, onKeyDown: ze, onMouseDown: Be, onMouseEnter: Ve, onMouseLeave: He, onOpen: Ue, onSelect: T, openOn: E = "click", options: D, overlay: O, requestFocus: We, onRequestFocus: k, style: Ge, tabIndex: Ke, tooltip: qe, tooltipMenuItem: Je, triggerClassName: Ye, value: A, width: Xe = "medium" } = s, Ze = ae(t), Qe = f(() => r(), []), j = u(() => Ee || Qe, [Ee, Qe]), [$e, et] = m(!1), [M, tt] = m(-1), [nt, rt] = m(-1), [N, P] = m([]), [F, it] = m(!1), I = p(null), at = p(null), ot = p(null), L = p({}), R = p(!1), st = p(!1), z = p(null), B = p(null), ct = f(() => de(D), [D]);
|
|
39
46
|
d(() => {
|
|
40
|
-
te(e,
|
|
41
|
-
}, [
|
|
47
|
+
te(e, s, ne);
|
|
48
|
+
}, [s]);
|
|
42
49
|
let V = u(() => !!(typeof x == "boolean" ? x : $e), [x, $e]), H = !_e && V() && F, U = u((e, t) => {
|
|
43
50
|
let n = -1;
|
|
44
51
|
return t && t.length && t.some((t, r) => t && t.value === e ? (n = r, !0) : !1), n;
|
|
@@ -58,14 +65,14 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
58
65
|
]);
|
|
59
66
|
let lt = ke ? "relative" : Ne, ut = u((e) => {
|
|
60
67
|
if (e !== void 0) return `${j()}-item-${e}`;
|
|
61
|
-
}, [j]), dt = u(() => Me ||
|
|
68
|
+
}, [j]), dt = u(() => Me || o, [Me]), W = u(() => {
|
|
62
69
|
!R.current && !st.current && I.current && I.current.focus();
|
|
63
70
|
}, []), ft = u(() => ot.current, []), pt = u((e) => e !== void 0 && L.current && L.current[e] || null, []), G = p(() => {}), K = u(() => {
|
|
64
71
|
V() && (y?.handleClose === G.current && (y = void 0), et(!1), R.current = !1, Le?.());
|
|
65
72
|
}, [V, Le]);
|
|
66
73
|
G.current = K;
|
|
67
74
|
let q = u(() => {
|
|
68
|
-
V() || (y &&
|
|
75
|
+
V() || (y && oe(y.handleClose) && y.handleClose(), y = { handleClose: K }, et(!0), Ue?.());
|
|
69
76
|
}, [
|
|
70
77
|
V,
|
|
71
78
|
K,
|
|
@@ -137,8 +144,8 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
137
144
|
let n = e.offsetHeight, r = e.scrollTop, i = t.offsetTop - e.offsetTop;
|
|
138
145
|
if (i < r) e.scrollTop = i;
|
|
139
146
|
else {
|
|
140
|
-
let
|
|
141
|
-
|
|
147
|
+
let a = r + n + e.offsetTop, o = i + t.offsetHeight + e.offsetTop;
|
|
148
|
+
o > a && (e.scrollTop = o - n - e.offsetTop);
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
}, []), Z = u((e) => {
|
|
@@ -156,7 +163,7 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
156
163
|
handleClick: (e) => {
|
|
157
164
|
Y(e);
|
|
158
165
|
}
|
|
159
|
-
}), [Y]), xt = u(({ event: e, isOpen: t = !0, keyCode: n, onFocus: r = Z, onSelect: i, target:
|
|
166
|
+
}), [Y]), xt = u(({ event: e, isOpen: t = !0, keyCode: n, onFocus: r = Z, onSelect: i, target: a, toggleOpen: o = le }) => {
|
|
160
167
|
re({
|
|
161
168
|
componentContext: bt,
|
|
162
169
|
currentFocusedIndex: M,
|
|
@@ -167,8 +174,8 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
167
174
|
navigableItems: ct,
|
|
168
175
|
onFocus: r,
|
|
169
176
|
onSelect: i,
|
|
170
|
-
target:
|
|
171
|
-
toggleOpen:
|
|
177
|
+
target: a,
|
|
178
|
+
toggleOpen: o
|
|
172
179
|
});
|
|
173
180
|
}, [
|
|
174
181
|
bt,
|
|
@@ -215,14 +222,14 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
215
222
|
}, []), Dt = u((e, t) => {
|
|
216
223
|
L.current[t] = e, t === M && e && Z(M);
|
|
217
224
|
}, [M, Z]), $ = u((e) => {
|
|
218
|
-
|
|
225
|
+
oe(O) && _ ? O(e, v) : O && e && !B.current && _ ? (B.current = v, document.querySelector("body")?.appendChild(v)) : !e && B.current?.parentNode && (B.current.parentNode.removeChild(B.current), B.current = null);
|
|
219
226
|
}, [O]);
|
|
220
227
|
d(() => {
|
|
221
228
|
$(H);
|
|
222
229
|
}, [H, $]), d(() => () => {
|
|
223
230
|
st.current = !0, y?.handleClose === G.current && (y = void 0), $(!1), z.current && clearTimeout(z.current);
|
|
224
231
|
}, [$]);
|
|
225
|
-
let Ot = u((e) => /* @__PURE__ */ g(
|
|
232
|
+
let Ot = u((e) => /* @__PURE__ */ g(se, {
|
|
226
233
|
checkmark: pe,
|
|
227
234
|
getListItemId: ut,
|
|
228
235
|
itemRefs: Dt,
|
|
@@ -265,16 +272,16 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
265
272
|
}
|
|
266
273
|
}), t.length > 0 ? t : Ot();
|
|
267
274
|
}, [Ot, Ct]), At = u((e, t, n) => {
|
|
268
|
-
let r = "bottom", i = !1,
|
|
269
|
-
C ? (i = !0, r =
|
|
270
|
-
let
|
|
271
|
-
|
|
272
|
-
let
|
|
273
|
-
return c === "center" && !i && (
|
|
275
|
+
let r = "bottom", i = !1, o = "";
|
|
276
|
+
C ? (i = !0, r = fe[C]) : c && (r = c === "center" ? "bottom" : `bottom ${c}`);
|
|
277
|
+
let s = fe[r]?.split(" ") || [];
|
|
278
|
+
o = h(s.map((e) => `slds-dropdown_${e}`));
|
|
279
|
+
let ee = {};
|
|
280
|
+
return c === "center" && !i && (ee.transform = "none"), t ? /* @__PURE__ */ g(a, {
|
|
274
281
|
align: r,
|
|
275
282
|
className: h(ge),
|
|
276
283
|
closeOnTabKey: !0,
|
|
277
|
-
contentsClassName: h("slds-dropdown", `slds-dropdown_${Xe}`, "slds-text-align_left", "ignore-react-onclickoutside", he,
|
|
284
|
+
contentsClassName: h("slds-dropdown", `slds-dropdown_${Xe}`, "slds-text-align_left", "ignore-react-onclickoutside", he, o, { "slds-dropdown_inverse": Oe }),
|
|
278
285
|
context: Ze,
|
|
279
286
|
hasNubbin: i,
|
|
280
287
|
hasStaticAlignment: ve,
|
|
@@ -285,7 +292,7 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
285
292
|
outsideClickIgnoreClass: n,
|
|
286
293
|
position: lt,
|
|
287
294
|
style: {
|
|
288
|
-
...
|
|
295
|
+
...ee,
|
|
289
296
|
...Pe
|
|
290
297
|
},
|
|
291
298
|
onRequestTargetElement: () => I.current,
|
|
@@ -307,7 +314,7 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
307
314
|
Pe,
|
|
308
315
|
Xe,
|
|
309
316
|
kt
|
|
310
|
-
]), jt =
|
|
317
|
+
]), jt = ee, Mt = {}, Nt = [];
|
|
311
318
|
l.Children.forEach(me, (e) => {
|
|
312
319
|
e && typeof e == "object" && "type" in e && e.type?.displayName === "SLDSMenuDropdownTrigger" ? (Mt = e.props, jt = e.type) : e && Nt.push(e);
|
|
313
320
|
});
|
|
@@ -315,8 +322,8 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
315
322
|
return /* @__PURE__ */ g(jt, {
|
|
316
323
|
ref: Tt,
|
|
317
324
|
"aria-haspopup": !0,
|
|
318
|
-
assistiveText:
|
|
319
|
-
className: h(Pt,
|
|
325
|
+
assistiveText: ie,
|
|
326
|
+
className: h(Pt, ce),
|
|
320
327
|
disabled: _e,
|
|
321
328
|
hint: ye,
|
|
322
329
|
iconCategory: xe,
|
|
@@ -325,7 +332,7 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
325
332
|
iconSize: we,
|
|
326
333
|
iconVariant: Te,
|
|
327
334
|
id: j(),
|
|
328
|
-
inverse:
|
|
335
|
+
inverse: ue,
|
|
329
336
|
isOpen: H,
|
|
330
337
|
label: Ae,
|
|
331
338
|
menu: At(Nt.length > 0 ? Nt : null, H, Pt),
|
|
@@ -342,12 +349,12 @@ var y, se = () => {}, ce = (e) => e.type !== "header" && e.type !== "divider" &&
|
|
|
342
349
|
tooltip: qe,
|
|
343
350
|
triggerClassName: Ye,
|
|
344
351
|
triggerRef: wt,
|
|
345
|
-
variant:
|
|
352
|
+
variant: b,
|
|
346
353
|
...Mt
|
|
347
354
|
});
|
|
348
355
|
};
|
|
349
356
|
b.displayName = e;
|
|
350
357
|
//#endregion
|
|
351
|
-
export {
|
|
358
|
+
export { ce as DropdownNubbinPositions, s as ListItem, o as ListItemLabel, b as default };
|
|
352
359
|
|
|
353
360
|
//# sourceMappingURL=menu-dropdown.js.map
|
|
@@ -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';\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: { handleClose: () => 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 = (typeof DropdownNubbinPositionsArray)[number];\n\nexport const DropdownNubbinPositions: readonly DropdownNubbinPosition[] = DropdownNubbinPositionsArray;\n\nconst noop = () => {};\n\nexport interface MenuDropdownOption {\n\tclassName?: string;\n\tdisabled?: boolean;\n\tdivider?: 'top' | 'bottom';\n\thref?: string;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: {\n\t\tname: string;\n\t\tcategory: string;\n\t};\n\trightIcon?: {\n\t\tname: string;\n\t\tcategory: string;\n\t};\n\ttooltipContent?: string;\n\ttype?: 'header' | 'item' | 'divider';\n\tvalue?: string | number;\n}\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/** Icon variant */\n\ticonVariant?:\n\t\t| 'bare'\n\t\t| 'container'\n\t\t| 'border'\n\t\t| 'border-filled'\n\t\t| 'small'\n\t\t| 'more';\n\t/** Determines the size of the icon */\n\ticonSize?: '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/** Triggered when the dropdown is closed */\n\tonClose?: () => 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/** Triggered when the dropdown is opened */\n\tonOpen?: () => void;\n\t/** Triggered when an item in the menu is clicked */\n\tonSelect?: (\n\t\toption: MenuDropdownOption,\n\t\tdata: { option: MenuDropdownOption; optionIndex: number }\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(\n\t\t() => getNavigableItems(options),\n\t\t[options]\n\t);\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(\n\t\t(index: number): HTMLLIElement | null => {\n\t\t\tif (index !== undefined && listItemsRef.current) {\n\t\t\t\treturn listItemsRef.current[index] || null;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t[]\n\t);\n\n\t// Handle close\n\tconst handleCloseRef = useRef<() => void>(() => {});\n\n\tconst handleClose = useCallback(() => {\n\t\tif (getIsOpen()) {\n\t\t\tif (currentOpenDropdown?.handleClose === handleCloseRef.current) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t\tsetIsOpenState(false);\n\t\t\tisHoverRef.current = false;\n\t\t\tonClose?.();\n\t\t}\n\t}, [getIsOpen, onClose]);\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\tif (!getIsOpen()) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\t\t\tcurrentOpenDropdown = { handleClose };\n\t\t\tsetIsOpenState(true);\n\t\t\tonOpen?.();\n\t\t}\n\t}, [getIsOpen, handleClose, onOpen]);\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();\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\tsetFocus();\n\t\tif (getIsOpen()) {\n\t\t\thandleClose();\n\t\t} else {\n\t\t\thandleOpen();\n\t\t}\n\t}, [getIsOpen, handleClose, handleOpen, setFocus]);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\thandleOpen();\n\t\t\t\tsetFocus();\n\t\t\t} else {\n\t\t\t\thandleClose();\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();\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\tconst handleSelect = useCallback(\n\t\t(index: number) => {\n\t\t\tif (!multiple) {\n\t\t\t\tsetSelectedIndex(index);\n\t\t\t\thandleClose();\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(option, { 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 (\n\t\t\t\tfocusedIndex !== newFocusedIndex &&\n\t\t\t\tnewFocusedIndex !== undefined\n\t\t\t) {\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\tsetFocus();\n\t\thandleClose();\n\t}, [setFocus, handleClose]);\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();\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: handleSelect,\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\ttoggleOpen,\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[handleCancel, handleKeyboardNavigate, getIsOpen, handleSelect, toggleOpen, onKeyDown]\n\t);\n\n\t// Handle click custom content\n\tconst handleClickCustomContent = useCallback(() => {\n\t\tsetFocus();\n\t\thandleClose();\n\t\tonSelect?.(\n\t\t\t{} as MenuDropdownOption,\n\t\t\t{ option: {} as MenuDropdownOption, optionIndex: -1 }\n\t\t);\n\t}, [setFocus, handleClose, onSelect]);\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// 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((child as ReactElement).props as Record<string, unknown>)\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<{ onClick?: () => void; key?: string }>,\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 = DropdownToDialogNubbinMapping[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={dialogAlign as 'top' | 'top left' | 'top right' | 'bottom' | 'bottom left' | 'bottom right'}\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={handleClose}\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\thandleClose,\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<string, unknown>;\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\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={iconVariant}\n\t\t\tid={getId()}\n\t\t\tinverse={buttonInverse}\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\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,IAAM,KAAO,GAqBP,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,GAeE,WAAa,CAAC,GAsJd,MAAoB,MACzB,EAAK,SAAS,YAAY,EAAK,SAAS,aAAa,CAAC,EAAK,U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AAO;GACP,WAAW,EAAW,EAAkB;GACxC,eAAA;GACA,mBAAmB,EAClB,iBACA,iBAAiB,MACjB,wBACA,+BACA,IACA,GACA,EACC,yBAAyB,GAC1B,CACD;GACS;GACE;GACS;GACpB,gBAAgB,KAAqB,WAAW;GACxC;GACR,SAAS;GACT,WAAW;GACc;GACzB,UAAU;GACV,OAAO;IACN,GAAG;IACH,GAAG;GACJ;GACA,8BAA8B,EAAW;GAExC,UAAA,GAAkB,CAAa;EACzB,CAAA,IACL;CACL,GACA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CACD,GAGI,KAAoC,GACpC,KAAmD,CAAC,GAClD,KAA6B,CAAC;CAEpC,EAAM,SAAS,QAAQ,KAAW,MAAU;EAC3C,AACC,KACA,OAAO,KAAU,YACjB,UAAU,KACT,EAAM,MAAmC,gBAAA,6BAG1C,KAA2B,EAAuB,OAClD,KAAkB,EAAuB,QAC/B,KACV,GAAc,KAAK,CAAK;CAE1B,CAAC;CAED,IAAM,KAA0B,gBAAgB,EAAM;CAEtD,OACC,kBAAC,IAAD;EACC,KAAK;EACL,iBAAA;EACe;EACf,WAAW,EAAW,IAAyB,CAAe;EACpD;EACJ;EACQ;EACJ;EACI;EACJ;EACG;EACb,IAAI,EAAM;EACV,SAAS;EACD;EACD;EACP,MAAM,GACL,GAAc,SAAS,IAAI,KAAgB,MAC3C,GACA,EACD;EACQ;EACR,SACC,MAAW,WAAW,MAAW,WAAW,IAAc;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 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';\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: { handleClose: () => 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 = (typeof DropdownNubbinPositionsArray)[number];\n\nexport const DropdownNubbinPositions: readonly DropdownNubbinPosition[] = DropdownNubbinPositionsArray;\n\nconst noop = () => {};\n\nexport interface MenuDropdownOption {\n\tclassName?: string;\n\tdisabled?: boolean;\n\tdivider?: 'top' | 'bottom';\n\thref?: string;\n\tid?: string;\n\tlabel?: string;\n\tleftIcon?: {\n\t\tname: string;\n\t\tcategory: string;\n\t};\n\trightIcon?: {\n\t\tname: string;\n\t\tcategory: string;\n\t};\n\ttooltipContent?: string;\n\ttype?: 'header' | 'item' | 'divider';\n\tvalue?: string | number;\n}\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/** Icon variant */\n\ticonVariant?:\n\t\t| 'bare'\n\t\t| 'container'\n\t\t| 'border'\n\t\t| 'border-filled'\n\t\t| 'small'\n\t\t| 'more';\n\t/** Determines the size of the icon */\n\ticonSize?: '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/** Triggered when the dropdown is closed */\n\tonClose?: () => 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/** Triggered when the dropdown is opened */\n\tonOpen?: () => void;\n\t/** Triggered when an item in the menu is clicked */\n\tonSelect?: (\n\t\toption: MenuDropdownOption,\n\t\tdata: { option: MenuDropdownOption; optionIndex: number }\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(\n\t\t() => getNavigableItems(options),\n\t\t[options]\n\t);\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(\n\t\t(index: number): HTMLLIElement | null => {\n\t\t\tif (index !== undefined && listItemsRef.current) {\n\t\t\t\treturn listItemsRef.current[index] || null;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t[]\n\t);\n\n\t// Handle close\n\tconst handleCloseRef = useRef<() => void>(() => {});\n\n\tconst handleClose = useCallback(() => {\n\t\tif (getIsOpen()) {\n\t\t\tif (currentOpenDropdown?.handleClose === handleCloseRef.current) {\n\t\t\t\tcurrentOpenDropdown = undefined;\n\t\t\t}\n\t\t\tsetIsOpenState(false);\n\t\t\tisHoverRef.current = false;\n\t\t\tonClose?.();\n\t\t}\n\t}, [getIsOpen, onClose]);\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\tif (!getIsOpen()) {\n\t\t\tif (currentOpenDropdown && isFunction(currentOpenDropdown.handleClose)) {\n\t\t\t\tcurrentOpenDropdown.handleClose();\n\t\t\t}\n\t\t\tcurrentOpenDropdown = { handleClose };\n\t\t\tsetIsOpenState(true);\n\t\t\tonOpen?.();\n\t\t}\n\t}, [getIsOpen, handleClose, onOpen]);\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();\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\tsetFocus();\n\t\tif (getIsOpen()) {\n\t\t\thandleClose();\n\t\t} else {\n\t\t\thandleOpen();\n\t\t}\n\t}, [getIsOpen, handleClose, handleOpen, setFocus]);\n\n\t// Handle click\n\tconst handleClick = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (!getIsOpen()) {\n\t\t\t\thandleOpen();\n\t\t\t\tsetFocus();\n\t\t\t} else {\n\t\t\t\thandleClose();\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();\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\tconst handleSelect = useCallback(\n\t\t(index: number) => {\n\t\t\tif (!multiple) {\n\t\t\t\tsetSelectedIndex(index);\n\t\t\t\thandleClose();\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(option, { 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 (\n\t\t\t\tfocusedIndex !== newFocusedIndex &&\n\t\t\t\tnewFocusedIndex !== undefined\n\t\t\t) {\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\tsetFocus();\n\t\thandleClose();\n\t}, [setFocus, handleClose]);\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();\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: handleSelect,\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\ttoggleOpen,\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[handleCancel, handleKeyboardNavigate, getIsOpen, handleSelect, toggleOpen, onKeyDown]\n\t);\n\n\t// Handle click custom content\n\tconst handleClickCustomContent = useCallback(() => {\n\t\tsetFocus();\n\t\thandleClose();\n\t\tonSelect?.(\n\t\t\t{} as MenuDropdownOption,\n\t\t\t{ option: {} as MenuDropdownOption, optionIndex: -1 }\n\t\t);\n\t}, [setFocus, handleClose, onSelect]);\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// 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((child as ReactElement).props as Record<string, unknown>)\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<{ onClick?: () => void; key?: string }>,\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 = DropdownToDialogNubbinMapping[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={dialogAlign as 'top' | 'top left' | 'top right' | 'bottom' | 'bottom left' | 'bottom right'}\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={handleClose}\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\thandleClose,\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<string, unknown>;\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\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={iconVariant}\n\t\t\tid={getId()}\n\t\t\tinverse={buttonInverse}\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\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,IAAM,KAAO,GAqBP,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,GAaS,KAA6D;CAVzE;CACA;CACA;CACA;CACA;CACA;AAKyE,GAEp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T,GAAI;CACJ,CAAA;AAEH;AAEA,EAAa,cAAc"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { PAGE_HEADER as e } from "../../utilities/constants.js";
|
|
2
|
-
import "./private/info.js";
|
|
3
|
-
import "./private/title.js";
|
|
4
|
-
import "./private/detail-block.js";
|
|
5
|
-
import "./private/detail-row.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
2
|
+
import t from "./private/info.js";
|
|
3
|
+
import n from "./private/title.js";
|
|
4
|
+
import r from "./private/detail-block.js";
|
|
5
|
+
import i from "./private/detail-row.js";
|
|
6
|
+
import a from "./private/base/index.js";
|
|
7
|
+
import o from "./private/record-home/index.js";
|
|
8
|
+
import s from "./private/object-home/index.js";
|
|
9
|
+
import c from "./private/related-list/index.js";
|
|
10
10
|
import "react";
|
|
11
|
-
import
|
|
12
|
-
import { jsx as
|
|
11
|
+
import l from "classnames";
|
|
12
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
13
13
|
//#region components/page-header/index.tsx
|
|
14
|
-
var
|
|
15
|
-
let v =
|
|
14
|
+
var d = ({ className: e, details: t, icon: n, info: r, joined: i, label: d, nameSwitcherDropdown: f, onRenderActions: p, onRenderControls: m, title: h, trail: g, variant: _ = "base" }) => {
|
|
15
|
+
let v = l("slds-page-header", {
|
|
16
16
|
"slds-page-header_record-home": _ === "record-home",
|
|
17
17
|
"slds-page-header_related-list": _ === "related-list",
|
|
18
|
-
"slds-page-header_joined":
|
|
18
|
+
"slds-page-header_joined": i
|
|
19
19
|
}, e), y = {
|
|
20
|
-
details:
|
|
21
|
-
icon:
|
|
22
|
-
info:
|
|
20
|
+
details: t,
|
|
21
|
+
icon: n,
|
|
22
|
+
info: r,
|
|
23
23
|
label: d,
|
|
24
24
|
nameSwitcherDropdown: f,
|
|
25
25
|
onRenderActions: p,
|
|
@@ -30,23 +30,23 @@ var s = ({ className: e, details: s, icon: c, info: l, joined: u, label: d, name
|
|
|
30
30
|
}, b;
|
|
31
31
|
switch (_) {
|
|
32
32
|
case "object-home":
|
|
33
|
-
b =
|
|
33
|
+
b = s;
|
|
34
34
|
break;
|
|
35
35
|
case "record-home":
|
|
36
|
-
b =
|
|
36
|
+
b = o;
|
|
37
37
|
break;
|
|
38
38
|
case "related-list":
|
|
39
|
-
b =
|
|
39
|
+
b = c;
|
|
40
40
|
break;
|
|
41
|
-
default: b =
|
|
41
|
+
default: b = a;
|
|
42
42
|
}
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ u("div", {
|
|
44
44
|
className: v,
|
|
45
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ u(b, { ...y })
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
d.displayName = e;
|
|
49
49
|
//#endregion
|
|
50
|
-
export {
|
|
50
|
+
export { r as DetailBlock, i as DetailRow, t as Info, n as Title, d as default };
|
|
51
51
|
|
|
52
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/page-header/index.tsx"],"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\nimport React, { type ReactNode, type ReactElement } from 'react';\nimport classnames from 'classnames';\nimport { PAGE_HEADER } from '../../utilities/constants';\n\n// Private components - keep JSX for now\nimport Info from './private/info';\nimport Title from './private/title';\nimport DetailRow from './private/detail-row';\nimport DetailBlock from './private/detail-block';\nimport Base from './private/base';\nimport RecordHome from './private/record-home';\nimport ObjectHome from './private/object-home';\nimport RelatedList from './private/related-list';\n\n/**\n * Page header variant types\n */\nexport type PageHeaderVariant
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/page-header/index.tsx"],"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\nimport React, { type ReactNode, type ReactElement } from 'react';\nimport classnames from 'classnames';\nimport { PAGE_HEADER } from '../../utilities/constants';\n\n// Private components - keep JSX for now\nimport Info from './private/info';\nimport Title from './private/title';\nimport DetailRow from './private/detail-row';\nimport DetailBlock from './private/detail-block';\nimport Base from './private/base';\nimport RecordHome from './private/record-home';\nimport ObjectHome from './private/object-home';\nimport RelatedList from './private/related-list';\n\n/**\n * Page header variant types\n */\nexport type PageHeaderVariant =\n\t'base' | 'object-home' | 'record-home' | 'related-list';\n\n/**\n * Detail block structure\n */\nexport interface PageHeaderDetail {\n\t/** Detail label */\n\tlabel?: ReactNode;\n\t/** Detail content */\n\tcontent?: ReactNode;\n\t/** Whether content is truncated */\n\ttruncate?: boolean;\n\t/** Flavor modifier */\n\tflavor?: string;\n}\n\n/**\n * Props for the PageHeader component\n */\nexport interface PageHeaderProps {\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Detail blocks for record-home variant */\n\tdetails?: PageHeaderDetail[];\n\t/** Icon element */\n\ticon?: ReactElement;\n\t/** Info text or element */\n\tinfo?: ReactNode;\n\t/** Whether joined with SimpleDataTable */\n\tjoined?: boolean;\n\t/** Label text or element */\n\tlabel?: ReactNode;\n\t/** Name switcher dropdown for object-home variant */\n\tnameSwitcherDropdown?: ReactNode;\n\t/** Render function for action controls (upper right) */\n\tonRenderActions?: () => ReactNode;\n\t/** Render function for controls (lower right) */\n\tonRenderControls?: () => ReactNode;\n\t/** Title text or element */\n\ttitle?: ReactNode;\n\t/** Breadcrumb trail */\n\ttrail?: ReactElement[];\n\t/** Page header variant */\n\tvariant?: PageHeaderVariant;\n}\n\n/**\n * The PageHeader component adds PageHeader with multiple variants:\n * base, object-home, record-home, and related-list.\n */\nconst PageHeader = ({\n\tclassName,\n\tdetails,\n\ticon,\n\tinfo,\n\tjoined,\n\tlabel,\n\tnameSwitcherDropdown,\n\tonRenderActions,\n\tonRenderControls,\n\ttitle,\n\ttrail,\n\tvariant = 'base',\n}: PageHeaderProps): React.ReactElement => {\n\tconst classes = classnames(\n\t\t'slds-page-header',\n\t\t{\n\t\t\t'slds-page-header_record-home': variant === 'record-home',\n\t\t\t'slds-page-header_related-list': variant === 'related-list',\n\t\t\t'slds-page-header_joined': joined,\n\t\t},\n\t\tclassName as string\n\t);\n\n\tconst variantProps = {\n\t\tdetails,\n\t\ticon,\n\t\tinfo,\n\t\tlabel,\n\t\tnameSwitcherDropdown,\n\t\tonRenderActions,\n\t\tonRenderControls,\n\t\ttitle,\n\t\ttrail,\n\t\tvariant,\n\t};\n\n\tlet VariantComponent: React.ComponentType<typeof variantProps>;\n\n\tswitch (variant) {\n\t\tcase 'object-home':\n\t\t\tVariantComponent = ObjectHome;\n\t\t\tbreak;\n\t\tcase 'record-home':\n\t\t\tVariantComponent = RecordHome;\n\t\t\tbreak;\n\t\tcase 'related-list':\n\t\t\tVariantComponent = RelatedList;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tVariantComponent = Base;\n\t}\n\n\treturn (\n\t\t<div className={classes}>\n\t\t\t<VariantComponent {...variantProps} />\n\t\t</div>\n\t);\n};\n\nPageHeader.displayName = PAGE_HEADER;\n\nexport default PageHeader;\n\n// NOTE: these are private components and are prone to breaking changes.\n// Do not use these in your app! These exports are for legacy use only.\nexport { Info, Title, DetailRow, DetailBlock };\n"],"mappings":";;;;;;;;;;;;;AAuEA,IAAM,KAAc,EACnB,cACA,YACA,SACA,SACA,WACA,UACA,yBACA,oBACA,qBACA,UACA,UACA,aAAU,aACgC;CAC1C,IAAM,IAAU,EACf,oBACA;EACC,gCAAgC,MAAY;EAC5C,iCAAiC,MAAY;EAC7C,2BAA2B;CAC5B,GACA,CACD,GAEM,IAAe;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,GAEI;CAEJ,QAAQ,GAAR;EACC,KAAK;GACJ,IAAmB;GACnB;EACD,KAAK;GACJ,IAAmB;GACnB;EACD,KAAK;GACJ,IAAmB;GACnB;EACD,SACC,IAAmB;CACrB;CAEA,OACC,kBAAC,OAAD;EAAK,WAAW;EACf,UAAA,kBAAC,GAAD,EAAkB,GAAI,EAAe,CAAA;CACjC,CAAA;AAEP;AAEA,EAAW,cAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "./popover.js";
|
|
1
|
+
import e, { PopoverNubbinPositions as t } from "./popover.js";
|
|
2
2
|
//#region components/popover/index.tsx
|
|
3
|
-
var
|
|
3
|
+
var n = e;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { t as default };
|
|
5
|
+
export { t as PopoverNubbinPositions, n as default };
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -12,7 +12,14 @@ import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
|
12
12
|
//#region components/popover/popover.tsx
|
|
13
13
|
var f = typeof document < "u", p = f ? document.createElement("span") : { style: {} };
|
|
14
14
|
f && (p.style.top = "0", p.style.left = "0", p.style.width = "100%", p.style.height = "100%", p.style.position = "absolute");
|
|
15
|
-
var m = null,
|
|
15
|
+
var m = null, h = [
|
|
16
|
+
"top left",
|
|
17
|
+
"top",
|
|
18
|
+
"top right",
|
|
19
|
+
"bottom left",
|
|
20
|
+
"bottom",
|
|
21
|
+
"bottom right"
|
|
22
|
+
], oe = { closeButton: "Close dialog" }, g = ({ align: e = "right", assistiveText: h, ariaLabelledby: g, children: se, body: _, classNameBody: v, classNameFooter: ce, footerClassName: le, className: ue, contentsClassName: de, disabled: fe = !1, footer: y, footerStyle: pe, footerWalkthroughActions: b, hasNoCloseButton: me = !1, hasNoNubbin: he = !1, hasStaticAlignment: ge = !1, hasNoTriggerStyles: _e = !1, heading: x, icon: ve, id: ye, isOpen: S, offset: be, onClick: C, onClose: w, onFocus: T, onKeyDown: E, onMouseDown: xe, onMouseEnter: D, onMouseLeave: O, onOpen: Se, onRequestClose: k, onRequestTargetElement: A, openOn: j = "click", overlay: M, position: Ce = "absolute", stepText: N, style: we, triggerClassName: Te, variant: P = "base", hoverCloseDelay: F = 300, closeButtonAssistiveText: Ee }) => {
|
|
16
23
|
let De = ae(), I = ye || De, Oe = ie(t), ke = {
|
|
17
24
|
...oe,
|
|
18
25
|
...h
|
|
@@ -275,8 +282,8 @@ var m = null, oe = { closeButton: "Close dialog" }, h = ({ align: e = "right", a
|
|
|
275
282
|
]
|
|
276
283
|
});
|
|
277
284
|
};
|
|
278
|
-
|
|
285
|
+
g.displayName = e;
|
|
279
286
|
//#endregion
|
|
280
|
-
export { h as default };
|
|
287
|
+
export { h as PopoverNubbinPositions, g as default };
|
|
281
288
|
|
|
282
289
|
//# sourceMappingURL=popover.js.map
|