diff --git a/packages/ibm-products/src/components/APIKeyModal/index.js b/packages/ibm-products/src/components/APIKeyModal/index.ts similarity index 78% rename from packages/ibm-products/src/components/APIKeyModal/index.js rename to packages/ibm-products/src/components/APIKeyModal/index.ts index db0f899f44..ab53986aba 100644 --- a/packages/ibm-products/src/components/APIKeyModal/index.js +++ b/packages/ibm-products/src/components/APIKeyModal/index.ts @@ -6,3 +6,4 @@ // export { APIKeyModal } from './APIKeyModal'; +export type { APIKeyModalProps } from './APIKeyModal.types'; diff --git a/packages/ibm-products/src/components/AboutModal/AboutModal.tsx b/packages/ibm-products/src/components/AboutModal/AboutModal.tsx index a170a492f7..4116de7ff5 100644 --- a/packages/ibm-products/src/components/AboutModal/AboutModal.tsx +++ b/packages/ibm-products/src/components/AboutModal/AboutModal.tsx @@ -28,7 +28,7 @@ import uuidv4 from '../../global/js/utils/uuidv4'; const blockClass = `${pkg.prefix}--about-modal`; const componentName = 'AboutModal'; -interface AboutModalProps { +export interface AboutModalProps { /** * If you are legally required to display logos of technologies used * to build your product you can provide this in the additionalInfo. diff --git a/packages/ibm-products/src/components/AboutModal/index.js b/packages/ibm-products/src/components/AboutModal/index.ts similarity index 80% rename from packages/ibm-products/src/components/AboutModal/index.js rename to packages/ibm-products/src/components/AboutModal/index.ts index 22dc2d3da8..7ae0d3341d 100644 --- a/packages/ibm-products/src/components/AboutModal/index.js +++ b/packages/ibm-products/src/components/AboutModal/index.ts @@ -6,3 +6,4 @@ */ export { AboutModal } from './AboutModal'; +export type { AboutModalProps } from './AboutModal'; diff --git a/packages/ibm-products/src/components/ActionSet/ActionSet.tsx b/packages/ibm-products/src/components/ActionSet/ActionSet.tsx index 93fe652b32..e5265d8797 100644 --- a/packages/ibm-products/src/components/ActionSet/ActionSet.tsx +++ b/packages/ibm-products/src/components/ActionSet/ActionSet.tsx @@ -5,18 +5,17 @@ * LICENSE file in the root directory of this source tree. */ +// Carbon and package components we use. +import { Button, ButtonSet, InlineLoading } from '@carbon/react'; // Import portions of React that are needed. import React, { ComponentProps, PropsWithChildren } from 'react'; +import { allPropTypes, prepareProps } from '../../global/js/utils/props-helper'; +import { ButtonProps } from '@carbon/react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../settings'; -import { allPropTypes, prepareProps } from '../../global/js/utils/props-helper'; - -// Carbon and package components we use. -import { Button, ButtonSet, InlineLoading } from '@carbon/react'; -import { ButtonProps } from '@carbon/react'; const blockClass = `${pkg.prefix}--action-set`; const componentName = 'ActionSet'; @@ -90,7 +89,7 @@ const defaults = { size: 'md', }; -interface ActionSetProps { +export interface ActionSetProps { /** * The action buttons to show. Each action is specified as an object * representation of a Carbon button. diff --git a/packages/ibm-products/src/components/ActionSet/index.js b/packages/ibm-products/src/components/ActionSet/index.ts similarity index 81% rename from packages/ibm-products/src/components/ActionSet/index.js rename to packages/ibm-products/src/components/ActionSet/index.ts index 59facca219..46f5b3fab8 100644 --- a/packages/ibm-products/src/components/ActionSet/index.js +++ b/packages/ibm-products/src/components/ActionSet/index.ts @@ -6,3 +6,4 @@ */ export { ActionSet } from './ActionSet'; +export type { ActionSetProps } from './ActionSet'; diff --git a/packages/ibm-products/src/components/AddSelect/index.js b/packages/ibm-products/src/components/AddSelect/index.ts similarity index 81% rename from packages/ibm-products/src/components/AddSelect/index.js rename to packages/ibm-products/src/components/AddSelect/index.ts index 034e5e2771..6f3bc3e544 100644 --- a/packages/ibm-products/src/components/AddSelect/index.js +++ b/packages/ibm-products/src/components/AddSelect/index.ts @@ -6,3 +6,4 @@ // export { AddSelect } from './AddSelect'; +export type { AddSelectProps } from './AddSelect'; diff --git a/packages/ibm-products/src/components/Carousel/index.js b/packages/ibm-products/src/components/Carousel/index.ts similarity index 84% rename from packages/ibm-products/src/components/Carousel/index.js rename to packages/ibm-products/src/components/Carousel/index.ts index bd2b370197..bef0c808df 100644 --- a/packages/ibm-products/src/components/Carousel/index.js +++ b/packages/ibm-products/src/components/Carousel/index.ts @@ -7,3 +7,4 @@ export { Carousel } from './Carousel'; export { CarouselItem } from './CarouselItem'; +export type { CarouselProps } from './Carousel'; diff --git a/packages/ibm-products/src/components/Cascade/Cascade.tsx b/packages/ibm-products/src/components/Cascade/Cascade.tsx index d5e105ca4c..192814cc15 100644 --- a/packages/ibm-products/src/components/Cascade/Cascade.tsx +++ b/packages/ibm-products/src/components/Cascade/Cascade.tsx @@ -5,17 +5,18 @@ // LICENSE file in the root directory of this source tree. // -import React, { forwardRef, PropsWithChildren, ReactNode } from 'react'; +import React, { PropsWithChildren, ReactNode, forwardRef } from 'react'; + import { Grid } from '@carbon/react'; -import cx from 'classnames'; import PropTypes from 'prop-types'; -import { pkg } from '../../settings'; +import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; +import { pkg } from '../../settings'; const blockClass = `${pkg.prefix}--cascade`; const componentName = 'Cascade'; -interface CascadeProps { +export interface CascadeProps { children: ReactNode; /** * Specify an optional className to be applied to diff --git a/packages/ibm-products/src/components/Cascade/index.js b/packages/ibm-products/src/components/Cascade/index.js deleted file mode 100644 index e7894cb3cc..0000000000 --- a/packages/ibm-products/src/components/Cascade/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright IBM Corp. 2024 - * - * This source code is licensed under the Apache-2.0 license found in the - * LICENSE file in the root directory of this source tree. - */ - -export { Cascade } from './Cascade'; diff --git a/packages/ibm-products/src/components/Cascade/index.ts b/packages/ibm-products/src/components/Cascade/index.ts new file mode 100644 index 0000000000..c72f8a6f0c --- /dev/null +++ b/packages/ibm-products/src/components/Cascade/index.ts @@ -0,0 +1,9 @@ +// +// Copyright IBM Corp. 2021, 2024 +// +// This source code is licensed under the Apache-2.0 license found in the +// LICENSE file in the root directory of this source tree. +// + +export { Cascade } from './Cascade'; +export type { CascadeProps } from './Cascade'; diff --git a/packages/ibm-products/src/components/Checklist/Checklist.tsx b/packages/ibm-products/src/components/Checklist/Checklist.tsx index d6996b7e2c..948269c484 100644 --- a/packages/ibm-products/src/components/Checklist/Checklist.tsx +++ b/packages/ibm-products/src/components/Checklist/Checklist.tsx @@ -12,6 +12,9 @@ * PageHeader (PageHeaderTitle, PageHeaderUtils) */ +// Carbon and package components we use. +import { Button, IconButton } from '@carbon/react'; +import { Kind, Kinds, Theme, Themes } from './Checklist.types'; // Import portions of React that are needed. import React, { ForwardedRef, @@ -21,21 +24,15 @@ import React, { useState, } from 'react'; +import { ChecklistChart } from './ChecklistChart'; +import { ChecklistIcon } from './ChecklistIcon'; +import { ChevronUp } from '@carbon/react/icons'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import uuidv4 from '../../global/js/utils/uuidv4'; import { pkg } from '../../settings'; - -// Carbon and package components we use. -import { Button, IconButton } from '@carbon/react'; -import { ChevronUp } from '@carbon/react/icons'; - -import { ChecklistIcon } from './ChecklistIcon'; -import { ChecklistChart } from './ChecklistChart'; -import { Kinds, Kind, Theme, Themes } from './Checklist.types'; +import uuidv4 from '../../global/js/utils/uuidv4'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--checklist`; @@ -63,7 +60,7 @@ type TaskList = { tasks: Array; }; -interface ChecklistProps { +export interface ChecklistProps { /** * Define both `chartLabel` and `chartValue` to show the chart and its label together. */ diff --git a/packages/ibm-products/src/components/Checklist/index.js b/packages/ibm-products/src/components/Checklist/index.ts similarity index 81% rename from packages/ibm-products/src/components/Checklist/index.js rename to packages/ibm-products/src/components/Checklist/index.ts index e583b3d45c..334ddc2743 100644 --- a/packages/ibm-products/src/components/Checklist/index.js +++ b/packages/ibm-products/src/components/Checklist/index.ts @@ -6,3 +6,4 @@ */ export { Checklist } from './Checklist'; +export type { ChecklistProps } from './Checklist'; diff --git a/packages/ibm-products/src/components/Coachmark/Coachmark.tsx b/packages/ibm-products/src/components/Coachmark/Coachmark.tsx index 7b807b323c..fb5c5ff10d 100644 --- a/packages/ibm-products/src/components/Coachmark/Coachmark.tsx +++ b/packages/ibm-products/src/components/Coachmark/Coachmark.tsx @@ -6,23 +6,24 @@ */ import React, { - forwardRef, MutableRefObject, ReactNode, + forwardRef, + useCallback, useEffect, useRef, useState, - useCallback, } from 'react'; -import cx from 'classnames'; +import { useClickOutsideElement, useWindowEvent } from './utils/hooks'; + +import { COACHMARK_OVERLAY_KIND } from './utils/enums'; +import { CoachmarkContext } from './utils/context'; +import { CoachmarkOverlay } from './CoachmarkOverlay'; import PropTypes from 'prop-types'; import { createPortal } from 'react-dom'; -import { CoachmarkOverlay } from './CoachmarkOverlay'; -import { CoachmarkContext } from './utils/context'; -import { COACHMARK_OVERLAY_KIND } from './utils/enums'; -import { useClickOutsideElement, useWindowEvent } from './utils/hooks'; +import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; +import { pkg } from '../../settings'; import { throttle } from 'lodash'; import { Popover, PopoverAlignment, PopoverContent } from '@carbon/react'; import { useIsomorphicEffect } from '../../global/js/hooks'; @@ -39,7 +40,7 @@ const defaults = { theme: 'light', }; -interface CoachmarkProps { +export interface CoachmarkProps { /** * Where to render the Coachmark relative to its target. * Applies only to Floating and Tooltip Coachmarks. diff --git a/packages/ibm-products/src/components/Coachmark/index.js b/packages/ibm-products/src/components/Coachmark/index.ts similarity index 87% rename from packages/ibm-products/src/components/Coachmark/index.js rename to packages/ibm-products/src/components/Coachmark/index.ts index cceba81c0f..fddc035072 100644 --- a/packages/ibm-products/src/components/Coachmark/index.js +++ b/packages/ibm-products/src/components/Coachmark/index.ts @@ -13,3 +13,4 @@ export { COACHMARK_ALIGNMENT, } from './utils/enums'; export { useCoachmark } from './utils/context'; +export type { CoachmarkProps } from './Coachmark'; diff --git a/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.tsx b/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.tsx index 8d696692f5..0a7fa80a90 100644 --- a/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.tsx +++ b/packages/ibm-products/src/components/CoachmarkBeacon/CoachmarkBeacon.tsx @@ -5,16 +5,15 @@ * LICENSE file in the root directory of this source tree. */ -// Import portions of React that are needed. -import React from 'react'; +import { BEACON_KIND, useCoachmark } from '../Coachmark'; // Other standard imports. import PropTypes from 'prop-types'; +// Import portions of React that are needed. +import React from 'react'; import cx from 'classnames'; -import { BEACON_KIND, useCoachmark } from '../Coachmark'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; +import { pkg } from '../../settings'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--coachmark-beacon`; @@ -24,7 +23,7 @@ const defaults = { kind: 'default', }; -interface CoachmarkBeaconProps { +export interface CoachmarkBeaconProps { /** * Optional class name for this component. */ diff --git a/packages/ibm-products/src/components/CoachmarkBeacon/index.js b/packages/ibm-products/src/components/CoachmarkBeacon/index.ts similarity index 78% rename from packages/ibm-products/src/components/CoachmarkBeacon/index.js rename to packages/ibm-products/src/components/CoachmarkBeacon/index.ts index 617d8c59bb..c6251536fe 100644 --- a/packages/ibm-products/src/components/CoachmarkBeacon/index.js +++ b/packages/ibm-products/src/components/CoachmarkBeacon/index.ts @@ -6,3 +6,4 @@ */ export { CoachmarkBeacon } from './CoachmarkBeacon'; +export type { CoachmarkBeaconProps } from './CoachmarkBeacon'; diff --git a/packages/ibm-products/src/components/CoachmarkButton/CoachmarkButton.tsx b/packages/ibm-products/src/components/CoachmarkButton/CoachmarkButton.tsx index 3e57d3c2bd..a975c94bc6 100644 --- a/packages/ibm-products/src/components/CoachmarkButton/CoachmarkButton.tsx +++ b/packages/ibm-products/src/components/CoachmarkButton/CoachmarkButton.tsx @@ -5,21 +5,20 @@ * LICENSE file in the root directory of this source tree. */ -// Import portions of React that are needed. -import React from 'react'; - +import { Button } from '@carbon/react'; // Other standard imports. import PropTypes from 'prop-types'; +// Import portions of React that are needed. +import React from 'react'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; -import { Button } from '@carbon/react'; +import { pkg } from '../../settings'; import { useCoachmark } from '../Coachmark'; + // Carbon and package components we use. /* TODO: @import(s) of carbon components and other package components. */ -interface CoachmarkButtonProps { +export interface CoachmarkButtonProps { /** * Provide an optional class to be applied to the containing node. */ diff --git a/packages/ibm-products/src/components/CoachmarkButton/index.js b/packages/ibm-products/src/components/CoachmarkButton/index.ts similarity index 78% rename from packages/ibm-products/src/components/CoachmarkButton/index.js rename to packages/ibm-products/src/components/CoachmarkButton/index.ts index 64338ed870..db2f836ae0 100644 --- a/packages/ibm-products/src/components/CoachmarkButton/index.js +++ b/packages/ibm-products/src/components/CoachmarkButton/index.ts @@ -6,3 +6,4 @@ */ export { CoachmarkButton } from './CoachmarkButton'; +export type { CoachmarkButtonProps } from './CoachmarkButton'; diff --git a/packages/ibm-products/src/components/CoachmarkFixed/CoachmarkFixed.tsx b/packages/ibm-products/src/components/CoachmarkFixed/CoachmarkFixed.tsx index 3d0837c176..d58f5c3672 100644 --- a/packages/ibm-products/src/components/CoachmarkFixed/CoachmarkFixed.tsx +++ b/packages/ibm-products/src/components/CoachmarkFixed/CoachmarkFixed.tsx @@ -7,28 +7,26 @@ // Import portions of React that are needed. import React, { + ReactNode, + useCallback, useEffect, useRef, useState, - useCallback, - ReactNode, - TransitionEvent, } from 'react'; +import { COACHMARK_OVERLAY_KIND } from '../Coachmark/utils/enums'; +import { CoachmarkContext } from '../Coachmark/utils/context'; +import { CoachmarkOverlay } from '../Coachmark/CoachmarkOverlay'; +import { CoachmarkTagline } from '../Coachmark/CoachmarkTagline'; // Other standard imports. import PropTypes from 'prop-types'; +import { createPortal } from 'react-dom'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; - -import { createPortal } from 'react-dom'; -import { CoachmarkOverlay } from '../Coachmark/CoachmarkOverlay'; -import { CoachmarkTagline } from '../Coachmark/CoachmarkTagline'; -import { CoachmarkContext } from '../Coachmark/utils/context'; -import { COACHMARK_OVERLAY_KIND } from '../Coachmark/utils/enums'; +import { pkg } from '../../settings'; import { useIsomorphicEffect } from '../../global/js/hooks'; import { useReducedMotion } from 'framer-motion'; + // Carbon and package components we use. /* TODO: @import(s) of carbon components and other package components. */ @@ -38,7 +36,7 @@ const blockClass = `${coachmarkClass}-fixed`; const overlayBlockClass = `${coachmarkClass}-overlay`; const componentName = 'CoachmarkFixed'; -interface CoachmarkFixedProps { +export interface CoachmarkFixedProps { /** * CoachmarkFixed should use a single CoachmarkOverlayElements component as a child. */ diff --git a/packages/ibm-products/src/components/CoachmarkFixed/index.js b/packages/ibm-products/src/components/CoachmarkFixed/index.ts similarity index 79% rename from packages/ibm-products/src/components/CoachmarkFixed/index.js rename to packages/ibm-products/src/components/CoachmarkFixed/index.ts index 446f3e263d..8ed30dffe7 100644 --- a/packages/ibm-products/src/components/CoachmarkFixed/index.js +++ b/packages/ibm-products/src/components/CoachmarkFixed/index.ts @@ -6,3 +6,4 @@ */ export { CoachmarkFixed } from './CoachmarkFixed'; +export type { CoachmarkFixedProps } from './CoachmarkFixed'; diff --git a/packages/ibm-products/src/components/CoachmarkOverlayElement/CoachmarkOverlayElement.tsx b/packages/ibm-products/src/components/CoachmarkOverlayElement/CoachmarkOverlayElement.tsx index 0bb3da1807..2fd67db85c 100644 --- a/packages/ibm-products/src/components/CoachmarkOverlayElement/CoachmarkOverlayElement.tsx +++ b/packages/ibm-products/src/components/CoachmarkOverlayElement/CoachmarkOverlayElement.tsx @@ -11,15 +11,14 @@ import React, { ReactNode } from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; +import { pkg } from '../../settings'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--coachmark-overlay-element`; const componentName = 'CoachmarkOverlayElement'; -interface CoachmarkOverlayElementProps { +export interface CoachmarkOverlayElementProps { /** * An optional button can be rendered below the description. * This can be a link, button, Coachmark button, etc. diff --git a/packages/ibm-products/src/components/CoachmarkOverlayElement/index.js b/packages/ibm-products/src/components/CoachmarkOverlayElement/index.ts similarity index 75% rename from packages/ibm-products/src/components/CoachmarkOverlayElement/index.js rename to packages/ibm-products/src/components/CoachmarkOverlayElement/index.ts index 4bb94cca8a..937cd1c894 100644 --- a/packages/ibm-products/src/components/CoachmarkOverlayElement/index.js +++ b/packages/ibm-products/src/components/CoachmarkOverlayElement/index.ts @@ -6,3 +6,4 @@ */ export { CoachmarkOverlayElement } from './CoachmarkOverlayElement'; +export type { CoachmarkOverlayElementProps } from './CoachmarkOverlayElement'; diff --git a/packages/ibm-products/src/components/CoachmarkOverlayElements/CoachmarkOverlayElements.tsx b/packages/ibm-products/src/components/CoachmarkOverlayElements/CoachmarkOverlayElements.tsx index 424a1ba666..f5f380770a 100644 --- a/packages/ibm-products/src/components/CoachmarkOverlayElements/CoachmarkOverlayElements.tsx +++ b/packages/ibm-products/src/components/CoachmarkOverlayElements/CoachmarkOverlayElements.tsx @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +// Carbon and package components we use. +import { Button, ButtonProps } from '@carbon/react'; // Import portions of React that are needed. import React, { Children, @@ -15,28 +17,25 @@ import React, { useState, } from 'react'; +//TODO THIS PATH WILL NEED TO BE UPDATED ONCE IN IBM PRODUCTS +import { Carousel } from '../Carousel'; +import { CarouselProps } from '../Carousel/Carousel'; // Other standard imports. import PropTypes from 'prop-types'; +//TODO THIS PATH WILL NEED TO BE UPDATED ONCE IN IBM PRODUCTS +import { SteppedAnimatedMedia } from '../SteppedAnimatedMedia'; +import { clamp } from 'lodash'; import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; - -// Carbon and package components we use. -import { Button, ButtonProps } from '@carbon/react'; -import { useCoachmark } from '../Coachmark'; -import { clamp } from 'lodash'; import pconsole from '../../global/js/utils/pconsole'; -//TODO THIS PATH WILL NEED TO BE UPDATED ONCE IN IBM PRODUCTS -import { Carousel } from '../Carousel'; -//TODO THIS PATH WILL NEED TO BE UPDATED ONCE IN IBM PRODUCTS -import { SteppedAnimatedMedia } from '../SteppedAnimatedMedia'; -import { CarouselProps } from '../Carousel/Carousel'; +import { pkg } from '../../settings'; +import { useCoachmark } from '../Coachmark'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--coachmark-overlay-elements`; const componentName = 'CoachmarkOverlayElements'; -interface CoachmarkOverlayElementsProps { +export interface CoachmarkOverlayElementsProps { /** * CoachmarkOverlayElements should be used with one or many CoachmarkOverlayElement components as children. * @see CoachmarkOverlayElement diff --git a/packages/ibm-products/src/components/CoachmarkOverlayElements/index.js b/packages/ibm-products/src/components/CoachmarkOverlayElements/index.ts similarity index 75% rename from packages/ibm-products/src/components/CoachmarkOverlayElements/index.js rename to packages/ibm-products/src/components/CoachmarkOverlayElements/index.ts index 845cd69c52..985e5e277d 100644 --- a/packages/ibm-products/src/components/CoachmarkOverlayElements/index.js +++ b/packages/ibm-products/src/components/CoachmarkOverlayElements/index.ts @@ -6,3 +6,4 @@ */ export { CoachmarkOverlayElements } from './CoachmarkOverlayElements'; +export type { CoachmarkOverlayElementsProps } from './CoachmarkOverlayElements'; diff --git a/packages/ibm-products/src/components/ComboButton/ComboButton.tsx b/packages/ibm-products/src/components/ComboButton/ComboButton.tsx index 0d8c23b327..bece3a60e3 100644 --- a/packages/ibm-products/src/components/ComboButton/ComboButton.tsx +++ b/packages/ibm-products/src/components/ComboButton/ComboButton.tsx @@ -5,31 +5,28 @@ * LICENSE file in the root directory of this source tree. */ +import { Button, OverflowMenu, OverflowMenuItem } from '@carbon/react'; import { ChevronDown, ChevronUp } from '@carbon/react/icons'; - -import { Button, OverflowMenuItem, OverflowMenu } from '@carbon/react'; - -import classnames from 'classnames'; -import { node, shape, string } from 'prop-types'; -import uuidv4 from '../../global/js/utils/uuidv4'; - import React, { Children, ComponentProps, + PropsWithChildren, + ReactNode, createElement, + forwardRef, useRef, useState, - ReactNode, - PropsWithChildren, - forwardRef, } from 'react'; +import { node, shape, string } from 'prop-types'; +import classnames from 'classnames'; import { pkg } from '../../settings'; +import uuidv4 from '../../global/js/utils/uuidv4'; const blockClass = `${pkg.prefix}--combo-button`; const componentName = 'ComboButton'; -interface ComboButtonProps extends ComponentProps<'div'> { +export interface ComboButtonProps extends ComponentProps<'div'> { /** Provide the contents of the `ComboButton` */ children?: ReactNode; diff --git a/packages/ibm-products/src/components/ComboButton/index.js b/packages/ibm-products/src/components/ComboButton/index.ts similarity index 83% rename from packages/ibm-products/src/components/ComboButton/index.js rename to packages/ibm-products/src/components/ComboButton/index.ts index bbc9552988..5a9037867d 100644 --- a/packages/ibm-products/src/components/ComboButton/index.js +++ b/packages/ibm-products/src/components/ComboButton/index.ts @@ -7,3 +7,4 @@ export { ComboButton } from './ComboButton'; export { ComboButtonItem } from './ComboButtonItem'; +export type { ComboButtonProps } from './ComboButton'; diff --git a/packages/ibm-products/src/components/CreateFullPage/CreateFullPage.tsx b/packages/ibm-products/src/components/CreateFullPage/CreateFullPage.tsx index 60fa34bc7a..a00bdc20b7 100644 --- a/packages/ibm-products/src/components/CreateFullPage/CreateFullPage.tsx +++ b/packages/ibm-products/src/components/CreateFullPage/CreateFullPage.tsx @@ -5,47 +5,45 @@ * LICENSE file in the root directory of this source tree. */ +// Carbon and package components we use. +import { + Button, + ComposedModal, + Form, + ModalBody, + ModalFooter, + ModalHeader, +} from '@carbon/react'; // Import portions of React that are needed. import React, { + ForwardedRef, + ReactNode, + createContext, useEffect, useState, - createContext, - ReactNode, - ForwardedRef, } from 'react'; - -// Other standard imports. -import PropTypes from 'prop-types'; -import cx from 'classnames'; - -import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg } from '../../settings'; - -// Carbon and package components we use. import { - ModalFooter, - ComposedModal, - ModalHeader, - ModalBody, - Button, - Form, -} from '@carbon/react'; -import { CreateInfluencer } from '../CreateInfluencer'; -import { ActionSet } from '../ActionSet'; + SimpleHeader, + overflowAriaLabel_required_if_breadcrumbs_exist, +} from '../SimpleHeader/SimpleHeader'; import { - usePreviousValue, - useValidCreateStepCount, - useResetCreateComponent, useCreateComponentFocus, useCreateComponentStepChange, + usePreviousValue, + useResetCreateComponent, + useValidCreateStepCount, } from '../../global/js/hooks'; -import { lastIndexInArray } from '../../global/js/utils/lastIndexInArray'; -import { getNumberOfHiddenSteps } from '../../global/js/utils/getNumberOfHiddenSteps'; -import { - SimpleHeader, - overflowAriaLabel_required_if_breadcrumbs_exist, -} from '../SimpleHeader/SimpleHeader'; + +import { ActionSet } from '../ActionSet'; +import { CreateInfluencer } from '../CreateInfluencer'; +// Other standard imports. +import PropTypes from 'prop-types'; import { StepsContextType } from '../CreateTearsheet/CreateTearsheet'; +import cx from 'classnames'; +import { getDevtoolsProps } from '../../global/js/utils/devtools'; +import { getNumberOfHiddenSteps } from '../../global/js/utils/getNumberOfHiddenSteps'; +import { lastIndexInArray } from '../../global/js/utils/lastIndexInArray'; +import { pkg } from '../../settings'; const blockClass = `${pkg.prefix}--create-full-page`; const componentName = 'CreateFullPage'; @@ -193,7 +191,7 @@ type CreateFullPageBaseProps = { title?: string; }; -type CreateFullPageProps = CreateFullPageBaseProps & +export type CreateFullPageProps = CreateFullPageBaseProps & CreateFullPageBreadcrumbsProps; interface Step { diff --git a/packages/ibm-products/src/components/CreateFullPage/index.js b/packages/ibm-products/src/components/CreateFullPage/index.ts similarity index 82% rename from packages/ibm-products/src/components/CreateFullPage/index.js rename to packages/ibm-products/src/components/CreateFullPage/index.ts index c9c72f0e7e..4f5f360f54 100644 --- a/packages/ibm-products/src/components/CreateFullPage/index.js +++ b/packages/ibm-products/src/components/CreateFullPage/index.ts @@ -7,3 +7,4 @@ export { CreateFullPage } from './CreateFullPage'; export { CreateFullPageStep } from './CreateFullPageStep'; +export type { CreateFullPageProps } from './CreateFullPage'; diff --git a/packages/ibm-products/src/components/CreateModal/CreateModal.tsx b/packages/ibm-products/src/components/CreateModal/CreateModal.tsx index 64725acacd..2b9a751cd4 100644 --- a/packages/ibm-products/src/components/CreateModal/CreateModal.tsx +++ b/packages/ibm-products/src/components/CreateModal/CreateModal.tsx @@ -5,22 +5,20 @@ * LICENSE file in the root directory of this source tree. */ -// Import portions of React that are needed. -import React, { PropsWithChildren, ReactNode } from 'react'; - // Carbon and package components we use. import { + Button, ComposedModal, - ModalHeader, - ModalFooter, - ModalBody, Form, - Button, + ModalBody, + ModalFooter, + ModalHeader, } from '@carbon/react'; +// Import portions of React that are needed. +import React, { PropsWithChildren, ReactNode } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; import { pkg } from '../../settings'; import { usePortalTarget } from '../../global/js/hooks/usePortalTarget'; @@ -40,7 +38,8 @@ const isValidChildren = return; }; -interface CreateModalProps extends React.ComponentProps { +export interface CreateModalProps + extends React.ComponentProps { /** * Specify an optional className to be applied to the modal root node */ diff --git a/packages/ibm-products/src/components/CreateModal/index.js b/packages/ibm-products/src/components/CreateModal/index.ts similarity index 84% rename from packages/ibm-products/src/components/CreateModal/index.js rename to packages/ibm-products/src/components/CreateModal/index.ts index 02f568462e..c9cf6eefe7 100644 --- a/packages/ibm-products/src/components/CreateModal/index.js +++ b/packages/ibm-products/src/components/CreateModal/index.ts @@ -8,3 +8,4 @@ // NOTE: An index file is most useful when you have multiple components export { CreateModal } from './CreateModal'; +export type { CreateModalProps } from './CreateModal'; diff --git a/packages/ibm-products/src/components/CreateSidePanel/index.js b/packages/ibm-products/src/components/CreateSidePanel/index.ts similarity index 100% rename from packages/ibm-products/src/components/CreateSidePanel/index.js rename to packages/ibm-products/src/components/CreateSidePanel/index.ts diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx index 7b45ffbf40..90a3a7a03a 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx +++ b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheet.tsx @@ -6,33 +6,34 @@ */ import React, { - forwardRef, - useState, - useRef, - createContext, - useEffect, - ReactNode, + Dispatch, ForwardedRef, PropsWithChildren, - Dispatch, + ReactNode, SetStateAction, + createContext, + forwardRef, + useEffect, + useRef, + useState, } from 'react'; -import PropTypes from 'prop-types'; -import cx from 'classnames'; -import { Form } from '@carbon/react'; -import { TearsheetShell } from '../Tearsheet/TearsheetShell'; -import { CreateInfluencer } from '../CreateInfluencer'; -import { pkg } from '../../settings'; import { - usePreviousValue, - useValidCreateStepCount, - useResetCreateComponent, useCreateComponentFocus, useCreateComponentStepChange, + usePreviousValue, + useResetCreateComponent, + useValidCreateStepCount, } from '../../global/js/hooks'; + +import { CreateInfluencer } from '../CreateInfluencer'; +import { Form } from '@carbon/react'; +import PropTypes from 'prop-types'; +import { TearsheetShell } from '../Tearsheet/TearsheetShell'; +import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { lastIndexInArray } from '../../global/js/utils/lastIndexInArray'; import { getNumberOfHiddenSteps } from '../../global/js/utils/getNumberOfHiddenSteps'; +import { lastIndexInArray } from '../../global/js/utils/lastIndexInArray'; +import { pkg } from '../../settings'; const componentName = 'CreateTearsheet'; const blockClass = `${pkg.prefix}--tearsheet-create`; @@ -56,7 +57,7 @@ export const StepsContext = createContext(null); // to let it know what number it is in the sequence of steps export const StepNumberContext = createContext(-1); -interface CreateTearsheetProps extends PropsWithChildren { +export interface CreateTearsheetProps extends PropsWithChildren { /** * The back button text */ diff --git a/packages/ibm-products/src/components/CreateTearsheet/index.js b/packages/ibm-products/src/components/CreateTearsheet/index.ts similarity index 85% rename from packages/ibm-products/src/components/CreateTearsheet/index.js rename to packages/ibm-products/src/components/CreateTearsheet/index.ts index f613099354..48cf04bd37 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/index.js +++ b/packages/ibm-products/src/components/CreateTearsheet/index.ts @@ -8,3 +8,4 @@ export { CreateTearsheet } from './CreateTearsheet'; export { CreateTearsheetStep } from './CreateTearsheetStep'; export { CreateTearsheetDivider } from './CreateTearsheetDivider'; +export type { CreateTearsheetProps } from './CreateTearsheet'; diff --git a/packages/ibm-products/src/components/CreateTearsheetNarrow/CreateTearsheetNarrow.tsx b/packages/ibm-products/src/components/CreateTearsheetNarrow/CreateTearsheetNarrow.tsx index 7999245155..70a43f517e 100644 --- a/packages/ibm-products/src/components/CreateTearsheetNarrow/CreateTearsheetNarrow.tsx +++ b/packages/ibm-products/src/components/CreateTearsheetNarrow/CreateTearsheetNarrow.tsx @@ -8,15 +8,13 @@ // Import portions of React that are needed. import React, { PropsWithChildren, ReactNode } from 'react'; +import { Form } from '@carbon/react'; // Other standard imports. import PropTypes from 'prop-types'; +import { TearsheetNarrow } from '../Tearsheet/TearsheetNarrow'; import cx from 'classnames'; -import { Form } from '@carbon/react'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; import { pkg } from '../../settings'; - -import { TearsheetNarrow } from '../Tearsheet/TearsheetNarrow'; import uuidv4 from '../../global/js/utils/uuidv4'; // The block part of our conventional BEM class names (blockClass__E--M). @@ -26,7 +24,7 @@ const componentName = 'CreateTearsheetNarrow'; // NOTE: the component SCSS is not imported here: it is rolled up separately. type VerticalPosition = 'normal' | 'lower'; -interface CreateTearsheetNarrowProps extends PropsWithChildren { +export interface CreateTearsheetNarrowProps extends PropsWithChildren { /** * Provide the contents of the CreateTearsheetNarrow. */ diff --git a/packages/ibm-products/src/components/CreateTearsheetNarrow/index.js b/packages/ibm-products/src/components/CreateTearsheetNarrow/index.ts similarity index 76% rename from packages/ibm-products/src/components/CreateTearsheetNarrow/index.js rename to packages/ibm-products/src/components/CreateTearsheetNarrow/index.ts index e44cfbe26c..8c15bfc01d 100644 --- a/packages/ibm-products/src/components/CreateTearsheetNarrow/index.js +++ b/packages/ibm-products/src/components/CreateTearsheetNarrow/index.ts @@ -6,3 +6,4 @@ */ export { CreateTearsheetNarrow } from './CreateTearsheetNarrow'; +export type { CreateTearsheetNarrowProps } from './CreateTearsheetNarrow'; diff --git a/packages/ibm-products/src/components/DataSpreadsheet/DataSpreadsheet.tsx b/packages/ibm-products/src/components/DataSpreadsheet/DataSpreadsheet.tsx index e8ed282798..257cb05753 100644 --- a/packages/ibm-products/src/components/DataSpreadsheet/DataSpreadsheet.tsx +++ b/packages/ibm-products/src/components/DataSpreadsheet/DataSpreadsheet.tsx @@ -5,57 +5,52 @@ * LICENSE file in the root directory of this source tree. */ +import { ActiveCellCoordinates, PrevState, Size, Theme } from './types'; +import { + Column, + TableInstance, + UseColumnOrderInstanceProps, + useBlockLayout, + useColumnOrder, + useTable, +} from 'react-table'; // Import portions of React that are needed. import React, { + ForwardedRef, + LegacyRef, + MutableRefObject, + useCallback, + useEffect, useMemo, useRef, useState, - useCallback, - useEffect, - ForwardedRef, - MutableRefObject, - LegacyRef, } from 'react'; -import { - useBlockLayout, - useTable, - useColumnOrder, - Column, - UseColumnOrderInstanceProps, - TableInstance, -} from 'react-table'; - -// Other standard imports. -import PropTypes from 'prop-types'; -import cx from 'classnames'; - -import { pkg } from '../../settings'; -import { DataSpreadsheetBody } from './DataSpreadsheetBody'; -import { DataSpreadsheetHeader } from './DataSpreadsheetHeader'; - -import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { getScrollbarWidth } from '../../global/js/utils/getScrollbarWidth'; import { useActiveElement, usePreviousValue } from '../../global/js/hooks'; -import uuidv4 from '../../global/js/utils/uuidv4'; -import { deepCloneObject } from '../../global/js/utils/deepCloneObject'; - import { - useResetSpreadsheetFocus, - useSpreadsheetOutsideClick, useMoveActiveCell, useMultipleKeyTracking, + useResetSpreadsheetFocus, useSpreadsheetEdit, + useSpreadsheetOutsideClick, } from './hooks'; +import { DataSpreadsheetBody } from './DataSpreadsheetBody'; +import { DataSpreadsheetHeader } from './DataSpreadsheetHeader'; +// Other standard imports. +import PropTypes from 'prop-types'; import { createActiveCellFn } from './utils/createActiveCellFn'; +import cx from 'classnames'; +import { deepCloneObject } from '../../global/js/utils/deepCloneObject'; import { getCellSize } from './utils/getCellSize'; - +import { getDevtoolsProps } from '../../global/js/utils/devtools'; +import { getScrollbarWidth } from '../../global/js/utils/getScrollbarWidth'; +import { handleEditSubmit } from './utils/handleEditSubmit'; import { handleHeaderCellSelection } from './utils/handleHeaderCellSelection'; +import { handleKeyPress } from './utils/commonEventHandlers'; +import { pkg } from '../../settings'; import { removeCellSelections } from './utils/removeCellSelections'; import { selectAllCells } from './utils/selectAllCells'; -import { handleEditSubmit } from './utils/handleEditSubmit'; -import { handleKeyPress } from './utils/commonEventHandlers'; -import { ActiveCellCoordinates, PrevState, Size, Theme } from './types'; +import uuidv4 from '../../global/js/utils/uuidv4'; // The block part of our conventional BEM class names (blockClass__E--M). const blockClass = `${pkg.prefix}--data-spreadsheet`; @@ -73,7 +68,7 @@ const defaults = { theme: 'light', }; -interface DataSpreadsheetProps { +export interface DataSpreadsheetProps { /** * Specifies the cell height */ diff --git a/packages/ibm-products/src/components/DataSpreadsheet/index.js b/packages/ibm-products/src/components/DataSpreadsheet/index.ts similarity index 78% rename from packages/ibm-products/src/components/DataSpreadsheet/index.js rename to packages/ibm-products/src/components/DataSpreadsheet/index.ts index 6dccc9fcde..9412540a9a 100644 --- a/packages/ibm-products/src/components/DataSpreadsheet/index.js +++ b/packages/ibm-products/src/components/DataSpreadsheet/index.ts @@ -6,3 +6,4 @@ */ export { DataSpreadsheet } from './DataSpreadsheet'; +export type { DataSpreadsheetProps } from './DataSpreadsheet'; diff --git a/packages/ibm-products/src/components/DelimitedList/DelimitedList.tsx b/packages/ibm-products/src/components/DelimitedList/DelimitedList.tsx index b3c6e1fa75..172751fe3f 100644 --- a/packages/ibm-products/src/components/DelimitedList/DelimitedList.tsx +++ b/packages/ibm-products/src/components/DelimitedList/DelimitedList.tsx @@ -11,7 +11,6 @@ import React, { PropsWithChildren } from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; import { pkg } from '../../settings'; @@ -23,7 +22,7 @@ const defaults = { items: [], truncate: true, }; -interface DelimitedListProps extends PropsWithChildren { +export interface DelimitedListProps extends PropsWithChildren { /** * Provide an optional class to be applied to the containing node. */ diff --git a/packages/ibm-products/src/components/DelimitedList/index.js b/packages/ibm-products/src/components/DelimitedList/index.ts similarity index 79% rename from packages/ibm-products/src/components/DelimitedList/index.js rename to packages/ibm-products/src/components/DelimitedList/index.ts index cf09db7101..b6e25f5848 100644 --- a/packages/ibm-products/src/components/DelimitedList/index.js +++ b/packages/ibm-products/src/components/DelimitedList/index.ts @@ -6,3 +6,4 @@ */ export { DelimitedList } from './DelimitedList'; +export type { DelimitedListProps } from './DelimitedList'; diff --git a/packages/ibm-products/src/components/EditFullPage/EditFullPage.tsx b/packages/ibm-products/src/components/EditFullPage/EditFullPage.tsx index 0431c18395..5aaa1cf5e1 100644 --- a/packages/ibm-products/src/components/EditFullPage/EditFullPage.tsx +++ b/packages/ibm-products/src/components/EditFullPage/EditFullPage.tsx @@ -6,14 +6,13 @@ */ // Import portions of React that are needed. -import React, { ReactNode, ForwardedRef } from 'react'; +import React, { ForwardedRef, ReactNode } from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; +import { pkg } from '../../settings'; // Carbon and package components we use. /* TODO: @import(s) of carbon components and other package components. */ @@ -33,7 +32,7 @@ const componentName = 'EditFullPage'; // Default values should be provided when the component needs to make a choice // or assumption when a prop is not supplied. -interface EditFullPageProps { +export interface EditFullPageProps { /** * Provide an optional class to be applied to the containing node. */ diff --git a/packages/ibm-products/src/components/EditFullPage/index.js b/packages/ibm-products/src/components/EditFullPage/index.ts similarity index 79% rename from packages/ibm-products/src/components/EditFullPage/index.js rename to packages/ibm-products/src/components/EditFullPage/index.ts index e0af0257a7..efb57c55a1 100644 --- a/packages/ibm-products/src/components/EditFullPage/index.js +++ b/packages/ibm-products/src/components/EditFullPage/index.ts @@ -6,3 +6,4 @@ */ export { EditFullPage } from './EditFullPage'; +export type { EditFullPageProps } from './EditFullPage'; diff --git a/packages/ibm-products/src/components/EditInPlace/EditInPlace.tsx b/packages/ibm-products/src/components/EditInPlace/EditInPlace.tsx index 17f6f2ac49..1efdae79b1 100644 --- a/packages/ibm-products/src/components/EditInPlace/EditInPlace.tsx +++ b/packages/ibm-products/src/components/EditInPlace/EditInPlace.tsx @@ -5,24 +5,19 @@ * LICENSE file in the root directory of this source tree. */ +import { Checkmark, Close, Edit, WarningFilled } from '@carbon/react/icons'; import React, { - useState, - useEffect, + PropsWithChildren, forwardRef, + useEffect, useRef, - PropsWithChildren, + useState, } from 'react'; +import { carbon, pkg } from '../../settings'; + import { IconButton } from '@carbon/react'; -import cx from 'classnames'; import PropTypes from 'prop-types'; -import { - Edit, - Checkmark, - Close, - // EditOff, - WarningFilled, -} from '@carbon/react/icons'; -import { pkg, carbon } from '../../settings'; +import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; const componentName = 'EditInPlace'; @@ -49,7 +44,7 @@ type Shape = { save: AlignPropType; }; -interface EditInplaceProps extends PropsWithChildren { +export interface EditInplaceProps extends PropsWithChildren { /** * label for cancel button */ diff --git a/packages/ibm-products/src/components/EditInPlace/index.js b/packages/ibm-products/src/components/EditInPlace/index.ts similarity index 80% rename from packages/ibm-products/src/components/EditInPlace/index.js rename to packages/ibm-products/src/components/EditInPlace/index.ts index 72e5c1074f..5efb4d692b 100644 --- a/packages/ibm-products/src/components/EditInPlace/index.js +++ b/packages/ibm-products/src/components/EditInPlace/index.ts @@ -6,3 +6,4 @@ */ export { EditInPlace } from './EditInPlace'; +export type { EditInplaceProps } from './EditInPlace'; diff --git a/packages/ibm-products/src/components/EditSidePanel/EditSidePanel.tsx b/packages/ibm-products/src/components/EditSidePanel/EditSidePanel.tsx index e835d119bb..ecb5b006ae 100644 --- a/packages/ibm-products/src/components/EditSidePanel/EditSidePanel.tsx +++ b/packages/ibm-products/src/components/EditSidePanel/EditSidePanel.tsx @@ -5,20 +5,19 @@ * LICENSE file in the root directory of this source tree. */ +import '../../global/js/utils/props-helper'; + // Import portions of React that are needed. import React, { ForwardedRef, ReactNode } from 'react'; +// Carbon and package components we use. +import { Form } from '@carbon/react'; // Other standard imports. import PropTypes from 'prop-types'; +import { SidePanel } from '../SidePanel'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; - -// Carbon and package components we use. -import { Form } from '@carbon/react'; -import { SidePanel } from '../SidePanel'; -import '../../global/js/utils/props-helper'; +import { pkg } from '../../settings'; import uuidv4 from '../../global/js/utils/uuidv4'; // The block part of our conventional BEM class names (blockClass__E--M). @@ -27,7 +26,7 @@ const componentName = 'EditSidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately. -interface EditSidePanelProps { +export interface EditSidePanelProps { /** * Sets the body content of the create side panel */ diff --git a/packages/ibm-products/src/components/EditSidePanel/index.js b/packages/ibm-products/src/components/EditSidePanel/index.ts similarity index 79% rename from packages/ibm-products/src/components/EditSidePanel/index.js rename to packages/ibm-products/src/components/EditSidePanel/index.ts index 448c8d999c..95743f7ddb 100644 --- a/packages/ibm-products/src/components/EditSidePanel/index.js +++ b/packages/ibm-products/src/components/EditSidePanel/index.ts @@ -6,3 +6,4 @@ */ export { EditSidePanel } from './EditSidePanel'; +export type { EditSidePanelProps } from './EditSidePanel'; diff --git a/packages/ibm-products/src/components/EditTearsheetNarrow/EditTearsheetNarrow.tsx b/packages/ibm-products/src/components/EditTearsheetNarrow/EditTearsheetNarrow.tsx index cffd6f65ef..294541a385 100644 --- a/packages/ibm-products/src/components/EditTearsheetNarrow/EditTearsheetNarrow.tsx +++ b/packages/ibm-products/src/components/EditTearsheetNarrow/EditTearsheetNarrow.tsx @@ -11,9 +11,8 @@ import React, { ForwardedRef, ReactNode } from 'react'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; +import { pkg } from '../../settings'; // Carbon and package components we use. /* TODO: @import(s) of carbon components and other package components. */ @@ -38,7 +37,7 @@ const componentName = 'EditTearsheetNarrow'; // /* TODO: add defaults for relevant props if needed */ // }; -interface EditTearsheetNarrowProps { +export interface EditTearsheetNarrowProps { /** * Provide the contents of the EditTearsheetNarrow. */ diff --git a/packages/ibm-products/src/components/EditTearsheetNarrow/index.js b/packages/ibm-products/src/components/EditTearsheetNarrow/index.ts similarity index 77% rename from packages/ibm-products/src/components/EditTearsheetNarrow/index.js rename to packages/ibm-products/src/components/EditTearsheetNarrow/index.ts index 88e8fdd972..c03db945c5 100644 --- a/packages/ibm-products/src/components/EditTearsheetNarrow/index.js +++ b/packages/ibm-products/src/components/EditTearsheetNarrow/index.ts @@ -6,3 +6,4 @@ */ export { EditTearsheetNarrow } from './EditTearsheetNarrow'; +export type { EditTearsheetNarrowProps } from './EditTearsheetNarrow'; diff --git a/packages/ibm-products/src/components/EditUpdateCards/EditUpdateCards.tsx b/packages/ibm-products/src/components/EditUpdateCards/EditUpdateCards.tsx index 745eeb3142..9f430447e5 100644 --- a/packages/ibm-products/src/components/EditUpdateCards/EditUpdateCards.tsx +++ b/packages/ibm-products/src/components/EditUpdateCards/EditUpdateCards.tsx @@ -8,14 +8,13 @@ // Import portions of React that are needed. import React, { ForwardedRef, ReactNode } from 'react'; +import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon'; +import { ProductiveCard } from '../ProductiveCard'; // Other standard imports. import PropTypes from 'prop-types'; import cx from 'classnames'; - import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { pkg /*, carbon */ } from '../../settings'; -import { ProductiveCard } from '../ProductiveCard'; -import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon'; +import { pkg } from '../../settings'; // import { children } from 'cheerio/lib/api/traversing'; @@ -46,7 +45,8 @@ type ActionIcon = { href?: string; }; type PlacementType = 'top' | 'bottom'; -interface EditUpdateCardsProps { + +export interface EditUpdateCardsProps { /** * Icons that are displayed on card. Refer to design documentation for implementation guidelines */ diff --git a/packages/ibm-products/src/components/EditUpdateCards/index.js b/packages/ibm-products/src/components/EditUpdateCards/index.ts similarity index 78% rename from packages/ibm-products/src/components/EditUpdateCards/index.js rename to packages/ibm-products/src/components/EditUpdateCards/index.ts index 0a24cea242..8ab893fdef 100644 --- a/packages/ibm-products/src/components/EditUpdateCards/index.js +++ b/packages/ibm-products/src/components/EditUpdateCards/index.ts @@ -6,3 +6,4 @@ */ export { EditUpdateCards } from './EditUpdateCards'; +export type { EditUpdateCardsProps } from './EditUpdateCards'; diff --git a/packages/ibm-products/src/components/ExportModal/ExportModal.tsx b/packages/ibm-products/src/components/ExportModal/ExportModal.tsx index da92e25d3d..ba95670492 100644 --- a/packages/ibm-products/src/components/ExportModal/ExportModal.tsx +++ b/packages/ibm-products/src/components/ExportModal/ExportModal.tsx @@ -5,34 +5,34 @@ // LICENSE file in the root directory of this source tree. // -import React, { - useState, - useRef, - forwardRef, - useEffect, - ReactNode, -} from 'react'; import { Button, ComposedModal, - ModalHeader, - ModalFooter, - ModalBody, - TextInput, - RadioButton, - RadioButtonGroup, FormGroup, Loading, + ModalBody, + ModalFooter, + ModalHeader, PasswordInput, + RadioButton, + RadioButtonGroup, + TextInput, } from '@carbon/react'; -import cx from 'classnames'; -import { ErrorFilled, CheckmarkFilled } from '@carbon/react/icons'; -import PropTypes from 'prop-types'; +import { CheckmarkFilled, ErrorFilled } from '@carbon/react/icons'; +import React, { + ReactNode, + forwardRef, + useEffect, + useRef, + useState, +} from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import uuidv4 from '../../global/js/utils/uuidv4'; import { pkg } from '../../settings'; import { usePortalTarget } from '../../global/js/hooks/usePortalTarget'; +import uuidv4 from '../../global/js/utils/uuidv4'; const componentName = 'ExportModal'; @@ -49,7 +49,8 @@ type PreformattedExtensions = { extension?: string; description?: string; }; -interface RemoveModalProps extends React.ComponentProps { +export interface ExportModalProps + extends React.ComponentProps { /** * Body content for the modal */ @@ -183,7 +184,7 @@ export let ExportModal = forwardRef( // Collect any other property values passed in. ...rest - }: React.PropsWithChildren, + }: React.PropsWithChildren, ref ) => { const [name, setName] = useState(''); diff --git a/packages/ibm-products/src/components/ExportModal/index.js b/packages/ibm-products/src/components/ExportModal/index.ts similarity index 80% rename from packages/ibm-products/src/components/ExportModal/index.js rename to packages/ibm-products/src/components/ExportModal/index.ts index 662d9ccd15..f38a6dc852 100644 --- a/packages/ibm-products/src/components/ExportModal/index.js +++ b/packages/ibm-products/src/components/ExportModal/index.ts @@ -6,3 +6,4 @@ // export { ExportModal } from './ExportModal'; +export type { ExportModalProps } from './ExportModal'; diff --git a/packages/ibm-products/src/components/ExpressiveCard/ExpressiveCard.tsx b/packages/ibm-products/src/components/ExpressiveCard/ExpressiveCard.tsx index 1253588980..8b0b7f9144 100644 --- a/packages/ibm-products/src/components/ExpressiveCard/ExpressiveCard.tsx +++ b/packages/ibm-products/src/components/ExpressiveCard/ExpressiveCard.tsx @@ -6,13 +6,13 @@ // import React, { PropsWithChildren, ReactNode, forwardRef } from 'react'; -import PropTypes from 'prop-types'; + import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon'; import { Card } from '../Card'; - +import PropTypes from 'prop-types'; import { getDevtoolsProps } from '../../global/js/utils/devtools'; -import { prepareProps } from '../../global/js/utils/props-helper'; import { pkg } from '../../settings'; +import { prepareProps } from '../../global/js/utils/props-helper'; type ActionIcon = { id?: string; @@ -23,7 +23,7 @@ type ActionIcon = { href?: string; }; -interface ExpressiveCardProps extends PropsWithChildren { +export interface ExpressiveCardProps extends PropsWithChildren { /** * Icons that are displayed on card. Refer to design documentation for implementation guidelines. Note- href will supersede onClick */ diff --git a/packages/ibm-products/src/components/ExpressiveCard/index.js b/packages/ibm-products/src/components/ExpressiveCard/index.ts similarity index 78% rename from packages/ibm-products/src/components/ExpressiveCard/index.js rename to packages/ibm-products/src/components/ExpressiveCard/index.ts index 710bc783b9..cd52b314af 100644 --- a/packages/ibm-products/src/components/ExpressiveCard/index.js +++ b/packages/ibm-products/src/components/ExpressiveCard/index.ts @@ -6,3 +6,4 @@ // export { ExpressiveCard } from './ExpressiveCard'; +export type { ExpressiveCardProps } from './ExpressiveCard';