@charcoal-ui/react 3.2.0 → 3.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/index.test.d.ts +2 -2
- package/dist/components/Button/index.test.d.ts.map +1 -1
- package/dist/components/Checkbox/performance.test.d.ts +2 -2
- package/dist/components/Checkbox/performance.test.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.story.d.ts +1 -1
- package/dist/core/CharcoalProvider.d.ts +3 -2
- package/dist/core/CharcoalProvider.d.ts.map +1 -1
- package/dist/index.cjs.js +7 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -6
- package/dist/index.esm.js.map +1 -1
- package/package.json +16 -14
- package/src/components/Button/index.test.tsx +2 -2
- package/src/components/Button/index.tsx +2 -2
- package/src/components/Checkbox/performance.test.tsx +2 -2
- package/src/components/LoadingSpinner/index.tsx +2 -2
- package/src/core/CharcoalProvider.tsx +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-beta.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@react-types/switch": "^3.1.2",
|
|
22
|
-
"@storybook/addon-actions": "^
|
|
23
|
-
"@storybook/addon-knobs": "^
|
|
24
|
-
"@storybook/addons": "^
|
|
25
|
-
"@storybook/api": "^
|
|
26
|
-
"@storybook/components": "^
|
|
27
|
-
"@storybook/core-events": "^
|
|
28
|
-
"@storybook/react": "^
|
|
29
|
-
"@storybook/
|
|
22
|
+
"@storybook/addon-actions": "^7.4.1",
|
|
23
|
+
"@storybook/addon-knobs": "^7.0.2",
|
|
24
|
+
"@storybook/addons": "^7.4.1",
|
|
25
|
+
"@storybook/api": "^7.4.1",
|
|
26
|
+
"@storybook/components": "^7.4.1",
|
|
27
|
+
"@storybook/core-events": "^7.4.1",
|
|
28
|
+
"@storybook/react": "^7.4.1",
|
|
29
|
+
"@storybook/react-webpack5": "^7.4.1",
|
|
30
|
+
"@storybook/theming": "^7.4.1",
|
|
30
31
|
"@testing-library/jest-dom": "^5.16.1",
|
|
31
32
|
"@testing-library/react": "^12.1.2",
|
|
32
33
|
"@testing-library/user-event": "^13.5.0",
|
|
@@ -44,15 +45,16 @@
|
|
|
44
45
|
"react-dom": "^17.0.2",
|
|
45
46
|
"react-router-dom": "^6.2.1",
|
|
46
47
|
"rimraf": "^3.0.2",
|
|
48
|
+
"storybook": "^7.4.1",
|
|
47
49
|
"styled-components": "^5.3.3",
|
|
48
50
|
"tsup": "^6.5.0",
|
|
49
51
|
"typescript": "^4.9.5"
|
|
50
52
|
},
|
|
51
53
|
"dependencies": {
|
|
52
|
-
"@charcoal-ui/icons": "^3.
|
|
53
|
-
"@charcoal-ui/styled": "^3.
|
|
54
|
-
"@charcoal-ui/theme": "^3.
|
|
55
|
-
"@charcoal-ui/utils": "^3.
|
|
54
|
+
"@charcoal-ui/icons": "^3.3.0-beta.0",
|
|
55
|
+
"@charcoal-ui/styled": "^3.3.0-beta.0",
|
|
56
|
+
"@charcoal-ui/theme": "^3.3.0-beta.0",
|
|
57
|
+
"@charcoal-ui/utils": "^3.3.0-beta.0",
|
|
56
58
|
"@react-aria/button": "^3.7.0",
|
|
57
59
|
"@react-aria/checkbox": "^3.8.0",
|
|
58
60
|
"@react-aria/dialog": "^3.5.0",
|
|
@@ -88,5 +90,5 @@
|
|
|
88
90
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
89
91
|
"directory": "packages/react"
|
|
90
92
|
},
|
|
91
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "aa4321ee5b76734602f8e135caa5e91388ca9403"
|
|
92
94
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import 'jest-styled-components'
|
|
2
2
|
|
|
3
3
|
import Button from '.'
|
|
4
|
-
import
|
|
4
|
+
import renderer from 'react-test-renderer'
|
|
5
5
|
import { ThemeProvider } from 'styled-components'
|
|
6
6
|
import { light } from '@charcoal-ui/theme'
|
|
7
7
|
|
|
8
8
|
export function render(children: JSX.Element) {
|
|
9
|
-
return
|
|
9
|
+
return renderer
|
|
10
10
|
.create(<ThemeProvider theme={light}>{children}</ThemeProvider>)
|
|
11
11
|
.toJSON()
|
|
12
12
|
}
|
|
@@ -58,7 +58,7 @@ const StyledButton = styled(Clickable)<StyledProps>`
|
|
|
58
58
|
${(p) =>
|
|
59
59
|
theme((o) => [
|
|
60
60
|
o.font[variantToFont(p.$variant)].hover.press,
|
|
61
|
-
o.bg[
|
|
61
|
+
o.bg[variantToBackground(p.$variant)].hover.press,
|
|
62
62
|
o.typography(14).bold.preserveHalfLeading,
|
|
63
63
|
o.padding.horizontal(p.$size === 'M' ? 24 : 16),
|
|
64
64
|
o.disabled,
|
|
@@ -70,7 +70,7 @@ const StyledButton = styled(Clickable)<StyledProps>`
|
|
|
70
70
|
height: ${(p) => (p.$size === 'M' ? 40 : 32)}px;
|
|
71
71
|
`
|
|
72
72
|
|
|
73
|
-
function
|
|
73
|
+
function variantToBackground(variant: Variant) {
|
|
74
74
|
switch (variant) {
|
|
75
75
|
case 'Overlay':
|
|
76
76
|
return 'surface4'
|
|
@@ -2,12 +2,12 @@ import { light } from '@charcoal-ui/theme'
|
|
|
2
2
|
import 'jest-styled-components'
|
|
3
3
|
|
|
4
4
|
import React from 'react'
|
|
5
|
-
import
|
|
5
|
+
import renderer from 'react-test-renderer'
|
|
6
6
|
import { ThemeProvider } from 'styled-components'
|
|
7
7
|
import Checkbox from '.'
|
|
8
8
|
|
|
9
9
|
export function render(children: JSX.Element) {
|
|
10
|
-
return
|
|
10
|
+
return renderer
|
|
11
11
|
.create(<ThemeProvider theme={light}>{children}</ThemeProvider>)
|
|
12
12
|
.toJSON()
|
|
13
13
|
}
|
|
@@ -50,7 +50,7 @@ const LoadingSpinnerRoot = styled.div.attrs({ role: 'progressbar' })<{
|
|
|
50
50
|
])}
|
|
51
51
|
`
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const scaleOut = keyframes`
|
|
54
54
|
from {
|
|
55
55
|
transform: scale(0);
|
|
56
56
|
opacity: 1;
|
|
@@ -67,7 +67,7 @@ const Icon = styled.div.attrs({ role: 'presentation' })<{ once: boolean }>`
|
|
|
67
67
|
height: 1em;
|
|
68
68
|
border-radius: 1em;
|
|
69
69
|
background-color: currentColor;
|
|
70
|
-
animation: ${
|
|
70
|
+
animation: ${scaleOut} 1s both ease-out;
|
|
71
71
|
animation-iteration-count: ${(p) => (p.once ? 1 : 'infinite')};
|
|
72
72
|
|
|
73
73
|
&[data-reset-animation] {
|
|
@@ -3,7 +3,7 @@ import { ThemeProvider } from 'styled-components'
|
|
|
3
3
|
import ComponentAbstraction, { Components } from './ComponentAbstraction'
|
|
4
4
|
import { TokenInjector } from '@charcoal-ui/styled'
|
|
5
5
|
import { ThemeMap } from '@charcoal-ui/styled/src/TokenInjector'
|
|
6
|
-
import { CharcoalTheme } from '@charcoal-ui/theme'
|
|
6
|
+
import { CharcoalTheme, ThemeColor } from '@charcoal-ui/theme'
|
|
7
7
|
|
|
8
8
|
import { OverlayProvider } from './OverlayProvider'
|
|
9
9
|
import { SSRProvider } from './SSRProvider'
|
|
@@ -13,6 +13,7 @@ export type CharcoalProviderProps = React.PropsWithChildren<{
|
|
|
13
13
|
defaultTheme?: CharcoalTheme
|
|
14
14
|
injectTokens?: boolean
|
|
15
15
|
components?: Partial<Components>
|
|
16
|
+
background?: keyof ThemeColor
|
|
16
17
|
}>
|
|
17
18
|
|
|
18
19
|
export function CharcoalProvider({
|
|
@@ -21,11 +22,14 @@ export function CharcoalProvider({
|
|
|
21
22
|
components = {},
|
|
22
23
|
injectTokens = true,
|
|
23
24
|
children,
|
|
25
|
+
background,
|
|
24
26
|
}: CharcoalProviderProps) {
|
|
25
27
|
return (
|
|
26
28
|
<SSRProvider>
|
|
27
29
|
<ThemeProvider theme={defaultTheme}>
|
|
28
|
-
{injectTokens &&
|
|
30
|
+
{injectTokens && (
|
|
31
|
+
<TokenInjector theme={themeMap} background={background} />
|
|
32
|
+
)}
|
|
29
33
|
<ComponentAbstraction components={components}>
|
|
30
34
|
<OverlayProvider>{children}</OverlayProvider>
|
|
31
35
|
</ComponentAbstraction>
|