@charcoal-ui/styled 4.3.0 → 4.4.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.tsx"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAK/B,OAAO,EAAE,OAAO,EAAW,MAAM,eAAe,CAAA;AA+BhD,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAiB,YAAa,SAAQ,OAAO;KAAG;CACjD"}
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.tsx"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAK/B,OAAO,EAAE,OAAO,EAAW,MAAM,eAAe,CAAA;AAiChD,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAiB,YAAa,SAAQ,OAAO;KAAG;CACjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/styled",
3
- "version": "4.3.0",
3
+ "version": "4.4.1",
4
4
  "license": "Apache-2.0",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs.js",
@@ -14,7 +14,6 @@
14
14
  "sideEffects": false,
15
15
  "devDependencies": {
16
16
  "@types/react": "^18.3.3",
17
- "@types/react-test-renderer": "^18.3.0",
18
17
  "@types/styled-components": "^5.1.21",
19
18
  "@types/warning": "^3.0.0",
20
19
  "@vitejs/plugin-react": "^4.3.1",
@@ -22,24 +21,23 @@
22
21
  "jsdom": "^24.1.0",
23
22
  "npm-run-all": "^4.1.5",
24
23
  "react": "^18.3.1",
25
- "react-test-renderer": "^18.3.1",
26
24
  "rimraf": "^3.0.2",
27
25
  "styled-components": "^5.3.3",
28
26
  "tsup": "^6.5.0",
29
27
  "typescript": "^4.9.5",
30
28
  "vitest": "^2.0.2",
31
- "@charcoal-ui/react": "4.3.0"
29
+ "@charcoal-ui/react": "4.4.1"
32
30
  },
33
31
  "dependencies": {
34
32
  "warning": "^4.0.3",
35
- "@charcoal-ui/theme": "4.3.0",
36
- "@charcoal-ui/foundation": "4.3.0",
37
- "@charcoal-ui/utils": "4.3.0"
33
+ "@charcoal-ui/foundation": "4.4.1",
34
+ "@charcoal-ui/theme": "4.4.1",
35
+ "@charcoal-ui/utils": "4.4.1"
38
36
  },
39
37
  "peerDependencies": {
40
38
  "react": ">=17.0.0",
41
39
  "styled-components": ">=5.1.1",
42
- "@charcoal-ui/react": "4.3.0"
40
+ "@charcoal-ui/react": "4.4.1"
43
41
  },
44
42
  "files": [
45
43
  "src",
@@ -109,64 +109,66 @@ exports[`Storybook Tests > styled/addThemeUtils > Example 1`] = `
109
109
  background-color: var(--charcoal-brand-press);
110
110
  }
111
111
 
112
- <div
113
- data-dark={false}
114
- >
112
+ <div>
115
113
  <div
116
- className="c0"
114
+ data-dark="false"
117
115
  >
118
116
  <div
119
- className="c1"
117
+ class="c0"
120
118
  >
121
119
  <div
122
- className="c2"
120
+ class="c1"
123
121
  >
124
- \${({ theme }) =&gt; theme.utils.typography(14, true)}
122
+ <div
123
+ class="c2"
124
+ >
125
+ \${({ theme }) =&gt; theme.utils.typography(14, true)}
126
+ </div>
125
127
  </div>
126
- </div>
127
- <div
128
- className="c1"
129
- >
130
128
  <div
131
- className="c3"
129
+ class="c1"
132
130
  >
133
- <pre
134
- className="c4"
131
+ <div
132
+ class="c3"
135
133
  >
136
- <code
137
- className="c5"
134
+ <pre
135
+ class="c4"
138
136
  >
139
- \${({ theme }) =&gt; [
137
+ <code
138
+ class="c5"
139
+ >
140
+ \${({ theme }) =&gt; [
140
141
  theme.utils.margin(16, 'auto'),
141
142
  theme.utils.padding(4, 8, 16, 24),
142
143
  ]}
143
- </code>
144
- </pre>
144
+ </code>
145
+ </pre>
146
+ </div>
145
147
  </div>
146
- </div>
147
- <div
148
- className="c1"
149
- >
150
148
  <div
151
- className="c6"
149
+ class="c1"
152
150
  >
153
- theme.utils.assertiveRingCss
151
+ <div
152
+ class="c6"
153
+ >
154
+ theme.utils.assertiveRingCss
155
+ </div>
154
156
  </div>
155
- </div>
156
- <div
157
- className="c1"
158
- >
159
- <button
160
- className="c7"
161
- >
162
- theme.utils.focusVisibleFocusRingCss
163
- </button>
164
- <button
165
- className="c7"
166
- disabled={true}
157
+ <div
158
+ class="c1"
167
159
  >
168
- theme.utils.disabledCss
169
- </button>
160
+ <button
161
+ class="c7"
162
+ >
163
+ theme.utils.focusVisibleFocusRingCss
164
+ </button>
165
+ <button
166
+ class="c7"
167
+ disabled=""
168
+ >
169
+ theme.utils.disabledCss
170
+ </button>
171
+ </div>
170
172
  </div>
171
173
  </div>
172
174
  </div>
@@ -109,61 +109,63 @@ exports[`Story > <Example /> 1`] = `
109
109
  background-color: var(--charcoal-brand-press);
110
110
  }
111
111
 
112
- <div
113
- className="c0"
114
- >
112
+ <div>
115
113
  <div
116
- className="c1"
114
+ class="c0"
117
115
  >
118
116
  <div
119
- className="c2"
117
+ class="c1"
120
118
  >
121
- \${({ theme }) =&gt; theme.utils.typography(14, true)}
119
+ <div
120
+ class="c2"
121
+ >
122
+ \${({ theme }) =&gt; theme.utils.typography(14, true)}
123
+ </div>
122
124
  </div>
123
- </div>
124
- <div
125
- className="c1"
126
- >
127
125
  <div
128
- className="c3"
126
+ class="c1"
129
127
  >
130
- <pre
131
- className="c4"
128
+ <div
129
+ class="c3"
132
130
  >
133
- <code
134
- className="c5"
131
+ <pre
132
+ class="c4"
135
133
  >
136
- \${({ theme }) =&gt; [
134
+ <code
135
+ class="c5"
136
+ >
137
+ \${({ theme }) =&gt; [
137
138
  theme.utils.margin(16, 'auto'),
138
139
  theme.utils.padding(4, 8, 16, 24),
139
140
  ]}
140
- </code>
141
- </pre>
141
+ </code>
142
+ </pre>
143
+ </div>
142
144
  </div>
143
- </div>
144
- <div
145
- className="c1"
146
- >
147
145
  <div
148
- className="c6"
146
+ class="c1"
149
147
  >
150
- theme.utils.assertiveRingCss
148
+ <div
149
+ class="c6"
150
+ >
151
+ theme.utils.assertiveRingCss
152
+ </div>
151
153
  </div>
152
- </div>
153
- <div
154
- className="c1"
155
- >
156
- <button
157
- className="c7"
158
- >
159
- theme.utils.focusVisibleFocusRingCss
160
- </button>
161
- <button
162
- className="c7"
163
- disabled={true}
154
+ <div
155
+ class="c1"
164
156
  >
165
- theme.utils.disabledCss
166
- </button>
157
+ <button
158
+ class="c7"
159
+ >
160
+ theme.utils.focusVisibleFocusRingCss
161
+ </button>
162
+ <button
163
+ class="c7"
164
+ disabled=""
165
+ >
166
+ theme.utils.disabledCss
167
+ </button>
168
+ </div>
167
169
  </div>
168
170
  </div>
169
171
  `;
@@ -265,17 +267,19 @@ exports[`ThemeUtilsTest > <ThemeUtilsTest /> 1`] = `
265
267
  font-weight: bold;
266
268
  }
267
269
 
268
- <div
269
- className="c0"
270
- >
271
- <div
272
- className="c1"
273
- />
274
- <div
275
- className="c2"
276
- />
270
+ <div>
277
271
  <div
278
- className="c3"
279
- />
272
+ class="c0"
273
+ >
274
+ <div
275
+ class="c1"
276
+ />
277
+ <div
278
+ class="c2"
279
+ />
280
+ <div
281
+ class="c3"
282
+ />
283
+ </div>
280
284
  </div>
281
285
  `;
@@ -1,7 +1,7 @@
1
1
  import { light } from '@charcoal-ui/theme'
2
2
  import 'jest-styled-components'
3
3
 
4
- import renderer from 'react-test-renderer'
4
+ import { render as testRender, cleanup } from '@testing-library/react'
5
5
  import styled, { ThemeProvider } from 'styled-components'
6
6
  import { Example } from './addThemeUtils.story'
7
7
  import { MyTheme, myTheme } from './storyHelper'
@@ -9,11 +9,13 @@ import { MyTheme, myTheme } from './storyHelper'
9
9
  import type { JSX } from 'react'
10
10
 
11
11
  function render(children: JSX.Element) {
12
- return renderer
13
- .create(<ThemeProvider theme={myTheme(light)}>{children}</ThemeProvider>)
14
- .toJSON()
12
+ return testRender(
13
+ <ThemeProvider theme={myTheme(light)}>{children}</ThemeProvider>
14
+ ).container
15
15
  }
16
16
 
17
+ afterEach(() => cleanup())
18
+
17
19
  // TODO: もう少し theme() 関数に対する丁寧なユニットテストが欲しい
18
20
  describe('Story', () => {
19
21
  test('<Example />', () => {