@charcoal-ui/react 5.1.0 → 5.3.0-beta.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.
Files changed (35) hide show
  1. package/dist/components/DropdownSelector/DropdownPopover.d.ts.map +1 -1
  2. package/dist/components/DropdownSelector/Popover/index.d.ts +9 -0
  3. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  4. package/dist/components/DropdownSelector/index.d.ts +2 -1
  5. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/package.json +5 -7
  11. package/src/README.mdx +1 -1
  12. package/src/SSR.mdx +1 -1
  13. package/src/components/Button/index.story.tsx +1 -1
  14. package/src/components/Checkbox/CheckboxInput/index.story.tsx +1 -1
  15. package/src/components/Checkbox/index.story.tsx +1 -1
  16. package/src/components/Clickable/index.story.tsx +2 -2
  17. package/src/components/DropdownSelector/DropdownPopover.tsx +1 -0
  18. package/src/components/DropdownSelector/ListItem/index.story.tsx +1 -1
  19. package/src/components/DropdownSelector/MenuList/index.story.tsx +2 -2
  20. package/src/components/DropdownSelector/Popover/index.story.tsx +1 -1
  21. package/src/components/DropdownSelector/Popover/index.tsx +13 -0
  22. package/src/components/DropdownSelector/index.story.tsx +1 -1
  23. package/src/components/DropdownSelector/index.tsx +3 -1
  24. package/src/components/HintText/index.story.tsx +1 -1
  25. package/src/components/Icon/index.story.tsx +1 -1
  26. package/src/components/IconButton/index.story.tsx +1 -1
  27. package/src/components/LoadingSpinner/index.story.tsx +1 -1
  28. package/src/components/Modal/index.story.tsx +1 -1
  29. package/src/components/MultiSelect/index.story.tsx +2 -2
  30. package/src/components/Radio/index.story.tsx +1 -1
  31. package/src/components/SegmentedControl/index.story.tsx +1 -1
  32. package/src/components/Switch/index.story.tsx +1 -1
  33. package/src/components/TagItem/index.story.tsx +1 -1
  34. package/src/components/TextArea/TextArea.story.tsx +2 -2
  35. package/src/components/TextField/TextField.story.tsx +1 -1
package/src/README.mdx CHANGED
@@ -1,4 +1,4 @@
1
- import { Meta, Story, Canvas, Props } from '@storybook/addon-docs'
1
+ import { Meta, Story, Canvas, Props } from '@storybook/addon-docs/blocks'
2
2
 
3
3
  <Meta title="react/README" />
4
4
 
package/src/SSR.mdx CHANGED
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs'
1
+ import { Meta } from '@storybook/addon-docs/blocks'
2
2
 
3
3
  <Meta title="react/SSR Guide" />
4
4
 
@@ -1,5 +1,5 @@
1
1
  import Button from '.'
2
- import { Meta, StoryObj } from '@storybook/react'
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
3
3
 
4
4
  export default {
5
5
  title: 'react/Button',
@@ -1,5 +1,5 @@
1
1
  import CheckboxInput from '.'
2
- import { Meta, StoryObj } from '@storybook/react'
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
3
3
  import { useState } from 'react'
4
4
 
5
5
  export default {
@@ -1,5 +1,5 @@
1
1
  import Checkbox from '.'
2
- import { Meta, StoryObj } from '@storybook/react'
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
3
3
  import { useCallback, useState } from 'react'
4
4
 
5
5
  export default {
@@ -1,6 +1,6 @@
1
- import { action } from '@storybook/addon-actions'
1
+ import { action } from 'storybook/actions'
2
2
  import Clickable from '.'
3
- import { Meta, StoryObj } from '@storybook/react'
3
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
4
4
 
5
5
  export default {
6
6
  title: 'react/Clickable',
@@ -44,6 +44,7 @@ export function DropdownPopover({ children, ...props }: DropdownPopoverProps) {
44
44
  onClose={props.onClose}
45
45
  popoverRef={ref}
46
46
  triggerRef={props.triggerRef}
47
+ inertWorkaround={props.inertWorkaround}
47
48
  >
48
49
  {children}
49
50
  </Popover>
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
  import Icon from '../../Icon'
3
3
  import Switch from '../../Switch'
4
4
  import ListItem from '.'
5
- import { Meta, StoryObj } from '@storybook/react'
5
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
6
6
 
7
7
  export default {
8
8
  title: 'react/internals/ListItem',
@@ -1,8 +1,8 @@
1
- import { action } from '@storybook/addon-actions'
1
+ import { action } from 'storybook/actions'
2
2
  import MenuList from '.'
3
3
  import MenuItem from '../MenuItem'
4
4
  import MenuItemGroup from '../MenuItemGroup'
5
- import { Meta, StoryObj } from '@storybook/react'
5
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
6
6
 
7
7
  export default {
8
8
  title: 'react/internals/MenuList',
@@ -1,7 +1,7 @@
1
1
  import { useRef, CSSProperties, useState } from 'react'
2
2
  import Popover from '.'
3
3
  import Button from '../../Button'
4
- import { Meta, StoryObj } from '@storybook/react'
4
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
5
5
 
6
6
  export default {
7
7
  title: 'react/internals/Popover',
@@ -11,6 +11,15 @@ export type PopoverProps = {
11
11
  children: ReactNode
12
12
  triggerRef: RefObject<Element | null>
13
13
  popoverRef?: RefObject<HTMLDivElement | null>
14
+ /**
15
+ * A tmp workaround for react-aria above 3.27.3 setting overlay element to inert and causing background to be clickable.
16
+ * This may become default at next major.
17
+ * https://github.com/adobe/react-spectrum/pull/8796
18
+ * https://github.com/adobe/react-spectrum/issues/8784
19
+ *
20
+ * @default false
21
+ */
22
+ inertWorkaround?: boolean
14
23
  }
15
24
 
16
25
  const _empty = () => null
@@ -50,6 +59,10 @@ export default function Popover(props: PopoverProps) {
50
59
  <Overlay portalContainer={document.body}>
51
60
  <div
52
61
  {...underlayProps}
62
+ // https://github.com/adobe/react-spectrum/issues/8784#issuecomment-3234771154
63
+ {...(props.inertWorkaround
64
+ ? { 'data-react-aria-top-layer': true, onClick: props.onClose }
65
+ : {})}
53
66
  style={{
54
67
  position: 'fixed',
55
68
  zIndex:
@@ -5,7 +5,7 @@ import MenuItemGroup from './MenuItemGroup'
5
5
  import DropdownMenuItem from './DropdownMenuItem'
6
6
  import Modal from '../Modal'
7
7
  import { ModalBody, ModalHeader } from '../Modal/ModalPlumbing'
8
- import { Meta, StoryObj } from '@storybook/react'
8
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
9
9
  import TextField from '../TextField'
10
10
  import TextArea from '../TextArea'
11
11
  import Button from '../Button'
@@ -11,6 +11,7 @@ import { useVisuallyHidden } from '@react-aria/visually-hidden'
11
11
  import { AssistiveText } from '../TextField/AssistiveText'
12
12
  import { useClassNames } from '../../_lib/useClassNames'
13
13
  import { useId } from '@react-aria/utils'
14
+ import { PopoverProps } from './Popover'
14
15
 
15
16
  export type DropdownSelectorProps = {
16
17
  label: string
@@ -30,7 +31,7 @@ export type DropdownSelectorProps = {
30
31
  children: MenuListChildren
31
32
  onChange: (value: string) => void
32
33
  className?: string
33
- }
34
+ } & Pick<PopoverProps, 'inertWorkaround'>
34
35
 
35
36
  export default function DropdownSelector({
36
37
  onChange,
@@ -126,6 +127,7 @@ export default function DropdownSelector({
126
127
  onClose={() => setIsOpen(false)}
127
128
  triggerRef={triggerRef}
128
129
  value={props.value}
130
+ inertWorkaround={props.inertWorkaround}
129
131
  >
130
132
  <MenuList
131
133
  value={props.value}
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react'
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
2
2
  import HintText from '.'
3
3
 
4
4
  export default {
@@ -1,6 +1,6 @@
1
1
  import Icon from '.'
2
2
  import { KNOWN_ICON_FILES } from '@charcoal-ui/icons'
3
- import { Meta, StoryObj } from '@storybook/react'
3
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
4
4
 
5
5
  export default {
6
6
  title: 'react/Icon',
@@ -1,6 +1,6 @@
1
1
  import '@charcoal-ui/icons'
2
2
  import IconButton, { IconButtonProps } from '.'
3
- import { Meta, StoryObj } from '@storybook/react'
3
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
4
4
 
5
5
  export default {
6
6
  title: 'react/IconButton',
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react'
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
2
2
  import LoadingSpinner from '.'
3
3
 
4
4
  export default {
@@ -12,7 +12,7 @@ import TextField from '../TextField'
12
12
  import DropdownSelector from '../DropdownSelector'
13
13
  import Checkbox from '../Checkbox'
14
14
  import DropdownMenuItem from '../DropdownSelector/DropdownMenuItem'
15
- import { Meta, StoryObj } from '@storybook/react'
15
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
16
16
 
17
17
  export default {
18
18
  title: 'react/Modal',
@@ -4,8 +4,8 @@ import {
4
4
  default as MultiSelect,
5
5
  MultiSelectGroupProps,
6
6
  } from '.'
7
- import { Meta, StoryObj } from '@storybook/react'
8
- import { action } from '@storybook/addon-actions'
7
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
8
+ import { action } from 'storybook/actions'
9
9
 
10
10
  const StyledMultiSelectGroup = (props: MultiSelectGroupProps) => {
11
11
  return (
@@ -1,6 +1,6 @@
1
1
  import Radio from '.'
2
2
  import { RadioGroup } from './RadioGroup'
3
- import { StoryObj } from '@storybook/react'
3
+ import { StoryObj } from '@storybook/react-webpack5'
4
4
  import { useState } from 'react'
5
5
 
6
6
  export default {
@@ -1,5 +1,5 @@
1
1
  import SegmentedControl from '.'
2
- import { Meta, StoryObj } from '@storybook/react'
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
3
3
 
4
4
  export default {
5
5
  title: 'react/SegmentedControl',
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react'
2
2
  import Switch from '.'
3
- import { Meta, StoryObj } from '@storybook/react'
3
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
4
4
 
5
5
  export default {
6
6
  title: 'react/Switch',
@@ -1,5 +1,5 @@
1
1
  import TagItem from '.'
2
- import { Meta, StoryObj } from '@storybook/react'
2
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
3
3
 
4
4
  export default {
5
5
  title: 'react/TagItem',
@@ -1,7 +1,7 @@
1
- import { action } from '@storybook/addon-actions'
1
+ import { action } from 'storybook/actions'
2
2
  import Clickable from '../Clickable'
3
3
  import TextArea from '.'
4
- import { Meta, StoryObj } from '@storybook/react'
4
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
5
5
 
6
6
  export default {
7
7
  title: 'react/TextArea',
@@ -1,7 +1,7 @@
1
1
  import Clickable from '../Clickable'
2
2
  import TextField from '.'
3
3
  import { useState } from 'react'
4
- import { Meta, StoryObj } from '@storybook/react'
4
+ import { Meta, StoryObj } from '@storybook/react-webpack5'
5
5
 
6
6
  export default {
7
7
  title: 'react/TextField',