Skip to content

Commit f4b5d9f

Browse files
committed
refactor(NumberInputSkeleton): add typescript annotations
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.
1 parent c4bdb30 commit f4b5d9f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

packages/react/src/components/NumberInput/NumberInput.Skeleton.js renamed to packages/react/src/components/NumberInput/NumberInput.Skeleton.tsx

+18-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,27 @@
66
*/
77

88
import PropTypes from 'prop-types';
9-
import React from 'react';
9+
import React, { HTMLAttributes } from 'react';
1010
import cx from 'classnames';
1111
import { usePrefix } from '../../internal/usePrefix';
1212

13-
function NumberInputSkeleton({ hideLabel, className, ...rest }) {
13+
export interface NumberInputSkeletonProps
14+
extends HTMLAttributes<HTMLDivElement> {
15+
/**
16+
* Specify an optional className to add to the form item wrapper.
17+
*/
18+
className?: string;
19+
20+
/**
21+
* Specify whether the label should be hidden, or not
22+
*/
23+
hideLabel?: boolean;
24+
}
25+
function NumberInputSkeleton({
26+
hideLabel,
27+
className,
28+
...rest
29+
}: NumberInputSkeletonProps) {
1430
const prefix = usePrefix();
1531
return (
1632
<div className={cx(`${prefix}--form-item`, className)} {...rest}>

0 commit comments

Comments
 (0)