Skip to content

Commit a9bc82f

Browse files
Harry FoxHarry Fox
authored andcommitted
back to inline styles
1 parent a76e5ea commit a9bc82f

26 files changed

+6784
-402
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
/*.log
2-
/*.DS_Store
3-
/node_modules/
4-
/lib/
5-
/dist/
6-
/.idea/
1+
# OS
2+
.DS_Store
3+
4+
# Cache
5+
.cache
6+
.playwright
7+
.tmp
8+
*.tsbuildinfo
9+
.eslintcache
10+
11+
# Yarn
12+
.pnp.*
13+
**/.yarn/*
14+
!**/.yarn/patches
15+
!**/.yarn/plugins
16+
!**/.yarn/releases
17+
!**/.yarn/sdks
18+
!**/.yarn/versions
19+
20+
# Project-generated directories and files
21+
coverage
22+
dist
23+
node_modules
24+
playwright-report
25+
test-results
26+
package.tgz
27+
28+
# Logs
29+
npm-debug.log
30+
yarn-error.log
31+
32+
# .env files
33+
**/.env
34+
**/.env.*
35+
!**/.env.example

biome.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"files": {
4+
"ignore": [
5+
".tsimp",
6+
".yarn",
7+
"coverage",
8+
"dist",
9+
".pnp.cjs",
10+
".pnp.loader.mjs"
11+
]
12+
},
13+
"formatter": {
14+
"lineWidth": 100,
15+
"indentStyle": "space"
16+
},
17+
"linter": {
18+
"rules": {
19+
"complexity": {
20+
"noUselessSwitchCase": "off"
21+
},
22+
"suspicious": {
23+
"noConsoleLog": "warn"
24+
}
25+
}
26+
},
27+
"css": {
28+
"formatter": {
29+
"enabled": true,
30+
"indentStyle": "space",
31+
"indentWidth": 2,
32+
"lineWidth": 100,
33+
"quoteStyle": "single"
34+
}
35+
},
36+
"javascript": {
37+
"formatter": {
38+
"quoteStyle": "single"
39+
}
40+
},
41+
"overrides": [
42+
{
43+
"include": ["**/package.json"],
44+
"formatter": {
45+
"lineWidth": 1
46+
}
47+
},
48+
{
49+
"include": ["**/vite.config.ts"],
50+
"linter": {
51+
"rules": {
52+
"suspicious": {
53+
"noConsoleLog": "off"
54+
}
55+
}
56+
}
57+
}
58+
]
59+
}

package.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-best-gradient-color-picker",
3-
"version": "3.0.8",
3+
"version": "3.0.10",
44
"description": "An easy to use color/gradient picker for React.js",
55
"type": "module",
66
"sideEffects": [
@@ -15,7 +15,7 @@
1515
"import": "./dist/esm/index.js",
1616
"require": "./dist/cjs/index.js"
1717
},
18-
"./dist/Picker.css": "./dist/Picker.css"
18+
"./dist/Calendar.css": "./dist/Picker.css"
1919
},
2020
"scripts": {
2121
"build": "yarn build-js && yarn copy-styles",
@@ -24,19 +24,15 @@
2424
"build-js-cjs": "tsc --project tsconfig.build.json --outDir dist/cjs --module commonjs --moduleResolution node --verbatimModuleSyntax false",
2525
"build-js-cjs-package": "echo '{\n \"type\": \"commonjs\"\n}' > dist/cjs/package.json",
2626
"clean": "rimraf dist",
27-
"copy-styles": "cpy 'src/**/*.css' dist/esm && cpy 'src/**/*.css' dist/cjs",
28-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
27+
"copy-styles": "cpy 'src/**/*.css' dist",
28+
"format": "biome format",
29+
"lint": "biome lint",
2930
"prepack": "yarn clean && yarn build",
30-
"prettier": "prettier --check . --cache",
31-
"test": "yarn lint && yarn tsc && yarn prettier && yarn unit",
31+
"test": "yarn lint && yarn tsc && yarn format && yarn unit",
3232
"tsc": "tsc",
3333
"unit": "vitest",
34-
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\""
34+
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & node --eval \"fs.watch('src', () => child_process.exec('yarn copy-styles'))\""
3535
},
36-
"files": [
37-
"dist",
38-
"src"
39-
],
4036
"repository": {
4137
"type": "git",
4238
"url": "git+https://github.com/hxf31891/react-gradient-color-picker.git"
@@ -68,8 +64,6 @@
6864
"@types/reactcss": "^1.2.11",
6965
"@types/tinycolor2": "^1.4.6",
7066
"cpy-cli": "^3.1.1",
71-
"eslint": "8.22.0",
72-
"eslint-config-wojtekmaj": "^0.9.0",
7367
"happy-dom": "^12.6.0",
7468
"nodemon": "^3.0.0",
7569
"prettier": "^3.0.0",
@@ -80,15 +74,19 @@
8074
"vitest": "^1.0.2"
8175
},
8276
"peerDependencies": {
83-
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
84-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
85-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
77+
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
78+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
79+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
8680
},
8781
"peerDependenciesMeta": {
8882
"@types/react": {
8983
"optional": true
9084
}
9185
},
86+
"files": [
87+
"dist",
88+
"src"
89+
],
9290
"license": "MIT",
9391
"bugs": {
9492
"url": "https://github.com/hxf31891/react-gradient-color-picker/issues"
@@ -97,4 +95,4 @@
9795
"publishConfig": {
9896
"@hxf31891:registry": "https://npm.pkg.github.com"
9997
}
100-
}
98+
}

src/components/AdvancedControls.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const AdvBar = ({
2121
openAdvanced: boolean
2222
label: string
2323
}) => {
24-
const { squareWidth, classes } = usePicker()
24+
const { squareWidth, defaultStyles } = usePicker()
2525
const [dragging, setDragging] = useState<boolean>(false)
2626
const [handleTop, setHandleTop] = useState<number>(2)
2727
const left = value * (squareWidth - 18)
@@ -66,11 +66,10 @@ const AdvBar = ({
6666
<div style={{ width: '100%', padding: '3px 0px 3px 0px' }}>
6767
<div
6868
onMouseMove={(e) => handleMove(e)}
69-
className={`${classes.cResize} ${classes.psRl}`}
69+
style={{ cursor: 'resize', position: 'relative' }}
7070
>
7171
<div
72-
style={{ left, top: handleTop }}
73-
className={classes.rbgcpHandle}
72+
style={{ left, top: handleTop, ...defaultStyles.rbgcpHandle }}
7473
onMouseDown={handleDown}
7574
role="button"
7675
tabIndex={0}
@@ -91,6 +90,11 @@ const AdvBar = ({
9190
}}
9291
onMouseMove={(e) => handleMove(e)}
9392
onClick={(e) => handleClick(e)}
93+
tabIndex={0}
94+
role="button"
95+
onKeyDown={() => {
96+
return
97+
}}
9498
>
9599
{label}
96100
</div>

src/components/ComparibleColors.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const ComparibleColors = ({
66
}: {
77
openComparibles: boolean
88
}) => {
9-
const { tinyColor, handleChange, classes } = usePicker()
9+
const { tinyColor, handleChange, defaultStyles } = usePicker()
1010

1111
const analogous = tinyColor.analogous()
1212
const monochromatic = tinyColor.monochromatic()
@@ -41,8 +41,8 @@ const ComparibleColors = ({
4141
position: 'absolute',
4242
top: 6.5,
4343
left: 2,
44+
...defaultStyles.rbgcpComparibleLabel,
4445
}}
45-
className={classes.rbgcpComparibleLabel}
4646
>
4747
Color Guide
4848
</div>
@@ -52,8 +52,8 @@ const ComparibleColors = ({
5252
fontSize: 12,
5353
fontWeight: 500,
5454
marginTop: 3,
55+
...defaultStyles.rbgcpComparibleLabel,
5556
}}
56-
className={classes.rbgcpComparibleLabel}
5757
>
5858
Analogous
5959
</div>
@@ -72,8 +72,8 @@ const ComparibleColors = ({
7272
fontSize: 12,
7373
fontWeight: 500,
7474
marginTop: 3,
75+
...defaultStyles.rbgcpComparibleLabel,
7576
}}
76-
className={classes.rbgcpComparibleLabel}
7777
>
7878
Monochromatic
7979
</div>
@@ -99,8 +99,8 @@ const ComparibleColors = ({
9999
fontSize: 12,
100100
fontWeight: 500,
101101
marginTop: 3,
102+
...defaultStyles.rbgcpComparibleLabel,
102103
}}
103-
className={classes.rbgcpComparibleLabel}
104104
>
105105
Triad
106106
</div>
@@ -130,8 +130,8 @@ const ComparibleColors = ({
130130
fontSize: 12,
131131
fontWeight: 500,
132132
marginTop: 3,
133+
...defaultStyles.rbgcpComparibleLabel,
133134
}}
134-
className={classes.rbgcpComparibleLabel}
135135
>
136136
Tetrad
137137
</div>

0 commit comments

Comments
 (0)