@charcoal-ui/react 4.0.0-beta.6 → 4.0.0-beta.7
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/_lib/createDivComponent.d.ts +4 -0
- package/dist/_lib/createDivComponent.d.ts.map +1 -0
- package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextField/AssistiveText/index.d.ts +5 -0
- package/dist/components/TextField/AssistiveText/index.d.ts.map +1 -0
- package/dist/components/TextField/index.d.ts +1 -3
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/index.cjs.js +209 -239
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +156 -0
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +127 -157
- package/dist/index.esm.js.map +1 -1
- package/package.json +8 -8
- package/src/_lib/createDivComponent.tsx +11 -0
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +8 -20
- package/src/components/DropdownSelector/index.tsx +2 -2
- package/src/components/Modal/ModalPlumbing.tsx +2 -11
- package/src/components/Modal/__snapshots__/index.story.storyshot +84 -276
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +141 -813
- package/src/components/TextArea/index.css +78 -0
- package/src/components/TextArea/index.tsx +26 -96
- package/src/components/TextField/AssistiveText/index.css +10 -0
- package/src/components/TextField/AssistiveText/index.tsx +6 -0
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +109 -1059
- package/src/components/TextField/index.css +87 -0
- package/src/components/TextField/index.tsx +24 -117
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"clean": "rimraf dist .tsbuildinfo"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@charcoal-ui/esbuild-plugin-styled-components": "^4.0.0-beta.
|
|
31
|
+
"@charcoal-ui/esbuild-plugin-styled-components": "^4.0.0-beta.7",
|
|
32
32
|
"@react-types/switch": "^3.1.2",
|
|
33
33
|
"@storybook/addon-actions": "^8.0.5",
|
|
34
34
|
"@storybook/react": "^8.0.5",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"typescript": "^4.9.5"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@charcoal-ui/foundation": "^4.0.0-beta.
|
|
61
|
-
"@charcoal-ui/icons": "^4.0.0-beta.
|
|
62
|
-
"@charcoal-ui/styled": "^4.0.0-beta.
|
|
63
|
-
"@charcoal-ui/theme": "^4.0.0-beta.
|
|
64
|
-
"@charcoal-ui/utils": "^4.0.0-beta.
|
|
60
|
+
"@charcoal-ui/foundation": "^4.0.0-beta.7",
|
|
61
|
+
"@charcoal-ui/icons": "^4.0.0-beta.7",
|
|
62
|
+
"@charcoal-ui/styled": "^4.0.0-beta.7",
|
|
63
|
+
"@charcoal-ui/theme": "^4.0.0-beta.7",
|
|
64
|
+
"@charcoal-ui/utils": "^4.0.0-beta.7",
|
|
65
65
|
"@react-aria/button": "^3.9.1",
|
|
66
66
|
"@react-aria/checkbox": "^3.13.0",
|
|
67
67
|
"@react-aria/dialog": "^3.5.10",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"url": "https://github.com/pixiv/charcoal.git",
|
|
95
95
|
"directory": "packages/react"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "917b92762540e43b08b295b3fecccd47862d67e3"
|
|
98
98
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from 'react'
|
|
2
|
+
import { useClassNames } from './useClassNames'
|
|
3
|
+
|
|
4
|
+
export function createDivComponent(mainClassName: string) {
|
|
5
|
+
return forwardRef<HTMLDivElement, React.ComponentPropsWithRef<'div'>>(
|
|
6
|
+
function DivComponent({ className, ...props }, ref) {
|
|
7
|
+
const classNames = useClassNames(mainClassName, className)
|
|
8
|
+
return <div className={classNames} ref={ref} {...props} />
|
|
9
|
+
}
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Storybook Tests react/DropdownSelector AssistiveText 1`] = `
|
|
4
|
-
.c4 {
|
|
5
|
-
font-size: 14px;
|
|
6
|
-
line-height: 22px;
|
|
7
|
-
margin: 0;
|
|
8
|
-
color: var(--charcoal-text2);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
4
|
.c0 {
|
|
12
5
|
display: grid;
|
|
13
6
|
grid-template-columns: 1fr;
|
|
@@ -159,11 +152,12 @@ exports[`Storybook Tests react/DropdownSelector AssistiveText 1`] = `
|
|
|
159
152
|
name="16/Menu"
|
|
160
153
|
/>
|
|
161
154
|
</button>
|
|
162
|
-
<
|
|
163
|
-
className="
|
|
155
|
+
<div
|
|
156
|
+
className="charcoal-text-field-assistive-text"
|
|
157
|
+
data-invalid={false}
|
|
164
158
|
>
|
|
165
159
|
assistiveText
|
|
166
|
-
</
|
|
160
|
+
</div>
|
|
167
161
|
</div>
|
|
168
162
|
</div>
|
|
169
163
|
</div>
|
|
@@ -1173,13 +1167,6 @@ exports[`Storybook Tests react/DropdownSelector Invalid 1`] = `
|
|
|
1173
1167
|
`;
|
|
1174
1168
|
|
|
1175
1169
|
exports[`Storybook Tests react/DropdownSelector InvalidAssistiveText 1`] = `
|
|
1176
|
-
.c4 {
|
|
1177
|
-
font-size: 14px;
|
|
1178
|
-
line-height: 22px;
|
|
1179
|
-
margin: 0;
|
|
1180
|
-
color: var(--charcoal-assertive);
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
1170
|
.c0 {
|
|
1184
1171
|
display: grid;
|
|
1185
1172
|
grid-template-columns: 1fr;
|
|
@@ -1336,11 +1323,12 @@ exports[`Storybook Tests react/DropdownSelector InvalidAssistiveText 1`] = `
|
|
|
1336
1323
|
name="16/Menu"
|
|
1337
1324
|
/>
|
|
1338
1325
|
</button>
|
|
1339
|
-
<
|
|
1340
|
-
className="
|
|
1326
|
+
<div
|
|
1327
|
+
className="charcoal-text-field-assistive-text"
|
|
1328
|
+
data-invalid={true}
|
|
1341
1329
|
>
|
|
1342
1330
|
assistiveText
|
|
1343
|
-
</
|
|
1331
|
+
</div>
|
|
1344
1332
|
</div>
|
|
1345
1333
|
</div>
|
|
1346
1334
|
</div>
|
|
@@ -9,7 +9,7 @@ import MenuList, { MenuListChildren } from './MenuList'
|
|
|
9
9
|
import { focusVisibleFocusRingCss } from '@charcoal-ui/styled'
|
|
10
10
|
import { getValuesRecursive } from './MenuList/internals/getValuesRecursive'
|
|
11
11
|
import { useVisuallyHidden } from '@react-aria/visually-hidden'
|
|
12
|
-
import { AssistiveText } from '../TextField'
|
|
12
|
+
import { AssistiveText } from '../TextField/AssistiveText'
|
|
13
13
|
|
|
14
14
|
export type DropdownSelectorProps = {
|
|
15
15
|
label: string
|
|
@@ -121,7 +121,7 @@ export default function DropdownSelector({
|
|
|
121
121
|
</DropdownPopover>
|
|
122
122
|
)}
|
|
123
123
|
{props.assistiveText !== undefined && (
|
|
124
|
-
<AssistiveText invalid={props.invalid === true}>
|
|
124
|
+
<AssistiveText data-invalid={props.invalid === true}>
|
|
125
125
|
{props.assistiveText}
|
|
126
126
|
</AssistiveText>
|
|
127
127
|
)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModalContext } from '.'
|
|
2
|
-
import {
|
|
3
|
-
import { useClassNames } from '../../_lib/useClassNames'
|
|
2
|
+
import { useContext } from 'react'
|
|
4
3
|
|
|
5
4
|
import './ModalPlumbing.css'
|
|
5
|
+
import { createDivComponent } from '../../_lib/createDivComponent'
|
|
6
6
|
|
|
7
7
|
export function ModalHeader() {
|
|
8
8
|
const modalCtx = useContext(ModalContext)
|
|
@@ -21,12 +21,3 @@ export const ModalAlign = createDivComponent('charcoal-modal-align')
|
|
|
21
21
|
export const ModalBody = createDivComponent('charcoal-modal-body')
|
|
22
22
|
|
|
23
23
|
export const ModalButtons = createDivComponent('charcoal-modal-buttons')
|
|
24
|
-
|
|
25
|
-
function createDivComponent(mainClassName: string) {
|
|
26
|
-
return forwardRef<HTMLDivElement, React.ComponentPropsWithRef<'div'>>(
|
|
27
|
-
function DivComponent({ className, ...props }, ref) {
|
|
28
|
-
const classNames = useClassNames(mainClassName, className)
|
|
29
|
-
return <div className={classNames} ref={ref} {...props} />
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
}
|