@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.
- package/CHANGELOG.md +1 -1
- package/es/Modal/ModalBody/__new-tests__/ModalBody.test.js +21 -12
- package/es/Modal/ModalBody/index.js +10 -6
- package/es/Modal/ModalFooter/__new-tests__/ModalFooter.test.js +8 -5
- package/es/Modal/ModalFooter/index.js +8 -7
- package/es/Modal/ModalHeader/__new-tests__/ModalHeader.test.js +19 -12
- package/es/Modal/ModalHeader/index.js +10 -9
- package/es/Modal/__new-tests__/Modal.test.js +185 -97
- package/es/Modal/index.js +33 -25
- package/lib/Modal/ModalBody/__new-tests__/ModalBody.test.js +22 -13
- package/lib/Modal/ModalBody/index.js +9 -5
- package/lib/Modal/ModalFooter/__new-tests__/ModalFooter.test.js +9 -6
- package/lib/Modal/ModalFooter/index.js +7 -6
- package/lib/Modal/ModalHeader/__new-tests__/ModalHeader.test.js +20 -13
- package/lib/Modal/ModalHeader/index.js +9 -9
- package/lib/Modal/__new-tests__/Modal.test.js +185 -97
- package/lib/Modal/index.js +32 -24
- package/package.json +19 -19
- package/src/Modal/ModalBody/__new-tests__/ModalBody.test.tsx +0 -2
- package/src/Modal/ModalBody/index.tsx +1 -2
- package/src/Modal/ModalFooter/__new-tests__/ModalFooter.test.tsx +0 -2
- package/src/Modal/ModalFooter/index.tsx +1 -2
- package/src/Modal/ModalHeader/__new-tests__/ModalHeader.test.tsx +0 -2
- package/src/Modal/ModalHeader/index.tsx +4 -5
- package/src/Modal/__new-tests__/Modal.test.tsx +3 -5
- package/src/Modal/index.tsx +1 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Modal/ModalBody/__new-tests__/ModalBody.test.d.ts.map +1 -1
- package/types/Modal/ModalBody/index.d.ts +1 -3
- package/types/Modal/ModalBody/index.d.ts.map +1 -1
- package/types/Modal/ModalFooter/__new-tests__/ModalFooter.test.d.ts.map +1 -1
- package/types/Modal/ModalFooter/index.d.ts +1 -3
- package/types/Modal/ModalFooter/index.d.ts.map +1 -1
- package/types/Modal/ModalHeader/__new-tests__/ModalHeader.test.d.ts.map +1 -1
- package/types/Modal/ModalHeader/index.d.ts +2 -4
- package/types/Modal/ModalHeader/index.d.ts.map +1 -1
- package/types/Modal/index.d.ts +2 -4
- package/types/Modal/index.d.ts.map +1 -1
|
@@ -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
|
|
32
|
+
import { withStyle } from '@instructure/emotion'
|
|
34
33
|
import generateStyle from './styles'
|
|
35
34
|
import generateComponentTheme from './theme'
|
|
36
35
|
|
|
@@ -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
|
|
29
|
+
import { withStyle } from '@instructure/emotion'
|
|
31
30
|
import generateStyle from './styles'
|
|
32
31
|
import generateComponentTheme from './theme'
|
|
33
32
|
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
package/src/Modal/index.tsx
CHANGED
|
@@ -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
|
|
42
|
+
import { withStyle } from '@instructure/emotion'
|
|
44
43
|
|
|
45
44
|
import generateStyle from './styles'
|
|
46
45
|
import generateComponentTheme from './theme'
|