@primer/components 0.0.0-2021927193941 → 0.0.0-2021927203131

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.
@@ -35,33 +35,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
35
 
36
36
  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); }
37
37
 
38
- /**
39
- * These colors are not yet in our default theme. Need to remove this once they are added.
40
- */
41
38
  const customItemThemes = {
42
39
  default: {
43
- hover: {
44
- light: 'rgba(46, 77, 108, 0.06)',
45
- dark: 'rgba(201, 206, 212, 0.12)',
46
- dark_dimmed: 'rgba(201, 206, 212, 0.12)'
47
- },
48
- focus: {
49
- light: 'rgba(54, 77, 100, 0.16)',
50
- dark: 'rgba(201, 206, 212, 0.24)',
51
- dark_dimmed: 'rgba(201, 206, 212, 0.24)'
52
- }
40
+ hover: (0, _constants.get)('colors.neutral.subtle'),
41
+ focus: (0, _constants.get)('colors.neutral.muted')
53
42
  },
54
43
  danger: {
55
- hover: {
56
- light: 'rgba(234, 74, 90, 0.08)',
57
- dark: 'rgba(248, 81, 73, 0.16)',
58
- dark_dimmed: 'rgba(248, 81, 73, 0.16)'
59
- },
60
- focus: {
61
- light: 'rgba(234, 74, 90, 0.14)',
62
- dark: 'rgba(248, 81, 73, 0.24)',
63
- dark_dimmed: 'rgba(248, 81, 73, 0.24)'
64
- }
44
+ hover: (0, _constants.get)('colors.danger.subtle'),
45
+ focus: (0, _constants.get)('colors.danger.muted')
65
46
  }
66
47
  };
67
48
  /**
@@ -230,8 +211,8 @@ const Item = /*#__PURE__*/_react.default.forwardRef((itemProps, ref) => {
230
211
  }
231
212
  }, [onAction, disabled, itemProps, onClick]);
232
213
  const customItemTheme = customItemThemes[variant];
233
- const hoverBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.hover, 'inherit');
234
- const focusBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.focus, 'inherit');
214
+ const hoverBackground = customItemTheme.hover;
215
+ const focusBackground = customItemTheme.focus;
235
216
  const {
236
217
  theme
237
218
  } = (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
- /**
16
- * These colors are not yet in our default theme. Need to remove this once they are added.
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
  /**
@@ -197,8 +177,8 @@ export const Item = /*#__PURE__*/React.forwardRef((itemProps, ref) => {
197
177
  }
198
178
  }, [onAction, disabled, itemProps, onClick]);
199
179
  const customItemTheme = customItemThemes[variant];
200
- const hoverBackground = useColorSchemeVar(customItemTheme.hover, 'inherit');
201
- const focusBackground = useColorSchemeVar(customItemTheme.focus, 'inherit');
180
+ const hoverBackground = customItemTheme.hover;
181
+ const focusBackground = customItemTheme.focus;
202
182
  const {
203
183
  theme
204
184
  } = useTheme();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021927193941",
3
+ "version": "0.0.0-2021927203131",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -132,7 +132,6 @@
132
132
  "rollup-plugin-visualizer": "5.5.0",
133
133
  "semver": "7.3.5",
134
134
  "size-limit": "5.0.2",
135
- "storybook-addon-performance": "0.16.1",
136
135
  "styled-components": "4.4.1",
137
136
  "typescript": "4.2.2"
138
137
  },