@codecademy/gamut-styles 17.9.1-alpha.2ea313.0 → 17.9.1-alpha.3e8b72.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.
Files changed (86) hide show
  1. package/package.json +3 -3
  2. package/dist/AssetProvider.d.ts +0 -2
  3. package/dist/AssetProvider.js +0 -20
  4. package/dist/Background.d.ts +0 -6
  5. package/dist/Background.js +0 -66
  6. package/dist/ColorMode.d.ts +0 -1312
  7. package/dist/ColorMode.js +0 -134
  8. package/dist/GamutProvider.d.ts +0 -23
  9. package/dist/GamutProvider.js +0 -64
  10. package/dist/cache/createEmotionCache.d.ts +0 -4
  11. package/dist/cache/createEmotionCache.js +0 -25
  12. package/dist/cache/index.d.ts +0 -1
  13. package/dist/cache/index.js +0 -1
  14. package/dist/cache/stylisPlugins/focusVisible.d.ts +0 -2
  15. package/dist/cache/stylisPlugins/focusVisible.js +0 -10
  16. package/dist/cache/stylisPlugins/index.d.ts +0 -1
  17. package/dist/cache/stylisPlugins/index.js +0 -1
  18. package/dist/globals/Reboot.d.ts +0 -1
  19. package/dist/globals/Reboot.js +0 -7
  20. package/dist/globals/Typography.d.ts +0 -1
  21. package/dist/globals/Typography.js +0 -20
  22. package/dist/globals/Variables.d.ts +0 -5
  23. package/dist/globals/Variables.js +0 -15
  24. package/dist/globals/index.d.ts +0 -2
  25. package/dist/globals/index.js +0 -2
  26. package/dist/index.d.ts +0 -13
  27. package/dist/index.js +0 -13
  28. package/dist/remoteAssets/fonts.d.ts +0 -26
  29. package/dist/remoteAssets/fonts.js +0 -34
  30. package/dist/styles/boxShadow.d.ts +0 -26
  31. package/dist/styles/boxShadow.js +0 -34
  32. package/dist/styles/fontSmoothing.d.ts +0 -29
  33. package/dist/styles/fontSmoothing.js +0 -27
  34. package/dist/styles/index.d.ts +0 -7
  35. package/dist/styles/index.js +0 -7
  36. package/dist/styles/noSelect.d.ts +0 -1
  37. package/dist/styles/noSelect.js +0 -11
  38. package/dist/styles/pxRem.d.ts +0 -1
  39. package/dist/styles/pxRem.js +0 -4
  40. package/dist/styles/responsive.d.ts +0 -6
  41. package/dist/styles/responsive.js +0 -12
  42. package/dist/styles/screenReaderOnly.d.ts +0 -2
  43. package/dist/styles/screenReaderOnly.js +0 -20
  44. package/dist/styles/transitionConcat.d.ts +0 -3
  45. package/dist/styles/transitionConcat.js +0 -6
  46. package/dist/themes/admin.d.ts +0 -966
  47. package/dist/themes/admin.js +0 -15
  48. package/dist/themes/core.d.ts +0 -519
  49. package/dist/themes/core.js +0 -132
  50. package/dist/themes/index.d.ts +0 -4
  51. package/dist/themes/index.js +0 -4
  52. package/dist/themes/lxStudio.d.ts +0 -1080
  53. package/dist/themes/lxStudio.js +0 -54
  54. package/dist/themes/platform.d.ts +0 -1157
  55. package/dist/themes/platform.js +0 -78
  56. package/dist/typings/theme.d.ts +0 -6
  57. package/dist/utilities/index.d.ts +0 -1
  58. package/dist/utilities/index.js +0 -1
  59. package/dist/utilities/themed.d.ts +0 -14
  60. package/dist/utilities/themed.js +0 -16
  61. package/dist/variables/borderRadii.d.ts +0 -8
  62. package/dist/variables/borderRadii.js +0 -8
  63. package/dist/variables/colors.d.ts +0 -310
  64. package/dist/variables/colors.js +0 -170
  65. package/dist/variables/deprecated-colors.d.ts +0 -156
  66. package/dist/variables/deprecated-colors.js +0 -156
  67. package/dist/variables/elements.d.ts +0 -11
  68. package/dist/variables/elements.js +0 -11
  69. package/dist/variables/index.d.ts +0 -8
  70. package/dist/variables/index.js +0 -9
  71. package/dist/variables/responsive.d.ts +0 -28
  72. package/dist/variables/responsive.js +0 -28
  73. package/dist/variables/spacing.d.ts +0 -13
  74. package/dist/variables/spacing.js +0 -14
  75. package/dist/variables/timing.d.ts +0 -12
  76. package/dist/variables/timing.js +0 -12
  77. package/dist/variables/typography.d.ts +0 -32
  78. package/dist/variables/typography.js +0 -39
  79. package/dist/variance/config.d.ts +0 -1052
  80. package/dist/variance/config.js +0 -514
  81. package/dist/variance/index.d.ts +0 -3
  82. package/dist/variance/index.js +0 -3
  83. package/dist/variance/props.d.ts +0 -1963
  84. package/dist/variance/props.js +0 -24
  85. package/dist/variance/utils.d.ts +0 -29
  86. package/dist/variance/utils.js +0 -34
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@codecademy/gamut-styles",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "17.9.1-alpha.2ea313.0",
4
+ "version": "17.9.1-alpha.3e8b72.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/variance": "0.24.1-alpha.2ea313.0",
7
+ "@codecademy/variance": "0.24.1-alpha.3e8b72.0",
8
8
  "@emotion/is-prop-valid": "^1.1.0",
9
9
  "polished": "^4.1.2"
10
10
  },
@@ -34,5 +34,5 @@
34
34
  "scripts": {
35
35
  "build": "nx build @codecademy/gamut-styles"
36
36
  },
37
- "gitHead": "00defd5b4502540be2284c18a8d5476485be7974"
37
+ "gitHead": "3eab6a6745552c0c03fb049875d22255f5a34a13"
38
38
  }
@@ -1,2 +0,0 @@
1
- export declare const createFontLinks: () => import("react/jsx-runtime").JSX.Element[];
2
- export declare const AssetProvider: () => import("react/jsx-runtime").JSX.Element;
@@ -1,20 +0,0 @@
1
- import { webFonts } from './remoteAssets/fonts';
2
-
3
- /*
4
- * Only preload woff2 fonts, since woff1 are only included as fallbacks.
5
- */
6
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
7
- export const createFontLinks = () => webFonts.filter(f => f.extensions.includes('woff2')).map(({
8
- filePath
9
- }) => /*#__PURE__*/_jsx("link", {
10
- as: "font",
11
- crossOrigin: "anonymous",
12
- href: `${filePath}.woff2`,
13
- rel: "preload",
14
- type: "font/woff2"
15
- }, filePath));
16
- export const AssetProvider = () => {
17
- return /*#__PURE__*/_jsx(_Fragment, {
18
- children: createFontLinks()
19
- });
20
- };
@@ -1,6 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- import { ColorMode, Colors } from './ColorMode';
3
- export interface BackgroundProps extends Omit<ComponentProps<typeof ColorMode>, 'mode' | 'alwaysSetVariables' | 'bg'> {
4
- bg: Colors;
5
- }
6
- export declare const Background: import("react").ForwardRefExoticComponent<Omit<BackgroundProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,66 +0,0 @@
1
- import { getContrast } from 'polished';
2
- import { forwardRef, useCallback, useMemo } from 'react';
3
- import { ColorMode, useColorModes } from './ColorMode';
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- const isColorAlias = (mode, color) => {
6
- return Object.keys(mode).includes(color);
7
- };
8
- export const Background = /*#__PURE__*/forwardRef(({
9
- bg,
10
- ...rest
11
- }, ref) => {
12
- const [active, activeColors, modes, getColorValue] = useColorModes();
13
-
14
- /** If a color alias was used then look up the true color key from the active mode */
15
- const trueColor = useMemo(() => {
16
- if (isColorAlias(activeColors, bg)) {
17
- return activeColors[bg];
18
- }
19
- return bg;
20
- }, [bg, activeColors]);
21
- const getTextContrast = useCallback(foreground => {
22
- return getContrast(getColorValue(foreground), getColorValue(trueColor));
23
- }, [trueColor, getColorValue]);
24
-
25
- /**
26
- * This compares the contrast of the selected background color
27
- * and each color modes body text and returns the mode that has
28
- * the highest contrast standard. This is not perfect as it is
29
- * probable that certain color modes will never be reachable if
30
- * there are more than 2 color modes.
31
- *
32
- * This does not guarantee a level of A/AA/AA compliance.
33
- */
34
-
35
- const accessibleMode = useMemo(() => {
36
- const {
37
- [active]: activeMode,
38
- ...otherModes
39
- } = modes;
40
- const possibleModes = Object.entries(otherModes);
41
-
42
- /**
43
- * Reduce all remaining modes to the mode key with the highest contrast
44
- * value.
45
- *
46
- * TODO: Add a tiebreaker. This could possibly have other dimensions as
47
- * it will likely fail to return a mode outside of the lightest and
48
- * darkest versions.
49
- */
50
- const [highestContrastMode] = possibleModes.reduce(([prevMode, prevContrast], [mode, {
51
- text
52
- }]) => {
53
- const contrast = getTextContrast(text);
54
-
55
- // Keep the higher contrast mode.
56
- return contrast > prevContrast ? [mode, contrast] : [prevMode, prevContrast];
57
- }, [active, getTextContrast(activeMode.text)]);
58
- return highestContrastMode;
59
- }, [modes, active, getTextContrast]);
60
- return /*#__PURE__*/_jsx(ColorMode, {
61
- ...rest,
62
- bg: bg,
63
- mode: accessibleMode,
64
- ref: ref
65
- });
66
- });