@khanacademy/wonder-blocks-modal 7.1.4 → 7.1.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
@@ -1,5 +1,21 @@
1
1
  # @khanacademy/wonder-blocks-modal
2
2
 
3
+ ## 7.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 4887c59: Use `focus` styles from `wonder-blocks-styles` to match the global focus outline.
8
+ - 86e1901: Update close button position to account for the new IconButton margin changes
9
+ - 61f7837: Update dismiss button (CloseButton) to use `actionStyles.inverse` instead of the now deprecated `IconButton.light` variant"
10
+ - Updated dependencies [61f7837]
11
+ - Updated dependencies [86e1901]
12
+ - Updated dependencies [aace76a]
13
+ - Updated dependencies [3cacbe7]
14
+ - Updated dependencies [61f7837]
15
+ - Updated dependencies [4887c59]
16
+ - @khanacademy/wonder-blocks-icon-button@7.0.0
17
+ - @khanacademy/wonder-blocks-styles@0.2.0
18
+
3
19
  ## 7.1.4
4
20
 
5
21
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -7,6 +7,7 @@ import { HeadingMedium, LabelSmall } from '@khanacademy/wonder-blocks-typography
7
7
  import * as ReactDOM from 'react-dom';
8
8
  import { StyleSheet } from 'aphrodite';
9
9
  import { withActionScheduler } from '@khanacademy/wonder-blocks-timing';
10
+ import { actionStyles, focusStyles } from '@khanacademy/wonder-blocks-styles';
10
11
  import xIcon from '@phosphor-icons/core/regular/x.svg';
11
12
  import IconButton from '@khanacademy/wonder-blocks-icon-button';
12
13
  import { MediaLayout } from '@khanacademy/wonder-blocks-layout';
@@ -20,8 +21,7 @@ const theme$1 = {
20
21
  }
21
22
  },
22
23
  border: {
23
- radius: border.radius.medium_4,
24
- width: border.width.thin
24
+ radius: border.radius.medium_4
25
25
  }
26
26
  },
27
27
  backdrop: {
@@ -54,16 +54,13 @@ const theme$1 = {
54
54
  }
55
55
  },
56
56
  panel: {
57
- color: {
58
- border: semanticColor.focus.outer
59
- },
60
57
  spacing: {
61
58
  gap: spacing.xLarge_32
62
59
  }
63
60
  },
64
61
  closeButton: {
65
62
  spacing: {
66
- gap: spacing.medium_16
63
+ gap: spacing.xSmall_8
67
64
  }
68
65
  }
69
66
  };
@@ -674,7 +671,6 @@ class CloseButton extends React.Component {
674
671
  "aria-label": "Close modal",
675
672
  onClick: onClick || closeModal,
676
673
  kind: light ? "primary" : "tertiary",
677
- light: light,
678
674
  style: style,
679
675
  testId: testId
680
676
  });
@@ -708,13 +704,14 @@ function ModalPanel({
708
704
  });
709
705
  }, [content, footer, scrollOverflow, styles.hasFooter]);
710
706
  const mainContent = renderMainContent();
707
+ const isInverse = !light;
711
708
  return React.createElement(View, {
712
- style: [styles.wrapper, !light && styles.dark, style],
709
+ style: [styles.wrapper, isInverse && styles.dark, style],
713
710
  testId: testId && `${testId}-panel`
714
711
  }, closeButtonVisible && React.createElement(CloseButton, {
715
- light: !light,
712
+ light: isInverse,
716
713
  onClick: onClose,
717
- style: styles.closeButton,
714
+ style: [styles.closeButton, isInverse && actionStyles.inverse],
718
715
  testId: testId && `${testId}-close`
719
716
  }), header, mainContent, !footer || ModalFooter.isComponentOf(footer) ? footer : React.createElement(ModalFooter, null, footer));
720
717
  }
@@ -740,13 +737,7 @@ const themedStylesFn = theme => ({
740
737
  right: theme.closeButton.spacing.gap,
741
738
  top: theme.closeButton.spacing.gap,
742
739
  zIndex: 1,
743
- ":focus": {
744
- outlineWidth: theme.root.border.width,
745
- outlineColor: theme.panel.color.border,
746
- outlineOffset: 1,
747
- outlineStyle: "solid",
748
- borderRadius: theme.root.border.radius
749
- }
740
+ ":focus": _extends({}, focusStyles.focus[":focus-visible"])
750
741
  },
751
742
  dark: {
752
743
  background: theme.root.color.inverse.background,
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
11
11
  var ReactDOM = require('react-dom');
12
12
  var aphrodite = require('aphrodite');
13
13
  var wonderBlocksTiming = require('@khanacademy/wonder-blocks-timing');
14
+ var wonderBlocksStyles = require('@khanacademy/wonder-blocks-styles');
14
15
  var xIcon = require('@phosphor-icons/core/regular/x.svg');
15
16
  var IconButton = require('@khanacademy/wonder-blocks-icon-button');
16
17
  var wonderBlocksLayout = require('@khanacademy/wonder-blocks-layout');
@@ -50,8 +51,7 @@ const theme$1 = {
50
51
  }
51
52
  },
52
53
  border: {
53
- radius: wonderBlocksTokens.border.radius.medium_4,
54
- width: wonderBlocksTokens.border.width.thin
54
+ radius: wonderBlocksTokens.border.radius.medium_4
55
55
  }
56
56
  },
57
57
  backdrop: {
@@ -84,16 +84,13 @@ const theme$1 = {
84
84
  }
85
85
  },
86
86
  panel: {
87
- color: {
88
- border: wonderBlocksTokens.semanticColor.focus.outer
89
- },
90
87
  spacing: {
91
88
  gap: wonderBlocksTokens.spacing.xLarge_32
92
89
  }
93
90
  },
94
91
  closeButton: {
95
92
  spacing: {
96
- gap: wonderBlocksTokens.spacing.medium_16
93
+ gap: wonderBlocksTokens.spacing.xSmall_8
97
94
  }
98
95
  }
99
96
  };
@@ -704,7 +701,6 @@ class CloseButton extends React__namespace.Component {
704
701
  "aria-label": "Close modal",
705
702
  onClick: onClick || closeModal,
706
703
  kind: light ? "primary" : "tertiary",
707
- light: light,
708
704
  style: style,
709
705
  testId: testId
710
706
  });
@@ -738,13 +734,14 @@ function ModalPanel({
738
734
  });
739
735
  }, [content, footer, scrollOverflow, styles.hasFooter]);
740
736
  const mainContent = renderMainContent();
737
+ const isInverse = !light;
741
738
  return React__namespace.createElement(wonderBlocksCore.View, {
742
- style: [styles.wrapper, !light && styles.dark, style],
739
+ style: [styles.wrapper, isInverse && styles.dark, style],
743
740
  testId: testId && `${testId}-panel`
744
741
  }, closeButtonVisible && React__namespace.createElement(CloseButton, {
745
- light: !light,
742
+ light: isInverse,
746
743
  onClick: onClose,
747
- style: styles.closeButton,
744
+ style: [styles.closeButton, isInverse && wonderBlocksStyles.actionStyles.inverse],
748
745
  testId: testId && `${testId}-close`
749
746
  }), header, mainContent, !footer || ModalFooter.isComponentOf(footer) ? footer : React__namespace.createElement(ModalFooter, null, footer));
750
747
  }
@@ -770,13 +767,7 @@ const themedStylesFn = theme => ({
770
767
  right: theme.closeButton.spacing.gap,
771
768
  top: theme.closeButton.spacing.gap,
772
769
  zIndex: 1,
773
- ":focus": {
774
- outlineWidth: theme.root.border.width,
775
- outlineColor: theme.panel.color.border,
776
- outlineOffset: 1,
777
- outlineStyle: "solid",
778
- borderRadius: theme.root.border.radius
779
- }
770
+ ":focus": _extends__default["default"]({}, wonderBlocksStyles.focusStyles.focus[":focus-visible"])
780
771
  },
781
772
  dark: {
782
773
  background: theme.root.color.inverse.background,
@@ -11,7 +11,6 @@ declare const theme: {
11
11
  };
12
12
  border: {
13
13
  radius: number;
14
- width: number;
15
14
  };
16
15
  };
17
16
  /**
@@ -47,16 +46,13 @@ declare const theme: {
47
46
  };
48
47
  };
49
48
  panel: {
50
- color: {
51
- border: string;
52
- };
53
49
  spacing: {
54
50
  gap: 32;
55
51
  };
56
52
  };
57
53
  closeButton: {
58
54
  spacing: {
59
- gap: 16;
55
+ gap: 8;
60
56
  };
61
57
  };
62
58
  };
@@ -11,7 +11,6 @@ declare const theme: {
11
11
  };
12
12
  border: {
13
13
  radius: number;
14
- width: number;
15
14
  };
16
15
  };
17
16
  backdrop: {
@@ -44,16 +43,13 @@ declare const theme: {
44
43
  };
45
44
  };
46
45
  panel: {
47
- color: {
48
- border: string;
49
- };
50
46
  spacing: {
51
47
  gap: 32;
52
48
  };
53
49
  };
54
50
  closeButton: {
55
51
  spacing: {
56
- gap: 16;
52
+ gap: 8;
57
53
  };
58
54
  };
59
55
  };
@@ -18,7 +18,6 @@ export declare const ModalDialogThemeContext: React.Context<{
18
18
  };
19
19
  border: {
20
20
  radius: number;
21
- width: number;
22
21
  };
23
22
  };
24
23
  backdrop: {
@@ -51,16 +50,13 @@ export declare const ModalDialogThemeContext: React.Context<{
51
50
  };
52
51
  };
53
52
  panel: {
54
- color: {
55
- border: string;
56
- };
57
53
  spacing: {
58
54
  gap: 32;
59
55
  };
60
56
  };
61
57
  closeButton: {
62
58
  spacing: {
63
- gap: 16;
59
+ gap: 8;
64
60
  };
65
61
  };
66
62
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-modal",
3
- "version": "7.1.4",
3
+ "version": "7.1.5",
4
4
  "design": "v2",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,8 +15,9 @@
15
15
  "@babel/runtime": "^7.24.5",
16
16
  "@khanacademy/wonder-blocks-breadcrumbs": "3.1.4",
17
17
  "@khanacademy/wonder-blocks-core": "12.2.1",
18
- "@khanacademy/wonder-blocks-icon-button": "6.1.4",
18
+ "@khanacademy/wonder-blocks-icon-button": "7.0.0",
19
19
  "@khanacademy/wonder-blocks-layout": "3.1.4",
20
+ "@khanacademy/wonder-blocks-styles": "0.2.0",
20
21
  "@khanacademy/wonder-blocks-theming": "3.2.1",
21
22
  "@khanacademy/wonder-blocks-timing": "7.0.2",
22
23
  "@khanacademy/wonder-blocks-tokens": "5.1.1",