From e33970c0fdf317f99c75ed9aa895a481295b37f4 Mon Sep 17 00:00:00 2001 From: Kyle Albert <5498623+kalbert312@users.noreply.github.com> Date: Wed, 7 Aug 2019 16:59:35 -0400 Subject: [PATCH] [@types/carbon-components-react] [NEW] New types package for carbon-components-react. (#37442) * Init carbon-components-react. * Fix tsconfig. * Add missing file. * Fix test + read only array. * Fix test. --- .../carbon-components-react-tests.tsx | 90 ++++++ .../Accordion/Accordion.Skeleton.d.ts | 11 + .../components/Accordion/Accordion.d.ts | 13 + .../components/Accordion/AccordionItem.d.ts | 19 ++ .../components/Accordion/index.d.ts | 7 + .../AccordionItem/AccordionItem.d.ts | 1 + .../components/AccordionItem/index.d.ts | 1 + .../Breadcrumb/Breadcrumb.Skeleton.d.ts | 7 + .../components/Breadcrumb/Breadcrumb.d.ts | 12 + .../components/Breadcrumb/BreadcrumbItem.d.ts | 15 + .../components/Breadcrumb/index.d.ts | 11 + .../components/BreadcrumbItem/index.d.ts | 1 + .../components/Button/Button.Skeleton.d.ts | 13 + .../components/Button/Button.d.ts | 30 ++ .../components/Button/index.d.ts | 3 + .../Checkbox/Checkbox.Skeleton.d.ts | 10 + .../components/Checkbox/Checkbox.d.ts | 21 ++ .../components/Checkbox/index.d.ts | 3 + .../CodeSnippet/CodeSnippet.Skeleton.d.ts | 12 + .../components/CodeSnippet/CodeSnippet.d.ts | 28 ++ .../components/CodeSnippet/index.d.ts | 3 + .../components/ComboBox/ComboBox.d.ts | 32 ++ .../components/ComboBox/index.d.ts | 2 + .../ComposedModal/ComposedModal.d.ts | 64 ++++ .../components/ComposedModal/index.d.ts | 2 + .../ContentSwitcher/ContentSwitcher.d.ts | 15 + .../components/ContentSwitcher/Switch.d.ts | 15 + .../components/ContentSwitcher/index.d.ts | 4 + .../components/Copy/Copy.d.ts | 18 ++ .../components/Copy/index.d.ts | 2 + .../components/CopyButton/CopyButton.d.ts | 15 + .../components/CopyButton/index.d.ts | 2 + .../components/DangerButton/DangerButton.d.ts | 10 + .../components/DangerButton/index.d.ts | 2 + .../components/DataTable/DataTable.d.ts | 217 +++++++++++++ .../components/DataTable/Table.d.ts | 15 + .../components/DataTable/TableActionList.d.ts | 10 + .../DataTable/TableBatchAction.d.ts | 10 + .../DataTable/TableBatchActions.d.ts | 19 ++ .../components/DataTable/TableBody.d.ts | 10 + .../components/DataTable/TableCell.d.ts | 9 + .../components/DataTable/TableContainer.d.ts | 13 + .../DataTable/TableExpandHeader.d.ts | 9 + .../components/DataTable/TableExpandRow.d.ts | 17 + .../DataTable/TableExpandedRow.d.ts | 12 + .../components/DataTable/TableHead.d.ts | 10 + .../components/DataTable/TableHeader.d.ts | 25 ++ .../components/DataTable/TableRow.d.ts | 10 + .../components/DataTable/TableSelectAll.d.ts | 19 ++ .../components/DataTable/TableSelectRow.d.ts | 19 ++ .../components/DataTable/TableToolbar.d.ts | 7 + .../DataTable/TableToolbarAction.d.ts | 7 + .../DataTable/TableToolbarContent.d.ts | 10 + .../DataTable/TableToolbarMenu.d.ts | 14 + .../DataTable/TableToolbarSearch.d.ts | 25 ++ .../components/DataTable/index.d.ts | 68 ++++ .../components/DataTable/state/sorting.d.ts | 10 + .../DataTableSkeleton/DataTableSkeleton.d.ts | 21 ++ .../components/DataTableSkeleton/index.d.ts | 2 + .../DatePicker/DatePicker.Skeleton.d.ts | 14 + .../components/DatePicker/DatePicker.d.ts | 25 ++ .../components/DatePicker/index.d.ts | 3 + .../DatePickerInput/DatePickerInput.d.ts | 19 ++ .../components/DatePickerInput/index.d.ts | 2 + .../Dropdown/Dropdown.Skeleton.d.ts | 9 + .../components/Dropdown/Dropdown.d.ts | 33 ++ .../components/Dropdown/index.d.ts | 3 + .../FileUploader/FileUploader.Skeleton.d.ts | 7 + .../components/FileUploader/FileUploader.d.ts | 69 +++++ .../components/FileUploader/index.d.ts | 3 + .../components/Form/Form.d.ts | 9 + .../components/Form/index.d.ts | 2 + .../components/FormGroup/FormGroup.d.ts | 16 + .../components/FormGroup/index.d.ts | 2 + .../components/FormItem/FormItem.d.ts | 10 + .../components/FormItem/index.d.ts | 2 + .../components/FormLabel/FormLabel.d.ts | 10 + .../components/FormLabel/index.d.ts | 2 + .../components/Icon/Icon.Skeleton.d.ts | 12 + .../components/Icon/Icon.d.ts | 34 ++ .../components/Icon/index.d.ts | 3 + .../InlineCheckbox/InlineCheckbox.d.ts | 21 ++ .../components/InlineCheckbox/index.d.ts | 2 + .../InlineLoading/InlineLoading.d.ts | 15 + .../components/InlineLoading/index.d.ts | 2 + .../components/Link/Link.d.ts | 12 + .../components/Link/index.d.ts | 2 + .../components/ListBox/ListBox.d.ts | 29 ++ .../components/ListBox/ListBoxField.d.ts | 17 + .../components/ListBox/ListBoxMenu.d.ts | 15 + .../components/ListBox/ListBoxMenuIcon.d.ts | 15 + .../components/ListBox/ListBoxMenuItem.d.ts | 15 + .../components/ListBox/ListBoxPropTypes.d.ts | 1 + .../components/ListBox/ListBoxSelection.d.ts | 16 + .../components/ListBox/index.d.ts | 5 + .../components/ListItem/ListItem.d.ts | 10 + .../components/ListItem/index.d.ts | 2 + .../components/Loading/Loading.d.ts | 18 ++ .../components/Loading/index.d.ts | 2 + .../components/Modal/Modal.d.ts | 31 ++ .../components/Modal/index.d.ts | 2 + .../components/ModalWrapper/ModalWrapper.d.ts | 25 ++ .../components/ModalWrapper/index.d.ts | 2 + .../MultiSelect/FilterableMultiSelect.d.ts | 18 ++ .../components/MultiSelect/MultiSelect.d.ts | 33 ++ .../MultiSelect/MultiSelectPropTypes.d.ts | 17 + .../components/MultiSelect/index.d.ts | 2 + .../components/Notification/Notification.d.ts | 96 ++++++ .../Notification/a11yIconWarningSolid.d.ts | 10 + .../components/Notification/index.d.ts | 1 + .../NumberInput/NumberInput.Skeleton.d.ts | 14 + .../components/NumberInput/NumberInput.d.ts | 27 ++ .../components/NumberInput/index.d.ts | 3 + .../components/OrderedList/OrderedList.d.ts | 11 + .../components/OrderedList/index.d.ts | 2 + .../components/OverflowMenu/OverflowMenu.d.ts | 30 ++ .../components/OverflowMenu/index.d.ts | 2 + .../OverflowMenuItem/OverflowMenuItem.d.ts | 34 ++ .../components/OverflowMenuItem/index.d.ts | 2 + .../Pagination/Pagination.Skeleton.d.ts | 7 + .../components/Pagination/Pagination.d.ts | 29 ++ .../components/Pagination/index.d.ts | 3 + .../PrimaryButton/PrimaryButton.d.ts | 10 + .../components/PrimaryButton/index.d.ts | 2 + .../ProgressIndicator.Skeleton.d.ts | 9 + .../ProgressIndicator/ProgressIndicator.d.ts | 40 +++ .../components/ProgressIndicator/index.d.ts | 2 + .../RadioButton/RadioButton.Skeleton.d.ts | 12 + .../components/RadioButton/RadioButton.d.ts | 20 ++ .../components/RadioButton/index.d.ts | 3 + .../RadioButtonGroup/RadioButtonGroup.d.ts | 20 ++ .../components/RadioButtonGroup/index.d.ts | 2 + .../components/RadioTile/RadioTile.d.ts | 21 ++ .../components/RadioTile/index.d.ts | 2 + .../components/Search/Search.Skeleton.d.ts | 12 + .../components/Search/Search.d.ts | 20 ++ .../components/Search/index.d.ts | 3 + .../SearchFilterButton.d.ts | 12 + .../components/SearchFilterButton/index.d.ts | 1 + .../SearchLayoutButton.d.ts | 17 + .../components/SearchLayoutButton/index.d.ts | 2 + .../SecondaryButton/SecondaryButton.d.ts | 10 + .../components/SecondaryButton/index.d.ts | 2 + .../components/Select/Select.Skeleton.d.ts | 14 + .../components/Select/Select.d.ts | 24 ++ .../components/Select/index.d.ts | 3 + .../components/SelectItem/SelectItem.d.ts | 13 + .../components/SelectItem/index.d.ts | 2 + .../SelectItemGroup/SelectItemGroup.d.ts | 13 + .../components/SelectItemGroup/index.d.ts | 2 + .../SkeletonPlaceholder.d.ts | 10 + .../components/SkeletonPlaceholder/index.d.ts | 2 + .../components/SkeletonText/SkeletonText.d.ts | 15 + .../components/SkeletonText/index.d.ts | 2 + .../components/Slider/Slider.Skeleton.d.ts | 14 + .../components/Slider/Slider.d.ts | 26 ++ .../components/Slider/index.d.ts | 3 + .../StructuredList.Skeleton.d.ts | 12 + .../StructuredList/StructuredList.d.ts | 72 +++++ .../components/StructuredList/index.d.ts | 2 + .../components/Switch/Switch.d.ts | 3 + .../components/Switch/index.d.ts | 2 + .../components/Tab/Tab.d.ts | 31 ++ .../components/Tab/index.d.ts | 2 + .../components/TabContent/TabContent.d.ts | 12 + .../components/TabContent/index.d.ts | 2 + .../components/Tabs/Tabs.Skeleton.d.ts | 7 + .../components/Tabs/Tabs.d.ts | 17 + .../components/Tabs/index.d.ts | 3 + .../components/Tag/Tag.Skeleton.d.ts | 7 + .../components/Tag/Tag.d.ts | 26 ++ .../components/Tag/index.d.ts | 3 + .../TextArea/TextArea.Skeleton.d.ts | 14 + .../components/TextArea/TextArea.d.ts | 21 ++ .../components/TextArea/index.d.ts | 3 + .../TextInput/ControlledPasswordInput.d.ts | 11 + .../components/TextInput/PasswordInput.d.ts | 11 + .../TextInput/TextInput.Skeleton.d.ts | 14 + .../components/TextInput/TextInput.d.ts | 15 + .../components/TextInput/index.d.ts | 14 + .../components/TextInput/props.d.ts | 16 + .../components/Tile/Tile.d.ts | 61 ++++ .../components/Tile/index.d.ts | 1 + .../components/TileGroup/TileGroup.d.ts | 21 ++ .../components/TileGroup/index.d.ts | 2 + .../components/TimePicker/TimePicker.d.ts | 18 ++ .../components/TimePicker/index.d.ts | 2 + .../TimePickerSelect/TimePickerSelect.d.ts | 17 + .../components/TimePickerSelect/index.d.ts | 2 + .../components/Toggle/Toggle.Skeleton.d.ts | 12 + .../components/Toggle/Toggle.d.ts | 22 ++ .../components/Toggle/index.d.ts | 3 + .../ToggleSmall/ToggleSmall.Skeleton.d.ts | 12 + .../components/ToggleSmall/ToggleSmall.d.ts | 23 ++ .../components/ToggleSmall/index.d.ts | 3 + .../components/Toolbar/Toolbar.d.ts | 47 +++ .../components/Toolbar/index.d.ts | 2 + .../ToolbarSearch/ToolbarSearch.d.ts | 16 + .../components/ToolbarSearch/index.d.ts | 2 + .../components/Tooltip/Tooltip.d.ts | 24 ++ .../components/Tooltip/index.d.ts | 2 + .../TooltipDefinition/TooltipDefinition.d.ts | 13 + .../components/TooltipDefinition/index.d.ts | 2 + .../components/TooltipIcon/TooltipIcon.d.ts | 17 + .../components/TooltipIcon/index.d.ts | 2 + .../components/UIShell/Content.d.ts | 17 + .../components/UIShell/Header.d.ts | 10 + .../components/UIShell/HeaderContainer.d.ts | 12 + .../UIShell/HeaderGlobalAction.d.ts | 12 + .../components/UIShell/HeaderGlobalBar.d.ts | 10 + .../components/UIShell/HeaderMenu.d.ts | 19 ++ .../components/UIShell/HeaderMenuButton.d.ts | 14 + .../components/UIShell/HeaderMenuItem.d.ts | 14 + .../components/UIShell/HeaderName.d.ts | 18 ++ .../components/UIShell/HeaderNavigation.d.ts | 10 + .../components/UIShell/HeaderPanel.d.ts | 12 + .../UIShell/HeaderSideNavItems.d.ts | 15 + .../components/UIShell/Link.d.ts | 12 + .../components/UIShell/SideNav.d.ts | 23 ++ .../components/UIShell/SideNavDetails.d.ts | 14 + .../components/UIShell/SideNavFooter.d.ts | 16 + .../components/UIShell/SideNavHeader.d.ts | 14 + .../components/UIShell/SideNavIcon.d.ts | 15 + .../components/UIShell/SideNavItem.d.ts | 12 + .../components/UIShell/SideNavItems.d.ts | 13 + .../components/UIShell/SideNavLink.d.ts | 23 ++ .../components/UIShell/SideNavLinkText.d.ts | 13 + .../components/UIShell/SideNavMenu.d.ts | 19 ++ .../components/UIShell/SideNavMenuItem.d.ts | 18 ++ .../components/UIShell/SideNavSwitcher.d.ts | 15 + .../components/UIShell/SkipToContent.d.ts | 12 + .../components/UIShell/Switcher.d.ts | 14 + .../components/UIShell/SwitcherDivider.d.ts | 10 + .../components/UIShell/SwitcherItem.d.ts | 17 + .../components/UIShell/index.d.ts | 63 ++++ .../UnorderedList/UnorderedList.d.ts | 12 + .../components/UnorderedList/index.d.ts | 2 + types/carbon-components-react/index.d.ts | 290 ++++++++++++++++++ types/carbon-components-react/package.json | 6 + types/carbon-components-react/tsconfig.json | 262 ++++++++++++++++ types/carbon-components-react/tslint.json | 17 + .../typings/shared.d.ts | 64 ++++ 242 files changed, 4121 insertions(+) create mode 100644 types/carbon-components-react/carbon-components-react-tests.tsx create mode 100644 types/carbon-components-react/components/Accordion/Accordion.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Accordion/Accordion.d.ts create mode 100644 types/carbon-components-react/components/Accordion/AccordionItem.d.ts create mode 100644 types/carbon-components-react/components/Accordion/index.d.ts create mode 100644 types/carbon-components-react/components/AccordionItem/AccordionItem.d.ts create mode 100644 types/carbon-components-react/components/AccordionItem/index.d.ts create mode 100644 types/carbon-components-react/components/Breadcrumb/Breadcrumb.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Breadcrumb/Breadcrumb.d.ts create mode 100644 types/carbon-components-react/components/Breadcrumb/BreadcrumbItem.d.ts create mode 100644 types/carbon-components-react/components/Breadcrumb/index.d.ts create mode 100644 types/carbon-components-react/components/BreadcrumbItem/index.d.ts create mode 100644 types/carbon-components-react/components/Button/Button.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Button/Button.d.ts create mode 100644 types/carbon-components-react/components/Button/index.d.ts create mode 100644 types/carbon-components-react/components/Checkbox/Checkbox.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Checkbox/Checkbox.d.ts create mode 100644 types/carbon-components-react/components/Checkbox/index.d.ts create mode 100644 types/carbon-components-react/components/CodeSnippet/CodeSnippet.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/CodeSnippet/CodeSnippet.d.ts create mode 100644 types/carbon-components-react/components/CodeSnippet/index.d.ts create mode 100644 types/carbon-components-react/components/ComboBox/ComboBox.d.ts create mode 100644 types/carbon-components-react/components/ComboBox/index.d.ts create mode 100644 types/carbon-components-react/components/ComposedModal/ComposedModal.d.ts create mode 100644 types/carbon-components-react/components/ComposedModal/index.d.ts create mode 100644 types/carbon-components-react/components/ContentSwitcher/ContentSwitcher.d.ts create mode 100644 types/carbon-components-react/components/ContentSwitcher/Switch.d.ts create mode 100644 types/carbon-components-react/components/ContentSwitcher/index.d.ts create mode 100644 types/carbon-components-react/components/Copy/Copy.d.ts create mode 100644 types/carbon-components-react/components/Copy/index.d.ts create mode 100644 types/carbon-components-react/components/CopyButton/CopyButton.d.ts create mode 100644 types/carbon-components-react/components/CopyButton/index.d.ts create mode 100644 types/carbon-components-react/components/DangerButton/DangerButton.d.ts create mode 100644 types/carbon-components-react/components/DangerButton/index.d.ts create mode 100644 types/carbon-components-react/components/DataTable/DataTable.d.ts create mode 100644 types/carbon-components-react/components/DataTable/Table.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableActionList.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableBatchAction.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableBatchActions.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableBody.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableCell.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableContainer.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableExpandHeader.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableExpandRow.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableExpandedRow.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableHead.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableHeader.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableRow.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableSelectAll.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableSelectRow.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableToolbar.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableToolbarAction.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableToolbarContent.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableToolbarMenu.d.ts create mode 100644 types/carbon-components-react/components/DataTable/TableToolbarSearch.d.ts create mode 100644 types/carbon-components-react/components/DataTable/index.d.ts create mode 100644 types/carbon-components-react/components/DataTable/state/sorting.d.ts create mode 100644 types/carbon-components-react/components/DataTableSkeleton/DataTableSkeleton.d.ts create mode 100644 types/carbon-components-react/components/DataTableSkeleton/index.d.ts create mode 100644 types/carbon-components-react/components/DatePicker/DatePicker.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/DatePicker/DatePicker.d.ts create mode 100644 types/carbon-components-react/components/DatePicker/index.d.ts create mode 100644 types/carbon-components-react/components/DatePickerInput/DatePickerInput.d.ts create mode 100644 types/carbon-components-react/components/DatePickerInput/index.d.ts create mode 100644 types/carbon-components-react/components/Dropdown/Dropdown.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Dropdown/Dropdown.d.ts create mode 100644 types/carbon-components-react/components/Dropdown/index.d.ts create mode 100644 types/carbon-components-react/components/FileUploader/FileUploader.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/FileUploader/FileUploader.d.ts create mode 100644 types/carbon-components-react/components/FileUploader/index.d.ts create mode 100644 types/carbon-components-react/components/Form/Form.d.ts create mode 100644 types/carbon-components-react/components/Form/index.d.ts create mode 100644 types/carbon-components-react/components/FormGroup/FormGroup.d.ts create mode 100644 types/carbon-components-react/components/FormGroup/index.d.ts create mode 100644 types/carbon-components-react/components/FormItem/FormItem.d.ts create mode 100644 types/carbon-components-react/components/FormItem/index.d.ts create mode 100644 types/carbon-components-react/components/FormLabel/FormLabel.d.ts create mode 100644 types/carbon-components-react/components/FormLabel/index.d.ts create mode 100644 types/carbon-components-react/components/Icon/Icon.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Icon/Icon.d.ts create mode 100644 types/carbon-components-react/components/Icon/index.d.ts create mode 100644 types/carbon-components-react/components/InlineCheckbox/InlineCheckbox.d.ts create mode 100644 types/carbon-components-react/components/InlineCheckbox/index.d.ts create mode 100644 types/carbon-components-react/components/InlineLoading/InlineLoading.d.ts create mode 100644 types/carbon-components-react/components/InlineLoading/index.d.ts create mode 100644 types/carbon-components-react/components/Link/Link.d.ts create mode 100644 types/carbon-components-react/components/Link/index.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBox.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxField.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxMenu.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxMenuIcon.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxMenuItem.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxPropTypes.d.ts create mode 100644 types/carbon-components-react/components/ListBox/ListBoxSelection.d.ts create mode 100644 types/carbon-components-react/components/ListBox/index.d.ts create mode 100644 types/carbon-components-react/components/ListItem/ListItem.d.ts create mode 100644 types/carbon-components-react/components/ListItem/index.d.ts create mode 100644 types/carbon-components-react/components/Loading/Loading.d.ts create mode 100644 types/carbon-components-react/components/Loading/index.d.ts create mode 100644 types/carbon-components-react/components/Modal/Modal.d.ts create mode 100644 types/carbon-components-react/components/Modal/index.d.ts create mode 100644 types/carbon-components-react/components/ModalWrapper/ModalWrapper.d.ts create mode 100644 types/carbon-components-react/components/ModalWrapper/index.d.ts create mode 100644 types/carbon-components-react/components/MultiSelect/FilterableMultiSelect.d.ts create mode 100644 types/carbon-components-react/components/MultiSelect/MultiSelect.d.ts create mode 100644 types/carbon-components-react/components/MultiSelect/MultiSelectPropTypes.d.ts create mode 100644 types/carbon-components-react/components/MultiSelect/index.d.ts create mode 100644 types/carbon-components-react/components/Notification/Notification.d.ts create mode 100644 types/carbon-components-react/components/Notification/a11yIconWarningSolid.d.ts create mode 100644 types/carbon-components-react/components/Notification/index.d.ts create mode 100644 types/carbon-components-react/components/NumberInput/NumberInput.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/NumberInput/NumberInput.d.ts create mode 100644 types/carbon-components-react/components/NumberInput/index.d.ts create mode 100644 types/carbon-components-react/components/OrderedList/OrderedList.d.ts create mode 100644 types/carbon-components-react/components/OrderedList/index.d.ts create mode 100644 types/carbon-components-react/components/OverflowMenu/OverflowMenu.d.ts create mode 100644 types/carbon-components-react/components/OverflowMenu/index.d.ts create mode 100644 types/carbon-components-react/components/OverflowMenuItem/OverflowMenuItem.d.ts create mode 100644 types/carbon-components-react/components/OverflowMenuItem/index.d.ts create mode 100644 types/carbon-components-react/components/Pagination/Pagination.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Pagination/Pagination.d.ts create mode 100644 types/carbon-components-react/components/Pagination/index.d.ts create mode 100644 types/carbon-components-react/components/PrimaryButton/PrimaryButton.d.ts create mode 100644 types/carbon-components-react/components/PrimaryButton/index.d.ts create mode 100644 types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.d.ts create mode 100644 types/carbon-components-react/components/ProgressIndicator/index.d.ts create mode 100644 types/carbon-components-react/components/RadioButton/RadioButton.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/RadioButton/RadioButton.d.ts create mode 100644 types/carbon-components-react/components/RadioButton/index.d.ts create mode 100644 types/carbon-components-react/components/RadioButtonGroup/RadioButtonGroup.d.ts create mode 100644 types/carbon-components-react/components/RadioButtonGroup/index.d.ts create mode 100644 types/carbon-components-react/components/RadioTile/RadioTile.d.ts create mode 100644 types/carbon-components-react/components/RadioTile/index.d.ts create mode 100644 types/carbon-components-react/components/Search/Search.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Search/Search.d.ts create mode 100644 types/carbon-components-react/components/Search/index.d.ts create mode 100644 types/carbon-components-react/components/SearchFilterButton/SearchFilterButton.d.ts create mode 100644 types/carbon-components-react/components/SearchFilterButton/index.d.ts create mode 100644 types/carbon-components-react/components/SearchLayoutButton/SearchLayoutButton.d.ts create mode 100644 types/carbon-components-react/components/SearchLayoutButton/index.d.ts create mode 100644 types/carbon-components-react/components/SecondaryButton/SecondaryButton.d.ts create mode 100644 types/carbon-components-react/components/SecondaryButton/index.d.ts create mode 100644 types/carbon-components-react/components/Select/Select.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Select/Select.d.ts create mode 100644 types/carbon-components-react/components/Select/index.d.ts create mode 100644 types/carbon-components-react/components/SelectItem/SelectItem.d.ts create mode 100644 types/carbon-components-react/components/SelectItem/index.d.ts create mode 100644 types/carbon-components-react/components/SelectItemGroup/SelectItemGroup.d.ts create mode 100644 types/carbon-components-react/components/SelectItemGroup/index.d.ts create mode 100644 types/carbon-components-react/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts create mode 100644 types/carbon-components-react/components/SkeletonPlaceholder/index.d.ts create mode 100644 types/carbon-components-react/components/SkeletonText/SkeletonText.d.ts create mode 100644 types/carbon-components-react/components/SkeletonText/index.d.ts create mode 100644 types/carbon-components-react/components/Slider/Slider.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Slider/Slider.d.ts create mode 100644 types/carbon-components-react/components/Slider/index.d.ts create mode 100644 types/carbon-components-react/components/StructuredList/StructuredList.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/StructuredList/StructuredList.d.ts create mode 100644 types/carbon-components-react/components/StructuredList/index.d.ts create mode 100644 types/carbon-components-react/components/Switch/Switch.d.ts create mode 100644 types/carbon-components-react/components/Switch/index.d.ts create mode 100644 types/carbon-components-react/components/Tab/Tab.d.ts create mode 100644 types/carbon-components-react/components/Tab/index.d.ts create mode 100644 types/carbon-components-react/components/TabContent/TabContent.d.ts create mode 100644 types/carbon-components-react/components/TabContent/index.d.ts create mode 100644 types/carbon-components-react/components/Tabs/Tabs.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Tabs/Tabs.d.ts create mode 100644 types/carbon-components-react/components/Tabs/index.d.ts create mode 100644 types/carbon-components-react/components/Tag/Tag.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Tag/Tag.d.ts create mode 100644 types/carbon-components-react/components/Tag/index.d.ts create mode 100644 types/carbon-components-react/components/TextArea/TextArea.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/TextArea/TextArea.d.ts create mode 100644 types/carbon-components-react/components/TextArea/index.d.ts create mode 100644 types/carbon-components-react/components/TextInput/ControlledPasswordInput.d.ts create mode 100644 types/carbon-components-react/components/TextInput/PasswordInput.d.ts create mode 100644 types/carbon-components-react/components/TextInput/TextInput.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/TextInput/TextInput.d.ts create mode 100644 types/carbon-components-react/components/TextInput/index.d.ts create mode 100644 types/carbon-components-react/components/TextInput/props.d.ts create mode 100644 types/carbon-components-react/components/Tile/Tile.d.ts create mode 100644 types/carbon-components-react/components/Tile/index.d.ts create mode 100644 types/carbon-components-react/components/TileGroup/TileGroup.d.ts create mode 100644 types/carbon-components-react/components/TileGroup/index.d.ts create mode 100644 types/carbon-components-react/components/TimePicker/TimePicker.d.ts create mode 100644 types/carbon-components-react/components/TimePicker/index.d.ts create mode 100644 types/carbon-components-react/components/TimePickerSelect/TimePickerSelect.d.ts create mode 100644 types/carbon-components-react/components/TimePickerSelect/index.d.ts create mode 100644 types/carbon-components-react/components/Toggle/Toggle.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/Toggle/Toggle.d.ts create mode 100644 types/carbon-components-react/components/Toggle/index.d.ts create mode 100644 types/carbon-components-react/components/ToggleSmall/ToggleSmall.Skeleton.d.ts create mode 100644 types/carbon-components-react/components/ToggleSmall/ToggleSmall.d.ts create mode 100644 types/carbon-components-react/components/ToggleSmall/index.d.ts create mode 100644 types/carbon-components-react/components/Toolbar/Toolbar.d.ts create mode 100644 types/carbon-components-react/components/Toolbar/index.d.ts create mode 100644 types/carbon-components-react/components/ToolbarSearch/ToolbarSearch.d.ts create mode 100644 types/carbon-components-react/components/ToolbarSearch/index.d.ts create mode 100644 types/carbon-components-react/components/Tooltip/Tooltip.d.ts create mode 100644 types/carbon-components-react/components/Tooltip/index.d.ts create mode 100644 types/carbon-components-react/components/TooltipDefinition/TooltipDefinition.d.ts create mode 100644 types/carbon-components-react/components/TooltipDefinition/index.d.ts create mode 100644 types/carbon-components-react/components/TooltipIcon/TooltipIcon.d.ts create mode 100644 types/carbon-components-react/components/TooltipIcon/index.d.ts create mode 100644 types/carbon-components-react/components/UIShell/Content.d.ts create mode 100644 types/carbon-components-react/components/UIShell/Header.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderContainer.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderGlobalAction.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderGlobalBar.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderMenu.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderMenuButton.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderMenuItem.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderName.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderNavigation.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderPanel.d.ts create mode 100644 types/carbon-components-react/components/UIShell/HeaderSideNavItems.d.ts create mode 100644 types/carbon-components-react/components/UIShell/Link.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNav.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavDetails.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavFooter.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavHeader.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavIcon.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavItem.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavItems.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavLink.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavLinkText.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavMenu.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavMenuItem.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SideNavSwitcher.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SkipToContent.d.ts create mode 100644 types/carbon-components-react/components/UIShell/Switcher.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SwitcherDivider.d.ts create mode 100644 types/carbon-components-react/components/UIShell/SwitcherItem.d.ts create mode 100644 types/carbon-components-react/components/UIShell/index.d.ts create mode 100644 types/carbon-components-react/components/UnorderedList/UnorderedList.d.ts create mode 100644 types/carbon-components-react/components/UnorderedList/index.d.ts create mode 100644 types/carbon-components-react/index.d.ts create mode 100644 types/carbon-components-react/package.json create mode 100644 types/carbon-components-react/tsconfig.json create mode 100644 types/carbon-components-react/tslint.json create mode 100644 types/carbon-components-react/typings/shared.d.ts diff --git a/types/carbon-components-react/carbon-components-react-tests.tsx b/types/carbon-components-react/carbon-components-react-tests.tsx new file mode 100644 index 0000000000..e40ebdecf8 --- /dev/null +++ b/types/carbon-components-react/carbon-components-react-tests.tsx @@ -0,0 +1,90 @@ +import * as React from 'react'; +import { DataTable, DataTableHeader, DataTableRow } from 'carbon-components-react'; + +interface Row1 extends DataTableRow { + rowProp: string; +} + +interface Header1 extends DataTableHeader { + headerProp: number; +} + +interface ExtraStuff { + extra1: string; + extra2?: number; +} + +const t1 = ( + + headers={[{ key: 'h1', header:
, headerProp: 2 }]} + rows={[{ id: 'r1', rowProp: 'row1' }]} + /> +); + +const t2 = ( + + filterRows={data => { + const headers: ReadonlyArray = data.headers; + const rowIds: ReadonlyArray = data.rowIds; + return [headers[0].key]; + }} + headers={[{ key: 'h1', header:
, headerProp: 2 }]} + rows={[{ id: 'r1', rowProp: 'row1' }]} + render={props => { + props.expandRow('asdf'); + + let bap = props.getBatchActionProps(); + bap.onCancel(); + let x = bap.totalSelected; + + let bap2 = props.getBatchActionProps({ extra1: 'extra' }); + let s = bap2.extra1; + + let hp = props.getHeaderProps({ header: { key: 'k', header: 'Test' } }); + let k = hp.key; + + let hp2 = props.getHeaderProps({ header: { key: 'k', header: 'Test' }, extra1: 'asdf' }); + let k2 = hp.key; + let e = hp2.extra1; + + let rp = props.getRowProps({ row: { id: 'r1' } }); + k = rp.key; + + let rp2 = props.getRowProps({ row: { id: 'r1' }, extra1: 'asdf' }); + k = rp2.key; + e = rp2.extra1; + + let sp = props.getSelectionProps(); + let c = sp.checked; + + let sp2 = props.getSelectionProps({ extra1: 't2', extra3: 'asdf' }); + c = sp2.checked; + e = sp2.extra1; + e = sp2.extra3; + + let tp = props.getTableProps(); + let size = tp.size; + + props.selectAll(); + props.selectRow('qwerty'); + props.sortBy('zxcv'); + + return
; + }} + /> +); + +// No types explicitly set on DataTable props +const row = { id: '2', someRandomRowProp: 'test' }; +const t3 = ( + { + let rowProps = data.getRowProps({ row, extra1: 'qwerty', ...row }); + let a = rowProps.extra1; + let b = rowProps.someRandomRowProp; + return
; + }} + /> +); diff --git a/types/carbon-components-react/components/Accordion/Accordion.Skeleton.d.ts b/types/carbon-components-react/components/Accordion/Accordion.Skeleton.d.ts new file mode 100644 index 0000000000..d1d1a9429d --- /dev/null +++ b/types/carbon-components-react/components/Accordion/Accordion.Skeleton.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; + +export interface AccordionSkeletonProps { + count?: number, + open?: boolean, + uid?: any, +} + +declare const AccordionSkeleton: React.FC; + +export default AccordionSkeleton; diff --git a/types/carbon-components-react/components/Accordion/Accordion.d.ts b/types/carbon-components-react/components/Accordion/Accordion.d.ts new file mode 100644 index 0000000000..10f45e8256 --- /dev/null +++ b/types/carbon-components-react/components/Accordion/Accordion.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], +} + +export interface AccordionProps extends InheritedProps { } + +declare const Accordion: React.FC; + +export default Accordion; diff --git a/types/carbon-components-react/components/Accordion/AccordionItem.d.ts b/types/carbon-components-react/components/Accordion/AccordionItem.d.ts new file mode 100644 index 0000000000..b588e87bda --- /dev/null +++ b/types/carbon-components-react/components/Accordion/AccordionItem.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactLIAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactLIAttr, EmbeddedIconProps { } + +export interface HeadingClickData { + event: React.MouseEvent; + isOpen: boolean; +} + +export interface AccordionItemProps extends InheritedProps { + onHeadingClick?(data: HeadingClickData): void, + open?: boolean, + renderExpando?: React.ReactNode, +} + +declare class AccordionItem extends React.Component { } + +export default AccordionItem; diff --git a/types/carbon-components-react/components/Accordion/index.d.ts b/types/carbon-components-react/components/Accordion/index.d.ts new file mode 100644 index 0000000000..b94de00df6 --- /dev/null +++ b/types/carbon-components-react/components/Accordion/index.d.ts @@ -0,0 +1,7 @@ +export * from "./Accordion"; +export * from "./Accordion.Skeleton"; +export * from "./AccordionItem"; + +export { default } from "./Accordion"; +export { default as AccordingItem } from "./AccordionItem"; +export { default as AccordionSkeleton } from "./Accordion.Skeleton"; diff --git a/types/carbon-components-react/components/AccordionItem/AccordionItem.d.ts b/types/carbon-components-react/components/AccordionItem/AccordionItem.d.ts new file mode 100644 index 0000000000..cb50fe2931 --- /dev/null +++ b/types/carbon-components-react/components/AccordionItem/AccordionItem.d.ts @@ -0,0 +1 @@ +export { default } from "../Accordion/AccordionItem"; diff --git a/types/carbon-components-react/components/AccordionItem/index.d.ts b/types/carbon-components-react/components/AccordionItem/index.d.ts new file mode 100644 index 0000000000..cb50fe2931 --- /dev/null +++ b/types/carbon-components-react/components/AccordionItem/index.d.ts @@ -0,0 +1 @@ +export { default } from "../Accordion/AccordionItem"; diff --git a/types/carbon-components-react/components/Breadcrumb/Breadcrumb.Skeleton.d.ts b/types/carbon-components-react/components/Breadcrumb/Breadcrumb.Skeleton.d.ts new file mode 100644 index 0000000000..9f21d81c0e --- /dev/null +++ b/types/carbon-components-react/components/Breadcrumb/Breadcrumb.Skeleton.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface BreadcrumbSkeletonProps { } + +declare class BreadcrumbSkeleton extends React.Component { } + +export default BreadcrumbSkeleton; diff --git a/types/carbon-components-react/components/Breadcrumb/Breadcrumb.d.ts b/types/carbon-components-react/components/Breadcrumb/Breadcrumb.d.ts new file mode 100644 index 0000000000..56e7823b73 --- /dev/null +++ b/types/carbon-components-react/components/Breadcrumb/Breadcrumb.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface BreadcrumbProps extends InheritedProps { + noTrailingSlash?: boolean, +} + +declare const Breadcrumb: React.FC; + +export default Breadcrumb; diff --git a/types/carbon-components-react/components/Breadcrumb/BreadcrumbItem.d.ts b/types/carbon-components-react/components/Breadcrumb/BreadcrumbItem.d.ts new file mode 100644 index 0000000000..46e9fa9c81 --- /dev/null +++ b/types/carbon-components-react/components/Breadcrumb/BreadcrumbItem.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; +import { LinkProps } from "../Link"; + +interface InheritedProps extends ReactDivAttr { + href?: LinkProps["href"], +} + +export interface BreadcrumbItemProps extends InheritedProps { + isCurrentPage?: boolean, +} + +declare const BreadcrumbItem: React.FC; + +export default BreadcrumbItem; diff --git a/types/carbon-components-react/components/Breadcrumb/index.d.ts b/types/carbon-components-react/components/Breadcrumb/index.d.ts new file mode 100644 index 0000000000..54522edc5c --- /dev/null +++ b/types/carbon-components-react/components/Breadcrumb/index.d.ts @@ -0,0 +1,11 @@ +import Breadcrumb from "./Breadcrumb"; +import BreadcrumbSkeleton from "./Breadcrumb.Skeleton"; +import BreadcrumbItem from "./BreadcrumbItem"; + +export * from "./Breadcrumb"; +export * from "./Breadcrumb.Skeleton"; +export * from "./BreadcrumbItem"; + +export { Breadcrumb, BreadcrumbItem, BreadcrumbSkeleton }; + +export { default } from "./Breadcrumb"; diff --git a/types/carbon-components-react/components/BreadcrumbItem/index.d.ts b/types/carbon-components-react/components/BreadcrumbItem/index.d.ts new file mode 100644 index 0000000000..97a9ac3f83 --- /dev/null +++ b/types/carbon-components-react/components/BreadcrumbItem/index.d.ts @@ -0,0 +1 @@ +export { default } from '../Breadcrumb/BreadcrumbItem'; diff --git a/types/carbon-components-react/components/Button/Button.Skeleton.d.ts b/types/carbon-components-react/components/Button/Button.Skeleton.d.ts new file mode 100644 index 0000000000..f69ec570e8 --- /dev/null +++ b/types/carbon-components-react/components/Button/Button.Skeleton.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ReactAnchorAttr, SizingProps } from "../../typings/shared"; + +interface InheritedProps extends SizingProps { + className?: ReactAnchorAttr["className"], + href?: ReactAnchorAttr["href"], +} + +export interface ButtonSkeletonProps extends InheritedProps { } + +declare const ButtonSkeleton: React.FC; + +export default ButtonSkeleton; diff --git a/types/carbon-components-react/components/Button/Button.d.ts b/types/carbon-components-react/components/Button/Button.d.ts new file mode 100644 index 0000000000..0650c3c9da --- /dev/null +++ b/types/carbon-components-react/components/Button/Button.d.ts @@ -0,0 +1,30 @@ +import * as React from "react"; +import { EmbeddedIconProps, EmbeddedTooltipProps, ReactAnchorAttr, ReactButtonAttr, ReactCreateElementParam, RenderIconProps, SizingProps, } from "../../typings/shared"; + +export type ButtonKind = "danger" | "danger--primary" | "ghost" | "primary" | "secondary" | "tertiary"; +export type ButtonSize = "default" | "field" | "small"; + +interface InheritedButtonProps extends ReactButtonAttr { } + +interface InheritedAnchorProps extends ReactAnchorAttr { } + +interface SharedProps extends + EmbeddedIconProps, + EmbeddedTooltipProps, + RenderIconProps, + SizingProps +{ + as?: ReactCreateElementParam, + hasOnlyIcon?: boolean, + kind?: ButtonKind, // required but has default value + size?: ButtonSize, +} + +export interface ButtonProps extends SharedProps, InheritedButtonProps { } + +export interface ButtonAnchorProps extends SharedProps, InheritedAnchorProps { } + +export type AllButtonProps = ButtonAnchorProps | ButtonProps; +declare const Button: React.RefForwardingComponent; + +export default Button; diff --git a/types/carbon-components-react/components/Button/index.d.ts b/types/carbon-components-react/components/Button/index.d.ts new file mode 100644 index 0000000000..689334c1cf --- /dev/null +++ b/types/carbon-components-react/components/Button/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Button"; +export * from "./Button.Skeleton"; +export { default } from './Button'; diff --git a/types/carbon-components-react/components/Checkbox/Checkbox.Skeleton.d.ts b/types/carbon-components-react/components/Checkbox/Checkbox.Skeleton.d.ts new file mode 100644 index 0000000000..4a03512e54 --- /dev/null +++ b/types/carbon-components-react/components/Checkbox/Checkbox.Skeleton.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +export interface CheckboxSkeletonProps { + id?: ReactLabelAttr["htmlFor"], +} + +declare class CheckboxSkeleton extends React.Component { } + +export default CheckboxSkeleton; diff --git a/types/carbon-components-react/components/Checkbox/Checkbox.d.ts b/types/carbon-components-react/components/Checkbox/Checkbox.d.ts new file mode 100644 index 0000000000..3fc064e675 --- /dev/null +++ b/types/carbon-components-react/components/Checkbox/Checkbox.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps } from "../../typings/shared"; + +type ExcludedAttributes = "id" | "onChange" | "type"; +interface InheritedProps extends + Omit, + RequiresIdProps +{ } + +export interface CheckboxProps extends InheritedProps { + defaultChecked?: boolean, + hideLabel?: boolean, + indeterminate?: boolean, + labelText: NonNullable, + onChange?(checked: boolean, id: string, event: React.ChangeEvent): void, + wrapperClassName?: string, +} + +declare const Checkbox: React.RefForwardingComponent; + +export default Checkbox; diff --git a/types/carbon-components-react/components/Checkbox/index.d.ts b/types/carbon-components-react/components/Checkbox/index.d.ts new file mode 100644 index 0000000000..b8ffde651e --- /dev/null +++ b/types/carbon-components-react/components/Checkbox/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Checkbox"; +export * from "./Checkbox.Skeleton"; +export { default } from "./Checkbox"; diff --git a/types/carbon-components-react/components/CodeSnippet/CodeSnippet.Skeleton.d.ts b/types/carbon-components-react/components/CodeSnippet/CodeSnippet.Skeleton.d.ts new file mode 100644 index 0000000000..bc06cf973a --- /dev/null +++ b/types/carbon-components-react/components/CodeSnippet/CodeSnippet.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface CodeSnippetSkeletonProps extends InheritedProps { + type?: "multi" | "single", +} + +declare class CodeSnippetSkeleton extends React.Component { } + +export default CodeSnippetSkeleton; diff --git a/types/carbon-components-react/components/CodeSnippet/CodeSnippet.d.ts b/types/carbon-components-react/components/CodeSnippet/CodeSnippet.d.ts new file mode 100644 index 0000000000..8e6af3cac2 --- /dev/null +++ b/types/carbon-components-react/components/CodeSnippet/CodeSnippet.d.ts @@ -0,0 +1,28 @@ +import * as React from "react"; +import { ReactDivAttr, ThemeProps } from "../../typings/shared"; +import { CopyProps } from "../Copy"; + +interface InheritedDivProps extends Omit { } +interface InheritedInlineProps extends Omit { } + +interface SharedProps extends ThemeProps { + children?: string, + copyLabel?: string, + copyButtonDescription?: string, + feedback?: CopyProps["feedback"], + showLessText?: string, + showMoreText?: string, +} + +export interface CodeSnippetDivProps extends SharedProps, InheritedDivProps { + type?: 'single' | 'multi' | null; +} + +export interface CodeSnippetInlineProps extends SharedProps, InheritedInlineProps { + type: "inline", +} + +export type AllCodeSnippetProps = CodeSnippetDivProps | CodeSnippetInlineProps; +declare class CodeSnippet extends React.Component { } + +export default CodeSnippet; diff --git a/types/carbon-components-react/components/CodeSnippet/index.d.ts b/types/carbon-components-react/components/CodeSnippet/index.d.ts new file mode 100644 index 0000000000..7a8d602f77 --- /dev/null +++ b/types/carbon-components-react/components/CodeSnippet/index.d.ts @@ -0,0 +1,3 @@ +export * from "./CodeSnippet"; +export * from "./CodeSnippet.Skeleton"; +export { default } from "./CodeSnippet"; diff --git a/types/carbon-components-react/components/ComboBox/ComboBox.d.ts b/types/carbon-components-react/components/ComboBox/ComboBox.d.ts new file mode 100644 index 0000000000..760d7748de --- /dev/null +++ b/types/carbon-components-react/components/ComboBox/ComboBox.d.ts @@ -0,0 +1,32 @@ +import * as React from "react"; +import { DownshiftTypedProps, InternationalProps, ReactInputAttr, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; +import { ListBoxProps } from "../ListBox"; +import { ListBoxMenuIconTranslationKey } from "../ListBox/ListBoxMenuIcon"; +import { ListBoxSelectionTranslationKey } from "../ListBox/ListBoxSelection"; + +type ExcludedAttributes = "id" | "onChange" | "placeholder" | "ref"; +interface InheritedProps extends + Omit, + DownshiftTypedProps, + InternationalProps, + RequiresIdProps, + ThemeProps, + ValidityProps +{ + ariaLabel?: React.AriaAttributes["aria-label"], + placeholder: NonNullable, + type?: ListBoxProps["type"], +} + +export interface ComboBoxProps extends InheritedProps { + downshiftProps: any, // TODO + initialSelectedItem?: ItemType; + items: ItemType[], + onChange?(selectedItem?: ItemType): void, + onInputChange?(inputValue?: string): void, + shouldFilterItem?(item: ItemType, itemToString?: ComboBoxProps["itemToString"], inputValue?: string): void, +} + +declare class ComboBox extends React.Component> { } + +export default ComboBox; diff --git a/types/carbon-components-react/components/ComboBox/index.d.ts b/types/carbon-components-react/components/ComboBox/index.d.ts new file mode 100644 index 0000000000..5da401e831 --- /dev/null +++ b/types/carbon-components-react/components/ComboBox/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ComboBox"; +export { default } from './ComboBox'; diff --git a/types/carbon-components-react/components/ComposedModal/ComposedModal.d.ts b/types/carbon-components-react/components/ComposedModal/ComposedModal.d.ts new file mode 100644 index 0000000000..7891b31b19 --- /dev/null +++ b/types/carbon-components-react/components/ComposedModal/ComposedModal.d.ts @@ -0,0 +1,64 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactDivAttr } from "../../typings/shared"; +import { ButtonProps } from "../Button"; + +// ComposedModal + +type ExcludedAttributes = "onBlur" | "onClick" | "onTransitionEnd" | "ref" | "role" | "tabIndex"; +interface ComposedModalInheritedProps extends Omit { } + +export interface ComposedModalProps extends ComposedModalInheritedProps { + containerClassName?: string, + onClose?(): boolean | void, + open?: boolean, + selectedPrimaryFocus?: string, +} + +declare class ComposedModal extends React.Component { } + +// Header + +interface ModalHeaderInheritedProps extends + Omit, + EmbeddedIconProps +{ } + +export interface ModalHeaderProps extends ModalHeaderInheritedProps { + buttonOnClick?(): void, + closeClassName?: string, + closeIconClassName?: string, + closeModal?(): void, + label?: React.ReactNode, + labelClassName?: string, + title?: React.ReactNode, + titleClassName?: string, +} + +export declare class ModalHeader extends React.Component { } + +// Body + +interface ModalBodyInheritedProps extends ReactDivAttr { } + +export interface ModalBodyProps extends ModalBodyInheritedProps { } + +export declare class ModalBody extends React.Component { } + +// Footer + +interface ModalFooterInheritedProps extends ReactDivAttr { } + +export interface ModalFooterProps extends ModalFooterInheritedProps { + closeModal?(): void, + primaryClassName?: string, + primaryButtonText?: string, + primaryButtonDisabled?: string, + secondaryClassName?: string, + secondaryButtonText?: string, + onRequestClose?: ButtonProps["onClick"], + onRequestSubmit?: ButtonProps["onClick"], +} + +export declare class ModalFooter extends React.Component { } + +export default ComposedModal; diff --git a/types/carbon-components-react/components/ComposedModal/index.d.ts b/types/carbon-components-react/components/ComposedModal/index.d.ts new file mode 100644 index 0000000000..6e0eed6a1e --- /dev/null +++ b/types/carbon-components-react/components/ComposedModal/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ComposedModal"; +export { default } from "./ComposedModal"; diff --git a/types/carbon-components-react/components/ContentSwitcher/ContentSwitcher.d.ts b/types/carbon-components-react/components/ContentSwitcher/ContentSwitcher.d.ts new file mode 100644 index 0000000000..451fa35098 --- /dev/null +++ b/types/carbon-components-react/components/ContentSwitcher/ContentSwitcher.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; +import { SwitchProps } from "./Switch"; + +interface InheritedProps extends Omit { + onChange: NonNullable, +} + +export interface ContentSwitcherProps extends InheritedProps { + selectedIndex?: number, +} + +declare const ContentSwitcher: React.FC; + +export default ContentSwitcher; diff --git a/types/carbon-components-react/components/ContentSwitcher/Switch.d.ts b/types/carbon-components-react/components/ContentSwitcher/Switch.d.ts new file mode 100644 index 0000000000..500d7ddb79 --- /dev/null +++ b/types/carbon-components-react/components/ContentSwitcher/Switch.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactButtonAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface SwitchProps extends InheritedProps { + index?: number, + onClick(event: React.MouseEvent, index?: SwitchProps["index"]): void, + selected?: boolean, + text: string, +} + +declare const Switch: React.RefForwardingComponent; + +export default Switch; diff --git a/types/carbon-components-react/components/ContentSwitcher/index.d.ts b/types/carbon-components-react/components/ContentSwitcher/index.d.ts new file mode 100644 index 0000000000..3d82c10802 --- /dev/null +++ b/types/carbon-components-react/components/ContentSwitcher/index.d.ts @@ -0,0 +1,4 @@ +export * from "./ContentSwitcher"; +export * from "./Switch"; +export { default as Switch } from "./Switch"; +export { default } from "./ContentSwitcher"; diff --git a/types/carbon-components-react/components/Copy/Copy.d.ts b/types/carbon-components-react/components/Copy/Copy.d.ts new file mode 100644 index 0000000000..008fcc42d7 --- /dev/null +++ b/types/carbon-components-react/components/Copy/Copy.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactButtonAttr } from "../../typings/shared"; + +export interface FeedbackProps { + feedback?: string, + feedbackTimeout?: number, +} + +interface InheritedProps extends + Omit, + FeedbackProps +{ } + +export interface CopyProps extends InheritedProps { } + +declare class Copy extends React.Component { } + +export default Copy; diff --git a/types/carbon-components-react/components/Copy/index.d.ts b/types/carbon-components-react/components/Copy/index.d.ts new file mode 100644 index 0000000000..9d9dc237a6 --- /dev/null +++ b/types/carbon-components-react/components/Copy/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Copy"; +export { default } from './Copy'; diff --git a/types/carbon-components-react/components/CopyButton/CopyButton.d.ts b/types/carbon-components-react/components/CopyButton/CopyButton.d.ts new file mode 100644 index 0000000000..34e599628c --- /dev/null +++ b/types/carbon-components-react/components/CopyButton/CopyButton.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactButtonAttr } from "../../typings/shared"; +import { FeedbackProps } from "../Copy"; + +interface InheritedProps extends + ReactButtonAttr, + EmbeddedIconProps, + FeedbackProps +{ } + +export interface CopyButtonProps extends InheritedProps { } + +declare class CopyButton extends React.Component { } + +export default CopyButton; diff --git a/types/carbon-components-react/components/CopyButton/index.d.ts b/types/carbon-components-react/components/CopyButton/index.d.ts new file mode 100644 index 0000000000..1d78d3d332 --- /dev/null +++ b/types/carbon-components-react/components/CopyButton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./CopyButton"; +export { default } from './CopyButton'; diff --git a/types/carbon-components-react/components/DangerButton/DangerButton.d.ts b/types/carbon-components-react/components/DangerButton/DangerButton.d.ts new file mode 100644 index 0000000000..0e7c4e1449 --- /dev/null +++ b/types/carbon-components-react/components/DangerButton/DangerButton.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ButtonProps } from "../Button"; + +interface InheritedProps extends Omit { } + +export interface DangerButtonProps extends InheritedProps { } + +declare const DangerButton: React.FC; + +export default DangerButton; diff --git a/types/carbon-components-react/components/DangerButton/index.d.ts b/types/carbon-components-react/components/DangerButton/index.d.ts new file mode 100644 index 0000000000..67aee8a925 --- /dev/null +++ b/types/carbon-components-react/components/DangerButton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./DangerButton"; +export { default } from "./DangerButton"; diff --git a/types/carbon-components-react/components/DataTable/DataTable.d.ts b/types/carbon-components-react/components/DataTable/DataTable.d.ts new file mode 100644 index 0000000000..938874f3f5 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/DataTable.d.ts @@ -0,0 +1,217 @@ +import * as React from "react"; +import { InternationalProps, ShapeOf } from "../../typings/shared"; +import { DataTableSortState, DataTableSortStates } from "./state/sorting"; +import Table from "./Table"; +import TableActionList from "./TableActionList"; +import TableBatchAction from "./TableBatchAction"; +import TableBatchActions from "./TableBatchActions"; +import TableBody from "./TableBody"; +import TableCell from "./TableCell"; +import TableContainer from "./TableContainer"; +import TableExpandedRow from "./TableExpandedRow"; +import TableExpandHeader from "./TableExpandHeader"; +import TableExpandRow from "./TableExpandRow"; +import TableHead from "./TableHead"; +import TableHeader from "./TableHeader"; +import TableRow from "./TableRow"; +import TableSelectAll from "./TableSelectAll"; +import TableSelectRow from "./TableSelectRow"; +import TableToolbar from "./TableToolbar"; +import TableToolbarAction from "./TableToolbarAction"; +import TableToolbarContent from "./TableToolbarContent"; +import TableToolbarMenu from "./TableToolbarMenu"; +import TableToolbarSearch from "./TableToolbarSearch"; + +// region Row Types + +export interface DataTableRow { + disabled?: boolean, + id: string, + isExpanded?: boolean, + isSelected?: boolean, +} + +export interface SortRowData { + compare(a: any, b: any, locale?: string): number, + key: string, + locale?: string, + sortDirection: DataTableSortState, + sortStates: DataTableSortStates, +} + +export interface FilterRowsData { + cellsById: { [cellId: string]: DataTableCell }; + headers: ReadonlyArray; + inputValue: string; + rowIds: ReadonlyArray; +} + +export type DenormalizedRow = + R & { cells: DataTableCell[] }; + +export interface DataTableCustomRowData { + onClick?(event: React.MouseEvent): void, + row: R, +} + +export interface DataTableCustomRowProps { + ariaLabel?: string, + disabled: R["disabled"], + isExpanded: R["isExpanded"], + isSelected: R["isSelected"], + key: R["id"], + onExpand(event: React.MouseEvent): void, +} + +export interface DataTableCustomSelectionData { + onClick?(event: React.MouseEvent): void, + row?: R, +} + +export interface DataTableCustomSelectionProps { + ariaLabel?: string, + checked: R extends never ? boolean : R["isSelected"], + disabled: R extends never ? never : R["disabled"], + id: string, + indeterminate: R extends never ? boolean : never, + name: string, + onSelect(event: React.MouseEvent): void, + radio: R extends never ? never : (Extract | null), +} + +// endregion Row Types + +// region Header Types + +export interface DataTableHeader { + header: NonNullable, + key: string, +} + +export interface DataTableCustomHeaderData { + header: H, + isSortable?: boolean, + onClick?(event: React.MouseEvent): void, +} + +export interface DataTableCustomHeaderProps { + isSortable?: boolean, + isSortHeader: boolean, + key: H["key"], + onClick(event: React.MouseEvent): void, + sortDirection: DataTableSortState, +} + +// endregion Header Types + +// region Cell Types + +export interface DataTableCell { + value?: any, +} + +// endregion CellTypes + +// region Batch Action Types + +export interface DataTableCustomBatchActionsData { } + +export interface DataTableCustomBatchActionsProps { + onCancel(): void, + shouldShowBatchActions?: boolean, + totalSelected: number, +} + +// endregion + +// region DataTable + +export type DataTableSize = "compact" | "normal" | "short" | "tall"; +export interface DataTableExposedProps { + isSortable?: boolean, + shouldShowBorder?: boolean, + size?: DataTableSize, + useStaticWidth?: boolean, + useZebraStyles?: boolean, +} + +// Custom Render Props +export interface DataTableCustomRenderProps< + R extends DataTableRow = DataTableRow, + H extends DataTableHeader = DataTableHeader +> { + expandRow(rowId: R['id']): void; + getBatchActionProps( + data?: ShapeOf + ): ShapeOf; + getHeaderProps( + data: ShapeOf, E> + ): ShapeOf, E>; + getRowProps( + data: ShapeOf, E> + ): ShapeOf, E>; + getSelectionProps( + data?: ShapeOf, E> + ): ShapeOf, E> | ShapeOf, E>; + getTableProps(): DataTableExposedProps; + headers: DataTableProps['headers']; + onInputChange(event: React.SyntheticEvent): void; + radio?: DataTableProps['radio']; + rows: ReadonlyArray>; + selectAll(): void; + selectedRows: ReadonlyArray>; + selectRow(rowId: R['id']): void; + sortBy(headerKey: H['key']): void; +} + +export type DataTableTranslationKey = + "carbon.table.row.expand" + | "carbon.table.row.collapse" + | "carbon.table.all.select" + | "carbon.table.all.unselect" + | "carbon.table.row.select" + | "carbon.table.row.unselect"; + +interface DataTableInheritedProps extends InternationalProps, DataTableExposedProps { } + +export interface DataTableProps + extends DataTableInheritedProps { + filterRows?(data: FilterRowsData): Array; + headers: H[]; + locale?: string; + radio?: boolean; + render?(props: DataTableCustomRenderProps): React.ReactNode; + rows: R[]; + sortRow?(cellA: any, cellB: any, data: SortRowData): number; +} + +declare class DataTable< + R extends DataTableRow = DataTableRow, + H extends DataTableHeader = DataTableHeader, +> extends React.Component> { + static readonly translationKeys: ReadonlyArray; + static readonly Table: typeof Table; + static readonly TableActionList: typeof TableActionList; + static readonly TableBatchAction: typeof TableBatchAction; + static readonly TableBatchActions: typeof TableBatchActions; + static readonly TableBody: typeof TableBody; + static readonly TableCell: typeof TableCell; + static readonly TableContainer: typeof TableContainer; + static readonly TableExpandHeader: typeof TableExpandHeader; + static readonly TableExpandRow: typeof TableExpandRow; + static readonly TableExpandedRow: typeof TableExpandedRow; + static readonly TableHead: typeof TableHead; + static readonly TableHeader: typeof TableHeader; + static readonly TableRow: typeof TableRow; + static readonly TableSelectAll: typeof TableSelectAll; + static readonly TableSelectRow: typeof TableSelectRow; + static readonly TableToolbar: typeof TableToolbar; + static readonly TableToolbarAction: typeof TableToolbarAction; + static readonly TableToolbarContent: typeof TableToolbarContent; + static readonly TableToolbarSearch: typeof TableToolbarSearch; + static readonly TableToolbarMenu: typeof TableToolbarMenu; +} + +// endregion DataTable + +export default DataTable; diff --git a/types/carbon-components-react/components/DataTable/Table.d.ts b/types/carbon-components-react/components/DataTable/Table.d.ts new file mode 100644 index 0000000000..aaa1acbe1f --- /dev/null +++ b/types/carbon-components-react/components/DataTable/Table.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; + +interface InheritedProps extends React.TableHTMLAttributes { } + +export interface TableProps extends InheritedProps { + isSortable?: boolean, + shouldShowBorder?: boolean, + size?: "compact" | "normal" | "small" | "tall", + useStaticWidth?: boolean, + useZebraStyles?: boolean, +} + +declare const Table: React.FC; + +export default Table; diff --git a/types/carbon-components-react/components/DataTable/TableActionList.d.ts b/types/carbon-components-react/components/DataTable/TableActionList.d.ts new file mode 100644 index 0000000000..6775678210 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableActionList.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface TableActionListProps extends InheritedProps { } + +declare const TableActionList: React.FC; + +export default TableActionList; diff --git a/types/carbon-components-react/components/DataTable/TableBatchAction.d.ts b/types/carbon-components-react/components/DataTable/TableBatchAction.d.ts new file mode 100644 index 0000000000..3bac419c51 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableBatchAction.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ButtonProps } from "../Button"; + +interface InheritedProps extends ButtonProps { } + +export interface TableBatchActionProps extends InheritedProps { } + +declare const TableBatchAction: React.FC; + +export default TableBatchAction; diff --git a/types/carbon-components-react/components/DataTable/TableBatchActions.d.ts b/types/carbon-components-react/components/DataTable/TableBatchActions.d.ts new file mode 100644 index 0000000000..b2dfbf1b4f --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableBatchActions.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { InternationalProps, ReactDivAttr } from "../../typings/shared"; + +export type TableBatchActionsTranslationKey = "carbon.table.batch.cancel" | "carbon.table.batch.items.selected" | "carbon.table.batch.item.selected"; +interface InheritedProps extends ReactDivAttr, InternationalProps { } + +export interface TableBatchActionsProps extends InheritedProps { + onCancel(event: React.MouseEvent): void, + shouldShowBatchActions?: boolean, + totalSelected: number, +} + +interface TableBatchActionsFC extends React.FC { + readonly translationKeys: ReadonlyArray; +} + +declare const TableBatchActions: TableBatchActionsFC; + +export default TableBatchActions; diff --git a/types/carbon-components-react/components/DataTable/TableBody.d.ts b/types/carbon-components-react/components/DataTable/TableBody.d.ts new file mode 100644 index 0000000000..f59c2df527 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableBody.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface TableBodyProps extends InheritedProps { } + +declare const TableBody: React.FC; + +export default TableBody; diff --git a/types/carbon-components-react/components/DataTable/TableCell.d.ts b/types/carbon-components-react/components/DataTable/TableCell.d.ts new file mode 100644 index 0000000000..0befdbf315 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableCell.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; + +interface InheritedProps extends React.TdHTMLAttributes { } + +export interface TableCellProps extends InheritedProps { } + +declare const TableCell: React.FC; + +export default TableCell; diff --git a/types/carbon-components-react/components/DataTable/TableContainer.d.ts b/types/carbon-components-react/components/DataTable/TableContainer.d.ts new file mode 100644 index 0000000000..62508e5afd --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableContainer.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface TableContainerProps extends InheritedProps { + description?: React.ReactNode, + title?: React.ReactNode, +} + +declare const TableContainer: React.FC; + +export default TableContainer; diff --git a/types/carbon-components-react/components/DataTable/TableExpandHeader.d.ts b/types/carbon-components-react/components/DataTable/TableExpandHeader.d.ts new file mode 100644 index 0000000000..4797b2c6a0 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableExpandHeader.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; + +interface InheritedProps extends React.ThHTMLAttributes { } + +export interface TableExpandHeaderProps extends InheritedProps { } + +declare const TableExpandHeader: React.FC; + +export default TableExpandHeader; diff --git a/types/carbon-components-react/components/DataTable/TableExpandRow.d.ts b/types/carbon-components-react/components/DataTable/TableExpandRow.d.ts new file mode 100644 index 0000000000..3d0a4314e9 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableExpandRow.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { + ariaLabel: NonNullable, +} + +export interface TableExpandRowProps extends InheritedProps { + expandHeader?: string, + expandIconDescription?: string, + isExpanded: boolean, + onExpand(event: React.MouseEvent): void, +} + +declare const TableExpandRow: React.FC; + +export default TableExpandRow; diff --git a/types/carbon-components-react/components/DataTable/TableExpandedRow.d.ts b/types/carbon-components-react/components/DataTable/TableExpandedRow.d.ts new file mode 100644 index 0000000000..1f531ec9de --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableExpandedRow.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface TableExpandedRowProps extends InheritedProps { + colSpan: number, +} + +declare const TableExpandedRow: React.FC; + +export default TableExpandedRow; diff --git a/types/carbon-components-react/components/DataTable/TableHead.d.ts b/types/carbon-components-react/components/DataTable/TableHead.d.ts new file mode 100644 index 0000000000..5650fcde60 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableHead.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface TableHeadProps extends InheritedProps { } + +declare const TableHead: React.FC; + +export default TableHead; diff --git a/types/carbon-components-react/components/DataTable/TableHeader.d.ts b/types/carbon-components-react/components/DataTable/TableHeader.d.ts new file mode 100644 index 0000000000..fbca899a50 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableHeader.d.ts @@ -0,0 +1,25 @@ +import * as React from "react"; +import { InternationalProps, ReactButtonAttr } from "../../typings/shared"; + +export type TableHeaderTranslationKey = "carbon.table.header.icon.description"; +interface InheritedProps extends + ReactButtonAttr, + InternationalProps +{ + scope?: React.ThHTMLAttributes["scope"], +} + +export type SortDirection = "ascending" | "descending" | "none"; +export interface TableHeaderProps extends InheritedProps { + isSortable?: boolean, + isSortHeader?: boolean, + sortDirection?: SortDirection, +} + +interface TableHeaderFC extends React.FC { + readonly translationKeys: ReadonlyArray, +} + +declare const TableHeader: TableHeaderFC; + +export default TableHeader; diff --git a/types/carbon-components-react/components/DataTable/TableRow.d.ts b/types/carbon-components-react/components/DataTable/TableRow.d.ts new file mode 100644 index 0000000000..d1b9c7ab74 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableRow.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface TableRowProps extends InheritedProps { } + +declare const TableRow: React.FC; + +export default TableRow; diff --git a/types/carbon-components-react/components/DataTable/TableSelectAll.d.ts b/types/carbon-components-react/components/DataTable/TableSelectAll.d.ts new file mode 100644 index 0000000000..b647c679e2 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableSelectAll.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; +import { InlineCheckboxProps } from "../InlineCheckbox"; + +interface InheritedProps { + ariaLabel?: InlineCheckboxProps["ariaLabel"], // required but has default value + checked: NonNullable, + className?: ReactAttr["className"], + id: NonNullable, + indeterminate?: InlineCheckboxProps["indeterminate"], + name: NonNullable + onSelect: NonNullable, +} + +export interface TableSelectAllProps extends InheritedProps { } + +declare const TableSelectAll: React.FC; + +export default TableSelectAll; diff --git a/types/carbon-components-react/components/DataTable/TableSelectRow.d.ts b/types/carbon-components-react/components/DataTable/TableSelectRow.d.ts new file mode 100644 index 0000000000..c68e3ac7a0 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableSelectRow.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { ReactAttr, ReactInputAttr, RequiresIdProps } from "../../typings/shared"; + +interface InheritedProps extends RequiresIdProps { + ariaLabel?: React.AriaAttributes["aria-label"], + checked: NonNullable, + className?: ReactAttr["className"], + disabled?: ReactInputAttr["disabled"], + name: NonNullable, +} + +export interface TableSelectRowProps extends InheritedProps { + radio?: boolean, + onSelect(event: React.MouseEvent): void, +} + +declare const TableSelectRow: React.FC; + +export default TableSelectRow; diff --git a/types/carbon-components-react/components/DataTable/TableToolbar.d.ts b/types/carbon-components-react/components/DataTable/TableToolbar.d.ts new file mode 100644 index 0000000000..b9ee263eb9 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableToolbar.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface TableToolbarProps { } + +declare const TableToolbar: React.FC; + +export default TableToolbar; diff --git a/types/carbon-components-react/components/DataTable/TableToolbarAction.d.ts b/types/carbon-components-react/components/DataTable/TableToolbarAction.d.ts new file mode 100644 index 0000000000..26f0687cd2 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableToolbarAction.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; +import { OverflowMenuItemAnchorProps, OverflowMenuItemButtonProps } from "../OverflowMenuItem"; + +export type AllTableToolbarActionProps = OverflowMenuItemAnchorProps | OverflowMenuItemButtonProps; +declare const TableToolbarAction: React.FC; + +export default TableToolbarAction; diff --git a/types/carbon-components-react/components/DataTable/TableToolbarContent.d.ts b/types/carbon-components-react/components/DataTable/TableToolbarContent.d.ts new file mode 100644 index 0000000000..b4d0fb4729 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableToolbarContent.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface TableToolbarContentProps extends InheritedProps { } + +declare const TableToolbarContent: React.FC; + +export default TableToolbarContent; diff --git a/types/carbon-components-react/components/DataTable/TableToolbarMenu.d.ts b/types/carbon-components-react/components/DataTable/TableToolbarMenu.d.ts new file mode 100644 index 0000000000..a8b78b116c --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableToolbarMenu.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { RequiresChildrenProps } from "../../typings/shared"; +import { OverflowMenuProps } from "../OverflowMenu"; + +interface InheritedProps extends + Omit, + RequiresChildrenProps +{ } + +export interface TableToolbarMenuProps extends InheritedProps { } + +declare const TableToolbarMenu: React.FC; + +export default TableToolbarMenu; diff --git a/types/carbon-components-react/components/DataTable/TableToolbarSearch.d.ts b/types/carbon-components-react/components/DataTable/TableToolbarSearch.d.ts new file mode 100644 index 0000000000..a6440dbdf0 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/TableToolbarSearch.d.ts @@ -0,0 +1,25 @@ +import * as React from "react"; +import { InternationalProps, ReactAttr } from "../../typings/shared"; +import { SearchProps } from "../Search"; + +type ExcludedAttributes = "aria-hidden" | "labelText" | "small"; +export type TableToolbarTranslationKey = "carbon.table.toolbar.search.label" | "carbon.table.toolbar.search.placeholder"; +interface InheritedProps extends + Omit, + InternationalProps +{ + labelText?: React.ReactNode, +} + +export interface TableToolbarSearchProps extends InheritedProps { + /** + * @deprecated + */ + persistant?: boolean, + persistent?: boolean, + searchContainerClasses?: ReactAttr["className"], +} + +declare const TableToolbarSearch: React.FC; + +export default TableToolbarSearch; diff --git a/types/carbon-components-react/components/DataTable/index.d.ts b/types/carbon-components-react/components/DataTable/index.d.ts new file mode 100644 index 0000000000..aba6a3609d --- /dev/null +++ b/types/carbon-components-react/components/DataTable/index.d.ts @@ -0,0 +1,68 @@ +import DataTable from "./DataTable"; +import Table from "./Table"; +import TableActionList from "./TableActionList"; +import TableBatchAction from "./TableBatchAction"; +import TableBatchActions from "./TableBatchActions"; +import TableBody from "./TableBody"; +import TableCell from "./TableCell"; +import TableContainer from "./TableContainer"; +import TableExpandedRow from "./TableExpandedRow"; +import TableExpandHeader from "./TableExpandHeader"; +import TableExpandRow from "./TableExpandRow"; +import TableHead from "./TableHead"; +import TableHeader from "./TableHeader"; +import TableRow from "./TableRow"; +import TableSelectAll from "./TableSelectAll"; +import TableSelectRow from "./TableSelectRow"; +import TableToolbar from "./TableToolbar"; +import TableToolbarAction from "./TableToolbarAction"; +import TableToolbarContent from "./TableToolbarContent"; +import TableToolbarMenu from "./TableToolbarMenu"; +import TableToolbarSearch from "./TableToolbarSearch"; + +export * from "./DataTable"; +export * from "./Table"; +export * from "./TableActionList"; +export * from "./TableBatchAction"; +export * from "./TableBatchActions"; +export * from "./TableBody"; +export * from "./TableCell"; +export * from "./TableContainer"; +export * from "./TableExpandHeader"; +export * from "./TableExpandRow"; +export * from "./TableExpandedRow"; +export * from "./TableHead"; +export * from "./TableHeader"; +export * from "./TableRow"; +export * from "./TableSelectAll"; +export * from "./TableSelectRow"; +export * from "./TableToolbar"; +export * from "./TableToolbarAction"; +export * from "./TableToolbarContent"; +export * from "./TableToolbarSearch"; +export * from "./TableToolbarMenu"; + +export { + Table, + TableActionList, + TableBatchAction, + TableBatchActions, + TableBody, + TableCell, + TableContainer, + TableExpandHeader, + TableExpandRow, + TableExpandedRow, + TableHead, + TableHeader, + TableRow, + TableSelectAll, + TableSelectRow, + TableToolbar, + TableToolbarAction, + TableToolbarContent, + TableToolbarSearch, + TableToolbarMenu, +}; + +export default DataTable; diff --git a/types/carbon-components-react/components/DataTable/state/sorting.d.ts b/types/carbon-components-react/components/DataTable/state/sorting.d.ts new file mode 100644 index 0000000000..bab0efa2a8 --- /dev/null +++ b/types/carbon-components-react/components/DataTable/state/sorting.d.ts @@ -0,0 +1,10 @@ +export type DataTableSortState = "ASC" | "DESC" | "NONE"; + +export type DataTableSortStates = Readonly<{ + ASC: Extract, + DESC: Extract, + NONE: Extract, +}>; + +export declare const sortStates: DataTableSortStates; +export declare const initialSortState: Extract; diff --git a/types/carbon-components-react/components/DataTableSkeleton/DataTableSkeleton.d.ts b/types/carbon-components-react/components/DataTableSkeleton/DataTableSkeleton.d.ts new file mode 100644 index 0000000000..1144f6a1de --- /dev/null +++ b/types/carbon-components-react/components/DataTableSkeleton/DataTableSkeleton.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { ShapeOf } from "../../typings/shared"; + +interface InheritedProps extends React.TableHTMLAttributes { } + +export interface HeaderType { + key?: string; + header?: React.ReactNode; +} + +export interface DataTableSkeletonProps extends InheritedProps { + compact?: boolean; + columnCount?: number; + headers?: ReadonlyArray | ReadonlyArray>; + rowCount?: number; + zebra?: boolean; +} + +declare const DataTableSkeleton: React.FC; + +export default DataTableSkeleton; diff --git a/types/carbon-components-react/components/DataTableSkeleton/index.d.ts b/types/carbon-components-react/components/DataTableSkeleton/index.d.ts new file mode 100644 index 0000000000..7e377845d4 --- /dev/null +++ b/types/carbon-components-react/components/DataTableSkeleton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./DataTableSkeleton"; +export { default } from './DataTableSkeleton'; diff --git a/types/carbon-components-react/components/DatePicker/DatePicker.Skeleton.d.ts b/types/carbon-components-react/components/DatePicker/DatePicker.Skeleton.d.ts new file mode 100644 index 0000000000..8ca0b2487b --- /dev/null +++ b/types/carbon-components-react/components/DatePicker/DatePicker.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactAttr["id"], +} + +export interface DatePickerSkeletonProps extends InheritedProps { + range?: boolean, +} + +declare const DatePickerSkeleton: React.FC; + +export default DatePickerSkeleton; diff --git a/types/carbon-components-react/components/DatePicker/DatePicker.d.ts b/types/carbon-components-react/components/DatePicker/DatePicker.d.ts new file mode 100644 index 0000000000..0a2148e3cf --- /dev/null +++ b/types/carbon-components-react/components/DatePicker/DatePicker.d.ts @@ -0,0 +1,25 @@ +import { key as LocaleKey } from "flatpickr/dist/types/locale"; +import { DateOption, Hook } from "flatpickr/dist/types/options"; +import * as React from "react"; +import { ReactDivAttr, ThemeProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + ThemeProps +{ } + +export interface DatePickerProps extends InheritedProps { + appendTo?: string | HTMLElement, + dateFormat?: string, + datePickerType?: "range" | "single" | "simple", + locale?: LocaleKey, + maxDate?: DateOption, + minDate?: DateOption, + onChange?: Hook, + short?: boolean, + value?: DateOption | DateOption[], +} + +declare class DatePicker extends React.Component { } + +export default DatePicker; diff --git a/types/carbon-components-react/components/DatePicker/index.d.ts b/types/carbon-components-react/components/DatePicker/index.d.ts new file mode 100644 index 0000000000..d1f336d6b2 --- /dev/null +++ b/types/carbon-components-react/components/DatePicker/index.d.ts @@ -0,0 +1,3 @@ +export * from "./DatePicker"; +export * from "./DatePicker.Skeleton"; +export { default } from './DatePicker'; diff --git a/types/carbon-components-react/components/DatePickerInput/DatePickerInput.d.ts b/types/carbon-components-react/components/DatePickerInput/DatePickerInput.d.ts new file mode 100644 index 0000000000..8f0129a42d --- /dev/null +++ b/types/carbon-components-react/components/DatePickerInput/DatePickerInput.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactInputAttr, RequiresIdProps, ValidityProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + EmbeddedIconProps, + RequiresIdProps, + ValidityProps +{ } + +export interface DatePickerInputProps extends InheritedProps { + labelText: NonNullable, + openCalendar?: React.MouseEventHandler, + pattern?: string, +} + +declare class DatePickerInput extends React.Component { } + +export default DatePickerInput; diff --git a/types/carbon-components-react/components/DatePickerInput/index.d.ts b/types/carbon-components-react/components/DatePickerInput/index.d.ts new file mode 100644 index 0000000000..306d9f3f7a --- /dev/null +++ b/types/carbon-components-react/components/DatePickerInput/index.d.ts @@ -0,0 +1,2 @@ +export * from "./DatePickerInput"; +export { default } from './DatePickerInput'; diff --git a/types/carbon-components-react/components/Dropdown/Dropdown.Skeleton.d.ts b/types/carbon-components-react/components/Dropdown/Dropdown.Skeleton.d.ts new file mode 100644 index 0000000000..56ad4cabd3 --- /dev/null +++ b/types/carbon-components-react/components/Dropdown/Dropdown.Skeleton.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; + +export interface DropdownSkeletonProps { + inline?: boolean, +} + +declare const DropdownSkeleton: React.FC; + +export default DropdownSkeleton; diff --git a/types/carbon-components-react/components/Dropdown/Dropdown.d.ts b/types/carbon-components-react/components/Dropdown/Dropdown.d.ts new file mode 100644 index 0000000000..89d8c845d0 --- /dev/null +++ b/types/carbon-components-react/components/Dropdown/Dropdown.d.ts @@ -0,0 +1,33 @@ +import * as React from "react"; +import { DownshiftTypedProps, InternationalProps, ReactInputAttr, ThemeProps, ValidityProps } from "../../typings/shared"; +import { ListBoxProps } from "../ListBox"; +import { ListBoxMenuIconTranslationKey } from "../ListBox/ListBoxMenuIcon"; + +interface InheritedProps extends + DownshiftTypedProps, + InternationalProps, + ThemeProps, + ValidityProps +{ + ariaLabel: React.AriaAttributes["aria-label"], + disabled?: ReactInputAttr["disabled"], + type?: ListBoxProps["type"], +} + +export interface OnChangeData { + selectedItem?: ItemType; +} + +export interface DropdownProps extends InheritedProps { + initialSelectedItem?: ItemType, + inline?: boolean, + helperText?: React.ReactNode, + items: ItemType[], + itemToElement?(item: ItemType): React.ComponentType, + label: NonNullable, + onChange?(data: OnChangeData): void, + selectedItem?: ItemType, + titleText: NonNullable, +} + +export default class Dropdown extends React.Component> { } diff --git a/types/carbon-components-react/components/Dropdown/index.d.ts b/types/carbon-components-react/components/Dropdown/index.d.ts new file mode 100644 index 0000000000..d9d6c81098 --- /dev/null +++ b/types/carbon-components-react/components/Dropdown/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Dropdown"; +export * from "./Dropdown.Skeleton"; +export { default } from './Dropdown'; diff --git a/types/carbon-components-react/components/FileUploader/FileUploader.Skeleton.d.ts b/types/carbon-components-react/components/FileUploader/FileUploader.Skeleton.d.ts new file mode 100644 index 0000000000..6280197a56 --- /dev/null +++ b/types/carbon-components-react/components/FileUploader/FileUploader.Skeleton.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface FileUploaderSkeletonProps { } + +declare class FileUploaderSkeleton extends React.Component { } + +export default FileUploaderSkeleton; diff --git a/types/carbon-components-react/components/FileUploader/FileUploader.d.ts b/types/carbon-components-react/components/FileUploader/FileUploader.d.ts new file mode 100644 index 0000000000..3f31e53697 --- /dev/null +++ b/types/carbon-components-react/components/FileUploader/FileUploader.d.ts @@ -0,0 +1,69 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactDivAttr, ReactInputAttr, ReactLabelAttr } from "../../typings/shared"; +import { ButtonKind } from "../Button"; + +interface SharedProps { + accept?: string[], + buttonKind?: ButtonKind, + disabled?: ReactInputAttr["disabled"], + disableLabelChanges?: boolean, + labelText?: string + listFiles?: boolean, + multiple?: boolean, +} + +export type FileStatus = "complete" | "edit" | "uploading"; + +// FileUploaderButton + +interface FileUploaderButtonInheritedProps extends + Omit, + SharedProps +{ + onChange?(event: React.ChangeEvent): void, +} + +export interface FileUploaderButtonProps extends FileUploaderButtonInheritedProps { } + +export declare class FileUploaderButton extends React.Component { } + +// Filename + +interface FilenameDivInheritedProps extends ReactDivAttr { } +interface FilenameIconInheritedProps extends + React.SVGAttributes, + EmbeddedIconProps +{ } + +export interface FilenameDivProps extends FilenameDivInheritedProps { + status: Extract, +} + +export interface FilenameIconProps extends FilenameIconInheritedProps { + status: Extract, +} + +export interface FilenameEmptyProps extends FilenameDivInheritedProps { + status?: null; +} + +export type AllFilenameProps = FilenameDivProps | FilenameIconProps | FilenameEmptyProps; +export declare class Filename extends React.Component { } + +// FileUploader + +interface FileUploaderInheritedProps extends + Omit, + EmbeddedIconProps, + SharedProps +{ } + +export interface FileUploaderProps extends FileUploaderInheritedProps { + buttonLabel?: string, + filenameStatus?: FileStatus, // required but has default value + labelDescription?: string, +} + +export declare class FileUploader extends React.Component { } + +export default FileUploader; diff --git a/types/carbon-components-react/components/FileUploader/index.d.ts b/types/carbon-components-react/components/FileUploader/index.d.ts new file mode 100644 index 0000000000..f458066b9f --- /dev/null +++ b/types/carbon-components-react/components/FileUploader/index.d.ts @@ -0,0 +1,3 @@ +export * from "./FileUploader"; +export * from "./FileUploader.Skeleton"; +export { default } from './FileUploader'; diff --git a/types/carbon-components-react/components/Form/Form.d.ts b/types/carbon-components-react/components/Form/Form.d.ts new file mode 100644 index 0000000000..c397acd0b8 --- /dev/null +++ b/types/carbon-components-react/components/Form/Form.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; + +interface InheritedProps extends React.FormHTMLAttributes { } + +export interface FormProps extends InheritedProps { } + +declare const Form: React.FC; + +export default Form; diff --git a/types/carbon-components-react/components/Form/index.d.ts b/types/carbon-components-react/components/Form/index.d.ts new file mode 100644 index 0000000000..c54a7e767e --- /dev/null +++ b/types/carbon-components-react/components/Form/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Form"; +export { default } from './Form'; diff --git a/types/carbon-components-react/components/FormGroup/FormGroup.d.ts b/types/carbon-components-react/components/FormGroup/FormGroup.d.ts new file mode 100644 index 0000000000..e2dfc5dd19 --- /dev/null +++ b/types/carbon-components-react/components/FormGroup/FormGroup.d.ts @@ -0,0 +1,16 @@ +import * as React from "react"; +import { ValidityProps } from "../../typings/shared"; + +interface InheritedProps extends React.FieldsetHTMLAttributes { + invalid?: ValidityProps["invalid"], +} + +export interface FormGroupProps extends InheritedProps { + legendText: string, + message?: boolean, + messageText?: string, +} + +declare const FormGroup: React.FC; + +export default FormGroup; diff --git a/types/carbon-components-react/components/FormGroup/index.d.ts b/types/carbon-components-react/components/FormGroup/index.d.ts new file mode 100644 index 0000000000..32bf1e54ab --- /dev/null +++ b/types/carbon-components-react/components/FormGroup/index.d.ts @@ -0,0 +1,2 @@ +export * from "./FormGroup"; +export { default } from './FormGroup'; diff --git a/types/carbon-components-react/components/FormItem/FormItem.d.ts b/types/carbon-components-react/components/FormItem/FormItem.d.ts new file mode 100644 index 0000000000..d785826ff9 --- /dev/null +++ b/types/carbon-components-react/components/FormItem/FormItem.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface FormItemProps extends InheritedProps { } + +declare const FormItem: React.FC; + +export default FormItem; diff --git a/types/carbon-components-react/components/FormItem/index.d.ts b/types/carbon-components-react/components/FormItem/index.d.ts new file mode 100644 index 0000000000..98719dd45b --- /dev/null +++ b/types/carbon-components-react/components/FormItem/index.d.ts @@ -0,0 +1,2 @@ +export * from "./FormItem"; +export { default } from './FormItem'; diff --git a/types/carbon-components-react/components/FormLabel/FormLabel.d.ts b/types/carbon-components-react/components/FormLabel/FormLabel.d.ts new file mode 100644 index 0000000000..ca176ea183 --- /dev/null +++ b/types/carbon-components-react/components/FormLabel/FormLabel.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface FormLabelProps extends InheritedProps { } + +declare const FormLabel: React.FC; + +export default FormLabel; diff --git a/types/carbon-components-react/components/FormLabel/index.d.ts b/types/carbon-components-react/components/FormLabel/index.d.ts new file mode 100644 index 0000000000..1c6f2eb335 --- /dev/null +++ b/types/carbon-components-react/components/FormLabel/index.d.ts @@ -0,0 +1,2 @@ +export * from "./FormLabel"; +export { default } from './FormLabel'; diff --git a/types/carbon-components-react/components/Icon/Icon.Skeleton.d.ts b/types/carbon-components-react/components/Icon/Icon.Skeleton.d.ts new file mode 100644 index 0000000000..34d351492b --- /dev/null +++ b/types/carbon-components-react/components/Icon/Icon.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + style?: ReactAttr["style"], +} + +export interface IconSkeletonProps extends InheritedProps { } + +declare const IconSkeleton: React.FC; + +export default IconSkeleton; diff --git a/types/carbon-components-react/components/Icon/Icon.d.ts b/types/carbon-components-react/components/Icon/Icon.d.ts new file mode 100644 index 0000000000..ed875dab85 --- /dev/null +++ b/types/carbon-components-react/components/Icon/Icon.d.ts @@ -0,0 +1,34 @@ +import * as React from "react"; + +type SVGAttr = React.SVGAttributes; + +interface SVGInheritedProps { + className?: SVGAttr["className"], + fill?: SVGAttr["fill"], + fillRule?: SVGAttr["fillRule"], + height?: SVGAttr["height"], + role?: SVGAttr["role"], + style?: SVGAttr["style"], + viewBox?: SVGAttr["viewBox"], + width?: SVGAttr["width"], +} + +export interface IconData { + width?: string; + height?: string; + viewBox: string; + svgData: any; +} + +export interface IconProps extends SVGInheritedProps { + description: string, + icon?: IconData, + iconRef?: React.Ref, + iconTitle?: string +} + +declare const Icon: React.FC; + +// TODO: icons + +export default Icon; diff --git a/types/carbon-components-react/components/Icon/index.d.ts b/types/carbon-components-react/components/Icon/index.d.ts new file mode 100644 index 0000000000..80fa91acc0 --- /dev/null +++ b/types/carbon-components-react/components/Icon/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Icon"; +export * from "./Icon.Skeleton"; +export { default } from "./Icon"; diff --git a/types/carbon-components-react/components/InlineCheckbox/InlineCheckbox.d.ts b/types/carbon-components-react/components/InlineCheckbox/InlineCheckbox.d.ts new file mode 100644 index 0000000000..c2ba0cba27 --- /dev/null +++ b/types/carbon-components-react/components/InlineCheckbox/InlineCheckbox.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-label" | "className" | "id" | "onChange" | "ref" | "type"; + +interface InheritedProps extends + Omit, + RequiresIdProps +{ + ariaLabel?: ReactInputAttr["aria-label"], +} + +export interface InlineCheckboxProps extends InheritedProps { + indeterminate?: boolean, + innerRef?: React.Ref; + onChange?(checked: boolean, id: string, event: React.ChangeEvent): void, +} + +declare const InlineCheckbox: React.RefForwardingComponent; + +export default InlineCheckbox; diff --git a/types/carbon-components-react/components/InlineCheckbox/index.d.ts b/types/carbon-components-react/components/InlineCheckbox/index.d.ts new file mode 100644 index 0000000000..276669386d --- /dev/null +++ b/types/carbon-components-react/components/InlineCheckbox/index.d.ts @@ -0,0 +1,2 @@ +export * from "./InlineCheckbox"; +export { default } from './InlineCheckbox'; diff --git a/types/carbon-components-react/components/InlineLoading/InlineLoading.d.ts b/types/carbon-components-react/components/InlineLoading/InlineLoading.d.ts new file mode 100644 index 0000000000..4bf3b11841 --- /dev/null +++ b/types/carbon-components-react/components/InlineLoading/InlineLoading.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr, EmbeddedIconProps { } + +export interface InlineLoadingProps extends InheritedProps { + description?: string, + onSuccess?(): void, + success?: boolean, + successDelay?: number, +} + +declare const InlineLoading: React.FC; + +export default InlineLoading; diff --git a/types/carbon-components-react/components/InlineLoading/index.d.ts b/types/carbon-components-react/components/InlineLoading/index.d.ts new file mode 100644 index 0000000000..dc63abb6fc --- /dev/null +++ b/types/carbon-components-react/components/InlineLoading/index.d.ts @@ -0,0 +1,2 @@ +export * from "./InlineLoading"; +export { default } from './InlineLoading'; diff --git a/types/carbon-components-react/components/Link/Link.d.ts b/types/carbon-components-react/components/Link/Link.d.ts new file mode 100644 index 0000000000..18ae2f7652 --- /dev/null +++ b/types/carbon-components-react/components/Link/Link.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAnchorAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAnchorAttr { } + +export interface LinkProps extends InheritedProps { + disabled?: boolean, +} + +declare const Link: React.FC; + +export default Link; diff --git a/types/carbon-components-react/components/Link/index.d.ts b/types/carbon-components-react/components/Link/index.d.ts new file mode 100644 index 0000000000..0b877f0d2d --- /dev/null +++ b/types/carbon-components-react/components/Link/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Link"; +export { default } from './Link'; diff --git a/types/carbon-components-react/components/ListBox/ListBox.d.ts b/types/carbon-components-react/components/ListBox/ListBox.d.ts new file mode 100644 index 0000000000..e5353d57c0 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBox.d.ts @@ -0,0 +1,29 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; +import { ListBoxFieldComponent } from "./ListBoxField"; +import { ListBoxMenuComponent } from "./ListBoxMenu"; +import { ListBoxMenuIconComponent } from "./ListBoxMenuIcon"; +import { ListBoxMenuItemComponent } from "./ListBoxMenuItem"; +import { ListBoxType } from "./ListBoxPropTypes"; +import { ListBoxSelectionComponent } from "./ListBoxSelection"; + +type ExcludedAttributes = "onKeyDown" | "onKeyPress" | "ref" | "role" | "tabIndex"; +interface InheritedProps extends Omit { } + +export interface ListBoxProps extends InheritedProps { + disabled?: boolean, // required but has default value + innerRef?: React.Ref, // required but has default value + type?: ListBoxType, // required but has default value +} + +export interface ListBoxComponent extends React.FC { + readonly Field: ListBoxFieldComponent, + readonly Menu: ListBoxMenuComponent, + readonly MenuIcon: ListBoxMenuIconComponent, + readonly MenuItem: ListBoxMenuItemComponent, + readonly Selection: ListBoxSelectionComponent, +} + +declare const ListBox: ListBoxComponent; + +export default ListBox; diff --git a/types/carbon-components-react/components/ListBox/ListBoxField.d.ts b/types/carbon-components-react/components/ListBox/ListBoxField.d.ts new file mode 100644 index 0000000000..983239dfd0 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxField.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { InternationalProps, ReactDivAttr, RequiresIdProps } from "../../typings/shared"; + +export type ListBoxFieldTranslationKey = "close.menu" | "open.menu"; +interface InheritedProps extends + Omit, + InternationalProps, + RequiresIdProps +{ } + +export interface ListBoxFieldProps extends InheritedProps { } + +export interface ListBoxFieldComponent extends React.FC { } + +declare const ListBoxField: ListBoxFieldComponent; + +export default ListBoxField; diff --git a/types/carbon-components-react/components/ListBox/ListBoxMenu.d.ts b/types/carbon-components-react/components/ListBox/ListBoxMenu.d.ts new file mode 100644 index 0000000000..7ab50b41cb --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxMenu.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactDivAttr, RequiresIdProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + RequiresIdProps +{ } + +export interface ListBoxMenuProps extends InheritedProps { } + +export interface ListBoxMenuComponent extends React.FC { } + +declare const ListBoxMenu: ListBoxMenuComponent; + +export default ListBoxMenu; diff --git a/types/carbon-components-react/components/ListBox/ListBoxMenuIcon.d.ts b/types/carbon-components-react/components/ListBox/ListBoxMenuIcon.d.ts new file mode 100644 index 0000000000..461efd86e5 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxMenuIcon.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { InternationalProps } from "../../typings/shared"; + +export type ListBoxMenuIconTranslationKey = "close.menu" | "open.menu"; +interface InheritedProps extends InternationalProps { } + +export interface ListBoxMenuIconProps extends InheritedProps { + isOpen: boolean, +} + +export interface ListBoxMenuIconComponent extends React.FC { } + +declare const ListBoxMenuIcon: ListBoxMenuIconComponent; + +export default ListBoxMenuIcon; diff --git a/types/carbon-components-react/components/ListBox/ListBoxMenuItem.d.ts b/types/carbon-components-react/components/ListBox/ListBoxMenuItem.d.ts new file mode 100644 index 0000000000..54359f6e50 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxMenuItem.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface ListBoxMenuItemProps extends InheritedProps { + isActive?: boolean, // required but has default value + isHighlighted?: boolean, // required but has default value +} + +export interface ListBoxMenuItemComponent extends React.FC { } + +declare const ListBoxMenuItem: ListBoxMenuItemComponent; + +export default ListBoxMenuItem; diff --git a/types/carbon-components-react/components/ListBox/ListBoxPropTypes.d.ts b/types/carbon-components-react/components/ListBox/ListBoxPropTypes.d.ts new file mode 100644 index 0000000000..6498569c20 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxPropTypes.d.ts @@ -0,0 +1 @@ +export type ListBoxType = "default" | "inline"; diff --git a/types/carbon-components-react/components/ListBox/ListBoxSelection.d.ts b/types/carbon-components-react/components/ListBox/ListBoxSelection.d.ts new file mode 100644 index 0000000000..eb45865b34 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/ListBoxSelection.d.ts @@ -0,0 +1,16 @@ +import * as React from "react"; +import { InternationalProps } from "../../typings/shared"; + +export type ListBoxSelectionTranslationKey = "clear.all" | "clear.selection"; +interface InheritedProps extends InternationalProps { } + +export interface ListBoxSelectionProps extends InheritedProps { + clearSelection(e: React.MouseEvent | React.KeyboardEvent): void, + selectionCount?: number, +} + +export interface ListBoxSelectionComponent extends React.FC { } + +declare const ListBoxSelection: ListBoxSelectionComponent; + +export default ListBoxSelection; diff --git a/types/carbon-components-react/components/ListBox/index.d.ts b/types/carbon-components-react/components/ListBox/index.d.ts new file mode 100644 index 0000000000..ef56343be1 --- /dev/null +++ b/types/carbon-components-react/components/ListBox/index.d.ts @@ -0,0 +1,5 @@ +import * as PropTypes from "./ListBoxPropTypes"; + +export * from "./ListBox"; +export { PropTypes }; +export { default } from './ListBox'; diff --git a/types/carbon-components-react/components/ListItem/ListItem.d.ts b/types/carbon-components-react/components/ListItem/ListItem.d.ts new file mode 100644 index 0000000000..07cd30ee1d --- /dev/null +++ b/types/carbon-components-react/components/ListItem/ListItem.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactLIAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactLIAttr { } + +export interface ListItemProps extends InheritedProps { } + +declare const ListItem: React.FC; + +export default ListItem; diff --git a/types/carbon-components-react/components/ListItem/index.d.ts b/types/carbon-components-react/components/ListItem/index.d.ts new file mode 100644 index 0000000000..840571e859 --- /dev/null +++ b/types/carbon-components-react/components/ListItem/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ListItem"; +export { default } from './ListItem'; diff --git a/types/carbon-components-react/components/Loading/Loading.d.ts b/types/carbon-components-react/components/Loading/Loading.d.ts new file mode 100644 index 0000000000..46de4dd2f0 --- /dev/null +++ b/types/carbon-components-react/components/Loading/Loading.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactDivAttr, SizingProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-label" | "aria-live"; +interface InheritedProps extends + Omit, + SizingProps +{ } + +export interface LoadingProps extends InheritedProps { + active?: boolean, + description?: string, + withOverlay?: boolean, +} + +declare class Loading extends React.Component { } + +export default Loading; diff --git a/types/carbon-components-react/components/Loading/index.d.ts b/types/carbon-components-react/components/Loading/index.d.ts new file mode 100644 index 0000000000..a5a24026ab --- /dev/null +++ b/types/carbon-components-react/components/Loading/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Loading"; +export { default } from './Loading'; diff --git a/types/carbon-components-react/components/Modal/Modal.d.ts b/types/carbon-components-react/components/Modal/Modal.d.ts new file mode 100644 index 0000000000..6de7395ac3 --- /dev/null +++ b/types/carbon-components-react/components/Modal/Modal.d.ts @@ -0,0 +1,31 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactDivAttr } from "../../typings/shared"; + +type ExcludedAttributes = "role" | "tabIndex" | "onBlur" | "onClick" | "onKeyDown" | "onTransitionEnd" | "ref"; +interface InheritedProps extends + Omit, + EmbeddedIconProps +{ } + +export interface ModalProps extends InheritedProps { + danger?: boolean, + focusTrap?: boolean, + modalAriaLabel?: string, + modalHeading?: React.ReactNode, + modalLabel?: React.ReactNode, + open?: boolean, + onRequestClose?(event: React.MouseEvent | React.KeyboardEvent): void, + onRequestSubmit?(event: React.MouseEvent | React.KeyboardEvent): void, + onSecondarySubmit?: ModalProps["onRequestClose"], + passiveModal?: boolean, + primaryButtonDisabled?: boolean, + primaryButtonText?: string, + secondaryButtonText?: string, + selectorPrimaryFocus?: string, + selectorsFloatingMenus?: string[], + shouldSubmitOnEnter?: boolean, +} + +declare class Modal extends React.Component { } + +export default Modal; diff --git a/types/carbon-components-react/components/Modal/index.d.ts b/types/carbon-components-react/components/Modal/index.d.ts new file mode 100644 index 0000000000..ac7264a2d1 --- /dev/null +++ b/types/carbon-components-react/components/Modal/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Modal"; +export { default } from './Modal'; diff --git a/types/carbon-components-react/components/ModalWrapper/ModalWrapper.d.ts b/types/carbon-components-react/components/ModalWrapper/ModalWrapper.d.ts new file mode 100644 index 0000000000..e682e7fb97 --- /dev/null +++ b/types/carbon-components-react/components/ModalWrapper/ModalWrapper.d.ts @@ -0,0 +1,25 @@ +import * as React from "react"; +import { ButtonProps } from "../Button"; +import { ModalProps } from "../Modal"; + +type ExcludedModalProps = "onRequestClose" | "onRequestSubmit" | "open"; +interface InheritedProps extends Omit { } + +export interface TriggerProps { + buttonTriggerClassName?: ButtonProps["className"], + buttonTriggerText?: ButtonProps["children"], + renderTriggerButtonIcon?: ButtonProps["renderIcon"], + triggerButtonIconDescription?: ButtonProps["iconDescription"], + triggerButtonKind?: ButtonProps["kind"], +} + +export interface ModalWrapperProps extends InheritedProps, TriggerProps { + handleOpen?(e: React.MouseEvent): void, + handleSubmit?(): boolean, + shouldCloseAfterSubmit?: boolean, + status?: string, +} + +declare class ModalWrapper extends React.Component { } + +export default ModalWrapper; diff --git a/types/carbon-components-react/components/ModalWrapper/index.d.ts b/types/carbon-components-react/components/ModalWrapper/index.d.ts new file mode 100644 index 0000000000..85c8c150dd --- /dev/null +++ b/types/carbon-components-react/components/ModalWrapper/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ModalWrapper"; +export { default } from './ModalWrapper'; diff --git a/types/carbon-components-react/components/MultiSelect/FilterableMultiSelect.d.ts b/types/carbon-components-react/components/MultiSelect/FilterableMultiSelect.d.ts new file mode 100644 index 0000000000..4b6fefdc24 --- /dev/null +++ b/types/carbon-components-react/components/MultiSelect/FilterableMultiSelect.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { DownshiftTypedProps, ListBoxBaseItemType } from "../../typings/shared"; +import { MultiSelectProps } from "./MultiSelect"; + +interface InheritedProps extends MultiSelectProps { } + +interface FilterItemsExtra { + inputValue: string, + itemToString: NonNullable["itemToString"]>, +} + +export interface FilterableMultiSelectProps extends InheritedProps { + filterItems?(items: ReadonlyArray, extra: FilterItemsExtra): ItemType[], +} + +declare class FilterableMultiSelect extends React.Component { } + +export default FilterableMultiSelect; diff --git a/types/carbon-components-react/components/MultiSelect/MultiSelect.d.ts b/types/carbon-components-react/components/MultiSelect/MultiSelect.d.ts new file mode 100644 index 0000000000..22b6ad949b --- /dev/null +++ b/types/carbon-components-react/components/MultiSelect/MultiSelect.d.ts @@ -0,0 +1,33 @@ +import * as React from "react"; +import { DownshiftTypedProps, InternationalProps, ListBoxBaseItemType, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; +import { ListBoxProps } from "../ListBox"; +import { ListBoxMenuIconTranslationKey } from "../ListBox/ListBoxMenuIcon"; +import FilterableMultiSelect from "./FilterableMultiSelect"; +import { MultiSelectSortingProps } from "./MultiSelectPropTypes"; + +interface InheritedProps extends + DownshiftTypedProps, + InternationalProps, + MultiSelectSortingProps, + RequiresIdProps, + ThemeProps, + ValidityProps +{ + disabled?: ListBoxProps["disabled"], + type?: ListBoxProps["type"], +} + +export interface MultiSelectProps extends InheritedProps { + inline?: boolean, + label?: React.ReactNode, + locale?: string, + open?: boolean, + selectionFeedback?: "fixed" | "top" | "top-after-reopen", + useTitleInItem?: boolean, +} + +declare class MultiSelect extends React.Component> { + static readonly Filterable: FilterableMultiSelect; +} + +export default MultiSelect; diff --git a/types/carbon-components-react/components/MultiSelect/MultiSelectPropTypes.d.ts b/types/carbon-components-react/components/MultiSelect/MultiSelectPropTypes.d.ts new file mode 100644 index 0000000000..5f1a0ee47e --- /dev/null +++ b/types/carbon-components-react/components/MultiSelect/MultiSelectPropTypes.d.ts @@ -0,0 +1,17 @@ +import { DownshiftTypedProps, ListBoxBaseItemType } from "../../typings/shared"; + +interface SharedOptions { + locale: string, +} + +interface SortItemsOptions extends SharedOptions, DownshiftTypedProps { + compareItems(item1: ItemType, item2: ItemType, options: SharedOptions): number, + selectedItems: ItemType[], +} + +export interface MultiSelectSortingProps { + compareItems?(item1: ItemType, item2: ItemType, options: SharedOptions): number, // required but has default value + sortItems?(items: ReadonlyArray, options: SortItemsOptions): ItemType[], // required but has default value +} + +export declare const sortingPropTypes: MultiSelectSortingProps; diff --git a/types/carbon-components-react/components/MultiSelect/index.d.ts b/types/carbon-components-react/components/MultiSelect/index.d.ts new file mode 100644 index 0000000000..7973f396f6 --- /dev/null +++ b/types/carbon-components-react/components/MultiSelect/index.d.ts @@ -0,0 +1,2 @@ +export * from "./MultiSelect"; +export { default } from './MultiSelect'; diff --git a/types/carbon-components-react/components/Notification/Notification.d.ts b/types/carbon-components-react/components/Notification/Notification.d.ts new file mode 100644 index 0000000000..8ad7d4ada0 --- /dev/null +++ b/types/carbon-components-react/components/Notification/Notification.d.ts @@ -0,0 +1,96 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactAttr, ReactButtonAttr, ReactDivAttr, RenderIconProps } from "../../typings/shared"; +import { ButtonProps } from "../Button"; + +export type NotificationType = "inline" | "toast"; +export type NotificationKind = "error" | "info" | "success" | "warning"; + +interface SharedProps { + notificationType?: NotificationType, +} + +export interface NotificationContentProps { + caption: NonNullable, + subtitle: NonNullable, + title: NonNullable, +} + +export interface NotificationInteractionProps { + hideCloseButton?: boolean, + onCloseButtonClick?(e: React.MouseEvent): void, +} + +export interface NotificationBaseProps extends NotificationInteractionProps, SharedProps { + kind: NotificationKind, +} + +// NotificationActionButton + +interface NotificationActionButtonInheritedProps extends ButtonProps { } + +export interface NotificationActionButtonProps extends NotificationActionButtonInheritedProps { } + +export declare class NotificationActionButton extends React.Component { } + +// NotificationButton + +type ExcludedButtonAttributes = "aria-label" | "title"; +interface NotificationButtonInheritedProps extends + Omit, + EmbeddedIconProps, + RenderIconProps, + SharedProps +{ + ariaLabel?: React.AriaAttributes["aria-label"], +} + +export interface NotificationButtonProps extends NotificationButtonInheritedProps { + name?: string, +} + +export declare class NotificationButton extends React.Component { } + +// NotificationTextDetail + +type ExcludedDetailDivAttributes = "className" | "title"; +interface NotificationTextDetailInheritedProps extends + Omit, + NotificationContentProps, + SharedProps +{ } + +export interface NotificationTextDetailsProps extends NotificationTextDetailInheritedProps { } + +export declare class NotificationTextDetails extends React.Component { } + +// ToastNotification + +type ExcludedToastDivAttributes = "role" | "title"; +interface ToastNotificationInheritedProps extends + Omit, + NotificationContentProps, + NotificationBaseProps +{ + iconDescription: NonNullable, + role: NonNullable, +} + +export interface ToastNotificationProps extends ToastNotificationInheritedProps { + timeout?: number, +} + +export declare class ToastNotification extends React.Component { } + +// Inline Notification + +interface InlineNotificationInheritedProps extends + Omit, + Omit, + NotificationBaseProps +{ } + +export interface InlineNotificationProps extends InlineNotificationInheritedProps { + actions?: React.ReactNode, +} + +export declare class InlineNotification extends React.Component { } diff --git a/types/carbon-components-react/components/Notification/a11yIconWarningSolid.d.ts b/types/carbon-components-react/components/Notification/a11yIconWarningSolid.d.ts new file mode 100644 index 0000000000..4904974ec4 --- /dev/null +++ b/types/carbon-components-react/components/Notification/a11yIconWarningSolid.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; + +export interface a11yWarningIconProps { + notificationType: string, + prefix: string, +} + +declare const a11yWarningIcon: React.FC; + +export default a11yWarningIcon; diff --git a/types/carbon-components-react/components/Notification/index.d.ts b/types/carbon-components-react/components/Notification/index.d.ts new file mode 100644 index 0000000000..ed80171ae9 --- /dev/null +++ b/types/carbon-components-react/components/Notification/index.d.ts @@ -0,0 +1 @@ +export * from './Notification'; diff --git a/types/carbon-components-react/components/NumberInput/NumberInput.Skeleton.d.ts b/types/carbon-components-react/components/NumberInput/NumberInput.Skeleton.d.ts new file mode 100644 index 0000000000..16ac1df5af --- /dev/null +++ b/types/carbon-components-react/components/NumberInput/NumberInput.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactAttr["id"], +} + +export interface NumberInputSkeletonProps extends InheritedProps { + hideLabel?: boolean, +} + +declare const NumberInputSkeleton: React.FC; + +export default NumberInputSkeleton; diff --git a/types/carbon-components-react/components/NumberInput/NumberInput.d.ts b/types/carbon-components-react/components/NumberInput/NumberInput.d.ts new file mode 100644 index 0000000000..f0ad1edc0f --- /dev/null +++ b/types/carbon-components-react/components/NumberInput/NumberInput.d.ts @@ -0,0 +1,27 @@ +import * as React from "react"; +import { EmbeddedIconProps, InternationalProps, ReactInputAttr, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-label" | "id" | "ref"; +export type NumberInputTranslationKey = "decrement.number" | "increment.number"; +interface InheritedProps extends + Omit, + EmbeddedIconProps, + InternationalProps, + RequiresIdProps, + ThemeProps, + ValidityProps +{ + value: number, +} + +export interface NumberInputProps extends InheritedProps { + allowEmpty?: boolean, + helperText?: string, + hideLabel?: boolean, + label?: React.ReactNode, + isMobile?: boolean, +} + +declare const NumberInput: React.RefForwardingComponent; + +export default NumberInput; diff --git a/types/carbon-components-react/components/NumberInput/index.d.ts b/types/carbon-components-react/components/NumberInput/index.d.ts new file mode 100644 index 0000000000..85e347f3e0 --- /dev/null +++ b/types/carbon-components-react/components/NumberInput/index.d.ts @@ -0,0 +1,3 @@ +export * from "./NumberInput"; +export * from "./NumberInput.Skeleton"; +export { default } from "./NumberInput"; diff --git a/types/carbon-components-react/components/OrderedList/OrderedList.d.ts b/types/carbon-components-react/components/OrderedList/OrderedList.d.ts new file mode 100644 index 0000000000..a71346db0c --- /dev/null +++ b/types/carbon-components-react/components/OrderedList/OrderedList.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; + +interface InheritedProps extends React.OlHTMLAttributes { } + +export interface OrderedListProps extends InheritedProps { + nested?: boolean, +} + +declare const OrderedList: React.FC; + +export default OrderedList; diff --git a/types/carbon-components-react/components/OrderedList/index.d.ts b/types/carbon-components-react/components/OrderedList/index.d.ts new file mode 100644 index 0000000000..66306300ba --- /dev/null +++ b/types/carbon-components-react/components/OrderedList/index.d.ts @@ -0,0 +1,2 @@ +export * from "./OrderedList"; +export { default } from "./OrderedList"; diff --git a/types/carbon-components-react/components/OverflowMenu/OverflowMenu.d.ts b/types/carbon-components-react/components/OverflowMenu/OverflowMenu.d.ts new file mode 100644 index 0000000000..571e1f6e29 --- /dev/null +++ b/types/carbon-components-react/components/OverflowMenu/OverflowMenu.d.ts @@ -0,0 +1,30 @@ +import * as React from "react"; +import { Direction, EmbeddedIconProps, MenuOffsetData, ReactAttr, ReactDivAttr, RenderIconProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-expanded" | "aria-haspopup" | "aria-label" | "onBlur" | "onClick" | "onKeyDown" | "onKeyPress" | "role"; +interface InheritedProps extends + Omit, + EmbeddedIconProps, + RenderIconProps +{ + ariaLabel?: React.AriaAttributes["aria-label"], + onClick?(e: React.MouseEvent | React.KeyboardEvent): void, +} + +export type MenuOffsetValue = MenuOffsetData | ((menuBody: HTMLElement, direction: Direction, trigger?: HTMLElement, flip?: boolean) => (MenuOffsetData | undefined)); + +export interface OverflowMenuProps extends InheritedProps { + direction?: Extract, + iconClass?: ReactAttr["className"] + flipped?: boolean, + menuOffset?: MenuOffsetValue, + menuOffsetFlip?: MenuOffsetValue, + menuOptionsClass?: ReactAttr["className"], + onClose?(): void, + onOpen?(): void, + open?: boolean, +} + +declare const OverflowMenu: React.RefForwardingComponent; + +export default OverflowMenu; diff --git a/types/carbon-components-react/components/OverflowMenu/index.d.ts b/types/carbon-components-react/components/OverflowMenu/index.d.ts new file mode 100644 index 0000000000..970adcecac --- /dev/null +++ b/types/carbon-components-react/components/OverflowMenu/index.d.ts @@ -0,0 +1,2 @@ +export * from "./OverflowMenu"; +export { default } from "./OverflowMenu"; diff --git a/types/carbon-components-react/components/OverflowMenuItem/OverflowMenuItem.d.ts b/types/carbon-components-react/components/OverflowMenuItem/OverflowMenuItem.d.ts new file mode 100644 index 0000000000..9561317753 --- /dev/null +++ b/types/carbon-components-react/components/OverflowMenuItem/OverflowMenuItem.d.ts @@ -0,0 +1,34 @@ +import * as React from "react"; +import { ReactAnchorAttr, ReactButtonAttr } from "../../typings/shared"; + +type ExcludedAttributes = "disabled" | "href" | "onClick" | "onKeyDown" | "ref" | "title" | "tabIndex"; + +interface InheritedButtonProps extends Omit { + onClick?(e: React.MouseEvent): void, +} + +interface InheritedAnchorProps extends Omit { + onClick?(e: React.MouseEvent): void, +} + +interface SharedProps { + // closeMenu is supplied by Overflow parent component + disabled?: boolean, + hasDivider?: boolean, + href?: string, + isDelete?: boolean, + itemText: NonNullable, + primaryFocus?: boolean, + requireTitle?: boolean, + wrapperClassName?: string, +} + +export interface OverflowMenuItemButtonProps extends InheritedButtonProps, SharedProps { } + +export interface OverflowMenuItemAnchorProps extends InheritedAnchorProps, SharedProps { } + +export type AllOverflowMenuItemProps = OverflowMenuItemAnchorProps | OverflowMenuItemButtonProps; + +declare class OverflowMenuItem extends React.Component { } + +export default OverflowMenuItem; diff --git a/types/carbon-components-react/components/OverflowMenuItem/index.d.ts b/types/carbon-components-react/components/OverflowMenuItem/index.d.ts new file mode 100644 index 0000000000..f01616fe21 --- /dev/null +++ b/types/carbon-components-react/components/OverflowMenuItem/index.d.ts @@ -0,0 +1,2 @@ +export * from "./OverflowMenuItem"; +export { default } from "./OverflowMenuItem"; diff --git a/types/carbon-components-react/components/Pagination/Pagination.Skeleton.d.ts b/types/carbon-components-react/components/Pagination/Pagination.Skeleton.d.ts new file mode 100644 index 0000000000..69481ffee7 --- /dev/null +++ b/types/carbon-components-react/components/Pagination/Pagination.Skeleton.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface PaginationSkeletonProps { } + +declare class PaginationSkeleton extends React.Component { } + +export default PaginationSkeleton; diff --git a/types/carbon-components-react/components/Pagination/Pagination.d.ts b/types/carbon-components-react/components/Pagination/Pagination.d.ts new file mode 100644 index 0000000000..472693ad5c --- /dev/null +++ b/types/carbon-components-react/components/Pagination/Pagination.d.ts @@ -0,0 +1,29 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +type ExcludedAttributes = "id" | "onChange"; +interface InheritedProps extends Omit { + id?: string | number, +} + +export interface PaginationProps extends InheritedProps { + backwardText?: string, + forwardText?: string, + isLastPage?: boolean, + itemsPerPageText?: string, + itemRangeText?(min: number, max: number, total: number): string, + itemText?(min: number, max: number): string, + onChange(data: { page: number, pageSize: number }): void, + page?: number, + pageInputDisabled?: boolean, + pageNumberText?: string, + pageRangeText?(current: number, total: number): string, + pageSize?: number, + pageSizes: number[], + pagesUnknown?: boolean, + totalItems?: number, +} + +declare class Pagination extends React.Component { } + +export default Pagination; diff --git a/types/carbon-components-react/components/Pagination/index.d.ts b/types/carbon-components-react/components/Pagination/index.d.ts new file mode 100644 index 0000000000..34e32d6142 --- /dev/null +++ b/types/carbon-components-react/components/Pagination/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Pagination"; +export * from "./Pagination.Skeleton"; +export { default } from "./Pagination"; diff --git a/types/carbon-components-react/components/PrimaryButton/PrimaryButton.d.ts b/types/carbon-components-react/components/PrimaryButton/PrimaryButton.d.ts new file mode 100644 index 0000000000..5085981a39 --- /dev/null +++ b/types/carbon-components-react/components/PrimaryButton/PrimaryButton.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ButtonProps } from "../Button"; + +interface InheritedProps extends Omit { } + +export interface PrimaryButtonProps extends InheritedProps { } + +declare const PrimaryButton: React.FC; + +export default PrimaryButton; diff --git a/types/carbon-components-react/components/PrimaryButton/index.d.ts b/types/carbon-components-react/components/PrimaryButton/index.d.ts new file mode 100644 index 0000000000..1467be58bd --- /dev/null +++ b/types/carbon-components-react/components/PrimaryButton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./PrimaryButton"; +export { default } from "./PrimaryButton"; diff --git a/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts b/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts new file mode 100644 index 0000000000..750d44dd0f --- /dev/null +++ b/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; + +interface InheritedProps { } + +export interface ProgressIndicatorSkeletonProps extends InheritedProps { } + +declare class ProgressIndicatorSkeleton extends React.Component { } + +export default ProgressIndicatorSkeleton; diff --git a/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.d.ts b/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.d.ts new file mode 100644 index 0000000000..0af08c3046 --- /dev/null +++ b/types/carbon-components-react/components/ProgressIndicator/ProgressIndicator.d.ts @@ -0,0 +1,40 @@ +import * as React from "react"; +import { ReactAttr, ReactInputAttr, ValidityProps } from "../../typings/shared"; + +// ProgressStep + +interface ProgressStepInheritedProps { + className?: ReactAttr["className"], + disabled?: ReactInputAttr["disabled"], + invalid?: ValidityProps["invalid"], +} + +export interface RenderLabelProps { + className: ReactAttr["className"], +} + +export interface ProgressStepProps extends ProgressStepInheritedProps { + complete?: boolean, // provided by parent + current?: boolean, + description?: boolean, + index?: number, // provided by parent + label: NonNullable, + onClick?(e?: React.MouseEvent): void, // provided by parent + overflowTooltipProps?: object, + renderLabel?: React.FC, + secondaryLabel?: string, + tooltipId?: string, +} + +export declare const ProgressStep: React.FC; + +// ProgressIndicator + +interface ProgressIndicatorInheritedProps extends Omit, "onChange"> { } + +export interface ProgressIndicatorProps extends ProgressIndicatorInheritedProps { + currentIndex?: number, + onChange?(index: number): void, +} + +export declare class ProgressIndicator extends React.Component { } diff --git a/types/carbon-components-react/components/ProgressIndicator/index.d.ts b/types/carbon-components-react/components/ProgressIndicator/index.d.ts new file mode 100644 index 0000000000..373ace59ca --- /dev/null +++ b/types/carbon-components-react/components/ProgressIndicator/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ProgressIndicator"; +export * from "./ProgressIndicator.Skeleton"; diff --git a/types/carbon-components-react/components/RadioButton/RadioButton.Skeleton.d.ts b/types/carbon-components-react/components/RadioButton/RadioButton.Skeleton.d.ts new file mode 100644 index 0000000000..978defea23 --- /dev/null +++ b/types/carbon-components-react/components/RadioButton/RadioButton.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactLabelAttr["htmlFor"], +} + +export interface RadioButtonSkeletonProps extends InheritedProps { } + +declare class RadioButtonSkeleton extends React.Component { } + +export default RadioButtonSkeleton; diff --git a/types/carbon-components-react/components/RadioButton/RadioButton.d.ts b/types/carbon-components-react/components/RadioButton/RadioButton.d.ts new file mode 100644 index 0000000000..3029f6bab6 --- /dev/null +++ b/types/carbon-components-react/components/RadioButton/RadioButton.d.ts @@ -0,0 +1,20 @@ +import * as React from "react"; +import { ReactInputAttr } from "../../typings/shared"; + +type ExcludedAttributes = "onChange" | "ref" | "type"; +interface InheritedProps extends Omit { } + +export type RadioButtonValue = string | number; + +export interface RadioButtonProps extends InheritedProps { + defaultChecked?: boolean, + hideLabel?: boolean, + labelPosition?: string, + labelText?: React.ReactNode, // required but has default value + onChange?(value: RadioButtonProps["value"], name: RadioButtonProps["name"], event: React.ChangeEvent): void, // required but has default value + value?: RadioButtonValue, // required but has default value +} + +declare const RadioButton: React.RefForwardingComponent; + +export default RadioButton; diff --git a/types/carbon-components-react/components/RadioButton/index.d.ts b/types/carbon-components-react/components/RadioButton/index.d.ts new file mode 100644 index 0000000000..c45dd8d360 --- /dev/null +++ b/types/carbon-components-react/components/RadioButton/index.d.ts @@ -0,0 +1,3 @@ +export * from "./RadioButton"; +export * from "./RadioButton.Skeleton"; +export { default } from "./RadioButton"; diff --git a/types/carbon-components-react/components/RadioButtonGroup/RadioButtonGroup.d.ts b/types/carbon-components-react/components/RadioButtonGroup/RadioButtonGroup.d.ts new file mode 100644 index 0000000000..53658ef37a --- /dev/null +++ b/types/carbon-components-react/components/RadioButtonGroup/RadioButtonGroup.d.ts @@ -0,0 +1,20 @@ +import * as React from "react"; +import { ReactAttr, ReactInputAttr } from "../../typings/shared"; +import { RadioButtonValue } from "../RadioButton"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], + disabled?: ReactInputAttr["disabled"], + name: NonNullable, +} + +export interface RadioButtonGroupProps extends InheritedProps { + defaultSelected?: RadioButtonValue, + onChange?(newSelection: RadioButtonValue, name: RadioButtonGroupProps["name"], event: React.ChangeEvent): void, // required but has default value + valueSelected?: RadioButtonValue, +} + +declare class RadioButtonGroup extends React.Component { } + +export default RadioButtonGroup; diff --git a/types/carbon-components-react/components/RadioButtonGroup/index.d.ts b/types/carbon-components-react/components/RadioButtonGroup/index.d.ts new file mode 100644 index 0000000000..aebf33e2d0 --- /dev/null +++ b/types/carbon-components-react/components/RadioButtonGroup/index.d.ts @@ -0,0 +1,2 @@ +export * from "./RadioButtonGroup"; +export { default } from "./RadioButtonGroup"; diff --git a/types/carbon-components-react/components/RadioTile/RadioTile.d.ts b/types/carbon-components-react/components/RadioTile/RadioTile.d.ts new file mode 100644 index 0000000000..b617ff6206 --- /dev/null +++ b/types/carbon-components-react/components/RadioTile/RadioTile.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactInputAttr } from "../../typings/shared"; +import { RadioButtonValue } from "../RadioButton"; + +type ExcludedAttributes = "onChange" | "type" | "value"; +interface InheritedProps extends + Omit, + EmbeddedIconProps +{ } + +export type RadioTileChangeEvent = React.ChangeEvent | React.KeyboardEvent; + +export interface RadioTileProps extends InheritedProps { + defaultChecked?: boolean, + onChange?(value: RadioTileProps["value"], name: RadioTileProps["name"], event: RadioTileChangeEvent): void, + value: RadioButtonValue, +} + +declare class RadioTile extends React.Component { } + +export default RadioTile; diff --git a/types/carbon-components-react/components/RadioTile/index.d.ts b/types/carbon-components-react/components/RadioTile/index.d.ts new file mode 100644 index 0000000000..1b8794a844 --- /dev/null +++ b/types/carbon-components-react/components/RadioTile/index.d.ts @@ -0,0 +1,2 @@ +export * from "./RadioTile"; +export { default } from "./RadioTile"; diff --git a/types/carbon-components-react/components/Search/Search.Skeleton.d.ts b/types/carbon-components-react/components/Search/Search.Skeleton.d.ts new file mode 100644 index 0000000000..1d60adec89 --- /dev/null +++ b/types/carbon-components-react/components/Search/Search.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactLabelAttr, SizingProps } from "../../typings/shared"; + +interface InheritedProps extends SizingProps { + id?: ReactLabelAttr["htmlFor"], +} + +export interface SearchSkeletonProps extends InheritedProps { } + +declare class SearchSkeleton extends React.Component { } + +export default SearchSkeleton; diff --git a/types/carbon-components-react/components/Search/Search.d.ts b/types/carbon-components-react/components/Search/Search.d.ts new file mode 100644 index 0000000000..a1f53726b0 --- /dev/null +++ b/types/carbon-components-react/components/Search/Search.d.ts @@ -0,0 +1,20 @@ +import * as React from "react"; +import { ReactInputAttr, SizingProps } from "../../typings/shared"; + +type ExcludedAttributes = "defaultValue" | "placeholder" | "ref" | "value"; +interface InheritedProps extends + Omit, + SizingProps +{ } + +export interface SearchProps extends InheritedProps { + closeButtonLabelText?: string, + defaultValue?: string | number, + labelText: NonNullable, + placeHolderText?: string, + value?: string | number, +} + +declare class Search extends React.Component { } + +export default Search; diff --git a/types/carbon-components-react/components/Search/index.d.ts b/types/carbon-components-react/components/Search/index.d.ts new file mode 100644 index 0000000000..61006f17b1 --- /dev/null +++ b/types/carbon-components-react/components/Search/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Search"; +export * from "./Search.Skeleton"; +export { default } from "./Search"; diff --git a/types/carbon-components-react/components/SearchFilterButton/SearchFilterButton.d.ts b/types/carbon-components-react/components/SearchFilterButton/SearchFilterButton.d.ts new file mode 100644 index 0000000000..071d5579e7 --- /dev/null +++ b/types/carbon-components-react/components/SearchFilterButton/SearchFilterButton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactButtonAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactButtonAttr, EmbeddedIconProps { } + +export interface SearchFilterButtonProps extends InheritedProps { + labelText?: string, +} + +declare const SearchFilterButton: React.FC; + +export default SearchFilterButton; diff --git a/types/carbon-components-react/components/SearchFilterButton/index.d.ts b/types/carbon-components-react/components/SearchFilterButton/index.d.ts new file mode 100644 index 0000000000..a75299b8fe --- /dev/null +++ b/types/carbon-components-react/components/SearchFilterButton/index.d.ts @@ -0,0 +1 @@ +export { default } from "./SearchFilterButton"; diff --git a/types/carbon-components-react/components/SearchLayoutButton/SearchLayoutButton.d.ts b/types/carbon-components-react/components/SearchLayoutButton/SearchLayoutButton.d.ts new file mode 100644 index 0000000000..9c882ed949 --- /dev/null +++ b/types/carbon-components-react/components/SearchLayoutButton/SearchLayoutButton.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; + +interface InheritedProps { } + +export type SearchLayoutButtonFormat = "grid" | "list"; + +export interface SearchLayoutButtonProps extends InheritedProps { + format?: SearchLayoutButtonFormat, + iconDescriptionGrid?: string, + iconDescriptionList?: string, + labelText?: string, + onChangeFormat?(data: { format: NonNullable }): void, +} + +declare class SearchLayoutButton extends React.Component { } + +export default SearchLayoutButton; diff --git a/types/carbon-components-react/components/SearchLayoutButton/index.d.ts b/types/carbon-components-react/components/SearchLayoutButton/index.d.ts new file mode 100644 index 0000000000..3112e2fb24 --- /dev/null +++ b/types/carbon-components-react/components/SearchLayoutButton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SearchLayoutButton"; +export { default } from "./SearchLayoutButton"; diff --git a/types/carbon-components-react/components/SecondaryButton/SecondaryButton.d.ts b/types/carbon-components-react/components/SecondaryButton/SecondaryButton.d.ts new file mode 100644 index 0000000000..b4f53dee70 --- /dev/null +++ b/types/carbon-components-react/components/SecondaryButton/SecondaryButton.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ButtonProps } from "../Button"; + +interface InheritedProps extends Omit { } + +export interface SecondaryButtonProps extends InheritedProps { } + +declare const SecondaryButton: React.FC; + +export default SecondaryButton; diff --git a/types/carbon-components-react/components/SecondaryButton/index.d.ts b/types/carbon-components-react/components/SecondaryButton/index.d.ts new file mode 100644 index 0000000000..be01a1695e --- /dev/null +++ b/types/carbon-components-react/components/SecondaryButton/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SecondaryButton"; +export { default } from "./SecondaryButton"; diff --git a/types/carbon-components-react/components/Select/Select.Skeleton.d.ts b/types/carbon-components-react/components/Select/Select.Skeleton.d.ts new file mode 100644 index 0000000000..4b25a487a1 --- /dev/null +++ b/types/carbon-components-react/components/Select/Select.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactLabelAttr["htmlFor"], +} + +export interface SelectSkeletonProps extends InheritedProps { + hideLabel?: boolean, +} + +declare const SelectSkeleton: React.FC; + +export default SelectSkeleton; diff --git a/types/carbon-components-react/components/Select/Select.d.ts b/types/carbon-components-react/components/Select/Select.d.ts new file mode 100644 index 0000000000..846ff7e863 --- /dev/null +++ b/types/carbon-components-react/components/Select/Select.d.ts @@ -0,0 +1,24 @@ +import * as React from "react"; +import { EmbeddedIconProps, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-invalid" | "id" | "ref"; +interface InheritedProps extends + Omit, ExcludedAttributes>, + EmbeddedIconProps, + RequiresIdProps, + ThemeProps, + ValidityProps +{ } + +export interface SelectProps extends InheritedProps { + defaultValue?: any, + helperText?: React.ReactNode, + hideLabel?: boolean, + inline?: boolean, + labelText?: React.ReactNode, + noLabel?: boolean, +} + +declare const Select: React.RefForwardingComponent; + +export default Select; diff --git a/types/carbon-components-react/components/Select/index.d.ts b/types/carbon-components-react/components/Select/index.d.ts new file mode 100644 index 0000000000..68f39be62e --- /dev/null +++ b/types/carbon-components-react/components/Select/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Select"; +export * from "./Select.Skeleton"; +export { default } from "./Select"; diff --git a/types/carbon-components-react/components/SelectItem/SelectItem.d.ts b/types/carbon-components-react/components/SelectItem/SelectItem.d.ts new file mode 100644 index 0000000000..ec2fe54d2c --- /dev/null +++ b/types/carbon-components-react/components/SelectItem/SelectItem.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; + +interface InheritedProps extends Omit, "value"> { + value: any, +} + +export interface SelectItemProps extends InheritedProps { + text: string, +} + +declare const SelectItem: React.FC; + +export default SelectItem; diff --git a/types/carbon-components-react/components/SelectItem/index.d.ts b/types/carbon-components-react/components/SelectItem/index.d.ts new file mode 100644 index 0000000000..60c8ea49d4 --- /dev/null +++ b/types/carbon-components-react/components/SelectItem/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SelectItem"; +export { default } from "./SelectItem"; diff --git a/types/carbon-components-react/components/SelectItemGroup/SelectItemGroup.d.ts b/types/carbon-components-react/components/SelectItemGroup/SelectItemGroup.d.ts new file mode 100644 index 0000000000..4d807873fe --- /dev/null +++ b/types/carbon-components-react/components/SelectItemGroup/SelectItemGroup.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; + +type ReactOptGroupAttr = React.OptgroupHTMLAttributes; + +interface InheritedProps extends Omit { + label: NonNullable, +} + +export interface SelectItemGroupProps extends InheritedProps { } + +declare const SelectItemGroup: React.FC; + +export default SelectItemGroup; diff --git a/types/carbon-components-react/components/SelectItemGroup/index.d.ts b/types/carbon-components-react/components/SelectItemGroup/index.d.ts new file mode 100644 index 0000000000..959e1835a0 --- /dev/null +++ b/types/carbon-components-react/components/SelectItemGroup/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SelectItemGroup"; +export { default } from "./SelectItemGroup"; diff --git a/types/carbon-components-react/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts b/types/carbon-components-react/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts new file mode 100644 index 0000000000..e3f492cd55 --- /dev/null +++ b/types/carbon-components-react/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface SkeletonPlaceholderProps extends InheritedProps { } + +declare const SkeletonPlaceholder: React.FC; + +export default SkeletonPlaceholder; diff --git a/types/carbon-components-react/components/SkeletonPlaceholder/index.d.ts b/types/carbon-components-react/components/SkeletonPlaceholder/index.d.ts new file mode 100644 index 0000000000..aa1edc41b9 --- /dev/null +++ b/types/carbon-components-react/components/SkeletonPlaceholder/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SkeletonPlaceholder"; +export { default } from "./SkeletonPlaceholder"; diff --git a/types/carbon-components-react/components/SkeletonText/SkeletonText.d.ts b/types/carbon-components-react/components/SkeletonText/SkeletonText.d.ts new file mode 100644 index 0000000000..8bcf039ac1 --- /dev/null +++ b/types/carbon-components-react/components/SkeletonText/SkeletonText.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface SkeletonTextProps extends InheritedProps { + heading?: boolean, + lineCount?: number, + paragraph?: boolean, + width?: string, +} + +declare const SkeletonText: React.FC; + +export default SkeletonText; diff --git a/types/carbon-components-react/components/SkeletonText/index.d.ts b/types/carbon-components-react/components/SkeletonText/index.d.ts new file mode 100644 index 0000000000..d17d58283e --- /dev/null +++ b/types/carbon-components-react/components/SkeletonText/index.d.ts @@ -0,0 +1,2 @@ +export * from "./SkeletonText"; +export { default } from "./SkeletonText"; diff --git a/types/carbon-components-react/components/Slider/Slider.Skeleton.d.ts b/types/carbon-components-react/components/Slider/Slider.Skeleton.d.ts new file mode 100644 index 0000000000..95e97fe372 --- /dev/null +++ b/types/carbon-components-react/components/Slider/Slider.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactAttr["id"], +} + +export interface SliderSkeletonProps extends InheritedProps { + hideLabel?: boolean, +} + +declare const SliderSkeleton: React.FC; + +export default SliderSkeleton; diff --git a/types/carbon-components-react/components/Slider/Slider.d.ts b/types/carbon-components-react/components/Slider/Slider.d.ts new file mode 100644 index 0000000000..82019166d1 --- /dev/null +++ b/types/carbon-components-react/components/Slider/Slider.d.ts @@ -0,0 +1,26 @@ +import * as React from "react"; +import { ReactDivAttr, ReactInputAttr, ThemeProps } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr, ThemeProps { + name?: ReactInputAttr["name"], +} + +export interface SliderProps extends InheritedProps { + ariaLabelInput?: string, + formatLabel?(value: SliderProps["value"], label: string): string, + hideTextInput?: boolean, + inputType?: ReactInputAttr["type"], + labelText?: React.ReactNode, + max: number, + maxLabel?: string, + min: number, + minLabel?: string, + onRelease?(data: { value: SliderProps["value"] }): void, + step?: number, + stepMuliplier?: number, // typo exists in source + value: number, +} + +declare class Slider extends React.PureComponent { } + +export default Slider; diff --git a/types/carbon-components-react/components/Slider/index.d.ts b/types/carbon-components-react/components/Slider/index.d.ts new file mode 100644 index 0000000000..16614d4151 --- /dev/null +++ b/types/carbon-components-react/components/Slider/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Slider"; +export * from "./Slider.Skeleton"; +export { default } from "./Slider"; diff --git a/types/carbon-components-react/components/StructuredList/StructuredList.Skeleton.d.ts b/types/carbon-components-react/components/StructuredList/StructuredList.Skeleton.d.ts new file mode 100644 index 0000000000..f30d591cab --- /dev/null +++ b/types/carbon-components-react/components/StructuredList/StructuredList.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; + +interface InheritedProps { } + +export interface StructuredListSkeletonProps extends InheritedProps { + border?: boolean, + rowCount?: number, +} + +declare const StructuredListSkeleton: React.FC; + +export default StructuredListSkeleton; diff --git a/types/carbon-components-react/components/StructuredList/StructuredList.d.ts b/types/carbon-components-react/components/StructuredList/StructuredList.d.ts new file mode 100644 index 0000000000..d945b824cb --- /dev/null +++ b/types/carbon-components-react/components/StructuredList/StructuredList.d.ts @@ -0,0 +1,72 @@ +import * as React from "react"; +import { ReactAttr, ReactDivAttr, ReactInputAttr, ReactLabelAttr } from "../../typings/shared"; + +// StructuredListWrapper + +interface StructureListWrapperInheritedProps extends Omit { + ariaLabel?: React.AriaAttributes["aria-label"], +} + +export interface StructuredListProps extends StructureListWrapperInheritedProps { + border?: boolean, + selection?: boolean, +} + +export declare class StructuredListWrapper extends React.Component { } + +// StructuredListHead + +interface StructuredListHeadInheritedProps extends ReactDivAttr { } + +export interface StructuredListHeadProps extends StructuredListHeadInheritedProps { } + +export declare class StructuredListHead extends React.Component { } + +// StructuredListInput + +interface StructuredListInputInheritedProps extends Omit { + value: string | number, +} + +export interface StructuredListInputProps extends StructuredListInputInheritedProps { + defaultChecked?: boolean, +} + +export declare class StructuredListInput extends React.Component { } + +// StructuredListRow + +interface StructuredListRowSharedProps { + head?: boolean, +} +interface StructuredListLabelRowInheritedProps extends Omit, StructuredListRowSharedProps { } +interface StructuredListDivRowInheritedProps extends ReactDivAttr, StructuredListRowSharedProps { } + +export interface StructuredListDivRowProps extends StructuredListDivRowInheritedProps { + label?: Exclude, +} +export interface StructuredListLabelRowProps extends StructuredListLabelRowInheritedProps { + label: true, +} + +export type AllStructuredListRowProps = StructuredListLabelRowProps | StructuredListDivRowProps; +export declare class StructuredListRow extends React.Component { } + +// StructuredListBody + +interface StructuredListBodyInheritedProps extends ReactDivAttr { } + +export interface StructuredListBodyProps extends StructuredListBodyInheritedProps { } + +export declare class StructuredListBody extends React.Component { } + +// StructuredListCell + +interface StructuredListCellInheritedProps extends ReactDivAttr { } + +export interface StructuredListCellProps extends StructuredListCellInheritedProps { + head?: boolean, + noWrap?: boolean, +} + +export declare class StructuredListCell extends React.Component { } diff --git a/types/carbon-components-react/components/StructuredList/index.d.ts b/types/carbon-components-react/components/StructuredList/index.d.ts new file mode 100644 index 0000000000..18faa9d22b --- /dev/null +++ b/types/carbon-components-react/components/StructuredList/index.d.ts @@ -0,0 +1,2 @@ +export * from "./StructuredList"; +export * from "./StructuredList.Skeleton"; diff --git a/types/carbon-components-react/components/Switch/Switch.d.ts b/types/carbon-components-react/components/Switch/Switch.d.ts new file mode 100644 index 0000000000..4f9a46772d --- /dev/null +++ b/types/carbon-components-react/components/Switch/Switch.d.ts @@ -0,0 +1,3 @@ +import { Switch } from "../ContentSwitcher"; + +export default Switch; diff --git a/types/carbon-components-react/components/Switch/index.d.ts b/types/carbon-components-react/components/Switch/index.d.ts new file mode 100644 index 0000000000..6ecf348c38 --- /dev/null +++ b/types/carbon-components-react/components/Switch/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Switch"; +export { default } from "./Switch"; diff --git a/types/carbon-components-react/components/Tab/Tab.d.ts b/types/carbon-components-react/components/Tab/Tab.d.ts new file mode 100644 index 0000000000..d4c359d4ec --- /dev/null +++ b/types/carbon-components-react/components/Tab/Tab.d.ts @@ -0,0 +1,31 @@ +import * as React from "react"; +import { ReactAnchorAttr, ReactAttr, ReactLIAttr } from "../../typings/shared"; + +type ExcludedAttributes = "role" | "tabIndex"; +interface InheritedProps extends Omit { + href: NonNullable, + tabIndex: NonNullable, +} + +export interface TabCustomAnchorProvidedProps { + "aria-selected": boolean, + className: NonNullable, + href: InheritedProps["href"], + role: "tab", + tabIndex: NonNullable, +} + +export interface TabProps extends InheritedProps { + handleTabAnchorFocus(index: TabProps["index"]): void, + handleTabClick(index: TabProps["index"], label: TabProps["label"], event: React.MouseEvent): void, + handleTabKeyDown(index: TabProps["index"], label: TabProps["label"], event: React.KeyboardEvent): void, + index?: number, + label?: React.ReactNode, + renderAnchor?: React.FC, + role?: string, // marked as required, but render code overwrites it currently + selected?: boolean, // required but has default value +} + +declare class Tab extends React.Component { } + +export default Tab; diff --git a/types/carbon-components-react/components/Tab/index.d.ts b/types/carbon-components-react/components/Tab/index.d.ts new file mode 100644 index 0000000000..b18836935f --- /dev/null +++ b/types/carbon-components-react/components/Tab/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Tab"; +export { default } from "./Tab"; diff --git a/types/carbon-components-react/components/TabContent/TabContent.d.ts b/types/carbon-components-react/components/TabContent/TabContent.d.ts new file mode 100644 index 0000000000..e706295551 --- /dev/null +++ b/types/carbon-components-react/components/TabContent/TabContent.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface TabContentProps extends InheritedProps { + selected?: boolean, +} + +declare const TabContent: React.FC; + +export default TabContent; diff --git a/types/carbon-components-react/components/TabContent/index.d.ts b/types/carbon-components-react/components/TabContent/index.d.ts new file mode 100644 index 0000000000..eef6a328b9 --- /dev/null +++ b/types/carbon-components-react/components/TabContent/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TabContent"; +export { default } from "./TabContent"; diff --git a/types/carbon-components-react/components/Tabs/Tabs.Skeleton.d.ts b/types/carbon-components-react/components/Tabs/Tabs.Skeleton.d.ts new file mode 100644 index 0000000000..9546c32c05 --- /dev/null +++ b/types/carbon-components-react/components/Tabs/Tabs.Skeleton.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface TabsSkeletonProps { } + +declare class TabsSkeleton extends React.Component { } + +export default TabsSkeleton; diff --git a/types/carbon-components-react/components/Tabs/Tabs.d.ts b/types/carbon-components-react/components/Tabs/Tabs.d.ts new file mode 100644 index 0000000000..a49b4aff0a --- /dev/null +++ b/types/carbon-components-react/components/Tabs/Tabs.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactAttr, ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr, EmbeddedIconProps { + ariaLabel?: React.AriaAttributes["aria-label"], +} + +export interface TabsProps extends InheritedProps { + onSelectionChange?(index: number): void, + selected?: number, + tabContentClassName?: ReactAttr["className"], + triggerHref: string, +} + +declare class Tabs extends React.Component { } + +export default Tabs; diff --git a/types/carbon-components-react/components/Tabs/index.d.ts b/types/carbon-components-react/components/Tabs/index.d.ts new file mode 100644 index 0000000000..dc565e7631 --- /dev/null +++ b/types/carbon-components-react/components/Tabs/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Tabs"; +export * from "./Tabs.Skeleton"; +export { default } from "./Tabs"; diff --git a/types/carbon-components-react/components/Tag/Tag.Skeleton.d.ts b/types/carbon-components-react/components/Tag/Tag.Skeleton.d.ts new file mode 100644 index 0000000000..a12ae57e11 --- /dev/null +++ b/types/carbon-components-react/components/Tag/Tag.Skeleton.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; + +export interface TagSkeletonProps { } + +declare class TagSkeleton extends React.Component { } + +export default TagSkeleton; diff --git a/types/carbon-components-react/components/Tag/Tag.d.ts b/types/carbon-components-react/components/Tag/Tag.d.ts new file mode 100644 index 0000000000..dd026e0f35 --- /dev/null +++ b/types/carbon-components-react/components/Tag/Tag.d.ts @@ -0,0 +1,26 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export type TagTypeName = + "red" + | "magenta" + | "purple" + | "blue" + | "cyan" + | "teal" + | "green" + | "gray" + | "cool-gray" + | "warm-gray"; + +export declare const types: TagTypeName[]; + +export interface TagProps extends InheritedProps { + type: TagTypeName, +} + +declare const Tag: React.FC; + +export default Tag; diff --git a/types/carbon-components-react/components/Tag/index.d.ts b/types/carbon-components-react/components/Tag/index.d.ts new file mode 100644 index 0000000000..f201f5f5c0 --- /dev/null +++ b/types/carbon-components-react/components/Tag/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Tag"; +export * from "./Tag.Skeleton"; +export { default } from "./Tag"; diff --git a/types/carbon-components-react/components/TextArea/TextArea.Skeleton.d.ts b/types/carbon-components-react/components/TextArea/TextArea.Skeleton.d.ts new file mode 100644 index 0000000000..98e281252e --- /dev/null +++ b/types/carbon-components-react/components/TextArea/TextArea.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactLabelAttr["htmlFor"], +} + +export interface TextAreaSkeletonProps extends InheritedProps { + hideLabel?: boolean, +} + +declare const TextAreaSkeleton: React.FC; + +export default TextAreaSkeleton; diff --git a/types/carbon-components-react/components/TextArea/TextArea.d.ts b/types/carbon-components-react/components/TextArea/TextArea.d.ts new file mode 100644 index 0000000000..ea124821ab --- /dev/null +++ b/types/carbon-components-react/components/TextArea/TextArea.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { ThemeProps, ValidityProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-invalid" | "aria-describedby" | "defaultValue" | "value"; +interface InheritedProps extends + Omit, ExcludedAttributes>, + ThemeProps, + ValidityProps +{ } + +export interface TextAreaProps extends InheritedProps { + defaultValue?: string | number, + helperText?: React.ReactNode, + hideLabel?: boolean, + labelText: React.ReactNode, + value?: string | number, +} + +declare const TextArea: React.RefForwardingComponent; + +export default TextArea; diff --git a/types/carbon-components-react/components/TextArea/index.d.ts b/types/carbon-components-react/components/TextArea/index.d.ts new file mode 100644 index 0000000000..9659acb943 --- /dev/null +++ b/types/carbon-components-react/components/TextArea/index.d.ts @@ -0,0 +1,3 @@ +export * from "./TextArea"; +export * from "./TextArea.Skeleton"; +export { default } from "./TextArea"; diff --git a/types/carbon-components-react/components/TextInput/ControlledPasswordInput.d.ts b/types/carbon-components-react/components/TextInput/ControlledPasswordInput.d.ts new file mode 100644 index 0000000000..82e5829992 --- /dev/null +++ b/types/carbon-components-react/components/TextInput/ControlledPasswordInput.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +import { EmbeddedTooltipProps } from "../../typings/shared"; +import { TextInputInheritedProps } from "./props"; + +interface InheritedProps extends TextInputInheritedProps, EmbeddedTooltipProps { } + +export interface ControlledPasswordInputProps extends InheritedProps { } + +declare const ControlledPasswordInput: React.RefForwardingComponent; + +export default ControlledPasswordInput; diff --git a/types/carbon-components-react/components/TextInput/PasswordInput.d.ts b/types/carbon-components-react/components/TextInput/PasswordInput.d.ts new file mode 100644 index 0000000000..441624f675 --- /dev/null +++ b/types/carbon-components-react/components/TextInput/PasswordInput.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +import { EmbeddedTooltipProps } from "../../typings/shared"; +import { TextInputInheritedProps } from "./props"; + +interface InheritedProps extends TextInputInheritedProps, EmbeddedTooltipProps { } + +export interface PasswordInputProps extends InheritedProps { } + +declare const PasswordInput: React.FC; + +export default PasswordInput; diff --git a/types/carbon-components-react/components/TextInput/TextInput.Skeleton.d.ts b/types/carbon-components-react/components/TextInput/TextInput.Skeleton.d.ts new file mode 100644 index 0000000000..8f617531f6 --- /dev/null +++ b/types/carbon-components-react/components/TextInput/TextInput.Skeleton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactLabelAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactLabelAttr["htmlFor"], +} + +export interface TextInputSkeletonProps extends InheritedProps { + hideLabel?: boolean, +} + +declare const TextInputSkeleton: React.FC; + +export default TextInputSkeleton; diff --git a/types/carbon-components-react/components/TextInput/TextInput.d.ts b/types/carbon-components-react/components/TextInput/TextInput.d.ts new file mode 100644 index 0000000000..c2cbc840c1 --- /dev/null +++ b/types/carbon-components-react/components/TextInput/TextInput.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import ControlledPasswordInput from "./ControlledPasswordInput"; +import PasswordInput from "./PasswordInput"; +import { TextInputInheritedProps } from "./props"; + +export interface TextInputProps extends TextInputInheritedProps { } + +interface TextInputFC extends React.RefForwardingComponent { + readonly ControlledPasswordInput: typeof ControlledPasswordInput, + readonly PasswordInput: typeof PasswordInput, +} + +declare const TextInput: TextInputFC; + +export default TextInput; diff --git a/types/carbon-components-react/components/TextInput/index.d.ts b/types/carbon-components-react/components/TextInput/index.d.ts new file mode 100644 index 0000000000..ce37378b78 --- /dev/null +++ b/types/carbon-components-react/components/TextInput/index.d.ts @@ -0,0 +1,14 @@ +import ControlledPasswordInput from "./ControlledPasswordInput"; +import PasswordInput from "./PasswordInput"; + +export * from "./TextInput"; +export * from "./TextInput.Skeleton"; +export * from "./ControlledPasswordInput"; +export * from "./PasswordInput"; + +export { + ControlledPasswordInput, + PasswordInput +}; + +export { default } from "./TextInput"; diff --git a/types/carbon-components-react/components/TextInput/props.d.ts b/types/carbon-components-react/components/TextInput/props.d.ts new file mode 100644 index 0000000000..65b6c2180d --- /dev/null +++ b/types/carbon-components-react/components/TextInput/props.d.ts @@ -0,0 +1,16 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-describedby" | "aria-invalid" | "defaultValue" | "id" | "value"; +export interface TextInputInheritedProps extends + Omit, + RequiresIdProps, + ThemeProps, + ValidityProps +{ + defaultValue?: TextInputInheritedProps["value"], + helperText?: React.ReactNode, + hideLabel?: boolean, + labelText: NonNullable, + value?: string | number, +} diff --git a/types/carbon-components-react/components/Tile/Tile.d.ts b/types/carbon-components-react/components/Tile/Tile.d.ts new file mode 100644 index 0000000000..8d42c7a3ef --- /dev/null +++ b/types/carbon-components-react/components/Tile/Tile.d.ts @@ -0,0 +1,61 @@ +import * as React from "react"; +import { EmbeddedIconProps, ReactAnchorAttr, ReactDivAttr, ReactInputAttr, ReactLabelAttr } from "../../typings/shared"; + +// Tile + +interface TileInheritedProps extends ReactDivAttr { } + +export interface TileProps extends TileInheritedProps { } + +export declare class Tile extends React.Component { } + +// ClickableTile + +interface ClickableTileInheritedProps extends ReactAnchorAttr { } + +export interface ClickableTileProps extends ClickableTileInheritedProps { } + +export declare class ClickableTile extends React.Component { } + +// SelectableTile + +type SelectedTileExcludedAttributes = "onChange" | "onClick" | "onKeyDown"; +interface SelectableTileInheritedProps extends + Omit, + EmbeddedIconProps +{ + onChange?: ReactInputAttr["onChange"], +} + +export interface SelectableTileProps extends SelectableTileInheritedProps { + handleClick?(e: React.MouseEvent): void, + handleKeyDown?(e: React.KeyboardEvent): void, + value: string | number, +} + +export declare class SelectableTile extends React.Component { } + +// ExpandableTile + +interface ExpandableTileInheritedProps extends Omit { } + +export interface ExpandableTileProps extends ExpandableTileInheritedProps { + expanded?: boolean, + handleClick?(e: React.MouseEvent): void, + tileCollapsedIconText?: string, + tileExpandedIconText?: string, +} + +export declare class ExpandableTile extends React.Component { } + +// TileAboveTheFoldContent + +export interface TileAboveTheFoldContentProps { } + +export declare class TileAboveTheFoldContent extends React.Component { } + +// TileBelowTheFoldContent + +export interface TileBelowTheFoldContentProps { } + +export declare class TileBelowTheFoldContent extends React.Component { } diff --git a/types/carbon-components-react/components/Tile/index.d.ts b/types/carbon-components-react/components/Tile/index.d.ts new file mode 100644 index 0000000000..fc09f5624a --- /dev/null +++ b/types/carbon-components-react/components/Tile/index.d.ts @@ -0,0 +1 @@ +export * from "./Tile"; diff --git a/types/carbon-components-react/components/TileGroup/TileGroup.d.ts b/types/carbon-components-react/components/TileGroup/TileGroup.d.ts new file mode 100644 index 0000000000..10f8f57f14 --- /dev/null +++ b/types/carbon-components-react/components/TileGroup/TileGroup.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +import { ReactAttr, ReactInputAttr } from "../../typings/shared"; +import { RadioTileChangeEvent } from "../RadioTile"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], + disabled?: ReactInputAttr["disabled"], + name: NonNullable, +} + +export interface TileGroupProps extends InheritedProps { + defaultSelected?: TileGroupProps["valueSelected"], + legend?: string, + onChange?(value: TileGroupProps["valueSelected"], name: TileGroupProps["name"], event: RadioTileChangeEvent): void, + valueSelected?: string | number, +} + +declare class TileGroup extends React.Component { } + +export default TileGroup; diff --git a/types/carbon-components-react/components/TileGroup/index.d.ts b/types/carbon-components-react/components/TileGroup/index.d.ts new file mode 100644 index 0000000000..770f52905d --- /dev/null +++ b/types/carbon-components-react/components/TileGroup/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TileGroup"; +export { default } from "./TileGroup"; diff --git a/types/carbon-components-react/components/TimePicker/TimePicker.d.ts b/types/carbon-components-react/components/TimePicker/TimePicker.d.ts new file mode 100644 index 0000000000..eac4549d57 --- /dev/null +++ b/types/carbon-components-react/components/TimePicker/TimePicker.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps, ThemeProps, ValidityProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + RequiresIdProps, + ThemeProps, + ValidityProps +{ } + +export interface TimePickerProps extends InheritedProps { + hideLabel?: boolean, + labelText?: React.ReactNode, +} + +declare class TimePicker extends React.Component { } + +export default TimePicker; diff --git a/types/carbon-components-react/components/TimePicker/index.d.ts b/types/carbon-components-react/components/TimePicker/index.d.ts new file mode 100644 index 0000000000..3dceaa2e83 --- /dev/null +++ b/types/carbon-components-react/components/TimePicker/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TimePicker"; +export { default } from "./TimePicker"; diff --git a/types/carbon-components-react/components/TimePickerSelect/TimePickerSelect.d.ts b/types/carbon-components-react/components/TimePickerSelect/TimePickerSelect.d.ts new file mode 100644 index 0000000000..9b298334a2 --- /dev/null +++ b/types/carbon-components-react/components/TimePickerSelect/TimePickerSelect.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { EmbeddedIconProps, RequiresIdProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, "id">, + EmbeddedIconProps, + RequiresIdProps +{ } + +export interface TimePickerSelectProps extends InheritedProps { + inline?: boolean, + labelText: NonNullable, +} + +declare class TimePickerSelect extends React.Component { } + +export default TimePickerSelect; diff --git a/types/carbon-components-react/components/TimePickerSelect/index.d.ts b/types/carbon-components-react/components/TimePickerSelect/index.d.ts new file mode 100644 index 0000000000..d533bcc682 --- /dev/null +++ b/types/carbon-components-react/components/TimePickerSelect/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TimePickerSelect"; +export { default } from "./TimePickerSelect"; diff --git a/types/carbon-components-react/components/Toggle/Toggle.Skeleton.d.ts b/types/carbon-components-react/components/Toggle/Toggle.Skeleton.d.ts new file mode 100644 index 0000000000..0f3d3cb83e --- /dev/null +++ b/types/carbon-components-react/components/Toggle/Toggle.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactAttr["id"], +} + +export interface ToggleSkeletonProps extends InheritedProps { } + +declare class ToggleSkeleton extends React.Component { } + +export default ToggleSkeleton; diff --git a/types/carbon-components-react/components/Toggle/Toggle.d.ts b/types/carbon-components-react/components/Toggle/Toggle.d.ts new file mode 100644 index 0000000000..cf5e287b4e --- /dev/null +++ b/types/carbon-components-react/components/Toggle/Toggle.d.ts @@ -0,0 +1,22 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-labelledby" | "id" | "onChange" | "onKeyUp" | "type"; +interface InheritedProps extends + Omit, + RequiresIdProps +{ } + +export interface ToggleProps extends InheritedProps { + defaultToggled?: boolean, + labelA?: string, // required but has default value + labelB?: string, // required but has default value + labelText?: string, + onChange?(event: React.ChangeEvent | React.KeyboardEvent): void, + onToggle?(checked: boolean, id: ToggleProps["id"], event: React.ChangeEvent | React.KeyboardEvent): void, + toggled?: boolean, +} + +declare class Toggle extends React.Component { } + +export default Toggle; diff --git a/types/carbon-components-react/components/Toggle/index.d.ts b/types/carbon-components-react/components/Toggle/index.d.ts new file mode 100644 index 0000000000..f9855505cd --- /dev/null +++ b/types/carbon-components-react/components/Toggle/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Toggle"; +export * from "./Toggle.Skeleton"; +export { default } from "./Toggle"; diff --git a/types/carbon-components-react/components/ToggleSmall/ToggleSmall.Skeleton.d.ts b/types/carbon-components-react/components/ToggleSmall/ToggleSmall.Skeleton.d.ts new file mode 100644 index 0000000000..606b2d2a67 --- /dev/null +++ b/types/carbon-components-react/components/ToggleSmall/ToggleSmall.Skeleton.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + id?: ReactAttr["id"], +} + +export interface ToggleSmallSkeletonProps extends InheritedProps { } + +declare class ToggleSmallSkeleton extends React.Component { } + +export default ToggleSmallSkeleton; diff --git a/types/carbon-components-react/components/ToggleSmall/ToggleSmall.d.ts b/types/carbon-components-react/components/ToggleSmall/ToggleSmall.d.ts new file mode 100644 index 0000000000..ba7e10270b --- /dev/null +++ b/types/carbon-components-react/components/ToggleSmall/ToggleSmall.d.ts @@ -0,0 +1,23 @@ +import * as React from "react"; +import { ReactInputAttr, RequiresIdProps } from "../../typings/shared"; + +type ExcludedAttributes = "aria-label" | "id" | "type"; +interface InheritedProps extends + Omit, + RequiresIdProps +{ + ariaLabel: NonNullable, +} + +export interface ToggleSmallProps extends InheritedProps { + defaultToggled?: boolean, + labelA?: string, // required but has default value + labelB?: string, // required but has default value + labelText?: string, + onToggle?(checked: boolean, id: ToggleSmallProps["id"], event: React.ChangeEvent | React.KeyboardEvent): void, + toggled?: boolean, +} + +declare const ToggleSmall: React.FC; + +export default ToggleSmall; diff --git a/types/carbon-components-react/components/ToggleSmall/index.d.ts b/types/carbon-components-react/components/ToggleSmall/index.d.ts new file mode 100644 index 0000000000..7852474beb --- /dev/null +++ b/types/carbon-components-react/components/ToggleSmall/index.d.ts @@ -0,0 +1,3 @@ +export * from "./ToggleSmall"; +export * from "./ToggleSmall.Skeleton"; +export { default } from "./ToggleSmall"; diff --git a/types/carbon-components-react/components/Toolbar/Toolbar.d.ts b/types/carbon-components-react/components/Toolbar/Toolbar.d.ts new file mode 100644 index 0000000000..76447ec983 --- /dev/null +++ b/types/carbon-components-react/components/Toolbar/Toolbar.d.ts @@ -0,0 +1,47 @@ +import * as React from "react"; +import { ReactAttr, ReactDivAttr } from "../../typings/shared"; + +// Toolbar + +interface ToolbarInheritedProps extends ReactDivAttr { } + +export interface ToolbarProps extends ToolbarInheritedProps { } + +declare const Toolbar: React.FC; + +// ToolbarItem + +interface ToolbarItemInheritedProps { + children?: ReactAttr["children"], +} + +export interface ToolbarItemProps extends ToolbarItemInheritedProps { + placeholderText?: string, + type?: string, +} + +export declare const ToolbarItem: React.FC; + +// ToolbarTitle + +export interface ToolbarTitleProps { + title?: string, +} + +export declare const ToolbarTitle: React.RefForwardingComponent; + +// ToolbarOption + +interface ToolbarOptionInheritedProps { + children?: ReactAttr["children"], +} + +export interface ToolbarOptionProps extends ToolbarOptionInheritedProps { } + +export declare const ToolbarOption: React.RefForwardingComponent; + +// ToolbarDivider + +export declare const ToolbarDivider: React.RefForwardingComponent; + +export default Toolbar; diff --git a/types/carbon-components-react/components/Toolbar/index.d.ts b/types/carbon-components-react/components/Toolbar/index.d.ts new file mode 100644 index 0000000000..c94af524e2 --- /dev/null +++ b/types/carbon-components-react/components/Toolbar/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Toolbar"; +export { default } from "./Toolbar"; diff --git a/types/carbon-components-react/components/ToolbarSearch/ToolbarSearch.d.ts b/types/carbon-components-react/components/ToolbarSearch/ToolbarSearch.d.ts new file mode 100644 index 0000000000..bf0f63a2d4 --- /dev/null +++ b/types/carbon-components-react/components/ToolbarSearch/ToolbarSearch.d.ts @@ -0,0 +1,16 @@ +import * as React from "react"; +import { ReactInputAttr, SizingProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + SizingProps +{ } + +export interface ToolbarSearchProps extends InheritedProps { + labelText?: React.ReactNode, + placeHolderText?: string, +} + +declare class ToolbarSearch extends React.Component { } + +export default ToolbarSearch; diff --git a/types/carbon-components-react/components/ToolbarSearch/index.d.ts b/types/carbon-components-react/components/ToolbarSearch/index.d.ts new file mode 100644 index 0000000000..46b36fb628 --- /dev/null +++ b/types/carbon-components-react/components/ToolbarSearch/index.d.ts @@ -0,0 +1,2 @@ +export * from "./ToolbarSearch"; +export { default } from "./ToolbarSearch"; diff --git a/types/carbon-components-react/components/Tooltip/Tooltip.d.ts b/types/carbon-components-react/components/Tooltip/Tooltip.d.ts new file mode 100644 index 0000000000..3c3223fdc8 --- /dev/null +++ b/types/carbon-components-react/components/Tooltip/Tooltip.d.ts @@ -0,0 +1,24 @@ +import * as React from "react"; +import { Direction, EmbeddedIconProps, MenuOffsetData, ReactDivAttr } from "../../typings/shared"; + +type ExcludedAttributes = "aria-labelledby" | "onBlur" | "onContextMenu" | "onFocus" | "onMouseOut" | "onMouseOver" | "role"; +interface InheritedProps extends + Omit, + EmbeddedIconProps +{ } + +export interface TooltipProps extends InheritedProps { + direction?: Direction, + iconDescription?: string, + iconName?: string, + menuOffset?: MenuOffsetData | ((menuBody: HTMLElement, menuDirection: TooltipProps["direction"]) => Required | undefined) + open?: boolean, + renderIcon?: React.RefForwardingComponent, + showIcon?: boolean, + triggerClassName?: string, + triggerText?: React.ReactNode, +} + +declare const Tooltip: React.RefForwardingComponent; + +export default Tooltip; diff --git a/types/carbon-components-react/components/Tooltip/index.d.ts b/types/carbon-components-react/components/Tooltip/index.d.ts new file mode 100644 index 0000000000..9474b38884 --- /dev/null +++ b/types/carbon-components-react/components/Tooltip/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Tooltip"; +export { default } from "./Tooltip"; diff --git a/types/carbon-components-react/components/TooltipDefinition/TooltipDefinition.d.ts b/types/carbon-components-react/components/TooltipDefinition/TooltipDefinition.d.ts new file mode 100644 index 0000000000..db2559ed26 --- /dev/null +++ b/types/carbon-components-react/components/TooltipDefinition/TooltipDefinition.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { Direction, ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface TooltipDefinitionProps extends InheritedProps { + direction?: Extract, // required but has default value + tooltipText: NonNullable, +} + +declare const TooltipDefinition: React.FC; + +export default TooltipDefinition; diff --git a/types/carbon-components-react/components/TooltipDefinition/index.d.ts b/types/carbon-components-react/components/TooltipDefinition/index.d.ts new file mode 100644 index 0000000000..b6eb528cb8 --- /dev/null +++ b/types/carbon-components-react/components/TooltipDefinition/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TooltipDefinition"; +export { default } from "./TooltipDefinition"; diff --git a/types/carbon-components-react/components/TooltipIcon/TooltipIcon.d.ts b/types/carbon-components-react/components/TooltipIcon/TooltipIcon.d.ts new file mode 100644 index 0000000000..074582cb2b --- /dev/null +++ b/types/carbon-components-react/components/TooltipIcon/TooltipIcon.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { Direction, ReactDivAttr, RequiresChildrenProps, TooltipAlignment } from "../../typings/shared"; + +interface InheritedProps extends + Omit, + RequiresChildrenProps +{ } + +export interface TooltipIconProps extends InheritedProps { + align?: TooltipAlignment, + direction?: Extract, // required but has default value + tooltipText: string, +} + +declare const TooltipIcon: React.FC; + +export default TooltipIcon; diff --git a/types/carbon-components-react/components/TooltipIcon/index.d.ts b/types/carbon-components-react/components/TooltipIcon/index.d.ts new file mode 100644 index 0000000000..5ef37d5e30 --- /dev/null +++ b/types/carbon-components-react/components/TooltipIcon/index.d.ts @@ -0,0 +1,2 @@ +export * from "./TooltipIcon"; +export { default } from "./TooltipIcon"; diff --git a/types/carbon-components-react/components/UIShell/Content.d.ts b/types/carbon-components-react/components/UIShell/Content.d.ts new file mode 100644 index 0000000000..5744a88c96 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/Content.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { ReactAttr, ReactCreateElementParam } from "../../typings/shared"; + +interface InheritedProps { + className?: ReactAttr["className"], + children?: ReactAttr["children"], +} + +export interface ContentPropsBase extends InheritedProps { + tagName?: ReactCreateElementParam, +} + +export type ContentProps = E & ContentPropsBase; + +declare function Content(props: React.PropsWithChildren>): React.ReactElement | null; + +export default Content; diff --git a/types/carbon-components-react/components/UIShell/Header.d.ts b/types/carbon-components-react/components/UIShell/Header.d.ts new file mode 100644 index 0000000000..6d1f1fc722 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/Header.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface HeaderProps extends InheritedProps { } + +declare const Header: React.FC; + +export default Header; diff --git a/types/carbon-components-react/components/UIShell/HeaderContainer.d.ts b/types/carbon-components-react/components/UIShell/HeaderContainer.d.ts new file mode 100644 index 0000000000..d74435286d --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderContainer.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; + +interface InheritedProps { } + +export interface HeaderContainerProps extends InheritedProps { + isSideNavExpanded?: boolean, + render: React.ComponentType, +} + +declare const HeaderContainer: React.FC; + +export default HeaderContainer; diff --git a/types/carbon-components-react/components/UIShell/HeaderGlobalAction.d.ts b/types/carbon-components-react/components/UIShell/HeaderGlobalAction.d.ts new file mode 100644 index 0000000000..c3bcfe5708 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderGlobalAction.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactButtonAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { } + +export interface HeaderGlobalActionProps extends InheritedProps { + isActive?: boolean, +} + +declare const HeaderGlobalAction: React.FC; + +export default HeaderGlobalAction; diff --git a/types/carbon-components-react/components/UIShell/HeaderGlobalBar.d.ts b/types/carbon-components-react/components/UIShell/HeaderGlobalBar.d.ts new file mode 100644 index 0000000000..84f9f613ba --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderGlobalBar.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface HeaderGlobalBarProps extends InheritedProps { } + +declare const HeaderGlobalBar: React.FC; + +export default HeaderGlobalBar; diff --git a/types/carbon-components-react/components/UIShell/HeaderMenu.d.ts b/types/carbon-components-react/components/UIShell/HeaderMenu.d.ts new file mode 100644 index 0000000000..f771a326ba --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderMenu.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + "aria-label"?: ReactAttr["aria-label"], + "aria-labelledby"?: ReactAttr["aria-labelledby"], + children?: ReactAttr["children"], + className?: ReactAttr["className"], + tabIndex?: ReactAttr["tabIndex"], +} + +export interface HeaderMenuProps extends InheritedProps { + menuLinkName: string, + renderMenuContent?: React.FC, +} + +declare const HeaderMenu: React.RefForwardingComponent; + +export default HeaderMenu; diff --git a/types/carbon-components-react/components/UIShell/HeaderMenuButton.d.ts b/types/carbon-components-react/components/UIShell/HeaderMenuButton.d.ts new file mode 100644 index 0000000000..a4a2da9604 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderMenuButton.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactButtonAttr } from "../../typings/shared"; + +type ExcludedAttributes = "title" | "type"; +interface InheritedProps extends Omit { } + +export interface HeaderMenuButtonProps extends InheritedProps { + isActive?: boolean, + isCollapsible?: boolean, +} + +declare const HeaderMenuButton: React.FC; + +export default HeaderMenuButton; diff --git a/types/carbon-components-react/components/UIShell/HeaderMenuItem.d.ts b/types/carbon-components-react/components/UIShell/HeaderMenuItem.d.ts new file mode 100644 index 0000000000..298e948d38 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderMenuItem.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAnchorAttr, RequiresChildrenProps } from "../../typings/shared"; +import { LinkProps } from "./Link"; + +type ExcludedAttributes = "children" | "ref" | "tabIndex"; +interface InheritedProps extends RequiresChildrenProps { } + +export interface HeaderMenuItemPropsBase extends InheritedProps { } + +export type HeaderMenuItemProps = Omit, ExcludedAttributes> & HeaderMenuItemPropsBase; + +declare function HeaderMenuItem(props: React.PropsWithChildren>, ref: React.Ref): React.ReactElement | null; + +export default HeaderMenuItem; diff --git a/types/carbon-components-react/components/UIShell/HeaderName.d.ts b/types/carbon-components-react/components/UIShell/HeaderName.d.ts new file mode 100644 index 0000000000..fb8ebb6144 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderName.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactAnchorAttr, ReactAttr, RequiresChildrenProps } from "../../typings/shared"; +import { LinkProps } from "./Link"; + +interface InheritedProps extends RequiresChildrenProps { + className?: ReactAttr["className"], + href?: ReactAnchorAttr["href"], +} + +export interface HeaderNamePropsBase extends InheritedProps { + prefix?: string, +} + +export type HeaderNameProps = LinkProps & HeaderNamePropsBase; + +declare function HeaderName(props: React.PropsWithChildren>): React.ReactElement | null; + +export default HeaderName; diff --git a/types/carbon-components-react/components/UIShell/HeaderNavigation.d.ts b/types/carbon-components-react/components/UIShell/HeaderNavigation.d.ts new file mode 100644 index 0000000000..85853d61e2 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderNavigation.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface HeaderNavigationProps extends InheritedProps { } + +declare class HeaderNavigation extends React.Component { } + +export default HeaderNavigation; diff --git a/types/carbon-components-react/components/UIShell/HeaderPanel.d.ts b/types/carbon-components-react/components/UIShell/HeaderPanel.d.ts new file mode 100644 index 0000000000..fc7c67b152 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderPanel.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactDivAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactDivAttr { } + +export interface HeaderPanelProps extends InheritedProps { + expanded?: boolean, +} + +declare const HeaderPanel: React.FC; + +export default HeaderPanel; diff --git a/types/carbon-components-react/components/UIShell/HeaderSideNavItems.d.ts b/types/carbon-components-react/components/UIShell/HeaderSideNavItems.d.ts new file mode 100644 index 0000000000..62be412183 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/HeaderSideNavItems.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], +} + +export interface HeaderSideNavItemsProps extends InheritedProps { + hasDivider?: boolean, +} + +declare const HeaderSideNavItems: React.FC; + +export default HeaderSideNavItems; diff --git a/types/carbon-components-react/components/UIShell/Link.d.ts b/types/carbon-components-react/components/UIShell/Link.d.ts new file mode 100644 index 0000000000..afcba8f827 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/Link.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAnchorAttr, ShapeOf } from "../../typings/shared"; + +export interface LinkPropsBase { + element?: string, // required but has default value +} + +export type LinkProps = ShapeOf; + +declare function Link(props: React.PropsWithChildren>, ref: React.Ref): React.ReactElement; + +export default Link; diff --git a/types/carbon-components-react/components/UIShell/SideNav.d.ts b/types/carbon-components-react/components/UIShell/SideNav.d.ts new file mode 100644 index 0000000000..ed08fe30e0 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNav.d.ts @@ -0,0 +1,23 @@ +import * as React from "react"; +import { InternationalProps, ReactAttr } from "../../typings/shared"; + +export type SideNavTranslationKey = "carbon.sidenav.state.closed" | "carbon.sidenav.state.open"; +interface InheritedProps extends InternationalProps { + "aria-label"?: ReactAttr["aria-label"], + "aria-labelledby"?: ReactAttr["aria-labelledby"], + className?: ReactAttr["className"], +} + +export interface SideNavProps extends InheritedProps { + defaultExpanded?: boolean, + expanded?: boolean, + isChildOfHeader?: boolean, + isFixedNav?: boolean, + isPersistent?: boolean, + isRail?: boolean, + onToggle?(event: React.FocusEvent, focus: boolean): void, +} + +declare const SideNav: React.RefForwardingComponent; + +export default SideNav; diff --git a/types/carbon-components-react/components/UIShell/SideNavDetails.d.ts b/types/carbon-components-react/components/UIShell/SideNavDetails.d.ts new file mode 100644 index 0000000000..985283cfbd --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavDetails.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + children?: ReactAttr["children"] + className?: ReactAttr["className"], + title: NonNullable, +} + +export interface SideNavDetailsProps extends InheritedProps { } + +declare const SideNavDetails: React.FC; + +export default SideNavDetails; diff --git a/types/carbon-components-react/components/UIShell/SideNavFooter.d.ts b/types/carbon-components-react/components/UIShell/SideNavFooter.d.ts new file mode 100644 index 0000000000..797ca9d1c9 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavFooter.d.ts @@ -0,0 +1,16 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + className?: ReactAttr["className"], +} + +export interface SideNavFooterProps extends InheritedProps { + assistiveText?: string, // required but has default value + expanded: boolean, + onToggle(event: React.MouseEvent): void, +} + +declare const SideNavFooter: React.FC; + +export default SideNavFooter; diff --git a/types/carbon-components-react/components/UIShell/SideNavHeader.d.ts b/types/carbon-components-react/components/UIShell/SideNavHeader.d.ts new file mode 100644 index 0000000000..3386748046 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavHeader.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr, RenderIconProps } from "../../typings/shared"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], + renderIcon: NonNullable, +} + +export interface SideNavHeaderProps extends InheritedProps { } + +declare const SideNavHeader: React.FC; + +export default SideNavHeader; diff --git a/types/carbon-components-react/components/UIShell/SideNavIcon.d.ts b/types/carbon-components-react/components/UIShell/SideNavIcon.d.ts new file mode 100644 index 0000000000..f917be3a71 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavIcon.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps, SizingProps } from "../../typings/shared"; + +interface InheritedProps extends + RequiresChildrenProps, + SizingProps +{ + className?: ReactAttr["className"], +} + +export interface SideNavIconProps extends InheritedProps { } + +declare const SideNavIcon: React.FC; + +export default SideNavIcon; diff --git a/types/carbon-components-react/components/UIShell/SideNavItem.d.ts b/types/carbon-components-react/components/UIShell/SideNavItem.d.ts new file mode 100644 index 0000000000..889e8963b0 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavItem.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps } from "../../typings/shared"; + +interface InheritedProps extends RequiresChildrenProps { + className?: ReactAttr["className"], +} + +export interface SideNavItemProps extends InheritedProps { } + +declare const SideNavItem: React.FC; + +export default SideNavItem; diff --git a/types/carbon-components-react/components/UIShell/SideNavItems.d.ts b/types/carbon-components-react/components/UIShell/SideNavItems.d.ts new file mode 100644 index 0000000000..b14e6d2e01 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavItems.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps } from "../../typings/shared"; + +interface InheritedProps extends RequiresChildrenProps { + className?: ReactAttr["className"], +} + +export interface SideNavItemsProps extends InheritedProps { +} + +declare const SideNavItems: React.FC; + +export default SideNavItems; diff --git a/types/carbon-components-react/components/UIShell/SideNavLink.d.ts b/types/carbon-components-react/components/UIShell/SideNavLink.d.ts new file mode 100644 index 0000000000..e87e3defcd --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavLink.d.ts @@ -0,0 +1,23 @@ +import * as React from "react"; +import { ReactAttr, RenderIconProps, RequiresChildrenProps } from "../../typings/shared"; +import { LinkProps } from "./Link"; + +interface InheritedProps extends + RenderIconProps, + RequiresChildrenProps +{ + className?: ReactAttr["className"], +} + +export interface SideNavLinkPropsBase extends InheritedProps { } + +export type SideNavLinkProps = LinkProps & SideNavLinkPropsBase; + +declare interface SideNavLinkFC extends React.FC> { } +export declare function createCustomSideNavLink( + element: SideNavLinkProps['element'] +): SideNavLinkFC>; + +declare function SideNavLink(props: React.PropsWithChildren>): React.ReactElement | null; + +export default SideNavLink; diff --git a/types/carbon-components-react/components/UIShell/SideNavLinkText.d.ts b/types/carbon-components-react/components/UIShell/SideNavLinkText.d.ts new file mode 100644 index 0000000000..f837b29542 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavLinkText.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps } from "../../typings/shared"; + +interface InheritedProps extends + Omit, "children">, + RequiresChildrenProps +{ } + +export interface SideNavLinkTextProps extends InheritedProps { } + +declare const SideNavLinkText: React.FC; + +export default SideNavLinkText; diff --git a/types/carbon-components-react/components/UIShell/SideNavMenu.d.ts b/types/carbon-components-react/components/UIShell/SideNavMenu.d.ts new file mode 100644 index 0000000000..eee933c93b --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavMenu.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { ReactAttr, RenderIconProps } from "../../typings/shared"; + +interface InheritedProps extends RenderIconProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], + title: NonNullable, +} + +export interface SideNavMenuProps extends InheritedProps { + defaultExpanded?: boolean + isActive?: boolean, +} + +export declare class SideNavMenu extends React.Component { } + +declare const SideNavMenuFC: React.RefForwardingComponent; + +export default SideNavMenuFC; diff --git a/types/carbon-components-react/components/UIShell/SideNavMenuItem.d.ts b/types/carbon-components-react/components/UIShell/SideNavMenuItem.d.ts new file mode 100644 index 0000000000..65f5ee3213 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavMenuItem.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; +import { LinkProps } from "./Link"; + +interface InheritedProps { + children?: ReactAttr["children"], + className?: ReactAttr["className"], +} + +export interface SideNavMenuItemPropsBase extends InheritedProps { + isActive?: boolean, +} + +export type SideNavMenuItemProps = LinkProps & SideNavMenuItemPropsBase; + +declare function SideNavMenuItem(props: React.PropsWithChildren>, ref: React.Ref): React.ReactElement | null; + +export default SideNavMenuItem; diff --git a/types/carbon-components-react/components/UIShell/SideNavSwitcher.d.ts b/types/carbon-components-react/components/UIShell/SideNavSwitcher.d.ts new file mode 100644 index 0000000000..c3135dd84f --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SideNavSwitcher.d.ts @@ -0,0 +1,15 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps { + className?: ReactAttr["className"], + onChange?(event: React.ChangeEvent): void, +} + +export interface SideNavSwitcherProps extends InheritedProps { + options: string[], +} + +declare const SideNavSwitcher: React.RefForwardingComponent; + +export default SideNavSwitcher; diff --git a/types/carbon-components-react/components/UIShell/SkipToContent.d.ts b/types/carbon-components-react/components/UIShell/SkipToContent.d.ts new file mode 100644 index 0000000000..db0c936243 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SkipToContent.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAnchorAttr } from "../../typings/shared"; + +interface InheritedProps extends Omit { + children?: string, +} + +export interface SkipToContentProps extends InheritedProps { } + +declare const SkipToContent: React.FC; + +export default SkipToContent; diff --git a/types/carbon-components-react/components/UIShell/Switcher.d.ts b/types/carbon-components-react/components/UIShell/Switcher.d.ts new file mode 100644 index 0000000000..85917ceba4 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/Switcher.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps } from "../../typings/shared"; + +interface InheritedProps extends RequiresChildrenProps { + "aria-label"?: ReactAttr["aria-label"], + "aria-labelledby"?: ReactAttr["aria-labelledby"], + className?: ReactAttr["className"], +} + +export interface SwitcherProps extends InheritedProps { } + +declare const Switcher: React.RefForwardingComponent; + +export default Switcher; diff --git a/types/carbon-components-react/components/UIShell/SwitcherDivider.d.ts b/types/carbon-components-react/components/UIShell/SwitcherDivider.d.ts new file mode 100644 index 0000000000..651fe43af1 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SwitcherDivider.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface SwitcherDividerProps extends InheritedProps { } + +declare const SwitcherDivider: React.FC; + +export default SwitcherDivider; diff --git a/types/carbon-components-react/components/UIShell/SwitcherItem.d.ts b/types/carbon-components-react/components/UIShell/SwitcherItem.d.ts new file mode 100644 index 0000000000..aca62187ab --- /dev/null +++ b/types/carbon-components-react/components/UIShell/SwitcherItem.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { ReactAttr, RequiresChildrenProps } from "../../typings/shared"; +import { LinkProps } from "./Link"; + +interface InheritedProps extends RequiresChildrenProps { + className?: ReactAttr["className"], +} + +export interface SwitcherItemPropsBase extends InheritedProps { + isSelected?: boolean, +} + +export type SwitcherItemProps = Omit, "tabIndex"> & SwitcherItemPropsBase; + +declare function SwitcherItem(props: React.PropsWithChildren>, ref: React.Ref): React.ReactElement | null; + +export default SwitcherItem; diff --git a/types/carbon-components-react/components/UIShell/index.d.ts b/types/carbon-components-react/components/UIShell/index.d.ts new file mode 100644 index 0000000000..5151104902 --- /dev/null +++ b/types/carbon-components-react/components/UIShell/index.d.ts @@ -0,0 +1,63 @@ +import Content from "./Content"; + +import Header from "./Header"; +import HeaderContainer from "./HeaderContainer"; +import HeaderGlobalAction from "./HeaderGlobalAction"; +import HeaderGlobalBar from "./HeaderGlobalBar"; +import HeaderMenu from "./HeaderMenu"; +import HeaderMenuButton from "./HeaderMenuButton"; +import HeaderMenuItem from "./HeaderMenuItem"; +import HeaderName from "./HeaderName"; +import HeaderNavigation from "./HeaderNavigation"; +import HeaderPanel from "./HeaderPanel"; +import HeaderSideNavItems from "./HeaderSideNavItems"; + +import SideNav from "./SideNav"; +import SideNavDetails from "./SideNavDetails"; +import SideNavFooter from "./SideNavFooter"; +import SideNavHeader from "./SideNavHeader"; +import SideNavIcon from "./SideNavIcon"; +import SideNavItem from "./SideNavItem"; +import SideNavItems from "./SideNavItems"; +import SideNavLink from "./SideNavLink"; +import SideNavLinkText from "./SideNavLinkText"; +import SideNavMenu from "./SideNavMenu"; +import SideNavMenuItem from "./SideNavMenuItem"; +import SideNavSwitcher from "./SideNavSwitcher"; + +import SkipToContent from "./SkipToContent"; + +import Switcher from "./Switcher"; +import SwitcherDivider from "./SwitcherDivider"; +import SwitcherItem from "./SwitcherItem"; + +export { + Content, + Header, + HeaderContainer, + HeaderGlobalAction, + HeaderGlobalBar, + HeaderMenu, + HeaderMenuButton, + HeaderMenuItem, + HeaderName, + HeaderNavigation, + HeaderPanel, + HeaderSideNavItems, + SkipToContent, + SideNav, + SideNavDetails, + SideNavFooter, + SideNavHeader, + SideNavIcon, + SideNavItem, + SideNavItems, + SideNavLink, + SideNavLinkText, + SideNavMenu, + SideNavMenuItem, + SideNavSwitcher, + Switcher, + SwitcherDivider, + SwitcherItem +}; diff --git a/types/carbon-components-react/components/UnorderedList/UnorderedList.d.ts b/types/carbon-components-react/components/UnorderedList/UnorderedList.d.ts new file mode 100644 index 0000000000..39da41a800 --- /dev/null +++ b/types/carbon-components-react/components/UnorderedList/UnorderedList.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { ReactAttr } from "../../typings/shared"; + +interface InheritedProps extends ReactAttr { } + +export interface UnorderedListProps extends InheritedProps { + nested?: boolean, +} + +declare const UnorderedList: React.FC; + +export default UnorderedList; diff --git a/types/carbon-components-react/components/UnorderedList/index.d.ts b/types/carbon-components-react/components/UnorderedList/index.d.ts new file mode 100644 index 0000000000..abdd76aade --- /dev/null +++ b/types/carbon-components-react/components/UnorderedList/index.d.ts @@ -0,0 +1,2 @@ +export * from "./UnorderedList"; +export { default } from "./UnorderedList"; diff --git a/types/carbon-components-react/index.d.ts b/types/carbon-components-react/index.d.ts new file mode 100644 index 0000000000..e17e68600c --- /dev/null +++ b/types/carbon-components-react/index.d.ts @@ -0,0 +1,290 @@ +// Type definitions for carbon-components-react 7.4 +// Project: https://github.com/carbon-design-system/carbon/tree/master/packages/react +// Definitions by: Kyle Albert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.5 + +export as namespace CarbonReact; + +import _Accordion from "./components/Accordion"; +import _AccordionSkeleton from "./components/Accordion/Accordion.Skeleton"; +import _AccordionItem from "./components/AccordionItem"; +import _BreadcrumbSkeleton from "./components/Breadcrumb/Breadcrumb.Skeleton"; +import _Button from "./components/Button"; +import _ButtonSkeleton from "./components/Button/Button.Skeleton"; +import _Checkbox from "./components/Checkbox"; +import _CheckboxSkeleton from "./components/Checkbox/Checkbox.Skeleton"; +import _CodeSnippet from "./components/CodeSnippet"; +import _CodeSnippetSkeleton from "./components/CodeSnippet/CodeSnippet.Skeleton"; +import _ComboBox from "./components/ComboBox"; +import _ComposedModal from "./components/ComposedModal"; +import _ContentSwitcher from "./components/ContentSwitcher"; +import _Copy from "./components/Copy"; +import _CopyButton from "./components/CopyButton"; +import _DangerButton from "./components/DangerButton"; +import _DataTableSkeleton from "./components/DataTableSkeleton"; +import _DatePicker from "./components/DatePicker"; +import _DatePickerSkeleton from "./components/DatePicker/DatePicker.Skeleton"; +import _DatePickerInput from "./components/DatePickerInput"; +import _Dropdown from "./components/Dropdown"; +import _DropdownSkeleton from "./components/Dropdown/Dropdown.Skeleton"; +import _FileUploader from "./components/FileUploader"; +import _FileUploaderSkeleton from "./components/FileUploader/FileUploader.Skeleton"; +import _Form from "./components/Form"; +import _FormGroup from "./components/FormGroup"; +import _FormItem from "./components/FormItem"; +import _FormLabel from "./components/FormLabel"; +import _Icon from "./components/Icon"; +import _IconSkeleton from "./components/Icon/Icon.Skeleton"; +import _InlineLoading from "./components/InlineLoading"; +import _Link from "./components/Link"; +import _ListItem from "./components/ListItem"; +import _Loading from "./components/Loading"; +import _Modal from "./components/Modal"; +import _ModalWrapper from "./components/ModalWrapper"; +import _MultiSelect from "./components/MultiSelect"; +import _NumberInput from "./components/NumberInput"; +import _NumberInputSkeleton from "./components/NumberInput/NumberInput.Skeleton"; +import _OrderedList from "./components/OrderedList"; +import _OverflowMenu from "./components/OverflowMenu"; +import _OverflowMenuItem from "./components/OverflowMenuItem"; +import _Pagination from "./components/Pagination"; +import _PrimaryButton from "./components/PrimaryButton"; +import _ProgressIndicatorSkeleton from "./components/ProgressIndicator/ProgressIndicator.Skeleton"; +import _RadioButton from "./components/RadioButton"; +import _RadioButtonSkeleton from "./components/RadioButton/RadioButton.Skeleton"; +import _RadioButtonGroup from "./components/RadioButtonGroup"; +import _RadioTile from "./components/RadioTile"; +import _Search from "./components/Search"; +import _SearchSkeleton from "./components/Search/Search.Skeleton"; +import _SearchFilterButton from "./components/SearchFilterButton"; +import _SearchLayoutButton from "./components/SearchLayoutButton"; +import _SecondaryButton from "./components/SecondaryButton"; +import _Select from "./components/Select"; +import _SelectSkeleton from "./components/Select/Select.Skeleton"; +import _SelectItem from "./components/SelectItem"; +import _SelectItemGroup from "./components/SelectItemGroup"; +import _SkeletonPlaceholder from "./components/SkeletonPlaceholder"; +import _SkeletonText from "./components/SkeletonText"; +import _Slider from "./components/Slider"; +import _SliderSkeleton from "./components/Slider/Slider.Skeleton"; +import _StructuredListSkeleton from "./components/StructuredList/StructuredList.Skeleton"; +import _Switch from "./components/Switch"; +import _Tab from "./components/Tab"; +import _TabContent from "./components/TabContent"; +import _Tabs from "./components/Tabs"; +import _TabsSkeleton from "./components/Tabs/Tabs.Skeleton"; +import _Tag from "./components/Tag"; +import _TagSkeleton from "./components/Tag/Tag.Skeleton"; +import _TextArea from "./components/TextArea"; +import _TextAreaSkeleton from "./components/TextArea/TextArea.Skeleton"; +import _TextInput from "./components/TextInput"; +import _TextInputSkeleton from "./components/TextInput/TextInput.Skeleton"; +import _TileGroup from "./components/TileGroup"; +import _TimePicker from "./components/TimePicker"; +import _TimePickerSelect from "./components/TimePickerSelect"; +import _Toggle from "./components/Toggle"; +import _ToggleSkeleton from "./components/Toggle/Toggle.Skeleton"; +import _ToggleSmall from "./components/ToggleSmall"; +import _ToggleSmallSkeleton from "./components/ToggleSmall/ToggleSmall.Skeleton"; +import _Toolbar from "./components/Toolbar"; +import _ToolbarSearch from "./components/ToolbarSearch"; +import _Tooltip from "./components/Tooltip"; +import _TooltipDefinition from "./components/TooltipDefinition"; +import _TooltipIcon from "./components/TooltipIcon"; +import _UnorderedList from "./components/UnorderedList"; + +export * from "./components/Accordion"; +export * from "./components/AccordionItem"; +export * from "./components/Breadcrumb"; +export * from "./components/BreadcrumbItem"; +export * from "./components/Button"; +export * from "./components/Checkbox"; +export * from "./components/CodeSnippet"; +export * from "./components/ComboBox"; +export * from "./components/ComposedModal"; +export * from "./components/ContentSwitcher"; +export * from "./components/Copy"; +export * from "./components/CopyButton"; +export * from "./components/DangerButton"; +export * from "./components/DataTable"; +export * from "./components/DataTableSkeleton"; +export * from "./components/DatePicker"; +export * from "./components/DatePickerInput"; +export * from "./components/Dropdown"; +export * from "./components/FileUploader"; +export * from "./components/Form"; +export * from "./components/FormGroup"; +export * from "./components/FormItem"; +export * from "./components/FormLabel"; +export * from "./components/Icon"; +export * from "./components/InlineCheckbox"; +export * from "./components/InlineLoading"; +export * from "./components/Link"; +export * from "./components/ListBox"; +export * from "./components/ListItem"; +export * from "./components/Loading"; +export * from "./components/Modal"; +export * from "./components/ModalWrapper"; +export * from "./components/MultiSelect"; +export * from "./components/Notification"; +export * from "./components/NumberInput"; +export * from "./components/OrderedList"; +export * from "./components/OverflowMenu"; +export * from "./components/OverflowMenuItem"; +export * from "./components/Pagination"; +export * from "./components/PrimaryButton"; +export * from "./components/ProgressIndicator"; +export * from "./components/RadioButton"; +export * from "./components/RadioButtonGroup"; +export * from "./components/RadioTile"; +export * from "./components/Search"; +export * from "./components/SearchFilterButton"; +export * from "./components/SearchLayoutButton"; +export * from "./components/SecondaryButton"; +export * from "./components/Select"; +export * from "./components/SelectItem"; +export * from "./components/SelectItemGroup"; +export * from "./components/SkeletonPlaceholder"; +export * from "./components/SkeletonText"; +export * from "./components/Slider"; +export * from "./components/StructuredList"; +export * from "./components/Switch"; +export * from "./components/Tab"; +export * from "./components/TabContent"; +export * from "./components/Tabs"; +export * from "./components/Tag"; +export * from "./components/TextArea"; +export * from "./components/TextInput"; +export * from "./components/Tile"; +export * from "./components/TileGroup"; +export * from "./components/TimePicker"; +export * from "./components/TimePickerSelect"; +export * from "./components/Toggle"; +export * from "./components/ToggleSmall"; +export * from "./components/Toolbar"; +export * from "./components/ToolbarSearch"; +export * from "./components/Tooltip"; +export * from "./components/TooltipDefinition"; +export * from "./components/TooltipIcon"; +export * from "./components/UIShell"; +export * from "./components/UnorderedList"; + +export { _Accordion as Accordion }; +export { _AccordionItem as AccordionItem }; +export { Breadcrumb, BreadcrumbItem } from "./components/Breadcrumb"; +export { _Button as Button }; +export { _Checkbox as Checkbox }; +export { _CodeSnippet as CodeSnippet }; +export { _ComboBox as ComboBox }; +export { _ComposedModal as ComposedModal }; +export { ModalHeader, ModalBody, ModalFooter } from "./components/ComposedModal"; +export { _ContentSwitcher as ContentSwitcher }; +export { _Copy as Copy }; +export { _CopyButton as CopyButton }; +export { _DangerButton as DangerButton }; +export { + default as DataTable, + Table, + TableActionList, + TableBatchAction, + TableBatchActions, + TableBody, + TableCell, + TableContainer, + TableExpandHeader, + TableExpandRow, + TableExpandedRow, + TableHead, + TableHeader, + TableRow, + TableSelectAll, + TableSelectRow, + TableToolbar, + TableToolbarAction, + TableToolbarContent, + TableToolbarSearch, + TableToolbarMenu +} from "./components/DataTable"; +export { _DatePicker as DatePicker }; +export { _DatePickerInput as DatePickerInput }; +export { _Dropdown as Dropdown }; +export { _FileUploader as FileUploader }; +export { Filename, FileUploaderButton } from "./components/FileUploader"; +export { _Form as Form }; +export { _FormGroup as FormGroup }; +export { _FormItem as FormItem }; +export { _FormLabel as FormLabel }; +export { _Icon as Icon }; +export { _InlineLoading as InlineLoading }; +export { _Link as Link }; +export { _ListItem as ListItem }; +export { _Loading as Loading }; +export { _Modal as Modal }; +export { _ModalWrapper as ModalWrapper }; +export { _MultiSelect as MultiSelect }; +export { ToastNotification, InlineNotification, NotificationActionButton, NotificationButton, NotificationTextDetails } from "./components/Notification"; +export { _NumberInput as NumberInput }; +export { _OrderedList as OrderedList }; +export { _OverflowMenu as OverflowMenu }; +export { _OverflowMenuItem as OverflowMenuItem }; +export { _Pagination as Pagination }; +export { _PrimaryButton as PrimaryButton }; +export { ProgressIndicator, ProgressStep } from "./components/ProgressIndicator"; +export { _RadioButton as RadioButton }; +export { _RadioButtonGroup as RadioButtonGroup }; +export { _Search as Search }; +export { _SearchFilterButton as SearchFilterButton }; +export { _SearchLayoutButton as SearchLayoutButton }; +export { _SecondaryButton as SecondaryButton }; +export { _Select as Select }; +export { _SelectItem as SelectItem }; +export { _SelectItemGroup as SelectItemGroup }; +export { _Switch as Switch }; +export { _Slider as Slider }; +export { StructuredListWrapper, StructuredListHead, StructuredListBody, StructuredListRow, StructuredListInput, StructuredListCell } from "./components/StructuredList"; +export { _Tab as Tab }; +export { _TabContent as TabContent }; +export { _Tabs as Tabs }; +export { _Tag as Tag }; +export { _TextArea as TextArea }; +export { _TextInput as TextInput }; +export { Tile, ClickableTile, SelectableTile, ExpandableTile, TileAboveTheFoldContent, TileBelowTheFoldContent } from "./components/Tile"; +export { _RadioTile as RadioTile }; +export { _TileGroup as TileGroup }; +export { _TimePicker as TimePicker }; +export { _TimePickerSelect as TimePickerSelect }; +export { _Toggle as Toggle }; +export { _ToggleSmall as ToggleSmall }; +export { _Toolbar as Toolbar }; +export { ToolbarItem, ToolbarTitle, ToolbarOption, ToolbarDivider } from "./components/Toolbar"; +export { _ToolbarSearch as ToolbarSearch }; +export { _Tooltip as Tooltip }; +export { _TooltipDefinition as TooltipDefinition }; +export { _TooltipIcon as TooltipIcon }; +export { _UnorderedList as UnorderedList }; +export { _SkeletonText as SkeletonText }; +export { _SkeletonPlaceholder as SkeletonPlaceholder }; +export { _DataTableSkeleton as DataTableSkeleton }; +export { _AccordionSkeleton as AccordionSkeleton }; +export { _BreadcrumbSkeleton as BreadcrumbSkeleton }; +export { _ButtonSkeleton as ButtonSkeleton }; +export { _CheckboxSkeleton as CheckboxSkeleton }; +export { _CodeSnippetSkeleton as CodeSnippetSkeleton }; +export { _DropdownSkeleton as DropdownSkeleton }; +export { _FileUploaderSkeleton as FileUploaderSkeleton }; +export { _NumberInputSkeleton as NumberInputSkeleton }; +export { _ProgressIndicatorSkeleton as ProgressIndicatorSkeleton }; +export { _RadioButtonSkeleton as RadioButtonSkeleton }; +export { _SearchSkeleton as SearchSkeleton }; +export { _SelectSkeleton as SelectSkeleton }; +export { _SliderSkeleton as SliderSkeleton }; +export { _StructuredListSkeleton as StructuredListSkeleton }; +export { _TabsSkeleton as TabsSkeleton }; +export { _TagSkeleton as TagSkeleton }; +export { _TextAreaSkeleton as TextAreaSkeleton }; +export { _TextInputSkeleton as TextInputSkeleton }; +export { _ToggleSkeleton as ToggleSkeleton }; +export { _ToggleSmallSkeleton as ToggleSmallSkeleton }; +export { _IconSkeleton as IconSkeleton }; +export { _DatePickerSkeleton as DatePickerSkeleton }; diff --git a/types/carbon-components-react/package.json b/types/carbon-components-react/package.json new file mode 100644 index 0000000000..6c0d45be06 --- /dev/null +++ b/types/carbon-components-react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "flatpickr": "4.6.1" + } +} diff --git a/types/carbon-components-react/tsconfig.json b/types/carbon-components-react/tsconfig.json new file mode 100644 index 0000000000..57e63e6eed --- /dev/null +++ b/types/carbon-components-react/tsconfig.json @@ -0,0 +1,262 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" + }, + "files": [ + "components/Accordion/Accordion.Skeleton.d.ts", + "components/Accordion/Accordion.d.ts", + "components/Accordion/AccordionItem.d.ts", + "components/Accordion/index.d.ts", + "components/AccordionItem/AccordionItem.d.ts", + "components/AccordionItem/index.d.ts", + "components/Breadcrumb/Breadcrumb.Skeleton.d.ts", + "components/Breadcrumb/Breadcrumb.d.ts", + "components/Breadcrumb/BreadcrumbItem.d.ts", + "components/Breadcrumb/index.d.ts", + "components/BreadcrumbItem/index.d.ts", + "components/Button/Button.Skeleton.d.ts", + "components/Button/Button.d.ts", + "components/Button/index.d.ts", + "components/Checkbox/Checkbox.Skeleton.d.ts", + "components/Checkbox/Checkbox.d.ts", + "components/Checkbox/index.d.ts", + "components/CodeSnippet/CodeSnippet.Skeleton.d.ts", + "components/CodeSnippet/CodeSnippet.d.ts", + "components/CodeSnippet/index.d.ts", + "components/ComboBox/ComboBox.d.ts", + "components/ComboBox/index.d.ts", + "components/ComposedModal/ComposedModal.d.ts", + "components/ComposedModal/index.d.ts", + "components/ContentSwitcher/ContentSwitcher.d.ts", + "components/ContentSwitcher/Switch.d.ts", + "components/ContentSwitcher/index.d.ts", + "components/Copy/Copy.d.ts", + "components/Copy/index.d.ts", + "components/CopyButton/CopyButton.d.ts", + "components/CopyButton/index.d.ts", + "components/DangerButton/DangerButton.d.ts", + "components/DangerButton/index.d.ts", + "components/DataTable/DataTable.d.ts", + "components/DataTable/Table.d.ts", + "components/DataTable/TableActionList.d.ts", + "components/DataTable/TableBatchAction.d.ts", + "components/DataTable/TableBatchActions.d.ts", + "components/DataTable/TableBody.d.ts", + "components/DataTable/TableCell.d.ts", + "components/DataTable/TableContainer.d.ts", + "components/DataTable/TableExpandHeader.d.ts", + "components/DataTable/TableExpandRow.d.ts", + "components/DataTable/TableExpandedRow.d.ts", + "components/DataTable/TableHead.d.ts", + "components/DataTable/TableHeader.d.ts", + "components/DataTable/TableRow.d.ts", + "components/DataTable/TableSelectAll.d.ts", + "components/DataTable/TableSelectRow.d.ts", + "components/DataTable/TableToolbar.d.ts", + "components/DataTable/TableToolbarAction.d.ts", + "components/DataTable/TableToolbarContent.d.ts", + "components/DataTable/TableToolbarMenu.d.ts", + "components/DataTable/TableToolbarSearch.d.ts", + "components/DataTable/index.d.ts", + "components/DataTable/state/sorting.d.ts", + "components/DataTableSkeleton/DataTableSkeleton.d.ts", + "components/DataTableSkeleton/index.d.ts", + "components/DatePicker/DatePicker.Skeleton.d.ts", + "components/DatePicker/DatePicker.d.ts", + "components/DatePicker/index.d.ts", + "components/DatePickerInput/DatePickerInput.d.ts", + "components/DatePickerInput/index.d.ts", + "components/Dropdown/Dropdown.Skeleton.d.ts", + "components/Dropdown/Dropdown.d.ts", + "components/Dropdown/index.d.ts", + "components/FileUploader/FileUploader.Skeleton.d.ts", + "components/FileUploader/FileUploader.d.ts", + "components/FileUploader/index.d.ts", + "components/Form/Form.d.ts", + "components/Form/index.d.ts", + "components/FormGroup/FormGroup.d.ts", + "components/FormGroup/index.d.ts", + "components/FormItem/FormItem.d.ts", + "components/FormItem/index.d.ts", + "components/FormLabel/FormLabel.d.ts", + "components/FormLabel/index.d.ts", + "components/Icon/Icon.Skeleton.d.ts", + "components/Icon/Icon.d.ts", + "components/Icon/index.d.ts", + "components/InlineCheckbox/InlineCheckbox.d.ts", + "components/InlineCheckbox/index.d.ts", + "components/InlineLoading/InlineLoading.d.ts", + "components/InlineLoading/index.d.ts", + "components/Link/Link.d.ts", + "components/Link/index.d.ts", + "components/ListBox/ListBox.d.ts", + "components/ListBox/ListBoxField.d.ts", + "components/ListBox/ListBoxMenu.d.ts", + "components/ListBox/ListBoxMenuIcon.d.ts", + "components/ListBox/ListBoxMenuItem.d.ts", + "components/ListBox/ListBoxPropTypes.d.ts", + "components/ListBox/ListBoxSelection.d.ts", + "components/ListBox/index.d.ts", + "components/ListItem/ListItem.d.ts", + "components/ListItem/index.d.ts", + "components/Loading/Loading.d.ts", + "components/Loading/index.d.ts", + "components/Modal/Modal.d.ts", + "components/Modal/index.d.ts", + "components/ModalWrapper/ModalWrapper.d.ts", + "components/ModalWrapper/index.d.ts", + "components/MultiSelect/FilterableMultiSelect.d.ts", + "components/MultiSelect/MultiSelect.d.ts", + "components/MultiSelect/MultiSelectPropTypes.d.ts", + "components/MultiSelect/index.d.ts", + "components/Notification/Notification.d.ts", + "components/Notification/a11yIconWarningSolid.d.ts", + "components/Notification/index.d.ts", + "components/NumberInput/NumberInput.Skeleton.d.ts", + "components/NumberInput/NumberInput.d.ts", + "components/NumberInput/index.d.ts", + "components/OrderedList/OrderedList.d.ts", + "components/OrderedList/index.d.ts", + "components/OverflowMenu/OverflowMenu.d.ts", + "components/OverflowMenu/index.d.ts", + "components/OverflowMenuItem/OverflowMenuItem.d.ts", + "components/OverflowMenuItem/index.d.ts", + "components/Pagination/Pagination.Skeleton.d.ts", + "components/Pagination/Pagination.d.ts", + "components/Pagination/index.d.ts", + "components/PrimaryButton/PrimaryButton.d.ts", + "components/PrimaryButton/index.d.ts", + "components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts", + "components/ProgressIndicator/ProgressIndicator.d.ts", + "components/ProgressIndicator/index.d.ts", + "components/RadioButton/RadioButton.Skeleton.d.ts", + "components/RadioButton/RadioButton.d.ts", + "components/RadioButton/index.d.ts", + "components/RadioButtonGroup/RadioButtonGroup.d.ts", + "components/RadioButtonGroup/index.d.ts", + "components/RadioTile/RadioTile.d.ts", + "components/RadioTile/index.d.ts", + "components/Search/Search.Skeleton.d.ts", + "components/Search/Search.d.ts", + "components/Search/index.d.ts", + "components/SearchFilterButton/SearchFilterButton.d.ts", + "components/SearchFilterButton/index.d.ts", + "components/SearchLayoutButton/SearchLayoutButton.d.ts", + "components/SearchLayoutButton/index.d.ts", + "components/SecondaryButton/SecondaryButton.d.ts", + "components/SecondaryButton/index.d.ts", + "components/Select/Select.Skeleton.d.ts", + "components/Select/Select.d.ts", + "components/Select/index.d.ts", + "components/SelectItem/SelectItem.d.ts", + "components/SelectItem/index.d.ts", + "components/SelectItemGroup/SelectItemGroup.d.ts", + "components/SelectItemGroup/index.d.ts", + "components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts", + "components/SkeletonPlaceholder/index.d.ts", + "components/SkeletonText/SkeletonText.d.ts", + "components/SkeletonText/index.d.ts", + "components/Slider/Slider.Skeleton.d.ts", + "components/Slider/Slider.d.ts", + "components/Slider/index.d.ts", + "components/StructuredList/StructuredList.Skeleton.d.ts", + "components/StructuredList/StructuredList.d.ts", + "components/StructuredList/index.d.ts", + "components/Switch/Switch.d.ts", + "components/Switch/index.d.ts", + "components/Tab/Tab.d.ts", + "components/Tab/index.d.ts", + "components/TabContent/TabContent.d.ts", + "components/TabContent/index.d.ts", + "components/Tabs/Tabs.Skeleton.d.ts", + "components/Tabs/Tabs.d.ts", + "components/Tabs/index.d.ts", + "components/Tag/Tag.Skeleton.d.ts", + "components/Tag/Tag.d.ts", + "components/Tag/index.d.ts", + "components/TextArea/TextArea.Skeleton.d.ts", + "components/TextArea/TextArea.d.ts", + "components/TextArea/index.d.ts", + "components/TextInput/ControlledPasswordInput.d.ts", + "components/TextInput/PasswordInput.d.ts", + "components/TextInput/TextInput.Skeleton.d.ts", + "components/TextInput/TextInput.d.ts", + "components/TextInput/index.d.ts", + "components/TextInput/props.d.ts", + "components/Tile/Tile.d.ts", + "components/Tile/index.d.ts", + "components/TileGroup/TileGroup.d.ts", + "components/TileGroup/index.d.ts", + "components/TimePicker/TimePicker.d.ts", + "components/TimePicker/index.d.ts", + "components/TimePickerSelect/TimePickerSelect.d.ts", + "components/TimePickerSelect/index.d.ts", + "components/Toggle/Toggle.Skeleton.d.ts", + "components/Toggle/Toggle.d.ts", + "components/Toggle/index.d.ts", + "components/ToggleSmall/ToggleSmall.Skeleton.d.ts", + "components/ToggleSmall/ToggleSmall.d.ts", + "components/ToggleSmall/index.d.ts", + "components/Toolbar/Toolbar.d.ts", + "components/Toolbar/index.d.ts", + "components/ToolbarSearch/ToolbarSearch.d.ts", + "components/ToolbarSearch/index.d.ts", + "components/Tooltip/Tooltip.d.ts", + "components/Tooltip/index.d.ts", + "components/TooltipDefinition/TooltipDefinition.d.ts", + "components/TooltipDefinition/index.d.ts", + "components/TooltipIcon/TooltipIcon.d.ts", + "components/TooltipIcon/index.d.ts", + "components/UIShell/Content.d.ts", + "components/UIShell/Header.d.ts", + "components/UIShell/HeaderContainer.d.ts", + "components/UIShell/HeaderGlobalAction.d.ts", + "components/UIShell/HeaderGlobalBar.d.ts", + "components/UIShell/HeaderMenu.d.ts", + "components/UIShell/HeaderMenuButton.d.ts", + "components/UIShell/HeaderMenuItem.d.ts", + "components/UIShell/HeaderName.d.ts", + "components/UIShell/HeaderNavigation.d.ts", + "components/UIShell/HeaderPanel.d.ts", + "components/UIShell/HeaderSideNavItems.d.ts", + "components/UIShell/Link.d.ts", + "components/UIShell/SideNav.d.ts", + "components/UIShell/SideNavDetails.d.ts", + "components/UIShell/SideNavFooter.d.ts", + "components/UIShell/SideNavHeader.d.ts", + "components/UIShell/SideNavIcon.d.ts", + "components/UIShell/SideNavItem.d.ts", + "components/UIShell/SideNavItems.d.ts", + "components/UIShell/SideNavLink.d.ts", + "components/UIShell/SideNavLinkText.d.ts", + "components/UIShell/SideNavMenu.d.ts", + "components/UIShell/SideNavMenuItem.d.ts", + "components/UIShell/SideNavSwitcher.d.ts", + "components/UIShell/SkipToContent.d.ts", + "components/UIShell/Switcher.d.ts", + "components/UIShell/SwitcherDivider.d.ts", + "components/UIShell/SwitcherItem.d.ts", + "components/UIShell/index.d.ts", + "components/UnorderedList/UnorderedList.d.ts", + "components/UnorderedList/index.d.ts", + "index.d.ts", + "typings/shared.d.ts", + "carbon-components-react-tests.tsx" + ] +} diff --git a/types/carbon-components-react/tslint.json b/types/carbon-components-react/tslint.json new file mode 100644 index 0000000000..6011d9520c --- /dev/null +++ b/types/carbon-components-react/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "dt-header": false, + "npm-naming": false, + "no-any-union": false, + "no-empty-interface": false, + "no-object-literal-type-assertion": false, + "no-unnecessary-generics": false, + "no-void-expression": false, + "one-line": false, + "prefer-const": false, + "semicolon": [true, "always", "ignore-interfaces"], + "strict-export-declare-modifiers": false, + "void-return": false + } +} diff --git a/types/carbon-components-react/typings/shared.d.ts b/types/carbon-components-react/typings/shared.d.ts new file mode 100644 index 0000000000..d033e12db4 --- /dev/null +++ b/types/carbon-components-react/typings/shared.d.ts @@ -0,0 +1,64 @@ +import * as React from "react"; + +export interface ReactAttr extends React.HTMLAttributes { } +export interface ReactAnchorAttr extends React.AnchorHTMLAttributes { } +export interface ReactButtonAttr extends React.ButtonHTMLAttributes { } +export interface ReactDivAttr extends ReactAttr { } +export interface ReactInputAttr extends React.InputHTMLAttributes { } +export interface ReactLabelAttr extends React.LabelHTMLAttributes { } +export interface ReactLIAttr extends React.LiHTMLAttributes { } +export type ReactCreateElementParam = Parameters[0]; + +export type ShapeOf = (E extends never ? {} : E) & B; + +export type Direction = "bottom" | "left" | "right" | "top"; +export type ListBoxBaseItemType = object | string; +export type TooltipAlignment = "center" | "end" | "start"; +export type TooltipPosition = Direction; + +export interface DownshiftTypedProps { + itemToString?(item: ItemType): string, +} + +export interface EmbeddedIconProps { + iconDescription?: string, +} + +export interface EmbeddedTooltipProps { + tooltipAlignment?: TooltipAlignment, + tooltipPosition?: TooltipPosition, +} + +export interface InternationalProps { + translateWithId?(messageId: MID): string, +} + +export interface MenuOffsetData { + left?: number, + top?: number, +} + +export interface RenderIconProps { + renderIcon?: React.ComponentType, +} + +export interface RequiresChildrenProps { + children: NonNullable, +} + +export interface RequiresIdProps { + id: NonNullable, +} + +export interface SizingProps { + small?: boolean, +} + +export interface ThemeProps { + light?: boolean, +} + +export interface ValidityProps { + invalid?: boolean, + invalidText?: string, +}