({
themeColorsData,
componentName,
}: {
themeColorsData: DataObject;
componentName: string;
})
| 106 | }; |
| 107 | |
| 108 | const ThemeColorsTable = ({ |
| 109 | themeColorsData, |
| 110 | componentName, |
| 111 | }: { |
| 112 | themeColorsData: DataObject; |
| 113 | componentName: string; |
| 114 | }): ReactNode | null => { |
| 115 | const uniqueKeys = getUniqueNestedKeys(themeColorsData); |
| 116 | const nestingLevel = getMaxNestedLevel(themeColorsData); |
| 117 | const isFlatTable = nestingLevel === 1; |
| 118 | |
| 119 | const Table = isFlatTable ? FlatTable : TabbedTable; |
| 120 | |
| 121 | return ( |
| 122 | <> |
| 123 | <Table themeColorsData={themeColorsData} uniqueKeys={uniqueKeys} /> |
| 124 | <Admonition type="tip"> |
| 125 | <p> |
| 126 | If a dedicated prop for a specific color is not available or the{' '} |
| 127 | <code>style</code> prop does not allow color modification, you can |
| 128 | customize it using the <code>theme</code> prop. It allows to override |
| 129 | any color, within the component, based on the table above. |
| 130 | </p> |
| 131 | <p> |
| 132 | <i>Example of overriding </i> |
| 133 | <code>primary</code> |
| 134 | <i> color:</i> |
| 135 | </p> |
| 136 | <code>{`<${componentName} theme={{ colors: { primary: 'green' } }} />`}</code> |
| 137 | </Admonition> |
| 138 | </> |
| 139 | ); |
| 140 | }; |
| 141 | |
| 142 | export default ThemeColorsTable; |
nothing calls this directly
no test coverage detected
searching dependent graphs…