/** @jsx jsx */ import * as React from "react" import { jsx, ColorModesScale } from "theme-ui" import Palette from "./palette" import normalizeThemeUIColors from "../utils/normalize-theme-ui-colors" import theme from "../theme" const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1) type ColorFamiliesProps = { colors?: { [key: string]: ColorModesScale } } const ColorFamilies = ({ colors = undefined }: ColorFamiliesProps) => (
{colors ? ( Object.entries(colors).map(([key, color]) => { if (!color || (!Array.isArray(color) && typeof color !== `object`)) return null return (

{capitalize(key)}

) }) ) : (
No colors were defined.
)}
) export default ColorFamilies