@charcoal-ui/react 5.11.0 → 6.0.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/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/useCustomModalOverlay.d.ts +1 -1
- package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/core/OverlayProvider.d.ts +1 -1
- package/dist/core/OverlayProvider.d.ts.map +1 -1
- package/dist/core/SSRProvider.d.ts +1 -1
- package/dist/core/SSRProvider.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +15 -24
- package/src/__tests__/css-output.test.ts +2 -1
- package/src/components/Checkbox/__snapshots__/index.css.snap +1 -0
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/DropdownSelector/Popover/index.tsx +2 -1
- package/src/components/DropdownSelector/index.tsx +3 -2
- package/src/components/Modal/Dialog/index.tsx +1 -1
- package/src/components/Modal/index.story.tsx +9 -9
- package/src/components/Modal/index.tsx +4 -3
- package/src/components/Modal/useCustomModalOverlay.tsx +6 -5
- package/src/components/Radio/__snapshots__/index.css.snap +1 -0
- package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
- package/src/components/SegmentedControl/index.tsx +5 -5
- package/src/components/Switch/__snapshots__/index.css.snap +1 -0
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/TagItem/index.tsx +2 -2
- package/src/components/TextArea/index.tsx +2 -2
- package/src/components/TextEllipsis/__snapshots__/index.css.snap +1 -0
- package/src/components/TextField/index.tsx +3 -3
- package/src/core/OverlayProvider.tsx +1 -1
- package/src/core/SSRProvider.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcoal-ui/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -20,47 +20,37 @@
|
|
|
20
20
|
"*.css"
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@react-types/dialog": "^3.5.15",
|
|
24
|
-
"@react-types/switch": "^3.1.2",
|
|
25
23
|
"@testing-library/jest-dom": "^6.6.3",
|
|
26
24
|
"@testing-library/react": "^16.2.0",
|
|
27
25
|
"@testing-library/user-event": "^13.5.0",
|
|
28
|
-
"@types/glob": "^8.1.0",
|
|
29
26
|
"@types/react": "^18.3.3",
|
|
30
27
|
"@types/react-dom": "^18.3.0",
|
|
31
|
-
"@types/react-router-dom": "^5.3.3",
|
|
32
28
|
"@types/warning": "^3.0.4",
|
|
29
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
30
|
+
"@vitest/browser": "^2.1.9",
|
|
33
31
|
"autoprefixer": "^10.4.19",
|
|
34
32
|
"jsdom": "^24.1.0",
|
|
33
|
+
"playwright": "^1.58.2",
|
|
35
34
|
"postcss-nested": "^7.0.2",
|
|
36
35
|
"react": "^18.3.1",
|
|
36
|
+
"react-aria": "3.48.0",
|
|
37
37
|
"react-dom": "^18.3.1",
|
|
38
|
-
"react-
|
|
38
|
+
"react-stately": "3.46.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@react-aria/button": "^3.9.1",
|
|
42
|
-
"@react-aria/checkbox": "^3.13.0",
|
|
43
|
-
"@react-aria/dialog": "^3.5.10",
|
|
44
|
-
"@react-aria/focus": "^3.16.0",
|
|
45
|
-
"@react-aria/overlays": "^3.20.0",
|
|
46
|
-
"@react-aria/radio": "^3.10.0",
|
|
47
|
-
"@react-aria/ssr": "^3.9.1",
|
|
48
|
-
"@react-aria/switch": "^3.6.0",
|
|
49
|
-
"@react-aria/utils": "^3.23.0",
|
|
50
|
-
"@react-aria/visually-hidden": "^3.8.8",
|
|
51
41
|
"@react-spring/web": "^10",
|
|
52
|
-
"@react-stately/radio": "^3.10.2",
|
|
53
42
|
"polished": "^4.1.4",
|
|
54
43
|
"react-compiler-runtime": "1.0.0",
|
|
55
|
-
"react-stately": "^3.26.0",
|
|
56
44
|
"warning": "^4.0.3",
|
|
57
|
-
"@charcoal-ui/foundation": "
|
|
58
|
-
"@charcoal-ui/
|
|
59
|
-
"@charcoal-ui/
|
|
60
|
-
"@charcoal-ui/utils": "
|
|
45
|
+
"@charcoal-ui/foundation": "6.0.0-beta.0",
|
|
46
|
+
"@charcoal-ui/theme": "6.0.0-beta.0",
|
|
47
|
+
"@charcoal-ui/icons": "6.0.0-beta.0",
|
|
48
|
+
"@charcoal-ui/utils": "6.0.0-beta.0"
|
|
61
49
|
},
|
|
62
50
|
"peerDependencies": {
|
|
63
|
-
"react": ">=17.0.0"
|
|
51
|
+
"react": ">=17.0.0",
|
|
52
|
+
"react-aria": ">=3.48.0",
|
|
53
|
+
"react-stately": ">=3.46.0"
|
|
64
54
|
},
|
|
65
55
|
"files": [
|
|
66
56
|
"src",
|
|
@@ -81,6 +71,7 @@
|
|
|
81
71
|
"build:dts": "tsc --project tsconfig.build.json --pretty --emitDeclarationOnly",
|
|
82
72
|
"typecheck": "tsc --project tsconfig.build.json --pretty --noEmit",
|
|
83
73
|
"clean": "rimraf dist .tsbuildinfo",
|
|
84
|
-
"test": "vitest run --passWithNoTests"
|
|
74
|
+
"test": "vitest run --passWithNoTests",
|
|
75
|
+
"test:browser": "vitest run --config vitest.browser.config.ts"
|
|
85
76
|
}
|
|
86
77
|
}
|
|
@@ -72,6 +72,7 @@ describe('CSS nesting output equivalence', () => {
|
|
|
72
72
|
'__snapshots__',
|
|
73
73
|
'index.css.snap',
|
|
74
74
|
)
|
|
75
|
-
await
|
|
75
|
+
const expected = await fs.readFile(snapshotPath, 'utf-8')
|
|
76
|
+
expect(canonicalize(result.root)).toBe(expected)
|
|
76
77
|
})
|
|
77
78
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
|
|
3
3
|
import { forwardRef, memo } from 'react'
|
|
4
|
-
import { useId } from '@react-aria/utils'
|
|
5
4
|
import CheckboxInput, { CheckboxInputProps } from './CheckboxInput'
|
|
6
5
|
import { CheckboxWithLabel } from './CheckboxWithLabel'
|
|
6
|
+
import { useId } from 'react-aria/useId'
|
|
7
7
|
|
|
8
8
|
export type CheckboxProps = CheckboxInputProps
|
|
9
9
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
|
|
3
3
|
import { RefObject, useContext, useRef, ReactNode } from 'react'
|
|
4
|
-
import { DismissButton, Overlay, usePopover } from '@react-aria/overlays'
|
|
5
4
|
import { ModalBackgroundContext } from '../../Modal/ModalBackgroundContext'
|
|
6
5
|
import { usePreventScroll } from './usePreventScroll'
|
|
6
|
+
import { DismissButton, Overlay } from 'react-aria/Overlay'
|
|
7
|
+
import { usePopover } from 'react-aria/usePopover'
|
|
7
8
|
|
|
8
9
|
export type PopoverProps = {
|
|
9
10
|
isOpen: boolean
|
|
@@ -7,12 +7,13 @@ import { DropdownPopover } from './DropdownPopover'
|
|
|
7
7
|
import { findPreviewRecursive } from './utils/findPreviewRecursive'
|
|
8
8
|
import MenuList, { MenuListChildren } from './MenuList'
|
|
9
9
|
import { getValuesRecursive } from './MenuList/internals/getValuesRecursive'
|
|
10
|
-
import { useVisuallyHidden } from '@react-aria/visually-hidden'
|
|
11
10
|
import { AssistiveText } from '../TextField/AssistiveText'
|
|
12
11
|
import { useClassNames } from '../../_lib/useClassNames'
|
|
13
|
-
import { useId } from '@react-aria/utils'
|
|
14
12
|
import { PopoverProps } from './Popover'
|
|
15
13
|
|
|
14
|
+
import { useVisuallyHidden } from 'react-aria/VisuallyHidden'
|
|
15
|
+
import { useId } from 'react-aria/useId'
|
|
16
|
+
|
|
16
17
|
export type DropdownSelectorProps = {
|
|
17
18
|
label: string
|
|
18
19
|
value: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useDialog } from '
|
|
3
|
+
import { useDialog } from 'react-aria/useDialog'
|
|
4
4
|
import { useForwardedRef } from '../../../_lib/useForwardedRef'
|
|
5
5
|
import { Size, BottomSheet } from '..'
|
|
6
6
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Modal, { ModalDismissButton, ModalProps } from '.'
|
|
2
|
-
import {
|
|
3
|
-
import { useOverlayTriggerState } from 'react-stately'
|
|
2
|
+
import { useOverlayTriggerState } from 'react-stately/useOverlayTriggerState'
|
|
4
3
|
import Button from '../Button'
|
|
5
4
|
import {
|
|
6
5
|
ModalAlign,
|
|
@@ -13,6 +12,9 @@ import DropdownSelector from '../DropdownSelector'
|
|
|
13
12
|
import Checkbox from '../Checkbox'
|
|
14
13
|
import DropdownMenuItem from '../DropdownSelector/DropdownMenuItem'
|
|
15
14
|
import { Meta, StoryObj } from '@storybook/react-vite'
|
|
15
|
+
import { OverlayProvider } from 'react-aria'
|
|
16
|
+
|
|
17
|
+
const defaultOpen = !!process.env.TEST
|
|
16
18
|
|
|
17
19
|
export default {
|
|
18
20
|
title: 'react/Modal',
|
|
@@ -38,7 +40,7 @@ export default {
|
|
|
38
40
|
},
|
|
39
41
|
},
|
|
40
42
|
render: function Render(args) {
|
|
41
|
-
const state = useOverlayTriggerState({})
|
|
43
|
+
const state = useOverlayTriggerState({ defaultOpen })
|
|
42
44
|
return (
|
|
43
45
|
// Application must be wrapped in an OverlayProvider so that it can be
|
|
44
46
|
// hidden from screen readers when a modal opens.
|
|
@@ -138,13 +140,12 @@ export const FullBottomSheet: StoryObj<typeof Modal> = {
|
|
|
138
140
|
bottomSheet: 'full',
|
|
139
141
|
},
|
|
140
142
|
render: function Render(args) {
|
|
141
|
-
const state = useOverlayTriggerState({})
|
|
143
|
+
const state = useOverlayTriggerState({ defaultOpen })
|
|
142
144
|
return (
|
|
143
145
|
// Application must be wrapped in an OverlayProvider so that it can be
|
|
144
146
|
// hidden from screen readers when a modal opens.
|
|
145
147
|
<OverlayProvider>
|
|
146
148
|
<Button onClick={() => state.open()}>Open Modal</Button>
|
|
147
|
-
|
|
148
149
|
<Modal
|
|
149
150
|
{...args}
|
|
150
151
|
isDismissable
|
|
@@ -184,13 +185,12 @@ export const FullBottomSheet: StoryObj<typeof Modal> = {
|
|
|
184
185
|
|
|
185
186
|
export const BottomSheet: StoryObj<typeof Modal> = {
|
|
186
187
|
render: function Render(args) {
|
|
187
|
-
const state = useOverlayTriggerState({})
|
|
188
|
+
const state = useOverlayTriggerState({ defaultOpen })
|
|
188
189
|
return (
|
|
189
190
|
// Application must be wrapped in an OverlayProvider so that it can be
|
|
190
191
|
// hidden from screen readers when a modal opens.
|
|
191
192
|
<OverlayProvider>
|
|
192
193
|
<Button onClick={() => state.open()}>Open Modal</Button>
|
|
193
|
-
|
|
194
194
|
<Modal
|
|
195
195
|
{...args}
|
|
196
196
|
isOpen={state.isOpen}
|
|
@@ -224,7 +224,7 @@ export const BottomSheet: StoryObj<typeof Modal> = {
|
|
|
224
224
|
|
|
225
225
|
export const NotDismmissableStory: StoryObj<typeof Modal> = {
|
|
226
226
|
render: function Render(args) {
|
|
227
|
-
const state = useOverlayTriggerState({})
|
|
227
|
+
const state = useOverlayTriggerState({ defaultOpen })
|
|
228
228
|
return (
|
|
229
229
|
<OverlayProvider>
|
|
230
230
|
<Button onClick={() => state.open()}>Open Modal</Button>
|
|
@@ -254,7 +254,7 @@ export const NotDismmissableStory: StoryObj<typeof Modal> = {
|
|
|
254
254
|
|
|
255
255
|
export const BackgroundScroll: StoryObj<typeof Modal> = {
|
|
256
256
|
render: function Render(args) {
|
|
257
|
-
const state = useOverlayTriggerState({})
|
|
257
|
+
const state = useOverlayTriggerState({ defaultOpen })
|
|
258
258
|
return (
|
|
259
259
|
<OverlayProvider>
|
|
260
260
|
<div
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useContext, forwardRef, memo } from 'react'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import {
|
|
4
|
-
import type { AriaDialogProps } from '@react-types/dialog'
|
|
3
|
+
import type { AriaDialogProps } from 'react-aria/useDialog'
|
|
5
4
|
import { animated, useTransition, easings } from '@react-spring/web'
|
|
6
5
|
import Button, { ButtonProps } from '../Button'
|
|
7
6
|
import IconButton, { IconButtonProps } from '../IconButton'
|
|
8
|
-
import { useObjectRef } from '@react-aria/utils'
|
|
9
7
|
import { Dialog } from './Dialog'
|
|
10
8
|
import { ModalBackgroundContext } from './ModalBackgroundContext'
|
|
11
9
|
import {
|
|
@@ -16,6 +14,9 @@ import {
|
|
|
16
14
|
|
|
17
15
|
import './index.css'
|
|
18
16
|
|
|
17
|
+
import { Overlay } from 'react-aria/Overlay'
|
|
18
|
+
import { useObjectRef } from 'react-aria/useObjectRef'
|
|
19
|
+
|
|
19
20
|
export type BottomSheet = boolean | 'full'
|
|
20
21
|
export type Size = 'S' | 'M' | 'L'
|
|
21
22
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
+
import { ariaHideOutside } from 'react-aria/private/overlays/ariaHideOutside'
|
|
3
|
+
import { useOverlayFocusContain } from 'react-aria/private/overlays/Overlay'
|
|
4
|
+
import { usePreventScroll } from '../DropdownSelector/Popover/usePreventScroll'
|
|
5
|
+
|
|
2
6
|
import {
|
|
3
7
|
AriaModalOverlayProps,
|
|
4
8
|
ModalOverlayAria,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
useOverlayFocusContain,
|
|
8
|
-
} from '@react-aria/overlays'
|
|
9
|
-
import { usePreventScroll } from '../DropdownSelector/Popover/usePreventScroll'
|
|
9
|
+
} from 'react-aria/useModalOverlay'
|
|
10
|
+
import { useOverlay } from 'react-aria/useOverlay'
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* We want to enable scrolling on the modal background,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import
|
|
3
|
+
import { RadioGroupState } from 'react-stately/useRadioGroupState'
|
|
4
4
|
|
|
5
5
|
const RadioContext = createContext<RadioGroupState | null>(null)
|
|
6
6
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ReactNode, forwardRef, memo, useMemo, useRef } from 'react'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import { RadioProvider, useRadioContext } from './RadioGroupContext'
|
|
4
|
+
import { useClassNames } from '../../_lib/useClassNames'
|
|
5
|
+
import './index.css'
|
|
4
6
|
import {
|
|
5
7
|
AriaRadioGroupProps,
|
|
6
8
|
AriaRadioProps,
|
|
7
9
|
useRadio,
|
|
8
10
|
useRadioGroup,
|
|
9
|
-
} from '
|
|
10
|
-
import { RadioProvider, useRadioContext } from './RadioGroupContext'
|
|
11
|
-
import { useClassNames } from '../../_lib/useClassNames'
|
|
11
|
+
} from 'react-aria/useRadioGroup'
|
|
12
12
|
|
|
13
|
-
import '
|
|
13
|
+
import { useRadioGroupState } from 'react-stately/useRadioGroupState'
|
|
14
14
|
|
|
15
15
|
type SegmentedControlItem = {
|
|
16
16
|
label: React.ReactNode
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
|
|
3
3
|
import { memo, forwardRef } from 'react'
|
|
4
|
-
import { useId } from '@react-aria/utils'
|
|
5
4
|
import SwitchInput, { type SwitchInputProps } from './SwitchInput'
|
|
6
5
|
import { SwitchWithLabel } from './SwitchWithLabel'
|
|
6
|
+
import { useId } from 'react-aria/useId'
|
|
7
7
|
|
|
8
8
|
export type SwitchProps = SwitchInputProps
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { forwardRef, memo, useMemo, ForwardedRef, type JSX } from 'react'
|
|
2
|
-
import { useObjectRef } from '@react-aria/utils'
|
|
3
2
|
import Icon from '../Icon'
|
|
4
3
|
import { useClassNames } from '../../_lib/useClassNames'
|
|
5
|
-
|
|
6
4
|
import './index.css'
|
|
7
5
|
|
|
6
|
+
import { useObjectRef } from 'react-aria/useObjectRef'
|
|
7
|
+
|
|
8
8
|
type SizeMap = {
|
|
9
9
|
S: 32
|
|
10
10
|
M: 40
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
|
|
3
|
-
import { useVisuallyHidden } from '@react-aria/visually-hidden'
|
|
4
3
|
import {
|
|
5
4
|
forwardRef,
|
|
6
5
|
useCallback,
|
|
@@ -13,9 +12,10 @@ import {
|
|
|
13
12
|
import FieldLabel from '../FieldLabel'
|
|
14
13
|
import { countCodePointsInString, mergeRefs } from '../../_lib'
|
|
15
14
|
import { useFocusWithClick } from '../TextField/useFocusWithClick'
|
|
16
|
-
import { useId } from '@react-aria/utils'
|
|
17
15
|
import { AssistiveText } from '../TextField/AssistiveText'
|
|
18
16
|
import { useClassNames } from '../../_lib/useClassNames'
|
|
17
|
+
import { useVisuallyHidden } from 'react-aria/VisuallyHidden'
|
|
18
|
+
import { useId } from 'react-aria/useId'
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* `TextArea` を `imperativeRef` から操作するためのハンドル
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
|
|
3
|
-
import { useVisuallyHidden } from '@react-aria/visually-hidden'
|
|
4
3
|
import { ReactNode, useCallback, useEffect, useRef, useState } from 'react'
|
|
5
4
|
import * as React from 'react'
|
|
6
5
|
import FieldLabel from '../FieldLabel'
|
|
7
|
-
import { countCodePointsInString } from '../../_lib'
|
|
6
|
+
import { countCodePointsInString, mergeRefs } from '../../_lib'
|
|
8
7
|
import { useFocusWithClick } from './useFocusWithClick'
|
|
9
|
-
import { mergeRefs, useId } from '@react-aria/utils'
|
|
10
8
|
import { AssistiveText } from './AssistiveText'
|
|
11
9
|
import { useClassNames } from '../../_lib/useClassNames'
|
|
10
|
+
import { useVisuallyHidden } from 'react-aria/VisuallyHidden'
|
|
11
|
+
import { useId } from 'react-aria/useId'
|
|
12
12
|
|
|
13
13
|
export type TextFieldProps = {
|
|
14
14
|
prefix?: ReactNode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { OverlayProvider } from '
|
|
1
|
+
export { OverlayProvider } from 'react-aria/private/overlays/useModal'
|
package/src/core/SSRProvider.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SSRProvider as OriginSSRProvider } from '@react-aria/ssr'
|
|
2
1
|
import { version, Fragment } from 'react'
|
|
2
|
+
import { SSRProvider as OriginSSRProvider } from 'react-aria/SSRProvider'
|
|
3
3
|
|
|
4
4
|
export function isReactVersionOver(minVersion: number): boolean {
|
|
5
5
|
// version history on the react side: https://github.com/facebook/react/commits/main/packages/shared/ReactVersion.js
|