Skip to content

Commit 8d29fbe

Browse files
committed
v10 layout (#161)
* Drop gradients and vertical columize stuff * Custom slider * Drop unused babel eslint parser * Small adjustments to the xy controller * More details mode details * Refactoring * More simplification * Move more variables into configuration * Small tweaks, start hooking up color input * Fix color track ramps * More small color track adjustments * Monitor drag on the document not the element to avoid sticky behaviour * Simplify coordinate fetching and pass correct slider value to onchange handler * Pass disc radius as prop * More simlplification of coordinates checking * Use calc for disc pixel offset * tests * Simple test for the slider component * Saturations lightness color should hold steady * Small cleanup/consistencies * Feedback
1 parent 03df3d5 commit 8d29fbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4885
-2479
lines changed

.eslintrc

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"parser": "@babel/eslint-parser",
2+
"parser": "@typescript-eslint/parser",
33
"extends": [
4-
"eslint:recommended"
4+
"eslint:recommended", "plugin:@typescript-eslint/recommended"
55
],
66
"env": {
77
"es6": true,
@@ -15,6 +15,7 @@
1515
}
1616
},
1717
"plugins": [
18+
"@typescript-eslint",
1819
"react",
1920
"jest"
2021
],
@@ -34,21 +35,8 @@
3435
"react/no-direct-mutation-state": ["error"],
3536
"react/no-unknown-property": ["error"],
3637
"react/prefer-es6-class": ["error", "always"],
37-
"react/prop-types": ["error"],
3838
"react/react-in-jsx-scope": ["error"],
3939
"react/require-render-return": ["error"],
40-
"react/style-prop-object": ["error"],
41-
},
42-
"overrides": [
43-
{
44-
"files": [
45-
"**/*.ts?(x)"
46-
],
47-
"rules": {
48-
"no-unused-vars": [
49-
2
50-
]
51-
}
52-
}
53-
]
40+
"react/style-prop-object": ["error"]
41+
}
5442
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

example/colorpickr.css

Lines changed: 0 additions & 125 deletions
Large diffs are not rendered by default.

example/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<title>React colorpickr</title>
55
<link rel="canonical" href="https://labs.mapbox.com/react-colorpickr/" >
66
<link rel='shortcut icon' href='https://mapbox.com/img/favicon.ico' type='image/x-icon' />
7-
<link href="https://api.mapbox.com/mapbox-assembly/mbx/v1.0.1/assembly.min.css" rel="stylesheet">
8-
<script src="https://api.mapbox.com/mapbox-assembly/mbx/v1.0.1/assembly.js"></script>
7+
<link href="https://api.mapbox.com/mapbox-assembly/mbx/v1.3.1/assembly.min.css" rel="stylesheet">
8+
<script src="https://api.mapbox.com/mapbox-assembly/mbx/v1.3.1/assembly.js"></script>
99
<link href='colorpickr.css' rel='stylesheet' />
1010
</head>
1111
<body>
1212
<div class='wmax600 mx-auto'>
1313
<div class='py60 px36 px0-mm'>
1414
<header class='mb24'>
15-
<h1 class='txt-h1 txt-fancy'>react-colorpickr</h1>
15+
<h1 class='txt-h2 txt-fancy'>react-colorpickr</h1>
1616
<p class='txt-l mb24'>
1717
A colorpicker for <a class='link' href='https://facebook.github.io/react/'>React</a>. Fork it on <a class='link' href='https://github.com/mapbox/react-colorpickr/'>GitHub</a>.
1818
</p>

jest-setup.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable */
2+
global.ResizeObserver = class ResizeObserver {
3+
[x: string]: any;
4+
constructor(cb: any) {
5+
this.cb = cb;
6+
}
7+
observe() {
8+
this.cb([{ borderBoxSize: { inlineSize: 0, blockSize: 0 } }]);
9+
}
10+
unobserve() {}
11+
disconnect() {}
12+
};

0 commit comments

Comments
 (0)