Skip to content

Commit

Permalink
refactor(NumberInputSkeleton): add typescript annotations
Browse files Browse the repository at this point in the history
Convert existing propType definitions to Typescript annotations on the
NumberInputSkeleton component. This is part of a broader effort to add
Typescript annotations to components, tracked in carbon-design-system#12513. Closes carbon-design-system#12549.

Type annotation changes only; no breaking feature changes.
  • Loading branch information
jpsorensen committed Dec 14, 2022
1 parent c4bdb30 commit f4b5d9f
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
*/

import PropTypes from 'prop-types';
import React from 'react';
import React, { HTMLAttributes } from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix';

function NumberInputSkeleton({ hideLabel, className, ...rest }) {
export interface NumberInputSkeletonProps
extends HTMLAttributes<HTMLDivElement> {
/**
* Specify an optional className to add to the form item wrapper.
*/
className?: string;

/**
* Specify whether the label should be hidden, or not
*/
hideLabel?: boolean;
}
function NumberInputSkeleton({
hideLabel,
className,
...rest
}: NumberInputSkeletonProps) {
const prefix = usePrefix();
return (
<div className={cx(`${prefix}--form-item`, className)} {...rest}>
Expand Down

0 comments on commit f4b5d9f

Please sign in to comment.