@charcoal-ui/styled 4.3.0-beta.5 → 4.4.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/index.test.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
+
"version": "4.4.0",
|
|
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.
|
|
29
|
+
"@charcoal-ui/react": "4.4.0"
|
|
32
30
|
},
|
|
33
31
|
"dependencies": {
|
|
34
32
|
"warning": "^4.0.3",
|
|
35
|
-
"@charcoal-ui/
|
|
36
|
-
"@charcoal-ui/
|
|
37
|
-
"@charcoal-ui/utils": "4.
|
|
33
|
+
"@charcoal-ui/theme": "4.4.0",
|
|
34
|
+
"@charcoal-ui/foundation": "4.4.0",
|
|
35
|
+
"@charcoal-ui/utils": "4.4.0"
|
|
38
36
|
},
|
|
39
37
|
"peerDependencies": {
|
|
40
38
|
"react": ">=17.0.0",
|
|
41
39
|
"styled-components": ">=5.1.1",
|
|
42
|
-
"@charcoal-ui/react": "4.
|
|
40
|
+
"@charcoal-ui/react": "4.4.0"
|
|
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
|
-
|
|
114
|
+
data-dark="false"
|
|
117
115
|
>
|
|
118
116
|
<div
|
|
119
|
-
|
|
117
|
+
class="c0"
|
|
120
118
|
>
|
|
121
119
|
<div
|
|
122
|
-
|
|
120
|
+
class="c1"
|
|
123
121
|
>
|
|
124
|
-
|
|
122
|
+
<div
|
|
123
|
+
class="c2"
|
|
124
|
+
>
|
|
125
|
+
\${({ theme }) => theme.utils.typography(14, true)}
|
|
126
|
+
</div>
|
|
125
127
|
</div>
|
|
126
|
-
</div>
|
|
127
|
-
<div
|
|
128
|
-
className="c1"
|
|
129
|
-
>
|
|
130
128
|
<div
|
|
131
|
-
|
|
129
|
+
class="c1"
|
|
132
130
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
131
|
+
<div
|
|
132
|
+
class="c3"
|
|
135
133
|
>
|
|
136
|
-
<
|
|
137
|
-
|
|
134
|
+
<pre
|
|
135
|
+
class="c4"
|
|
138
136
|
>
|
|
139
|
-
|
|
137
|
+
<code
|
|
138
|
+
class="c5"
|
|
139
|
+
>
|
|
140
|
+
\${({ theme }) => [
|
|
140
141
|
theme.utils.margin(16, 'auto'),
|
|
141
142
|
theme.utils.padding(4, 8, 16, 24),
|
|
142
143
|
]}
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
</code>
|
|
145
|
+
</pre>
|
|
146
|
+
</div>
|
|
145
147
|
</div>
|
|
146
|
-
</div>
|
|
147
|
-
<div
|
|
148
|
-
className="c1"
|
|
149
|
-
>
|
|
150
148
|
<div
|
|
151
|
-
|
|
149
|
+
class="c1"
|
|
152
150
|
>
|
|
153
|
-
|
|
151
|
+
<div
|
|
152
|
+
class="c6"
|
|
153
|
+
>
|
|
154
|
+
theme.utils.assertiveRingCss
|
|
155
|
+
</div>
|
|
154
156
|
</div>
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
169
|
-
|
|
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
|
-
|
|
114
|
+
class="c0"
|
|
117
115
|
>
|
|
118
116
|
<div
|
|
119
|
-
|
|
117
|
+
class="c1"
|
|
120
118
|
>
|
|
121
|
-
|
|
119
|
+
<div
|
|
120
|
+
class="c2"
|
|
121
|
+
>
|
|
122
|
+
\${({ theme }) => theme.utils.typography(14, true)}
|
|
123
|
+
</div>
|
|
122
124
|
</div>
|
|
123
|
-
</div>
|
|
124
|
-
<div
|
|
125
|
-
className="c1"
|
|
126
|
-
>
|
|
127
125
|
<div
|
|
128
|
-
|
|
126
|
+
class="c1"
|
|
129
127
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
128
|
+
<div
|
|
129
|
+
class="c3"
|
|
132
130
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
131
|
+
<pre
|
|
132
|
+
class="c4"
|
|
135
133
|
>
|
|
136
|
-
|
|
134
|
+
<code
|
|
135
|
+
class="c5"
|
|
136
|
+
>
|
|
137
|
+
\${({ theme }) => [
|
|
137
138
|
theme.utils.margin(16, 'auto'),
|
|
138
139
|
theme.utils.padding(4, 8, 16, 24),
|
|
139
140
|
]}
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
</code>
|
|
142
|
+
</pre>
|
|
143
|
+
</div>
|
|
142
144
|
</div>
|
|
143
|
-
</div>
|
|
144
|
-
<div
|
|
145
|
-
className="c1"
|
|
146
|
-
>
|
|
147
145
|
<div
|
|
148
|
-
|
|
146
|
+
class="c1"
|
|
149
147
|
>
|
|
150
|
-
|
|
148
|
+
<div
|
|
149
|
+
class="c6"
|
|
150
|
+
>
|
|
151
|
+
theme.utils.assertiveRingCss
|
|
152
|
+
</div>
|
|
151
153
|
</div>
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
166
|
-
|
|
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
|
-
|
|
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
|
`;
|
package/src/index.test.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { light } from '@charcoal-ui/theme'
|
|
2
2
|
import 'jest-styled-components'
|
|
3
3
|
|
|
4
|
-
import
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
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 />', () => {
|