@onewelcome/react-lib-components 14.0.0-experiment.1 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.cjs.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.module.scss.es.js +5 -5
- package/dist/components/Button/BaseButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/BaseButton.module.scss.es.js +4 -4
- package/dist/components/Button/Button.cjs.js +1 -1
- package/dist/components/Button/Button.cjs.js.map +1 -1
- package/dist/components/Button/Button.es.js +11 -2
- package/dist/components/Button/Button.es.js.map +1 -1
- package/dist/components/Button/Button.module.scss.cjs.js +2 -2
- package/dist/components/Button/Button.module.scss.es.js +17 -17
- package/dist/components/Button/IconButton.module.scss.cjs.js +2 -2
- package/dist/components/Button/IconButton.module.scss.es.js +18 -18
- package/dist/components/ContextMenu/ContextMenu.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.es.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.module.scss.es.js +6 -6
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuDivider.module.scss.es.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuItem.es.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.cjs.js +2 -2
- package/dist/components/ContextMenu/ContextMenuItem.module.scss.es.js +3 -3
- package/dist/components/ContextMenu/ContextMenuService.cjs.js +1 -1
- package/dist/components/ContextMenu/ContextMenuService.cjs.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenuService.es.js +20 -17
- package/dist/components/ContextMenu/ContextMenuService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js +1 -1
- package/dist/components/DataGrid/DataGrid.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.es.js +102 -59
- package/dist/components/DataGrid/DataGrid.es.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGrid.module.scss.es.js +8 -6
- package/dist/components/DataGrid/DataGrid.module.scss.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridActions.module.scss.es.js +6 -6
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss.es.js +7 -7
- package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js +4 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridBody.module.scss.es.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss.es.js +4 -4
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss.es.js +5 -5
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js +2 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.scss.es.js +24 -24
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js +1 -1
- package/dist/components/DataGrid/DataGridBody/DataGridRow/useNestedRow.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js +4 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridFilter.module.scss.es.js +9 -9
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterPopover.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js +17 -21
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterService.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js +15 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterTag.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js +54 -6
- package/dist/components/DataGrid/DataGridFilters/DataGridFilterValueSelect.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js +4 -4
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DataGridToolbar.module.scss.es.js +10 -10
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePicker.module.scss.es.js +17 -17
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js +45 -24
- package/dist/components/DataGrid/DataGridFilters/DateTimePicker/DateTimePickerCalendarSection.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js +7 -9
- package/dist/components/DataGrid/DataGridFilters/useFiltersReducer.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js +6 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js +7 -4
- package/dist/components/DataGrid/DataGridHeader/DataGridHeader.module.scss.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.cjs.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js +14 -12
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.es.js.map +1 -1
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.cjs.js +2 -2
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js +11 -10
- package/dist/components/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss.es.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.module.scss.cjs.js +2 -2
- package/dist/components/DatePicker/DatePicker.module.scss.es.js +31 -31
- package/dist/components/Form/Checkbox/Checkbox.cjs.js.map +1 -1
- package/dist/components/Form/Checkbox/Checkbox.es.js.map +1 -1
- package/dist/components/Form/Checkbox/Checkbox.module.scss.cjs.js +2 -2
- package/dist/components/Form/Checkbox/Checkbox.module.scss.es.js +13 -13
- package/dist/components/Form/Fieldset/Fieldset.cjs.js +1 -1
- package/dist/components/Form/Fieldset/Fieldset.cjs.js.map +1 -1
- package/dist/components/Form/Fieldset/Fieldset.es.js +3 -2
- package/dist/components/Form/Fieldset/Fieldset.es.js.map +1 -1
- package/dist/components/Form/Fieldset/Fieldset.module.scss.cjs.js +2 -2
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js +8 -5
- package/dist/components/Form/Fieldset/Fieldset.module.scss.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileItem/FileItem.module.scss.es.js +18 -18
- package/dist/components/Form/FileUpload/FileUpload.cjs.js +1 -1
- package/dist/components/Form/FileUpload/FileUpload.cjs.js.map +1 -1
- package/dist/components/Form/FileUpload/FileUpload.es.js +6 -6
- package/dist/components/Form/FileUpload/FileUpload.es.js.map +1 -1
- package/dist/components/Form/FileUpload/FileUpload.module.scss.cjs.js +2 -2
- package/dist/components/Form/FileUpload/FileUpload.module.scss.es.js +16 -16
- package/dist/components/Form/Form.module.scss.cjs.js +2 -2
- package/dist/components/Form/Form.module.scss.es.js +2 -2
- package/dist/components/Form/FormControl/FormControl.cjs.js +1 -1
- package/dist/components/Form/FormControl/FormControl.cjs.js.map +1 -1
- package/dist/components/Form/FormControl/FormControl.es.js +3 -3
- package/dist/components/Form/FormControl/FormControl.es.js.map +1 -1
- package/dist/components/Form/FormControl/FormControl.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormControl/FormControl.module.scss.es.js +13 -13
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js +9 -6
- package/dist/components/Form/FormErrorText/FormErrorText.module.scss.es.js.map +1 -1
- package/dist/components/Form/FormGroup/FormGroup.cjs.js.map +1 -1
- package/dist/components/Form/FormGroup/FormGroup.es.js.map +1 -1
- package/dist/components/Form/FormGroup/FormGroup.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormGroup/FormGroup.module.scss.es.js +3 -3
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormHelperText/FormHelperText.module.scss.es.js +4 -4
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.cjs.js.map +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js +4 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.es.js.map +1 -1
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss.es.js +6 -6
- package/dist/components/Form/Input/Input.cjs.js +1 -1
- package/dist/components/Form/Input/Input.cjs.js.map +1 -1
- package/dist/components/Form/Input/Input.es.js +48 -5
- package/dist/components/Form/Input/Input.es.js.map +1 -1
- package/dist/components/Form/Input/Input.module.scss.cjs.js +2 -2
- package/dist/components/Form/Input/Input.module.scss.es.js +8 -8
- package/dist/components/Form/Label/Label.module.scss.cjs.js +2 -2
- package/dist/components/Form/Label/Label.module.scss.es.js +2 -2
- package/dist/components/Form/Radio/Radio.cjs.js.map +1 -1
- package/dist/components/Form/Radio/Radio.es.js +1 -1
- package/dist/components/Form/Radio/Radio.es.js.map +1 -1
- package/dist/components/Form/Radio/Radio.module.scss.cjs.js +2 -2
- package/dist/components/Form/Radio/Radio.module.scss.es.js +11 -11
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js +11 -10
- package/dist/components/Form/Select/MultiSelect/MultiOption.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js +236 -57
- package/dist/components/Form/Select/MultiSelect/MultiSelect.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js +20 -15
- package/dist/components/Form/Select/MultiSelect/MultiSelect.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectButton.module.scss.es.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/MultiSelect/SelectedOptions.module.scss.es.js +4 -4
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js +134 -32
- package/dist/components/Form/Select/MultiSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js +73 -55
- package/dist/components/Form/Select/MultiSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.cjs.js.map +1 -1
- package/dist/components/Form/Select/Select.interfaces.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Option.es.js +16 -9
- package/dist/components/Form/Select/SingleSelect/Option.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.es.js +202 -46
- package/dist/components/Form/Select/SingleSelect/Select.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js +21 -17
- package/dist/components/Form/Select/SingleSelect/Select.module.scss.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js +176 -89
- package/dist/components/Form/Select/SingleSelect/useArrowNavigation.es.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js +48 -36
- package/dist/components/Form/Select/SingleSelect/useSearch.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js +1 -1
- package/dist/components/Form/Select/useAddNewBtn.cjs.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.es.js +8 -6
- package/dist/components/Form/Select/useAddNewBtn.es.js.map +1 -1
- package/dist/components/Form/Select/useAddNewBtn.module.scss.cjs.js +2 -2
- package/dist/components/Form/Select/useAddNewBtn.module.scss.es.js +4 -4
- package/dist/components/Form/Select/useBaseSearch.cjs.js +2 -0
- package/dist/components/Form/Select/useBaseSearch.cjs.js.map +1 -0
- package/dist/components/Form/Select/useBaseSearch.es.js +85 -0
- package/dist/components/Form/Select/useBaseSearch.es.js.map +1 -0
- package/dist/components/Form/Select/useSelectPositionList.cjs.js +1 -1
- package/dist/components/Form/Select/useSelectPositionList.cjs.js.map +1 -1
- package/dist/components/Form/Select/useSelectPositionList.es.js +18 -5
- package/dist/components/Form/Select/useSelectPositionList.es.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.cjs.js +1 -1
- package/dist/components/Form/Textarea/Textarea.cjs.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.es.js +4 -0
- package/dist/components/Form/Textarea/Textarea.es.js.map +1 -1
- package/dist/components/Form/Textarea/Textarea.module.scss.cjs.js +2 -2
- package/dist/components/Form/Textarea/Textarea.module.scss.es.js +6 -6
- package/dist/components/Form/Toggle/Toggle.cjs.js +1 -1
- package/dist/components/Form/Toggle/Toggle.cjs.js.map +1 -1
- package/dist/components/Form/Toggle/Toggle.es.js +5 -3
- package/dist/components/Form/Toggle/Toggle.es.js.map +1 -1
- package/dist/components/Form/Toggle/Toggle.module.scss.cjs.js +2 -2
- package/dist/components/Form/Toggle/Toggle.module.scss.es.js +18 -18
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js +25 -17
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js +8 -4
- package/dist/components/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss.es.js.map +1 -1
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/InputWrapper/InputWrapper.module.scss.es.js +5 -5
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/MultiSelectWrapper/MultiSelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js +41 -22
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js +8 -4
- package/dist/components/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss.es.js.map +1 -1
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss.es.js +3 -3
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js +2 -0
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss.es.js +8 -8
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.cjs.js.map +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.es.js.map +1 -1
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.cjs.js +2 -2
- package/dist/components/Form/Wrapper/Wrapper/Wrapper.module.scss.es.js +6 -6
- package/dist/components/Icon/Icon.cjs.js +1 -1
- package/dist/components/Icon/Icon.cjs.js.map +1 -1
- package/dist/components/Icon/Icon.es.js +2 -1
- package/dist/components/Icon/Icon.es.js.map +1 -1
- package/dist/components/Icon/Icon.module.scss.cjs.js +2 -2
- package/dist/components/Icon/Icon.module.scss.es.js +108 -107
- package/dist/components/Icon/Icon.module.scss.es.js.map +1 -1
- package/dist/components/Layout/ActionBar/ActionBar.cjs.js +2 -0
- package/dist/components/Layout/ActionBar/ActionBar.cjs.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.es.js +122 -0
- package/dist/components/Layout/ActionBar/ActionBar.es.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js +3 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.cjs.js.map +1 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js +24 -0
- package/dist/components/Layout/ActionBar/ActionBar.module.scss.es.js.map +1 -0
- package/dist/components/Layout/Card/Card.module.scss.cjs.js +2 -2
- package/dist/components/Layout/Card/Card.module.scss.es.js +12 -12
- package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.cjs.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js +66 -41
- package/dist/components/Layout/ContentHeader/ContentHeader.es.js.map +1 -1
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.cjs.js +2 -2
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js +28 -13
- package/dist/components/Layout/ContentHeader/ContentHeader.module.scss.es.js.map +1 -1
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormSection/FormSection.module.scss.es.js +4 -4
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormStepper/FormStepper.module.scss.es.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.cjs.js +2 -2
- package/dist/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss.es.js +3 -3
- package/dist/components/Link/Link.cjs.js.map +1 -1
- package/dist/components/Link/Link.es.js +1 -1
- package/dist/components/Link/Link.es.js.map +1 -1
- package/dist/components/Link/Link.module.scss.cjs.js +2 -2
- package/dist/components/Link/Link.module.scss.es.js +17 -17
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertContainer/AlertContainer.module.scss.es.js +11 -11
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.cjs.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js +7 -1
- package/dist/components/Notifications/Alert/AlertContainer/useAlertContainerHeightAnimation.es.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.cjs.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.es.js.map +1 -1
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Alert/AlertItem/AlertItem.module.scss.es.js +22 -22
- package/dist/components/Notifications/Banner/Banner.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Banner/Banner.module.scss.es.js +9 -9
- package/dist/components/Notifications/BaseModal/BaseModal.cjs.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.es.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModal.module.scss.es.js +5 -5
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.es.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalActions/BaseModalActions.module.scss.es.js +4 -4
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.cjs.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.es.js.map +1 -1
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalContent/BaseModalContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.module.scss.es.js +6 -6
- package/dist/components/Notifications/Dialog/Dialog.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/Dialog.module.scss.es.js +4 -4
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogActions/DialogActions.module.scss.es.js +3 -3
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/Dialog/DialogTitle/DialogTitle.module.scss.es.js +10 -10
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.cjs.js.map +1 -1
- package/dist/components/Notifications/DiscardChangesModal/DiscardChangesModal.es.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.cjs.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.es.js.map +1 -1
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheet.module.scss.es.js +13 -13
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetContent/SideSheetContent.module.scss.es.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SideSheet/SideSheetHeader/SideSheetHeader.module.scss.es.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.cjs.js.map +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.es.js.map +1 -1
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.cjs.js +2 -2
- package/dist/components/Notifications/SlideInModal/SlideInModal.module.scss.es.js +10 -10
- package/dist/components/Pagination/Pagination.cjs.js +1 -1
- package/dist/components/Pagination/Pagination.cjs.js.map +1 -1
- package/dist/components/Pagination/Pagination.es.js +118 -90
- package/dist/components/Pagination/Pagination.es.js.map +1 -1
- package/dist/components/Pagination/Pagination.module.scss.cjs.js +2 -2
- package/dist/components/Pagination/Pagination.module.scss.es.js +15 -14
- package/dist/components/Pagination/Pagination.module.scss.es.js.map +1 -1
- package/dist/components/Popover/Popover.cjs.js.map +1 -1
- package/dist/components/Popover/Popover.es.js.map +1 -1
- package/dist/components/Popover/Popover.module.scss.cjs.js +2 -2
- package/dist/components/Popover/Popover.module.scss.es.js +3 -3
- package/dist/components/ProgressBar/ProgressBar.cjs.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.es.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.module.scss.cjs.js +2 -2
- package/dist/components/ProgressBar/ProgressBar.module.scss.es.js +9 -9
- package/dist/components/Skeleton/Skeleton.module.scss.cjs.js +2 -2
- package/dist/components/Skeleton/Skeleton.module.scss.es.js +5 -5
- package/dist/components/Spinner/Spinner.module.scss.cjs.js +2 -2
- package/dist/components/Spinner/Spinner.module.scss.es.js +3 -3
- package/dist/components/Stepper/Step.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Step.module.scss.es.js +22 -22
- package/dist/components/Stepper/Stepper.module.scss.cjs.js +2 -2
- package/dist/components/Stepper/Stepper.module.scss.es.js +4 -4
- package/dist/components/Tabs/Tab.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tab.module.scss.es.js +3 -3
- package/dist/components/Tabs/TabButton.cjs.js.map +1 -1
- package/dist/components/Tabs/TabButton.es.js.map +1 -1
- package/dist/components/Tabs/TabButton.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/TabButton.module.scss.es.js +12 -12
- package/dist/components/Tabs/Tabs.cjs.js +1 -1
- package/dist/components/Tabs/Tabs.cjs.js.map +1 -1
- package/dist/components/Tabs/Tabs.es.js +1 -1
- package/dist/components/Tabs/Tabs.es.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.scss.cjs.js +2 -2
- package/dist/components/Tabs/Tabs.module.scss.es.js +10 -10
- package/dist/components/Tag/RemoveButton.module.scss.cjs.js +2 -2
- package/dist/components/Tag/RemoveButton.module.scss.es.js +3 -3
- package/dist/components/Tag/Tag.cjs.js +1 -1
- package/dist/components/Tag/Tag.cjs.js.map +1 -1
- package/dist/components/Tag/Tag.es.js +7 -1
- package/dist/components/Tag/Tag.es.js.map +1 -1
- package/dist/components/Tag/Tag.module.scss.cjs.js +2 -2
- package/dist/components/Tag/Tag.module.scss.es.js +6 -6
- package/dist/components/TextEllipsis/TextEllipsis.cjs.js.map +1 -1
- package/dist/components/TextEllipsis/TextEllipsis.es.js.map +1 -1
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.cjs.js +2 -2
- package/dist/components/TextEllipsis/TextEllipsis.module.scss.es.js +3 -3
- package/dist/components/Tiles/Tile.cjs.js.map +1 -1
- package/dist/components/Tiles/Tile.es.js.map +1 -1
- package/dist/components/Tiles/Tile.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tile.module.scss.es.js +8 -8
- package/dist/components/Tiles/Tiles.module.scss.cjs.js +2 -2
- package/dist/components/Tiles/Tiles.module.scss.es.js +2 -2
- package/dist/components/Tooltip/Tooltip.cjs.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.es.js +47 -39
- package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.scss.cjs.js +2 -2
- package/dist/components/Tooltip/Tooltip.module.scss.es.js +28 -27
- package/dist/components/Tooltip/Tooltip.module.scss.es.js.map +1 -1
- package/dist/components/Typography/Typography.module.scss.cjs.js +2 -2
- package/dist/components/Typography/Typography.module.scss.es.js +13 -13
- package/dist/components/_BaseStyling_/BaseStyling.cjs.js +2 -1
- package/dist/components/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
- package/dist/components/_BaseStyling_/BaseStyling.es.js +3 -3
- package/dist/components/_BaseStyling_/BaseStyling.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNav.module.scss.es.js +5 -5
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js +3 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/ButtonLeftNavItem.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LeftNavItem.module.scss.es.js +14 -14
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js +6 -2
- package/dist/components/admin/layout/LeftNav/LeftNavItem/LinkLeftNavItem.es.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.cjs.js.map +1 -1
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js +7 -6
- package/dist/components/admin/layout/LeftNav/useRefItems.es.js.map +1 -1
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/MicrofrontendContainer/MicrofrontendContainer.module.scss.es.js +3 -3
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/ProfileMenu/ProfileMenu.module.scss.es.js +7 -7
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.cjs.js +2 -2
- package/dist/components/admin/layout/TopNavBar/TopNavBar.module.scss.es.js +13 -13
- package/dist/components/miscellaneous/IdentityProviderButton.cjs.js.map +1 -1
- package/dist/components/miscellaneous/IdentityProviderButton.es.js.map +1 -1
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.cjs.js +2 -2
- package/dist/components/miscellaneous/IdentityProviderButton.module.scss.es.js +3 -3
- package/dist/components/withReadOnly.cjs.js +1 -1
- package/dist/components/withReadOnly.cjs.js.map +1 -1
- package/dist/components/withReadOnly.es.js +2 -4
- package/dist/components/withReadOnly.es.js.map +1 -1
- package/dist/hooks/useClickOutside.cjs.js +1 -1
- package/dist/hooks/useClickOutside.cjs.js.map +1 -1
- package/dist/hooks/useClickOutside.es.js +1 -1
- package/dist/hooks/useClickOutside.es.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js +1 -1
- package/dist/hooks/useDebouncedCallback.cjs.js.map +1 -1
- package/dist/hooks/useDebouncedCallback.es.js +9 -2
- package/dist/hooks/useDebouncedCallback.es.js.map +1 -1
- package/dist/hooks/useGetDomRoot.cjs.js.map +1 -1
- package/dist/hooks/useGetDomRoot.es.js.map +1 -1
- package/dist/hooks/usePosition.cjs.js +1 -1
- package/dist/hooks/usePosition.cjs.js.map +1 -1
- package/dist/hooks/usePosition.es.js +105 -4
- package/dist/hooks/usePosition.es.js.map +1 -1
- package/dist/hooks/useRepeatFocus.cjs.js.map +1 -1
- package/dist/hooks/useRepeatFocus.es.js.map +1 -1
- package/dist/hooks/useScreenSize.cjs.js +1 -1
- package/dist/hooks/useScreenSize.cjs.js.map +1 -1
- package/dist/hooks/useScreenSize.es.js +1 -1
- package/dist/hooks/useScreenSize.es.js.map +1 -1
- package/dist/hooks/useStickyStacking.cjs.js +2 -0
- package/dist/hooks/useStickyStacking.cjs.js.map +1 -0
- package/dist/hooks/useStickyStacking.es.js +208 -0
- package/dist/hooks/useStickyStacking.es.js.map +1 -0
- package/dist/hooks/useUploadFile.cjs.js +1 -1
- package/dist/hooks/useUploadFile.cjs.js.map +1 -1
- package/dist/hooks/useUploadFile.es.js +1 -1
- package/dist/hooks/useUploadFile.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +140 -29
- package/dist/index.es.js +4 -0
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.cjs.js +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.cjs.js.map +1 -1
- package/dist/node_modules/tabbable/dist/index.esm.es.js +4 -3
- package/dist/node_modules/tabbable/dist/index.esm.es.js.map +1 -1
- package/dist/readyclasses.module.scss.cjs.js +2 -2
- package/dist/readyclasses.module.scss.es.js +5 -5
- package/dist/util/helper.cjs.js +1 -1
- package/dist/util/helper.cjs.js.map +1 -1
- package/dist/util/helper.es.js +33 -16
- package/dist/util/helper.es.js.map +1 -1
- package/package.json +12 -12
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.IconButton_sr-only_gLrTA{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.IconButton_hidden_gLrTA{display:none}.IconButton_slide-in_gLrTA{animation:IconButton_slide-in_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.IconButton_slide-in_gLrTA{animation-duration:.1ms}}.IconButton_slide-out_gLrTA{animation:IconButton_slide-out_gLrTA .5s forwards}@media(prefers-reduced-motion:reduce){.IconButton_slide-out_gLrTA{animation-duration:.1ms}}@keyframes IconButton_slide-in_gLrTA{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes IconButton_slide-out_gLrTA{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.IconButton_icon-button_gLrTA{border:var(--button-border-width) var(--button-border-style) transparent;background-color:transparent;padding:0;border-radius:var(--button-border-radius);display:flex;align-items:center;justify-content:center;min-height:auto}.IconButton_icon-button_gLrTA span{vertical-align:top}.IconButton_icon-button_gLrTA.IconButton_button-s_gLrTA{width:calc(1.875 * var(--font-size));height:calc(1.875 * var(--font-size))}.IconButton_icon-button_gLrTA.IconButton_button-s_gLrTA span{font-size:calc(.75 * var(--font-size))}.IconButton_icon-button_gLrTA.IconButton_button-m_gLrTA{width:calc(2.5 * var(--font-size));height:calc(2.5 * var(--font-size))}.IconButton_icon-button_gLrTA.IconButton_button-m_gLrTA span{font-size:var(--font-size)}.IconButton_icon-button_gLrTA.IconButton_button-l_gLrTA{width:calc(3.125 * var(--font-size));height:calc(3.125 * var(--font-size))}.IconButton_icon-button_gLrTA.IconButton_button-l_gLrTA span{font-size:calc(1.375 * var(--font-size))}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA{font-weight:500}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA:not(:disabled){color:var(--button-fill-text-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_primary_gLrTA:not(:disabled){background-color:var(--button-fill-primary-default-color);border-color:var(--button-fill-primary-default-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_primary_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-primary-hover-color);border-color:var(--button-fill-primary-hover-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-primary-focused-color);border-color:var(--button-fill-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_primary_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-primary-pressed-color);border-color:var(--button-fill-primary-pressed-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_success_gLrTA:not(:disabled){background-color:var(--button-fill-success-default-color);border-color:var(--button-fill-success-default-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_success_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-success-hover-color);border-color:var(--button-fill-success-hover-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_success_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_success_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-success-focused-color);border-color:var(--button-fill-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_success_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-success-pressed-color);border-color:var(--button-fill-success-pressed-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_danger_gLrTA:not(:disabled){background-color:var(--button-fill-danger-default-color);border-color:var(--button-fill-danger-default-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_danger_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-danger-hover-color);border-color:var(--button-fill-danger-hover-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-danger-focused-color);border-color:var(--button-fill-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_danger_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){background-color:var(--button-fill-danger-pressed-color);border-color:var(--button-fill-danger-pressed-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_default_gLrTA:not(:disabled){background-color:var(--button-default-color);border-color:var(--button-default-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_default_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){background-color:var(--button-default-hover-color);border-color:var(--button-default-hover-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_default_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_default_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){background-color:var(--button-default-focused-color);border-color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_default_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){background-color:var(--button-default-pressed-color);border-color:var(--button-default-pressed-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_warning_gLrTA:not(:disabled){background-color:var(--button-warning-default-color);border-color:var(--button-warning-default-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_warning_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){background-color:var(--button-warning-hover-color);border-color:var(--button-warning-hover-color)}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){background-color:var(--button-warning-focused-color);border-color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_fill_gLrTA.IconButton_warning_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){background-color:var(--button-warning-pressed-color);border-color:var(--button-warning-pressed-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA{font-weight:500;border-color:transparent;background-color:transparent}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_primary_gLrTA:not(:disabled){color:var(--button-text-primary-default-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_primary_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-text-primary-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-text-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_primary_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-text-primary-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_success_gLrTA:not(:disabled){color:var(--button-text-success-default-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_success_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-text-success-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_success_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_success_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-text-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_success_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-text-success-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_danger_gLrTA:not(:disabled){color:var(--button-text-danger-default-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_danger_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-text-danger-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-text-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_danger_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-text-danger-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_default_gLrTA:not(:disabled){color:var(--button-default-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_default_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-default-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_default_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_default_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_default_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-default-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_warning_gLrTA:not(:disabled){color:var(--button-warning-default-color)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_warning_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-warning-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_text_gLrTA.IconButton_warning_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-warning-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA{font-weight:500;background-color:var(--white)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_primary_gLrTA:not(:disabled){border-color:var(--button-outline-primary-default-color);color:var(--button-outline-primary-default-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_primary_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-outline-primary-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-primary-hover-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_primary_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-outline-primary-focused-color);border-color:var(--button-outline-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_primary_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-outline-primary-pressed-color);border-color:var(--button-outline-primary-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_success_gLrTA:not(:disabled){border-color:var(--button-outline-success-default-color);color:var(--button-outline-success-default-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_success_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-outline-success-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-success-hover-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_success_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_success_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-outline-success-focused-color);border-color:var(--button-outline-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_success_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-outline-success-pressed-color);border-color:var(--button-outline-success-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_danger_gLrTA:not(:disabled){border-color:var(--button-outline-danger-default-color);color:var(--button-outline-danger-default-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_danger_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-outline-danger-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-danger-hover-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_danger_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-outline-danger-focused-color);border-color:var(--button-outline-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_danger_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-outline-danger-pressed-color);border-color:var(--button-outline-danger-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_default_gLrTA:not(:disabled){border-color:var(--button-default-color);color:var(--button-default-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_default_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-default-hover-color);background-color:var(--color-black10);border-color:var(--button-default-hover-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_default_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_default_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-default-focused-color);border-color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_default_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-default-pressed-color);border-color:var(--button-default-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_warning_gLrTA:not(:disabled){border-color:var(--button-warning-default-color);color:var(--button-warning-default-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_warning_gLrTA:not(:disabled):hover:not(.IconButton_disabled_gLrTA){color:var(--button-warning-hover-color);background-color:var(--color-black10);border-color:var(--button-warning-hover-color)}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus:not(.IconButton_disabled_gLrTA),.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_warning_gLrTA:not(:disabled):focus-visible:not(.IconButton_disabled_gLrTA){color:var(--button-warning-focused-color);border-color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_gLrTA.IconButton_outline_gLrTA.IconButton_warning_gLrTA:not(:disabled):active:not(.IconButton_disabled_gLrTA){color:var(--button-warning-pressed-color);border-color:var(--button-warning-pressed-color);background-color:var(--color-black20)}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
-
const hidden = "
|
|
3
|
-
const fill = "
|
|
4
|
-
const primary = "
|
|
5
|
-
const disabled = "
|
|
6
|
-
const success = "
|
|
7
|
-
const danger = "
|
|
8
|
-
const warning = "
|
|
9
|
-
const text = "
|
|
10
|
-
const outline = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.IconButton_sr-only_pZ2y9{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.IconButton_hidden_pZ2y9{display:none}.IconButton_slide-in_pZ2y9{animation:IconButton_slide-in_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.IconButton_slide-in_pZ2y9{animation-duration:.1ms}}.IconButton_slide-out_pZ2y9{animation:IconButton_slide-out_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.IconButton_slide-out_pZ2y9{animation-duration:.1ms}}@keyframes IconButton_slide-in_pZ2y9{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes IconButton_slide-out_pZ2y9{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.IconButton_icon-button_pZ2y9{border:var(--button-border-width) var(--button-border-style) transparent;background-color:transparent;padding:0;border-radius:var(--button-border-radius);display:flex;align-items:center;justify-content:center;min-height:auto}.IconButton_icon-button_pZ2y9 span{vertical-align:top}.IconButton_icon-button_pZ2y9.IconButton_button-s_pZ2y9{width:calc(1.875 * var(--font-size));height:calc(1.875 * var(--font-size))}.IconButton_icon-button_pZ2y9.IconButton_button-s_pZ2y9 span{font-size:calc(.75 * var(--font-size))}.IconButton_icon-button_pZ2y9.IconButton_button-m_pZ2y9{width:calc(2.5 * var(--font-size));height:calc(2.5 * var(--font-size))}.IconButton_icon-button_pZ2y9.IconButton_button-m_pZ2y9 span{font-size:var(--font-size)}.IconButton_icon-button_pZ2y9.IconButton_button-l_pZ2y9{width:calc(3.125 * var(--font-size));height:calc(3.125 * var(--font-size))}.IconButton_icon-button_pZ2y9.IconButton_button-l_pZ2y9 span{font-size:calc(1.375 * var(--font-size))}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9{font-weight:500}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9:not(:disabled){color:var(--button-fill-text-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_primary_pZ2y9:not(:disabled){background-color:var(--button-fill-primary-default-color);border-color:var(--button-fill-primary-default-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-primary-hover-color);border-color:var(--button-fill-primary-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-primary-focused-color);border-color:var(--button-fill-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-primary-pressed-color);border-color:var(--button-fill-primary-pressed-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_success_pZ2y9:not(:disabled){background-color:var(--button-fill-success-default-color);border-color:var(--button-fill-success-default-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_success_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-success-hover-color);border-color:var(--button-fill-success-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-success-focused-color);border-color:var(--button-fill-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_success_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-success-pressed-color);border-color:var(--button-fill-success-pressed-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_danger_pZ2y9:not(:disabled){background-color:var(--button-fill-danger-default-color);border-color:var(--button-fill-danger-default-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-danger-hover-color);border-color:var(--button-fill-danger-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-danger-focused-color);border-color:var(--button-fill-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){background-color:var(--button-fill-danger-pressed-color);border-color:var(--button-fill-danger-pressed-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_default_pZ2y9:not(:disabled){background-color:var(--button-default-color);border-color:var(--button-default-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_default_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){background-color:var(--button-default-hover-color);border-color:var(--button-default-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){background-color:var(--button-default-focused-color);border-color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_default_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){background-color:var(--button-default-pressed-color);border-color:var(--button-default-pressed-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_warning_pZ2y9:not(:disabled){background-color:var(--button-warning-default-color);border-color:var(--button-warning-default-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){background-color:var(--button-warning-hover-color);border-color:var(--button-warning-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){background-color:var(--button-warning-focused-color);border-color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_fill_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){background-color:var(--button-warning-pressed-color);border-color:var(--button-warning-pressed-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9{font-weight:500;border-color:transparent;background-color:transparent}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_primary_pZ2y9:not(:disabled){color:var(--button-text-primary-default-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-text-primary-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-text-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-text-primary-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_success_pZ2y9:not(:disabled){color:var(--button-text-success-default-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_success_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-text-success-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-text-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_success_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-text-success-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_danger_pZ2y9:not(:disabled){color:var(--button-text-danger-default-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-text-danger-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-text-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-text-danger-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_default_pZ2y9:not(:disabled){color:var(--button-default-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_default_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-default-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_default_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-default-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_warning_pZ2y9:not(:disabled){color:var(--button-warning-default-color)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-hover-color);background-color:var(--color-black10)}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_text_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9{font-weight:500;background-color:var(--white)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_primary_pZ2y9:not(:disabled){border-color:var(--button-outline-primary-default-color);color:var(--button-outline-primary-default-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-primary-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-primary-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-primary-focused-color);border-color:var(--button-outline-primary-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_primary_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-primary-pressed-color);border-color:var(--button-outline-primary-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_success_pZ2y9:not(:disabled){border-color:var(--button-outline-success-default-color);color:var(--button-outline-success-default-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_success_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-success-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-success-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_success_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-success-focused-color);border-color:var(--button-outline-success-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_success_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-success-pressed-color);border-color:var(--button-outline-success-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_danger_pZ2y9:not(:disabled){border-color:var(--button-outline-danger-default-color);color:var(--button-outline-danger-default-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-danger-hover-color);background-color:var(--color-black10);border-color:var(--button-outline-danger-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-danger-focused-color);border-color:var(--button-outline-danger-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_danger_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-outline-danger-pressed-color);border-color:var(--button-outline-danger-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_default_pZ2y9:not(:disabled){border-color:var(--button-default-color);color:var(--button-default-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_default_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-default-hover-color);background-color:var(--color-black10);border-color:var(--button-default-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_default_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-default-focused-color);border-color:var(--button-default-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_default_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-default-pressed-color);border-color:var(--button-default-pressed-color);background-color:var(--color-black20)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_warning_pZ2y9:not(:disabled){border-color:var(--button-warning-default-color);color:var(--button-warning-default-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):hover:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-hover-color);background-color:var(--color-black10);border-color:var(--button-warning-hover-color)}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus:not(.IconButton_disabled_pZ2y9),.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):focus-visible:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-focused-color);border-color:var(--button-warning-focused-color);position:relative;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:calc(.125 * var(--font-size));z-index:2}.IconButton_icon-button_pZ2y9.IconButton_outline_pZ2y9.IconButton_warning_pZ2y9:not(:disabled):active:not(.IconButton_disabled_pZ2y9){color:var(--button-warning-pressed-color);border-color:var(--button-warning-pressed-color);background-color:var(--color-black20)}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
const hidden = "IconButton_hidden_pZ2y9";
|
|
3
|
+
const fill = "IconButton_fill_pZ2y9";
|
|
4
|
+
const primary = "IconButton_primary_pZ2y9";
|
|
5
|
+
const disabled = "IconButton_disabled_pZ2y9";
|
|
6
|
+
const success = "IconButton_success_pZ2y9";
|
|
7
|
+
const danger = "IconButton_danger_pZ2y9";
|
|
8
|
+
const warning = "IconButton_warning_pZ2y9";
|
|
9
|
+
const text = "IconButton_text_pZ2y9";
|
|
10
|
+
const outline = "IconButton_outline_pZ2y9";
|
|
11
11
|
const classes = {
|
|
12
|
-
"sr-only": "IconButton_sr-
|
|
12
|
+
"sr-only": "IconButton_sr-only_pZ2y9",
|
|
13
13
|
hidden,
|
|
14
|
-
"slide-in": "IconButton_slide-
|
|
15
|
-
"slide-out": "IconButton_slide-
|
|
16
|
-
"icon-button": "IconButton_icon-
|
|
17
|
-
"button-s": "IconButton_button-
|
|
18
|
-
"button-m": "IconButton_button-
|
|
19
|
-
"button-l": "IconButton_button-
|
|
14
|
+
"slide-in": "IconButton_slide-in_pZ2y9",
|
|
15
|
+
"slide-out": "IconButton_slide-out_pZ2y9",
|
|
16
|
+
"icon-button": "IconButton_icon-button_pZ2y9",
|
|
17
|
+
"button-s": "IconButton_button-s_pZ2y9",
|
|
18
|
+
"button-m": "IconButton_button-m_pZ2y9",
|
|
19
|
+
"button-l": "IconButton_button-l_pZ2y9",
|
|
20
20
|
fill,
|
|
21
21
|
primary,
|
|
22
22
|
disabled,
|
|
23
23
|
success,
|
|
24
24
|
danger,
|
|
25
|
-
"default": "
|
|
25
|
+
"default": "IconButton_default_pZ2y9",
|
|
26
26
|
warning,
|
|
27
27
|
text,
|
|
28
28
|
outline
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Props as ButtonProps } from \"../Button/Button\";\nimport { Props as IconButtonProps } from \"../Button/IconButton\";\nimport { Popover, Props as PopoverProps } from \"../Popover/Popover\";\nimport { Placement, Offset } from \"../../hooks/usePosition\";\nimport classes from \"./ContextMenu.module.scss\";\nimport { useClickOutside } from \"../../hooks/useClickOutside\";\nimport { Props as ContextMenuItemProps } from \"./ContextMenuItem\";\nimport { ContextMenuDivider } from \"./ContextMenuDivider\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../hooks/useGetDomRoot\";\nimport { useArrowNavigation, useDefaultOffset, useFocusAnchorElement } from \"./ContextMenuService\";\nimport { generateID } from \"../../util/helper\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"div\">, \"onChange\"> {\n ariaLabel?: string;\n trigger: ReactElement<ButtonProps> | ReactElement<IconButtonProps>;\n decorativeElement?: ReactNode;\n children:\n | ReactElement<ContextMenuItemProps>\n | ReactElement<typeof ContextMenuDivider>\n | (ReactElement<ContextMenuItemProps> | ReactElement<typeof ContextMenuDivider>)[];\n placement?: Placement;\n transformOrigin?: Placement;\n offset?: Offset;\n debounceAmount?: number;\n id?: string;\n show?: boolean;\n domRoot?: HTMLElement;\n onShow?: () => void;\n onClose?: () => void;\n popoverProps?: PopoverProps;\n value?: number;\n onChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n showChevron?: boolean;\n}\n\nconst ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n trigger,\n children,\n decorativeElement,\n id = `ID-${generateID()}`,\n show = false,\n onShow,\n onClose,\n placement = { horizontal: \"right\", vertical: \"top\" },\n offset,\n transformOrigin = { horizontal: \"left\", vertical: \"top\" },\n debounceAmount,\n domRoot,\n popoverProps,\n value,\n onChange,\n ariaLabel,\n showChevron = false,\n ...rest\n }: Props,\n ref\n) => {\n const anchorEl = useRef<HTMLButtonElement>(null);\n const wrappingDivRef = (ref as RefObject<HTMLDivElement>) || createRef<HTMLDivElement>();\n const [showContextMenu, setShowContextMenu] = useState(show);\n const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);\n const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the \"click\" listener in ContextMenuItem component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n\n const childrenCount = React.Children.toArray(children).filter(\n child => React.isValidElement(child) && child.type !== ContextMenuDivider\n ).length;\n\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n\n const syncSelectedContextMenuItem = setSelectedContextMenuItem;\n\n useEffect(() => {\n value !== undefined && syncSelectedContextMenuItem(value);\n }, [value]);\n\n const { calculateDefaultOffset } = useDefaultOffset();\n const calculatedOffset = offset ?? calculateDefaultOffset(placement, transformOrigin);\n\n const { onArrowNavigation } = useArrowNavigation({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n });\n\n useClickOutside(anchorEl, () => {\n if (showContextMenu) {\n setShowContextMenu(false);\n }\n }, [showContextMenu]);\n\n useFocusAnchorElement(\n anchorEl,\n id,\n showContextMenu,\n setShowContextMenu,\n setFocusedContextMenuItem,\n onShow,\n onClose\n );\n\n const renderTrigger = () => {\n const triggerProps = {\n id: id,\n \"aria-haspopup\": \"true\" as const,\n \"aria-controls\": `${id}-menu`,\n \"aria-expanded\": showContextMenu,\n \"aria-label\": ariaLabel,\n onClick: () => setShowContextMenu(!showContextMenu),\n tabIndex: 0,\n ref: anchorEl\n };\n\n if (showChevron) {\n const chevronIcon = (\n <Icon\n key=\"context-menu-chevron\"\n className={classes[\"chevron\"]}\n icon={showContextMenu ? Icons.ChevronUp : Icons.ChevronDown}\n />\n );\n const existingChildren = React.Children.toArray(trigger.props.children);\n return React.cloneElement(trigger, triggerProps, ...existingChildren, chevronIcon);\n }\n\n return React.cloneElement(trigger, triggerProps);\n };\n\n const renderChildren = () => {\n let itemIndex = 0;\n return React.Children.map(children, child => {\n if (React.isValidElement(child) && child.type === ContextMenuDivider) {\n return child;\n }\n\n const menuItem = child as ReactElement<ContextMenuItemProps>;\n const currentItemIndex = itemIndex;\n itemIndex++;\n\n return React.cloneElement(menuItem, {\n onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),\n onSelectedChange: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => {\n setSelectedContextMenuItem(childIndex);\n setShouldClick(false);\n onChange?.(event, childIndex);\n },\n childIndex: currentItemIndex,\n hasFocus: focusedContextMenuItem === currentItemIndex,\n isSelected: selectedContextMenuItem === currentItemIndex,\n showActiveState:\n menuItem.props.showActiveState ??\n (value !== undefined && selectedContextMenuItem === currentItemIndex),\n contextMenuOpened: showContextMenu,\n shouldClick: shouldClick,\n autoFocus: showContextMenu && currentItemIndex === 0\n });\n });\n };\n\n const onOutOfViewHandler = useCallback(() => {\n setShowContextMenu(false);\n }, []);\n\n if (!root) {\n return null;\n }\n\n return (\n <div\n {...rest}\n ref={wrappingDivRef}\n onKeyDown={onArrowNavigation}\n className={classes[\"context-menu\"]}\n >\n {renderTrigger()}\n {createPortal(\n <Popover\n {...popoverProps}\n placement={placement}\n transformOrigin={transformOrigin}\n offset={calculatedOffset}\n anchorEl={anchorEl}\n debounceAmount={debounceAmount}\n show={showContextMenu}\n onAnchorOutOfView={onOutOfViewHandler}\n >\n {decorativeElement && (\n <div className={classes[\"decorative-element\"]}>{decorativeElement}</div>\n )}\n <ul\n className={`${classes[\"menu\"]} ${decorativeElement ? classes[\"no-margin-top\"] : \"\"}`}\n id={`${id}-menu`}\n aria-describedby={id}\n role=\"menu\"\n >\n {renderChildren()}\n </ul>\n </Popover>,\n root\n )}\n </div>\n );\n};\n\nexport const ContextMenu = React.forwardRef(ContextMenuComponent);\n"],"names":["ContextMenu","React","forwardRef","trigger","children","decorativeElement","id","generateID","show","onShow","onClose","placement","horizontal","vertical","offset","transformOrigin","debounceAmount","domRoot","popoverProps","value","onChange","ariaLabel","showChevron","rest","ref","anchorEl","useRef","wrappingDivRef","createRef","showContextMenu","setShowContextMenu","useState","selectedContextMenuItem","setSelectedContextMenuItem","focusedContextMenuItem","setFocusedContextMenuItem","shouldClick","setShouldClick","childrenCount","Children","toArray","filter","isValidElement","child","type","ContextMenuDivider","length","root","useGetDomRoot","syncSelectedContextMenuItem","useEffect","calculateDefaultOffset","useDefaultOffset","calculatedOffset","onArrowNavigation","useArrowNavigation","useClickOutside","useFocusAnchorElement","onOutOfViewHandler","useCallback","createElement","onKeyDown","className","classes","triggerProps","onClick","tabIndex","chevronIcon","Icon","key","icon","Icons","ChevronUp","ChevronDown","existingChildren","props","cloneElement","renderTrigger","createPortal","Popover","onAnchorOutOfView","role","itemIndex","map","menuItem","currentItemIndex","onFocusChange","childIndex","onSelectedChange","event","hasFocus","isSelected","showActiveState","contextMenuOpened","autoFocus","renderChildren"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"ContextMenu.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Props as ButtonProps } from \"../Button/Button\";\nimport { Props as IconButtonProps } from \"../Button/IconButton\";\nimport { Popover, Props as PopoverProps } from \"../Popover/Popover\";\nimport { Placement, Offset } from \"../../hooks/usePosition\";\nimport classes from \"./ContextMenu.module.scss\";\nimport { useClickOutside } from \"../../hooks/useClickOutside\";\nimport { Props as ContextMenuItemProps } from \"./ContextMenuItem\";\nimport { ContextMenuDivider } from \"./ContextMenuDivider\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../hooks/useGetDomRoot\";\nimport { useArrowNavigation, useDefaultOffset, useFocusAnchorElement } from \"./ContextMenuService\";\nimport { generateID } from \"../../util/helper\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"div\">, \"onChange\"> {\n ariaLabel?: string;\n trigger: ReactElement<ButtonProps> | ReactElement<IconButtonProps>;\n decorativeElement?: ReactNode;\n children:\n | ReactElement<ContextMenuItemProps>\n | ReactElement<typeof ContextMenuDivider>\n | (ReactElement<ContextMenuItemProps> | ReactElement<typeof ContextMenuDivider>)[];\n placement?: Placement;\n transformOrigin?: Placement;\n offset?: Offset;\n debounceAmount?: number;\n id?: string;\n show?: boolean;\n domRoot?: HTMLElement;\n onShow?: () => void;\n onClose?: () => void;\n popoverProps?: PopoverProps;\n value?: number;\n onChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n showChevron?: boolean;\n}\n\nconst ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n trigger,\n children,\n decorativeElement,\n id = `ID-${generateID()}`,\n show = false,\n onShow,\n onClose,\n placement = { horizontal: \"right\", vertical: \"top\" },\n offset,\n transformOrigin = { horizontal: \"left\", vertical: \"top\" },\n debounceAmount,\n domRoot,\n popoverProps,\n value,\n onChange,\n ariaLabel,\n showChevron = false,\n ...rest\n }: Props,\n ref\n) => {\n const anchorEl = useRef<HTMLButtonElement>(null);\n const wrappingDivRef = (ref as RefObject<HTMLDivElement | null>) || createRef<HTMLDivElement>();\n const [showContextMenu, setShowContextMenu] = useState(show);\n const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);\n const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the \"click\" listener in ContextMenuItem component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n\n const childrenCount = React.Children.toArray(children).filter(\n child => React.isValidElement(child) && child.type !== ContextMenuDivider\n ).length;\n\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n\n const syncSelectedContextMenuItem = setSelectedContextMenuItem;\n\n useEffect(() => {\n value !== undefined && syncSelectedContextMenuItem(value);\n }, [value]);\n\n const { calculateDefaultOffset } = useDefaultOffset();\n const calculatedOffset = offset ?? calculateDefaultOffset(placement, transformOrigin);\n\n const { onArrowNavigation } = useArrowNavigation({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n });\n\n useClickOutside(anchorEl, () => {\n if (showContextMenu) {\n setShowContextMenu(false);\n }\n }, [showContextMenu]);\n\n useFocusAnchorElement(\n anchorEl,\n id,\n showContextMenu,\n setShowContextMenu,\n setFocusedContextMenuItem,\n onShow,\n onClose\n );\n\n const renderTrigger = () => {\n const triggerProps = {\n id: id,\n \"aria-haspopup\": \"true\" as const,\n \"aria-controls\": `${id}-menu`,\n \"aria-expanded\": showContextMenu,\n \"aria-label\": ariaLabel,\n onClick: () => setShowContextMenu(!showContextMenu),\n tabIndex: 0,\n ref: anchorEl\n };\n\n if (showChevron) {\n const chevronIcon = (\n <Icon\n key=\"context-menu-chevron\"\n className={classes[\"chevron\"]}\n icon={showContextMenu ? Icons.ChevronUp : Icons.ChevronDown}\n />\n );\n const existingChildren = React.Children.toArray(trigger.props.children);\n return React.cloneElement(trigger, triggerProps, ...existingChildren, chevronIcon);\n }\n\n return React.cloneElement(trigger, triggerProps);\n };\n\n const renderChildren = () => {\n let itemIndex = 0;\n return React.Children.map(children, child => {\n if (React.isValidElement(child) && child.type === ContextMenuDivider) {\n return child;\n }\n\n const menuItem = child as ReactElement<ContextMenuItemProps>;\n const currentItemIndex = itemIndex;\n itemIndex++;\n\n return React.cloneElement(menuItem, {\n onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),\n onSelectedChange: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => {\n setSelectedContextMenuItem(childIndex);\n setShouldClick(false);\n onChange?.(event, childIndex);\n },\n childIndex: currentItemIndex,\n hasFocus: focusedContextMenuItem === currentItemIndex,\n isSelected: selectedContextMenuItem === currentItemIndex,\n showActiveState:\n menuItem.props.showActiveState ??\n (value !== undefined && selectedContextMenuItem === currentItemIndex),\n contextMenuOpened: showContextMenu,\n shouldClick: shouldClick,\n autoFocus: showContextMenu && currentItemIndex === 0\n });\n });\n };\n\n const onOutOfViewHandler = useCallback(() => {\n setShowContextMenu(false);\n }, []);\n\n if (!root) {\n return null;\n }\n\n return (\n <div // NOSONAR S6848 - event-delegation wrapper only; keystrokes bubble up from the already-focusable trigger and menu items. Adding a role/tabIndex here would create a second, spurious tab stop.\n {...rest}\n ref={wrappingDivRef}\n onKeyDown={onArrowNavigation}\n className={classes[\"context-menu\"]}\n >\n {renderTrigger()}\n {createPortal(\n <Popover\n {...popoverProps}\n placement={placement}\n transformOrigin={transformOrigin}\n offset={calculatedOffset}\n anchorEl={anchorEl}\n debounceAmount={debounceAmount}\n show={showContextMenu}\n onAnchorOutOfView={onOutOfViewHandler}\n >\n {decorativeElement && (\n <div className={classes[\"decorative-element\"]}>{decorativeElement}</div>\n )}\n <ul\n className={`${classes[\"menu\"]} ${decorativeElement ? classes[\"no-margin-top\"] : \"\"}`}\n id={`${id}-menu`}\n aria-describedby={id}\n role=\"menu\" // NOSONAR S6842 - required by the ARIA menu pattern; the trigger's aria-controls and ContextMenuService's closest(\"#${id}-menu\") focus-return both depend on this role/id pairing.\n >\n {renderChildren()}\n </ul>\n </Popover>,\n root\n )}\n </div>\n );\n};\n\nexport const ContextMenu = React.forwardRef(ContextMenuComponent);\n"],"names":["ContextMenu","React","forwardRef","trigger","children","decorativeElement","id","generateID","show","onShow","onClose","placement","horizontal","vertical","offset","transformOrigin","debounceAmount","domRoot","popoverProps","value","onChange","ariaLabel","showChevron","rest","ref","anchorEl","useRef","wrappingDivRef","createRef","showContextMenu","setShowContextMenu","useState","selectedContextMenuItem","setSelectedContextMenuItem","focusedContextMenuItem","setFocusedContextMenuItem","shouldClick","setShouldClick","childrenCount","Children","toArray","filter","isValidElement","child","type","ContextMenuDivider","length","root","useGetDomRoot","syncSelectedContextMenuItem","useEffect","calculateDefaultOffset","useDefaultOffset","calculatedOffset","onArrowNavigation","useArrowNavigation","useClickOutside","useFocusAnchorElement","onOutOfViewHandler","useCallback","createElement","onKeyDown","className","classes","triggerProps","onClick","tabIndex","chevronIcon","Icon","key","icon","Icons","ChevronUp","ChevronDown","existingChildren","props","cloneElement","renderTrigger","createPortal","Popover","onAnchorOutOfView","role","itemIndex","map","menuItem","currentItemIndex","onFocusChange","childIndex","onSelectedChange","event","hasFocus","isSelected","showActiveState","contextMenuOpened","autoFocus","renderChildren"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.es.js","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Props as ButtonProps } from \"../Button/Button\";\nimport { Props as IconButtonProps } from \"../Button/IconButton\";\nimport { Popover, Props as PopoverProps } from \"../Popover/Popover\";\nimport { Placement, Offset } from \"../../hooks/usePosition\";\nimport classes from \"./ContextMenu.module.scss\";\nimport { useClickOutside } from \"../../hooks/useClickOutside\";\nimport { Props as ContextMenuItemProps } from \"./ContextMenuItem\";\nimport { ContextMenuDivider } from \"./ContextMenuDivider\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../hooks/useGetDomRoot\";\nimport { useArrowNavigation, useDefaultOffset, useFocusAnchorElement } from \"./ContextMenuService\";\nimport { generateID } from \"../../util/helper\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"div\">, \"onChange\"> {\n ariaLabel?: string;\n trigger: ReactElement<ButtonProps> | ReactElement<IconButtonProps>;\n decorativeElement?: ReactNode;\n children:\n | ReactElement<ContextMenuItemProps>\n | ReactElement<typeof ContextMenuDivider>\n | (ReactElement<ContextMenuItemProps> | ReactElement<typeof ContextMenuDivider>)[];\n placement?: Placement;\n transformOrigin?: Placement;\n offset?: Offset;\n debounceAmount?: number;\n id?: string;\n show?: boolean;\n domRoot?: HTMLElement;\n onShow?: () => void;\n onClose?: () => void;\n popoverProps?: PopoverProps;\n value?: number;\n onChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n showChevron?: boolean;\n}\n\nconst ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n trigger,\n children,\n decorativeElement,\n id = `ID-${generateID()}`,\n show = false,\n onShow,\n onClose,\n placement = { horizontal: \"right\", vertical: \"top\" },\n offset,\n transformOrigin = { horizontal: \"left\", vertical: \"top\" },\n debounceAmount,\n domRoot,\n popoverProps,\n value,\n onChange,\n ariaLabel,\n showChevron = false,\n ...rest\n }: Props,\n ref\n) => {\n const anchorEl = useRef<HTMLButtonElement>(null);\n const wrappingDivRef = (ref as RefObject<HTMLDivElement>) || createRef<HTMLDivElement>();\n const [showContextMenu, setShowContextMenu] = useState(show);\n const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);\n const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the \"click\" listener in ContextMenuItem component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n\n const childrenCount = React.Children.toArray(children).filter(\n child => React.isValidElement(child) && child.type !== ContextMenuDivider\n ).length;\n\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n\n const syncSelectedContextMenuItem = setSelectedContextMenuItem;\n\n useEffect(() => {\n value !== undefined && syncSelectedContextMenuItem(value);\n }, [value]);\n\n const { calculateDefaultOffset } = useDefaultOffset();\n const calculatedOffset = offset ?? calculateDefaultOffset(placement, transformOrigin);\n\n const { onArrowNavigation } = useArrowNavigation({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n });\n\n useClickOutside(anchorEl, () => {\n if (showContextMenu) {\n setShowContextMenu(false);\n }\n }, [showContextMenu]);\n\n useFocusAnchorElement(\n anchorEl,\n id,\n showContextMenu,\n setShowContextMenu,\n setFocusedContextMenuItem,\n onShow,\n onClose\n );\n\n const renderTrigger = () => {\n const triggerProps = {\n id: id,\n \"aria-haspopup\": \"true\" as const,\n \"aria-controls\": `${id}-menu`,\n \"aria-expanded\": showContextMenu,\n \"aria-label\": ariaLabel,\n onClick: () => setShowContextMenu(!showContextMenu),\n tabIndex: 0,\n ref: anchorEl\n };\n\n if (showChevron) {\n const chevronIcon = (\n <Icon\n key=\"context-menu-chevron\"\n className={classes[\"chevron\"]}\n icon={showContextMenu ? Icons.ChevronUp : Icons.ChevronDown}\n />\n );\n const existingChildren = React.Children.toArray(trigger.props.children);\n return React.cloneElement(trigger, triggerProps, ...existingChildren, chevronIcon);\n }\n\n return React.cloneElement(trigger, triggerProps);\n };\n\n const renderChildren = () => {\n let itemIndex = 0;\n return React.Children.map(children, child => {\n if (React.isValidElement(child) && child.type === ContextMenuDivider) {\n return child;\n }\n\n const menuItem = child as ReactElement<ContextMenuItemProps>;\n const currentItemIndex = itemIndex;\n itemIndex++;\n\n return React.cloneElement(menuItem, {\n onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),\n onSelectedChange: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => {\n setSelectedContextMenuItem(childIndex);\n setShouldClick(false);\n onChange?.(event, childIndex);\n },\n childIndex: currentItemIndex,\n hasFocus: focusedContextMenuItem === currentItemIndex,\n isSelected: selectedContextMenuItem === currentItemIndex,\n showActiveState:\n menuItem.props.showActiveState ??\n (value !== undefined && selectedContextMenuItem === currentItemIndex),\n contextMenuOpened: showContextMenu,\n shouldClick: shouldClick,\n autoFocus: showContextMenu && currentItemIndex === 0\n });\n });\n };\n\n const onOutOfViewHandler = useCallback(() => {\n setShowContextMenu(false);\n }, []);\n\n if (!root) {\n return null;\n }\n\n return (\n <div\n {...rest}\n ref={wrappingDivRef}\n onKeyDown={onArrowNavigation}\n className={classes[\"context-menu\"]}\n >\n {renderTrigger()}\n {createPortal(\n <Popover\n {...popoverProps}\n placement={placement}\n transformOrigin={transformOrigin}\n offset={calculatedOffset}\n anchorEl={anchorEl}\n debounceAmount={debounceAmount}\n show={showContextMenu}\n onAnchorOutOfView={onOutOfViewHandler}\n >\n {decorativeElement && (\n <div className={classes[\"decorative-element\"]}>{decorativeElement}</div>\n )}\n <ul\n className={`${classes[\"menu\"]} ${decorativeElement ? classes[\"no-margin-top\"] : \"\"}`}\n id={`${id}-menu`}\n aria-describedby={id}\n role=\"menu\"\n >\n {renderChildren()}\n </ul>\n </Popover>,\n root\n )}\n </div>\n );\n};\n\nexport const ContextMenu = React.forwardRef(ContextMenuComponent);\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"ContextMenu.es.js","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from \"react\";\nimport { Props as ButtonProps } from \"../Button/Button\";\nimport { Props as IconButtonProps } from \"../Button/IconButton\";\nimport { Popover, Props as PopoverProps } from \"../Popover/Popover\";\nimport { Placement, Offset } from \"../../hooks/usePosition\";\nimport classes from \"./ContextMenu.module.scss\";\nimport { useClickOutside } from \"../../hooks/useClickOutside\";\nimport { Props as ContextMenuItemProps } from \"./ContextMenuItem\";\nimport { ContextMenuDivider } from \"./ContextMenuDivider\";\nimport { createPortal } from \"react-dom\";\nimport { useGetDomRoot } from \"../../hooks/useGetDomRoot\";\nimport { useArrowNavigation, useDefaultOffset, useFocusAnchorElement } from \"./ContextMenuService\";\nimport { generateID } from \"../../util/helper\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"div\">, \"onChange\"> {\n ariaLabel?: string;\n trigger: ReactElement<ButtonProps> | ReactElement<IconButtonProps>;\n decorativeElement?: ReactNode;\n children:\n | ReactElement<ContextMenuItemProps>\n | ReactElement<typeof ContextMenuDivider>\n | (ReactElement<ContextMenuItemProps> | ReactElement<typeof ContextMenuDivider>)[];\n placement?: Placement;\n transformOrigin?: Placement;\n offset?: Offset;\n debounceAmount?: number;\n id?: string;\n show?: boolean;\n domRoot?: HTMLElement;\n onShow?: () => void;\n onClose?: () => void;\n popoverProps?: PopoverProps;\n value?: number;\n onChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n showChevron?: boolean;\n}\n\nconst ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (\n {\n trigger,\n children,\n decorativeElement,\n id = `ID-${generateID()}`,\n show = false,\n onShow,\n onClose,\n placement = { horizontal: \"right\", vertical: \"top\" },\n offset,\n transformOrigin = { horizontal: \"left\", vertical: \"top\" },\n debounceAmount,\n domRoot,\n popoverProps,\n value,\n onChange,\n ariaLabel,\n showChevron = false,\n ...rest\n }: Props,\n ref\n) => {\n const anchorEl = useRef<HTMLButtonElement>(null);\n const wrappingDivRef = (ref as RefObject<HTMLDivElement | null>) || createRef<HTMLDivElement>();\n const [showContextMenu, setShowContextMenu] = useState(show);\n const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);\n const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);\n const [shouldClick, setShouldClick] =\n useState(\n false\n ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the \"click\" listener in ContextMenuItem component. Instead, we only want this to fire if we press \"enter\" or \"spacebar\" so we set this to true whenever that is the case, and back to false when it has been executed. */\n\n const childrenCount = React.Children.toArray(children).filter(\n child => React.isValidElement(child) && child.type !== ContextMenuDivider\n ).length;\n\n const { root } = useGetDomRoot(domRoot, wrappingDivRef);\n\n const syncSelectedContextMenuItem = setSelectedContextMenuItem;\n\n useEffect(() => {\n value !== undefined && syncSelectedContextMenuItem(value);\n }, [value]);\n\n const { calculateDefaultOffset } = useDefaultOffset();\n const calculatedOffset = offset ?? calculateDefaultOffset(placement, transformOrigin);\n\n const { onArrowNavigation } = useArrowNavigation({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n });\n\n useClickOutside(anchorEl, () => {\n if (showContextMenu) {\n setShowContextMenu(false);\n }\n }, [showContextMenu]);\n\n useFocusAnchorElement(\n anchorEl,\n id,\n showContextMenu,\n setShowContextMenu,\n setFocusedContextMenuItem,\n onShow,\n onClose\n );\n\n const renderTrigger = () => {\n const triggerProps = {\n id: id,\n \"aria-haspopup\": \"true\" as const,\n \"aria-controls\": `${id}-menu`,\n \"aria-expanded\": showContextMenu,\n \"aria-label\": ariaLabel,\n onClick: () => setShowContextMenu(!showContextMenu),\n tabIndex: 0,\n ref: anchorEl\n };\n\n if (showChevron) {\n const chevronIcon = (\n <Icon\n key=\"context-menu-chevron\"\n className={classes[\"chevron\"]}\n icon={showContextMenu ? Icons.ChevronUp : Icons.ChevronDown}\n />\n );\n const existingChildren = React.Children.toArray(trigger.props.children);\n return React.cloneElement(trigger, triggerProps, ...existingChildren, chevronIcon);\n }\n\n return React.cloneElement(trigger, triggerProps);\n };\n\n const renderChildren = () => {\n let itemIndex = 0;\n return React.Children.map(children, child => {\n if (React.isValidElement(child) && child.type === ContextMenuDivider) {\n return child;\n }\n\n const menuItem = child as ReactElement<ContextMenuItemProps>;\n const currentItemIndex = itemIndex;\n itemIndex++;\n\n return React.cloneElement(menuItem, {\n onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),\n onSelectedChange: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => {\n setSelectedContextMenuItem(childIndex);\n setShouldClick(false);\n onChange?.(event, childIndex);\n },\n childIndex: currentItemIndex,\n hasFocus: focusedContextMenuItem === currentItemIndex,\n isSelected: selectedContextMenuItem === currentItemIndex,\n showActiveState:\n menuItem.props.showActiveState ??\n (value !== undefined && selectedContextMenuItem === currentItemIndex),\n contextMenuOpened: showContextMenu,\n shouldClick: shouldClick,\n autoFocus: showContextMenu && currentItemIndex === 0\n });\n });\n };\n\n const onOutOfViewHandler = useCallback(() => {\n setShowContextMenu(false);\n }, []);\n\n if (!root) {\n return null;\n }\n\n return (\n <div // NOSONAR S6848 - event-delegation wrapper only; keystrokes bubble up from the already-focusable trigger and menu items. Adding a role/tabIndex here would create a second, spurious tab stop.\n {...rest}\n ref={wrappingDivRef}\n onKeyDown={onArrowNavigation}\n className={classes[\"context-menu\"]}\n >\n {renderTrigger()}\n {createPortal(\n <Popover\n {...popoverProps}\n placement={placement}\n transformOrigin={transformOrigin}\n offset={calculatedOffset}\n anchorEl={anchorEl}\n debounceAmount={debounceAmount}\n show={showContextMenu}\n onAnchorOutOfView={onOutOfViewHandler}\n >\n {decorativeElement && (\n <div className={classes[\"decorative-element\"]}>{decorativeElement}</div>\n )}\n <ul\n className={`${classes[\"menu\"]} ${decorativeElement ? classes[\"no-margin-top\"] : \"\"}`}\n id={`${id}-menu`}\n aria-describedby={id}\n role=\"menu\" // NOSONAR S6842 - required by the ARIA menu pattern; the trigger's aria-controls and ContextMenuService's closest(\"#${id}-menu\") focus-return both depend on this role/id pairing.\n >\n {renderChildren()}\n </ul>\n </Popover>,\n root\n )}\n </div>\n );\n};\n\nexport const ContextMenu = React.forwardRef(ContextMenuComponent);\n"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenu_context-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenu_context-menu_pZ2y9{position:relative;display:inline-block;box-sizing:border-box}.ContextMenu_menu_pZ2y9{white-space:nowrap;margin:.25rem 0;list-style:none;padding:0;min-width:10rem}.ContextMenu_menu_pZ2y9.ContextMenu_no-margin-top_pZ2y9{margin:0 0 .25rem}.ContextMenu_menu_pZ2y9 button{text-align:left}.ContextMenu_decorative-element_pZ2y9{margin-top:.5rem}.ContextMenu_chevron_pZ2y9{font-size:.75rem;color:var(--default);pointer-events:none;margin-left:.5rem}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="ContextMenu_menu_pZ2y9",t="ContextMenu_chevron_pZ2y9",n={"context-menu":"ContextMenu_context-menu_pZ2y9",menu:e,"no-margin-top":"ContextMenu_no-margin-top_pZ2y9","decorative-element":"ContextMenu_decorative-element_pZ2y9",chevron:t};exports.chevron=t,exports.default=n,exports.menu=e;
|
|
3
3
|
//# sourceMappingURL=ContextMenu.module.scss.cjs.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenu_context-
|
|
2
|
-
const menu = "
|
|
3
|
-
const chevron = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenu_context-menu_pZ2y9{position:relative;display:inline-block;box-sizing:border-box}.ContextMenu_menu_pZ2y9{white-space:nowrap;margin:.25rem 0;list-style:none;padding:0;min-width:10rem}.ContextMenu_menu_pZ2y9.ContextMenu_no-margin-top_pZ2y9{margin:0 0 .25rem}.ContextMenu_menu_pZ2y9 button{text-align:left}.ContextMenu_decorative-element_pZ2y9{margin-top:.5rem}.ContextMenu_chevron_pZ2y9{font-size:.75rem;color:var(--default);pointer-events:none;margin-left:.5rem}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}}();
|
|
2
|
+
const menu = "ContextMenu_menu_pZ2y9";
|
|
3
|
+
const chevron = "ContextMenu_chevron_pZ2y9";
|
|
4
4
|
const classes = {
|
|
5
|
-
"context-menu": "ContextMenu_context-
|
|
5
|
+
"context-menu": "ContextMenu_context-menu_pZ2y9",
|
|
6
6
|
menu,
|
|
7
|
-
"no-margin-top": "ContextMenu_no-margin-
|
|
8
|
-
"decorative-element": "ContextMenu_decorative-
|
|
7
|
+
"no-margin-top": "ContextMenu_no-margin-top_pZ2y9",
|
|
8
|
+
"decorative-element": "ContextMenu_decorative-element_pZ2y9",
|
|
9
9
|
chevron
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuDivider_context-menu-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default={"context-menu-divider":"ContextMenuDivider_context-menu-
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuDivider_context-menu-divider_pZ2y9{margin:.31rem .62rem;border:none;border-top:1px solid var(--color-blue-grey100);height:0}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default={"context-menu-divider":"ContextMenuDivider_context-menu-divider_pZ2y9"};
|
|
3
3
|
//# sourceMappingURL=ContextMenuDivider.module.scss.cjs.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuDivider_context-menu-
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuDivider_context-menu-divider_pZ2y9{margin:.31rem .62rem;border:none;border-top:1px solid var(--color-blue-grey100);height:0}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}}();
|
|
2
2
|
const classes = {
|
|
3
|
-
"context-menu-divider": "ContextMenuDivider_context-menu-
|
|
3
|
+
"context-menu-divider": "ContextMenuDivider_context-menu-divider_pZ2y9"
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
6
|
classes as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactNode,\n RefObject,\n useEffect\n} from \"react\";\nimport classes from \"./ContextMenuItem.module.scss\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"button\">, \"onClick\"> {\n children?: ReactNode;\n hasFocus?: boolean;\n isSelected?: boolean;\n showActiveState?: boolean;\n childIndex?: number;\n shouldClick?: boolean;\n contextMenuOpened?: boolean;\n autoFocus?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onFocusChange?: (childIndex: number) => void;\n onSelectedChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n}\n\nconst ContextMenuItemComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n {\n children,\n onClick,\n onFocusChange,\n onSelectedChange,\n hasFocus,\n isSelected,\n showActiveState,\n childIndex,\n contextMenuOpened,\n shouldClick,\n autoFocus,\n className,\n ...rest\n }: Props,\n ref\n) => {\n const innerButtonRef
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactNode,\n RefObject,\n useEffect\n} from \"react\";\nimport classes from \"./ContextMenuItem.module.scss\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"button\">, \"onClick\"> {\n children?: ReactNode;\n hasFocus?: boolean;\n isSelected?: boolean;\n showActiveState?: boolean;\n childIndex?: number;\n shouldClick?: boolean;\n contextMenuOpened?: boolean;\n autoFocus?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onFocusChange?: (childIndex: number) => void;\n onSelectedChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n}\n\nconst ContextMenuItemComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n {\n children,\n onClick,\n onFocusChange,\n onSelectedChange,\n hasFocus,\n isSelected,\n showActiveState,\n childIndex,\n contextMenuOpened,\n shouldClick,\n autoFocus,\n className,\n ...rest\n }: Props,\n ref\n) => {\n const innerButtonRef =\n (ref as RefObject<HTMLButtonElement | null>) || createRef<HTMLButtonElement>();\n\n useEffect(() => {\n if (isSelected && innerButtonRef.current && shouldClick) {\n innerButtonRef.current.click();\n }\n }, [isSelected, shouldClick]);\n\n useEffect(() => {\n if (autoFocus && innerButtonRef.current) {\n innerButtonRef.current.focus();\n }\n }, [autoFocus]);\n\n useEffect(() => {\n if (innerButtonRef.current && hasFocus && contextMenuOpened) {\n onFocusChange && childIndex !== undefined && onFocusChange(childIndex);\n innerButtonRef.current.focus();\n }\n }, [hasFocus, innerButtonRef, contextMenuOpened]);\n\n return (\n <li role=\"none\" className={`${classes[\"context-menu-item\"]} ${className ?? \"\"}`}>\n <button\n role=\"menuitem\"\n className={showActiveState ? classes[\"active\"] : undefined}\n {...rest}\n ref={innerButtonRef}\n data-focus={hasFocus}\n tabIndex={-1}\n onClick={event => {\n onClick?.(event);\n childIndex !== undefined && onSelectedChange?.(event, childIndex);\n }}\n >\n {children}\n </button>\n </li>\n );\n};\n\nexport const ContextMenuItem = React.forwardRef(ContextMenuItemComponent);\n"],"names":["ContextMenuItem","React","forwardRef","children","onClick","onFocusChange","onSelectedChange","hasFocus","isSelected","showActiveState","childIndex","contextMenuOpened","shouldClick","autoFocus","className","rest","ref","innerButtonRef","createRef","useEffect","current","click","focus","createElement","role","classes","tabIndex","event"],"mappings":"2JAoGaA,EAAkBC,EAAMC,WA5DgD,EAEjFC,WACAC,UACAC,gBACAC,mBACAC,WACAC,aACAC,kBACAC,aACAC,oBACAC,cACAC,YACAC,eACGC,GAELC,KAEA,MAAMC,EACHD,GAA+CE,cAqBlD,OAnBAC,EAAAA,UAAU,KACJX,GAAcS,EAAeG,SAAWR,GAC1CK,EAAeG,QAAQC,SAExB,CAACb,EAAYI,IAEhBO,EAAAA,UAAU,KACJN,GAAaI,EAAeG,SAC9BH,EAAeG,QAAQE,SAExB,CAACT,IAEJM,EAAAA,UAAU,KACJF,EAAeG,SAAWb,GAAYI,IACxCN,QAAgC,IAAfK,GAA4BL,EAAcK,GAC3DO,EAAeG,QAAQE,UAExB,CAACf,EAAUU,EAAgBN,MAG5BY,cAAC,KAAA,CAAGC,KAAK,OAAOV,UAAW,GAAGW,EAAAA,QAAQ,wBAAwBX,GAAa,MACzEb,EAAAsB,cAAC,SAAA,CACCC,KAAK,WACLV,UAAWL,EAAkBgB,UAAgB,YAAI,KAC7CV,EACJC,IAAKC,EACL,aAAYV,EACZmB,UAAU,EACVtB,QAASuB,IACP,MAAAvB,GAAAA,EAAUuB,QACK,IAAfjB,UAA4BJ,KAAmBqB,EAAOjB,MAGvDP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.es.js","sources":["../../../src/components/ContextMenu/ContextMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactNode,\n RefObject,\n useEffect\n} from \"react\";\nimport classes from \"./ContextMenuItem.module.scss\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"button\">, \"onClick\"> {\n children?: ReactNode;\n hasFocus?: boolean;\n isSelected?: boolean;\n showActiveState?: boolean;\n childIndex?: number;\n shouldClick?: boolean;\n contextMenuOpened?: boolean;\n autoFocus?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onFocusChange?: (childIndex: number) => void;\n onSelectedChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n}\n\nconst ContextMenuItemComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n {\n children,\n onClick,\n onFocusChange,\n onSelectedChange,\n hasFocus,\n isSelected,\n showActiveState,\n childIndex,\n contextMenuOpened,\n shouldClick,\n autoFocus,\n className,\n ...rest\n }: Props,\n ref\n) => {\n const innerButtonRef
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.es.js","sources":["../../../src/components/ContextMenu/ContextMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, {\n ComponentPropsWithRef,\n createRef,\n ForwardRefRenderFunction,\n ReactNode,\n RefObject,\n useEffect\n} from \"react\";\nimport classes from \"./ContextMenuItem.module.scss\";\n\nexport interface Props extends Omit<ComponentPropsWithRef<\"button\">, \"onClick\"> {\n children?: ReactNode;\n hasFocus?: boolean;\n isSelected?: boolean;\n showActiveState?: boolean;\n childIndex?: number;\n shouldClick?: boolean;\n contextMenuOpened?: boolean;\n autoFocus?: boolean;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onFocusChange?: (childIndex: number) => void;\n onSelectedChange?: (event: React.MouseEvent<HTMLButtonElement>, childIndex: number) => void;\n}\n\nconst ContextMenuItemComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n {\n children,\n onClick,\n onFocusChange,\n onSelectedChange,\n hasFocus,\n isSelected,\n showActiveState,\n childIndex,\n contextMenuOpened,\n shouldClick,\n autoFocus,\n className,\n ...rest\n }: Props,\n ref\n) => {\n const innerButtonRef =\n (ref as RefObject<HTMLButtonElement | null>) || createRef<HTMLButtonElement>();\n\n useEffect(() => {\n if (isSelected && innerButtonRef.current && shouldClick) {\n innerButtonRef.current.click();\n }\n }, [isSelected, shouldClick]);\n\n useEffect(() => {\n if (autoFocus && innerButtonRef.current) {\n innerButtonRef.current.focus();\n }\n }, [autoFocus]);\n\n useEffect(() => {\n if (innerButtonRef.current && hasFocus && contextMenuOpened) {\n onFocusChange && childIndex !== undefined && onFocusChange(childIndex);\n innerButtonRef.current.focus();\n }\n }, [hasFocus, innerButtonRef, contextMenuOpened]);\n\n return (\n <li role=\"none\" className={`${classes[\"context-menu-item\"]} ${className ?? \"\"}`}>\n <button\n role=\"menuitem\"\n className={showActiveState ? classes[\"active\"] : undefined}\n {...rest}\n ref={innerButtonRef}\n data-focus={hasFocus}\n tabIndex={-1}\n onClick={event => {\n onClick?.(event);\n childIndex !== undefined && onSelectedChange?.(event, childIndex);\n }}\n >\n {children}\n </button>\n </li>\n );\n};\n\nexport const ContextMenuItem = React.forwardRef(ContextMenuItemComponent);\n"],"names":["classes"],"mappings":";;AAwCA,MAAM,2BAA+E,CACnF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,QACG;AACH,QAAM,iBACH,OAA+C,UAAA;AAElD,YAAU,MAAM;AACd,QAAI,cAAc,eAAe,WAAW,aAAa;AACvD,qBAAe,QAAQ,MAAA;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,YAAY,WAAW,CAAC;AAE5B,YAAU,MAAM;AACd,QAAI,aAAa,eAAe,SAAS;AACvC,qBAAe,QAAQ,MAAA;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,YAAU,MAAM;AACd,QAAI,eAAe,WAAW,YAAY,mBAAmB;AAC3D,uBAAiB,eAAe,UAAa,cAAc,UAAU;AACrE,qBAAe,QAAQ,MAAA;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,UAAU,gBAAgB,iBAAiB,CAAC;AAEhD,SACE,sBAAA,cAAC,MAAA,EAAG,MAAK,QAAO,WAAW,GAAGA,uBAAQ,mBAAmB,CAAC,IAAI,aAAa,EAAE,GAAA,GAC3E,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,kBAAkBA,uBAAQ,QAAQ,IAAI;AAAA,MAChD,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,cAAY;AAAA,MACZ,UAAU;AAAA,MACV,SAAS,CAAA,UAAS;AAChB,2CAAU;AACV,uBAAe,WAAa,qDAAmB,OAAO;AAAA,MACxD;AAAA,IAAA;AAAA,IAEC;AAAA,EAAA,CAEL;AAEJ;AAEO,MAAM,kBAAkB,MAAM,WAAW,wBAAwB;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.ContextMenuItem_sr-
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.ContextMenuItem_sr-only_pZ2y9{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.ContextMenuItem_hidden_pZ2y9{display:none}.ContextMenuItem_slide-in_pZ2y9{animation:ContextMenuItem_slide-in_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.ContextMenuItem_slide-in_pZ2y9{animation-duration:.1ms}}.ContextMenuItem_slide-out_pZ2y9{animation:ContextMenuItem_slide-out_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.ContextMenuItem_slide-out_pZ2y9{animation-duration:.1ms}}@keyframes ContextMenuItem_slide-in_pZ2y9{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes ContextMenuItem_slide-out_pZ2y9{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuItem_context-menu-item_pZ2y9{position:relative}.ContextMenuItem_context-menu-item_pZ2y9 button{background-color:transparent;border:0;font-family:var(--font-family);font-size:var(--context-menu-font-size);line-height:1.43;cursor:pointer;width:100%;height:100%;padding:.62rem .75rem;box-sizing:border-box}.ContextMenuItem_context-menu-item_pZ2y9 button:focus-visible{outline:none}.ContextMenuItem_context-menu-item_pZ2y9 button:focus-visible:after{content:"";position:absolute;top:0;left:0;height:100%;width:100%;z-index:101;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.ContextMenuItem_context-menu-item_pZ2y9 button:hover{background-color:var(--context-menu-hover-color)}.ContextMenuItem_context-menu-item_pZ2y9 button:active{background-color:var(--context-menu-pressed-color)}.ContextMenuItem_context-menu-item_pZ2y9 button.ContextMenuItem_active_pZ2y9{color:var(--context-menu-active-color)}.ContextMenuItem_context-menu-item_pZ2y9 button.ContextMenuItem_active_pZ2y9:before{content:"";position:absolute;top:0;left:0;height:100%;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-left:.25rem solid var(--context-menu-active-color)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="ContextMenuItem_active_pZ2y9",t={"context-menu-item":"ContextMenuItem_context-menu-item_pZ2y9",active:e};exports.active=e,exports.default=t;
|
|
3
3
|
//# sourceMappingURL=ContextMenuItem.module.scss.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.ContextMenuItem_sr-
|
|
2
|
-
const active = "
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.ContextMenuItem_sr-only_pZ2y9{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.ContextMenuItem_hidden_pZ2y9{display:none}.ContextMenuItem_slide-in_pZ2y9{animation:ContextMenuItem_slide-in_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.ContextMenuItem_slide-in_pZ2y9{animation-duration:.1ms}}.ContextMenuItem_slide-out_pZ2y9{animation:ContextMenuItem_slide-out_pZ2y9 .5s forwards}@media(prefers-reduced-motion:reduce){.ContextMenuItem_slide-out_pZ2y9{animation-duration:.1ms}}@keyframes ContextMenuItem_slide-in_pZ2y9{0%{transform:translateY(100vh)}to{transform:translateY(0)}}@keyframes ContextMenuItem_slide-out_pZ2y9{0%{transform:translateY(0)}to{transform:translateY(100vh)}}/*!\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.ContextMenuItem_context-menu-item_pZ2y9{position:relative}.ContextMenuItem_context-menu-item_pZ2y9 button{background-color:transparent;border:0;font-family:var(--font-family);font-size:var(--context-menu-font-size);line-height:1.43;cursor:pointer;width:100%;height:100%;padding:.62rem .75rem;box-sizing:border-box}.ContextMenuItem_context-menu-item_pZ2y9 button:focus-visible{outline:none}.ContextMenuItem_context-menu-item_pZ2y9 button:focus-visible:after{content:"";position:absolute;top:0;left:0;height:100%;width:100%;z-index:101;outline:calc(.125 * var(--font-size)) solid var(--color-focus);outline-offset:0;border-radius:var(--focus-border-radius)}.ContextMenuItem_context-menu-item_pZ2y9 button:hover{background-color:var(--context-menu-hover-color)}.ContextMenuItem_context-menu-item_pZ2y9 button:active{background-color:var(--context-menu-pressed-color)}.ContextMenuItem_context-menu-item_pZ2y9 button.ContextMenuItem_active_pZ2y9{color:var(--context-menu-active-color)}.ContextMenuItem_context-menu-item_pZ2y9 button.ContextMenuItem_active_pZ2y9:before{content:"";position:absolute;top:0;left:0;height:100%;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-left:.25rem solid var(--context-menu-active-color)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
+
const active = "ContextMenuItem_active_pZ2y9";
|
|
3
3
|
const contextMenuItemClasses = {
|
|
4
|
-
"context-menu-item": "ContextMenuItem_context-menu-
|
|
4
|
+
"context-menu-item": "ContextMenuItem_context-menu-item_pZ2y9",
|
|
5
5
|
active
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../hooks/usePosition.cjs.js"),o=require("../../util/helper.cjs.js").remToPx(.25);exports.useArrowNavigation=({selectedContextMenuItem:e,setSelectedContextMenuItem:t,focusedContextMenuItem:o,setFocusedContextMenuItem:r,showContextMenu:n,setShowContextMenu:c,childrenCount:s,setShouldClick:u})=>({onArrowNavigation:i=>{switch(-1===o&&-1!==e&&r(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Space","Escape","End","Home"].includes(i.code)&&i.preventDefault(),i.code){case"ArrowDown":return n?void r(e=>e+1>s-1?0:e+1):void c(!0);case"ArrowUp":return void r(e=>e-1<0?s-1:e-1);case"Enter":case"Space":return n?(u(!0),t(o),void c(!1)):void c(!0);case"Tab":case"Escape":return void c(!1);case"End":return void r(s-1);case"Home":return void r(0)}}}),exports.useDefaultOffset=()=>({calculateDefaultOffset:(e,r)=>{const n={left:0,right:0,top:0,bottom:0};return e.vertical===t.vertical.BOTTOM&&r.vertical===t.vertical.TOP?n.top=o:e.vertical===t.vertical.TOP&&r.vertical===t.vertical.BOTTOM&&(n.top=-o),e.horizontal===t.horizontal.RIGHT&&(n.left=o),n}}),exports.useFocusAnchorElement=(t,o,r,n,c,s,u)=>{const i=e=>{var o;"Escape"===e.key&&(n(!1),null==(o=t.current)||o.focus())};e.useEffect(()=>{var e,n;r?document.addEventListener("keydown",i):document.removeEventListener("keydown",i),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("../../hooks/usePosition.cjs.js"),o=require("../../util/helper.cjs.js").remToPx(.25);exports.useArrowNavigation=({selectedContextMenuItem:e,setSelectedContextMenuItem:t,focusedContextMenuItem:o,setFocusedContextMenuItem:r,showContextMenu:n,setShowContextMenu:c,childrenCount:s,setShouldClick:u})=>({onArrowNavigation:i=>{switch(-1===o&&-1!==e&&r(e),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Space","Escape","End","Home"].includes(i.code)&&i.preventDefault(),i.code){case"ArrowDown":return n?void r(e=>e+1>s-1?0:e+1):void c(!0);case"ArrowUp":return void r(e=>e-1<0?s-1:e-1);case"Enter":case"Space":return n?(u(!0),t(o),void c(!1)):void c(!0);case"Tab":case"Escape":return void c(!1);case"End":return void r(s-1);case"Home":return void r(0)}}}),exports.useDefaultOffset=()=>({calculateDefaultOffset:(e,r)=>{const n={left:0,right:0,top:0,bottom:0};return e.vertical===t.vertical.BOTTOM&&r.vertical===t.vertical.TOP?n.top=o:e.vertical===t.vertical.TOP&&r.vertical===t.vertical.BOTTOM&&(n.top=-o),e.horizontal===t.horizontal.RIGHT&&(n.left=o),n}}),exports.useFocusAnchorElement=(t,o,r,n,c,s,u)=>{const i=e=>{var o;"Escape"===e.key&&(n(!1),null==(o=t.current)||o.focus())};e.useEffect(()=>{var e,n;r?(document.addEventListener("keydown",i),null==s||s()):(document.removeEventListener("keydown",i),null==u||u(),(null==(e=document.activeElement)?void 0:e.closest(`#${o}-menu`))&&(null==(n=t.current)||n.focus()),c(-1))},[r])};
|
|
2
2
|
//# sourceMappingURL=ContextMenuService.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuService.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenuService.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SetStateAction, useEffect } from \"react\";\nimport { horizontal, Offset, Placement, vertical } from \"../../hooks/usePosition\";\nimport { remToPx } from \"../../util/helper\";\n\ninterface UseArrowNavigation {\n selectedContextMenuItem: number;\n setSelectedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n focusedContextMenuItem: number;\n setFocusedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n showContextMenu: boolean;\n setShowContextMenu: React.Dispatch<React.SetStateAction<boolean>>;\n childrenCount: number;\n setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\n/** @scope . */\nexport const useArrowNavigation = ({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n}: UseArrowNavigation) => {\n const onArrowNavigation = (event: React.KeyboardEvent) => {\n if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {\n setFocusedContextMenuItem(selectedContextMenuItem);\n }\n\n const codesToPreventDefault = [\n \"ArrowDown\",\n \"ArrowUp\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Enter\",\n \"Space\",\n \"Escape\",\n \"End\",\n \"Home\"\n ];\n\n if (codesToPreventDefault.includes(event.code)) {\n event.preventDefault();\n }\n\n switch (event.code) {\n case \"ArrowDown\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n setFocusedContextMenuItem(prevState => {\n return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;\n });\n return;\n case \"ArrowUp\":\n setFocusedContextMenuItem(prevState => {\n return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;\n });\n return;\n case \"Enter\":\n case \"Space\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n\n setShouldClick(true);\n setSelectedContextMenuItem(focusedContextMenuItem);\n setShowContextMenu(false);\n return;\n case \"Tab\":\n case \"Escape\":\n setShowContextMenu(false);\n return;\n case \"End\":\n setFocusedContextMenuItem(childrenCount - 1);\n return;\n case \"Home\":\n setFocusedContextMenuItem(0);\n return;\n }\n };\n\n return { onArrowNavigation };\n};\n\nconst defaultOffsetSpacing = remToPx(0.25);\n\nexport const useDefaultOffset = () => {\n const calculateDefaultOffset = (placement: Placement, transformOrigin: Placement): Offset => {\n const offset = { left: 0, right: 0, top: 0, bottom: 0 };\n if (placement.vertical === vertical.BOTTOM && transformOrigin.vertical === vertical.TOP) {\n offset.top = defaultOffsetSpacing;\n } else if (\n placement.vertical === vertical.TOP &&\n transformOrigin.vertical === vertical.BOTTOM\n ) {\n offset.top = -defaultOffsetSpacing;\n }\n\n if (placement.horizontal === horizontal.RIGHT) {\n offset.left = defaultOffsetSpacing;\n }\n return offset;\n };\n\n return { calculateDefaultOffset };\n};\n\nexport const useFocusAnchorElement = (\n anchorEl: React.RefObject<HTMLElement>,\n id: string,\n showContextMenu: boolean,\n setShowContextMenu: React.Dispatch<SetStateAction<boolean>>,\n setFocusedContextMenuItem: React.Dispatch<SetStateAction<number>>,\n onShow?: () => void,\n onClose?: () => void\n) => {\n const handleEscapeKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setShowContextMenu(false);\n anchorEl.current?.focus();\n }\n };\n\n const
|
|
1
|
+
{"version":3,"file":"ContextMenuService.cjs.js","sources":["../../../src/components/ContextMenu/ContextMenuService.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SetStateAction, useEffect } from \"react\";\nimport { horizontal, Offset, Placement, vertical } from \"../../hooks/usePosition\";\nimport { remToPx } from \"../../util/helper\";\n\ninterface UseArrowNavigation {\n selectedContextMenuItem: number;\n setSelectedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n focusedContextMenuItem: number;\n setFocusedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n showContextMenu: boolean;\n setShowContextMenu: React.Dispatch<React.SetStateAction<boolean>>;\n childrenCount: number;\n setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\n/** @scope . */\nexport const useArrowNavigation = ({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n}: UseArrowNavigation) => {\n const onArrowNavigation = (event: React.KeyboardEvent) => {\n if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {\n setFocusedContextMenuItem(selectedContextMenuItem);\n }\n\n const codesToPreventDefault = [\n \"ArrowDown\",\n \"ArrowUp\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Enter\",\n \"Space\",\n \"Escape\",\n \"End\",\n \"Home\"\n ];\n\n if (codesToPreventDefault.includes(event.code)) {\n event.preventDefault();\n }\n\n switch (event.code) {\n case \"ArrowDown\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n setFocusedContextMenuItem(prevState => {\n return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;\n });\n return;\n case \"ArrowUp\":\n setFocusedContextMenuItem(prevState => {\n return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;\n });\n return;\n case \"Enter\":\n case \"Space\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n\n setShouldClick(true);\n setSelectedContextMenuItem(focusedContextMenuItem);\n setShowContextMenu(false);\n return;\n case \"Tab\":\n case \"Escape\":\n setShowContextMenu(false);\n return;\n case \"End\":\n setFocusedContextMenuItem(childrenCount - 1);\n return;\n case \"Home\":\n setFocusedContextMenuItem(0);\n return;\n }\n };\n\n return { onArrowNavigation };\n};\n\nconst defaultOffsetSpacing = remToPx(0.25);\n\nexport const useDefaultOffset = () => {\n const calculateDefaultOffset = (placement: Placement, transformOrigin: Placement): Offset => {\n const offset = { left: 0, right: 0, top: 0, bottom: 0 };\n if (placement.vertical === vertical.BOTTOM && transformOrigin.vertical === vertical.TOP) {\n offset.top = defaultOffsetSpacing;\n } else if (\n placement.vertical === vertical.TOP &&\n transformOrigin.vertical === vertical.BOTTOM\n ) {\n offset.top = -defaultOffsetSpacing;\n }\n\n if (placement.horizontal === horizontal.RIGHT) {\n offset.left = defaultOffsetSpacing;\n }\n return offset;\n };\n\n return { calculateDefaultOffset };\n};\n\nexport const useFocusAnchorElement = (\n anchorEl: React.RefObject<HTMLElement | null>,\n id: string,\n showContextMenu: boolean,\n setShowContextMenu: React.Dispatch<SetStateAction<boolean>>,\n setFocusedContextMenuItem: React.Dispatch<SetStateAction<number>>,\n onShow?: () => void,\n onClose?: () => void\n) => {\n const handleEscapeKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setShowContextMenu(false);\n anchorEl.current?.focus();\n }\n };\n\n const addEscapeKeyListener = () => {\n document.addEventListener(\"keydown\", handleEscapeKeyPress);\n };\n\n const removeEscapeKeyListener = () => {\n document.removeEventListener(\"keydown\", handleEscapeKeyPress);\n };\n\n const handleContextMenuOpen = () => {\n onShow?.();\n };\n\n const handleContextMenuClose = () => {\n onClose?.();\n\n if (document.activeElement?.closest(`#${id}-menu`)) {\n anchorEl.current?.focus();\n }\n\n setFocusedContextMenuItem(-1);\n };\n\n useEffect(() => {\n if (showContextMenu) {\n addEscapeKeyListener();\n handleContextMenuOpen();\n } else {\n removeEscapeKeyListener();\n handleContextMenuClose();\n }\n }, [showContextMenu]);\n};\n"],"names":["defaultOffsetSpacing","remToPx","selectedContextMenuItem","setSelectedContextMenuItem","focusedContextMenuItem","setFocusedContextMenuItem","showContextMenu","setShowContextMenu","childrenCount","setShouldClick","onArrowNavigation","event","includes","code","preventDefault","prevState","calculateDefaultOffset","placement","transformOrigin","offset","left","right","top","bottom","vertical","BOTTOM","TOP","horizontal","RIGHT","anchorEl","id","onShow","onClose","handleEscapeKeyPress","e","key","_a","current","focus","useEffect","document","addEventListener","removeEventListener","activeElement","closest","_b"],"mappings":"qJAyGMA,sCAAuBC,QAAQ,gCAzEH,EAChCC,0BACAC,6BACAC,yBACAC,4BACAC,kBACAC,qBACAC,gBACAC,qBA8DO,CAAEC,kBA5DkBC,IAqBzB,QApB+B,IAA3BP,IAA6D,IAA5BF,GACnCG,EAA0BH,GAGE,CAC5B,YACA,UACA,YACA,aACA,QACA,QACA,SACA,MACA,QAGwBU,SAASD,EAAME,OACvCF,EAAMG,iBAGAH,EAAME,MACZ,IAAK,YACH,OAAKP,OAILD,EAA0BU,GACjBA,EAAY,EAAIP,EAAgB,EAAI,EAAIO,EAAY,QAJ3DR,GAAmB,GAOvB,IAAK,UAIH,YAHAF,EAA0BU,GACjBA,EAAY,EAAI,EAAIP,EAAgB,EAAIO,EAAY,GAG/D,IAAK,QACL,IAAK,QACH,OAAKT,GAKLG,GAAe,GACfN,EAA2BC,QAC3BG,GAAmB,SANjBA,GAAmB,GAQvB,IAAK,MACL,IAAK,SAEH,YADAA,GAAmB,GAErB,IAAK,MAEH,YADAF,EAA0BG,EAAgB,GAE5C,IAAK,OAEH,YADAH,EAA0B,gCAUF,KAkBvB,CAAEW,uBAjBsB,CAACC,EAAsBC,KACpD,MAAMC,EAAS,CAAEC,KAAM,EAAGC,MAAO,EAAGC,IAAK,EAAGC,OAAQ,GAapD,OAZIN,EAAUO,WAAaA,WAASC,QAAUP,EAAgBM,WAAaA,EAAAA,SAASE,IAClFP,EAAOG,IAAMtB,EAEbiB,EAAUO,WAAaA,EAAAA,SAASE,KAChCR,EAAgBM,WAAaA,EAAAA,SAASC,SAEtCN,EAAOG,KAAOtB,GAGZiB,EAAUU,aAAeA,EAAAA,WAAWC,QACtCT,EAAOC,KAAOpB,GAETmB,mCAM0B,CACnCU,EACAC,EACAxB,EACAC,EACAF,EACA0B,EACAC,KAEA,MAAMC,EAAwBC,UACd,WAAVA,EAAEC,MACJ5B,GAAmB,GACnB,OAAA6B,EAAAP,EAASQ,UAATD,EAAkBE,UA0BtBC,EAAAA,UAAU,KAVqB,QAWzBjC,GAtBJkC,SAASC,iBAAiB,UAAWR,GAQrC,MAAAF,GAAAA,MAJAS,SAASE,oBAAoB,UAAWT,GAQxC,MAAAD,GAAAA,KAEI,OAAAI,WAASO,oBAAT,EAAAP,EAAwBQ,QAAQ,IAAId,aACtC,OAAAe,EAAAhB,EAASQ,UAATQ,EAAkBP,SAGpBjC,GAA0B,KAWzB,CAACC"}
|
|
@@ -92,28 +92,31 @@ const useFocusAnchorElement = (anchorEl, id, showContextMenu, setShowContextMenu
|
|
|
92
92
|
(_a = anchorEl.current) == null ? void 0 : _a.focus();
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
const addEscapeKeyListener = () => {
|
|
96
|
+
document.addEventListener("keydown", handleEscapeKeyPress);
|
|
97
|
+
};
|
|
98
|
+
const removeEscapeKeyListener = () => {
|
|
99
|
+
document.removeEventListener("keydown", handleEscapeKeyPress);
|
|
100
|
+
};
|
|
101
|
+
const handleContextMenuOpen = () => {
|
|
102
|
+
onShow == null ? void 0 : onShow();
|
|
101
103
|
};
|
|
102
|
-
const
|
|
104
|
+
const handleContextMenuClose = () => {
|
|
103
105
|
var _a, _b;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onClose == null ? void 0 : onClose();
|
|
108
|
-
if ((_a = document.activeElement) == null ? void 0 : _a.closest(`#${id}-menu`)) {
|
|
109
|
-
(_b = anchorEl.current) == null ? void 0 : _b.focus();
|
|
110
|
-
}
|
|
111
|
-
setFocusedContextMenuItem(-1);
|
|
106
|
+
onClose == null ? void 0 : onClose();
|
|
107
|
+
if ((_a = document.activeElement) == null ? void 0 : _a.closest(`#${id}-menu`)) {
|
|
108
|
+
(_b = anchorEl.current) == null ? void 0 : _b.focus();
|
|
112
109
|
}
|
|
110
|
+
setFocusedContextMenuItem(-1);
|
|
113
111
|
};
|
|
114
112
|
useEffect(() => {
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
if (showContextMenu) {
|
|
114
|
+
addEscapeKeyListener();
|
|
115
|
+
handleContextMenuOpen();
|
|
116
|
+
} else {
|
|
117
|
+
removeEscapeKeyListener();
|
|
118
|
+
handleContextMenuClose();
|
|
119
|
+
}
|
|
117
120
|
}, [showContextMenu]);
|
|
118
121
|
};
|
|
119
122
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuService.es.js","sources":["../../../src/components/ContextMenu/ContextMenuService.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SetStateAction, useEffect } from \"react\";\nimport { horizontal, Offset, Placement, vertical } from \"../../hooks/usePosition\";\nimport { remToPx } from \"../../util/helper\";\n\ninterface UseArrowNavigation {\n selectedContextMenuItem: number;\n setSelectedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n focusedContextMenuItem: number;\n setFocusedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n showContextMenu: boolean;\n setShowContextMenu: React.Dispatch<React.SetStateAction<boolean>>;\n childrenCount: number;\n setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\n/** @scope . */\nexport const useArrowNavigation = ({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n}: UseArrowNavigation) => {\n const onArrowNavigation = (event: React.KeyboardEvent) => {\n if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {\n setFocusedContextMenuItem(selectedContextMenuItem);\n }\n\n const codesToPreventDefault = [\n \"ArrowDown\",\n \"ArrowUp\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Enter\",\n \"Space\",\n \"Escape\",\n \"End\",\n \"Home\"\n ];\n\n if (codesToPreventDefault.includes(event.code)) {\n event.preventDefault();\n }\n\n switch (event.code) {\n case \"ArrowDown\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n setFocusedContextMenuItem(prevState => {\n return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;\n });\n return;\n case \"ArrowUp\":\n setFocusedContextMenuItem(prevState => {\n return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;\n });\n return;\n case \"Enter\":\n case \"Space\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n\n setShouldClick(true);\n setSelectedContextMenuItem(focusedContextMenuItem);\n setShowContextMenu(false);\n return;\n case \"Tab\":\n case \"Escape\":\n setShowContextMenu(false);\n return;\n case \"End\":\n setFocusedContextMenuItem(childrenCount - 1);\n return;\n case \"Home\":\n setFocusedContextMenuItem(0);\n return;\n }\n };\n\n return { onArrowNavigation };\n};\n\nconst defaultOffsetSpacing = remToPx(0.25);\n\nexport const useDefaultOffset = () => {\n const calculateDefaultOffset = (placement: Placement, transformOrigin: Placement): Offset => {\n const offset = { left: 0, right: 0, top: 0, bottom: 0 };\n if (placement.vertical === vertical.BOTTOM && transformOrigin.vertical === vertical.TOP) {\n offset.top = defaultOffsetSpacing;\n } else if (\n placement.vertical === vertical.TOP &&\n transformOrigin.vertical === vertical.BOTTOM\n ) {\n offset.top = -defaultOffsetSpacing;\n }\n\n if (placement.horizontal === horizontal.RIGHT) {\n offset.left = defaultOffsetSpacing;\n }\n return offset;\n };\n\n return { calculateDefaultOffset };\n};\n\nexport const useFocusAnchorElement = (\n anchorEl: React.RefObject<HTMLElement>,\n id: string,\n showContextMenu: boolean,\n setShowContextMenu: React.Dispatch<SetStateAction<boolean>>,\n setFocusedContextMenuItem: React.Dispatch<SetStateAction<number>>,\n onShow?: () => void,\n onClose?: () => void\n) => {\n const handleEscapeKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setShowContextMenu(false);\n anchorEl.current?.focus();\n }\n };\n\n const
|
|
1
|
+
{"version":3,"file":"ContextMenuService.es.js","sources":["../../../src/components/ContextMenu/ContextMenuService.ts"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SetStateAction, useEffect } from \"react\";\nimport { horizontal, Offset, Placement, vertical } from \"../../hooks/usePosition\";\nimport { remToPx } from \"../../util/helper\";\n\ninterface UseArrowNavigation {\n selectedContextMenuItem: number;\n setSelectedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n focusedContextMenuItem: number;\n setFocusedContextMenuItem: React.Dispatch<React.SetStateAction<number>>;\n showContextMenu: boolean;\n setShowContextMenu: React.Dispatch<React.SetStateAction<boolean>>;\n childrenCount: number;\n setShouldClick: React.Dispatch<React.SetStateAction<boolean>>;\n}\n\n/** @scope . */\nexport const useArrowNavigation = ({\n selectedContextMenuItem,\n setSelectedContextMenuItem,\n focusedContextMenuItem,\n setFocusedContextMenuItem,\n showContextMenu,\n setShowContextMenu,\n childrenCount,\n setShouldClick\n}: UseArrowNavigation) => {\n const onArrowNavigation = (event: React.KeyboardEvent) => {\n if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {\n setFocusedContextMenuItem(selectedContextMenuItem);\n }\n\n const codesToPreventDefault = [\n \"ArrowDown\",\n \"ArrowUp\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Enter\",\n \"Space\",\n \"Escape\",\n \"End\",\n \"Home\"\n ];\n\n if (codesToPreventDefault.includes(event.code)) {\n event.preventDefault();\n }\n\n switch (event.code) {\n case \"ArrowDown\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n setFocusedContextMenuItem(prevState => {\n return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;\n });\n return;\n case \"ArrowUp\":\n setFocusedContextMenuItem(prevState => {\n return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;\n });\n return;\n case \"Enter\":\n case \"Space\":\n if (!showContextMenu) {\n setShowContextMenu(true);\n return;\n }\n\n setShouldClick(true);\n setSelectedContextMenuItem(focusedContextMenuItem);\n setShowContextMenu(false);\n return;\n case \"Tab\":\n case \"Escape\":\n setShowContextMenu(false);\n return;\n case \"End\":\n setFocusedContextMenuItem(childrenCount - 1);\n return;\n case \"Home\":\n setFocusedContextMenuItem(0);\n return;\n }\n };\n\n return { onArrowNavigation };\n};\n\nconst defaultOffsetSpacing = remToPx(0.25);\n\nexport const useDefaultOffset = () => {\n const calculateDefaultOffset = (placement: Placement, transformOrigin: Placement): Offset => {\n const offset = { left: 0, right: 0, top: 0, bottom: 0 };\n if (placement.vertical === vertical.BOTTOM && transformOrigin.vertical === vertical.TOP) {\n offset.top = defaultOffsetSpacing;\n } else if (\n placement.vertical === vertical.TOP &&\n transformOrigin.vertical === vertical.BOTTOM\n ) {\n offset.top = -defaultOffsetSpacing;\n }\n\n if (placement.horizontal === horizontal.RIGHT) {\n offset.left = defaultOffsetSpacing;\n }\n return offset;\n };\n\n return { calculateDefaultOffset };\n};\n\nexport const useFocusAnchorElement = (\n anchorEl: React.RefObject<HTMLElement | null>,\n id: string,\n showContextMenu: boolean,\n setShowContextMenu: React.Dispatch<SetStateAction<boolean>>,\n setFocusedContextMenuItem: React.Dispatch<SetStateAction<number>>,\n onShow?: () => void,\n onClose?: () => void\n) => {\n const handleEscapeKeyPress = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setShowContextMenu(false);\n anchorEl.current?.focus();\n }\n };\n\n const addEscapeKeyListener = () => {\n document.addEventListener(\"keydown\", handleEscapeKeyPress);\n };\n\n const removeEscapeKeyListener = () => {\n document.removeEventListener(\"keydown\", handleEscapeKeyPress);\n };\n\n const handleContextMenuOpen = () => {\n onShow?.();\n };\n\n const handleContextMenuClose = () => {\n onClose?.();\n\n if (document.activeElement?.closest(`#${id}-menu`)) {\n anchorEl.current?.focus();\n }\n\n setFocusedContextMenuItem(-1);\n };\n\n useEffect(() => {\n if (showContextMenu) {\n addEscapeKeyListener();\n handleContextMenuOpen();\n } else {\n removeEscapeKeyListener();\n handleContextMenuClose();\n }\n }, [showContextMenu]);\n};\n"],"names":[],"mappings":"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"}
|