@charcoal-ui/react 5.0.0-beta.2 → 5.0.0-beta.4
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 +1 -1
- package/dist/_lib/useForwardedRef.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -12
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxWithLabel.d.ts +3 -3
- package/dist/components/Checkbox/CheckboxWithLabel.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts +6 -6
- package/dist/components/Clickable/index.d.ts +1 -1
- package/dist/components/Clickable/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/MenuItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/Modal/ModalPlumbing.d.ts +3 -3
- package/dist/components/Modal/index.d.ts +8 -8
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +6 -6
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/Radio/RadioInput/index.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +3 -3
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Switch/SwitchWithLabel.d.ts +3 -3
- package/dist/components/Switch/SwitchWithLabel.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts +5 -5
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TextArea/index.d.ts +11 -11
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextField/AssistiveText/index.d.ts +1 -1
- package/dist/components/TextField/index.d.ts +11 -11
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/core/SSRProvider.d.ts +1 -1
- package/dist/core/themeHelper.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -17
- package/src/_lib/useForwardedRef.tsx +1 -0
- package/src/components/Button/index.story.tsx +4 -4
- package/src/components/DropdownSelector/DropdownMenuItem/index.tsx +1 -1
- package/src/components/DropdownSelector/ListItem/index.tsx +1 -1
- package/src/components/DropdownSelector/MenuItem/index.tsx +2 -1
- package/src/components/DropdownSelector/Popover/usePreventScroll.tsx +1 -0
- package/src/components/DropdownSelector/index.tsx +1 -0
- package/src/components/Modal/index.story.tsx +4 -12
- package/src/components/MultiSelect/index.test.tsx +4 -4
- package/src/components/MultiSelect/index.tsx +1 -1
- package/src/components/Radio/RadioInput/index.tsx +1 -0
- package/src/components/TagItem/index.tsx +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"*.css"
|
|
27
27
|
],
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@babel/core": "^7.23.9",
|
|
30
29
|
"@react-types/dialog": "^3.5.15",
|
|
31
30
|
"@react-types/switch": "^3.1.2",
|
|
32
31
|
"@storybook/addon-actions": "^8.0.5",
|
|
@@ -42,15 +41,9 @@
|
|
|
42
41
|
"@vitejs/plugin-react": "^4.3.1",
|
|
43
42
|
"autoprefixer": "^10.4.19",
|
|
44
43
|
"jsdom": "^24.1.0",
|
|
45
|
-
"npm-run-all": "^4.1.5",
|
|
46
44
|
"react": "^18.3.1",
|
|
47
45
|
"react-dom": "^18.3.1",
|
|
48
|
-
"react-router-dom": "^6.2.1"
|
|
49
|
-
"rimraf": "^3.0.2",
|
|
50
|
-
"tsup": "^6.5.0",
|
|
51
|
-
"typescript": "^4.9.5",
|
|
52
|
-
"vitest": "^2.0.1",
|
|
53
|
-
"@charcoal-ui/esbuild-plugin-styled-components": "5.0.0-beta.2"
|
|
46
|
+
"react-router-dom": "^6.2.1"
|
|
54
47
|
},
|
|
55
48
|
"dependencies": {
|
|
56
49
|
"@react-aria/button": "^3.9.1",
|
|
@@ -68,14 +61,13 @@
|
|
|
68
61
|
"react-spring": "^9.0.0",
|
|
69
62
|
"react-stately": "^3.26.0",
|
|
70
63
|
"warning": "^4.0.3",
|
|
71
|
-
"@charcoal-ui/
|
|
72
|
-
"@charcoal-ui/
|
|
73
|
-
"@charcoal-ui/theme": "5.0.0-beta.
|
|
74
|
-
"@charcoal-ui/utils": "5.0.0-beta.
|
|
64
|
+
"@charcoal-ui/icons": "5.0.0-beta.4",
|
|
65
|
+
"@charcoal-ui/foundation": "5.0.0-beta.4",
|
|
66
|
+
"@charcoal-ui/theme": "5.0.0-beta.4",
|
|
67
|
+
"@charcoal-ui/utils": "5.0.0-beta.4"
|
|
75
68
|
},
|
|
76
69
|
"peerDependencies": {
|
|
77
|
-
"react": ">=17.0.0"
|
|
78
|
-
"styled-components": ">=5.1.1"
|
|
70
|
+
"react": ">=17.0.0"
|
|
79
71
|
},
|
|
80
72
|
"files": [
|
|
81
73
|
"src",
|
|
@@ -91,9 +83,8 @@
|
|
|
91
83
|
},
|
|
92
84
|
"gitHead": "e1ece2e43901ae667afdd5c178040607d939dcd5",
|
|
93
85
|
"scripts": {
|
|
94
|
-
"build": "run-
|
|
86
|
+
"build": "run-s --print-label 'build:*'",
|
|
95
87
|
"build:tsdown": "tsdown",
|
|
96
|
-
"build-old:tsup": "tsup",
|
|
97
88
|
"build:dts": "tsc --project tsconfig.build.json --pretty --emitDeclarationOnly",
|
|
98
89
|
"typecheck": "tsc --project tsconfig.build.json --pretty --noEmit",
|
|
99
90
|
"clean": "rimraf dist .tsbuildinfo",
|
|
@@ -143,23 +143,23 @@ export const AriaDisabled: StoryObj<typeof Button> = {
|
|
|
143
143
|
<h2>{`disabled={true}`}</h2>
|
|
144
144
|
<div style={{ display: 'flex', gap: '8px' }}>
|
|
145
145
|
<div>
|
|
146
|
-
<Button disabled
|
|
146
|
+
<Button disabled>属性なし</Button>
|
|
147
147
|
</div>
|
|
148
148
|
<div>
|
|
149
|
-
<Button aria-disabled disabled
|
|
149
|
+
<Button aria-disabled disabled>
|
|
150
150
|
aria-disabled
|
|
151
151
|
</Button>
|
|
152
152
|
</div>
|
|
153
153
|
<div>
|
|
154
154
|
<Button
|
|
155
155
|
aria-disabled="true"
|
|
156
|
-
disabled
|
|
156
|
+
disabled
|
|
157
157
|
>{`aria-disabled="true"`}</Button>
|
|
158
158
|
</div>
|
|
159
159
|
<div>
|
|
160
160
|
<Button
|
|
161
161
|
aria-disabled="false"
|
|
162
|
-
disabled
|
|
162
|
+
disabled
|
|
163
163
|
>{`aria-disabled="false"`}</Button>
|
|
164
164
|
</div>
|
|
165
165
|
</div>
|
|
@@ -19,7 +19,7 @@ const ListItem = forwardRef(function ListItem<T extends React.ElementType>(
|
|
|
19
19
|
) {
|
|
20
20
|
const Component = useMemo(() => as ?? 'li', [as])
|
|
21
21
|
const classNames = useClassNames('charcoal-list-item', className)
|
|
22
|
-
return <Component className={classNames} ref={ref} {...props}
|
|
22
|
+
return <Component className={classNames} ref={ref} {...props} />
|
|
23
23
|
}) as <T extends React.ElementType = 'li'>(p: ListItemProps<T>) => JSX.Element
|
|
24
24
|
|
|
25
25
|
export default ListItem
|
|
@@ -14,11 +14,12 @@ export type MenuItemProps<T extends React.ElementType = 'li'> = {
|
|
|
14
14
|
const MenuItem = forwardRef(function MenuItem<
|
|
15
15
|
T extends React.ElementType = 'li'
|
|
16
16
|
>(
|
|
17
|
-
{ className, value, disabled, ...props }: MenuItemProps<T>,
|
|
17
|
+
{ className: _, value, disabled, ...props }: MenuItemProps<T>,
|
|
18
18
|
ref: ForwardedRef<HTMLLIElement>
|
|
19
19
|
) {
|
|
20
20
|
const [handleKeyDown, setContextValue] = useMenuItemHandleKeyDown(value)
|
|
21
21
|
return (
|
|
22
|
+
// @ts-expect-error TODO: fix mismatch between MenuItemProps and ListItemProps
|
|
22
23
|
<ListItem
|
|
23
24
|
{...props}
|
|
24
25
|
ref={ref}
|
|
@@ -9,6 +9,7 @@ export function usePreventScroll(
|
|
|
9
9
|
if (isOpen && element) {
|
|
10
10
|
const defaultPaddingRight = element.style.paddingRight
|
|
11
11
|
const defaultOverflow = element.style.overflow
|
|
12
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
12
13
|
element.style.paddingRight = `${
|
|
13
14
|
window.innerWidth - element.clientWidth
|
|
14
15
|
}px`
|
|
@@ -68,7 +68,7 @@ const M = (props: ModalProps) => {
|
|
|
68
68
|
possimus fugiat aspernatur, numquam, commodi repellat.
|
|
69
69
|
</StyledModalText>
|
|
70
70
|
<ModalAlign>
|
|
71
|
-
<TextField showLabel label="Name" placeholder="Nagisa"
|
|
71
|
+
<TextField showLabel label="Name" placeholder="Nagisa" />
|
|
72
72
|
</ModalAlign>
|
|
73
73
|
<ModalAlign>
|
|
74
74
|
<TextField
|
|
@@ -76,7 +76,7 @@ const M = (props: ModalProps) => {
|
|
|
76
76
|
showLabel
|
|
77
77
|
label="Country"
|
|
78
78
|
placeholder="Tokyo"
|
|
79
|
-
|
|
79
|
+
/>
|
|
80
80
|
</ModalAlign>
|
|
81
81
|
<ModalAlign>
|
|
82
82
|
<DropdownSelector
|
|
@@ -161,18 +161,10 @@ export const FullBottomSheet: StoryObj<typeof Modal> = {
|
|
|
161
161
|
possimus fugiat aspernatur, numquam, commodi repellat.
|
|
162
162
|
</StyledModalText>
|
|
163
163
|
<ModalAlign>
|
|
164
|
-
<TextField
|
|
165
|
-
showLabel
|
|
166
|
-
label="Name"
|
|
167
|
-
placeholder="Nagisa"
|
|
168
|
-
></TextField>
|
|
164
|
+
<TextField showLabel label="Name" placeholder="Nagisa" />
|
|
169
165
|
</ModalAlign>
|
|
170
166
|
<ModalAlign>
|
|
171
|
-
<TextField
|
|
172
|
-
showLabel
|
|
173
|
-
label="Country"
|
|
174
|
-
placeholder="Tokyo"
|
|
175
|
-
></TextField>
|
|
167
|
+
<TextField showLabel label="Country" placeholder="Tokyo" />
|
|
176
168
|
</ModalAlign>
|
|
177
169
|
</ModalVStack>
|
|
178
170
|
<ModalButtons>
|
|
@@ -137,7 +137,7 @@ describe('MultiSelect', () => {
|
|
|
137
137
|
let allOptions: HTMLInputElement[]
|
|
138
138
|
|
|
139
139
|
beforeEach(() => {
|
|
140
|
-
render(<TestComponent selected={['option1']} parentDisabled
|
|
140
|
+
render(<TestComponent selected={['option1']} parentDisabled />)
|
|
141
141
|
|
|
142
142
|
option1 = screen.getByDisplayValue('option1')
|
|
143
143
|
option2 = screen.getByDisplayValue('option2')
|
|
@@ -157,7 +157,7 @@ describe('MultiSelect', () => {
|
|
|
157
157
|
let allOptions: HTMLInputElement[]
|
|
158
158
|
|
|
159
159
|
beforeEach(() => {
|
|
160
|
-
render(<TestComponent selected={['option1']} readonly
|
|
160
|
+
render(<TestComponent selected={['option1']} readonly />)
|
|
161
161
|
|
|
162
162
|
option1 = screen.getByDisplayValue('option1')
|
|
163
163
|
option2 = screen.getByDisplayValue('option2')
|
|
@@ -177,7 +177,7 @@ describe('MultiSelect', () => {
|
|
|
177
177
|
let allOptions: HTMLInputElement[]
|
|
178
178
|
|
|
179
179
|
beforeEach(() => {
|
|
180
|
-
render(<TestComponent selected={['option1']} invalid
|
|
180
|
+
render(<TestComponent selected={['option1']} invalid />)
|
|
181
181
|
|
|
182
182
|
option1 = screen.getByDisplayValue('option1')
|
|
183
183
|
option2 = screen.getByDisplayValue('option2')
|
|
@@ -197,7 +197,7 @@ describe('MultiSelect', () => {
|
|
|
197
197
|
let option2: HTMLInputElement
|
|
198
198
|
|
|
199
199
|
beforeEach(() => {
|
|
200
|
-
render(<TestComponent selected={[]} firstOptionDisabled
|
|
200
|
+
render(<TestComponent selected={[]} firstOptionDisabled />)
|
|
201
201
|
|
|
202
202
|
option1 = screen.getByDisplayValue('option1')
|
|
203
203
|
option2 = screen.getByDisplayValue('option2')
|
|
@@ -74,7 +74,7 @@ const MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(
|
|
|
74
74
|
className="charcoal-multi-select-overlay"
|
|
75
75
|
data-overlay={variant === 'overlay'}
|
|
76
76
|
aria-invalid={invalid}
|
|
77
|
-
aria-hidden
|
|
77
|
+
aria-hidden
|
|
78
78
|
>
|
|
79
79
|
<Icon name="24/Check" unsafe-non-guideline-scale={16 / 24} />
|
|
80
80
|
</div>
|
|
@@ -26,6 +26,7 @@ const RadioInput = forwardRef<HTMLInputElement, RadioInputProps>(
|
|
|
26
26
|
const classNames = useClassNames('charcoal-radio-input', className)
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
+
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
|
|
29
30
|
<input
|
|
30
31
|
className={classNames}
|
|
31
32
|
ref={ref}
|
|
@@ -5,9 +5,9 @@ import { useClassNames } from '../../_lib/useClassNames'
|
|
|
5
5
|
|
|
6
6
|
import './index.css'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
S: 32
|
|
10
|
-
M: 40
|
|
8
|
+
type SizeMap = {
|
|
9
|
+
S: 32
|
|
10
|
+
M: 40
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type TagItemProps<T extends React.ElementType = 'button'> = {
|
|
@@ -16,7 +16,7 @@ export type TagItemProps<T extends React.ElementType = 'button'> = {
|
|
|
16
16
|
bgColor?: string
|
|
17
17
|
bgImage?: string
|
|
18
18
|
status?: 'default' | 'active' | 'inactive'
|
|
19
|
-
size?: keyof
|
|
19
|
+
size?: keyof SizeMap
|
|
20
20
|
/**
|
|
21
21
|
* The component used for root element.
|
|
22
22
|
* @type T extends React.ElementType = 'button'
|