@primer/components 0.0.0-202183011441 → 0.0.0-202183053931

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.
@@ -36,33 +36,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
36
36
 
37
37
  function _extends() { _extends = Object.assign || 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); }
38
38
 
39
- /**
40
- * These colors are not yet in our default theme. Need to remove this once they are added.
41
- */
42
39
  const customItemThemes = {
43
40
  default: {
44
- hover: {
45
- light: 'rgba(46, 77, 108, 0.06)',
46
- dark: 'rgba(201, 206, 212, 0.12)',
47
- dark_dimmed: 'rgba(201, 206, 212, 0.12)'
48
- },
49
- focus: {
50
- light: 'rgba(54, 77, 100, 0.16)',
51
- dark: 'rgba(201, 206, 212, 0.24)',
52
- dark_dimmed: 'rgba(201, 206, 212, 0.24)'
53
- }
41
+ hover: (0, _constants.get)('colors.neutral.subtle'),
42
+ focus: (0, _constants.get)('colors.neutral.muted')
54
43
  },
55
44
  danger: {
56
- hover: {
57
- light: 'rgba(234, 74, 90, 0.08)',
58
- dark: 'rgba(248, 81, 73, 0.16)',
59
- dark_dimmed: 'rgba(248, 81, 73, 0.16)'
60
- },
61
- focus: {
62
- light: 'rgba(234, 74, 90, 0.14)',
63
- dark: 'rgba(248, 81, 73, 0.24)',
64
- dark_dimmed: 'rgba(248, 81, 73, 0.24)'
65
- }
45
+ hover: (0, _constants.get)('colors.danger.subtle'),
46
+ focus: (0, _constants.get)('colors.danger.muted')
66
47
  }
67
48
  };
68
49
  /**
@@ -229,8 +210,8 @@ function Item(itemProps) {
229
210
  }
230
211
  }, [onAction, disabled, itemProps, onClick]);
231
212
  const customItemTheme = customItemThemes[variant];
232
- const hoverBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.hover, 'inherit');
233
- const focusBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.focus, 'inherit');
213
+ const hoverBackground = customItemTheme.hover;
214
+ const focusBackground = customItemTheme.focus;
234
215
  const {
235
216
  theme
236
217
  } = (0, _ThemeProvider.useTheme)();
@@ -8,37 +8,17 @@ import Truncate from '../Truncate';
8
8
  import styled from 'styled-components';
9
9
  import { StyledHeader } from './Header';
10
10
  import { StyledDivider } from './Divider';
11
- import { useColorSchemeVar, useTheme } from '../ThemeProvider';
11
+ import { useTheme } from '../ThemeProvider';
12
12
  import { activeDescendantActivatedDirectly, activeDescendantActivatedIndirectly, isActiveDescendantAttribute } from '../behaviors/focusZone';
13
13
  import { useSSRSafeId } from '@react-aria/ssr';
14
- /**
15
- * These colors are not yet in our default theme. Need to remove this once they are added.
16
- */
17
-
18
14
  const customItemThemes = {
19
15
  default: {
20
- hover: {
21
- light: 'rgba(46, 77, 108, 0.06)',
22
- dark: 'rgba(201, 206, 212, 0.12)',
23
- dark_dimmed: 'rgba(201, 206, 212, 0.12)'
24
- },
25
- focus: {
26
- light: 'rgba(54, 77, 100, 0.16)',
27
- dark: 'rgba(201, 206, 212, 0.24)',
28
- dark_dimmed: 'rgba(201, 206, 212, 0.24)'
29
- }
16
+ hover: get('colors.neutral.subtle'),
17
+ focus: get('colors.neutral.muted')
30
18
  },
31
19
  danger: {
32
- hover: {
33
- light: 'rgba(234, 74, 90, 0.08)',
34
- dark: 'rgba(248, 81, 73, 0.16)',
35
- dark_dimmed: 'rgba(248, 81, 73, 0.16)'
36
- },
37
- focus: {
38
- light: 'rgba(234, 74, 90, 0.14)',
39
- dark: 'rgba(248, 81, 73, 0.24)',
40
- dark_dimmed: 'rgba(248, 81, 73, 0.24)'
41
- }
20
+ hover: get('colors.danger.subtle'),
21
+ focus: get('colors.danger.muted')
42
22
  }
43
23
  };
44
24
  /**
@@ -195,8 +175,8 @@ export function Item(itemProps) {
195
175
  }
196
176
  }, [onAction, disabled, itemProps, onClick]);
197
177
  const customItemTheme = customItemThemes[variant];
198
- const hoverBackground = useColorSchemeVar(customItemTheme.hover, 'inherit');
199
- const focusBackground = useColorSchemeVar(customItemTheme.focus, 'inherit');
178
+ const hoverBackground = customItemTheme.hover;
179
+ const focusBackground = customItemTheme.focus;
200
180
  const {
201
181
  theme
202
182
  } = useTheme();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-202183011441",
3
+ "version": "0.0.0-202183053931",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -72,7 +72,7 @@
72
72
  "@changesets/cli": "2.17.0",
73
73
  "@github/prettier-config": "0.0.4",
74
74
  "@rollup/plugin-commonjs": "19.0.2",
75
- "@rollup/plugin-node-resolve": "13.0.0",
75
+ "@rollup/plugin-node-resolve": "13.0.5",
76
76
  "@size-limit/preset-big-lib": "5.0.2",
77
77
  "@storybook/addon-a11y": "6.3.4",
78
78
  "@storybook/addon-actions": "^6.2.9",
@@ -81,7 +81,7 @@
81
81
  "@storybook/react": "6.3.8",
82
82
  "@testing-library/dom": "7.31.2",
83
83
  "@testing-library/react": "11.2.7",
84
- "@testing-library/react-hooks": "7.0.0",
84
+ "@testing-library/react-hooks": "7.0.2",
85
85
  "@testing-library/user-event": "13.1.9",
86
86
  "@types/chroma-js": "2.1.3",
87
87
  "@types/enzyme": "3.10.9",
@@ -111,7 +111,7 @@
111
111
  "eslint-plugin-jsx-a11y": "6.4.1",
112
112
  "eslint-plugin-mdx": "1.15.1",
113
113
  "eslint-plugin-prettier": "3.4.0",
114
- "eslint-plugin-primer-react": "0.4.2",
114
+ "eslint-plugin-primer-react": "0.5.0",
115
115
  "eslint-plugin-react": "7.24.0",
116
116
  "eslint-plugin-react-hooks": "4.2.0",
117
117
  "jest": "27.0.4",