Skip to content

Commit 74cf6f3

Browse files
committed
chore: update examples
1 parent 96da98b commit 74cf6f3

File tree

20 files changed

+4407
-91
lines changed

20 files changed

+4407
-91
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ lib
33
!.prettierrc.js
44
!.eslintrc.js
55
!.stylelintrc.js
6-
/examples
6+
# /examples

examples/green-wall/.eslintrc.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
module.exports = {
22
root: true,
3-
extends: [require.resolve('../../lib/eslint')],
4-
rules: {
5-
'react/react-in-jsx-scope': 0,
6-
'jsx-a11y/no-static-element-interactions': 0,
7-
'jsx-a11y/click-events-have-key-events': 0,
8-
'@typescript-eslint/no-explicit-any': 0,
9-
},
10-
parserOptions: {
11-
tsconfigRootDir: __dirname,
12-
project: ['./tsconfig.json'],
13-
},
3+
extends: [require.resolve('prefer-code-style/lib/eslint')],
144
ignorePatterns: [
155
'public',
16-
'es',
17-
'dist*',
186
'yarn*',
19-
'.cache',
207
'.next',
218
'!.eslintrc.js',
229
'!.prettierrc.js',

examples/green-wall/.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const prettier = require('../../lib/prettier')
1+
const { prettier } = require('prefer-code-style')
22

33
module.exports = {
44
...prettier,

examples/green-wall/.stylelintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
extends: [require.resolve('../../lib/stylelint')],
2+
extends: [require.resolve('prefer-code-style/lib/stylelint')],
33
rules: {
44
'color-function-notation': 'modern',
55
'selector-id-pattern': null,

examples/green-wall/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@types/react": "18.0.20",
3838
"autoprefixer": "^10.4.11",
3939
"postcss": "^8.4.16",
40+
"prefer-code-style": "0.6.9",
4041
"tailwindcss": "^3.1.8",
4142
"typescript": "^4.8.3"
4243
}

examples/green-wall/src/components/AppearanceSetting/AppearanceSetting.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { useId } from 'react'
2+
13
import splitbee from '@splitbee/web'
24

3-
import { type GraphData, DisplayName, GraphSize } from '../../types'
5+
import { DisplayName, type GraphData, GraphSize } from '../../types'
46
import type useSetting from '../../useSetting'
57
import ThemeSelector from '../ThemeSelector'
68
import { RadixSelect } from '../ui-kit/RadixSelect'
@@ -10,7 +12,7 @@ import { RadixToggleGroup } from '../ui-kit/RadixToggleGroup'
1012
type State = ReturnType<typeof useSetting>[0]
1113
type Dispatch = ReturnType<typeof useSetting>[1]
1214

13-
export interface AppearanceSettingProps {
15+
interface AppearanceSettingProps {
1416
value?: State
1517
onChange?: Dispatch
1618
graphData: GraphData | undefined
@@ -21,6 +23,8 @@ export default function AppearanceSetting({
2123
onChange: dispatch,
2224
graphData,
2325
}: AppearanceSettingProps) {
26+
const attribution = useId()
27+
2428
return (
2529
<div className="appearance-setting min-w-[min(40vw,220px)] max-w-[min(90vw,280px)] text-main-400">
2630
<fieldset>
@@ -49,11 +53,11 @@ export default function AppearanceSetting({
4953
</fieldset>
5054

5155
<fieldset>
52-
<label htmlFor="attribution">Attribution</label>
56+
<label htmlFor={attribution}>Attribution</label>
5357
<RadixSwitch
5458
checked={settings?.showAttribution}
5559
defaultChecked={true}
56-
id="attribution"
60+
id={attribution}
5761
onCheckedChange={(checked) => dispatch?.({ type: 'showAttribution', payload: checked })}
5862
/>
5963
</fieldset>

examples/green-wall/src/components/AppearanceSetting/DraggableAppearanceSetting.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { motion, useDragControls } from 'framer-motion'
21
import { useEffect, useRef, useState } from 'react'
32

3+
import { motion, useDragControls } from 'framer-motion'
4+
45
import { iconClose } from '../icons'
56

67
export default function DraggableAppearanceSetting(

examples/green-wall/src/components/ContributionsGraph/ContributionsGraph.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react'
22

3-
import { DEFAULT_SIZE, DEFAULT_THEME, sizeProperties, THEMES } from '../../constants'
3+
import { DEFAULT_SIZE, DEFAULT_THEME, THEMES, sizeProperties } from '../../constants'
44
import type { GraphData, GraphSettings } from '../../types'
55
import { DisplayName } from '../../types'
6+
67
import Graph from './Graph'
78
import GraphFooter from './GraphFooter'
89
import GraphHeader from './GraphHeader'

examples/green-wall/src/components/ContributionsGraph/Graph.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { levels } from '../../constants'
22
import { numberWithCommas } from '../../helpers'
33
import type { ContributionCalendar, ContributionDay } from '../../types'
44
import { ContributionLevel } from '../../types'
5+
56
import styles from './Graph.module.css'
67

78
interface GraphProps extends React.ComponentProps<'div'> {

examples/green-wall/src/components/ContributionsGraph/GraphHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from 'next/link'
22

33
import type { GitHubUser, GitHubUsername } from '../../types'
4+
45
import styles from './Graph.module.css'
56

67
export default function GraphHeader(props: {

0 commit comments

Comments
 (0)