Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 0 additions & 124 deletions packages/components/src/Checkbox/Checkbox.stories.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion packages/components/src/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import React, { useEffect, useId, useState } from "react";
import classnames from "classnames";
import { Controller, useForm, useFormContext } from "react-hook-form";
import styles from "./Checkbox.module.css";
// TODO: Temporary disable — this V1 component will be deleted as part of V1/V2 consolidation
// eslint-disable-next-line import/no-deprecated
import type { CheckboxLegacyProps } from "./Checkbox.types";
import { Icon } from "../Icon";
import { Text } from "../Text";
Expand All @@ -20,7 +22,8 @@ export function CheckboxLegacy({
onBlur,
onChange,
onFocus,
}: CheckboxLegacyProps) {
}: // eslint-disable-next-line import/no-deprecated
CheckboxLegacyProps) {
const { control, setValue, watch } =
useFormContext() != undefined
? useFormContext()
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/Checkbox/Checkbox.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export type CheckboxRebuiltProps = CheckboxCoreProps &
): void;
};

/**
* @deprecated Use the v2 Checkbox component instead (version={2}).
*/
export type CheckboxLegacyProps = XOR<
CheckboxLabelProps,
CheckboxChildrenProps
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/Checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { forwardRef } from "react";
import { CheckboxLegacy } from "./Checkbox";
import { CheckboxRebuilt } from "./Checkbox.rebuilt";
// TODO: Temporary disable — this V1 component will be deleted as part of V1/V2 consolidation
import type {
// eslint-disable-next-line import/no-deprecated
CheckboxLegacyProps,
CheckboxRebuiltProps,
} from "./Checkbox.types";

// eslint-disable-next-line import/no-deprecated
type CheckboxShimProps = CheckboxLegacyProps | CheckboxRebuiltProps;

function isNewCheckboxProps(
Expand All @@ -27,4 +30,5 @@ export const Checkbox = forwardRef(function CheckboxShim(

Checkbox.displayName = "Checkbox";

// eslint-disable-next-line import/no-deprecated
export type { CheckboxLegacyProps, CheckboxRebuiltProps };
Loading
Loading