@khanacademy/wonder-blocks-popover 5.2.2 → 6.0.0

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,27 @@
1
1
  # @khanacademy/wonder-blocks-popover
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 46206d0: Remove `emphasized` variant from `PopoverContent` and `color` prop from `PopoverContentCore` as these are not currently used and no longer recommended
8
+
9
+ ### Patch Changes
10
+
11
+ - 61f7837: Update dismiss button (CloseButton) to use `actionStyles.inverse` instead of the now deprecated `IconButton.light` variant"
12
+ - Updated dependencies [61f7837]
13
+ - Updated dependencies [86e1901]
14
+ - Updated dependencies [aace76a]
15
+ - Updated dependencies [3cacbe7]
16
+ - Updated dependencies [61f7837]
17
+ - Updated dependencies [4887c59]
18
+ - Updated dependencies [86e1901]
19
+ - Updated dependencies [61f7837]
20
+ - @khanacademy/wonder-blocks-icon-button@7.0.0
21
+ - @khanacademy/wonder-blocks-styles@0.2.0
22
+ - @khanacademy/wonder-blocks-modal@7.1.5
23
+ - @khanacademy/wonder-blocks-tooltip@4.1.5
24
+
3
25
  ## 5.2.2
4
26
 
5
27
  ### Patch Changes
@@ -17,11 +17,6 @@ type Props = AriaProps & {
17
17
  * When true, the close button is shown; otherwise, the close button is not shown.
18
18
  */
19
19
  closeButtonVisible?: boolean;
20
- /**
21
- * Whether we should use the default light color scheme or switch to a
22
- * different color scheme.
23
- */
24
- color: "blue" | "darkBlue" | "white";
25
20
  /**
26
21
  * Custom styles applied to the content container
27
22
  */
@@ -32,7 +27,6 @@ type Props = AriaProps & {
32
27
  testId?: string;
33
28
  };
34
29
  type DefaultProps = {
35
- color: Props["color"];
36
30
  closeButtonLight: Props["closeButtonLight"];
37
31
  closeButtonVisible: Props["closeButtonVisible"];
38
32
  };
@@ -44,7 +44,7 @@ type CommonProps = AriaProps & {
44
44
  */
45
45
  uniqueId?: string;
46
46
  };
47
- type Props = (CommonProps & {
47
+ type Props = CommonProps & {
48
48
  /**
49
49
  * Decorate the popover with an illustrated icon. It cannot be used at the
50
50
  * same time with image.
@@ -60,18 +60,7 @@ type Props = (CommonProps & {
60
60
  * the same time with icon.
61
61
  */
62
62
  image?: React.ReactElement<React.ComponentProps<"img">> | React.ReactElement<React.ComponentProps<"svg">>;
63
- emphasized?: never;
64
- }) | (CommonProps & {
65
- /**
66
- * When true, changes the popover dialog background to blue; otherwise, the
67
- * popover dialog background is not modified. It can be used only with
68
- * Text-only popovers. It cannot be used with icon or image.
69
- */
70
- emphasized?: boolean;
71
- icon?: never;
72
- iconAlt?: never;
73
- image?: never;
74
- });
63
+ };
75
64
  type DefaultProps = {
76
65
  closeButtonVisible: Props["closeButtonVisible"];
77
66
  };
package/dist/es/index.js CHANGED
@@ -7,6 +7,7 @@ import { maybeGetPortalMountedModalHostElement } from '@khanacademy/wonder-block
7
7
  import { StyleSheet } from 'aphrodite';
8
8
  import { spacing, semanticColor, color } from '@khanacademy/wonder-blocks-tokens';
9
9
  import { HeadingSmall, Body } from '@khanacademy/wonder-blocks-typography';
10
+ import { actionStyles } 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
 
@@ -76,7 +77,7 @@ class PopoverDialog extends React.Component {
76
77
  "aria-label": ariaLabel
77
78
  } = this.props;
78
79
  const contentProps = children.props;
79
- const color = contentProps.emphasized ? "blue" : contentProps.color;
80
+ const color = contentProps.color;
80
81
  return React.createElement(React.Fragment, null, React.createElement(View, {
81
82
  "aria-label": ariaLabel,
82
83
  "aria-describedby": ariaDescribedby,
@@ -553,7 +554,6 @@ class CloseButton extends React.Component {
553
554
  "aria-label": ariaLabel,
554
555
  onClick: close,
555
556
  kind: light ? "primary" : "tertiary",
556
- light: light,
557
557
  style: style,
558
558
  testId: testId
559
559
  });
@@ -573,24 +573,22 @@ class PopoverContentCore extends React.Component {
573
573
  closeButtonLight,
574
574
  closeButtonLabel,
575
575
  closeButtonVisible,
576
- color,
577
576
  style,
578
577
  testId
579
578
  } = this.props;
580
579
  return React.createElement(View, {
581
580
  testId: testId,
582
- style: [styles$1.content, color !== "white" && styles$1[color], style],
581
+ style: [styles$1.content, style],
583
582
  "aria-label": ariaLabel
584
583
  }, closeButtonVisible && React.createElement(CloseButton, {
585
584
  "aria-label": closeButtonLabel,
586
- light: closeButtonLight || color !== "white",
587
- style: styles$1.closeButton,
585
+ light: closeButtonLight,
586
+ style: [styles$1.closeButton, closeButtonLight && actionStyles.inverse],
588
587
  testId: `${testId || "popover"}-close-btn`
589
588
  }), children);
590
589
  }
591
590
  }
592
591
  PopoverContentCore.defaultProps = {
593
- color: "white",
594
592
  closeButtonLight: false,
595
593
  closeButtonVisible: false
596
594
  };
@@ -606,14 +604,6 @@ const styles$1 = StyleSheet.create({
606
604
  overflow: "hidden",
607
605
  justifyContent: "center"
608
606
  },
609
- blue: {
610
- backgroundColor: semanticColor.surface.emphasis,
611
- color: semanticColor.text.inverse
612
- },
613
- darkBlue: {
614
- backgroundColor: semanticColor.surface.inverse,
615
- color: semanticColor.text.inverse
616
- },
617
607
  closeButton: {
618
608
  margin: 0,
619
609
  position: "absolute",
@@ -691,7 +681,6 @@ class PopoverContent extends React.Component {
691
681
  closeButtonLabel,
692
682
  closeButtonVisible,
693
683
  content,
694
- emphasized = undefined,
695
684
  icon,
696
685
  image,
697
686
  style,
@@ -708,7 +697,6 @@ class PopoverContent extends React.Component {
708
697
  placement
709
698
  });
710
699
  return React.createElement(PopoverContentCore, {
711
- color: emphasized ? "blue" : "white",
712
700
  closeButtonLight: image && placement === "top",
713
701
  closeButtonLabel: closeButtonLabel,
714
702
  closeButtonVisible: closeButtonVisible,
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ var wonderBlocksModal = require('@khanacademy/wonder-blocks-modal');
11
11
  var aphrodite = require('aphrodite');
12
12
  var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
13
13
  var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
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
 
@@ -106,7 +107,7 @@ class PopoverDialog extends React__namespace.Component {
106
107
  "aria-label": ariaLabel
107
108
  } = this.props;
108
109
  const contentProps = children.props;
109
- const color = contentProps.emphasized ? "blue" : contentProps.color;
110
+ const color = contentProps.color;
110
111
  return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(wonderBlocksCore.View, {
111
112
  "aria-label": ariaLabel,
112
113
  "aria-describedby": ariaDescribedby,
@@ -583,7 +584,6 @@ class CloseButton extends React__namespace.Component {
583
584
  "aria-label": ariaLabel,
584
585
  onClick: close,
585
586
  kind: light ? "primary" : "tertiary",
586
- light: light,
587
587
  style: style,
588
588
  testId: testId
589
589
  });
@@ -603,24 +603,22 @@ class PopoverContentCore extends React__namespace.Component {
603
603
  closeButtonLight,
604
604
  closeButtonLabel,
605
605
  closeButtonVisible,
606
- color,
607
606
  style,
608
607
  testId
609
608
  } = this.props;
610
609
  return React__namespace.createElement(wonderBlocksCore.View, {
611
610
  testId: testId,
612
- style: [styles$1.content, color !== "white" && styles$1[color], style],
611
+ style: [styles$1.content, style],
613
612
  "aria-label": ariaLabel
614
613
  }, closeButtonVisible && React__namespace.createElement(CloseButton, {
615
614
  "aria-label": closeButtonLabel,
616
- light: closeButtonLight || color !== "white",
617
- style: styles$1.closeButton,
615
+ light: closeButtonLight,
616
+ style: [styles$1.closeButton, closeButtonLight && wonderBlocksStyles.actionStyles.inverse],
618
617
  testId: `${testId || "popover"}-close-btn`
619
618
  }), children);
620
619
  }
621
620
  }
622
621
  PopoverContentCore.defaultProps = {
623
- color: "white",
624
622
  closeButtonLight: false,
625
623
  closeButtonVisible: false
626
624
  };
@@ -636,14 +634,6 @@ const styles$1 = aphrodite.StyleSheet.create({
636
634
  overflow: "hidden",
637
635
  justifyContent: "center"
638
636
  },
639
- blue: {
640
- backgroundColor: wonderBlocksTokens.semanticColor.surface.emphasis,
641
- color: wonderBlocksTokens.semanticColor.text.inverse
642
- },
643
- darkBlue: {
644
- backgroundColor: wonderBlocksTokens.semanticColor.surface.inverse,
645
- color: wonderBlocksTokens.semanticColor.text.inverse
646
- },
647
637
  closeButton: {
648
638
  margin: 0,
649
639
  position: "absolute",
@@ -721,7 +711,6 @@ class PopoverContent extends React__namespace.Component {
721
711
  closeButtonLabel,
722
712
  closeButtonVisible,
723
713
  content,
724
- emphasized = undefined,
725
714
  icon,
726
715
  image,
727
716
  style,
@@ -738,7 +727,6 @@ class PopoverContent extends React__namespace.Component {
738
727
  placement
739
728
  });
740
729
  return React__namespace.createElement(PopoverContentCore, {
741
- color: emphasized ? "blue" : "white",
742
730
  closeButtonLight: image && placement === "top",
743
731
  closeButtonLabel: closeButtonLabel,
744
732
  closeButtonVisible: closeButtonVisible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khanacademy/wonder-blocks-popover",
3
- "version": "5.2.2",
3
+ "version": "6.0.0",
4
4
  "design": "v1",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,10 +14,11 @@
14
14
  "dependencies": {
15
15
  "@babel/runtime": "^7.24.5",
16
16
  "@khanacademy/wonder-blocks-core": "12.2.1",
17
- "@khanacademy/wonder-blocks-icon-button": "6.1.4",
18
- "@khanacademy/wonder-blocks-modal": "7.1.4",
17
+ "@khanacademy/wonder-blocks-icon-button": "7.0.0",
18
+ "@khanacademy/wonder-blocks-modal": "7.1.5",
19
+ "@khanacademy/wonder-blocks-styles": "0.2.0",
19
20
  "@khanacademy/wonder-blocks-tokens": "5.1.1",
20
- "@khanacademy/wonder-blocks-tooltip": "4.1.4",
21
+ "@khanacademy/wonder-blocks-tooltip": "4.1.5",
21
22
  "@khanacademy/wonder-blocks-typography": "3.1.3"
22
23
  },
23
24
  "peerDependencies": {