@khanacademy/wonder-blocks-modal 5.1.17 → 6.0.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 +34 -0
- package/dist/components/modal-backdrop.d.ts +2 -1
- package/dist/components/modal-content.d.ts +1 -1
- package/dist/components/modal-footer.d.ts +1 -1
- package/dist/components/modal-header.d.ts +1 -1
- package/dist/components/modal-launcher.d.ts +1 -1
- package/dist/components/modal-panel.d.ts +1 -1
- package/dist/es/index.js +12 -3
- package/dist/index.js +12 -3
- package/dist/themes/default.d.ts +2 -0
- package/dist/themes/khanmigo.d.ts +2 -0
- package/dist/themes/themed-modal-dialog.d.ts +3 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-modal
|
|
2
2
|
|
|
3
|
+
## 6.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0955be7e: - ModalBackdrop: Change initial focus behavior. Focus on the dismiss button (X) by default.
|
|
8
|
+
|
|
9
|
+
- CloseButton: Override `:focus` styles on the dismiss button to make it visually distinct when the focus is set programmatically.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [f4abd572]
|
|
12
|
+
- Updated dependencies [0955be7e]
|
|
13
|
+
- @khanacademy/wonder-blocks-core@9.0.0
|
|
14
|
+
- @khanacademy/wonder-blocks-icon-button@6.0.1
|
|
15
|
+
- @khanacademy/wonder-blocks-breadcrumbs@3.0.1
|
|
16
|
+
- @khanacademy/wonder-blocks-layout@3.0.1
|
|
17
|
+
- @khanacademy/wonder-blocks-typography@3.0.1
|
|
18
|
+
|
|
19
|
+
## 6.0.0
|
|
20
|
+
|
|
21
|
+
### Major Changes
|
|
22
|
+
|
|
23
|
+
- e6abdd17: Upgrade to React 18
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [e6abdd17]
|
|
28
|
+
- @khanacademy/wonder-blocks-theming@3.0.0
|
|
29
|
+
- @khanacademy/wonder-blocks-timing@6.0.0
|
|
30
|
+
- @khanacademy/wonder-blocks-core@8.0.0
|
|
31
|
+
- @khanacademy/wonder-blocks-breadcrumbs@3.0.0
|
|
32
|
+
- @khanacademy/wonder-blocks-icon-button@6.0.0
|
|
33
|
+
- @khanacademy/wonder-blocks-layout@3.0.0
|
|
34
|
+
- @khanacademy/wonder-blocks-tokens@3.0.0
|
|
35
|
+
- @khanacademy/wonder-blocks-typography@3.0.0
|
|
36
|
+
|
|
3
37
|
## 5.1.17
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -5,7 +5,8 @@ type Props = {
|
|
|
5
5
|
onCloseModal: () => unknown;
|
|
6
6
|
/**
|
|
7
7
|
* The selector for the element that will be focused when the dialog shows.
|
|
8
|
-
* When not set, the first tabbable element within the dialog will be used
|
|
8
|
+
* When not set, the first tabbable element within the dialog will be used,
|
|
9
|
+
* which usually is the dismiss button (X).
|
|
9
10
|
*/
|
|
10
11
|
initialFocusId?: string;
|
|
11
12
|
/**
|
|
@@ -11,7 +11,7 @@ type Props = {
|
|
|
11
11
|
/**
|
|
12
12
|
* The Modal content included after the header
|
|
13
13
|
*/
|
|
14
|
-
declare function ModalContent(props: Props): JSX.Element;
|
|
14
|
+
declare function ModalContent(props: Props): React.JSX.Element;
|
|
15
15
|
declare namespace ModalContent {
|
|
16
16
|
var __IS_MODAL_CONTENT__: boolean;
|
|
17
17
|
var isComponentOf: (instance: any) => boolean;
|
|
@@ -19,7 +19,7 @@ type Props = {
|
|
|
19
19
|
* </ModalFooter>
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
declare function ModalFooter({ children }: Props): JSX.Element;
|
|
22
|
+
declare function ModalFooter({ children }: Props): React.JSX.Element;
|
|
23
23
|
declare namespace ModalFooter {
|
|
24
24
|
var __IS_MODAL_FOOTER__: boolean;
|
|
25
25
|
var isComponentOf: (instance: any) => boolean;
|
|
@@ -83,7 +83,7 @@ type Props = Common | WithSubtitle | WithBreadcrumbs;
|
|
|
83
83
|
* />
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
|
-
declare function ModalHeader(props: Props): JSX.Element;
|
|
86
|
+
declare function ModalHeader(props: Props): React.JSX.Element;
|
|
87
87
|
declare namespace ModalHeader {
|
|
88
88
|
var defaultProps: {
|
|
89
89
|
light: boolean;
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
readonly closedFocusId?: string | undefined;
|
|
15
15
|
readonly opened?: boolean | undefined;
|
|
16
16
|
readonly onClose?: (() => unknown) | undefined;
|
|
17
|
-
}): JSX.Element;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
|
@@ -72,7 +72,7 @@ type Props = {
|
|
|
72
72
|
* </ModalDialog>
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare function ModalPanel({ closeButtonVisible, scrollOverflow, light, content, footer, header, onClose, style, testId, }: Props): JSX.Element;
|
|
75
|
+
declare function ModalPanel({ closeButtonVisible, scrollOverflow, light, content, footer, header, onClose, style, testId, }: Props): React.JSX.Element;
|
|
76
76
|
declare namespace ModalPanel {
|
|
77
77
|
var defaultProps: {
|
|
78
78
|
closeButtonVisible: boolean;
|
package/dist/es/index.js
CHANGED
|
@@ -26,7 +26,9 @@ const theme$1 = {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
border: {
|
|
29
|
-
radius: tokens.border.radius.medium_4
|
|
29
|
+
radius: tokens.border.radius.medium_4,
|
|
30
|
+
width: tokens.border.width.thin,
|
|
31
|
+
color: tokens.color.blue
|
|
30
32
|
},
|
|
31
33
|
spacing: {
|
|
32
34
|
dialog: {
|
|
@@ -304,7 +306,7 @@ class FocusTrap extends React.Component {
|
|
|
304
306
|
|
|
305
307
|
const ModalLauncherPortalAttributeName = "data-modal-launcher-portal";
|
|
306
308
|
|
|
307
|
-
const FOCUSABLE_ELEMENTS =
|
|
309
|
+
const FOCUSABLE_ELEMENTS = "a[href], details, input, textarea, select, button";
|
|
308
310
|
function findFocusableNodes(root) {
|
|
309
311
|
return Array.from(root.querySelectorAll(FOCUSABLE_ELEMENTS));
|
|
310
312
|
}
|
|
@@ -709,7 +711,14 @@ const themedStylesFn = theme => ({
|
|
|
709
711
|
position: "absolute",
|
|
710
712
|
right: theme.spacing.panel.closeButton,
|
|
711
713
|
top: theme.spacing.panel.closeButton,
|
|
712
|
-
zIndex: 1
|
|
714
|
+
zIndex: 1,
|
|
715
|
+
":focus": {
|
|
716
|
+
outlineWidth: theme.border.width,
|
|
717
|
+
outlineColor: theme.border.color,
|
|
718
|
+
outlineOffset: 1,
|
|
719
|
+
outlineStyle: "solid",
|
|
720
|
+
borderRadius: theme.border.radius
|
|
721
|
+
}
|
|
713
722
|
},
|
|
714
723
|
dark: {
|
|
715
724
|
background: theme.color.bg.inverse,
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,9 @@ const theme$1 = {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
border: {
|
|
59
|
-
radius: tokens__namespace.border.radius.medium_4
|
|
59
|
+
radius: tokens__namespace.border.radius.medium_4,
|
|
60
|
+
width: tokens__namespace.border.width.thin,
|
|
61
|
+
color: tokens__namespace.color.blue
|
|
60
62
|
},
|
|
61
63
|
spacing: {
|
|
62
64
|
dialog: {
|
|
@@ -334,7 +336,7 @@ class FocusTrap extends React__namespace.Component {
|
|
|
334
336
|
|
|
335
337
|
const ModalLauncherPortalAttributeName = "data-modal-launcher-portal";
|
|
336
338
|
|
|
337
|
-
const FOCUSABLE_ELEMENTS =
|
|
339
|
+
const FOCUSABLE_ELEMENTS = "a[href], details, input, textarea, select, button";
|
|
338
340
|
function findFocusableNodes(root) {
|
|
339
341
|
return Array.from(root.querySelectorAll(FOCUSABLE_ELEMENTS));
|
|
340
342
|
}
|
|
@@ -739,7 +741,14 @@ const themedStylesFn = theme => ({
|
|
|
739
741
|
position: "absolute",
|
|
740
742
|
right: theme.spacing.panel.closeButton,
|
|
741
743
|
top: theme.spacing.panel.closeButton,
|
|
742
|
-
zIndex: 1
|
|
744
|
+
zIndex: 1,
|
|
745
|
+
":focus": {
|
|
746
|
+
outlineWidth: theme.border.width,
|
|
747
|
+
outlineColor: theme.border.color,
|
|
748
|
+
outlineOffset: 1,
|
|
749
|
+
outlineStyle: "solid",
|
|
750
|
+
borderRadius: theme.border.radius
|
|
751
|
+
}
|
|
743
752
|
},
|
|
744
753
|
dark: {
|
|
745
754
|
background: theme.color.bg.inverse,
|
package/dist/themes/default.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export declare const ModalDialogThemeContext: React.Context<{
|
|
|
23
23
|
};
|
|
24
24
|
border: {
|
|
25
25
|
radius: number;
|
|
26
|
+
width: number;
|
|
27
|
+
color: string;
|
|
26
28
|
};
|
|
27
29
|
spacing: {
|
|
28
30
|
dialog: {
|
|
@@ -44,5 +46,5 @@ export declare const ModalDialogThemeContext: React.Context<{
|
|
|
44
46
|
* ThemeModalDialog is a component that provides a theme to the <ModalDialog/>
|
|
45
47
|
* component.
|
|
46
48
|
*/
|
|
47
|
-
export default function ThemeModalDialog(props: Props): JSX.Element;
|
|
49
|
+
export default function ThemeModalDialog(props: Props): React.JSX.Element;
|
|
48
50
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"design": "v2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,23 +16,23 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.18.6",
|
|
19
|
-
"@khanacademy/wonder-blocks-breadcrumbs": "^
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "^
|
|
21
|
-
"@khanacademy/wonder-blocks-icon-button": "^
|
|
22
|
-
"@khanacademy/wonder-blocks-layout": "^
|
|
23
|
-
"@khanacademy/wonder-blocks-theming": "^
|
|
24
|
-
"@khanacademy/wonder-blocks-timing": "^
|
|
25
|
-
"@khanacademy/wonder-blocks-tokens": "^
|
|
26
|
-
"@khanacademy/wonder-blocks-typography": "^
|
|
19
|
+
"@khanacademy/wonder-blocks-breadcrumbs": "^3.0.1",
|
|
20
|
+
"@khanacademy/wonder-blocks-core": "^9.0.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-icon-button": "^6.0.1",
|
|
22
|
+
"@khanacademy/wonder-blocks-layout": "^3.0.1",
|
|
23
|
+
"@khanacademy/wonder-blocks-theming": "^3.0.0",
|
|
24
|
+
"@khanacademy/wonder-blocks-timing": "^6.0.0",
|
|
25
|
+
"@khanacademy/wonder-blocks-tokens": "^3.0.0",
|
|
26
|
+
"@khanacademy/wonder-blocks-typography": "^3.0.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@phosphor-icons/core": "^2.0.2",
|
|
30
30
|
"aphrodite": "^1.2.5",
|
|
31
|
-
"react": "
|
|
32
|
-
"react-dom": "
|
|
31
|
+
"react": "18.2.0",
|
|
32
|
+
"react-dom": "18.2.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@khanacademy/wonder-blocks-breadcrumbs": "^
|
|
36
|
-
"@khanacademy/wb-dev-build-settings": "^
|
|
35
|
+
"@khanacademy/wonder-blocks-breadcrumbs": "^3.0.1",
|
|
36
|
+
"@khanacademy/wb-dev-build-settings": "^2.0.0"
|
|
37
37
|
}
|
|
38
38
|
}
|