From 81879c6ee2073c142a7cb698a74da9ec2c9e1758 Mon Sep 17 00:00:00 2001 From: Sinta Augustine Date: Wed, 20 Mar 2024 11:31:36 +0530 Subject: [PATCH 1/3] fix(createtearsheetdivider): file type updated --- .../{CreateTearsheetDivider.js => CreateTearsheetDivider.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/ibm-products/src/components/CreateTearsheet/{CreateTearsheetDivider.js => CreateTearsheetDivider.tsx} (100%) diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.js b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx similarity index 100% rename from packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.js rename to packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx From 89c3da2841e601fef0631703a0f9a98086404c2d Mon Sep 17 00:00:00 2001 From: Sinta Augustine Date: Wed, 20 Mar 2024 12:12:48 +0530 Subject: [PATCH 2/3] feat(createtearsheetdivider): add typescript types --- .../CreateTearsheet/CreateTearsheetDivider.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx index 0dd473e51b..af6235a569 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx +++ b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx @@ -1,19 +1,28 @@ /** - * Copyright IBM Corp. 2021, 2021 + * 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. */ -import React, { forwardRef } from 'react'; +import React, { forwardRef, PropsWithChildren } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../settings'; const componentName = 'CreateTearsheetDivider'; const blockClass = `${pkg.prefix}--tearsheet-create__section--divider`; + +interface CreateTearsheetDividerProps { + /** Specifies an optional className to be added to the tearsheet divider */ + className?: string; +} + export let CreateTearsheetDivider = forwardRef( - ({ className, ...rest }, ref) => { + ( + { className, ...rest }: PropsWithChildren, + ref: React.Ref + ) => { return ; } ); @@ -26,7 +35,7 @@ CreateTearsheetDivider = pkg.checkComponentEnabled( CreateTearsheetDivider.propTypes = { /** - * Sets an optional className to be added to the tearsheet step + * Sets an optional className to be added to the tearsheet divider */ className: PropTypes.string, }; From a464746effd8081d9b0023cf55c185332210523b Mon Sep 17 00:00:00 2001 From: Sinta Augustine Date: Mon, 25 Mar 2024 12:44:24 +0530 Subject: [PATCH 3/3] fix(createtearsheetdivider): removed type propswithchildren --- .../CreateTearsheetDivider.tsx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx index af6235a569..95f92b0e2b 100644 --- a/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx +++ b/packages/ibm-products/src/components/CreateTearsheet/CreateTearsheetDivider.tsx @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { forwardRef, PropsWithChildren } from 'react'; +import React, { ForwardedRef, forwardRef } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import { pkg } from '../../settings'; @@ -18,14 +18,19 @@ interface CreateTearsheetDividerProps { className?: string; } -export let CreateTearsheetDivider = forwardRef( - ( - { className, ...rest }: PropsWithChildren, - ref: React.Ref - ) => { - return ; - } -); +export let CreateTearsheetDivider: React.FC = + forwardRef( + ( + { + className, + // Collect any other property values passed in + ...rest + }, + ref: ForwardedRef + ) => { + return ; + } + ); // Return a placeholder if not released and not enabled by feature flag CreateTearsheetDivider = pkg.checkComponentEnabled(