@t2ca/gatsby-theme-showcase 1.0.88 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "prettier",
8
8
  "prettier/react"
9
9
  ],
10
- "plugins": ["react", "react-hooks", "import", "jsx-a11y", "emotion"],
10
+ "plugins": ["react", "react-hooks", "import", "jsx-a11y", "@emotion"],
11
11
  "parser": "babel-eslint",
12
12
  "parserOptions": {
13
13
  "ecmaVersion": 2018,
@@ -29,7 +29,10 @@
29
29
  "rules": {
30
30
  "react-hooks/rules-of-hooks": "error",
31
31
  "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
32
- "jsx-a11y/anchor-is-valid": ["error", { "components": ["Link"], "specialLink": ["to"] }],
32
+ "jsx-a11y/anchor-is-valid": [
33
+ "error",
34
+ { "components": ["Link"], "specialLink": ["to"] }
35
+ ],
33
36
  "no-console": "off",
34
37
  "react/prop-types": [0],
35
38
  "react/display-name": [0]
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@t2ca/gatsby-theme-showcase",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "devDependencies": {
7
+ "@emotion/eslint-plugin": "^11.0.0",
7
8
  "babel-eslint": "^10.0.2",
8
9
  "eslint": "^7.0.0",
9
10
  "eslint-config-prettier": "^6.0.0",
10
- "eslint-plugin-emotion": "^11.0.0",
11
11
  "eslint-plugin-graphql": "^4.0.0",
12
12
  "eslint-plugin-import": "^2.18.0",
13
13
  "eslint-plugin-jsx-a11y": "^6.2.3",
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import styled from "@emotion/styled"
3
- import { useColorMode } from "theme-ui"
3
+ import { useThemeUI } from "theme-ui"
4
4
 
5
5
  const IconWrapper = styled.button`
6
6
  padding: 0;
@@ -87,7 +87,8 @@ const MoonMask = styled.div`
87
87
  `
88
88
 
89
89
  const ColorModeToggle = () => {
90
- const [colorMode, setColorMode] = useColorMode()
90
+ const context = useThemeUI()
91
+ const { theme, colorMode, setColorMode } = context
91
92
  const isDark = colorMode === `dark`
92
93
 
93
94
  const toggleColorMode = (e) => {
@@ -97,13 +98,12 @@ const ColorModeToggle = () => {
97
98
 
98
99
  return (
99
100
  <IconWrapper
100
- isDark={isDark}
101
101
  onClick={toggleColorMode}
102
102
  aria-label={isDark ? `Activate light mode` : `Activate dark mode`}
103
103
  title={isDark ? `Activate light mode` : `Activate dark mode`}
104
104
  >
105
- <MoonOrSun isDark={isDark} />
106
- <MoonMask isDark={isDark} />
105
+ <MoonOrSun isDark={isDark} theme={theme} />
106
+ <MoonMask isDark={isDark} theme={theme} />
107
107
  </IconWrapper>
108
108
  )
109
109
  }
@@ -8,7 +8,12 @@ export default ({ href, type = "basic", ...props }) => {
8
8
  const isExternal = isAbsoluteURL(href || "")
9
9
  if (isExternal) {
10
10
  return (
11
- <a href={href} sx={props.styles}>
11
+ <a
12
+ href={href}
13
+ sx={props.styles}
14
+ target="_blank"
15
+ rel="noopener noreferrer"
16
+ >
12
17
  {props}
13
18
  </a>
14
19
  )
package/.babelrc DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "plugins": [
3
- [
4
- "@babel/plugin-transform-react-jsx",
5
- {
6
- // TODO: This is to handle theme-ui pragma issues: https://github.com/system-ui/theme-ui/issues/1160
7
- "throwIfNamespace": true, // defaults to true
8
- "runtime": "classic", // defaults to classic
9
- "importSource": "react" // defaults to react
10
- }
11
- ]
12
- ]
13
- }