@codecademy/gamut-styles 14.2.5 → 14.2.6-alpha.9fa786.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.
@@ -1,10 +1,10 @@
1
- import { Helmet } from 'react-helmet';
1
+ import { Helmet } from 'react-helmet-async';
2
2
  import { webFonts } from './remoteAssets/fonts';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var createFontLinks = function createFontLinks() {
5
5
  return webFonts.flatMap(function (_ref) {
6
6
  var filePath = _ref.filePath,
7
- extensions = _ref.extensions;
7
+ extensions = _ref.extensions;
8
8
  return extensions.map(function (ext) {
9
9
  return /*#__PURE__*/_jsx("link", {
10
10
  rel: "preload",
@@ -3,4 +3,4 @@ import { ColorMode, Colors } from './ColorMode';
3
3
  export interface BackgroundProps extends Omit<ComponentProps<typeof ColorMode>, 'mode' | 'alwaysSetVariables' | 'bg'> {
4
4
  bg: Colors;
5
5
  }
6
- export declare const Background: import("react").ForwardRefExoticComponent<Pick<BackgroundProps, "dir" | "p" | "slot" | "style" | "title" | "id" | "key" | "color" | "background" | "property" | "alignContent" | "alignItems" | "alignSelf" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "inset" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "position" | "right" | "rowGap" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "overflow" | "hidden" | "variables" | "children" | "theme" | "dimensions" | "textColor" | "bg" | "borderColorX" | "borderColorY" | "borderColorLeft" | "borderColorRight" | "borderColorTop" | "borderColorBottom" | "px" | "py" | "pt" | "pb" | "pr" | "pl" | "m" | "mx" | "my" | "mt" | "mb" | "mr" | "ml" | "borderX" | "borderY" | "borderWidthX" | "borderWidthY" | "borderWidthLeft" | "borderWidthRight" | "borderWidthTop" | "borderWidthBottom" | "borderRadiusLeft" | "borderRadiusTop" | "borderRadiusBottom" | "borderRadiusRight" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomRight" | "borderRadiusBottomLeft" | "borderStyleX" | "borderStyleY" | "borderStyleLeft" | "borderStyleRight" | "borderStyleTop" | "borderStyleBottom" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const Background: import("react").ForwardRefExoticComponent<Pick<BackgroundProps, "dir" | "p" | "slot" | "style" | "title" | "id" | "nonce" | "key" | "color" | "background" | "property" | "alignContent" | "alignItems" | "alignSelf" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "inset" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "position" | "right" | "rowGap" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "overflow" | "hidden" | "variables" | "children" | "theme" | "dimensions" | "textColor" | "bg" | "borderColorX" | "borderColorY" | "borderColorLeft" | "borderColorRight" | "borderColorTop" | "borderColorBottom" | "px" | "py" | "pt" | "pb" | "pr" | "pl" | "m" | "mx" | "my" | "mt" | "mb" | "mr" | "ml" | "borderX" | "borderY" | "borderWidthX" | "borderWidthY" | "borderWidthLeft" | "borderWidthRight" | "borderWidthTop" | "borderWidthBottom" | "borderRadiusLeft" | "borderRadiusTop" | "borderRadiusBottom" | "borderRadiusRight" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomRight" | "borderRadiusBottomLeft" | "borderStyleX" | "borderStyleY" | "borderStyleLeft" | "borderStyleRight" | "borderStyleTop" | "borderStyleBottom" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,63 +1,46 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
-
2
+ var _excluded = ["bg"];
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
-
9
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
-
11
7
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
-
13
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
-
15
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
-
17
10
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
-
19
11
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
-
21
12
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
22
-
23
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
-
25
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
26
-
27
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
28
-
29
16
  import { getContrast } from 'polished';
30
17
  import { forwardRef, useCallback, useMemo } from 'react';
31
18
  import { ColorMode, useColorModes } from './ColorMode';
32
19
  import { jsx as _jsx } from "react/jsx-runtime";
33
-
34
20
  var isColorAlias = function isColorAlias(mode, color) {
35
21
  return Object.keys(mode).includes(color);
36
22
  };
37
-
38
23
  export var Background = /*#__PURE__*/forwardRef(function Background(_ref, ref) {
39
24
  var bg = _ref.bg,
40
- rest = _objectWithoutProperties(_ref, ["bg"]);
41
-
25
+ rest = _objectWithoutProperties(_ref, _excluded);
42
26
  var _useColorModes = useColorModes(),
43
- _useColorModes2 = _slicedToArray(_useColorModes, 4),
44
- active = _useColorModes2[0],
45
- activeColors = _useColorModes2[1],
46
- modes = _useColorModes2[2],
47
- getColorValue = _useColorModes2[3];
48
- /** If a color alias was used then look up the true color key from the active mode */
49
-
27
+ _useColorModes2 = _slicedToArray(_useColorModes, 4),
28
+ active = _useColorModes2[0],
29
+ activeColors = _useColorModes2[1],
30
+ modes = _useColorModes2[2],
31
+ getColorValue = _useColorModes2[3];
50
32
 
33
+ /** If a color alias was used then look up the true color key from the active mode */
51
34
  var trueColor = useMemo(function () {
52
35
  if (isColorAlias(activeColors, bg)) {
53
36
  return activeColors[bg];
54
37
  }
55
-
56
38
  return bg;
57
39
  }, [bg, activeColors]);
58
40
  var getTextContrast = useCallback(function (foreground) {
59
41
  return getContrast(getColorValue(foreground), getColorValue(trueColor));
60
42
  }, [trueColor, getColorValue]);
43
+
61
44
  /**
62
45
  * This compares the contrast of the selected background color
63
46
  * and each color modes body text and returns the mode that has
@@ -70,9 +53,9 @@ export var Background = /*#__PURE__*/forwardRef(function Background(_ref, ref) {
70
53
 
71
54
  var accessibleMode = useMemo(function () {
72
55
  var activeMode = modes[active],
73
- otherModes = _objectWithoutProperties(modes, [active].map(_toPropertyKey));
74
-
56
+ otherModes = _objectWithoutProperties(modes, [active].map(_toPropertyKey));
75
57
  var possibleModes = Object.entries(otherModes);
58
+
76
59
  /**
77
60
  * Reduce all remaining modes to the mode key with the highest contrast
78
61
  * value.
@@ -81,23 +64,19 @@ export var Background = /*#__PURE__*/forwardRef(function Background(_ref, ref) {
81
64
  * it will likelyfail to return a mode outside of the lighest and
82
65
  * darkest versions.
83
66
  */
84
-
85
67
  var _possibleModes$reduce = possibleModes.reduce(function (_ref2, _ref3) {
86
- var _ref4 = _slicedToArray(_ref2, 2),
68
+ var _ref4 = _slicedToArray(_ref2, 2),
87
69
  prevMode = _ref4[0],
88
70
  prevContrast = _ref4[1];
89
-
90
- var _ref5 = _slicedToArray(_ref3, 2),
71
+ var _ref5 = _slicedToArray(_ref3, 2),
91
72
  mode = _ref5[0],
92
73
  text = _ref5[1].text;
93
-
94
- var contrast = getTextContrast(text); // Keep the higher contrast mode.
95
-
96
- return contrast > prevContrast ? [mode, contrast] : [prevMode, prevContrast];
97
- }, [active, getTextContrast(activeMode.text)]),
98
- _possibleModes$reduce2 = _slicedToArray(_possibleModes$reduce, 1),
99
- highestContrastMode = _possibleModes$reduce2[0];
100
-
74
+ var contrast = getTextContrast(text);
75
+ // Keep the higher contrast mode.
76
+ return contrast > prevContrast ? [mode, contrast] : [prevMode, prevContrast];
77
+ }, [active, getTextContrast(activeMode.text)]),
78
+ _possibleModes$reduce2 = _slicedToArray(_possibleModes$reduce, 1),
79
+ highestContrastMode = _possibleModes$reduce2[0];
101
80
  return highestContrastMode;
102
81
  }, [modes, active, getTextContrast]);
103
82
  return /*#__PURE__*/_jsx(ColorMode, _objectSpread(_objectSpread({}, rest), {}, {
@@ -875,7 +875,7 @@ export declare const VariableProvider: import("@emotion/styled").StyledComponent
875
875
  } & {
876
876
  variables?: CSSObject | undefined;
877
877
  alwaysSetVariables?: boolean | undefined;
878
- }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "dir" | "slot" | "style" | "title" | "id" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>>, {}>;
878
+ }, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "dir" | "slot" | "style" | "title" | "id" | "nonce" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>>, {}>;
879
879
  export declare const ColorMode: import("react").ForwardRefExoticComponent<Pick<Omit<{
880
880
  theme?: Theme | undefined;
881
881
  as?: import("react").ElementType<any> | undefined;
@@ -1273,6 +1273,4 @@ export declare const ColorMode: import("react").ForwardRefExoticComponent<Pick<O
1273
1273
  } & {
1274
1274
  variables?: CSSObject | undefined;
1275
1275
  alwaysSetVariables?: boolean | undefined;
1276
- } & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "dir" | "slot" | "style" | "title" | "id" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>> & {
1277
- children?: import("react").ReactNode;
1278
- }, "bg"> & ColorModeProps, "dir" | "p" | "slot" | "style" | "title" | "id" | "key" | "color" | "background" | "property" | "alignContent" | "alignItems" | "alignSelf" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "inset" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "position" | "right" | "rowGap" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "overflow" | "hidden" | "variables" | "children" | "theme" | "dimensions" | "textColor" | "borderColorX" | "borderColorY" | "borderColorLeft" | "borderColorRight" | "borderColorTop" | "borderColorBottom" | "px" | "py" | "pt" | "pb" | "pr" | "pl" | "m" | "mx" | "my" | "mt" | "mb" | "mr" | "ml" | "borderX" | "borderY" | "borderWidthX" | "borderWidthY" | "borderWidthLeft" | "borderWidthRight" | "borderWidthTop" | "borderWidthBottom" | "borderRadiusLeft" | "borderRadiusTop" | "borderRadiusBottom" | "borderRadiusRight" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomRight" | "borderRadiusBottomLeft" | "borderStyleX" | "borderStyleY" | "borderStyleLeft" | "borderStyleRight" | "borderStyleTop" | "borderStyleBottom" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as" | "alwaysSetVariables" | keyof ColorModeProps> & import("react").RefAttributes<HTMLDivElement>>;
1276
+ } & Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "dir" | "slot" | "style" | "title" | "id" | "nonce" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>>, "bg"> & ColorModeProps, "dir" | "p" | "slot" | "style" | "title" | "id" | "nonce" | "key" | "color" | "background" | "property" | "alignContent" | "alignItems" | "alignSelf" | "backgroundImage" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "inset" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "position" | "right" | "rowGap" | "top" | "translate" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "overflow" | "hidden" | "variables" | "children" | "theme" | "dimensions" | "textColor" | "borderColorX" | "borderColorY" | "borderColorLeft" | "borderColorRight" | "borderColorTop" | "borderColorBottom" | "px" | "py" | "pt" | "pb" | "pr" | "pl" | "m" | "mx" | "my" | "mt" | "mb" | "mr" | "ml" | "borderX" | "borderY" | "borderWidthX" | "borderWidthY" | "borderWidthLeft" | "borderWidthRight" | "borderWidthTop" | "borderWidthBottom" | "borderRadiusLeft" | "borderRadiusTop" | "borderRadiusBottom" | "borderRadiusRight" | "borderRadiusTopLeft" | "borderRadiusTopRight" | "borderRadiusBottomRight" | "borderRadiusBottomLeft" | "borderStyleX" | "borderStyleY" | "borderStyleLeft" | "borderStyleRight" | "borderStyleTop" | "borderStyleBottom" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as" | "alwaysSetVariables" | keyof ColorModeProps> & import("react").RefAttributes<HTMLDivElement>>;
package/dist/ColorMode.js CHANGED
@@ -1,29 +1,17 @@
1
1
  import _styled from "@emotion/styled/base";
2
-
2
+ var _excluded = ["mode", "alwaysSetVariables", "bg"];
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
-
5
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
-
7
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
-
9
6
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
-
11
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
-
13
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
-
15
9
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
-
17
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
-
19
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
-
21
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
22
-
23
13
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
-
25
14
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
-
27
15
  import { serializeTokens, variance } from '@codecademy/variance';
28
16
  import { ThemeProvider, useTheme } from '@emotion/react';
29
17
  import { mapValues, pick } from 'lodash';
@@ -34,7 +22,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
34
22
  export var providerProps = variance.compose(layout, color, grid, flex, positioning, space, border, background);
35
23
  export var modeColorProps = function modeColorProps(_ref) {
36
24
  var theme = _ref.theme,
37
- mode = _ref.mode;
25
+ mode = _ref.mode;
38
26
  if (!theme || !mode || mode === (theme === null || theme === void 0 ? void 0 : theme.mode)) return {};
39
27
  var colors = theme.colors;
40
28
  return serializeTokens(mapValues(theme === null || theme === void 0 ? void 0 : theme.modes[mode], function (color) {
@@ -46,44 +34,37 @@ var BackgroundCurrentContext = /*#__PURE__*/createContext({
46
34
  });
47
35
  export function useColorModes() {
48
36
  var bgCurrent = useContext(BackgroundCurrentContext);
49
-
50
37
  var _ref2 = useTheme() || {},
51
- mode = _ref2.mode,
52
- modes = _ref2.modes,
53
- getColorValue = _ref2._getColorValue;
54
-
38
+ mode = _ref2.mode,
39
+ modes = _ref2.modes,
40
+ getColorValue = _ref2._getColorValue;
55
41
  var modesCopy = _objectSpread({}, modes);
56
-
57
42
  if (bgCurrent['background-current'] && modesCopy[mode]['background-current'] !== bgCurrent['background-current']) {
58
43
  /* sets the color to the copy of our modes object, and casts the type as the default color values for background-current.
59
44
  we could potentially alter the Merge type utility function from createTheme, but since 'background-current' is the only exception to the type-merging rule and this is the only place we override, this seems to be a more straightforward + lower-risk solution.
60
45
  */
46
+
61
47
  modesCopy[mode]['background-current'] = bgCurrent['background-current'];
62
48
  }
63
-
64
49
  return [mode, modesCopy === null || modesCopy === void 0 ? void 0 : modesCopy[mode], modes, getColorValue];
65
50
  }
66
51
  export function useCurrentMode(mode) {
67
52
  var _useColorModes = useColorModes(),
68
- _useColorModes2 = _slicedToArray(_useColorModes, 1),
69
- activeMode = _useColorModes2[0];
70
-
53
+ _useColorModes2 = _slicedToArray(_useColorModes, 1),
54
+ activeMode = _useColorModes2[0];
71
55
  return mode !== null && mode !== void 0 ? mode : activeMode;
72
56
  }
73
57
  export function usePrefersDarkMode() {
74
58
  var _useState = useState(false),
75
- _useState2 = _slicedToArray(_useState, 2),
76
- prefersDarkMode = _useState2[0],
77
- setPrefersDarkMode = _useState2[1];
78
-
59
+ _useState2 = _slicedToArray(_useState, 2),
60
+ prefersDarkMode = _useState2[0],
61
+ setPrefersDarkMode = _useState2[1];
79
62
  useEffect(function () {
80
63
  function onChange(event) {
81
64
  setPrefersDarkMode(event.matches);
82
65
  }
83
-
84
66
  if (window && 'matchMedia' in window) {
85
67
  var mq = window.matchMedia('(prefers-color-scheme: dark)');
86
-
87
68
  if (mq && 'addEventListener' in mq) {
88
69
  setPrefersDarkMode(mq.matches);
89
70
  mq.addEventListener('change', onChange);
@@ -106,39 +87,37 @@ export var VariableProvider = /*#__PURE__*/_styled('div', _extends({}, {
106
87
  }), providerProps, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9Db2xvck1vZGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9JZ0MiLCJmaWxlIjoiLi4vc3JjL0NvbG9yTW9kZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBzZXJpYWxpemVUb2tlbnMsXG4gIFN0eWxlUHJvcHMsXG4gIFRoZW1lUHJvcHMsXG4gIHZhcmlhbmNlLFxufSBmcm9tICdAY29kZWNhZGVteS92YXJpYW5jZSc7XG5pbXBvcnQgeyBDU1NPYmplY3QsIFRoZW1lLCBUaGVtZVByb3ZpZGVyLCB1c2VUaGVtZSB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IG1hcFZhbHVlcywgcGljayB9IGZyb20gJ2xvZGFzaCc7XG5pbXBvcnQge1xuICBDb21wb25lbnRQcm9wcyxcbiAgY3JlYXRlQ29udGV4dCxcbiAgZm9yd2FyZFJlZixcbiAgdXNlQ29udGV4dCxcbiAgdXNlRWZmZWN0LFxuICB1c2VNZW1vLFxuICB1c2VTdGF0ZSxcbn0gZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgeyB0a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vZGUsIG1vZGVzLCB0aGVtZSwgYmddKTtcblxuICBpZiAoYWN0aXZlID09PSBtb2RlKSB7XG4gICAgY29uc3QgdmFycyA9IGFsd2F5c1NldFZhcmlhYmxlc1xuICAgICAgPyB2YXJpYWJsZXNcbiAgICAgIDogcGljayh2YXJpYWJsZXMsIFsnLS1jb2xvci1iYWNrZ3JvdW5kLWN1cnJlbnQnXSk7XG5cbiAgICByZXR1cm4gKFxuICAgICAgPEJhY2tncm91bmRDdXJyZW50Q29udGV4dC5Qcm92aWRlclxuICAgICAgICB2YWx1ZT17eyAnYmFja2dyb3VuZC1jdXJyZW50JzogYmdDdXJyZW50IH19XG4gICAgICA+XG4gICAgICAgIDxWYXJpYWJsZVByb3ZpZGVyIHsuLi5yZXN0fSB2YXJpYWJsZXM9e3ZhcnN9IGJnPXtjb250ZXh0Qmd9IHJlZj17cmVmfSAvPlxuICAgICAgPC9CYWNrZ3JvdW5kQ3VycmVudENvbnRleHQuUHJvdmlkZXI+XG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiAoXG4gICAgPFRoZW1lUHJvdmlkZXIgdGhlbWU9e3sgbW9kZSB9fT5cbiAgICAgIDxWYXJpYWJsZVByb3ZpZGVyXG4gICAgICAgIHsuLi5yZXN0fVxuICAgICAgICB2YXJpYWJsZXM9e3ZhcmlhYmxlc31cbiAgICAgICAgYmc9e2NvbnRleHRCZ31cbiAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAvPlxuICAgIDwvVGhlbWVQcm92aWRlcj5cbiAgKTtcbn0pO1xuIl19 */");
107
88
  export var ColorMode = /*#__PURE__*/forwardRef(function ColorMode(_ref4, ref) {
108
89
  var preference = _ref4.mode,
109
- alwaysSetVariables = _ref4.alwaysSetVariables,
110
- bg = _ref4.bg,
111
- rest = _objectWithoutProperties(_ref4, ["mode", "alwaysSetVariables", "bg"]);
112
-
90
+ alwaysSetVariables = _ref4.alwaysSetVariables,
91
+ bg = _ref4.bg,
92
+ rest = _objectWithoutProperties(_ref4, _excluded);
113
93
  // checks if the user has set 'system' as their color mode preference
114
94
  // then sets the color mode
115
95
  var prefersDarkMode = usePrefersDarkMode();
116
96
  var mode = preference === 'system' ? prefersDarkMode ? 'dark' : 'light' : preference;
117
97
  var theme = useTheme();
118
98
  var modes = theme.modes,
119
- active = theme.mode,
120
- colors = theme.colors;
121
- var contextBg = bg ? 'background-current' : undefined; // This makes sure the background-current context is always set to the correct color + not the semantic color name.
99
+ active = theme.mode,
100
+ colors = theme.colors;
101
+ var contextBg = bg ? 'background-current' : undefined;
122
102
 
103
+ // This makes sure the background-current context is always set to the correct color + not the semantic color name.
123
104
  var currentParentBg = useContext(BackgroundCurrentContext);
124
105
  var bgCurrent = bg === 'background-current' ? currentParentBg['background-current'] ? currentParentBg['background-current'] : modes[active]['background-current'] : bg;
106
+
125
107
  /** Serialize color variables for the current mode
126
108
  * 1. If all variables are required add all mode variables to the current context
127
109
  * 2. If the user has specified a background color - set that color to the current-bg
128
110
  * 3. If not
129
111
  */
130
-
131
112
  var _useMemo = useMemo(function () {
132
- return serializeTokens(mapValues(modes[mode], function (color, key) {
133
- if (key === 'background-current' && typeof bg !== 'undefined') {
134
- return colors[bg];
135
- }
136
-
137
- return colors[color];
138
- }), 'color', theme);
139
- }, [colors, mode, modes, theme, bg]),
140
- variables = _useMemo.variables;
141
-
113
+ return serializeTokens(mapValues(modes[mode], function (color, key) {
114
+ if (key === 'background-current' && typeof bg !== 'undefined') {
115
+ return colors[bg];
116
+ }
117
+ return colors[color];
118
+ }), 'color', theme);
119
+ }, [colors, mode, modes, theme, bg]),
120
+ variables = _useMemo.variables;
142
121
  if (active === mode) {
143
122
  var vars = alwaysSetVariables ? variables : pick(variables, ['--color-background-current']);
144
123
  return /*#__PURE__*/_jsx(BackgroundCurrentContext.Provider, {
@@ -152,7 +131,6 @@ export var ColorMode = /*#__PURE__*/forwardRef(function ColorMode(_ref4, ref) {
152
131
  }))
153
132
  });
154
133
  }
155
-
156
134
  return /*#__PURE__*/_jsx(ThemeProvider, {
157
135
  theme: {
158
136
  mode: mode
@@ -2,6 +2,7 @@ import { CSSObject } from '@codecademy/variance';
2
2
  import { EmotionCache, Theme } from '@emotion/react';
3
3
  import * as React from 'react';
4
4
  export interface GamutProviderProps {
5
+ children?: React.ReactNode;
5
6
  useGlobals?: boolean;
6
7
  useCache?: boolean;
7
8
  theme: Theme;
@@ -15,28 +15,26 @@ export var GamutContext = /*#__PURE__*/React.createContext({
15
15
  GamutContext.displayName = 'GamutContext';
16
16
  export var GamutProvider = function GamutProvider(_ref) {
17
17
  var children = _ref.children,
18
- cache = _ref.cache,
19
- _ref$theme = _ref.theme,
20
- theme = _ref$theme === void 0 ? coreTheme : _ref$theme,
21
- variables = _ref.variables,
22
- _ref$useGlobals = _ref.useGlobals,
23
- useGlobals = _ref$useGlobals === void 0 ? true : _ref$useGlobals,
24
- _ref$useCache = _ref.useCache,
25
- useCache = _ref$useCache === void 0 ? true : _ref$useCache;
26
-
18
+ cache = _ref.cache,
19
+ _ref$theme = _ref.theme,
20
+ theme = _ref$theme === void 0 ? coreTheme : _ref$theme,
21
+ variables = _ref.variables,
22
+ _ref$useGlobals = _ref.useGlobals,
23
+ useGlobals = _ref$useGlobals === void 0 ? true : _ref$useGlobals,
24
+ _ref$useCache = _ref.useCache,
25
+ useCache = _ref$useCache === void 0 ? true : _ref$useCache;
27
26
  var _useContext = useContext(GamutContext),
28
- hasGlobals = _useContext.hasGlobals,
29
- hasCache = _useContext.hasCache;
30
-
27
+ hasGlobals = _useContext.hasGlobals,
28
+ hasCache = _useContext.hasCache;
31
29
  var shouldCreateCache = useCache && !hasCache;
32
- var shouldInsertGlobals = useGlobals && !hasGlobals; // Do not initialize a new cache if one has been provided as props
30
+ var shouldInsertGlobals = useGlobals && !hasGlobals;
33
31
 
32
+ // Do not initialize a new cache if one has been provided as props
34
33
  var activeCache = useRef(shouldCreateCache && (cache !== null && cache !== void 0 ? cache : createEmotionCache()));
35
34
  var contextValue = {
36
35
  hasGlobals: shouldInsertGlobals,
37
36
  hasCache: shouldCreateCache
38
37
  };
39
-
40
38
  var globals = shouldInsertGlobals && /*#__PURE__*/_jsxs(_Fragment, {
41
39
  children: [/*#__PURE__*/_jsx(Typography, {}), /*#__PURE__*/_jsx(Reboot, {}), /*#__PURE__*/_jsx(Variables, {
42
40
  variables: theme._variables
@@ -44,7 +42,6 @@ export var GamutProvider = function GamutProvider(_ref) {
44
42
  variables: variables
45
43
  })]
46
44
  });
47
-
48
45
  if (activeCache.current) {
49
46
  return /*#__PURE__*/_jsx(GamutContext.Provider, {
50
47
  value: contextValue,
@@ -57,7 +54,6 @@ export var GamutProvider = function GamutProvider(_ref) {
57
54
  })
58
55
  });
59
56
  }
60
-
61
57
  return /*#__PURE__*/_jsxs(GamutContext.Provider, {
62
58
  value: contextValue,
63
59
  children: [globals, /*#__PURE__*/_jsx(ThemeProvider, {
@@ -1,4 +1,4 @@
1
1
  import { Options } from '@emotion/cache';
2
2
  export declare const EMOTION_KEY = "gamut";
3
3
  export declare const EMOTION_CONTAINER = "emotion-styles";
4
- export declare const createEmotionCache: (overrides?: Partial<Options> | undefined) => import("@emotion/cache").EmotionCache;
4
+ export declare const createEmotionCache: (overrides?: Partial<Options> | undefined) => import("@emotion/utils").EmotionCache;
@@ -1,44 +1,32 @@
1
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
-
3
2
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
-
13
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
-
15
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
-
17
9
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
-
19
10
  import createCache from '@emotion/cache';
20
11
  import { prefixer } from 'stylis';
21
12
  import { focusVisible } from './stylisPlugins';
22
13
  export var EMOTION_KEY = 'gamut';
23
14
  export var EMOTION_CONTAINER = 'emotion-styles';
24
-
25
15
  var getEmotionNode = function getEmotionNode() {
26
16
  if (typeof document === 'undefined') {
27
17
  return;
28
18
  }
29
-
30
19
  var node = document.getElementById(EMOTION_CONTAINER);
31
20
  if (node) return node;
32
21
  node = document.createElement('div');
33
- node.setAttribute('id', EMOTION_CONTAINER); // if this has not been created add it to the DOM at the top of the body
22
+ node.setAttribute('id', EMOTION_CONTAINER);
34
23
 
24
+ // if this has not been created add it to the DOM at the top of the body
35
25
  document.getElementsByTagName('body')[0].prepend(node);
36
26
  return node;
37
27
  };
38
-
39
28
  export var createEmotionCache = function createEmotionCache(overrides) {
40
29
  var _overrides$container, _overrides$stylisPlug;
41
-
42
30
  return createCache(_objectSpread(_objectSpread({
43
31
  key: EMOTION_KEY,
44
32
  speedy: process.env.NODE_ENV !== 'development',
@@ -5,6 +5,5 @@ export var focusVisible = function focusVisible(element) {
5
5
  return selector + prop.replace(/:focus-visible/g, '[data-focus-visible-added]');
6
6
  });
7
7
  }
8
-
9
8
  return undefined;
10
9
  };
@@ -3,17 +3,17 @@ import { webFonts } from '../remoteAssets/fonts';
3
3
  import { coreTheme as theme } from '../themes';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  var fontSize = theme.fontSize,
6
- spacing = theme.spacing,
7
- fontWeight = theme.fontWeight,
8
- lineHeight = theme.lineHeight;
6
+ spacing = theme.spacing,
7
+ fontWeight = theme.fontWeight,
8
+ lineHeight = theme.lineHeight;
9
9
  var typographyGlobals = /*#__PURE__*/css(webFonts.map(function (_ref) {
10
10
  var name = _ref.name,
11
- _ref$style = _ref.style,
12
- style = _ref$style === void 0 ? 'normal' : _ref$style,
13
- _ref$weight = _ref.weight,
14
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
15
- extensions = _ref.extensions,
16
- filePath = _ref.filePath;
11
+ _ref$style = _ref.style,
12
+ style = _ref$style === void 0 ? 'normal' : _ref$style,
13
+ _ref$weight = _ref.weight,
14
+ weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
15
+ extensions = _ref.extensions,
16
+ filePath = _ref.filePath;
17
17
  return /*#__PURE__*/css("@font-face{font-display:swap;font-family:'", name, "';font-style:", style, ";font-weight:", weight, ";src:", extensions.map(function (ext) {
18
18
  return "url(\"".concat(filePath, ".").concat(ext, "\") format(\"").concat(ext, "\")");
19
19
  }).join(', '), ";};label:typographyGlobals;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWxzL1R5cG9ncmFwaHkudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVhIiwiZmlsZSI6Ii4uLy4uL3NyYy9nbG9iYWxzL1R5cG9ncmFwaHkudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBHbG9iYWwgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7IHdlYkZvbnRzIH0gZnJvbSAnLi4vcmVtb3RlQXNzZXRzL2ZvbnRzJztcbmltcG9ydCB7IGNvcmVUaGVtZSBhcyB0aGVtZSB9IGZyb20gJy4uL3RoZW1lcyc7XG5cbmNvbnN0IHsgZm9udFNpemUsIHNwYWNpbmcsIGZvbnRXZWlnaHQsIGxpbmVIZWlnaHQgfSA9IHRoZW1lO1xuXG5jb25zdCB0eXBvZ3JhcGh5R2xvYmFscyA9IGNzc2BcbiAgJHt3ZWJGb250cy5tYXAoXG4gICAgKHtcbiAgICAgIG5hbWUsXG4gICAgICBzdHlsZSA9ICdub3JtYWwnLFxuICAgICAgd2VpZ2h0ID0gJ25vcm1hbCcsXG4gICAgICBleHRlbnNpb25zLFxuICAgICAgZmlsZVBhdGgsXG4gICAgfSkgPT4gY3NzYFxuICAgICAgQGZvbnQtZmFjZSB7XG4gICAgICAgIGZvbnQtZGlzcGxheTogc3dhcDtcbiAgICAgICAgZm9udC1mYW1pbHk6ICcke25hbWV9JztcbiAgICAgICAgZm9udC1zdHlsZTogJHtzdHlsZX07XG4gICAgICAgIGZvbnQtd2VpZ2h0OiAke3dlaWdodH07XG4gICAgICAgIHNyYzogJHtleHRlbnNpb25zXG4gICAgICAgICAgLm1hcCgoZXh0KSA9PiBgdXJsKFwiJHtmaWxlUGF0aH0uJHtleHR9XCIpIGZvcm1hdChcIiR7ZXh0fVwiKWApXG4gICAgICAgICAgLmpvaW4oJywgJyl9O1xuICAgICAgfVxuICAgIGBcbiAgKX1cblxuICBoMSxcbiAgaDIsXG4gIGgzLFxuICBoNCxcbiAgaDUsXG4gIGg2IHtcbiAgICBtYXJnaW4tYm90dG9tOiAke3NwYWNpbmdbMTZdfTtcbiAgICBmb250LXdlaWdodDogJHtmb250V2VpZ2h0LnRpdGxlfTtcbiAgICBsaW5lLWhlaWdodDogJHtsaW5lSGVpZ2h0LnRpdGxlfTtcbiAgfVxuXG4gIGgxIHtcbiAgICBmb250LXNpemU6ICR7Zm9udFNpemVbNjRdfTtcbiAgfVxuICBoMiB7XG4gICAgZm9udC1zaXplOiAke2ZvbnRTaXplWzQ0XX07XG4gIH1cbiAgaDMge1xuICAgIGZvbnQtc2l6ZTogJHtmb250U2l6ZVszNF19O1xuICB9XG4gIGg0IHtcbiAgICBmb250LXNpemU6ICR7Zm9udFNpemVbMjZdfTtcbiAgfVxuICBoNSB7XG4gICAgZm9udC1zaXplOiAke2ZvbnRTaXplWzIyXX07XG4gIH1cbiAgaDYge1xuICAgIGZvbnQtc2l6ZTogJHtmb250U2l6ZVsyMF19O1xuICB9XG5cbiAgc21hbGwge1xuICAgIGZvbnQtc2l6ZTogJHtmb250U2l6ZVsxNF19O1xuICAgIGZvbnQtd2VpZ2h0OiAke2ZvbnRXZWlnaHQuYmFzZX07XG4gIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBUeXBvZ3JhcGh5ID0gKCkgPT4gPEdsb2JhbCBzdHlsZXM9e3R5cG9ncmFwaHlHbG9iYWxzfSAvPjtcbiJdfQ== */"));
@@ -1,35 +1,25 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
5
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
-
15
8
  import { css, Global } from '@emotion/react';
16
9
  import * as React from 'react';
17
10
  import { jsx as _jsx } from "react/jsx-runtime";
18
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
19
-
20
12
  var scopeVariables = function scopeVariables(vars) {
21
13
  var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ':root';
22
14
  return /*#__PURE__*/css(_defineProperty({}, scope, vars), ";label:scopeVariables;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWxzL1ZhcmlhYmxlcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0UiLCJmaWxlIjoiLi4vLi4vc3JjL2dsb2JhbHMvVmFyaWFibGVzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENTU09iamVjdCB9IGZyb20gJ0Bjb2RlY2FkZW15L3ZhcmlhbmNlJztcbmltcG9ydCB7IGNzcywgR2xvYmFsIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5jb25zdCBzY29wZVZhcmlhYmxlcyA9ICh2YXJzOiBDU1NPYmplY3QsIHNjb3BlID0gJzpyb290JykgPT5cbiAgY3NzKHsgW3Njb3BlXTogdmFycyB9KTtcblxuZXhwb3J0IGNvbnN0IFZhcmlhYmxlczogUmVhY3QuRkM8e1xuICB2YXJpYWJsZXM6IFJlY29yZDxzdHJpbmcsIENTU09iamVjdD47XG59PiA9ICh7IHZhcmlhYmxlcyB9KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPD5cbiAgICAgIHtPYmplY3QuZW50cmllcyh2YXJpYWJsZXMpLm1hcCgoW2tleSwgdmFyc10pID0+IChcbiAgICAgICAgPEdsb2JhbCBrZXk9e2tleX0gc3R5bGVzPXtzY29wZVZhcmlhYmxlcyh2YXJzKX0gLz5cbiAgICAgICkpfVxuICAgIDwvPlxuICApO1xufTtcbiJdfQ== */"));
23
15
  };
24
-
25
16
  export var Variables = function Variables(_ref) {
26
17
  var variables = _ref.variables;
27
18
  return /*#__PURE__*/_jsx(_Fragment, {
28
19
  children: Object.entries(variables).map(function (_ref2) {
29
20
  var _ref3 = _slicedToArray(_ref2, 2),
30
- key = _ref3[0],
31
- vars = _ref3[1];
32
-
21
+ key = _ref3[0],
22
+ vars = _ref3[1];
33
23
  return /*#__PURE__*/_jsx(Global, {
34
24
  styles: scopeVariables(vars)
35
25
  }, key);
@@ -22,5 +22,5 @@ declare const shadowsForDepth: {
22
22
  };
23
23
  };
24
24
  export declare const createShadow: (depth: ShadowDepth) => string;
25
- export declare const boxShadow: (depth?: ShadowDepth) => import("@emotion/react").SerializedStyles;
25
+ export declare const boxShadow: (depth?: ShadowDepth) => import("@emotion/utils").SerializedStyles;
26
26
  export {};
@@ -1,15 +1,9 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
5
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import { css } from '@emotion/react';
14
8
  var shadowsForDepth = {
15
9
  1: {
@@ -35,15 +29,14 @@ var shadowsForDepth = {
35
29
  };
36
30
  export var createShadow = function createShadow(depth) {
37
31
  var _shadowsForDepth$dept = shadowsForDepth[depth],
38
- _shadowsForDepth$dept2 = _slicedToArray(_shadowsForDepth$dept.offsets, 4),
39
- o1 = _shadowsForDepth$dept2[0],
40
- o2 = _shadowsForDepth$dept2[1],
41
- o3 = _shadowsForDepth$dept2[2],
42
- o4 = _shadowsForDepth$dept2[3],
43
- _shadowsForDepth$dept3 = _slicedToArray(_shadowsForDepth$dept.shades, 2),
44
- s1 = _shadowsForDepth$dept3[0],
45
- s2 = _shadowsForDepth$dept3[1];
46
-
32
+ _shadowsForDepth$dept2 = _slicedToArray(_shadowsForDepth$dept.offsets, 4),
33
+ o1 = _shadowsForDepth$dept2[0],
34
+ o2 = _shadowsForDepth$dept2[1],
35
+ o3 = _shadowsForDepth$dept2[2],
36
+ o4 = _shadowsForDepth$dept2[3],
37
+ _shadowsForDepth$dept3 = _slicedToArray(_shadowsForDepth$dept.shades, 2),
38
+ s1 = _shadowsForDepth$dept3[0],
39
+ s2 = _shadowsForDepth$dept3[1];
47
40
  return " 0 ".concat(o1, "px ").concat(o2, "px rgba(0, 0, 0, ").concat(s1, "),\n 0 ").concat(o3, "px ").concat(o4, "px rgba(0, 0, 0, ").concat(s2, ")");
48
41
  };
49
42
  export var boxShadow = function boxShadow() {
@@ -1 +1 @@
1
- export declare const noSelect: import("@emotion/react").SerializedStyles;
1
+ export declare const noSelect: import("@emotion/utils").SerializedStyles;
@@ -1,5 +1,4 @@
1
1
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
-
3
2
  import { css } from '@emotion/react';
4
3
  export var noSelect = process.env.NODE_ENV === "production" ? {
5
4
  name: "1ui1tha-noSelect",
@@ -1,2 +1,2 @@
1
- export declare const screenReaderOnly: import("@emotion/react").SerializedStyles;
2
- export declare const screenReaderOnlyFocusable: import("@emotion/react").SerializedStyles;
1
+ export declare const screenReaderOnly: import("@emotion/utils").SerializedStyles;
2
+ export declare const screenReaderOnlyFocusable: import("@emotion/utils").SerializedStyles;
@@ -1,5 +1,4 @@
1
1
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
-
3
2
  import { css } from '@emotion/react';
4
3
  export var screenReaderOnly = process.env.NODE_ENV === "production" ? {
5
4
  name: "ut38oz-screenReaderOnly",
@@ -1,5 +1,6 @@
1
1
  import { createTheme } from '@codecademy/variance';
2
2
  import { corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing } from '../variables';
3
+
3
4
  /**
4
5
  * @description This is the core theme that all other Codecademy themes are extended from
5
6
  * and is the only theme that gamut components are typed to. This ensures that gamut components
@@ -1,6 +1,7 @@
1
1
  import { createTheme } from '@codecademy/variance';
2
2
  import { platformPalette } from '../variables';
3
3
  import { coreTheme } from './core';
4
+
4
5
  /**
5
6
  * @description This is an extended theme for the learning environment with an expanded set of tokens
6
7
  * That are not needed for the rest of the application.
@@ -1,4 +1,5 @@
1
1
  import { get } from 'lodash';
2
+
2
3
  /**
3
4
  * Creates a function that will look up the a design token from the `theme` context of a
4
5
  * tyled component or a component that accepts theme as a prop.
@@ -1,9 +1,6 @@
1
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
2
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
4
  import { flattenScale } from '@codecademy/variance';
8
5
  import { rgba } from 'polished';
9
6
  /**
@@ -105,6 +102,7 @@ export var trueColors = {
105
102
  white: white
106
103
  };
107
104
  export var corePalette = _objectSpread(_objectSpread(_objectSpread({}, flattenScale(coreSwatches)), flattenScale(effects)), trueColors);
105
+
108
106
  /**
109
107
  * Platform Colors
110
108
  */
@@ -1,13 +1,11 @@
1
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
2
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
4
  import { flattenScale } from '@codecademy/variance';
8
5
  import { corePalette } from './colors';
9
6
  var black = corePalette.black,
10
- white = corePalette.white;
7
+ white = corePalette.white;
8
+
11
9
  /**
12
10
  * @deprecated
13
11
  * Using these variables directly is no longer supported.
@@ -19,6 +17,7 @@ export var interactiveColors = {
19
17
  dark: corePalette.hyper,
20
18
  light: corePalette.yellow
21
19
  };
20
+
22
21
  /**
23
22
  * @deprecated
24
23
  * Using these variables directly is no longer supported.
@@ -36,6 +35,7 @@ export var editorColors = {
36
35
  red: '#ea6c8b',
37
36
  yellow: '#ffe083'
38
37
  };
38
+
39
39
  /**
40
40
  * @deprecated
41
41
  * Using these variables directly is no longer supported.
@@ -60,6 +60,7 @@ export var platformColors = {
60
60
  '900': '#15141f'
61
61
  }
62
62
  };
63
+
63
64
  /**
64
65
  * @deprecated
65
66
  * Using these variables directly is no longer supported.
@@ -115,6 +116,7 @@ export var swatches = {
115
116
  '900': '#19191a'
116
117
  }
117
118
  };
119
+
118
120
  /**
119
121
  * @deprecated
120
122
  * Using these variables directly is no longer supported.
@@ -141,6 +143,7 @@ var trueColors = {
141
143
  black: black,
142
144
  white: white
143
145
  };
146
+
144
147
  /**
145
148
  * @deprecated
146
149
  * Using these variables directly is no longer supported.
@@ -3,7 +3,6 @@ export var elements = {
3
3
  base: '4rem',
4
4
  md: '5rem'
5
5
  },
6
-
7
6
  /**
8
7
  * Semi-arbitrary z-index for global page headers.
9
8
  * @remarks PLEASE talk to web platform before adding new z-index constants!
@@ -3,6 +3,6 @@ export * from './responsive';
3
3
  export * from './spacing';
4
4
  export * from './typography';
5
5
  export * from './timing';
6
- export * from './elements'; // Deprecated variables
7
-
6
+ export * from './elements';
7
+ // Deprecated variables
8
8
  export * from './deprecated-colors';
@@ -5,11 +5,9 @@ export var breakpoints = {
5
5
  lg: '1200px',
6
6
  xl: '1440px'
7
7
  };
8
-
9
8
  var createMediaQuery = function createMediaQuery(size, direction) {
10
9
  return "@media only screen and (".concat(direction, "-width: ").concat(breakpoints[size], ")");
11
10
  };
12
-
13
11
  export var mediaQueries = {
14
12
  xs: createMediaQuery('xs', 'min'),
15
13
  sm: createMediaQuery('sm', 'min'),
@@ -1,9 +1,6 @@
1
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
-
3
2
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
-
5
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
4
  import { transformSize } from '@codecademy/variance';
8
5
  export var color = {
9
6
  color: {
@@ -173,7 +170,6 @@ var selfAlignments = {
173
170
  property: 'gridArea'
174
171
  }
175
172
  };
176
-
177
173
  var alignments = _objectSpread({
178
174
  justifyContent: {
179
175
  property: 'justifyContent'
@@ -188,7 +184,6 @@ var alignments = _objectSpread({
188
184
  property: 'alignContent'
189
185
  }
190
186
  }, selfAlignments);
191
-
192
187
  var flexItems = {
193
188
  flexBasis: {
194
189
  property: 'flexBasis'
@@ -1,7 +1,7 @@
1
1
  import { variance } from '@codecademy/variance';
2
2
  import * as PROPERTIES from './config';
3
- /** General Prop Groups */
4
3
 
4
+ /** General Prop Groups */
5
5
  export var typography = variance.create(PROPERTIES.typography);
6
6
  export var grid = variance.create(PROPERTIES.grid);
7
7
  export var flex = variance.create(PROPERTIES.flex);
@@ -12,12 +12,12 @@ export var color = variance.create(PROPERTIES.color);
12
12
  export var shadow = variance.create(PROPERTIES.shadows);
13
13
  export var space = variance.create(PROPERTIES.space);
14
14
  export var border = variance.create(PROPERTIES.border);
15
- /** Sub Groups */
16
15
 
16
+ /** Sub Groups */
17
17
  export var padding = variance.create(PROPERTIES.padding);
18
18
  export var margin = variance.create(PROPERTIES.margin);
19
- /** CSS */
20
19
 
20
+ /** CSS */
21
21
  export var css = variance.createCss(PROPERTIES.all);
22
22
  export var variant = variance.createVariant(PROPERTIES.all);
23
23
  export var states = variance.createStates(PROPERTIES.all);
@@ -24,6 +24,6 @@ export declare function createStyledOptions<El extends ElementOrProps = 'div', A
24
24
  *
25
25
  */
26
26
  export declare const styledOptions: typeof createStyledOptions & {
27
- shouldForwardProp: (prop: PropertyKey) => prop is "dir" | "slot" | "style" | "title" | "id" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>;
27
+ shouldForwardProp: (prop: PropertyKey) => prop is "dir" | "slot" | "style" | "title" | "id" | "nonce" | "property" | "translate" | "hidden" | "children" | "className" | "prefix" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLDivElement>;
28
28
  };
29
29
  export {};
@@ -1,23 +1,17 @@
1
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
-
3
2
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12
-
13
7
  import isPropValid from '@emotion/is-prop-valid';
14
8
  import { all as allProps } from './config';
15
9
  var allPropnames = ['mode', 'variant'].concat(_toConsumableArray(Object.keys(allProps)));
10
+
16
11
  /**
17
12
  * Emotion will not attempt to forward all system props - so this pre filters all possible exceptions to search agains
18
13
  * props like `color` and `width`.
19
14
  */
20
-
21
15
  var validPropnames = allPropnames.filter(isPropValid);
22
16
  export function createStyledOptions() {
23
17
  var additional = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -29,6 +23,7 @@ export function createStyledOptions() {
29
23
  }
30
24
  };
31
25
  }
26
+
32
27
  /**
33
28
  * @description
34
29
  * This object can be passed to the second argument of `styled('div', styledOptions)` or be called as a function to filter additional prop names
@@ -45,5 +40,4 @@ export function createStyledOptions() {
45
40
  * styled(Box)()
46
41
  *
47
42
  */
48
-
49
43
  export var styledOptions = Object.assign(createStyledOptions, createStyledOptions());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codecademy/gamut-styles",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "14.2.5",
4
+ "version": "14.2.6-alpha.9fa786.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "url": "git@github.com:Codecademy/gamut.git"
22
22
  },
23
23
  "dependencies": {
24
- "@codecademy/variance": "0.20.5",
24
+ "@codecademy/variance": "0.20.6-alpha.9fa786.0",
25
25
  "@emotion/is-prop-valid": "^1.1.0",
26
26
  "polished": "^4.1.2"
27
27
  },
@@ -30,18 +30,17 @@
30
30
  "@emotion/react": "^11.4.0",
31
31
  "@emotion/styled": "^11.3.0",
32
32
  "lodash": "^4.17.5",
33
- "react": ">=17.0.2",
34
- "react-helmet": "^6.1.0",
33
+ "react": "^17.0.2 || ^18.2.0",
34
+ "react-helmet-async": "^1.3.0",
35
35
  "stylis": "^4.0.7"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@emotion/jest": "^11.3.0",
39
- "@types/react-helmet": "^6.1.0",
40
39
  "component-test-setup": "^0.3.1"
41
40
  },
42
41
  "license": "MIT",
43
42
  "publishConfig": {
44
43
  "access": "public"
45
44
  },
46
- "gitHead": "fe70bd1ec980feef3ecc2bbe5dd4c0b7e8453da6"
45
+ "gitHead": "bcee3f6691770960bcc8020a319325458666d8c2"
47
46
  }