diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aab5d97cf..2ec04df7da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Features - Add experimental runtime accessibility attributes validation (the initial step validates the Button component only) @mshoho ([#1911](https://github.com/stardust-ui/react/pull/1911)) - Add `sync` icon to Teams theme @codepretty ([#1973](https://github.com/stardust-ui/react/pull/1973)) +- Updating category colors palette and schemes in Teams theme @codepretty ([#1994](https://github.com/stardust-ui/react/pull/1994)) - Add `bell` icon to Teams theme @codepretty ([#1993](https://github.com/stardust-ui/react/pull/1993)) diff --git a/docs/src/components/CategoryColorSchemes.tsx b/docs/src/components/CategoryColorSchemes.tsx new file mode 100644 index 0000000000..ff11e32250 --- /dev/null +++ b/docs/src/components/CategoryColorSchemes.tsx @@ -0,0 +1,68 @@ +import * as React from 'react' +import * as _ from 'lodash' +import { + createComponent, + ComponentSlotStylesInput, + ThemePrepared, + Grid, + Header, + HeaderProps, + ShorthandCollection, +} from '@stardust-ui/react' + +import ColorBox from './ColorBox' + +type ColorVariantsProps = { + name?: string + themes?: ThemePrepared[] + headers?: ShorthandCollection +} + +export const colorVariantsStyles: ComponentSlotStylesInput = { + root: { + border: '1px solid transparent', + borderRadius: '.25rem', + overflow: 'hidden', + }, +} + +const CategoryColorSchemes = createComponent({ + displayName: 'ColorVariants', + render: ({ name, themes, headers, stardust: { classes } }) => { + if (themes.length === 0) return <> + + const colorSchemes = _.map(themes, theme => theme.siteVariables.categoryColorScheme[name]) + + const elements = _.flatMap(_.head(colorSchemes), (i, token) => [ + , + ..._.map(colorSchemes, (colorScheme, i) => ( + + )), + ]) + + const columns = `auto ${_.times(themes.length, () => '180px').join(' ')}` + return ( +
+ + {headers && headers.map(header => Header.create(header))} + {elements} + +
+ ) + }, +}) + +export default CategoryColorSchemes diff --git a/docs/src/routes.tsx b/docs/src/routes.tsx index 05d7961386..b3d02b9d93 100644 --- a/docs/src/routes.tsx +++ b/docs/src/routes.tsx @@ -12,7 +12,9 @@ import * as Layout from './pages/Layout.mdx' import Accessibility from './views/Accessibility' import Colors from './views/Colors' import ColorPalette from './views/ColorPalette' +import CategoryColorPalette from './views/CategoryColorPalette' import ColorSchemes from './views/ColorSchemes' +import CategoryColorSchemes from './views/CategoryColorSchemes' import FAQ from './views/FAQ' import * as ShorthandProps from './pages/ShorthandProps.mdx' @@ -98,7 +100,9 @@ const Routes = () => ( + + diff --git a/docs/src/views/CategoryColorPalette.tsx b/docs/src/views/CategoryColorPalette.tsx new file mode 100644 index 0000000000..b2baf125ba --- /dev/null +++ b/docs/src/views/CategoryColorPalette.tsx @@ -0,0 +1,59 @@ +import { Provider, ProviderConsumer, Grid } from '@stardust-ui/react' +import * as _ from 'lodash' +import * as React from 'react' + +import ColorBox, { colorBoxStyles, colorBoxVariables } from 'docs/src/components/ColorBox' +import { colorVariantsStyles } from 'docs/src/components/ColorVariants' +import DocPage from 'docs/src/components/DocPage/DocPage' + +const ColorPalette = () => ( + + ( + +

+ This page displays all category colors in the Teams theme. These colors are used for + features like calendar, announcement posts, and text formatting. +

+ + + {_.map(categoryColors, (variants, colorName) => ( +
+ + {_.map(categoryColors[colorName], (value, variable) => ( + + ))} +
+ ))} +
+
+ )} + /> +
+) + +export default ColorPalette diff --git a/docs/src/views/CategoryColorSchemes.tsx b/docs/src/views/CategoryColorSchemes.tsx new file mode 100644 index 0000000000..c4250b0e8a --- /dev/null +++ b/docs/src/views/CategoryColorSchemes.tsx @@ -0,0 +1,79 @@ +import * as React from 'react' +import DocPage from '../components/DocPage/DocPage' +import GuidesNavigationFooter from '../components/GuidesNavigationFooter' +import CategoryColorSchemes from 'docs/src/components/CategoryColorSchemes' + +import { Dropdown, themes, Flex, Provider } from '@stardust-ui/react' +import { faderStyles } from 'docs/src/components/Fader' +import { colorVariantsStyles } from 'docs/src/components/ColorVariants' +import { colorBoxStyles, colorBoxVariables } from 'docs/src/components/ColorBox' + +export default () => { + const [color, setColor] = React.useState('red') + return ( + + + + setColor(value as string)} + /> + + + + + + ) +} diff --git a/packages/react/src/themes/teams-dark/colors.ts b/packages/react/src/themes/teams-dark/colors.ts index cf33c05192..e064405b97 100644 --- a/packages/react/src/themes/teams-dark/colors.ts +++ b/packages/react/src/themes/teams-dark/colors.ts @@ -261,6 +261,7 @@ export const colorScheme: ColorSchemeMapping = { background2: colors.onyx[500], border: colors.onyx[800], border1: 'transparent', + border2: colors.silver[400], }), amethyst: createColorScheme({ background: colors.onyx[200], @@ -307,4 +308,23 @@ export const categoryColorScheme: TeamsCategoryColorSchemeMapping = { smokeLight: createCategoryColorScheme('smokeLight'), steelDark: createCategoryColorScheme('steelDark'), steelLight: createCategoryColorScheme('steelLight'), + neon: createCategoryColorScheme('neon'), + formatting: { + foreground1: categoryColors.red[250], + background1: categoryColors.red[700], + foreground2: categoryColors.orangeDark[350], + background2: categoryColors.orange[700], + foreground3: categoryColors.yellow[250], + background3: categoryColors.yellow[800], + foreground4: categoryColors.neon[150], + background4: categoryColors.neon[800], + foreground5: categoryColors.green[250], + background5: categoryColors.green[700], + foreground6: categoryColors.tealLight[250], + background6: categoryColors.tealLight[700], + foreground7: categoryColors.blueDark[250], + background7: categoryColors.blueDark[450], + foreground8: categoryColors.maroon[350], + background8: categoryColors.maroon[800], + }, } diff --git a/packages/react/src/themes/teams-dark/siteVariables.ts b/packages/react/src/themes/teams-dark/siteVariables.ts index 96d1b2ac6d..512425332c 100644 --- a/packages/react/src/themes/teams-dark/siteVariables.ts +++ b/packages/react/src/themes/teams-dark/siteVariables.ts @@ -1,6 +1,6 @@ import { colors } from '../teams/siteVariables' -export { colorScheme } from './colors' +export { colorScheme, categoryColorScheme } from './colors' // // BORDER STYLES diff --git a/packages/react/src/themes/teams-high-contrast/colors.ts b/packages/react/src/themes/teams-high-contrast/colors.ts index 1b3c1c2e58..3941224e41 100644 --- a/packages/react/src/themes/teams-high-contrast/colors.ts +++ b/packages/react/src/themes/teams-high-contrast/colors.ts @@ -264,6 +264,7 @@ export const colorScheme: ColorSchemeMapping = { background2: colors.white, border: colors.white, border1: colors.white, + border2: colors.white, }), amethyst: createEmptyColorScheme({ background: colors.silver[900], @@ -308,4 +309,23 @@ export const categoryColorScheme: TeamsCategoryColorSchemeMapping = { smokeLight: createCategoryColorScheme(), steelDark: createCategoryColorScheme(), steelLight: createCategoryColorScheme(), + neon: createCategoryColorScheme(), + formatting: { + foreground1: undefined, + background1: undefined, + foreground2: undefined, + background2: undefined, + foreground3: undefined, + background3: undefined, + foreground4: undefined, + background4: undefined, + foreground5: undefined, + background5: undefined, + foreground6: undefined, + background6: undefined, + foreground7: undefined, + background7: undefined, + foreground8: undefined, + background8: undefined, + }, } diff --git a/packages/react/src/themes/teams/categoryColors.ts b/packages/react/src/themes/teams/categoryColors.ts index 6ba7e63116..1c91900f32 100644 --- a/packages/react/src/themes/teams/categoryColors.ts +++ b/packages/react/src/themes/teams/categoryColors.ts @@ -476,6 +476,25 @@ export const categoryColors: TeamsCategoryColors = { 850: '#404243', 900: '#292828', }, + neon: { + 100: '#FAFEDF', + 150: '#F4FBC4', + 200: '#E9F1AC', + 250: '#E5F18F', + 300: '#D9E388', + 350: '#C8D464', + 400: '#BDCB4C', + 450: '#B7C640', + 500: '#A8B63A', + 550: '#99A43B', + 600: '#909A45', + 650: '#899338', + 700: '#7A8337', + 750: '#656C2B', + 800: '#50571E', + 850: '#3C4212', + 900: '#272B0E', + }, } const createCategoryColorScheme = (color: string, customValues = {}) => { @@ -513,4 +532,23 @@ export const categoryColorScheme: TeamsCategoryColorSchemeMapping = { smokeLight: createCategoryColorScheme('smokeLight'), steelDark: createCategoryColorScheme('steelDark'), steelLight: createCategoryColorScheme('steelLight'), + neon: createCategoryColorScheme('neon'), + formatting: { + foreground1: categoryColors.red[600], + background1: categoryColors.red[300], + foreground2: categoryColors.orangeDark[400], + background2: categoryColors.orange[300], + foreground3: categoryColors.yellow[400], + background3: categoryColors.yellow[300], + foreground4: categoryColors.neon[450], + background4: categoryColors.neon[200], + foreground5: categoryColors.green[600], + background5: categoryColors.green[300], + foreground6: categoryColors.tealLight[650], + background6: categoryColors.tealLight[300], + foreground7: categoryColors.blueDark[400], + background7: categoryColors.blueDark[200], + foreground8: categoryColors.maroon[500], + background8: categoryColors.maroon[200], + }, } diff --git a/packages/react/src/themes/teams/colors.ts b/packages/react/src/themes/teams/colors.ts index 7551c423a7..de3ff69616 100644 --- a/packages/react/src/themes/teams/colors.ts +++ b/packages/react/src/themes/teams/colors.ts @@ -153,8 +153,8 @@ export const transparentColors: TeamsTransparentColors = { onyx: { 100: 'rgba(59,58,57,0.9)', 200: 'rgba(45,44,44,0.4)', - 300: undefined, - 400: undefined, + 300: 'rgba(37,36,35,0.2)', + 400: 'rgba(37,36,35,0.65)', 500: 'rgba(41,40,40,0.9)', 600: undefined, 700: 'rgba(0,0,0,0.5)', @@ -468,6 +468,7 @@ export const colorScheme: ColorSchemeMapping = { background2: colors.onyx[500], border: colors.onyx[800], border1: 'transparent', + border2: colors.onyx[300], }), amethyst: createColorScheme({ background: colors.amethyst[600], diff --git a/packages/react/src/themes/teams/types.ts b/packages/react/src/themes/teams/types.ts index 37ef2401d3..3cbee24546 100644 --- a/packages/react/src/themes/teams/types.ts +++ b/packages/react/src/themes/teams/types.ts @@ -53,6 +53,7 @@ export type TeamsCategoryColors = { smokeLight: ColorVariants steelDark: ColorVariants steelLight: ColorVariants + neon: ColorVariants } export type TeamsCategoryColorNames = keyof TeamsCategoryColors