@charcoal-ui/react 3.7.0 → 3.9.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.
Files changed (107) hide show
  1. package/dist/components/Button/StyledButton.d.ts +1 -0
  2. package/dist/components/Button/StyledButton.d.ts.map +1 -1
  3. package/dist/components/Button/index.d.ts +1 -0
  4. package/dist/components/Button/index.d.ts.map +1 -1
  5. package/dist/components/Button/index.story.d.ts +16 -32
  6. package/dist/components/Button/index.story.d.ts.map +1 -1
  7. package/dist/components/Checkbox/index.d.ts.map +1 -1
  8. package/dist/components/DropdownSelector/ListItem/index.story.d.ts +7 -7
  9. package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +1 -1
  10. package/dist/components/DropdownSelector/MenuList/index.story.d.ts +6 -9
  11. package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +1 -1
  12. package/dist/components/DropdownSelector/Popover/index.story.d.ts +3 -7
  13. package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +1 -1
  14. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  15. package/dist/components/DropdownSelector/index.story.d.ts +9 -12
  16. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  17. package/dist/components/Icon/index.story.d.ts +4 -26
  18. package/dist/components/Icon/index.story.d.ts.map +1 -1
  19. package/dist/components/IconButton/index.d.ts +1 -0
  20. package/dist/components/IconButton/index.d.ts.map +1 -1
  21. package/dist/components/IconButton/index.story.d.ts +6 -25
  22. package/dist/components/IconButton/index.story.d.ts.map +1 -1
  23. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +8 -0
  24. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +1 -0
  25. package/dist/components/LoadingSpinner/index.d.ts +2 -2
  26. package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
  27. package/dist/components/LoadingSpinner/index.story.d.ts +4 -7
  28. package/dist/components/LoadingSpinner/index.story.d.ts.map +1 -1
  29. package/dist/components/Modal/index.d.ts.map +1 -1
  30. package/dist/components/Modal/index.story.d.ts +16 -41
  31. package/dist/components/Modal/index.story.d.ts.map +1 -1
  32. package/dist/components/Modal/useCustomModalOverlay.d.ts +12 -0
  33. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
  34. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  35. package/dist/components/Radio/index.d.ts +0 -2
  36. package/dist/components/Radio/index.d.ts.map +1 -1
  37. package/dist/components/Radio/index.story.d.ts +12 -23
  38. package/dist/components/Radio/index.story.d.ts.map +1 -1
  39. package/dist/components/SegmentedControl/index.story.d.ts +5 -8
  40. package/dist/components/SegmentedControl/index.story.d.ts.map +1 -1
  41. package/dist/components/Switch/index.d.ts.map +1 -1
  42. package/dist/components/Switch/index.story.d.ts +7 -12
  43. package/dist/components/Switch/index.story.d.ts.map +1 -1
  44. package/dist/components/TagItem/index.d.ts.map +1 -1
  45. package/dist/components/TagItem/index.story.d.ts +14 -24
  46. package/dist/components/TagItem/index.story.d.ts.map +1 -1
  47. package/dist/components/TextArea/TextArea.story.d.ts +7 -25
  48. package/dist/components/TextArea/TextArea.story.d.ts.map +1 -1
  49. package/dist/components/TextArea/index.d.ts.map +1 -1
  50. package/dist/components/TextField/TextField.story.d.ts +14 -20
  51. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  52. package/dist/components/TextField/index.d.ts.map +1 -1
  53. package/dist/index.cjs.js +1006 -2240
  54. package/dist/index.cjs.js.map +1 -1
  55. package/dist/index.esm.js +1001 -2241
  56. package/dist/index.esm.js.map +1 -1
  57. package/dist/styled.d.ts +4 -4
  58. package/package.json +7 -6
  59. package/src/components/Button/StyledButton.tsx +19 -14
  60. package/src/components/Button/__snapshots__/index.story.storyshot +314 -118
  61. package/src/components/Button/index.story.tsx +141 -138
  62. package/src/components/Button/index.tsx +3 -0
  63. package/src/components/Checkbox/__snapshots__/index.story.storyshot +55 -42
  64. package/src/components/Checkbox/index.tsx +15 -17
  65. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  66. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +42 -37
  67. package/src/components/DropdownSelector/ListItem/index.story.tsx +8 -4
  68. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +38 -38
  69. package/src/components/DropdownSelector/MenuList/index.story.tsx +33 -27
  70. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +11 -5
  71. package/src/components/DropdownSelector/Popover/index.story.tsx +6 -6
  72. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +148 -47
  73. package/src/components/DropdownSelector/index.story.tsx +207 -204
  74. package/src/components/DropdownSelector/index.tsx +17 -10
  75. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  76. package/src/components/Icon/index.story.tsx +8 -12
  77. package/src/components/IconButton/__snapshots__/index.story.storyshot +135 -13
  78. package/src/components/IconButton/index.story.tsx +30 -23
  79. package/src/components/IconButton/index.tsx +35 -20
  80. package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +12 -0
  81. package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +28 -0
  82. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +1 -35
  83. package/src/components/LoadingSpinner/index.story.tsx +11 -54
  84. package/src/components/LoadingSpinner/index.tsx +1 -1
  85. package/src/components/Modal/__snapshots__/index.story.storyshot +224 -171
  86. package/src/components/Modal/index.story.tsx +139 -133
  87. package/src/components/Modal/index.tsx +15 -20
  88. package/src/components/Modal/useCustomModalOverlay.tsx +42 -0
  89. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +56 -4
  90. package/src/components/MultiSelect/index.tsx +3 -0
  91. package/src/components/Radio/__snapshots__/index.story.storyshot +1001 -121
  92. package/src/components/Radio/index.story.tsx +128 -63
  93. package/src/components/Radio/index.tsx +15 -17
  94. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  95. package/src/components/SegmentedControl/index.story.tsx +24 -29
  96. package/src/components/Switch/__snapshots__/index.story.storyshot +184 -26
  97. package/src/components/Switch/index.story.tsx +72 -48
  98. package/src/components/Switch/index.tsx +2 -7
  99. package/src/components/TagItem/__snapshots__/index.story.storyshot +72 -33
  100. package/src/components/TagItem/index.story.tsx +154 -159
  101. package/src/components/TagItem/index.tsx +2 -6
  102. package/src/components/TextArea/TextArea.story.tsx +29 -32
  103. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +127 -73
  104. package/src/components/TextArea/index.tsx +22 -14
  105. package/src/components/TextField/TextField.story.tsx +85 -64
  106. package/src/components/TextField/__snapshots__/TextField.story.storyshot +479 -167
  107. package/src/components/TextField/index.tsx +22 -21
@@ -7,6 +7,7 @@ import FieldLabel, { FieldLabelProps } from '../FieldLabel'
7
7
  import { countCodePointsInString, mergeRefs } from '../../_lib'
8
8
  import { ReactAreaUseTextFieldCompat } from '../../_lib/compat'
9
9
  import { useFocusWithClick } from './useFocusWithClick'
10
+ import { mergeProps } from '@react-aria/utils'
10
11
 
11
12
  type DOMProps = Omit<
12
13
  React.InputHTMLAttributes<HTMLInputElement>,
@@ -60,6 +61,7 @@ const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
60
61
  maxLength,
61
62
  prefix = null,
62
63
  suffix = null,
64
+ ...restProps
63
65
  } = props
64
66
 
65
67
  const { visuallyHiddenProps } = useVisuallyHidden()
@@ -87,25 +89,31 @@ const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
87
89
  setCount(countCodePointsInString(props.value ?? ''))
88
90
  }, [props.value])
89
91
 
90
- const { inputProps, labelProps, descriptionProps, errorMessageProps } =
91
- useTextField(
92
- {
93
- inputElementType: 'input',
94
- isDisabled: disabled,
95
- isRequired: required,
96
- validationState: invalid ? 'invalid' : 'valid',
97
- description: !invalid && assistiveText,
98
- errorMessage: invalid && assistiveText,
99
- onChange: handleChange,
100
- ...props,
101
- },
102
- ariaRef
103
- )
92
+ const {
93
+ inputProps: ariaInputProps,
94
+ labelProps,
95
+ descriptionProps,
96
+ errorMessageProps,
97
+ } = useTextField(
98
+ {
99
+ inputElementType: 'input',
100
+ isDisabled: disabled,
101
+ isRequired: required,
102
+ validationState: invalid ? 'invalid' : 'valid',
103
+ description: !invalid && assistiveText,
104
+ errorMessage: invalid && assistiveText,
105
+ onChange: handleChange,
106
+ ...props,
107
+ },
108
+ ariaRef
109
+ )
104
110
 
105
111
  const containerRef = useRef(null)
106
112
 
107
113
  useFocusWithClick(containerRef, ariaRef)
108
114
 
115
+ const inputProps = mergeProps(restProps, ariaInputProps)
116
+
109
117
  return (
110
118
  <TextFieldRoot className={className} isDisabled={disabled}>
111
119
  <TextFieldLabel
@@ -191,13 +199,6 @@ const StyledInputContainer = styled.div<{
191
199
  background-color: var(--charcoal-surface3-hover);
192
200
  }
193
201
 
194
- :not(:disabled):not([aria-disabled]):active,
195
- [aria-disabled='false']:active {
196
- outline: none;
197
- box-shadow: 0 0 0 4px
198
- ${(p) => (p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`)};
199
- }
200
-
201
202
  :focus-within {
202
203
  outline: none;
203
204
  box-shadow: 0 0 0 4px