@khanacademy/wonder-blocks-modal 7.1.4 → 7.1.6

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,35 @@
1
1
  # @khanacademy/wonder-blocks-modal
2
2
 
3
+ ## 7.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 4846e9c: Update icon buttons to use the new mapping (from `primary` to `tertiary`)
8
+ - Updated dependencies [3dc5dac]
9
+ - Updated dependencies [4846e9c]
10
+ - Updated dependencies [4846e9c]
11
+ - @khanacademy/wonder-blocks-tokens@5.2.0
12
+ - @khanacademy/wonder-blocks-icon-button@8.0.0
13
+ - @khanacademy/wonder-blocks-breadcrumbs@3.1.5
14
+ - @khanacademy/wonder-blocks-layout@3.1.5
15
+ - @khanacademy/wonder-blocks-styles@0.2.1
16
+
17
+ ## 7.1.5
18
+
19
+ ### Patch Changes
20
+
21
+ - 4887c59: Use `focus` styles from `wonder-blocks-styles` to match the global focus outline.
22
+ - 86e1901: Update close button position to account for the new IconButton margin changes
23
+ - 61f7837: Update dismiss button (CloseButton) to use `actionStyles.inverse` instead of the now deprecated `IconButton.light` variant"
24
+ - Updated dependencies [61f7837]
25
+ - Updated dependencies [86e1901]
26
+ - Updated dependencies [aace76a]
27
+ - Updated dependencies [3cacbe7]
28
+ - Updated dependencies [61f7837]
29
+ - Updated dependencies [4887c59]
30
+ - @khanacademy/wonder-blocks-icon-button@7.0.0
31
+ - @khanacademy/wonder-blocks-styles@0.2.0
32
+
3
33
  ## 7.1.4
4
34
 
5
35
  ### Patch Changes
@@ -1,13 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  type Props = {
4
- /**
5
- * Whether the button is on a dark/colored background.
6
- *
7
- * Sets primary button background color to white, and secondary and
8
- * tertiary button title to color.
9
- */
10
- light?: boolean;
11
4
  /** Optional click handler */
12
5
  onClick?: () => unknown;
13
6
  /** Optional custom styles. */
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
  };
@@ -658,7 +655,6 @@ ModalContent.defaultProps = {
658
655
  class CloseButton extends React.Component {
659
656
  render() {
660
657
  const {
661
- light,
662
658
  onClick,
663
659
  style,
664
660
  testId
@@ -673,8 +669,8 @@ class CloseButton extends React.Component {
673
669
  icon: xIcon,
674
670
  "aria-label": "Close modal",
675
671
  onClick: onClick || closeModal,
676
- kind: light ? "primary" : "tertiary",
677
- light: light,
672
+ kind: "tertiary",
673
+ actionType: "neutral",
678
674
  style: style,
679
675
  testId: testId
680
676
  });
@@ -708,13 +704,13 @@ 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,
716
712
  onClick: onClose,
717
- style: styles.closeButton,
713
+ style: [styles.closeButton, isInverse && actionStyles.inverse],
718
714
  testId: testId && `${testId}-close`
719
715
  }), header, mainContent, !footer || ModalFooter.isComponentOf(footer) ? footer : React.createElement(ModalFooter, null, footer));
720
716
  }
@@ -740,13 +736,7 @@ const themedStylesFn = theme => ({
740
736
  right: theme.closeButton.spacing.gap,
741
737
  top: theme.closeButton.spacing.gap,
742
738
  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
- }
739
+ ":focus": _extends({}, focusStyles.focus[":focus-visible"])
750
740
  },
751
741
  dark: {
752
742
  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
  };
@@ -688,7 +685,6 @@ ModalContent.defaultProps = {
688
685
  class CloseButton extends React__namespace.Component {
689
686
  render() {
690
687
  const {
691
- light,
692
688
  onClick,
693
689
  style,
694
690
  testId
@@ -703,8 +699,8 @@ class CloseButton extends React__namespace.Component {
703
699
  icon: xIcon__default["default"],
704
700
  "aria-label": "Close modal",
705
701
  onClick: onClick || closeModal,
706
- kind: light ? "primary" : "tertiary",
707
- light: light,
702
+ kind: "tertiary",
703
+ actionType: "neutral",
708
704
  style: style,
709
705
  testId: testId
710
706
  });
@@ -738,13 +734,13 @@ 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,
746
742
  onClick: onClose,
747
- style: styles.closeButton,
743
+ style: [styles.closeButton, isInverse && wonderBlocksStyles.actionStyles.inverse],
748
744
  testId: testId && `${testId}-close`
749
745
  }), header, mainContent, !footer || ModalFooter.isComponentOf(footer) ? footer : React__namespace.createElement(ModalFooter, null, footer));
750
746
  }
@@ -770,13 +766,7 @@ const themedStylesFn = theme => ({
770
766
  right: theme.closeButton.spacing.gap,
771
767
  top: theme.closeButton.spacing.gap,
772
768
  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
- }
769
+ ":focus": _extends__default["default"]({}, wonderBlocksStyles.focusStyles.focus[":focus-visible"])
780
770
  },
781
771
  dark: {
782
772
  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.6",
4
4
  "design": "v2",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,13 +13,14 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@babel/runtime": "^7.24.5",
16
- "@khanacademy/wonder-blocks-breadcrumbs": "3.1.4",
16
+ "@khanacademy/wonder-blocks-breadcrumbs": "3.1.5",
17
17
  "@khanacademy/wonder-blocks-core": "12.2.1",
18
- "@khanacademy/wonder-blocks-icon-button": "6.1.4",
19
- "@khanacademy/wonder-blocks-layout": "3.1.4",
18
+ "@khanacademy/wonder-blocks-icon-button": "8.0.0",
19
+ "@khanacademy/wonder-blocks-layout": "3.1.5",
20
+ "@khanacademy/wonder-blocks-styles": "0.2.1",
20
21
  "@khanacademy/wonder-blocks-theming": "3.2.1",
21
22
  "@khanacademy/wonder-blocks-timing": "7.0.2",
22
- "@khanacademy/wonder-blocks-tokens": "5.1.1",
23
+ "@khanacademy/wonder-blocks-tokens": "5.2.0",
23
24
  "@khanacademy/wonder-blocks-typography": "3.1.3"
24
25
  },
25
26
  "peerDependencies": {