@chronogrove/ui 0.76.0 → 0.77.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 (39) hide show
  1. package/jest.config.cjs +1 -0
  2. package/package.json +10 -1
  3. package/src/gatsby/build-theme-ui-color-mode-head-components.js +36 -0
  4. package/src/gatsby/index.js +4 -0
  5. package/src/gatsby/index.spec.js +131 -0
  6. package/src/gatsby/on-pre-render-html-sort.js +21 -0
  7. package/src/gatsby/on-route-update-color-mode.js +14 -0
  8. package/.turbo/turbo-test$colon$coverage.log +0 -44
  9. package/.turbo/turbo-test.log +0 -168
  10. package/coverage/clover.xml +0 -131
  11. package/coverage/coverage-final.json +0 -13
  12. package/coverage/lcov-report/base.css +0 -224
  13. package/coverage/lcov-report/block-navigation.js +0 -87
  14. package/coverage/lcov-report/browser-sync.js.html +0 -268
  15. package/coverage/lcov-report/favicon.png +0 -0
  16. package/coverage/lcov-report/index.html +0 -161
  17. package/coverage/lcov-report/prettify.css +0 -1
  18. package/coverage/lcov-report/prettify.js +0 -2
  19. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  20. package/coverage/lcov-report/sorter.js +0 -210
  21. package/coverage/lcov-report/src/button.js.html +0 -160
  22. package/coverage/lcov-report/src/color-mode/browser-sync.js.html +0 -268
  23. package/coverage/lcov-report/src/color-mode/constants.js.html +0 -121
  24. package/coverage/lcov-report/src/color-mode/head-inline.js.html +0 -304
  25. package/coverage/lcov-report/src/color-mode/index.html +0 -176
  26. package/coverage/lcov-report/src/color-mode/index.js.html +0 -124
  27. package/coverage/lcov-report/src/color-mode/normalize.js.html +0 -112
  28. package/coverage/lcov-report/src/color-mode/resolve-theme-colors.js.html +0 -154
  29. package/coverage/lcov-report/src/color-toggle.js.html +0 -142
  30. package/coverage/lcov-report/src/emotion-cache.js.html +0 -151
  31. package/coverage/lcov-report/src/helpers/index.html +0 -116
  32. package/coverage/lcov-report/src/helpers/isDarkMode.js.html +0 -91
  33. package/coverage/lcov-report/src/index.html +0 -161
  34. package/coverage/lcov-report/src/provider.js.html +0 -124
  35. package/coverage/lcov-report/src/skip-nav/SkipNavContent.js.html +0 -133
  36. package/coverage/lcov-report/src/skip-nav/SkipNavLink.js.html +0 -301
  37. package/coverage/lcov-report/src/skip-nav/index.html +0 -131
  38. package/coverage/lcov-report/src/theme.js.html +0 -2143
  39. package/coverage/lcov.info +0 -309
package/jest.config.cjs CHANGED
@@ -15,6 +15,7 @@ module.exports = {
15
15
  'src/index.js',
16
16
  'src/skip-nav/index.js',
17
17
  'src/color-mode/index.js',
18
+ 'src/gatsby/index.js',
18
19
  'src/theme.js'
19
20
  ],
20
21
  moduleNameMapper: {
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@chronogrove/ui",
3
- "version": "0.76.0",
3
+ "version": "0.77.0",
4
4
  "description": "Chronogrove Theme UI theme, color mode helpers, and shared UI primitives",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/chrisvogt/gatsby-theme-chronogrove.git",
9
+ "directory": "packages/ui"
10
+ },
6
11
  "sideEffects": false,
7
12
  "exports": {
8
13
  ".": {
@@ -40,6 +45,10 @@
40
45
  "./is-dark-mode": {
41
46
  "import": "./src/helpers/isDarkMode.js",
42
47
  "default": "./src/helpers/isDarkMode.js"
48
+ },
49
+ "./gatsby": {
50
+ "import": "./src/gatsby/index.js",
51
+ "default": "./src/gatsby/index.js"
43
52
  }
44
53
  },
45
54
  "peerDependencies": {
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+
3
+ import { resolveChronogroveSurfaceColors } from '../color-mode/resolve-theme-colors.js'
4
+ import {
5
+ buildThemeUiNoFlashInlineScript,
6
+ buildHtmlBackgroundInlineScript,
7
+ buildThemeUiColorModeFallbackCss
8
+ } from '../color-mode/head-inline.js'
9
+
10
+ /**
11
+ * React head elements for Theme UI color mode: no-flash script, HTML background script, fallback CSS.
12
+ * Compose with your own meta tags (e.g. Emotion insertion point) in `onRenderBody`.
13
+ *
14
+ * @param {{ theme: object }} options — Theme UI theme object (same as `ThemeUIProvider`)
15
+ * @returns {import('react').ReactElement[]}
16
+ */
17
+ export function buildThemeUiColorModeHeadComponents({ theme }) {
18
+ const surface = resolveChronogroveSurfaceColors(theme)
19
+ const colorModeScript = buildThemeUiNoFlashInlineScript()
20
+ const htmlBackgroundScript = buildHtmlBackgroundInlineScript({
21
+ defaultBackgroundHex: surface.defaultBackgroundHex,
22
+ darkBackgroundHex: surface.darkBackgroundHex
23
+ })
24
+ const colorModeFallbackCSS = buildThemeUiColorModeFallbackCss({
25
+ defaultTextHex: surface.defaultTextHex,
26
+ defaultTextMutedHex: surface.defaultTextMutedHex,
27
+ darkTextHex: surface.darkTextHex,
28
+ darkTextMutedHex: surface.darkTextMutedHex
29
+ })
30
+
31
+ return [
32
+ <script key='theme-ui-no-flash' dangerouslySetInnerHTML={{ __html: colorModeScript }} />,
33
+ <script key='html-bg-color' dangerouslySetInnerHTML={{ __html: htmlBackgroundScript }} />,
34
+ <style key='theme-ui-color-mode-fallback' dangerouslySetInnerHTML={{ __html: colorModeFallbackCSS }} />
35
+ ]
36
+ }
@@ -0,0 +1,4 @@
1
+ export { buildThemeUiColorModeHeadComponents } from './build-theme-ui-color-mode-head-components.js'
2
+ export { onPreRenderHTMLSortThemeUiColorModeFirst } from './on-pre-render-html-sort.js'
3
+ export { onRouteUpdateThemeUiColorMode } from './on-route-update-color-mode.js'
4
+ export { RECONCILE_COLOR_MODE_EVENT } from '../color-mode/constants.js'
@@ -0,0 +1,131 @@
1
+ import React from 'react'
2
+ import { render } from '@testing-library/react'
3
+ import '@testing-library/jest-dom'
4
+
5
+ import chronogroveTheme from '../theme.js'
6
+ import * as gatsby from './index.js'
7
+ import { buildThemeUiColorModeHeadComponents } from './build-theme-ui-color-mode-head-components.js'
8
+ import { onPreRenderHTMLSortThemeUiColorModeFirst } from './on-pre-render-html-sort.js'
9
+ import { onRouteUpdateThemeUiColorMode } from './on-route-update-color-mode.js'
10
+
11
+ describe('@chronogrove/ui/gatsby public API', () => {
12
+ it('exports reconcile event and helpers from the barrel', () => {
13
+ expect(gatsby.RECONCILE_COLOR_MODE_EVENT).toBe('theme-ui-reconcile-color-mode')
14
+ expect(gatsby.buildThemeUiColorModeHeadComponents).toEqual(expect.any(Function))
15
+ expect(gatsby.onPreRenderHTMLSortThemeUiColorModeFirst).toEqual(expect.any(Function))
16
+ expect(gatsby.onRouteUpdateThemeUiColorMode).toEqual(expect.any(Function))
17
+ })
18
+ })
19
+
20
+ describe('@chronogrove/ui/gatsby', () => {
21
+ describe('buildThemeUiColorModeHeadComponents', () => {
22
+ it('returns no-flash script, HTML background script, and fallback style for the theme', () => {
23
+ const head = buildThemeUiColorModeHeadComponents({ theme: chronogroveTheme })
24
+ expect(head).toHaveLength(3)
25
+ expect(head[0].key).toBe('theme-ui-no-flash')
26
+ expect(head[1].key).toBe('html-bg-color')
27
+ expect(head[2].key).toBe('theme-ui-color-mode-fallback')
28
+
29
+ const { container: colorModeScriptContainer } = render(head[0])
30
+ const colorModeScriptTag = colorModeScriptContainer.querySelector('script')
31
+ expect(colorModeScriptTag).toHaveTextContent(/localStorage\.getItem\(['"]theme-ui-color-mode['"]\)/)
32
+ expect(colorModeScriptTag).toHaveTextContent(/data-theme-ui-color-mode/)
33
+
34
+ const { container: htmlBgScriptContainer } = render(head[1])
35
+ const htmlBgScriptTag = htmlBgScriptContainer.querySelector('script')
36
+ expect(htmlBgScriptTag).toHaveTextContent(/#14141F/)
37
+ expect(htmlBgScriptTag).toHaveTextContent(/#fdf8f5/)
38
+
39
+ const { container: fallbackStyleContainer } = render(head[2])
40
+ const fallbackStyle = fallbackStyleContainer.querySelector('style')
41
+ expect(fallbackStyle).toHaveTextContent(/:root\[data-theme-ui-color-mode="default"\]/)
42
+ expect(fallbackStyle).toHaveTextContent(/--theme-ui-colors-text: #111 !important/)
43
+ })
44
+ })
45
+
46
+ describe('onPreRenderHTMLSortThemeUiColorModeFirst', () => {
47
+ it('puts color-mode scripts and fallback style before other head components', () => {
48
+ const getHeadComponents = jest.fn(() => [
49
+ { key: 'emotion-insertion-point', type: 'meta' },
50
+ { key: 'theme-ui-no-flash', type: 'script' },
51
+ { key: 'html-bg-color', type: 'script' },
52
+ { key: 'theme-ui-color-mode-fallback', type: 'style' }
53
+ ])
54
+ const replaceHeadComponents = jest.fn()
55
+
56
+ onPreRenderHTMLSortThemeUiColorModeFirst({ getHeadComponents, replaceHeadComponents })
57
+
58
+ const sorted = replaceHeadComponents.mock.calls[0][0]
59
+ const colorModeKeys = ['theme-ui-no-flash', 'html-bg-color', 'theme-ui-color-mode-fallback']
60
+ const firstThree = sorted.slice(0, 3).map(c => c.key)
61
+ colorModeKeys.forEach(key => expect(firstThree).toContain(key))
62
+ expect(sorted[3].key).toBe('emotion-insertion-point')
63
+ })
64
+
65
+ it('sorts color-mode keys before arbitrary head components', () => {
66
+ const getHeadComponents = jest.fn(() => [
67
+ { key: 'other-meta', type: 'meta' },
68
+ { key: 'theme-ui-no-flash', type: 'script' },
69
+ { key: 'another-tag', type: 'link' },
70
+ { key: 'html-bg-color', type: 'script' },
71
+ { key: 'theme-ui-color-mode-fallback', type: 'style' }
72
+ ])
73
+ const replaceHeadComponents = jest.fn()
74
+
75
+ onPreRenderHTMLSortThemeUiColorModeFirst({ getHeadComponents, replaceHeadComponents })
76
+
77
+ const sorted = replaceHeadComponents.mock.calls[0][0]
78
+ const keys = sorted.map(c => c.key)
79
+ expect(keys.indexOf('theme-ui-no-flash')).toBeLessThan(keys.indexOf('other-meta'))
80
+ expect(keys.indexOf('html-bg-color')).toBeLessThan(keys.indexOf('another-tag'))
81
+ expect(keys.indexOf('theme-ui-color-mode-fallback')).toBeLessThan(keys.indexOf('other-meta'))
82
+ })
83
+
84
+ it('preserves relative order among non-priority head components (comparator returns 0)', () => {
85
+ const getHeadComponents = jest.fn(() => [
86
+ { key: 'z-last', type: 'meta' },
87
+ { key: 'a-first', type: 'meta' }
88
+ ])
89
+ const replaceHeadComponents = jest.fn()
90
+ onPreRenderHTMLSortThemeUiColorModeFirst({ getHeadComponents, replaceHeadComponents })
91
+ expect(replaceHeadComponents.mock.calls[0][0].map(c => c.key)).toEqual(['z-last', 'a-first'])
92
+ })
93
+
94
+ it('preserves relative order among priority keys when both sides are priority (comparator returns 0)', () => {
95
+ const getHeadComponents = jest.fn(() => [
96
+ { key: 'html-bg-color', type: 'script' },
97
+ { key: 'theme-ui-no-flash', type: 'script' }
98
+ ])
99
+ const replaceHeadComponents = jest.fn()
100
+ onPreRenderHTMLSortThemeUiColorModeFirst({ getHeadComponents, replaceHeadComponents })
101
+ expect(replaceHeadComponents.mock.calls[0][0].map(c => c.key)).toEqual(['html-bg-color', 'theme-ui-no-flash'])
102
+ })
103
+ })
104
+
105
+ describe('onRouteUpdateThemeUiColorMode', () => {
106
+ beforeEach(() => {
107
+ window.localStorage.removeItem('theme-ui-color-mode')
108
+ document.documentElement.removeAttribute('data-theme-ui-color-mode')
109
+ document.documentElement.className = ''
110
+ })
111
+
112
+ it('syncs DOM from localStorage and dispatches reconcile event', () => {
113
+ window.localStorage.setItem('theme-ui-color-mode', 'dark')
114
+ const listener = jest.fn()
115
+ window.addEventListener('theme-ui-reconcile-color-mode', listener)
116
+
117
+ onRouteUpdateThemeUiColorMode()
118
+
119
+ expect(document.documentElement.getAttribute('data-theme-ui-color-mode')).toBe('dark')
120
+ expect(listener).toHaveBeenCalled()
121
+ })
122
+
123
+ it('does not throw when CustomEvent is unavailable', () => {
124
+ const original = window.CustomEvent
125
+ window.CustomEvent = undefined
126
+ window.localStorage.setItem('theme-ui-color-mode', 'default')
127
+ expect(() => onRouteUpdateThemeUiColorMode()).not.toThrow()
128
+ window.CustomEvent = original
129
+ })
130
+ })
131
+ })
@@ -0,0 +1,21 @@
1
+ import { CHRONOGROVE_COLOR_MODE_HEAD_PRIORITY_KEYS } from '../color-mode/constants.js'
2
+
3
+ /**
4
+ * Gatsby `onPreRenderHTML`: move Theme UI color-mode head entries (`theme-ui-no-flash`, `html-bg-color`,
5
+ * `theme-ui-color-mode-fallback`) before other head components to minimize flash and ordering issues.
6
+ *
7
+ * @param {{ getHeadComponents: () => unknown[], replaceHeadComponents: (c: unknown[]) => void }} api
8
+ */
9
+ export function onPreRenderHTMLSortThemeUiColorModeFirst({ getHeadComponents, replaceHeadComponents }) {
10
+ const headComponents = getHeadComponents()
11
+ const priorityKeys = CHRONOGROVE_COLOR_MODE_HEAD_PRIORITY_KEYS
12
+ const sorted = [...headComponents].sort((a, b) => {
13
+ const aKey = a?.key ?? ''
14
+ const bKey = b?.key ?? ''
15
+ const aFirst = priorityKeys.includes(aKey) ? -1 : 0
16
+ const bFirst = priorityKeys.includes(bKey) ? -1 : 0
17
+ if (aFirst !== bFirst) return aFirst - bFirst
18
+ return 0
19
+ })
20
+ replaceHeadComponents(sorted)
21
+ }
@@ -0,0 +1,14 @@
1
+ import { RECONCILE_COLOR_MODE_EVENT } from '../color-mode/constants.js'
2
+ import { scheduleThemeUiColorModeSync } from '../color-mode/browser-sync.js'
3
+
4
+ /**
5
+ * Call from Gatsby `onRouteUpdate` so Theme UI color mode stays aligned with `localStorage` and the
6
+ * document after client-side navigations. Dispatches {@link RECONCILE_COLOR_MODE_EVENT} for app code
7
+ * that listens (e.g. React context reconciliation).
8
+ */
9
+ export function onRouteUpdateThemeUiColorMode() {
10
+ scheduleThemeUiColorModeSync()
11
+ if (typeof window !== 'undefined' && typeof window.CustomEvent === 'function') {
12
+ window.dispatchEvent(new window.CustomEvent(RECONCILE_COLOR_MODE_EVENT))
13
+ }
14
+ }
@@ -1,44 +0,0 @@
1
-
2
- > @chronogrove/ui@0.76.0 test:coverage /Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui
3
- > jest --config jest.config.cjs --coverage --colors --maxWorkers=2
4
-
5
- PASS src/color-mode/browser-sync.spec.js
6
- PASS src/skip-nav/SkipNavLink.spec.js
7
- PASS src/color-toggle.spec.js
8
- PASS src/emotion-cache.spec.js
9
- PASS src/skip-nav/SkipNavContent.spec.js
10
- PASS src/provider.spec.js
11
- PASS src/color-mode/normalize.spec.js
12
- PASS src/button.spec.js
13
- PASS src/color-mode/browser-sync.node.spec.js
14
- PASS src/helpers/isDarkMode.spec.js
15
- PASS src/theme.spec.js
16
- PASS src/color-mode/head-inline.spec.js
17
- PASS src/color-mode/resolve-theme-colors.spec.js
18
- --------------------------|---------|----------|---------|---------|-------------------
19
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
20
- --------------------------|---------|----------|---------|---------|-------------------
21
- All files | 98.75 | 96.15 | 100 | 98.7 |
22
- src | 100 | 88.88 | 100 | 100 |
23
- button.js | 100 | 100 | 100 | 100 |
24
- color-toggle.js | 100 | 100 | 100 | 100 |
25
- emotion-cache.js | 100 | 83.33 | 100 | 100 | 7
26
- provider.js | 100 | 100 | 100 | 100 |
27
- src/color-mode | 98.21 | 98.21 | 100 | 98.14 |
28
- browser-sync.js | 97.05 | 96.66 | 100 | 96.87 | 44
29
- constants.js | 100 | 100 | 100 | 100 |
30
- head-inline.js | 100 | 100 | 100 | 100 |
31
- normalize.js | 100 | 100 | 100 | 100 |
32
- resolve-theme-colors.js | 100 | 100 | 100 | 100 |
33
- src/helpers | 100 | 100 | 100 | 100 |
34
- isDarkMode.js | 100 | 100 | 100 | 100 |
35
- src/skip-nav | 100 | 92.3 | 100 | 100 |
36
- SkipNavContent.js | 100 | 100 | 100 | 100 |
37
- SkipNavLink.js | 100 | 90.9 | 100 | 100 | 7
38
- --------------------------|---------|----------|---------|---------|-------------------
39
-
40
- Test Suites: 13 passed, 13 total
41
- Tests: 39 passed, 39 total
42
- Snapshots: 1 passed, 1 total
43
- Time: 1.111 s
44
- Ran all test suites.
@@ -1,168 +0,0 @@
1
-
2
- 
3
- > @chronogrove/ui@0.76.0 test /Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui
4
- > jest --config jest.config.cjs
5
-
6
- Determining test suites to run...[?2026h
7
- [?2026l[?2026h
8
-  RUNS  src/color-mode/browser-sync.spec.js
9
- [?2026l[?2026h
10
-  RUNS  src/color-mode/browser-sync.spec.js
11
- [?2026l[?2026h
12
-  RUNS  src/color-mode/browser-sync.spec.js
13
- [?2026l[?2026h
14
-  RUNS  src/color-mode/browser-sync.spec.js
15
- [?2026l[?2026h
16
-  RUNS  src/color-mode/browser-sync.spec.js
17
- [?2026l[?2026h
18
-  RUNS  src/color-mode/browser-sync.spec.js
19
- [?2026l[?2026h
20
-  RUNS  src/color-mode/browser-sync.spec.js
21
- [?2026l[?2026h
22
-  RUNS  src/color-mode/browser-sync.spec.js
23
- [?2026l[?2026h
24
-  RUNS  src/color-mode/browser-sync.spec.js
25
- [?2026l[?2026h
26
-  RUNS  src/color-mode/browser-sync.spec.js
27
- [?2026l[?2026h
28
-  RUNS  src/color-mode/browser-sync.spec.js
29
- [?2026l[?2026h
30
-  RUNS  src/color-mode/browser-sync.spec.js
31
- [?2026l[?2026h
32
-
33
-  RUNS  src/color-mode/browser-sync.spec.js
34
- [?2026l[?2026h
35
-  RUNS  src/color-mode/browser-sync.spec.js
36
- [?2026l[?2026h
37
-  RUNS  src/skip-nav/SkipNavLink.spec.js
38
- [?2026l[?2026h
39
-  RUNS  src/skip-nav/SkipNavLink.spec.js
40
- [?2026l[?2026h
41
-  RUNS  src/skip-nav/SkipNavLink.spec.js
42
- [?2026l[?2026h
43
-  RUNS  src/skip-nav/SkipNavLink.spec.js
44
- [?2026l[?2026h
45
-  RUNS  src/skip-nav/SkipNavLink.spec.js
46
- [?2026l[?2026h
47
-
48
-  RUNS  src/skip-nav/SkipNavLink.spec.js
49
- [?2026l[?2026h
50
-  RUNS  src/provider.spec.js
51
- [?2026l[?2026h
52
-  RUNS  src/provider.spec.js
53
- [?2026l[?2026h
54
-
55
-  RUNS  src/provider.spec.js
56
- [?2026l[?2026h
57
-  RUNS  src/button.spec.js
58
- [?2026l[?2026h
59
-  RUNS  src/button.spec.js
60
- [?2026l[?2026h
61
-
62
-  RUNS  src/button.spec.js
63
- [?2026l[?2026h
64
-  RUNS  src/color-toggle.spec.js
65
- [?2026l[?2026h
66
-  RUNS  src/color-toggle.spec.js
67
- [?2026l[?2026h
68
-  RUNS  src/color-toggle.spec.js
69
- [?2026l[?2026h
70
-  RUNS  src/color-toggle.spec.js
71
- [?2026l[?2026h
72
-
73
-  RUNS  src/color-toggle.spec.js
74
- [?2026l[?2026h
75
-  RUNS  src/color-mode/browser-sync.node.spec.js
76
- [?2026l[?2026h
77
-  RUNS  src/color-mode/browser-sync.node.spec.js
78
- [?2026l[?2026h
79
-  RUNS  src/color-mode/browser-sync.node.spec.js
80
- [?2026l[?2026h
81
-
82
-  RUNS  src/color-mode/browser-sync.node.spec.js
83
- [?2026l[?2026h
84
-  RUNS  src/color-mode/head-inline.spec.js
85
- [?2026l[?2026h
86
-  RUNS  src/color-mode/head-inline.spec.js
87
- [?2026l[?2026h
88
-  RUNS  src/color-mode/head-inline.spec.js
89
- [?2026l[?2026h
90
-  RUNS  src/color-mode/head-inline.spec.js
91
- [?2026l[?2026h
92
-
93
-  RUNS  src/color-mode/head-inline.spec.js
94
- [?2026l[?2026h
95
-  RUNS  src/skip-nav/SkipNavContent.spec.js
96
- [?2026l[?2026h
97
-  RUNS  src/skip-nav/SkipNavContent.spec.js
98
- [?2026l[?2026h
99
-  RUNS  src/skip-nav/SkipNavContent.spec.js
100
- [?2026l[?2026h
101
-
102
-  RUNS  src/skip-nav/SkipNavContent.spec.js
103
- [?2026l[?2026h
104
-  RUNS  src/theme.spec.js
105
- [?2026l[?2026h
106
-  RUNS  src/theme.spec.js
107
- [?2026l[?2026h
108
-  RUNS  src/theme.spec.js
109
- [?2026l[?2026h
110
-  RUNS  src/theme.spec.js
111
- [?2026l[?2026h
112
-  RUNS  src/theme.spec.js
113
- [?2026l[?2026h
114
-  RUNS  src/theme.spec.js
115
- [?2026l[?2026h
116
-  RUNS  src/theme.spec.js
117
- [?2026l[?2026h
118
-  RUNS  src/theme.spec.js
119
- [?2026l[?2026h
120
-  RUNS  src/theme.spec.js
121
- [?2026l[?2026h
122
-
123
-  RUNS  src/theme.spec.js
124
- [?2026l[?2026h
125
-  RUNS  src/helpers/isDarkMode.spec.js
126
- [?2026l[?2026h
127
-  RUNS  src/helpers/isDarkMode.spec.js
128
- [?2026l[?2026h
129
-
130
-  RUNS  src/helpers/isDarkMode.spec.js
131
- [?2026l[?2026h
132
-  RUNS  src/color-mode/resolve-theme-colors.spec.js
133
- [?2026l[?2026h
134
-  RUNS  src/color-mode/resolve-theme-colors.spec.js
135
- [?2026l[?2026h
136
-  RUNS  src/color-mode/resolve-theme-colors.spec.js
137
- [?2026l[?2026h
138
-
139
-  RUNS  src/color-mode/resolve-theme-colors.spec.js
140
- [?2026l[?2026h
141
-  RUNS  src/emotion-cache.spec.js
142
- [?2026l[?2026h
143
-  RUNS  src/emotion-cache.spec.js
144
- [?2026l[?2026h
145
-  RUNS  src/emotion-cache.spec.js
146
- [?2026l[?2026h
147
-  RUNS  src/emotion-cache.spec.js
148
- [?2026l[?2026h
149
-
150
-  RUNS  src/emotion-cache.spec.js
151
- [?2026l[?2026h
152
-  RUNS  src/color-mode/normalize.spec.js
153
- [?2026l[?2026h
154
-  RUNS  src/color-mode/normalize.spec.js
155
- [?2026l[?2026h
156
-  RUNS  src/color-mode/normalize.spec.js
157
- [?2026l[?2026h
158
-  RUNS  src/color-mode/normalize.spec.js
159
- [?2026l[?2026h
160
-
161
-  RUNS  src/color-mode/normalize.spec.js
162
- [?2026l[?2026h
163
- Test Suites: 13 passed, 13 total
164
- Tests: 40 passed, 40 total
165
- Snapshots: 1 passed, 1 total
166
- Time: 0.812 s, estimated 1 s
167
- Ran all test suites.
168
- [?2026h[?2026l
@@ -1,131 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1775797645097" clover="3.2.0">
3
- <project timestamp="1775797645097" name="All files">
4
- <metrics statements="77" coveredstatements="77" conditionals="78" coveredconditionals="76" methods="23" coveredmethods="23" elements="178" coveredelements="176" complexity="0" loc="77" ncloc="77" packages="4" files="12" classes="12"/>
5
- <package name="src">
6
- <metrics statements="12" coveredstatements="12" conditionals="9" coveredconditionals="8" methods="6" coveredmethods="6"/>
7
- <file name="button.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/button.js">
8
- <metrics statements="2" coveredstatements="2" conditionals="1" coveredconditionals="1" methods="1" coveredmethods="1"/>
9
- <line num="4" count="1" type="cond" truecount="1" falsecount="0"/>
10
- <line num="5" count="1" type="stmt"/>
11
- </file>
12
- <file name="color-toggle.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-toggle.js">
13
- <metrics statements="3" coveredstatements="3" conditionals="2" coveredconditionals="2" methods="2" coveredmethods="2"/>
14
- <line num="7" count="2" type="stmt"/>
15
- <line num="9" count="2" type="stmt"/>
16
- <line num="13" count="2" type="cond" truecount="2" falsecount="0"/>
17
- </file>
18
- <file name="emotion-cache.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/emotion-cache.js">
19
- <metrics statements="6" coveredstatements="6" conditionals="6" coveredconditionals="5" methods="2" coveredmethods="2"/>
20
- <line num="3" count="2" type="stmt"/>
21
- <line num="7" count="2" type="cond" truecount="1" falsecount="1"/>
22
- <line num="9" count="2" type="stmt"/>
23
- <line num="18" count="3" type="cond" truecount="2" falsecount="0"/>
24
- <line num="19" count="2" type="stmt"/>
25
- <line num="21" count="3" type="stmt"/>
26
- </file>
27
- <file name="provider.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/provider.js">
28
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
29
- <line num="6" count="1" type="stmt"/>
30
- </file>
31
- </package>
32
- <package name="src.color-mode">
33
- <metrics statements="54" coveredstatements="54" conditionals="56" coveredconditionals="56" methods="14" coveredmethods="14"/>
34
- <file name="browser-sync.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-mode/browser-sync.js">
35
- <metrics statements="32" coveredstatements="32" conditionals="30" coveredconditionals="30" methods="7" coveredmethods="7"/>
36
- <line num="6" count="13" type="stmt"/>
37
- <line num="7" count="13" type="cond" truecount="2" falsecount="0"/>
38
- <line num="9" count="1" type="stmt"/>
39
- <line num="11" count="13" type="stmt"/>
40
- <line num="12" count="13" type="cond" truecount="2" falsecount="0"/>
41
- <line num="13" count="7" type="stmt"/>
42
- <line num="16" count="6" type="cond" truecount="2" falsecount="0"/>
43
- <line num="17" count="5" type="stmt"/>
44
- <line num="18" count="5" type="stmt"/>
45
- <line num="19" count="5" type="cond" truecount="2" falsecount="0"/>
46
- <line num="20" count="1" type="stmt"/>
47
- <line num="22" count="4" type="cond" truecount="2" falsecount="0"/>
48
- <line num="23" count="1" type="stmt"/>
49
- <line num="25" count="3" type="cond" truecount="4" falsecount="0"/>
50
- <line num="26" count="1" type="stmt"/>
51
- <line num="31" count="3" type="cond" truecount="3" falsecount="0"/>
52
- <line num="35" count="3" type="cond" truecount="2" falsecount="0"/>
53
- <line num="39" count="8" type="cond" truecount="2" falsecount="0"/>
54
- <line num="40" count="1" type="stmt"/>
55
- <line num="42" count="7" type="stmt"/>
56
- <line num="43" count="7" type="cond" truecount="2" falsecount="0"/>
57
- <line num="44" count="1" type="stmt"/>
58
- <line num="46" count="6" type="stmt"/>
59
- <line num="47" count="6" type="stmt"/>
60
- <line num="48" count="4" type="stmt"/>
61
- <line num="49" count="4" type="stmt"/>
62
- <line num="50" count="6" type="stmt"/>
63
- <line num="51" count="6" type="stmt"/>
64
- <line num="55" count="2" type="stmt"/>
65
- <line num="56" count="2" type="cond" truecount="4" falsecount="0"/>
66
- <line num="57" count="1" type="stmt"/>
67
- <line num="59" count="1" type="stmt"/>
68
- </file>
69
- <file name="constants.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-mode/constants.js">
70
- <metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
71
- <line num="2" count="3" type="stmt"/>
72
- <line num="5" count="3" type="stmt"/>
73
- <line num="8" count="3" type="stmt"/>
74
- </file>
75
- <file name="head-inline.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-mode/head-inline.js">
76
- <metrics statements="8" coveredstatements="8" conditionals="2" coveredconditionals="2" methods="4" coveredmethods="4"/>
77
- <line num="4" count="4" type="stmt"/>
78
- <line num="8" count="1" type="stmt"/>
79
- <line num="9" count="1" type="stmt"/>
80
- <line num="44" count="1" type="stmt"/>
81
- <line num="45" count="1" type="stmt"/>
82
- <line num="46" count="1" type="stmt"/>
83
- <line num="47" count="1" type="stmt"/>
84
- <line num="69" count="1" type="stmt"/>
85
- </file>
86
- <file name="normalize.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-mode/normalize.js">
87
- <metrics statements="5" coveredstatements="5" conditionals="6" coveredconditionals="6" methods="1" coveredmethods="1"/>
88
- <line num="2" count="23" type="cond" truecount="2" falsecount="0"/>
89
- <line num="3" count="5" type="stmt"/>
90
- <line num="5" count="18" type="cond" truecount="4" falsecount="0"/>
91
- <line num="6" count="6" type="stmt"/>
92
- <line num="8" count="12" type="stmt"/>
93
- </file>
94
- <file name="resolve-theme-colors.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/color-mode/resolve-theme-colors.js">
95
- <metrics statements="6" coveredstatements="6" conditionals="18" coveredconditionals="18" methods="2" coveredmethods="2"/>
96
- <line num="2" count="12" type="cond" truecount="2" falsecount="0"/>
97
- <line num="3" count="6" type="stmt"/>
98
- <line num="5" count="6" type="stmt"/>
99
- <line num="13" count="2" type="cond" truecount="2" falsecount="0"/>
100
- <line num="14" count="2" type="cond" truecount="2" falsecount="0"/>
101
- <line num="15" count="2" type="stmt"/>
102
- </file>
103
- </package>
104
- <package name="src.helpers">
105
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
106
- <file name="isDarkMode.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/helpers/isDarkMode.js">
107
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
108
- <line num="1" count="9" type="stmt"/>
109
- </file>
110
- </package>
111
- <package name="src.skip-nav">
112
- <metrics statements="10" coveredstatements="10" conditionals="13" coveredconditionals="12" methods="2" coveredmethods="2"/>
113
- <file name="SkipNavContent.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/skip-nav/SkipNavContent.js">
114
- <metrics statements="3" coveredstatements="3" conditionals="2" coveredconditionals="2" methods="1" coveredmethods="1"/>
115
- <line num="3" count="1" type="stmt"/>
116
- <line num="7" count="1" type="stmt"/>
117
- <line num="14" count="1" type="stmt"/>
118
- </file>
119
- <file name="SkipNavLink.js" path="/Users/chrisvogt/Code/gatsby-theme-chronogrove/packages/ui/src/skip-nav/SkipNavLink.js">
120
- <metrics statements="7" coveredstatements="7" conditionals="11" coveredconditionals="10" methods="1" coveredmethods="1"/>
121
- <line num="6" count="1" type="stmt"/>
122
- <line num="10" count="4" type="stmt"/>
123
- <line num="11" count="4" type="stmt"/>
124
- <line num="12" count="4" type="cond" truecount="4" falsecount="0"/>
125
- <line num="13" count="4" type="cond" truecount="4" falsecount="0"/>
126
- <line num="15" count="4" type="stmt"/>
127
- <line num="70" count="1" type="stmt"/>
128
- </file>
129
- </package>
130
- </project>
131
- </coverage>