From dd9a3d35a8fa1d9d0e6c39e65da0acb2632e5be4 Mon Sep 17 00:00:00 2001 From: telamonian Date: Sun, 23 Feb 2020 23:40:22 -0500 Subject: [PATCH] remove deprecated `rendererClass` and `justify` args --- packages/ui-components/src/icon/labicon.tsx | 7 +------ packages/ui-components/src/style/icon.ts | 23 +++++---------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/packages/ui-components/src/icon/labicon.tsx b/packages/ui-components/src/icon/labicon.tsx index aca1b22cad42..dbafebaaba43 100644 --- a/packages/ui-components/src/icon/labicon.tsx +++ b/packages/ui-components/src/icon/labicon.tsx @@ -601,12 +601,7 @@ export namespace LabIcon { * Interface defining the parameters to be passed to the LabIcon * constructor */ - export interface IOptions extends IIcon, Partial { - /** - * @deprecated does nothing - */ - rendererClass?: typeof Private.Renderer; - } + export interface IOptions extends IIcon, Partial {} /** * The input props for creating a new LabIcon diff --git a/packages/ui-components/src/style/icon.ts b/packages/ui-components/src/style/icon.ts index ba2f0e72fb4d..e1cdc1149f47 100644 --- a/packages/ui-components/src/style/icon.ts +++ b/packages/ui-components/src/style/icon.ts @@ -134,11 +134,6 @@ export namespace LabIconStyle { * the kind of the icon, associated with a builtin stylesheet */ kind?: IStyleResolvable | IStyleResolvable[]; - - /** - * @deprecated use elementPosition instead - */ - justify?: IPosition; } /** @@ -512,10 +507,12 @@ export namespace LabIconStyle { ...styles.map(s => s.options) ); + // add the position style (if any) with lowest precedence if (options.elementPosition) { styles.unshift(positionStyles[options.elementPosition]); } + // add the size style (if any) with lowest precedence if (options.elementSize) { styles.unshift(sizeStyles[options.elementSize]); } @@ -548,18 +545,7 @@ export namespace LabIconStyle { return ''; } - let { - elementPosition, - elementSize, - kind, - justify, - ...elementStyle - } = props; - - // DEPRECATED: alias justify => elementPosition - if (!elementPosition) { - elementPosition = justify; - } + let { elementPosition, elementSize, kind, ...elementStyle } = props; // add option args with defined values to overrides const options = { @@ -579,7 +565,8 @@ export namespace LabIconStyle { const styles = resolveKind(kind); styles.push({ elementStyle, options }); - // apply style options/merge styles, then convert to typestyle class + // merge styles (while applying any style options), + // then convert to typestyle class const cls = resolveStyleClass(resolveStyles(styles)); if (cacheable) {