@lowdefy/blocks-color-selectors 4.0.0-alpha.7 → 4.0.0-alpha.8

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 (29) hide show
  1. package/README.md +1 -1
  2. package/dist/blocks/ColorSelector/ColorPicker.js +66 -0
  3. package/dist/blocks/ColorSelector/ColorSelector.js +18 -15
  4. package/dist/blocks/ColorSelector/schema.json +8 -33
  5. package/dist/blocks/ColorSelector/style.less +56 -0
  6. package/dist/blocks/ColorSelector/useClickOutside.js +46 -0
  7. package/dist/blocks.js +0 -7
  8. package/package.json +9 -8
  9. package/dist/blocks/ChromeColorSelector/ChromeColorSelector.js +0 -75
  10. package/dist/blocks/ChromeColorSelector/schema.json +0 -99
  11. package/dist/blocks/ChromeColorSelector/style.less +0 -17
  12. package/dist/blocks/CircleColorSelector/CircleColorSelector.js +0 -93
  13. package/dist/blocks/CircleColorSelector/schema.json +0 -156
  14. package/dist/blocks/CircleColorSelector/style.less +0 -17
  15. package/dist/blocks/CompactColorSelector/CompactColorSelector.js +0 -71
  16. package/dist/blocks/CompactColorSelector/schema.json +0 -144
  17. package/dist/blocks/CompactColorSelector/style.less +0 -17
  18. package/dist/blocks/GithubColorSelector/GithubColorSelector.js +0 -73
  19. package/dist/blocks/GithubColorSelector/schema.json +0 -138
  20. package/dist/blocks/GithubColorSelector/style.less +0 -17
  21. package/dist/blocks/SliderColorSelector/SliderColorSelector.js +0 -69
  22. package/dist/blocks/SliderColorSelector/schema.json +0 -96
  23. package/dist/blocks/SliderColorSelector/style.less +0 -17
  24. package/dist/blocks/SwatchesColorSelector/SwatchesColorSelector.js +0 -72
  25. package/dist/blocks/SwatchesColorSelector/schema.json +0 -146
  26. package/dist/blocks/SwatchesColorSelector/style.less +0 -17
  27. package/dist/blocks/TwitterColorSelector/TwitterColorSelector.js +0 -66
  28. package/dist/blocks/TwitterColorSelector/schema.json +0 -125
  29. package/dist/blocks/TwitterColorSelector/style.less +0 -17
@@ -1,156 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "type": "object",
5
- "properties": {
6
- "circleSize": {
7
- "type": "number",
8
- "description": "Pixel value for circle size.",
9
- "default": 28
10
- },
11
- "circleSpacing": {
12
- "type": "number",
13
- "description": "Pixel value for spacing between circles.",
14
- "default": 14
15
- },
16
- "colors": {
17
- "type": "array",
18
- "description": "Colors to display.",
19
- "default": [
20
- "#f44336",
21
- "#e91e63",
22
- "#9c27b0",
23
- "#673ab7",
24
- "#3f51b5",
25
- "#2196f3",
26
- "#03a9f4",
27
- "#00bcd4",
28
- "#009688",
29
- "#4caf50",
30
- "#8bc34a",
31
- "#cddc39",
32
- "#ffeb3b",
33
- "#ffc107",
34
- "#ff9800",
35
- "#ff5722",
36
- "#795548",
37
- "#607d8b"
38
- ],
39
- "items": {
40
- "type": "string",
41
- "docs": {
42
- "displayType": "color"
43
- }
44
- }
45
- },
46
- "defaultColor": {
47
- "type": "string",
48
- "default": "#000000",
49
- "description": "Default color to display if input value is null.",
50
- "docs": {
51
- "displayType": "color"
52
- }
53
- },
54
- "inputStyle": {
55
- "type": "object",
56
- "description": "Css style to applied to input.",
57
- "docs": {
58
- "displayType": "yaml"
59
- }
60
- },
61
- "valueStyle": {
62
- "type": "object",
63
- "description": "Css style to applied to value text when is displayed.",
64
- "docs": {
65
- "displayType": "yaml"
66
- }
67
- },
68
- "showValue": {
69
- "type": "boolean",
70
- "description": "Display the selector value next to the circle selector.",
71
- "default": false
72
- },
73
- "label": {
74
- "type": "object",
75
- "description": "Label properties.",
76
- "additionalProperties": false,
77
- "properties": {
78
- "align": {
79
- "type": "string",
80
- "enum": ["left", "right"],
81
- "default": "left",
82
- "description": "Align label left or right when inline."
83
- },
84
- "colon": {
85
- "type": "boolean",
86
- "default": true,
87
- "description": "Append label with colon."
88
- },
89
- "extra": {
90
- "type": "string",
91
- "description": "Extra text to display beneath the content."
92
- },
93
- "title": {
94
- "type": "string",
95
- "description": "Label title."
96
- },
97
- "span": {
98
- "type": "number",
99
- "description": "Label inline span."
100
- },
101
- "disabled": {
102
- "type": "boolean",
103
- "default": false,
104
- "description": "Hide input label."
105
- },
106
- "hasFeedback": {
107
- "type": "boolean",
108
- "default": true,
109
- "description": "Display feedback extra from validation, this does not disable validation."
110
- },
111
- "inline": {
112
- "type": "boolean",
113
- "default": false,
114
- "description": "Render input and label inline."
115
- },
116
- "extraStyle": {
117
- "type": "object",
118
- "description": "Css style to applied to label extra.",
119
- "docs": {
120
- "displayType": "yaml"
121
- }
122
- },
123
- "feedbackStyle": {
124
- "type": "object",
125
- "description": "Css style to applied to label feedback.",
126
- "docs": {
127
- "displayType": "yaml"
128
- }
129
- }
130
- }
131
- },
132
- "title": {
133
- "type": "string",
134
- "description": "Title to describe the input component, if no title is specified the block id is displayed."
135
- },
136
- "width": {
137
- "type": ["string", "number"],
138
- "description": "Color selector width.",
139
- "default": "100%",
140
- "docs": {
141
- "displayType": "string"
142
- }
143
- }
144
- }
145
- },
146
- "events": {
147
- "type": "object",
148
- "additionalProperties": false,
149
- "properties": {
150
- "onChange": {
151
- "type": "array",
152
- "description": "Trigger actions when color is picked."
153
- }
154
- }
155
- }
156
- }
@@ -1,17 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- @import '@lowdefy/blocks-antd/blocks/Label/style.less';
@@ -1,71 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*
3
- Copyright 2020-2021 Lowdefy, Inc
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- */ import React from 'react';
17
- import CompactPicker from 'react-color/lib/Compact.js';
18
- import { blockDefaultProps } from '@lowdefy/block-utils';
19
- import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
20
- const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
21
- return(/*#__PURE__*/ _jsx(Label, {
22
- blockId: blockId,
23
- loading: loading,
24
- methods: methods,
25
- properties: {
26
- title: properties.title,
27
- size: properties.size,
28
- ...properties.label
29
- },
30
- required: required,
31
- validation: validation,
32
- content: {
33
- content: ()=>/*#__PURE__*/ _jsx(CompactPicker, {
34
- id: `${blockId}_input`,
35
- className: methods.makeCssClass([
36
- {
37
- marginBottom: '0px !important'
38
- },
39
- properties.inputStyle,
40
- ]),
41
- color: value || properties.defaultColor || '#000000',
42
- colors: properties.colors,
43
- onChangeComplete: (color)=>{
44
- methods.setValue(color.hex ? color.hex : '#000000');
45
- methods.triggerEvent({
46
- name: 'onChange'
47
- });
48
- }
49
- })
50
- }
51
- }));
52
- };
53
- Selector.defaultProps = blockDefaultProps;
54
- Selector.meta = {
55
- valueType: 'string',
56
- category: 'input',
57
- loading: {
58
- type: 'Skeleton',
59
- properties: {
60
- width: 245,
61
- height: 90
62
- }
63
- },
64
- icons: [
65
- ...Label.meta.icons
66
- ],
67
- styles: [
68
- 'blocks/CompactColorSelector/style.less'
69
- ]
70
- };
71
- export default Selector;
@@ -1,144 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "type": "object",
5
- "properties": {
6
- "colors": {
7
- "type": "array",
8
- "description": "Colors to display.",
9
- "default": [
10
- "#4D4D4D",
11
- "#999999",
12
- "#FFFFFF",
13
- "#F44E3B",
14
- "#FE9200",
15
- "#FCDC00",
16
- "#DBDF00",
17
- "#A4DD00",
18
- "#68CCCA",
19
- "#73D8FF",
20
- "#AEA1FF",
21
- "#FDA1FF",
22
- "#333333",
23
- "#808080",
24
- "#cccccc",
25
- "#D33115",
26
- "#E27300",
27
- "#FCC400",
28
- "#B0BC00",
29
- "#68BC00",
30
- "#16A5A5",
31
- "#009CE0",
32
- "#7B64FF",
33
- "#FA28FF",
34
- "#000000",
35
- "#666666",
36
- "#B3B3B3",
37
- "#9F0500",
38
- "#C45100",
39
- "#FB9E00",
40
- "#808900",
41
- "#194D33",
42
- "#0C797D",
43
- "#0062B1",
44
- "#653294",
45
- "#AB149E"
46
- ],
47
- "items": {
48
- "type": "string",
49
- "docs": {
50
- "displayType": "color"
51
- }
52
- }
53
- },
54
- "defaultColor": {
55
- "type": "string",
56
- "default": "#000000",
57
- "description": "Default color to display if input value is null.",
58
- "docs": {
59
- "displayType": "color"
60
- }
61
- },
62
- "inputStyle": {
63
- "type": "object",
64
- "description": "Css style to applied to input.",
65
- "docs": {
66
- "displayType": "yaml"
67
- }
68
- },
69
- "label": {
70
- "type": "object",
71
- "description": "Label properties.",
72
- "additionalProperties": false,
73
- "properties": {
74
- "align": {
75
- "type": "string",
76
- "enum": ["left", "right"],
77
- "default": "left",
78
- "description": "Align label left or right when inline."
79
- },
80
- "colon": {
81
- "type": "boolean",
82
- "default": true,
83
- "description": "Append label with colon."
84
- },
85
- "extra": {
86
- "type": "string",
87
- "description": "Extra text to display beneath the content."
88
- },
89
- "title": {
90
- "type": "string",
91
- "description": "Label title."
92
- },
93
- "span": {
94
- "type": "number",
95
- "description": "Label inline span."
96
- },
97
- "disabled": {
98
- "type": "boolean",
99
- "default": false,
100
- "description": "Hide input label."
101
- },
102
- "hasFeedback": {
103
- "type": "boolean",
104
- "default": true,
105
- "description": "Display feedback extra from validation, this does not disable validation."
106
- },
107
- "inline": {
108
- "type": "boolean",
109
- "default": false,
110
- "description": "Render input and label inline."
111
- },
112
- "extraStyle": {
113
- "type": "object",
114
- "description": "Css style to applied to label extra.",
115
- "docs": {
116
- "displayType": "yaml"
117
- }
118
- },
119
- "feedbackStyle": {
120
- "type": "object",
121
- "description": "Css style to applied to label feedback.",
122
- "docs": {
123
- "displayType": "yaml"
124
- }
125
- }
126
- }
127
- },
128
- "title": {
129
- "type": "string",
130
- "description": "Title to describe the input component, if no title is specified the block id is displayed."
131
- }
132
- }
133
- },
134
- "events": {
135
- "type": "object",
136
- "additionalProperties": false,
137
- "properties": {
138
- "onChange": {
139
- "type": "array",
140
- "description": "Trigger actions when color is picked."
141
- }
142
- }
143
- }
144
- }
@@ -1,17 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- @import '@lowdefy/blocks-antd/blocks/Label/style.less';
@@ -1,73 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*
3
- Copyright 2020-2021 Lowdefy, Inc
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- */ import React from 'react';
17
- import GithubPicker from 'react-color/lib/Github.js';
18
- import { blockDefaultProps } from '@lowdefy/block-utils';
19
- import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
20
- const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
21
- return(/*#__PURE__*/ _jsx(Label, {
22
- blockId: blockId,
23
- loading: loading,
24
- methods: methods,
25
- properties: {
26
- title: properties.title,
27
- size: properties.size,
28
- ...properties.label
29
- },
30
- required: required,
31
- validation: validation,
32
- content: {
33
- content: ()=>/*#__PURE__*/ _jsx(GithubPicker, {
34
- id: `${blockId}_input`,
35
- className: methods.makeCssClass([
36
- {
37
- marginBottom: '0px !important'
38
- },
39
- properties.inputStyle,
40
- ]),
41
- color: value || properties.defaultColor || '#000000',
42
- colors: properties.colors,
43
- triangle: properties.triangle || 'hide',
44
- width: properties.width || '100%',
45
- onChangeComplete: (color)=>{
46
- methods.setValue(color.hex ? color.hex : '#000000');
47
- methods.triggerEvent({
48
- name: 'onChange'
49
- });
50
- }
51
- })
52
- }
53
- }));
54
- };
55
- Selector.defaultProps = blockDefaultProps;
56
- Selector.meta = {
57
- valueType: 'string',
58
- category: 'input',
59
- loading: {
60
- type: 'Skeleton',
61
- properties: {
62
- width: 216,
63
- height: 62
64
- }
65
- },
66
- icons: [
67
- ...Label.meta.icons
68
- ],
69
- styles: [
70
- 'blocks/GithubColorSelector/style.less'
71
- ]
72
- };
73
- export default Selector;
@@ -1,138 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "type": "object",
5
- "properties": {
6
- "colors": {
7
- "type": "array",
8
- "description": "Colors to display.",
9
- "default": [
10
- "#B80000",
11
- "#DB3E00",
12
- "#FCCB00",
13
- "#008B02",
14
- "#006B76",
15
- "#1273DE",
16
- "#004DCF",
17
- "#5300EB",
18
- "#EB9694",
19
- "#FAD0C3",
20
- "#FEF3BD",
21
- "#C1E1C5",
22
- "#BEDADC",
23
- "#C4DEF6",
24
- "#BED3F3",
25
- "#D4C4FB"
26
- ],
27
- "items": {
28
- "type": "string",
29
- "docs": {
30
- "displayType": "color"
31
- }
32
- }
33
- },
34
- "defaultColor": {
35
- "type": "string",
36
- "default": "#000000",
37
- "description": "Default color to display if input value is null.",
38
- "docs": {
39
- "displayType": "color"
40
- }
41
- },
42
- "inputStyle": {
43
- "type": "object",
44
- "description": "Css style to applied to input.",
45
- "docs": {
46
- "displayType": "yaml"
47
- }
48
- },
49
- "label": {
50
- "type": "object",
51
- "description": "Label properties.",
52
- "additionalProperties": false,
53
- "properties": {
54
- "align": {
55
- "type": "string",
56
- "enum": ["left", "right"],
57
- "default": "left",
58
- "description": "Align label left or right when inline."
59
- },
60
- "colon": {
61
- "type": "boolean",
62
- "default": true,
63
- "description": "Append label with colon."
64
- },
65
- "extra": {
66
- "type": "string",
67
- "description": "Extra text to display beneath the content."
68
- },
69
- "title": {
70
- "type": "string",
71
- "description": "Label title."
72
- },
73
- "span": {
74
- "type": "number",
75
- "description": "Label inline span."
76
- },
77
- "disabled": {
78
- "type": "boolean",
79
- "default": false,
80
- "description": "Hide input label."
81
- },
82
- "hasFeedback": {
83
- "type": "boolean",
84
- "default": true,
85
- "description": "Display feedback extra from validation, this does not disable validation."
86
- },
87
- "inline": {
88
- "type": "boolean",
89
- "default": false,
90
- "description": "Render input and label inline."
91
- },
92
- "extraStyle": {
93
- "type": "object",
94
- "description": "Css style to applied to label extra.",
95
- "docs": {
96
- "displayType": "yaml"
97
- }
98
- },
99
- "feedbackStyle": {
100
- "type": "object",
101
- "description": "Css style to applied to label feedback.",
102
- "docs": {
103
- "displayType": "yaml"
104
- }
105
- }
106
- }
107
- },
108
- "title": {
109
- "type": "string",
110
- "description": "Title to describe the input component, if no title is specified the block id is displayed."
111
- },
112
- "triangle": {
113
- "type": "string",
114
- "enum": ["hide", "top-left", "top-right"],
115
- "default": "hide",
116
- "description": "Show triangle on color selector border."
117
- },
118
- "width": {
119
- "type": ["string", "number"],
120
- "description": "Color selector width.",
121
- "default": "100%",
122
- "docs": {
123
- "displayType": "string"
124
- }
125
- }
126
- }
127
- },
128
- "events": {
129
- "type": "object",
130
- "additionalProperties": false,
131
- "properties": {
132
- "onChange": {
133
- "type": "array",
134
- "description": "Trigger actions when color is picked."
135
- }
136
- }
137
- }
138
- }
@@ -1,17 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */
16
-
17
- @import '@lowdefy/blocks-antd/blocks/Label/style.less';