Skip to content

Commit 8379832

Browse files
committed
docs: fix withStyleForDocs JSDoc and remove duplicate @module and incorrectly merged description
1 parent 34b047c commit 8379832

1 file changed

Lines changed: 3 additions & 50 deletions

File tree

packages/__docs__/src/withStyleForDocs.tsx

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -132,56 +132,9 @@ const defaultValues = {
132132
*
133133
* @module withStyleForDocs
134134
*
135-
* A themeable component’s theme can be configured via wrapping it in an
136-
* [InstUISettingsProvider](InstUISettingsProvider) component, and/or set
137-
* explicitly via its `themeOverride` prop.
138-
*
139-
* InstUISettingsProvider provides a theme object (e.g. the [canvas theme](/#canvas)).
140-
* These variables are mapped to the component's own variables in `theme.js`.
141-
*
142-
* With the `themeOverride` prop you can directly set/override the component theme variables declared in theme.js. It accepts an object or a function. The function has the component's theme and the currently active main theme as its parameter.
143-
*
144-
* See more about the overrides on the [Legacy theme overrides](/#legacy-theme-overrides) docs page.
145-
*
146-
* ```js-code
147-
* // ExampleComponent/theme.js
148-
* const generateComponentTheme = (theme) => {
149-
* const { colors } = theme
150-
*
151-
* const componentVariables = {
152-
* background: colors?.backgroundMedium,
153-
* color: colors?.textDarkest,
154-
*
155-
* hoverColor: colors?.textLightest,
156-
* hoverBackground: colors?.backgroundDarkest
157-
* }
158-
*
159-
* return componentVariables
160-
* }
161-
* export default generateComponentTheme
162-
* ```
163-
*
164-
* ```jsx-code
165-
* {// global theme override}
166-
* <InstUISettingsProvider theme={{
167-
* colors: { backgroundMedium: '#888' }
168-
* }}>
169-
* {// component theme override}
170-
* <ExampleComponent themeOverride={{ hoverColor: '#eee' }} />
171-
*
172-
* {// component theme override with function}
173-
* <ExampleComponent themeOverride={(componentTheme, currentTheme) => ({
174-
* hoverBackground: componentTheme.background,
175-
* activeBackground: currentTheme.colors.backgroundBrand
176-
* })} />
177-
* </InstUISettingsProvider>
178-
* ```
179-
*
180-
* @module withStyleNew
181-
*
182-
* @param {function} generateStyle - The function that returns the component's style object
183-
* @param {function} generateComponentTheme - The function that returns the component's theme variables object
184-
* @returns {ReactElement} The decorated WithStyle Component
135+
* @param {function} generateStyle - Returns the component's style object
136+
* @param {function} generateComponentTheme - Returns the component's theme variables object
137+
* @returns {ReactElement} The decorated component
185138
*/
186139
const withStyleForDocs = decorator(
187140
(

0 commit comments

Comments
 (0)