@instructure/ui-toggle-details 10.23.1-snapshot-4 → 10.23.1-snapshot-5

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/CHANGELOG.md CHANGED
@@ -3,9 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [10.23.1-snapshot-4](https://github.com/instructure/instructure-ui/compare/v10.23.0...v10.23.1-snapshot-4) (2025-07-18)
6
+ ## [10.23.1-snapshot-5](https://github.com/instructure/instructure-ui/compare/v10.23.0...v10.23.1-snapshot-5) (2025-07-18)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-toggle-details
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui-toggle-details,ui-expandable:** improve typing for onClick prop ([e086e31](https://github.com/instructure/instructure-ui/commit/e086e3194f93565a0314233a10bba804f48c3a16))
9
12
 
10
13
 
11
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-toggle-details",
3
- "version": "10.23.1-snapshot-4",
3
+ "version": "10.23.1-snapshot-5",
4
4
  "description": "A styled toggleable, accordion-like component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.23.1-snapshot-4",
27
- "@instructure/ui-babel-preset": "10.23.1-snapshot-4",
28
- "@instructure/ui-themes": "10.23.1-snapshot-4",
26
+ "@instructure/ui-axe-check": "10.23.1-snapshot-5",
27
+ "@instructure/ui-babel-preset": "10.23.1-snapshot-5",
28
+ "@instructure/ui-themes": "10.23.1-snapshot-5",
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
30
  "@testing-library/react": "^16.0.1",
31
31
  "@testing-library/user-event": "^14.6.1",
@@ -33,20 +33,20 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.27.6",
36
- "@instructure/emotion": "10.23.1-snapshot-4",
37
- "@instructure/shared-types": "10.23.1-snapshot-4",
38
- "@instructure/ui-buttons": "10.23.1-snapshot-4",
39
- "@instructure/ui-dom-utils": "10.23.1-snapshot-4",
40
- "@instructure/ui-expandable": "10.23.1-snapshot-4",
41
- "@instructure/ui-flex": "10.23.1-snapshot-4",
42
- "@instructure/ui-icons": "10.23.1-snapshot-4",
43
- "@instructure/ui-motion": "10.23.1-snapshot-4",
44
- "@instructure/ui-prop-types": "10.23.1-snapshot-4",
45
- "@instructure/ui-react-utils": "10.23.1-snapshot-4",
46
- "@instructure/ui-testable": "10.23.1-snapshot-4",
47
- "@instructure/ui-utils": "10.23.1-snapshot-4",
48
- "@instructure/ui-view": "10.23.1-snapshot-4",
49
- "@instructure/uid": "10.23.1-snapshot-4",
36
+ "@instructure/emotion": "10.23.1-snapshot-5",
37
+ "@instructure/shared-types": "10.23.1-snapshot-5",
38
+ "@instructure/ui-buttons": "10.23.1-snapshot-5",
39
+ "@instructure/ui-dom-utils": "10.23.1-snapshot-5",
40
+ "@instructure/ui-expandable": "10.23.1-snapshot-5",
41
+ "@instructure/ui-flex": "10.23.1-snapshot-5",
42
+ "@instructure/ui-icons": "10.23.1-snapshot-5",
43
+ "@instructure/ui-motion": "10.23.1-snapshot-5",
44
+ "@instructure/ui-prop-types": "10.23.1-snapshot-5",
45
+ "@instructure/ui-react-utils": "10.23.1-snapshot-5",
46
+ "@instructure/ui-testable": "10.23.1-snapshot-5",
47
+ "@instructure/ui-utils": "10.23.1-snapshot-5",
48
+ "@instructure/ui-view": "10.23.1-snapshot-5",
49
+ "@instructure/uid": "10.23.1-snapshot-5",
50
50
  "prop-types": "^15.8.1"
51
51
  },
52
52
  "peerDependencies": {
@@ -39,6 +39,7 @@ import generateComponentTheme from './theme'
39
39
  import type { ToggleDetailsProps } from './props'
40
40
  import { allowedProps, propTypes } from './props'
41
41
  import type { ExpandableToggleProps } from '@instructure/ui-expandable'
42
+ import type { ViewProps } from '@instructure/ui-view'
42
43
 
43
44
  /**
44
45
  ---
@@ -168,7 +169,10 @@ class ToggleDetails extends Component<ToggleDetailsProps> {
168
169
  return <div css={this.props.styles?.content}>{this.props.children}</div>
169
170
  }
170
171
 
171
- handleToggle = (event: React.MouseEvent, expanded: boolean) => {
172
+ handleToggle = (
173
+ event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>,
174
+ expanded: boolean
175
+ ) => {
172
176
  if (typeof this.props.onToggle === 'function') {
173
177
  this.props.onToggle(event, expanded)
174
178
  }
@@ -33,6 +33,7 @@ import type {
33
33
  ToggleDetailsTheme
34
34
  } from '@instructure/shared-types'
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
+ import type { ViewProps } from '@instructure/ui-view'
36
37
 
37
38
  type ToggleDetailsOwnProps = {
38
39
  variant?: 'default' | 'filled'
@@ -48,7 +49,10 @@ type ToggleDetailsOwnProps = {
48
49
  * Whether the content is initially expanded or hidden (uncontrolled)
49
50
  */
50
51
  defaultExpanded?: boolean
51
- onToggle?: (event: React.MouseEvent, expanded: boolean) => void
52
+ onToggle?: (
53
+ event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>,
54
+ expanded: boolean
55
+ ) => void
52
56
  /**
53
57
  * The icon to display next to the summary text when content is hidden
54
58
  */