Skip to content

Commit 713dd07

Browse files
committed
feat: adds ComponentProvider to wrap all providers
Started with an update to dependencies and the required fixes. This required significant work in the dev support (tests/stories). Changes in components now require some global Providers so a new component provider has been added to wrap them all together. BREAKING CHANGE: It is now reccommended that you wrap the application with `ComponentsProvider` replacing the `ThemeProvider`. This includes all required components. fix #253
1 parent 6e6ba4e commit 713dd07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+9111
-12863
lines changed

.husky/_/husky.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/sh
22
if [ -z "$husky_skip_init" ]; then
33
debug () {
4-
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
4+
if [ "$HUSKY_DEBUG" = "1" ]; then
5+
echo "husky (debug) - $1"
6+
fi
57
}
68

79
readonly hook_name="$(basename "$0")"
@@ -23,8 +25,7 @@ if [ -z "$husky_skip_init" ]; then
2325

2426
if [ $exitCode != 0 ]; then
2527
echo "husky - $hook_name hook exited with code $exitCode (error)"
26-
exit $exitCode
2728
fi
2829

29-
exit 0
30+
exit $exitCode
3031
fi

.storybook/committed/withTheme.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { useDarkMode } from 'storybook-dark-mode'
3-
import { ThemeProvider, darkTheme, lightTheme } from '../../src'
3+
import { ComponentsProvider, darkTheme, lightTheme } from '../../src'
44
import '@fontsource/inter/300.css'
55
import '@fontsource/inter/400.css'
66
import '@fontsource/inter/700.css'
@@ -20,8 +20,8 @@ export const withTheme = (Story) => {
2020

2121
const choice = useDarkMode() ? 'dark' : 'light'
2222
return (
23-
<ThemeProvider choice={choice}>
23+
<ComponentsProvider theme={{ choice }}>
2424
<Story />
25-
</ThemeProvider>
25+
</ComponentsProvider>
2626
)
2727
}

.storybook/components/DocsContainer.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ export const DocsContainer = ({ context, ...props }) => {
1010
<BaseContainer
1111
context={{
1212
...context,
13-
parameters: {
14-
...context.parameters,
15-
docs: {
16-
...context.parameters.docs,
17-
theme: dark ? themes.dark : themes.light,
18-
},
13+
storyById: (id) => {
14+
const storyContext = context.storyById(id)
15+
return {
16+
...storyContext,
17+
parameters: {
18+
...storyContext?.parameters,
19+
docs: {
20+
...storyContext?.parameters?.docs,
21+
theme: dark ? themes.dark : themes.light,
22+
},
23+
},
24+
}
1925
},
2026
}}
2127
{...props}

.storybook/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,16 @@ module.exports = {
2323
],
2424
typescript: {
2525
check: false,
26+
checkOptions: {},
27+
reactDocgen: 'react-docgen-typescript',
28+
reactDocgenTypescriptOptions: {
29+
shouldExtractLiteralValuesFromEnum: true,
30+
propFilter: (prop) => {
31+
return prop.parent
32+
? /@radix-ui/.test(prop.parent.fileName) ||
33+
!/node_modules/.test(prop.parent.fileName)
34+
: true
35+
},
36+
},
2637
},
2738
}

0 commit comments

Comments
 (0)