color-elements 0.0.1 → 0.0.2

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 (47) hide show
  1. package/README.md +33 -11
  2. package/_build/copy-config.js +11 -1
  3. package/_build/copy-config.json +1 -1
  4. package/_build/eleventy.js +21 -0
  5. package/_build/filters-extra.js +3 -0
  6. package/_data/components.json +8 -0
  7. package/_includes/component.njk +61 -0
  8. package/_includes/partials/_nav-links.njk +12 -0
  9. package/_redirects +1 -1
  10. package/assets/js/index.js +8 -7
  11. package/eslint.config.js +316 -0
  12. package/index.js +6 -4
  13. package/logo.svg +22 -44
  14. package/package.json +11 -5
  15. package/src/channel-slider/README.md +123 -0
  16. package/src/channel-slider/channel-slider.css +19 -0
  17. package/src/channel-slider/channel-slider.js +252 -0
  18. package/{color-gamut → src/color-gamut}/README.md +1 -1
  19. package/{color-gamut → src/color-gamut}/color-gamut.js +1 -1
  20. package/src/color-inline/README.md +31 -0
  21. package/{color-swatch/color-swatch.js → src/color-inline/color-inline.js} +6 -6
  22. package/src/color-inline/style.css +14 -0
  23. package/src/color-picker/README.md +48 -0
  24. package/src/color-picker/color-picker.css +20 -0
  25. package/src/color-picker/color-picker.js +164 -0
  26. package/src/color-slider/README.md +193 -0
  27. package/src/color-slider/color-slider.css +164 -0
  28. package/src/color-slider/color-slider.js +278 -0
  29. package/src/color-swatch/README.md +100 -0
  30. package/src/color-swatch/color-swatch.css +95 -0
  31. package/{css-color/css-color.js → src/color-swatch/color-swatch.js} +30 -8
  32. package/src/common/color.js +12 -0
  33. package/src/common/dom.js +61 -0
  34. package/src/common/util.js +142 -0
  35. package/src/index.js.njk +7 -0
  36. package/src/src.json +3 -0
  37. package/_data/eleventyComputed.11tydata.js +0 -29
  38. package/color-slider/README.md +0 -84
  39. package/color-slider/color-slider.js +0 -79
  40. package/color-slider/style.css +0 -65
  41. package/color-swatch/index.njk +0 -40
  42. package/common/attributes.js +0 -68
  43. package/common/color.js +0 -10
  44. package/css-color/index.njk +0 -43
  45. package/css-color/style.css +0 -67
  46. /package/{color-gamut/style.css → src/color-gamut/color-gamut.css} +0 -0
  47. /package/{color-swatch/color-swatch.css → src/color-inline/color-inline.css} +0 -0
package/README.md CHANGED
@@ -1,33 +1,55 @@
1
- # Color.js Web Components
1
+ # Color Elements
2
2
 
3
- These are some highly experimental color-related web components.
3
+ These are some **highly experimental** color-related web components.
4
4
  Use at your own risk, the API can change at any point.
5
5
 
6
6
  ## Usage
7
7
 
8
+ ### CDN
9
+
8
10
  To include all components at once:
9
11
 
10
12
  ```html
11
- <script src="https://colorjs.io/elements/index.js"></script>
13
+ <script src="https://elements.colorjs.io/index.js"></script>
12
14
  ```
13
15
 
14
16
  To cherry-pick individual components, follow the instructions within the component’s page, but it generally looks like this:
15
17
 
16
18
  ```html
17
- <script src="https://colorjs.io/elements/COMPONENT_NAME/COMPONENT_NAME.js"></script>
19
+ <script src="https://elements.colorjs.io/src/COMPONENT_NAME/COMPONENT_NAME.js"></script>
20
+ ```
21
+
22
+ Each component imports its own dependencies and styles.
23
+
24
+ ### NPM
25
+
26
+ As usual:
27
+
28
+ ```bash
29
+ npm i color-elements
18
30
  ```
19
31
 
20
- or if using a bundler:
32
+ and then:
21
33
 
22
34
  ```js
23
35
  import "color-elements";
24
36
  ```
25
37
 
26
- Then just start using it!
38
+ You can also import individual components:
39
+
40
+ ```js
41
+ import "color-elements/COMPONENT_NAME";
42
+ ```
43
+
44
+ ## All elements
45
+
46
+ - [`<color-picker>`](src/color-picker/)
47
+ - [`<color-slider>`](src/color-slider/)
48
+ - [`<channel-slider>`](src/channel-slider/)
49
+ - [`<color-swatch>`](src/color-swatch/)
50
+ - [`<color-inline>`](src/color-inline/)
51
+ - [`<color-gamut>`](src/color-gamut/)
27
52
 
28
- ## Components
53
+ ### Upcoming:
29
54
 
30
- - [`<css-color>`](./css-color/)
31
- - [`<color-swatch>`](./color-swatch/)
32
- - [`<color-gamut>`](./color-gamut/)
33
- - [`<color-slider>`](./color-slider/)
55
+ - `<color-plane>`
@@ -12,8 +12,18 @@ let commands = [
12
12
  `git clone ${ config.source } ${ TEMP_REPO }`,
13
13
  ...config.paths.map(path => {
14
14
  let [current_path, new_path] = Array.isArray(path) ? path : [path, path];
15
+ let new_path_dir = new_path.split("/").slice(0, -1).join("/");
15
16
 
16
- return `rm -rf ./${new_path} && cp -r ${TEMP_REPO}/${ current_path } ./${ new_path }`;
17
+ let commands = [
18
+ `rm -rf ./${new_path}`,
19
+ `cp -r ${TEMP_REPO}/${ current_path } ./${ new_path }`,
20
+ ];
21
+
22
+ if (new_path_dir) {
23
+ commands.splice(1, 0, `mkdir -p ./${new_path_dir}`);
24
+ }
25
+
26
+ return commands.join(" && ");
17
27
  }),
18
28
  ];
19
29
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "source": "https://github.com/color-js/color.js",
3
3
  "paths": [
4
- "_includes/partials",
4
+ "_includes/partials/_nav.njk",
5
5
  "_includes/page.njk",
6
6
  "_includes/plain.njk",
7
7
  "_data/eleventyComputed.js",
@@ -1,10 +1,21 @@
1
+ import markdownIt from "markdown-it";
2
+ import markdownItAttrs from "markdown-it-attrs";
1
3
  import configOriginal from "./eleventy-original.js";
4
+ import * as filters from "./filters-extra.js";
2
5
 
3
6
  let data = {
4
7
  "permalink": "{{ page.filePathStem | replace('README', '') | replace('index', '') }}/index.html",
5
8
  "body_classes": "cn-ignore"
6
9
  };
7
10
 
11
+ let md = markdownIt({
12
+ html: true,
13
+ linkify: true,
14
+ typographer: true,
15
+ })
16
+ .disable("code")
17
+ .use(markdownItAttrs);
18
+
8
19
  export default config => {
9
20
  let ret = configOriginal(config);
10
21
 
@@ -12,5 +23,15 @@ export default config => {
12
23
  config.addGlobalData(prop, data[prop]);
13
24
  }
14
25
 
26
+ for (let f in filters) {
27
+ config.addFilter(f, filters[f]);
28
+ }
29
+
30
+ config.setLibrary("md", md);
31
+
32
+ config.addPairedShortcode("md", children => {
33
+ return md.render(children);
34
+ });
35
+
15
36
  return ret;
16
37
  };
@@ -0,0 +1,3 @@
1
+ export function tag_to_class (tag) {
2
+ return tag?.replace(/(?:^|-)([a-z])/g, ($0, $1) => $1.toUpperCase());
3
+ }
@@ -0,0 +1,8 @@
1
+ [
2
+ "color-picker",
3
+ "color-swatch",
4
+ "color-inline",
5
+ "channel-slider",
6
+ "color-slider",
7
+ "color-gamut"
8
+ ]
@@ -0,0 +1,61 @@
1
+ ---js
2
+ {
3
+ layout: "page.njk",
4
+ body_classes: "cn-ignore component-page",
5
+ eleventyComputed: {
6
+ name: function (data) {
7
+ let url = data.page.url;
8
+ if (url.includes("/src/")) {
9
+ return url.match(/\/src\/([^/]+)/)[1];
10
+ }
11
+ },
12
+ tag: function (data) {
13
+ let name = data.name;
14
+ if (name) {
15
+ return `<${name}>`;
16
+ }
17
+ },
18
+ title: function (data) {
19
+ return data.title ?? data.tag;
20
+ },
21
+ }
22
+ }
23
+ ---
24
+
25
+ <script src="{{ page | relative }}/index.js" type="module"></script>
26
+ <script src="{{ name }}.js" type="module"></script>
27
+
28
+ {{ content | safe }}
29
+
30
+ <section id="installation">
31
+ {% md %}
32
+ ## Installation
33
+
34
+ To install all color elements, check out the [instructions on the homepage](../).
35
+ The rest of this section is about using _only_ `{{ tag | safe }}`.
36
+
37
+ The quick and dirty way is straight from the CDN (kindly provided by [Netlify](https://www.netlify.com/)):
38
+
39
+ ```html
40
+ <script src="https://elements.colorjs.io/src/{{ name }}/{{ name }}.js" type="module"></script>
41
+ ```
42
+
43
+ or in JS:
44
+
45
+ ```js
46
+ import "https://elements.colorjs.io/src/{{ name }}/{{ name }}.js";
47
+ ```
48
+
49
+ If you are using npm to manage your dependencies, you can import it via:
50
+
51
+ ```js
52
+ import "color-elements/{{ name }}";
53
+ ```
54
+
55
+ or:
56
+
57
+ ```js
58
+ import { {{ name | tag_to_class }} } from "color-elements";
59
+ ```
60
+ {% endmd %}
61
+ </section>
@@ -0,0 +1,12 @@
1
+ <a href="https://colorjs.io">Color.js</a>
2
+ <div class="menu">
3
+ <a href="{{ page | relative }}">Elements</a>
4
+ <ul>
5
+ {% for name in components %}
6
+ <li><a href="{{ page | relative }}/src/{{ name }}/"><code>&lt;{{ name }}&gt;</code></a></span>
7
+ {% endfor %}
8
+ </ul>
9
+ </div>
10
+
11
+ <a href="https://github.com/color-js/elements">GitHub</a>
12
+ <a href="https://github.com/color-js/elements/issues/new" class="footer">File bug</a>
package/_redirects CHANGED
@@ -1,2 +1,2 @@
1
- node_modules/* lib/:splat 200
1
+ node_modules/:modulename/* https://cdn.jsdelivr.net/npm/:modulename@latest/:splat 200
2
2
  assets/* https://colorjs.io/assets/:splat 200
@@ -1,15 +1,16 @@
1
- import "https://colorjs.io/assets/js/index.js";
2
-
3
1
  import "https://colorjs.io/assets/js//prism.js";
4
- // import "https://blissfuljs.com/bliss.shy.js";
5
- // import "https://live.prismjs.com/src/prism-live.mjs?load=javascript";
6
- // import "https://colorjs.io/notebook/color-notebook.js";
7
2
  import "https://colorjs.io/assets/js/colors.js";
8
- import { styleCallouts } from "https://colorjs.io/assets/js/enhance.js";
9
3
 
4
+ import { styleCallouts } from "https://colorjs.io/assets/js/enhance.js";
10
5
  styleCallouts();
11
6
 
12
7
  let root = document.documentElement;
13
8
  document.addEventListener("scroll", evt => {
14
9
  root.style.setProperty("--scrolltop", root.scrollTop);
15
- }, {passive: true});
10
+ }, {passive: true});
11
+
12
+ import HTMLDemoElement from "https://nudeui.com/elements/html-demo/html-demo.js";
13
+
14
+ if (document.body.classList.contains("component-page")) {
15
+ HTMLDemoElement.wrapAll();
16
+ }
@@ -0,0 +1,316 @@
1
+ import globals from "globals";
2
+ import stylistic from "@stylistic/eslint-plugin";
3
+
4
+ export default [
5
+ {
6
+ languageOptions: {
7
+ ecmaVersion: 2022,
8
+ sourceType: "module",
9
+ globals: {
10
+ ...globals.browser,
11
+ },
12
+ },
13
+ plugins: {
14
+ "@stylistic": stylistic,
15
+ },
16
+ rules: {
17
+ /**
18
+ * ESLint rules: https://eslint.org/docs/latest/rules/
19
+ * Based off of: https://github.com/eslint/eslint/blob/v8.54.0/packages/js/src/configs/eslint-recommended.js
20
+ */
21
+ // Enforce curly braces for all control statements
22
+ // https://eslint.org/docs/latest/rules/curly
23
+ curly: 1,
24
+
25
+ // Require `super()` calls in constructors
26
+ // https://eslint.org/docs/latest/rules/constructor-super
27
+ "constructor-super": 1,
28
+
29
+ // Enforce “for” loop update clause moving the counter in the right direction
30
+ // https://eslint.org/docs/latest/rules/for-direction
31
+ "for-direction": 1,
32
+
33
+ // Enforce `return` statements in getters
34
+ // https://eslint.org/docs/latest/rules/getter-return
35
+ "getter-return": 1,
36
+
37
+ // Disallow using an async function as a Promise executor
38
+ // https://eslint.org/docs/latest/rules/no-async-promise-executor
39
+ "no-async-promise-executor": 1,
40
+
41
+ // Disallow `let`/const`/function`/`class` in `case`/`default` clauses
42
+ // https://eslint.org/docs/latest/rules/no-case-declarations
43
+ "no-case-declarations": 1,
44
+
45
+ // Disallow reassigning class members
46
+ // https://eslint.org/docs/latest/rules/no-class-assign
47
+ "no-class-assign": 1,
48
+
49
+ // Disallow comparing against -0
50
+ // https://eslint.org/docs/latest/rules/no-compare-neg-zero
51
+ "no-compare-neg-zero": 1,
52
+
53
+ // Disallow reassigning `const` variables
54
+ // https://eslint.org/docs/latest/rules/no-const-assign
55
+ "no-const-assign": 1,
56
+
57
+ // Disallow constant expressions in conditions
58
+ // https://eslint.org/docs/latest/rules/no-constant-condition
59
+ "no-constant-condition": 1,
60
+
61
+ // Disallow control characters in regular expressions
62
+ // https://eslint.org/docs/latest/rules/no-control-regex
63
+ "no-control-regex": 1,
64
+
65
+ // Disallow the use of `debugger`
66
+ // https://eslint.org/docs/latest/rules/no-debugger
67
+ "no-debugger": 1,
68
+
69
+ // Disallow deleting variables
70
+ // https://eslint.org/docs/latest/rules/no-delete-var
71
+ "no-delete-var": 1,
72
+
73
+ // Disallow duplicate arguments in `function` definitions
74
+ // https://eslint.org/docs/latest/rules/no-dupe-args
75
+ "no-dupe-args": 1,
76
+
77
+ // Disallow duplicate class members
78
+ // https://eslint.org/docs/latest/rules/no-dupe-class-members
79
+ "no-dupe-class-members": 1,
80
+
81
+ // Disallow duplicate conditions in if-else-if chains
82
+ // https://eslint.org/docs/latest/rules/no-dupe-else-if
83
+ "no-dupe-else-if": 1,
84
+
85
+ // Disallow duplicate keys in object literals
86
+ // https://eslint.org/docs/latest/rules/no-dupe-keys
87
+ "no-dupe-keys": 1,
88
+
89
+ // Disallow duplicate case labels
90
+ // https://eslint.org/docs/latest/rules/no-duplicate-case
91
+ "no-duplicate-case": 1,
92
+
93
+ // Disallow empty character classes in regular expressions
94
+ // https://eslint.org/docs/latest/rules/no-empty-character-class
95
+ "no-empty-character-class": 1,
96
+
97
+ // Disallow empty destructuring patterns
98
+ // https://eslint.org/docs/latest/rules/no-empty-pattern
99
+ "no-empty-pattern": 1,
100
+
101
+ // Disallow reassigning exceptions in `catch` clauses
102
+ // https://eslint.org/docs/latest/rules/no-ex-assign
103
+ "no-ex-assign": 1,
104
+
105
+ // Disallow unnecessary boolean casts
106
+ // https://eslint.org/docs/latest/rules/no-extra-boolean-cast
107
+ "no-extra-boolean-cast": 1,
108
+
109
+ // Disallow fallthrough of `case` statements
110
+ // unless marked with a comment that matches `/falls?\s?through/i` regex
111
+ // https://eslint.org/docs/latest/rules/no-fallthrough
112
+ "no-fallthrough": 1,
113
+
114
+ // Disallow reassigning `function` declarations
115
+ // https://eslint.org/docs/latest/rules/no-func-assign
116
+ "no-func-assign": 1,
117
+
118
+ // Disallow assignments to native objects or read-only global variables
119
+ // https://eslint.org/docs/latest/rules/no-global-assign
120
+ "no-global-assign": 1,
121
+
122
+ // Disallow assigning to imported bindings
123
+ // https://eslint.org/docs/latest/rules/no-import-assign
124
+ "no-import-assign": 1,
125
+
126
+ // Disallow invalid regular expression strings in `RegExp` constructors
127
+ // https://eslint.org/docs/latest/rules/no-invalid-regexp
128
+ "no-invalid-regexp": 1,
129
+
130
+ // Disallow whitespace that is not `tab` or `space` except in string literals
131
+ // https://eslint.org/docs/latest/rules/no-irregular-whitespace
132
+ "no-irregular-whitespace": 1,
133
+
134
+ // Disallow characters which are made with multiple code points in character class syntax
135
+ // https://eslint.org/docs/latest/rules/no-misleading-character-class
136
+ "no-misleading-character-class": 1,
137
+
138
+ // Disallow `new` operators with the `Symbol` object
139
+ // https://eslint.org/docs/latest/rules/no-new-symbol
140
+ "no-new-symbol": 1,
141
+
142
+ // Disallow `\8` and `\9` escape sequences in string literals
143
+ // https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
144
+ "no-nonoctal-decimal-escape": 1,
145
+
146
+ // Disallow calling global object properties as functions
147
+ // https://eslint.org/docs/latest/rules/no-obj-calls
148
+ "no-obj-calls": 1,
149
+
150
+ // Disallow octal literals
151
+ // https://eslint.org/docs/latest/rules/no-octal
152
+ "no-octal": 1,
153
+
154
+ // Disallow calling some `Object.prototype` methods directly on objects
155
+ // https://eslint.org/docs/latest/rules/no-prototype-builtins
156
+ "no-prototype-builtins": 1,
157
+
158
+ // Disallow multiple spaces in regular expressions
159
+ // https://eslint.org/docs/latest/rules/no-regex-spaces
160
+ "no-regex-spaces": 1,
161
+
162
+ // Disallow assignments where both sides are exactly the same
163
+ // https://eslint.org/docs/latest/rules/no-self-assign
164
+ "no-self-assign": 1,
165
+
166
+ // Disallow identifiers from shadowing restricted names
167
+ // https://eslint.org/docs/latest/rules/no-shadow-restricted-names
168
+ "no-shadow-restricted-names": 1,
169
+
170
+ // Disallow `this`/`super` before calling `super()` in constructors
171
+ // https://eslint.org/docs/latest/rules/no-this-before-super
172
+ "no-this-before-super": 1,
173
+
174
+ // Disallow the use of undeclared variables unless mentioned in `/*global */` comments
175
+ // https://eslint.org/docs/latest/rules/no-undef
176
+ // TODO: At-risk; subject to change.
177
+ "no-undef": 1,
178
+
179
+ // Disallow confusing multiline expressions
180
+ // https://eslint.org/docs/latest/rules/no-unexpected-multiline
181
+ // TODO: At-risk; subject to change.
182
+ "no-unexpected-multiline": 1,
183
+
184
+ // Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements
185
+ // https://eslint.org/docs/latest/rules/no-unreachable
186
+ "no-unreachable": 1,
187
+
188
+ // Disallow control flow statements in `finally` blocks
189
+ // https://eslint.org/docs/latest/rules/no-unsafe-finally
190
+ "no-unsafe-finally": 1,
191
+
192
+ // Disallow negating the left operand of relational operators
193
+ // https://eslint.org/docs/latest/rules/no-unsafe-negation
194
+ "no-unsafe-negation": 1,
195
+
196
+ // Disallow use of optional chaining in contexts where the `undefined` value is not allowed
197
+ // https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
198
+ "no-unsafe-optional-chaining": 1,
199
+
200
+ // Disallow unused labels
201
+ // https://eslint.org/docs/latest/rules/no-unused-labels
202
+ "no-unused-labels": 1,
203
+
204
+ // Disallow useless backreferences in regular expressions
205
+ // https://eslint.org/docs/latest/rules/no-useless-backreference
206
+ "no-useless-backreference": 1,
207
+
208
+ // Disallow unnecessary calls to `.call()` and `.apply()`
209
+ // https://eslint.org/docs/latest/rules/no-useless-call
210
+ "no-useless-call": 1,
211
+
212
+ // Disallow unnecessary `catch` clauses
213
+ // https://eslint.org/docs/latest/rules/no-useless-catch
214
+ "no-useless-catch": 1,
215
+
216
+ // Disallow unnecessary escape characters
217
+ // https://eslint.org/docs/latest/rules/no-useless-escape
218
+ "no-useless-escape": 1,
219
+
220
+ // Disallow `with` statements
221
+ // https://eslint.org/docs/latest/rules/no-with
222
+ "no-with": 1,
223
+
224
+ // Require generator functions to contain `yield`
225
+ // https://eslint.org/docs/latest/rules/require-yield
226
+ "require-yield": 1,
227
+
228
+ // Require calls to `isNaN()` when checking for `NaN`
229
+ // https://eslint.org/docs/latest/rules/use-isnan
230
+ "use-isnan": 1,
231
+
232
+ // Enforce comparing `typeof` expressions against valid strings
233
+ // https://eslint.org/docs/latest/rules/valid-typeof
234
+ "valid-typeof": 1,
235
+
236
+ /**
237
+ * ESLint Stylistic rules: https://eslint.style/packages/default#rules
238
+ */
239
+ // Enforce a space before and after `=>` in arrow functions
240
+ // https://eslint.style/rules/default/arrow-spacing
241
+ "@stylistic/arrow-spacing": 1,
242
+
243
+ // Enforce consistent brace style for blocks
244
+ // https://eslint.style/rules/default/brace-style
245
+ "@stylistic/brace-style": [1, "stroustrup"],
246
+
247
+ // Enforce trailing commas unless closing `]` or `}` is on the same line
248
+ // https://eslint.style/rules/default/comma-dangle
249
+ "@stylistic/comma-dangle": [1, "always-multiline"],
250
+
251
+ // Enforce no space before and one or more spaces after a comma
252
+ // https://eslint.style/rules/default/comma-spacing
253
+ "@stylistic/comma-spacing": 1,
254
+
255
+ // Require newline at the end of files
256
+ // https://eslint.style/rules/default/eol-last
257
+ "@stylistic/eol-last": 1,
258
+
259
+ // Enforce consistent indentation
260
+ // https://eslint.style/rules/default/indent
261
+ "@stylistic/indent": [1, "tab", { SwitchCase: 1, outerIIFEBody: 0 }],
262
+
263
+ // Enforce consistent spacing before and after keywords
264
+ // https://eslint.style/rules/default/keyword-spacing
265
+ "@stylistic/keyword-spacing": 1,
266
+
267
+ // Disallow unnecessary semicolons
268
+ // https://eslint.style/rules/default/no-extra-semi
269
+ "@stylistic/no-extra-semi": 1,
270
+
271
+ // Disallow mixed spaces and tabs for indentation
272
+ // https://eslint.style/rules/default/no-mixed-spaces-and-tabs
273
+ "@stylistic/no-mixed-spaces-and-tabs": [1, "smart-tabs"],
274
+
275
+ // Disallow trailing whitespace at the end of lines
276
+ // https://eslint.style/rules/default/no-trailing-spaces
277
+ "@stylistic/no-trailing-spaces": 1,
278
+
279
+ // Enforce the consistent use of double quotes
280
+ // https://eslint.style/rules/default/quotes
281
+ "@stylistic/quotes": [
282
+ 1,
283
+ "double",
284
+ { avoidEscape: true, allowTemplateLiterals: true },
285
+ ],
286
+
287
+ // Require semicolons instead of ASI
288
+ // https://eslint.style/rules/default/semi
289
+ "@stylistic/semi": 1,
290
+
291
+ // Enforce at least one space before blocks
292
+ // https://eslint.style/rules/default/space-before-blocks
293
+ "@stylistic/space-before-blocks": 1,
294
+
295
+ // Enforce a space before `function` definition opening parenthesis
296
+ // https://eslint.style/rules/default/space-before-function-paren
297
+ "@stylistic/space-before-function-paren": 1,
298
+
299
+ // Require spaces around infix operators (e.g. `+`, `=`, `?`, `:`)
300
+ // https://eslint.style/rules/default/space-infix-ops
301
+ "@stylistic/space-infix-ops": 1,
302
+
303
+ // Enforce a space after unary word operators (`new`, `delete`, `typeof`, `void`, `yield`)
304
+ // https://eslint.style/rules/default/space-unary-ops
305
+ "@stylistic/space-unary-ops": 1,
306
+
307
+ // Enforce whitespace after the `//` or `/*` in a comment
308
+ // https://eslint.style/rules/default/spaced-comment
309
+ "@stylistic/spaced-comment": [
310
+ 1,
311
+ "always",
312
+ { block: { exceptions: ["*"] } },
313
+ ],
314
+ },
315
+ },
316
+ ];
package/index.js CHANGED
@@ -1,4 +1,6 @@
1
- export { default as ColorSlider } from './color-slider/color-slider.js';
2
- export { default as ColorSwatch } from './color-swatch/color-swatch.js';
3
- export { default as CSSColor } from './css-color/css-color.js';
4
- export { default as ColorGamut } from './color-gamut/color-gamut.js';
1
+ export { default as ColorPicker } from "./src/color-picker/color-picker.js";
2
+ export { default as ColorSwatch } from "./src/color-swatch/color-swatch.js";
3
+ export { default as ColorInline } from "./src/color-inline/color-inline.js";
4
+ export { default as ChannelSlider } from "./src/channel-slider/channel-slider.js";
5
+ export { default as ColorSlider } from "./src/color-slider/color-slider.js";
6
+ export { default as ColorGamut } from "./src/color-gamut/color-gamut.js";
package/logo.svg CHANGED
@@ -1,30 +1,36 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -625 630 615" overflow="visible" height="600">
2
2
  <desc>Based on u*,v* UCS diagram</desc>
3
3
  <style>
4
+
4
5
  #tongue {
5
6
  fill: hsl(220, 10%, 48%);
6
7
  }
7
8
 
8
- .color-space polygon {
9
- fill: none;
9
+ text {
10
+ stroke: hsl(220, 10%, 94%);
11
+ stroke-width: .1em;
12
+ stroke-linejoin: round;
13
+ font: 800 333px/1 system-ui, sans-serif;
14
+ text-anchor: middle;
15
+ dominant-baseline: middle;
16
+ letter-spacing: -.06em;
17
+ paint-order: stroke fill;
10
18
  }
11
19
 
12
- .color-space circle,
13
- .color-space polygon {
14
- stroke: hsl(220, 10%, 88%);
15
- stroke-width: 30px;
20
+ .lt {
21
+ fill: hsl(0, 80%, 50%);
16
22
  }
17
23
 
18
- .color-space circle {
19
- stroke-width: 22px;
24
+ .slash {
25
+ fill: hsl(90, 50%, 45%);
20
26
  }
21
27
 
22
- #white-point {
23
- fill: white;
28
+ .gt {
29
+ fill: hsl(210 80% 55%);
24
30
  }
25
31
 
26
32
  </style>
27
-
33
+ <!-- <rect x="0" y="-625" width="630" height="615" fill="hsl(60, 100%, 50%)"/> -->
28
34
  <path id="tongue" d="M 256.804 -16.594
29
35
  L 256.637 -16.593
30
36
  L 256.418 -16.266
@@ -120,39 +126,11 @@
120
126
  L 623.393 -506.491
121
127
  Z"/>
122
128
 
123
- <!-- White point -->
124
- <!-- <circle r="12" cx="197.83" cy="-468.32" id="white-point" /> -->
125
-
126
- <!-- sRGB
127
- red 450.70423, 522.88732
128
- green 125, 562.5
129
- blue 175.4386, 157.89474
130
- white 197.83001, 468.31999
131
-
132
- <g class="color-space" id="srgb">
133
- <polygon points="450.7, -522.887 125, -562.5 175.44, -157.89"/>
134
-
135
- <circle r="36" cx="450.7" cy="-522.887" fill="hsl(0, 80%, 50%)" />
136
- <circle r="36" cx="125" cy="-562.5" fill="hsl(90, 50%, 45%)" />
137
- <circle r="36" cx="175.44" cy="-157.89" fill="hsl(210 80% 55%)" />
138
- </g>
139
- -->
140
-
141
- <!-- display-p3000
142
- red 496.35036, 525.54745
143
- green 98.60465, 577.67442
144
- blue 175.4386, 157.89474
145
- white 197.83001, 468.31999
146
- -->
147
- <g class="color-space" id="p3">
148
- <polygon points="496.35, -525.54 98.6, -577.67 175.44, -157.89"/>
149
-
150
- <circle r="36" cx="496.35" cy="-525.54" fill="hsl(0, 80%, 50%)" />
151
- <circle r="36" cx="98.6" cy="-577.67" fill="hsl(90, 50%, 45%)" />
152
- <circle r="36" cx="175.44" cy="-157.89" fill="hsl(210 80% 55%)" />
153
- </g>
154
-
155
-
129
+ <text x="44%" y="-55%">
130
+ <tspan class="lt">&lt;</tspan>
131
+ <tspan class="slash">/</tspan>
132
+ <tspan class="gt">&gt;</tspan>
133
+ </text>
156
134
 
157
135
 
158
136