diff --git a/packages/react/src/components/Select/Select.tsx b/packages/react/src/components/Select/Select.tsx index fada4c25..fb7f147b 100644 --- a/packages/react/src/components/Select/Select.tsx +++ b/packages/react/src/components/Select/Select.tsx @@ -21,11 +21,12 @@ import clsx from 'clsx'; import {forwardRef, ForwardRefExoticComponent, MutableRefObject, ReactElement} from 'react'; import {WithWrapperProps} from '../../models'; import {composeComponentDisplayName} from '../../utils'; -import Box from '../Box'; import InputLabel, {InputLabelProps as MuiInputLabelProps} from '../InputLabel'; -import './select.scss'; export interface SelectProps extends MuiSelectProps { + /** + * Props for the `InputLabel` component. + */ InputLabelProps?: MuiInputLabelProps; } @@ -33,25 +34,39 @@ const COMPONENT_NAME: string = 'Select'; const Select: ForwardRefExoticComponent & WithWrapperProps = forwardRef( (props: SelectProps, ref: MutableRefObject): ReactElement => { - const {className, InputLabelProps, label, id, ...rest} = props; + const {className, InputLabelProps, label, name, required, ...rest} = props; const classes: string = clsx('oxygen-select', className); + const labelProps: MuiInputLabelProps = { + ...{ + disableAnimation: true, + required, + shrink: false, + }, + ...InputLabelProps, + }; + return ( - + <> {label && ( - + {label} )} - - + + ); }, ) as ForwardRefExoticComponent & WithWrapperProps; Select.displayName = composeComponentDisplayName(COMPONENT_NAME); Select.muiName = COMPONENT_NAME; -Select.defaultProps = {}; +Select.defaultProps = { + InputLabelProps: { + disableAnimation: true, + shrink: false, + }, +}; export default Select; diff --git a/packages/react/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap b/packages/react/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap index 2d97e3cc..25aa116e 100644 --- a/packages/react/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +++ b/packages/react/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap @@ -4,56 +4,52 @@ exports[`Select should match the snapshot 1`] = `
- - - -
+ +
diff --git a/packages/react/src/components/Select/select.scss b/packages/react/src/components/Select/select.scss deleted file mode 100644 index 78b09832..00000000 --- a/packages/react/src/components/Select/select.scss +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -.oxygen-select { - /* Add Styles */ -} diff --git a/packages/react/src/components/Skeleton/Skeleton.tsx b/packages/react/src/components/Skeleton/Skeleton.tsx index 9fc404b0..7921d7ab 100644 --- a/packages/react/src/components/Skeleton/Skeleton.tsx +++ b/packages/react/src/components/Skeleton/Skeleton.tsx @@ -33,7 +33,7 @@ const Skeleton: FC & WithWrapperProps = ( ): ReactElement => { const {className, ...rest} = props; - const classes: string = clsx('oxygen-Skeleton', className); + const classes: string = clsx('oxygen-skeleton', className); return ; }; diff --git a/packages/react/src/components/Skeleton/__test__/__snapshots__/Skeleton.test.tsx.snap b/packages/react/src/components/Skeleton/__test__/__snapshots__/Skeleton.test.tsx.snap index e16ca409..c69abfce 100644 --- a/packages/react/src/components/Skeleton/__test__/__snapshots__/Skeleton.test.tsx.snap +++ b/packages/react/src/components/Skeleton/__test__/__snapshots__/Skeleton.test.tsx.snap @@ -4,7 +4,7 @@ exports[`Skeleton should match the snapshot 1`] = `