@instructure/ui-modal 10.16.1-snapshot-0 → 10.16.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 (38) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/es/Modal/ModalBody/__new-tests__/ModalBody.test.js +21 -12
  3. package/es/Modal/ModalBody/index.js +10 -6
  4. package/es/Modal/ModalFooter/__new-tests__/ModalFooter.test.js +8 -5
  5. package/es/Modal/ModalFooter/index.js +8 -7
  6. package/es/Modal/ModalHeader/__new-tests__/ModalHeader.test.js +19 -12
  7. package/es/Modal/ModalHeader/index.js +10 -9
  8. package/es/Modal/__new-tests__/Modal.test.js +185 -97
  9. package/es/Modal/index.js +33 -25
  10. package/lib/Modal/ModalBody/__new-tests__/ModalBody.test.js +22 -13
  11. package/lib/Modal/ModalBody/index.js +9 -5
  12. package/lib/Modal/ModalFooter/__new-tests__/ModalFooter.test.js +9 -6
  13. package/lib/Modal/ModalFooter/index.js +7 -6
  14. package/lib/Modal/ModalHeader/__new-tests__/ModalHeader.test.js +20 -13
  15. package/lib/Modal/ModalHeader/index.js +9 -9
  16. package/lib/Modal/__new-tests__/Modal.test.js +185 -97
  17. package/lib/Modal/index.js +32 -24
  18. package/package.json +19 -19
  19. package/src/Modal/ModalBody/__new-tests__/ModalBody.test.tsx +0 -2
  20. package/src/Modal/ModalBody/index.tsx +1 -2
  21. package/src/Modal/ModalFooter/__new-tests__/ModalFooter.test.tsx +0 -2
  22. package/src/Modal/ModalFooter/index.tsx +1 -2
  23. package/src/Modal/ModalHeader/__new-tests__/ModalHeader.test.tsx +0 -2
  24. package/src/Modal/ModalHeader/index.tsx +4 -5
  25. package/src/Modal/__new-tests__/Modal.test.tsx +3 -5
  26. package/src/Modal/index.tsx +1 -2
  27. package/tsconfig.build.tsbuildinfo +1 -1
  28. package/types/Modal/ModalBody/__new-tests__/ModalBody.test.d.ts.map +1 -1
  29. package/types/Modal/ModalBody/index.d.ts +1 -3
  30. package/types/Modal/ModalBody/index.d.ts.map +1 -1
  31. package/types/Modal/ModalFooter/__new-tests__/ModalFooter.test.d.ts.map +1 -1
  32. package/types/Modal/ModalFooter/index.d.ts +1 -3
  33. package/types/Modal/ModalFooter/index.d.ts.map +1 -1
  34. package/types/Modal/ModalHeader/__new-tests__/ModalHeader.test.d.ts.map +1 -1
  35. package/types/Modal/ModalHeader/index.d.ts +2 -4
  36. package/types/Modal/ModalHeader/index.d.ts.map +1 -1
  37. package/types/Modal/index.d.ts +2 -4
  38. package/types/Modal/index.d.ts.map +1 -1
@@ -22,8 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import React from 'react'
26
-
27
25
  import { render } from '@testing-library/react'
28
26
  import { vi } from 'vitest'
29
27
  import '@testing-library/jest-dom'
@@ -22,7 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- /** @jsx jsx */
26
25
  import { Component } from 'react'
27
26
 
28
27
  import { View } from '@instructure/ui-view'
@@ -30,7 +29,7 @@ import { testable } from '@instructure/ui-testable'
30
29
  import { omitProps } from '@instructure/ui-react-utils'
31
30
  import { getComputedStyle } from '@instructure/ui-dom-utils'
32
31
 
33
- import { withStyle, jsx } from '@instructure/emotion'
32
+ import { withStyle } from '@instructure/emotion'
34
33
  import generateStyle from './styles'
35
34
  import generateComponentTheme from './theme'
36
35
 
@@ -22,8 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import React from 'react'
26
-
27
25
  import { render } from '@testing-library/react'
28
26
  import '@testing-library/jest-dom'
29
27
 
@@ -22,12 +22,11 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- /** @jsx jsx */
26
25
  import { Component } from 'react'
27
26
 
28
27
  import { passthroughProps } from '@instructure/ui-react-utils'
29
28
  import { testable } from '@instructure/ui-testable'
30
- import { withStyle, jsx } from '@instructure/emotion'
29
+ import { withStyle } from '@instructure/emotion'
31
30
  import generateStyle from './styles'
32
31
  import generateComponentTheme from './theme'
33
32
 
@@ -22,8 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import React from 'react'
26
-
27
25
  import { render } from '@testing-library/react'
28
26
  import '@testing-library/jest-dom'
29
27
 
@@ -22,8 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- /** @jsx jsx */
26
- import React, { Component } from 'react'
25
+ import { ComponentElement, Children, Component } from 'react'
27
26
 
28
27
  import {
29
28
  matchComponentTypes,
@@ -31,7 +30,7 @@ import {
31
30
  } from '@instructure/ui-react-utils'
32
31
  import { testable } from '@instructure/ui-testable'
33
32
 
34
- import { withStyle, jsx } from '@instructure/emotion'
33
+ import { withStyle } from '@instructure/emotion'
35
34
 
36
35
  import { CloseButton } from '@instructure/ui-buttons'
37
36
  import type { CloseButtonProps } from '@instructure/ui-buttons'
@@ -42,7 +41,7 @@ import generateComponentTheme from './theme'
42
41
  import { propTypes, allowedProps } from './props'
43
42
  import type { ModalHeaderProps, ModalHeaderStyleProps } from './props'
44
43
 
45
- type CloseButtonChild = React.ComponentElement<CloseButtonProps, CloseButton>
44
+ type CloseButtonChild = ComponentElement<CloseButtonProps, CloseButton>
46
45
 
47
46
  /**
48
47
  ---
@@ -85,7 +84,7 @@ class ModalHeader extends Component<ModalHeaderProps> {
85
84
  get usesCloseButton() {
86
85
  let hasCloseButton = false
87
86
 
88
- React.Children.forEach(this.props.children, (child) => {
87
+ Children.forEach(this.props.children, (child) => {
89
88
  if (
90
89
  child &&
91
90
  matchComponentTypes<CloseButtonChild>(child, [CloseButton])
@@ -22,7 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import React from 'react'
25
+ import { Component } from 'react'
26
26
  import { render, waitFor } from '@testing-library/react'
27
27
  import { vi } from 'vitest'
28
28
  import userEvent from '@testing-library/user-event'
@@ -173,9 +173,7 @@ describe('<Modal />', () => {
173
173
  const bodyText = 'Modal-body-text'
174
174
  const { findByText } = render(
175
175
  <Modal open label="Modal Dialog" shouldReturnFocus={false}>
176
- <View>
177
- This is a custom child
178
- </View>
176
+ <View>This is a custom child</View>
179
177
  <Modal.Body>{bodyText}</Modal.Body>
180
178
  </Modal>
181
179
  )
@@ -409,7 +407,7 @@ describe('<Modal />', () => {
409
407
  })
410
408
 
411
409
  describe('managed focus', () => {
412
- class ModalExample extends React.Component<Partial<ModalProps>> {
410
+ class ModalExample extends Component<Partial<ModalProps>> {
413
411
  static propTypes = {
414
412
  // eslint-disable-next-line react/forbid-foreign-prop-types
415
413
  ...Modal.propTypes
@@ -22,7 +22,6 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- /** @jsx jsx */
26
25
  import { Children, Component, isValidElement, ReactElement } from 'react'
27
26
 
28
27
  import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils'
@@ -40,7 +39,7 @@ import { ModalHeader } from './ModalHeader'
40
39
  import { ModalBody } from './ModalBody'
41
40
  import { ModalFooter } from './ModalFooter'
42
41
 
43
- import { withStyle, jsx } from '@instructure/emotion'
42
+ import { withStyle } from '@instructure/emotion'
44
43
 
45
44
  import generateStyle from './styles'
46
45
  import generateComponentTheme from './theme'