Skip to content

Commit

Permalink
fix: remove unused type (#2112)
Browse files Browse the repository at this point in the history
* fix: remove unused type

* test: resolve typing issue in storybook object

* test: update deprecated prop name to current one
  • Loading branch information
chrispulsinelli-okta committed Feb 8, 2024
1 parent be8728a commit 9083d7c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
8 changes: 2 additions & 6 deletions packages/odyssey-react-mui/src/@types/react-augment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { FC } from "react";
export interface ForwardRefWithType extends FC<WithForwardRefProps<Option>> {
<T extends Option>(props: WithForwardRefProps<T>): ReturnType<
FC<WithForwardRefProps<T>>
>;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import React from "react";

declare module "react" {
type DataAttributeKey = `data-${string}`;
Expand Down
3 changes: 1 addition & 2 deletions packages/odyssey-react-mui/src/NativeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { Field } from "./Field";
import { FieldComponentProps } from "./FieldComponentProps";
import type { HtmlProps } from "./HtmlProps";
import { FocusHandle, getControlState, useInputValues } from "./inputUtils";
import { ForwardRefWithType } from "./@types/react-augment";

export type NativeSelectOption = {
text: string;
Expand Down Expand Up @@ -105,7 +104,7 @@ export type NativeSelectProps<
> &
HtmlProps;

const NativeSelect: ForwardRefWithType = forwardRef(
const NativeSelect = forwardRef(
<
Value extends NativeSelectValueType<HasMultipleChoices>,
HasMultipleChoices extends boolean
Expand Down
1 change: 0 additions & 1 deletion packages/odyssey-react-mui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export type {
ThemeOptions,
} from "@mui/material";

export type { ForwardRefWithType } from "./@types/react-augment";
export type { FocusHandle } from "./inputUtils";

export { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const storybookMeta: Meta<typeof NativeSelect> = {
id: fieldComponentPropsMetaData.id,
isDisabled: fieldComponentPropsMetaData.isDisabled,
isFullWidth: fieldComponentPropsMetaData.isFullWidth,
isMultiSelect: {
hasMultipleChoices: {
control: "boolean",
description:
"If `true`, the native select component allows multiple selections",
Expand Down Expand Up @@ -134,6 +134,7 @@ const Template: StoryObj<typeof NativeSelect> = {
render: function C(args) {
return (
<NativeSelect
{...args}
id={args.id}
label={args.label}
hint={args.hint}
Expand Down Expand Up @@ -213,7 +214,7 @@ export const DefaultGrouped: StoryObj<typeof NativeSelect> = {
export const Multi: StoryObj<typeof NativeSelect> = {
...Template,
args: {
isMultiSelect: true,
hasMultipleChoices: true,
defaultValue: [],
},
};
Expand Down Expand Up @@ -287,7 +288,7 @@ export const ControlledMultiselect: StoryObj<typeof NativeSelect> = {
<NativeSelect
{...args}
defaultValue={undefined}
isMultiSelect={true}
hasMultipleChoices={true}
value={localValue}
onChange={onChange}
children={
Expand Down Expand Up @@ -383,7 +384,7 @@ export const ControlledPreselectedMultiselect: StoryObj<typeof NativeSelect> = {
<NativeSelect
{...args}
defaultValue={undefined}
isMultiSelect={true}
hasMultipleChoices={true}
value={localValue}
onChange={onChange}
children={
Expand Down

0 comments on commit 9083d7c

Please sign in to comment.