@carbon/react 1.21.0 → 1.22.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/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/Breadcrumb/Breadcrumb.js +2 -1
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -1
- package/es/components/Button/Button.Skeleton.js +2 -1
- package/es/components/Button/Button.js +2 -1
- package/es/components/Button/index.js +0 -1
- package/es/components/ButtonSet/ButtonSet.js +2 -1
- package/es/{es/components → components}/Checkbox/Checkbox.Skeleton.d.ts +0 -0
- package/es/{es/components → components}/Checkbox/Checkbox.d.ts +0 -0
- package/es/{es/components → components}/Checkbox/index.d.ts +0 -0
- package/es/components/CodeSnippet/CodeSnippet.js +0 -1
- package/es/components/ComboBox/ComboBox.js +7 -7
- package/es/components/ComposedModal/ComposedModal.js +3 -2
- package/es/components/ComposedModal/ModalFooter.js +0 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/es/components/DangerButton/DangerButton.js +3 -2
- package/es/components/DataTable/Table.js +2 -1
- package/es/components/DataTable/TableActionList.js +2 -1
- package/es/components/DataTable/TableBatchAction.js +2 -2
- package/es/components/DataTable/TableBatchActions.js +2 -2
- package/es/components/DataTable/TableBody.js +2 -1
- package/es/components/DataTable/TableCell.js +2 -1
- package/es/components/DataTable/TableContainer.js +2 -1
- package/es/components/DataTable/TableExpandHeader.js +2 -1
- package/es/components/DataTable/TableExpandRow.js +2 -1
- package/es/components/DataTable/TableExpandedRow.js +2 -1
- package/es/components/DataTable/TableHead.js +2 -1
- package/es/components/DataTable/TableHeader.js +2 -1
- package/es/components/DataTable/TableRow.js +2 -1
- package/es/components/DataTable/TableSelectAll.d.ts +83 -0
- package/es/components/DataTable/TableSelectAll.js +2 -1
- package/es/components/DataTable/TableSelectRow.js +2 -1
- package/es/components/DataTable/TableToolbar.js +3 -2
- package/es/components/DataTable/TableToolbarAction.js +2 -1
- package/es/components/DataTable/TableToolbarContent.js +2 -1
- package/es/components/DataTable/TableToolbarMenu.js +2 -1
- package/es/components/DataTable/TableToolbarSearch.js +2 -2
- package/es/components/DataTable/state/getDerivedStateFromProps.js +3 -1
- package/es/components/DataTable/tools/denormalize.js +3 -1
- package/es/components/DataTable/tools/instanceId.js +3 -1
- package/es/components/DataTable/tools/normalize.js +3 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +2 -1
- package/es/components/DatePicker/DatePicker.Skeleton.js +2 -1
- package/es/components/DatePicker/DatePicker.js +4 -3
- package/es/components/DatePicker/index.js +0 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +32 -1
- package/es/components/DatePickerInput/DatePickerInput.js +2 -1
- package/es/components/Dropdown/Dropdown.Skeleton.js +2 -1
- package/es/components/Dropdown/Dropdown.d.ts +134 -0
- package/es/components/Dropdown/Dropdown.js +27 -14
- package/es/components/Dropdown/index.d.ts +11 -0
- package/es/components/Dropdown/index.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +0 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.js +2 -2
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -1
- package/es/components/FluidComboBox/FluidComboBox.js +2 -1
- package/es/components/FluidDatePicker/FluidDatePicker.js +2 -2
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.js +2 -2
- package/es/components/FluidForm/FluidForm.d.ts +11 -0
- package/es/components/FluidForm/FluidForm.js +2 -2
- package/es/components/FluidForm/FormContext.d.ts +11 -0
- package/es/components/FluidForm/index.d.ts +10 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -1
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +2 -1
- package/es/components/FluidSelect/FluidSelect.js +2 -1
- package/es/components/FluidSelect/index.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -1
- package/es/components/FluidTextInput/index.js +0 -1
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +2 -2
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -2
- package/es/components/Form/Form.js +2 -1
- package/es/components/FormGroup/FormGroup.js +2 -1
- package/es/components/IconButton/index.js +1 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +4 -1
- package/es/components/Link/Link.js +2 -1
- package/es/components/ListBox/ListBox.d.ts +60 -0
- package/es/components/ListBox/ListBox.js +4 -15
- package/es/components/ListBox/ListBoxField.d.ts +18 -0
- package/es/components/ListBox/ListBoxField.js +1 -1
- package/es/components/ListBox/ListBoxMenu.d.ts +22 -0
- package/es/components/ListBox/ListBoxMenu.js +2 -2
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +31 -0
- package/es/components/ListBox/ListBoxMenuIcon.js +8 -5
- package/es/components/ListBox/ListBoxMenuItem.d.ts +24 -0
- package/es/components/ListBox/ListBoxMenuItem.js +2 -3
- package/es/components/ListBox/ListBoxPropTypes.d.ts +14 -0
- package/es/components/ListBox/ListBoxPropTypes.js +4 -2
- package/es/components/ListBox/ListBoxSelection.d.ts +51 -0
- package/es/components/ListBox/ListBoxSelection.js +7 -20
- package/es/components/ListBox/index.d.ts +23 -0
- package/es/components/ListBox/index.js +11 -8
- package/es/components/ListBox/next/ListBoxSelection.js +3 -3
- package/es/components/ListBox/next/ListBoxTrigger.js +2 -1
- package/es/components/ListItem/ListItem.js +2 -1
- package/es/components/Menu/Menu.js +4 -3
- package/es/components/Menu/MenuOption.js +2 -2
- package/es/components/Modal/Modal.js +3 -3
- package/es/components/ModalWrapper/ModalWrapper.js +0 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +8 -8
- package/es/components/MultiSelect/MultiSelect.js +6 -6
- package/es/components/Notification/Notification.js +4 -5
- package/es/components/NumberInput/NumberInput.Skeleton.d.ts +32 -0
- package/es/components/OrderedList/OrderedList.js +2 -1
- package/es/components/OverflowMenu/OverflowMenu.js +40 -35
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/es/components/OverflowMenuV2/index.js +2 -2
- package/es/components/Pagination/Pagination.js +2 -1
- package/es/components/Pagination/experimental/Pagination.js +0 -1
- package/es/components/PaginationNav/PaginationNav.js +2 -2
- package/es/components/PrimaryButton/PrimaryButton.js +3 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/es/components/RadioButton/RadioButton.js +2 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.Skeleton.js +2 -1
- package/es/components/Search/Search.js +6 -5
- package/es/components/Search/index.js +0 -1
- package/es/components/SecondaryButton/SecondaryButton.js +3 -2
- package/es/components/Select/Select.Skeleton.d.ts +33 -0
- package/es/components/Select/Select.Skeleton.js +2 -1
- package/es/components/Select/Select.js +2 -1
- package/es/components/SelectItem/SelectItem.js +2 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +2 -1
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -1
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -1
- package/es/components/SkeletonText/SkeletonText.js +2 -1
- package/es/components/Slider/Slider.Skeleton.d.ts +33 -0
- package/es/components/Slider/Slider.Skeleton.js +2 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/StructuredList/StructuredList.Skeleton.js +2 -1
- package/es/components/Switch/Switch.js +2 -1
- package/es/components/Tab/Tab.js +1 -1
- package/es/components/TabContent/TabContent.js +2 -1
- package/es/components/Tabs/Tabs.js +2 -3
- package/es/components/Tag/Tag.js +2 -1
- package/es/{es/components → components}/Text/Text.d.ts +0 -0
- package/es/{es/components → components}/Text/TextDirection.d.ts +0 -0
- package/es/{es/components → components}/Text/createTextComponent.d.ts +0 -0
- package/es/{es/components → components}/Text/index.d.ts +0 -0
- package/es/components/TextArea/TextArea.Skeleton.js +2 -1
- package/es/components/TextArea/TextArea.js +6 -3
- package/es/components/TextArea/index.js +0 -1
- package/es/components/TextInput/ControlledPasswordInput.js +2 -1
- package/es/components/TextInput/PasswordInput.js +2 -1
- package/es/components/TextInput/TextInput.Skeleton.js +2 -1
- package/es/components/TextInput/TextInput.js +2 -1
- package/es/components/TextInput/index.js +0 -1
- package/es/components/Tile/Tile.js +3 -7
- package/es/components/TileGroup/TileGroup.js +1 -1
- package/es/components/TimePicker/TimePicker.js +2 -1
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -1
- package/es/components/TimePickerSelect/index.js +2 -2
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.js +34 -5
- package/es/components/TreeView/TreeNode.js +2 -2
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/Content.js +2 -1
- package/es/components/UIShell/Header.js +3 -2
- package/es/components/UIShell/HeaderContainer.js +2 -1
- package/es/components/UIShell/HeaderGlobalAction.js +3 -3
- package/es/components/UIShell/HeaderMenu.js +5 -4
- package/es/components/UIShell/HeaderMenuButton.js +1 -1
- package/es/components/UIShell/HeaderMenuItem.js +3 -2
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.js +1 -1
- package/es/components/UIShell/HeaderPanel.js +3 -2
- package/es/components/UIShell/HeaderSideNavItems.js +2 -1
- package/es/components/UIShell/Link.js +2 -1
- package/es/components/UIShell/SideNav.js +3 -2
- package/es/components/UIShell/SideNavDetails.js +2 -1
- package/es/components/UIShell/SideNavHeader.js +2 -1
- package/es/components/UIShell/SideNavItems.js +2 -1
- package/es/components/UIShell/SideNavLink.js +3 -2
- package/es/components/UIShell/SideNavMenu.js +5 -3
- package/es/components/UIShell/SideNavMenuItem.js +2 -1
- package/es/components/UIShell/SideNavSwitcher.js +2 -1
- package/es/components/UIShell/Switcher.js +3 -2
- package/es/components/UIShell/SwitcherDivider.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +3 -2
- package/es/components/UnorderedList/UnorderedList.js +2 -1
- package/es/{es/index.d.ts → index.d.ts} +0 -0
- package/es/index.js +134 -140
- package/es/internal/ClickListener.js +1 -1
- package/es/internal/FloatingMenu.js +5 -6
- package/es/internal/OptimizedResize.js +3 -1
- package/es/internal/Selection.js +1 -1
- package/es/internal/useIsomorphicEffect.js +2 -1
- package/es/{es/internal → internal}/usePrefix.d.ts +0 -0
- package/es/node_modules/flatpickr/dist/plugins/rangePlugin.js +1 -1
- package/es/tools/mergeRefs.js +3 -1
- package/es/tools/wrapComponent.js +3 -1
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Breadcrumb/Breadcrumb.js +2 -1
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -1
- package/lib/components/Button/Button.Skeleton.js +2 -1
- package/lib/components/Button/Button.js +2 -1
- package/lib/components/Button/index.js +0 -2
- package/lib/components/ButtonSet/ButtonSet.js +2 -1
- package/lib/{lib/components → components}/Checkbox/Checkbox.Skeleton.d.ts +0 -0
- package/lib/{lib/components → components}/Checkbox/Checkbox.d.ts +0 -0
- package/lib/{lib/components → components}/Checkbox/index.d.ts +0 -0
- package/lib/components/CodeSnippet/CodeSnippet.js +0 -1
- package/lib/components/ComboBox/ComboBox.js +10 -10
- package/lib/components/ComposedModal/ComposedModal.js +2 -1
- package/lib/components/ComposedModal/ModalFooter.js +0 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +3 -2
- package/lib/components/DataTable/DataTable.js +5 -5
- package/lib/components/DataTable/Table.js +2 -1
- package/lib/components/DataTable/TableActionList.js +2 -1
- package/lib/components/DataTable/TableBatchAction.js +2 -2
- package/lib/components/DataTable/TableBatchActions.js +2 -2
- package/lib/components/DataTable/TableBody.js +2 -1
- package/lib/components/DataTable/TableCell.js +2 -1
- package/lib/components/DataTable/TableContainer.js +2 -1
- package/lib/components/DataTable/TableExpandHeader.js +2 -1
- package/lib/components/DataTable/TableExpandRow.js +2 -1
- package/lib/components/DataTable/TableExpandedRow.js +2 -1
- package/lib/components/DataTable/TableHead.js +2 -1
- package/lib/components/DataTable/TableHeader.js +2 -1
- package/lib/components/DataTable/TableRow.js +2 -1
- package/lib/components/DataTable/TableSelectAll.d.ts +83 -0
- package/lib/components/DataTable/TableSelectAll.js +2 -1
- package/lib/components/DataTable/TableSelectRow.js +2 -1
- package/lib/components/DataTable/TableToolbar.js +2 -1
- package/lib/components/DataTable/TableToolbarAction.js +2 -1
- package/lib/components/DataTable/TableToolbarContent.js +2 -1
- package/lib/components/DataTable/TableToolbarMenu.js +2 -1
- package/lib/components/DataTable/TableToolbarSearch.js +2 -2
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +3 -1
- package/lib/components/DataTable/tools/denormalize.js +3 -1
- package/lib/components/DataTable/tools/instanceId.js +3 -1
- package/lib/components/DataTable/tools/normalize.js +3 -1
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +2 -1
- package/lib/components/DatePicker/DatePicker.Skeleton.js +2 -1
- package/lib/components/DatePicker/DatePicker.js +4 -3
- package/lib/components/DatePicker/index.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +32 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.js +2 -1
- package/lib/components/Dropdown/Dropdown.d.ts +134 -0
- package/lib/components/Dropdown/Dropdown.js +30 -17
- package/lib/components/Dropdown/index.d.ts +11 -0
- package/lib/components/Dropdown/index.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +0 -1
- package/lib/components/FileUploader/FileUploader.js +2 -2
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -2
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +2 -1
- package/lib/components/FluidDatePicker/FluidDatePicker.js +2 -2
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +2 -2
- package/lib/components/FluidForm/FluidForm.d.ts +11 -0
- package/lib/components/FluidForm/FluidForm.js +2 -2
- package/lib/components/FluidForm/FormContext.d.ts +11 -0
- package/lib/components/FluidForm/index.d.ts +10 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -1
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +2 -1
- package/lib/components/FluidSelect/FluidSelect.js +2 -1
- package/lib/components/FluidSelect/index.js +0 -2
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -1
- package/lib/components/FluidTextInput/index.js +0 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +2 -2
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -2
- package/lib/components/Form/Form.js +2 -1
- package/lib/components/FormGroup/FormGroup.js +2 -1
- package/lib/components/IconButton/index.js +1 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +4 -1
- package/lib/components/Link/Link.js +2 -1
- package/lib/components/ListBox/ListBox.d.ts +60 -0
- package/lib/components/ListBox/ListBox.js +3 -14
- package/lib/components/ListBox/ListBoxField.d.ts +18 -0
- package/lib/components/ListBox/ListBoxField.js +1 -1
- package/lib/components/ListBox/ListBoxMenu.d.ts +22 -0
- package/lib/components/ListBox/ListBoxMenu.js +2 -2
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +31 -0
- package/lib/components/ListBox/ListBoxMenuIcon.js +8 -5
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +24 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -3
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +14 -0
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -2
- package/lib/components/ListBox/ListBoxSelection.d.ts +51 -0
- package/lib/components/ListBox/ListBoxSelection.js +7 -20
- package/lib/components/ListBox/index.d.ts +23 -0
- package/lib/components/ListBox/index.js +12 -8
- package/lib/components/ListBox/next/ListBoxSelection.js +2 -2
- package/lib/components/ListBox/next/ListBoxTrigger.js +2 -1
- package/lib/components/ListItem/ListItem.js +2 -1
- package/lib/components/Menu/Menu.js +4 -3
- package/lib/components/Menu/MenuOption.js +2 -2
- package/lib/components/Modal/Modal.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +0 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +10 -10
- package/lib/components/MultiSelect/MultiSelect.js +10 -10
- package/lib/components/Notification/Notification.js +2 -3
- package/lib/components/NumberInput/NumberInput.Skeleton.d.ts +32 -0
- package/lib/components/OrderedList/OrderedList.js +2 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +40 -54
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/lib/components/OverflowMenuV2/index.js +2 -2
- package/lib/components/Pagination/Pagination.js +2 -1
- package/lib/components/Pagination/experimental/Pagination.js +0 -1
- package/lib/components/PaginationNav/PaginationNav.js +2 -2
- package/lib/components/PrimaryButton/PrimaryButton.js +3 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioButton/RadioButton.js +2 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +2 -1
- package/lib/components/Search/Search.js +4 -3
- package/lib/components/Search/index.js +0 -2
- package/lib/components/SecondaryButton/SecondaryButton.js +3 -2
- package/lib/components/Select/Select.Skeleton.d.ts +33 -0
- package/lib/components/Select/Select.Skeleton.js +2 -1
- package/lib/components/Select/Select.js +2 -1
- package/lib/components/SelectItem/SelectItem.js +2 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +2 -1
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -1
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -1
- package/lib/components/SkeletonText/SkeletonText.js +2 -1
- package/lib/components/Slider/Slider.Skeleton.d.ts +33 -0
- package/lib/components/Slider/Slider.Skeleton.js +2 -1
- package/lib/components/StructuredList/StructuredList.Skeleton.js +2 -1
- package/lib/components/Switch/Switch.js +2 -1
- package/lib/components/TabContent/TabContent.js +2 -1
- package/lib/components/Tabs/Tabs.js +2 -3
- package/lib/components/Tag/Tag.js +2 -1
- package/lib/{lib/components → components}/Text/Text.d.ts +0 -0
- package/lib/{lib/components → components}/Text/TextDirection.d.ts +0 -0
- package/lib/{lib/components → components}/Text/createTextComponent.d.ts +0 -0
- package/lib/{lib/components → components}/Text/index.d.ts +0 -0
- package/lib/components/TextArea/TextArea.Skeleton.js +2 -1
- package/lib/components/TextArea/TextArea.js +6 -3
- package/lib/components/TextArea/index.js +0 -2
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -1
- package/lib/components/TextInput/PasswordInput.js +2 -1
- package/lib/components/TextInput/TextInput.Skeleton.js +2 -1
- package/lib/components/TextInput/TextInput.js +2 -1
- package/lib/components/TextInput/index.js +0 -2
- package/lib/components/Tile/Tile.js +3 -7
- package/lib/components/TimePicker/TimePicker.js +2 -1
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -1
- package/lib/components/Toggletip/index.js +2 -2
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.js +33 -4
- package/lib/components/TreeView/TreeNode.js +2 -2
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/Content.js +2 -1
- package/lib/components/UIShell/Header.js +2 -1
- package/lib/components/UIShell/HeaderContainer.js +2 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +4 -3
- package/lib/components/UIShell/HeaderMenuItem.js +2 -1
- package/lib/components/UIShell/HeaderPanel.js +2 -1
- package/lib/components/UIShell/HeaderSideNavItems.js +2 -1
- package/lib/components/UIShell/Link.js +2 -1
- package/lib/components/UIShell/SideNav.js +2 -1
- package/lib/components/UIShell/SideNavDetails.js +2 -1
- package/lib/components/UIShell/SideNavHeader.js +2 -1
- package/lib/components/UIShell/SideNavItems.js +2 -1
- package/lib/components/UIShell/SideNavLink.js +2 -1
- package/lib/components/UIShell/SideNavMenu.js +5 -3
- package/lib/components/UIShell/SideNavMenuItem.js +2 -1
- package/lib/components/UIShell/SideNavSwitcher.js +2 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherDivider.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +2 -1
- package/lib/components/UnorderedList/UnorderedList.js +2 -1
- package/lib/{lib/index.d.ts → index.d.ts} +0 -0
- package/lib/index.js +281 -287
- package/lib/internal/FloatingMenu.js +4 -5
- package/lib/internal/OptimizedResize.js +3 -1
- package/lib/internal/useIsomorphicEffect.js +2 -1
- package/lib/{lib/internal → internal}/usePrefix.d.ts +0 -0
- package/lib/tools/mergeRefs.js +3 -1
- package/lib/tools/wrapComponent.js +3 -1
- package/package.json +5 -5
- package/es/components/ContainedList/index.js +0 -13
- package/es/components/DataTable/index.js +0 -70
- package/es/components/TreeView/index.js +0 -13
- package/lib/components/ContainedList/index.js +0 -19
- package/lib/components/DataTable/index.js +0 -76
- package/lib/components/TreeView/index.js +0 -19
|
@@ -10,6 +10,8 @@ import React__default, { useRef, useEffect } from 'react';
|
|
|
10
10
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
11
11
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
12
12
|
|
|
13
|
+
/** @type any */
|
|
14
|
+
|
|
13
15
|
var InlineCheckbox = /*#__PURE__*/React__default.forwardRef(function InlineCheckbox(props, forwardRef) {
|
|
14
16
|
var ariaLabel = props.ariaLabel,
|
|
15
17
|
_props$checked = props.checked,
|
|
@@ -116,5 +118,6 @@ InlineCheckbox.propTypes = {
|
|
|
116
118
|
*/
|
|
117
119
|
title: PropTypes.string
|
|
118
120
|
};
|
|
121
|
+
var InlineCheckbox$1 = InlineCheckbox;
|
|
119
122
|
|
|
120
|
-
export { InlineCheckbox as default };
|
|
123
|
+
export { InlineCheckbox$1 as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { ListBoxType, ListBoxSize } from './ListBoxPropTypes';
|
|
9
|
+
import { ForwardRefReturn, ReactAttr } from '../../types/common';
|
|
10
|
+
type ExcludedAttributes = 'onKeyDown' | 'onKeyPress' | 'ref';
|
|
11
|
+
export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> {
|
|
12
|
+
/**
|
|
13
|
+
* Specify whether the ListBox is currently disabled
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Specify whether the control is currently invalid
|
|
18
|
+
*/
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Specify the text to be displayed when the control is invalid
|
|
22
|
+
*/
|
|
23
|
+
invalidText?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Specify if the control should render open
|
|
26
|
+
*/
|
|
27
|
+
isOpen?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
30
|
+
* Don't use this to make tile background color same as container background color.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated The `light` prop for `ListBox` has been deprecated in favor of
|
|
33
|
+
* the new `Layer` component. It will be removed in the next major release.
|
|
34
|
+
*/
|
|
35
|
+
light?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
38
|
+
*/
|
|
39
|
+
size?: ListBoxSize;
|
|
40
|
+
/**
|
|
41
|
+
* Specify the "type" of the ListBox. Currently supports either `default` or
|
|
42
|
+
* `inline` as an option.
|
|
43
|
+
*/
|
|
44
|
+
type?: ListBoxType;
|
|
45
|
+
/**
|
|
46
|
+
* Specify whether the control is currently in warning state
|
|
47
|
+
*/
|
|
48
|
+
warn?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Provide the text that is displayed when the control is in warning state
|
|
51
|
+
*/
|
|
52
|
+
warnText?: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export type ListBoxComponent = ForwardRefReturn<HTMLDivElement, ListBoxProps>;
|
|
55
|
+
/**
|
|
56
|
+
* `ListBox` is a generic container component that handles creating the
|
|
57
|
+
* container class name in response to certain props.
|
|
58
|
+
*/
|
|
59
|
+
declare const ListBox: ListBoxComponent;
|
|
60
|
+
export default ListBox;
|
|
@@ -5,18 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import React__default, { useContext } from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import deprecate from '../../prop-types/deprecate.js';
|
|
13
13
|
import { ListBoxSize, ListBoxType } from './ListBoxPropTypes.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
-
import ListBoxField from './ListBoxField.js';
|
|
16
|
-
import ListBoxMenu from './ListBoxMenu.js';
|
|
17
|
-
import ListBoxMenuIcon from './ListBoxMenuIcon.js';
|
|
18
|
-
import ListBoxMenuItem from './ListBoxMenuItem.js';
|
|
19
|
-
import ListBoxSelection from './ListBoxSelection.js';
|
|
20
15
|
import '../FluidForm/FluidForm.js';
|
|
21
16
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
22
17
|
|
|
@@ -32,14 +27,13 @@ var handleClick = function handleClick(event) {
|
|
|
32
27
|
event.preventDefault();
|
|
33
28
|
event.stopPropagation();
|
|
34
29
|
};
|
|
30
|
+
|
|
35
31
|
/**
|
|
36
32
|
* `ListBox` is a generic container component that handles creating the
|
|
37
33
|
* container class name in response to certain props.
|
|
38
34
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
35
|
var ListBox = /*#__PURE__*/React__default.forwardRef(function ListBox(_ref, ref) {
|
|
42
|
-
var
|
|
36
|
+
var _objectSpread2$1;
|
|
43
37
|
|
|
44
38
|
var children = _ref.children,
|
|
45
39
|
containerClassName = _ref.className,
|
|
@@ -60,7 +54,7 @@ var ListBox = /*#__PURE__*/React__default.forwardRef(function ListBox(_ref, ref)
|
|
|
60
54
|
isFluid = _useContext.isFluid;
|
|
61
55
|
|
|
62
56
|
var showWarning = !invalid && warn;
|
|
63
|
-
var className = cx((
|
|
57
|
+
var className = cx(_objectSpread2(_objectSpread2({}, containerClassName && _defineProperty({}, containerClassName, true)), {}, (_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box"), true), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--").concat(size), size), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--inline"), type === 'inline'), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--disabled"), disabled), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--light"), light), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--expanded"), isOpen), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--invalid"), invalid), _defineProperty(_objectSpread2$1, "".concat(prefix, "--list-box--warning"), showWarning), _objectSpread2$1)));
|
|
64
58
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
65
59
|
className: className,
|
|
66
60
|
ref: ref,
|
|
@@ -138,10 +132,5 @@ ListBox.defaultProps = {
|
|
|
138
132
|
disabled: false,
|
|
139
133
|
type: 'default'
|
|
140
134
|
};
|
|
141
|
-
ListBox.Field = ListBoxField;
|
|
142
|
-
ListBox.Menu = ListBoxMenu;
|
|
143
|
-
ListBox.MenuIcon = ListBoxMenuIcon;
|
|
144
|
-
ListBox.MenuItem = ListBoxMenuItem;
|
|
145
|
-
ListBox.Selection = ListBoxSelection;
|
|
146
135
|
|
|
147
136
|
export { ListBox as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { ReactAttr } from '../../types/common';
|
|
9
|
+
export declare const translationIds: {};
|
|
10
|
+
export interface ListBoxFieldProps extends ReactAttr<HTMLDivElement> {
|
|
11
|
+
/**
|
|
12
|
+
* Specify if the parent <ListBox> is disabled
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type ListBoxFieldComponent = React.FC<ListBoxFieldProps>;
|
|
17
|
+
declare const _default: ListBoxFieldComponent;
|
|
18
|
+
export default _default;
|
|
@@ -11,12 +11,12 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
12
12
|
|
|
13
13
|
var _excluded = ["children", "disabled", "tabIndex"];
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* `ListBoxField` is responsible for creating the containing node for valid
|
|
16
17
|
* elements inside of a field. It also provides a11y-related attributes like
|
|
17
18
|
* `role` to make sure a user can focus the given field.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
20
|
function ListBoxField(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
22
22
|
disabled = _ref.disabled,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { ForwardRefReturn, ReactAttr } from '../../types/common';
|
|
8
|
+
type ExcludedAttributes = 'id';
|
|
9
|
+
export interface ListBoxMenuProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> {
|
|
10
|
+
/**
|
|
11
|
+
* Specify a custom `id`
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export type ListBoxMenuComponent = ForwardRefReturn<HTMLDivElement, ListBoxMenuProps>;
|
|
16
|
+
/**
|
|
17
|
+
* `ListBoxMenu` is a simple container node that isolates the `list-box__menu`
|
|
18
|
+
* class into a single component. It is also being used to validate given
|
|
19
|
+
* `children` components.
|
|
20
|
+
*/
|
|
21
|
+
declare const ListBoxMenu: ListBoxMenuComponent;
|
|
22
|
+
export default ListBoxMenu;
|
|
@@ -12,12 +12,12 @@ import PropTypes from 'prop-types';
|
|
|
12
12
|
import ListBoxMenuItem from './ListBoxMenuItem.js';
|
|
13
13
|
|
|
14
14
|
var _excluded = ["children", "id"];
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* `ListBoxMenu` is a simple container node that isolates the `list-box__menu`
|
|
17
18
|
* class into a single component. It is also being used to validate given
|
|
18
19
|
* `children` components.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var ListBoxMenu = /*#__PURE__*/React__default.forwardRef(function ListBoxMenu(_ref, ref) {
|
|
22
22
|
var children = _ref.children,
|
|
23
23
|
id = _ref.id,
|
|
@@ -36,7 +36,7 @@ ListBoxMenu.propTypes = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Provide the contents of your ListBoxMenu
|
|
38
38
|
*/
|
|
39
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(ListBoxMenuItem),
|
|
39
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.oneOf([ListBoxMenuItem])),
|
|
40
40
|
/**
|
|
41
41
|
* allow single item using the workaround for functional components
|
|
42
42
|
* https://github.com/facebook/react/issues/2979#issuecomment-222379916
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export declare const translationIds: {
|
|
9
|
+
'close.menu': string;
|
|
10
|
+
'open.menu': string;
|
|
11
|
+
};
|
|
12
|
+
export interface ListBoxMenuIconProps {
|
|
13
|
+
/**
|
|
14
|
+
* Specify whether the menu is currently open, which will influence the
|
|
15
|
+
* direction of the menu icon
|
|
16
|
+
*/
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* i18n hook used to provide the appropriate description for the given menu
|
|
20
|
+
* icon. This function takes in an id defined in `translationIds` and should
|
|
21
|
+
* return a string message for that given message id.
|
|
22
|
+
*/
|
|
23
|
+
translateWithId?(messageId: string, args?: Record<string, unknown>): string;
|
|
24
|
+
}
|
|
25
|
+
export type ListBoxMenuIconComponent = React.FC<ListBoxMenuIconProps>;
|
|
26
|
+
/**
|
|
27
|
+
* `ListBoxMenuIcon` is used to orient the icon up or down depending on the
|
|
28
|
+
* state of the menu for a given `ListBox`
|
|
29
|
+
*/
|
|
30
|
+
declare const ListBoxMenuIcon: ListBoxMenuIconComponent;
|
|
31
|
+
export default ListBoxMenuIcon;
|
|
@@ -18,14 +18,19 @@ var translationIds = {
|
|
|
18
18
|
'open.menu': 'open.menu'
|
|
19
19
|
};
|
|
20
20
|
var defaultTranslations = (_defaultTranslations = {}, _defineProperty(_defaultTranslations, translationIds['close.menu'], 'Close menu'), _defineProperty(_defaultTranslations, translationIds['open.menu'], 'Open menu'), _defaultTranslations);
|
|
21
|
+
|
|
22
|
+
var defaultTranslateWithId = function defaultTranslateWithId(id) {
|
|
23
|
+
return defaultTranslations[id];
|
|
24
|
+
};
|
|
25
|
+
|
|
21
26
|
/**
|
|
22
27
|
* `ListBoxMenuIcon` is used to orient the icon up or down depending on the
|
|
23
28
|
* state of the menu for a given `ListBox`
|
|
24
29
|
*/
|
|
25
|
-
|
|
26
30
|
var ListBoxMenuIcon = function ListBoxMenuIcon(_ref) {
|
|
27
31
|
var isOpen = _ref.isOpen,
|
|
28
|
-
|
|
32
|
+
_ref$translateWithId = _ref.translateWithId,
|
|
33
|
+
t = _ref$translateWithId === void 0 ? defaultTranslateWithId : _ref$translateWithId;
|
|
29
34
|
var prefix = usePrefix();
|
|
30
35
|
var className = cx("".concat(prefix, "--list-box__menu-icon"), _defineProperty({}, "".concat(prefix, "--list-box__menu-icon--open"), isOpen));
|
|
31
36
|
var description = isOpen ? t('close.menu') : t('open.menu');
|
|
@@ -52,9 +57,7 @@ ListBoxMenuIcon.propTypes = {
|
|
|
52
57
|
translateWithId: PropTypes.func.isRequired
|
|
53
58
|
};
|
|
54
59
|
ListBoxMenuIcon.defaultProps = {
|
|
55
|
-
translateWithId:
|
|
56
|
-
return defaultTranslations[id];
|
|
57
|
-
}
|
|
60
|
+
translateWithId: defaultTranslateWithId
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
export { ListBoxMenuIcon as default, translationIds };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React, { ForwardedRef } from 'react';
|
|
8
|
+
import { ForwardRefReturn, ReactAttr } from '../../types/common';
|
|
9
|
+
export interface ListBoxMenuItemProps extends ReactAttr<HTMLDivElement> {
|
|
10
|
+
/**
|
|
11
|
+
* Specify whether the current menu item is "active".
|
|
12
|
+
*/
|
|
13
|
+
isActive?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Specify whether the current menu item is "highlighted".
|
|
16
|
+
*/
|
|
17
|
+
isHighlighted?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type ListBoxMenuItemForwardedRef = ForwardedRef<HTMLDivElement> & {
|
|
20
|
+
menuItemOptionRef?: React.Ref<HTMLDivElement>;
|
|
21
|
+
} | null;
|
|
22
|
+
export type ListBoxMenuItemComponent = ForwardRefReturn<ListBoxMenuItemForwardedRef, ListBoxMenuItemProps>;
|
|
23
|
+
declare const _default: ListBoxMenuItemComponent;
|
|
24
|
+
export default _default;
|
|
@@ -27,13 +27,12 @@ function useIsTruncated(ref) {
|
|
|
27
27
|
}, [ref, setIsTruncated]);
|
|
28
28
|
return isTruncated;
|
|
29
29
|
}
|
|
30
|
+
|
|
30
31
|
/**
|
|
31
32
|
* `ListBoxMenuItem` is a helper component for managing the container class
|
|
32
33
|
* name, alongside any classes for any corresponding states, for a generic list
|
|
33
34
|
* box menu item.
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
36
|
var ListBoxMenuItem = /*#__PURE__*/React__default.forwardRef(function ListBoxMenuItem(_ref, forwardedRef) {
|
|
38
37
|
var _cx;
|
|
39
38
|
|
|
@@ -50,7 +49,7 @@ var ListBoxMenuItem = /*#__PURE__*/React__default.forwardRef(function ListBoxMen
|
|
|
50
49
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
51
50
|
className: className,
|
|
52
51
|
title: isTruncated ? title : undefined,
|
|
53
|
-
tabIndex:
|
|
52
|
+
tabIndex: -1
|
|
54
53
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
55
54
|
className: "".concat(prefix, "--list-box__menu-item__option"),
|
|
56
55
|
ref: (forwardedRef === null || forwardedRef === void 0 ? void 0 : forwardedRef.menuItemOptionRef) || ref
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
declare const listBoxTypes: readonly ["default", "inline"];
|
|
9
|
+
declare const listBoxSizes: readonly ["sm", "md", "lg"];
|
|
10
|
+
export type ListBoxType = typeof listBoxTypes[number];
|
|
11
|
+
export type ListBoxSize = typeof listBoxSizes[number];
|
|
12
|
+
export declare const ListBoxType: PropTypes.Requireable<"default" | "inline">;
|
|
13
|
+
export declare const ListBoxSize: PropTypes.Requireable<"md" | "sm" | "lg">;
|
|
14
|
+
export {};
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
var
|
|
10
|
+
var listBoxTypes = ['default', 'inline'];
|
|
11
|
+
var listBoxSizes = ['sm', 'md', 'lg'];
|
|
12
|
+
var ListBoxType = PropTypes.oneOf(listBoxTypes);
|
|
13
|
+
var ListBoxSize = PropTypes.oneOf(listBoxSizes);
|
|
12
14
|
|
|
13
15
|
export { ListBoxSize, ListBoxType };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { KeyboardEvent, MouseEvent } from 'react';
|
|
9
|
+
export interface ListBoxSelectionProps {
|
|
10
|
+
/**
|
|
11
|
+
* Specify a function to be invoked when a user interacts with the clear
|
|
12
|
+
* selection element.
|
|
13
|
+
*/
|
|
14
|
+
clearSelection(event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Specify whether or not the clear selection element should be disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Specify an optional `onClearSelection` handler that is called when the underlying
|
|
21
|
+
* element is cleared
|
|
22
|
+
*/
|
|
23
|
+
onClearSelection?(event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>): void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether or not the Dropdown is readonly
|
|
26
|
+
*/
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify an optional `selectionCount` value that will be used to determine
|
|
30
|
+
* whether the selection should display a badge or a single clear icon.
|
|
31
|
+
*/
|
|
32
|
+
selectionCount?: number;
|
|
33
|
+
/**
|
|
34
|
+
* i18n hook used to provide the appropriate description for the given menu
|
|
35
|
+
* icon. This function takes in an id defined in `translationIds` and should
|
|
36
|
+
* return a string message for that given message id.
|
|
37
|
+
*/
|
|
38
|
+
translateWithId(messageId: string, args?: Record<string, unknown>): string;
|
|
39
|
+
}
|
|
40
|
+
export type ListBoxSelectionComponent = React.FC<ListBoxSelectionProps>;
|
|
41
|
+
/**
|
|
42
|
+
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
43
|
+
* addition to conditionally rendering a badge if the control has more than one
|
|
44
|
+
* selection.
|
|
45
|
+
*/
|
|
46
|
+
declare const ListBoxSelection: ListBoxSelectionComponent;
|
|
47
|
+
export declare const translationIds: {
|
|
48
|
+
'clear.all': string;
|
|
49
|
+
'clear.selection': string;
|
|
50
|
+
};
|
|
51
|
+
export default ListBoxSelection;
|
|
@@ -10,18 +10,18 @@ import cx from 'classnames';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
|
-
import { Enter } from '../../internal/keyboard/keys.js';
|
|
14
|
-
import { match } from '../../internal/keyboard/match.js';
|
|
15
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
import { match } from '../../internal/keyboard/match.js';
|
|
15
|
+
import { Enter } from '../../internal/keyboard/keys.js';
|
|
16
16
|
|
|
17
17
|
var _Close, _Close2, _defaultTranslations;
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
20
21
|
* addition to conditionally rendering a badge if the control has more than one
|
|
21
22
|
* selection.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
function ListBoxSelection(_ref) {
|
|
24
|
+
var ListBoxSelection = function ListBoxSelection(_ref) {
|
|
25
25
|
var _cx;
|
|
26
26
|
|
|
27
27
|
var clearSelection = _ref.clearSelection,
|
|
@@ -55,7 +55,7 @@ function ListBoxSelection(_ref) {
|
|
|
55
55
|
} // When a user hits ENTER, we'll clear the selection
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
if (match(event, Enter)) {
|
|
58
|
+
if (match(event.code, Enter)) {
|
|
59
59
|
clearSelection(event);
|
|
60
60
|
|
|
61
61
|
if (onClearSelection) {
|
|
@@ -70,14 +70,13 @@ function ListBoxSelection(_ref) {
|
|
|
70
70
|
className: tagClasses
|
|
71
71
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
72
72
|
className: "".concat(prefix, "--tag__label"),
|
|
73
|
-
title: selectionCount
|
|
73
|
+
title: "".concat(selectionCount)
|
|
74
74
|
}, selectionCount), /*#__PURE__*/React__default.createElement("div", {
|
|
75
75
|
role: "button",
|
|
76
76
|
tabIndex: disabled ? -1 : 0,
|
|
77
77
|
className: "".concat(prefix, "--tag__close-icon"),
|
|
78
78
|
onClick: handleOnClick,
|
|
79
79
|
onKeyDown: handleOnKeyDown,
|
|
80
|
-
disabled: disabled,
|
|
81
80
|
"aria-label": t('clear.all'),
|
|
82
81
|
title: description,
|
|
83
82
|
"aria-disabled": readOnly ? true : undefined
|
|
@@ -90,7 +89,7 @@ function ListBoxSelection(_ref) {
|
|
|
90
89
|
"aria-label": description,
|
|
91
90
|
title: description
|
|
92
91
|
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React__default.createElement(Close, null)));
|
|
93
|
-
}
|
|
92
|
+
};
|
|
94
93
|
|
|
95
94
|
var translationIds = {
|
|
96
95
|
'clear.all': 'clear.all',
|
|
@@ -115,18 +114,6 @@ ListBoxSelection.propTypes = {
|
|
|
115
114
|
*/
|
|
116
115
|
onClearSelection: PropTypes.func,
|
|
117
116
|
|
|
118
|
-
/**
|
|
119
|
-
* Specify an optional `onClick` handler that is called when the underlying
|
|
120
|
-
* clear selection element is clicked
|
|
121
|
-
*/
|
|
122
|
-
onClick: PropTypes.func,
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Specify an optional `onKeyDown` handler that is called when the underlying
|
|
126
|
-
* clear selection element fires a keydown event
|
|
127
|
-
*/
|
|
128
|
-
onKeyDown: PropTypes.func,
|
|
129
|
-
|
|
130
117
|
/**
|
|
131
118
|
* Whether or not the Dropdown is readonly
|
|
132
119
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export * as PropTypes from './ListBoxPropTypes';
|
|
8
|
+
export * from './ListBoxPropTypes';
|
|
9
|
+
import { ListBoxComponent as ListBoxPartialComponent } from './ListBox';
|
|
10
|
+
import { ListBoxFieldComponent } from './ListBoxField';
|
|
11
|
+
import { ListBoxMenuComponent } from './ListBoxMenu';
|
|
12
|
+
import { ListBoxMenuIconComponent } from './ListBoxMenuIcon';
|
|
13
|
+
import { ListBoxMenuItemComponent } from './ListBoxMenuItem';
|
|
14
|
+
import { ListBoxSelectionComponent } from './ListBoxSelection';
|
|
15
|
+
export interface ListBoxComponent extends ListBoxPartialComponent {
|
|
16
|
+
readonly Field: ListBoxFieldComponent;
|
|
17
|
+
readonly Menu: ListBoxMenuComponent;
|
|
18
|
+
readonly MenuIcon: ListBoxMenuIconComponent;
|
|
19
|
+
readonly MenuItem: ListBoxMenuItemComponent;
|
|
20
|
+
readonly Selection: ListBoxSelectionComponent;
|
|
21
|
+
}
|
|
22
|
+
declare const ListBox: ListBoxComponent;
|
|
23
|
+
export default ListBox;
|
|
@@ -5,17 +5,20 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
import ListBox from './ListBox.js';
|
|
10
|
-
export { default } from './ListBox.js';
|
|
8
|
+
export { ListBoxSize, ListBoxType } from './ListBoxPropTypes.js';
|
|
9
|
+
import ListBox$1 from './ListBox.js';
|
|
11
10
|
import ListBoxField from './ListBoxField.js';
|
|
12
11
|
import ListBoxMenu from './ListBoxMenu.js';
|
|
13
12
|
import ListBoxMenuIcon from './ListBoxMenuIcon.js';
|
|
14
13
|
import ListBoxMenuItem from './ListBoxMenuItem.js';
|
|
15
14
|
import ListBoxSelection from './ListBoxSelection.js';
|
|
16
15
|
|
|
17
|
-
ListBox
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var ListBox = Object.assign(ListBox$1, {
|
|
17
|
+
Field: ListBoxField,
|
|
18
|
+
Menu: ListBoxMenu,
|
|
19
|
+
MenuIcon: ListBoxMenuIcon,
|
|
20
|
+
MenuItem: ListBoxMenuItem,
|
|
21
|
+
Selection: ListBoxSelection
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { ListBox as default };
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
|
-
import { Enter } from '../../../internal/keyboard/keys.js';
|
|
14
|
-
import { match } from '../../../internal/keyboard/match.js';
|
|
15
13
|
import { usePrefix } from '../../../internal/usePrefix.js';
|
|
14
|
+
import { match } from '../../../internal/keyboard/match.js';
|
|
15
|
+
import { Enter } from '../../../internal/keyboard/keys.js';
|
|
16
16
|
|
|
17
17
|
var _Close, _Close2, _defaultTranslations;
|
|
18
18
|
|
|
@@ -10,14 +10,14 @@ import React__default, { useRef, useState, useEffect } from 'react';
|
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
|
-
import { Tab, Enter, Space, Escape, ArrowLeft, ArrowUp, ArrowDown } from '../../internal/keyboard/keys.js';
|
|
14
|
-
import { match } from '../../internal/keyboard/match.js';
|
|
15
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
14
|
import { getParentMenu, getNextNode, getParentNode, getValidNodes, clickedElementHasSubnodes, getPosition, capWithinRange, resetFocus, focusNode } from './_utils.js';
|
|
17
15
|
import MenuGroup from './MenuGroup.js';
|
|
18
16
|
import MenuRadioGroup from './MenuRadioGroup.js';
|
|
19
17
|
import MenuRadioGroupOptions from './MenuRadioGroupOptions.js';
|
|
20
18
|
import MenuSelectableItem from './MenuSelectableItem.js';
|
|
19
|
+
import { match } from '../../internal/keyboard/match.js';
|
|
20
|
+
import { Tab, Enter, Space, Escape, ArrowLeft, ArrowUp, ArrowDown } from '../../internal/keyboard/keys.js';
|
|
21
21
|
|
|
22
22
|
var _excluded = ["children", "className", "id", "level", "open", "size", "target", "x", "y", "onClose"];
|
|
23
23
|
var margin = 16; // distance to keep to body edges, in px
|
|
@@ -323,5 +323,6 @@ Menu.propTypes = {
|
|
|
323
323
|
*/
|
|
324
324
|
y: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)])
|
|
325
325
|
};
|
|
326
|
+
var Menu$1 = Menu;
|
|
326
327
|
|
|
327
|
-
export { Menu as default };
|
|
328
|
+
export { Menu$1 as default };
|
|
@@ -10,11 +10,11 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { CaretRight } from '@carbon/icons-react';
|
|
13
|
-
import { ArrowRight, Enter, Space } from '../../internal/keyboard/keys.js';
|
|
14
|
-
import { match } from '../../internal/keyboard/match.js';
|
|
15
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
14
|
import { getFirstSubNode, focusNode, clickedElementHasSubnodes, getParentMenu } from './_utils.js';
|
|
17
15
|
import Menu from './Menu.js';
|
|
16
|
+
import { match } from '../../internal/keyboard/match.js';
|
|
17
|
+
import { ArrowRight, Enter, Space } from '../../internal/keyboard/keys.js';
|
|
18
18
|
|
|
19
19
|
var _CaretRight;
|
|
20
20
|
|
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default, { useRef, useEffect } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
13
|
import toggleClass from '../../tools/toggleClass.js';
|
|
14
14
|
import Button from '../Button/Button.js';
|
|
15
|
-
import '../Button/Button.Skeleton.js';
|
|
16
15
|
import ButtonSet from '../ButtonSet/ButtonSet.js';
|
|
17
16
|
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
18
17
|
import wrapFocus, { elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
@@ -271,5 +270,6 @@ Modal.defaultProps = {
|
|
|
271
270
|
selectorPrimaryFocus: '[data-modal-primary-focus]',
|
|
272
271
|
hasScrollingContent: false
|
|
273
272
|
};
|
|
273
|
+
var Modal$1 = Modal;
|
|
274
274
|
|
|
275
|
-
export { Modal as default };
|
|
275
|
+
export { Modal$1 as default };
|