From 82aa74d21bb56f308451524a779319d08387068d Mon Sep 17 00:00:00 2001 From: Dane Pilcher Date: Tue, 9 Nov 2021 21:04:36 +0000 Subject: [PATCH] feat: remove FieldGroup, FieldGroupIcon, and FieldGroupIconButton primitives These primitives are for amplify-ui internal use only --- .../__snapshots__/primitives.test.ts.snap | 6 ----- .../amplify-ui-renderers/amplify-renderer.ts | 24 ------------------- .../studio-ui-codegen-react/lib/primitive.ts | 3 --- .../src/PrimitivesTests.tsx | 6 ----- .../FieldGroupIconButtonPrimitive.json | 6 ----- .../primitives/FieldGroupIconPrimitive.json | 6 ----- .../primitives/FieldGroupPrimitive.json | 6 ----- .../lib/components/primitives/index.ts | 3 --- 8 files changed, 60 deletions(-) delete mode 100644 packages/test-generator/lib/components/primitives/FieldGroupIconButtonPrimitive.json delete mode 100644 packages/test-generator/lib/components/primitives/FieldGroupIconPrimitive.json delete mode 100644 packages/test-generator/lib/components/primitives/FieldGroupPrimitive.json diff --git a/packages/studio-ui-codegen-react/lib/__tests__/amplify-ui-renderers/__snapshots__/primitives.test.ts.snap b/packages/studio-ui-codegen-react/lib/__tests__/amplify-ui-renderers/__snapshots__/primitives.test.ts.snap index 53bbb3500..ffdd2e529 100644 --- a/packages/studio-ui-codegen-react/lib/__tests__/amplify-ui-renderers/__snapshots__/primitives.test.ts.snap +++ b/packages/studio-ui-codegen-react/lib/__tests__/amplify-ui-renderers/__snapshots__/primitives.test.ts.snap @@ -16,12 +16,6 @@ exports[`Primitives Collection 1`] = `""`; -exports[`Primitives FieldGroup 1`] = `""`; - -exports[`Primitives FieldGroupIcon 1`] = `""`; - -exports[`Primitives FieldGroupIconButton 1`] = `""`; - exports[`Primitives Flex 1`] = `""`; exports[`Primitives Grid 1`] = `""`; diff --git a/packages/studio-ui-codegen-react/lib/amplify-ui-renderers/amplify-renderer.ts b/packages/studio-ui-codegen-react/lib/amplify-ui-renderers/amplify-renderer.ts index 0e1d74a85..4148ce20e 100644 --- a/packages/studio-ui-codegen-react/lib/amplify-ui-renderers/amplify-renderer.ts +++ b/packages/studio-ui-codegen-react/lib/amplify-ui-renderers/amplify-renderer.ts @@ -24,8 +24,6 @@ import { CardProps, CheckboxFieldProps, DividerProps, - FieldGroupIconProps, - FieldGroupIconButtonProps, FlexProps, GridProps, HeadingProps, @@ -116,28 +114,6 @@ export class AmplifyRenderer extends ReactStudioTemplateRenderer { case Primitive.Divider: return new ReactComponentRenderer(component, this.importCollection, parent).renderElement(); - case Primitive.FieldGroup: - // TODO: Use correct prop type - return new ReactComponentWithChildrenRenderer( - component, - this.importCollection, - parent, - ).renderElement(renderChildren); - - case Primitive.FieldGroupIcon: - return new ReactComponentWithChildrenRenderer( - component, - this.importCollection, - parent, - ).renderElement(renderChildren); - - case Primitive.FieldGroupIconButton: - return new ReactComponentWithChildrenRenderer( - component, - this.importCollection, - parent, - ).renderElement(renderChildren); - case Primitive.Flex: return new ReactComponentWithChildrenRenderer( component, diff --git a/packages/studio-ui-codegen-react/lib/primitive.ts b/packages/studio-ui-codegen-react/lib/primitive.ts index 7f73f0eb5..19238a56c 100644 --- a/packages/studio-ui-codegen-react/lib/primitive.ts +++ b/packages/studio-ui-codegen-react/lib/primitive.ts @@ -22,9 +22,6 @@ enum Primitive { CheckboxField = 'CheckboxField', Collection = 'Collection', Divider = 'Divider', - FieldGroup = 'FieldGroup', - FieldGroupIcon = 'FieldGroupIcon', - FieldGroupIconButton = 'FieldGroupIconButton', Flex = 'Flex', Grid = 'Grid', Heading = 'Heading', diff --git a/packages/test-generator/integration-test-templates/src/PrimitivesTests.tsx b/packages/test-generator/integration-test-templates/src/PrimitivesTests.tsx index b31bebd4c..e7b5f803c 100644 --- a/packages/test-generator/integration-test-templates/src/PrimitivesTests.tsx +++ b/packages/test-generator/integration-test-templates/src/PrimitivesTests.tsx @@ -8,9 +8,6 @@ import CardPrimitive from './ui-components/CardPrimitive'; import CheckboxFieldPrimitive from './ui-components/CheckboxFieldPrimitive'; import CollectionPrimitive from './ui-components/CollectionPrimitive'; import DividerPrimitive from './ui-components/DividerPrimitive'; -import FieldGroupPrimitive from './ui-components/FieldGroupPrimitive'; -import FieldGroupIconPrimitive from './ui-components/FieldGroupIconPrimitive'; -import FieldGroupIconButtonPrimitive from './ui-components/FieldGroupIconButtonPrimitive'; import FlexPrimitive from './ui-components/FlexPrimitive'; import GridPrimitive from './ui-components/GridPrimitive'; import HeadingPrimitive from './ui-components/HeadingPrimitive'; @@ -51,9 +48,6 @@ export default function PrimitivesTests() { - - - diff --git a/packages/test-generator/lib/components/primitives/FieldGroupIconButtonPrimitive.json b/packages/test-generator/lib/components/primitives/FieldGroupIconButtonPrimitive.json deleted file mode 100644 index fb119775c..000000000 --- a/packages/test-generator/lib/components/primitives/FieldGroupIconButtonPrimitive.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "1234-5678-9010", - "componentType": "FieldGroupIconButton", - "name": "FieldGroupIconButtonPrimitive", - "properties": {} -} diff --git a/packages/test-generator/lib/components/primitives/FieldGroupIconPrimitive.json b/packages/test-generator/lib/components/primitives/FieldGroupIconPrimitive.json deleted file mode 100644 index 31eb26a7f..000000000 --- a/packages/test-generator/lib/components/primitives/FieldGroupIconPrimitive.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "1234-5678-9010", - "componentType": "FieldGroupIcon", - "name": "FieldGroupIconPrimitive", - "properties": {} -} diff --git a/packages/test-generator/lib/components/primitives/FieldGroupPrimitive.json b/packages/test-generator/lib/components/primitives/FieldGroupPrimitive.json deleted file mode 100644 index 67de67fe6..000000000 --- a/packages/test-generator/lib/components/primitives/FieldGroupPrimitive.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "1234-5678-9010", - "componentType": "FieldGroup", - "name": "FieldGroupPrimitive", - "properties": {} -} diff --git a/packages/test-generator/lib/components/primitives/index.ts b/packages/test-generator/lib/components/primitives/index.ts index f592383f9..f6f91bddc 100644 --- a/packages/test-generator/lib/components/primitives/index.ts +++ b/packages/test-generator/lib/components/primitives/index.ts @@ -21,9 +21,6 @@ export { default as CardPrimitive } from './CardPrimitive.json'; export { default as CheckboxFieldPrimitive } from './CheckboxFieldPrimitive.json'; export { default as CollectionPrimitive } from './CollectionPrimitive.json'; export { default as DividerPrimitive } from './DividerPrimitive.json'; -export { default as FieldGroupPrimitive } from './FieldGroupPrimitive.json'; -export { default as FieldGroupIconPrimitive } from './FieldGroupIconPrimitive.json'; -export { default as FieldGroupIconButtonPrimitive } from './FieldGroupIconButtonPrimitive.json'; export { default as FlexPrimitive } from './FlexPrimitive.json'; export { default as GridPrimitive } from './GridPrimitive.json'; export { default as HeadingPrimitive } from './HeadingPrimitive.json';