@khanacademy/wonder-blocks-popover 5.2.2 → 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 CHANGED
@@ -1,5 +1,42 @@
1
1
  # @khanacademy/wonder-blocks-popover
2
2
 
3
+ ## 6.0.1
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
+ - Updated dependencies [4846e9c]
12
+ - @khanacademy/wonder-blocks-tokens@5.2.0
13
+ - @khanacademy/wonder-blocks-modal@7.1.6
14
+ - @khanacademy/wonder-blocks-icon-button@8.0.0
15
+ - @khanacademy/wonder-blocks-styles@0.2.1
16
+ - @khanacademy/wonder-blocks-tooltip@4.1.6
17
+
18
+ ## 6.0.0
19
+
20
+ ### Major Changes
21
+
22
+ - 46206d0: Remove `emphasized` variant from `PopoverContent` and `color` prop from `PopoverContentCore` as these are not currently used and no longer recommended
23
+
24
+ ### Patch Changes
25
+
26
+ - 61f7837: Update dismiss button (CloseButton) to use `actionStyles.inverse` instead of the now deprecated `IconButton.light` variant"
27
+ - Updated dependencies [61f7837]
28
+ - Updated dependencies [86e1901]
29
+ - Updated dependencies [aace76a]
30
+ - Updated dependencies [3cacbe7]
31
+ - Updated dependencies [61f7837]
32
+ - Updated dependencies [4887c59]
33
+ - Updated dependencies [86e1901]
34
+ - Updated dependencies [61f7837]
35
+ - @khanacademy/wonder-blocks-icon-button@7.0.0
36
+ - @khanacademy/wonder-blocks-styles@0.2.0
37
+ - @khanacademy/wonder-blocks-modal@7.1.5
38
+ - @khanacademy/wonder-blocks-tooltip@4.1.5
39
+
3
40
  ## 5.2.2
4
41
 
5
42
  ### Patch Changes
@@ -1,11 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { AriaProps, StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  type Props = AriaProps & {
4
- /**
5
- * Whether to display the light version of this component instead, for use
6
- * when the item is used on a dark background.
7
- */
8
- light?: boolean;
9
4
  /**
10
5
  * Custom styles applied to the IconButton
11
6
  */
@@ -16,7 +11,6 @@ type Props = AriaProps & {
16
11
  testId?: string;
17
12
  };
18
13
  type DefaultProps = {
19
- light: Props["light"];
20
14
  ["aria-label"]: Props["aria-label"];
21
15
  };
22
16
  /**
@@ -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,
@@ -540,7 +541,6 @@ Popover.defaultProps = {
540
541
  class CloseButton extends React.Component {
541
542
  render() {
542
543
  const {
543
- light,
544
544
  "aria-label": ariaLabel,
545
545
  style,
546
546
  testId
@@ -552,8 +552,8 @@ class CloseButton extends React.Component {
552
552
  icon: xIcon,
553
553
  "aria-label": ariaLabel,
554
554
  onClick: close,
555
- kind: light ? "primary" : "tertiary",
556
- light: light,
555
+ kind: "tertiary",
556
+ actionType: "neutral",
557
557
  style: style,
558
558
  testId: testId
559
559
  });
@@ -561,7 +561,6 @@ class CloseButton extends React.Component {
561
561
  }
562
562
  }
563
563
  CloseButton.defaultProps = {
564
- light: true,
565
564
  "aria-label": "Close Popover"
566
565
  };
567
566
 
@@ -573,24 +572,21 @@ class PopoverContentCore extends React.Component {
573
572
  closeButtonLight,
574
573
  closeButtonLabel,
575
574
  closeButtonVisible,
576
- color,
577
575
  style,
578
576
  testId
579
577
  } = this.props;
580
578
  return React.createElement(View, {
581
579
  testId: testId,
582
- style: [styles$1.content, color !== "white" && styles$1[color], style],
580
+ style: [styles$1.content, style],
583
581
  "aria-label": ariaLabel
584
582
  }, closeButtonVisible && React.createElement(CloseButton, {
585
583
  "aria-label": closeButtonLabel,
586
- light: closeButtonLight || color !== "white",
587
- style: styles$1.closeButton,
584
+ style: [styles$1.closeButton, closeButtonLight && actionStyles.inverse],
588
585
  testId: `${testId || "popover"}-close-btn`
589
586
  }), children);
590
587
  }
591
588
  }
592
589
  PopoverContentCore.defaultProps = {
593
- color: "white",
594
590
  closeButtonLight: false,
595
591
  closeButtonVisible: false
596
592
  };
@@ -606,14 +602,6 @@ const styles$1 = StyleSheet.create({
606
602
  overflow: "hidden",
607
603
  justifyContent: "center"
608
604
  },
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
605
  closeButton: {
618
606
  margin: 0,
619
607
  position: "absolute",
@@ -691,7 +679,6 @@ class PopoverContent extends React.Component {
691
679
  closeButtonLabel,
692
680
  closeButtonVisible,
693
681
  content,
694
- emphasized = undefined,
695
682
  icon,
696
683
  image,
697
684
  style,
@@ -708,7 +695,6 @@ class PopoverContent extends React.Component {
708
695
  placement
709
696
  });
710
697
  return React.createElement(PopoverContentCore, {
711
- color: emphasized ? "blue" : "white",
712
698
  closeButtonLight: image && placement === "top",
713
699
  closeButtonLabel: closeButtonLabel,
714
700
  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,
@@ -570,7 +571,6 @@ Popover.defaultProps = {
570
571
  class CloseButton extends React__namespace.Component {
571
572
  render() {
572
573
  const {
573
- light,
574
574
  "aria-label": ariaLabel,
575
575
  style,
576
576
  testId
@@ -582,8 +582,8 @@ class CloseButton extends React__namespace.Component {
582
582
  icon: xIcon__default["default"],
583
583
  "aria-label": ariaLabel,
584
584
  onClick: close,
585
- kind: light ? "primary" : "tertiary",
586
- light: light,
585
+ kind: "tertiary",
586
+ actionType: "neutral",
587
587
  style: style,
588
588
  testId: testId
589
589
  });
@@ -591,7 +591,6 @@ class CloseButton extends React__namespace.Component {
591
591
  }
592
592
  }
593
593
  CloseButton.defaultProps = {
594
- light: true,
595
594
  "aria-label": "Close Popover"
596
595
  };
597
596
 
@@ -603,24 +602,21 @@ class PopoverContentCore extends React__namespace.Component {
603
602
  closeButtonLight,
604
603
  closeButtonLabel,
605
604
  closeButtonVisible,
606
- color,
607
605
  style,
608
606
  testId
609
607
  } = this.props;
610
608
  return React__namespace.createElement(wonderBlocksCore.View, {
611
609
  testId: testId,
612
- style: [styles$1.content, color !== "white" && styles$1[color], style],
610
+ style: [styles$1.content, style],
613
611
  "aria-label": ariaLabel
614
612
  }, closeButtonVisible && React__namespace.createElement(CloseButton, {
615
613
  "aria-label": closeButtonLabel,
616
- light: closeButtonLight || color !== "white",
617
- style: styles$1.closeButton,
614
+ style: [styles$1.closeButton, closeButtonLight && wonderBlocksStyles.actionStyles.inverse],
618
615
  testId: `${testId || "popover"}-close-btn`
619
616
  }), children);
620
617
  }
621
618
  }
622
619
  PopoverContentCore.defaultProps = {
623
- color: "white",
624
620
  closeButtonLight: false,
625
621
  closeButtonVisible: false
626
622
  };
@@ -636,14 +632,6 @@ const styles$1 = aphrodite.StyleSheet.create({
636
632
  overflow: "hidden",
637
633
  justifyContent: "center"
638
634
  },
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
635
  closeButton: {
648
636
  margin: 0,
649
637
  position: "absolute",
@@ -721,7 +709,6 @@ class PopoverContent extends React__namespace.Component {
721
709
  closeButtonLabel,
722
710
  closeButtonVisible,
723
711
  content,
724
- emphasized = undefined,
725
712
  icon,
726
713
  image,
727
714
  style,
@@ -738,7 +725,6 @@ class PopoverContent extends React__namespace.Component {
738
725
  placement
739
726
  });
740
727
  return React__namespace.createElement(PopoverContentCore, {
741
- color: emphasized ? "blue" : "white",
742
728
  closeButtonLight: image && placement === "top",
743
729
  closeButtonLabel: closeButtonLabel,
744
730
  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.1",
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",
19
- "@khanacademy/wonder-blocks-tokens": "5.1.1",
20
- "@khanacademy/wonder-blocks-tooltip": "4.1.4",
17
+ "@khanacademy/wonder-blocks-icon-button": "8.0.0",
18
+ "@khanacademy/wonder-blocks-modal": "7.1.6",
19
+ "@khanacademy/wonder-blocks-styles": "0.2.1",
20
+ "@khanacademy/wonder-blocks-tokens": "5.2.0",
21
+ "@khanacademy/wonder-blocks-tooltip": "4.1.6",
21
22
  "@khanacademy/wonder-blocks-typography": "3.1.3"
22
23
  },
23
24
  "peerDependencies": {