From 7427e94f858f1eb87b4ccccc45a4750aa85d9c65 Mon Sep 17 00:00:00 2001 From: guidari Date: Tue, 5 Mar 2024 15:36:07 -0300 Subject: [PATCH] fix: added hideLabel to dropdown family --- .../__snapshots__/PublicAPI-test.js.snap | 3 +++ .../components/Dropdown/Dropdown.Skeleton.tsx | 23 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 75e1c6b38f4b..c5be36655130 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -2990,6 +2990,9 @@ Map { "className": Object { "type": "string", }, + "hideLabel": Object { + "type": "bool", + }, "size": Object { "args": Array [ Array [ diff --git a/packages/react/src/components/Dropdown/Dropdown.Skeleton.tsx b/packages/react/src/components/Dropdown/Dropdown.Skeleton.tsx index 3f2cb75dfd6a..afc27489afd1 100644 --- a/packages/react/src/components/Dropdown/Dropdown.Skeleton.tsx +++ b/packages/react/src/components/Dropdown/Dropdown.Skeleton.tsx @@ -13,12 +13,26 @@ import { usePrefix } from '../../internal/usePrefix'; import { ReactAttr } from '../../types/common'; export interface DropdownSkeletonProps extends ReactAttr { + /** + * Specify an optional className to add. + */ + className?: string; + + /** + * Specify whether the label should be hidden, or not + */ + hideLabel?: boolean; + + /** + * Specify the size of the ListBox. + */ size?: ListBoxSize; } const DropdownSkeleton: React.FC = ({ className, size, + hideLabel, ...rest }: DropdownSkeletonProps) => { const prefix = usePrefix(); @@ -36,7 +50,9 @@ const DropdownSkeleton: React.FC = ({ return (
- + {!hideLabel && ( + + )}
); @@ -48,6 +64,11 @@ DropdownSkeleton.propTypes = { */ className: PropTypes.string, + /** + * Specify whether the label should be hidden, or not + */ + hideLabel: PropTypes.bool, + /** * Specify the size of the ListBox. */