@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/react",
3
- "version": "3.2.0",
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": "^6.4.17",
23
- "@storybook/addon-knobs": "^6.4.0",
24
- "@storybook/addons": "^6.4.17",
25
- "@storybook/api": "^6.4.17",
26
- "@storybook/components": "^6.4.17",
27
- "@storybook/core-events": "^6.4.17",
28
- "@storybook/react": "^6.4.17",
29
- "@storybook/theming": "^6.4.17",
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.2.0",
53
- "@charcoal-ui/styled": "^3.2.0",
54
- "@charcoal-ui/theme": "^3.2.0",
55
- "@charcoal-ui/utils": "^3.2.0",
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": "495dc492d64a159618461a074b2315547eeda99f"
93
+ "gitHead": "aa4321ee5b76734602f8e135caa5e91388ca9403"
92
94
  }
@@ -1,12 +1,12 @@
1
1
  import 'jest-styled-components'
2
2
 
3
3
  import Button from '.'
4
- import renderder from 'react-test-renderer'
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 renderder
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[variantToBackgraund(p.$variant)].hover.press,
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 variantToBackgraund(variant: Variant) {
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 renderder from 'react-test-renderer'
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 renderder
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 scaleout = keyframes`
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: ${scaleout} 1s both ease-out;
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 && <TokenInjector theme={themeMap} />}
30
+ {injectTokens && (
31
+ <TokenInjector theme={themeMap} background={background} />
32
+ )}
29
33
  <ComponentAbstraction components={components}>
30
34
  <OverlayProvider>{children}</OverlayProvider>
31
35
  </ComponentAbstraction>