From 6245f7f0fa2436f09694283808838d3977a64474 Mon Sep 17 00:00:00 2001 From: Jeff Yates Date: Mon, 16 Dec 2024 14:52:01 -0600 Subject: [PATCH 1/2] [wb1812.4.delete] Delete the deprecated identifier generation code --- .../id-provider.stories.tsx | 92 ------- .../unique-id-provider.stories.tsx | 137 ----------- __docs__/wonder-blocks-core/use-unique-id.mdx | 50 ---- .../use-unique-id.stories.tsx | 116 --------- .../modal-header.stories.tsx | 4 +- .../with-action-scheduler.mdx | 142 +---------- .../with-action-scheduler.stories.tsx | 50 ++-- .../wonder-blocks-tooltip/tooltip.stories.tsx | 2 +- .../components/__tests__/id-provider.test.tsx | 49 ---- .../__tests__/unique-id-provider.test.tsx | 189 -------------- .../src/components/id-provider.tsx | 90 ------- .../src/components/unique-id-provider.tsx | 115 --------- .../hooks/__tests__/use-unique-id.test.tsx | 231 ------------------ .../src/hooks/use-unique-id.ts | 63 ----- packages/wonder-blocks-core/src/index.ts | 18 +- .../unique-id-factory.test.ts.snap | 7 - .../src/util/__tests__/ssr-id-factory.test.ts | 13 - .../util/__tests__/unique-id-factory.test.ts | 165 ------------- .../src/util/ssr-id-factory.ts | 24 -- packages/wonder-blocks-core/src/util/types.ts | 9 - .../src/util/unique-id-factory.ts | 65 ----- 21 files changed, 30 insertions(+), 1601 deletions(-) delete mode 100644 __docs__/wonder-blocks-core/id-provider.stories.tsx delete mode 100644 __docs__/wonder-blocks-core/unique-id-provider.stories.tsx delete mode 100644 __docs__/wonder-blocks-core/use-unique-id.mdx delete mode 100644 __docs__/wonder-blocks-core/use-unique-id.stories.tsx delete mode 100644 packages/wonder-blocks-core/src/components/__tests__/id-provider.test.tsx delete mode 100644 packages/wonder-blocks-core/src/components/__tests__/unique-id-provider.test.tsx delete mode 100644 packages/wonder-blocks-core/src/components/id-provider.tsx delete mode 100644 packages/wonder-blocks-core/src/components/unique-id-provider.tsx delete mode 100644 packages/wonder-blocks-core/src/hooks/__tests__/use-unique-id.test.tsx delete mode 100644 packages/wonder-blocks-core/src/hooks/use-unique-id.ts delete mode 100644 packages/wonder-blocks-core/src/util/__tests__/__snapshots__/unique-id-factory.test.ts.snap delete mode 100644 packages/wonder-blocks-core/src/util/__tests__/ssr-id-factory.test.ts delete mode 100644 packages/wonder-blocks-core/src/util/__tests__/unique-id-factory.test.ts delete mode 100644 packages/wonder-blocks-core/src/util/ssr-id-factory.ts delete mode 100644 packages/wonder-blocks-core/src/util/unique-id-factory.ts diff --git a/__docs__/wonder-blocks-core/id-provider.stories.tsx b/__docs__/wonder-blocks-core/id-provider.stories.tsx deleted file mode 100644 index 073a23114..000000000 --- a/__docs__/wonder-blocks-core/id-provider.stories.tsx +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable import/no-deprecated */ -import * as React from "react"; -import type {Meta, StoryObj} from "@storybook/react"; - -import {IDProvider, View} from "@khanacademy/wonder-blocks-core"; -import packageConfig from "../../packages/wonder-blocks-core/package.json"; - -import ComponentInfo from "../../.storybook/components/component-info"; - -export default { - title: "Packages / Core / IDProvider", - component: IDProvider, - args: { - scope: "field", - id: "", - testId: "", - }, - parameters: { - componentSubtitle: ( - - ), - docs: { - description: { - component: null, - }, - source: { - // See https://github.com/storybookjs/storybook/issues/12596 - excludeDecorators: true, - }, - }, - }, - decorators: [(Story): React.ReactElement => {Story()}], -} as Meta; - -type StoryComponentType = StoryObj; - -export const Default: StoryComponentType = { - render: (args) => ( - - {(uniqueId) => ( - - )} - - ), -}; - -export const WithFormFields: StoryComponentType = () => ( - - {(uniqueId) => ( - - )} - -); - -WithFormFields.parameters = { - docs: { - description: { - story: "This example allows you to generate an unique ID and make it available to associate the `