From 36a68fa15d8b213b7a92689c65fe992f09c2f8e9 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Wed, 30 Jun 2021 06:18:14 -0700 Subject: [PATCH 1/6] components: Remove `@emotion/css` from Elevation --- .../elevation/{component.js => component.tsx} | 23 ++-- packages/components/src/elevation/hook.js | 120 ------------------ .../src/elevation/{index.js => index.ts} | 1 - packages/components/src/elevation/styles.js | 16 --- packages/components/src/elevation/styles.ts | 88 +++++++++++++ 5 files changed, 103 insertions(+), 145 deletions(-) rename packages/components/src/elevation/{component.js => component.tsx} (51%) delete mode 100644 packages/components/src/elevation/hook.js rename packages/components/src/elevation/{index.js => index.ts} (68%) delete mode 100644 packages/components/src/elevation/styles.js create mode 100644 packages/components/src/elevation/styles.ts diff --git a/packages/components/src/elevation/component.js b/packages/components/src/elevation/component.tsx similarity index 51% rename from packages/components/src/elevation/component.js rename to packages/components/src/elevation/component.tsx index a225e665a9ff67..a03174848be339 100644 --- a/packages/components/src/elevation/component.js +++ b/packages/components/src/elevation/component.tsx @@ -1,8 +1,19 @@ /** * Internal dependencies */ -import { useElevation } from './hook'; -import { createComponent } from '../ui/utils'; +import { + useContextSystem, + contextConnect, + PolymorphicComponentProps, +} from '../ui/context'; +import type { Props } from './types'; +import { ElevationWrapper } from './styles'; + +function Elevation( props: PolymorphicComponentProps< Props, 'div', false > ) { + const contextProps = useContextSystem( props, 'Elevation' ); + + return