diff --git a/CHANGELOG.md b/CHANGELOG.md index 2416b768e6..04a33ca5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Label Processed Teams icons moved to Stardust theme @kuzhelov ([#574](https://github.com/stardust-ui/react/pull/574)) - Add `Dropdown` component @silviuavram ([#422](https://github.com/stardust-ui/react/pull/422)) - Export `call-recording` SVG icon @Bugaa92 ([#585](https://github.com/stardust-ui/react/pull/585)) +- Export `canvas-add-page` SVG icon @priyankar205 ([#601](https://github.com/stardust-ui/react/pull/601)) +- Add `sizeModifier` variable (with `x` and `xx` values) to `Icon`'s Teams theme styles @priyankar205 ([#601](https://github.com/stardust-ui/react/pull/601)) ### Documentation - Add `prettier` support throughout the docs @levithomason ([#568](https://github.com/stardust-ui/react/pull/568)) diff --git a/src/themes/teams/components/Icon/iconStyles.ts b/src/themes/teams/components/Icon/iconStyles.ts index 6e5860309b..dd6cd3d239 100644 --- a/src/themes/teams/components/Icon/iconStyles.ts +++ b/src/themes/teams/components/Icon/iconStyles.ts @@ -24,23 +24,24 @@ const getDefaultFontIcon = (iconName: string) => { } const getFontStyles = ( - size: string, + size: number, iconName: string, themeIcon?: ResultOf, ): ICSSInJSStyle => { const { fontFamily, content } = themeIcon || getDefaultFontIcon(iconName) + const sizeInRems = pxToRem(size) return { fontFamily, - fontSize: getSize(size), + fontSize: sizeInRems, lineHeight: 1, textAlign: 'center', '::before': { content, display: 'block', - width: getSize(size), - height: getSize(size), + width: sizeInRems, + height: sizeInRems, }, } } @@ -71,7 +72,19 @@ const getPaddedStyle = (): ICSSInJSStyle => ({ padding: pxToRem(4), }) -const getSize = size => pxToRem(sizes.get(size)) +const getIconSize = (size, sizeModifier): number => { + if (!sizeModifier) { + return sizes.get(size) + } + const modifiedSizes = { + large: { + x: 24, + xx: 28, + }, + } + + return modifiedSizes[size] && modifiedSizes[size][sizeModifier] +} const getIconColor = color => color || 'currentColor' @@ -91,8 +104,7 @@ const iconStyles: ComponentSlotStylesInput = { speak: 'none', verticalAlign: 'middle', - ...(isFontBased && - getFontStyles(size, name, callable(iconSpec && (iconSpec.icon as FontIconSpec))())), + ...(isFontBased && getFontStyles(getIconSize(size, v.sizeModifier), name)), ...(isFontBased && { color: getIconColor(v.color), @@ -128,10 +140,12 @@ const iconStyles: ComponentSlotStylesInput = { }, svg: ({ props: { size, disabled }, variables: v }): ICSSInJSStyle => { + const iconSizeInRems = pxToRem(getIconSize(size, v.sizeModifier)) + return { display: 'block', - width: getSize(size), - height: getSize(size), + width: iconSizeInRems, + height: iconSizeInRems, fill: getIconColor(v.color), ...(disabled && { diff --git a/src/themes/teams/components/Icon/svg/ProcessedIcons/icons-canvas-addpage.tsx b/src/themes/teams/components/Icon/svg/ProcessedIcons/icons-canvas-addpage.tsx index 7f42143a0c..c3f3e62046 100644 --- a/src/themes/teams/components/Icon/svg/ProcessedIcons/icons-canvas-addpage.tsx +++ b/src/themes/teams/components/Icon/svg/ProcessedIcons/icons-canvas-addpage.tsx @@ -18,4 +18,5 @@ export default { ), styles: {}, + exportedAs: 'canvas-add-page', } as TeamsProcessedSvgIconSpec diff --git a/src/themes/teams/components/Icon/svg/icons/canvasAddPage.tsx b/src/themes/teams/components/Icon/svg/icons/canvasAddPage.tsx new file mode 100644 index 0000000000..7f42143a0c --- /dev/null +++ b/src/themes/teams/components/Icon/svg/icons/canvasAddPage.tsx @@ -0,0 +1,21 @@ +import * as React from 'react' +import { TeamsProcessedSvgIconSpec } from '../types' + +export default { + icon: ({ classes }) => ( + + + + + + + + + + + + + + ), + styles: {}, +} as TeamsProcessedSvgIconSpec diff --git a/src/themes/teams/components/Icon/svg/icons/index.ts b/src/themes/teams/components/Icon/svg/icons/index.ts index f2cbc85839..f50c2fe168 100644 --- a/src/themes/teams/components/Icon/svg/icons/index.ts +++ b/src/themes/teams/components/Icon/svg/icons/index.ts @@ -12,6 +12,7 @@ import callEnd from './callEnd' import callRecording from './callRecording' import callVideo from './callVideo' import callVideoOff from './callVideoOff' +import canvasAddPage from './canvasAddPage' import edit from './edit' import error from './error' import fontColor from './fontColor' @@ -50,6 +51,7 @@ export default { 'call-control-present-new': callControlPresentNew, 'call-control-stop-presenting-new': callControlStopPresentingNew, 'call-recording': callRecording, + 'canvas-add-page': canvasAddPage, edit, error, format,