@finsweet/webflow-apps-utils 1.0.12 → 1.0.14
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.
- package/dist/ui/components/color-picker/ColorPicker.stories.svelte +67 -3
- package/dist/ui/components/color-picker/ColorPicker.svelte +86 -11
- package/dist/ui/components/color-picker/ColorPicker.svelte.d.ts +25 -2
- package/dist/ui/components/color-picker/ColorSelect.stories.svelte +27 -4
- package/dist/ui/components/color-picker/ColorSelect.svelte +90 -9
- package/dist/ui/components/color-picker/ColorSelect.svelte.d.ts +24 -1
- package/dist/ui/components/layout/examples/ExampleLayout.svelte +2 -2
- package/dist/ui/components/tooltip/Tooltip.svelte +19 -1
- package/dist/ui/icons/ReceiptIcon.svelte +13 -0
- package/dist/ui/icons/ReceiptIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WorkspaceIcon.svelte +13 -0
- package/dist/ui/icons/WorkspaceIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/index.d.ts +3 -1
- package/dist/ui/icons/index.js +3 -1
- package/package.json +1 -1
|
@@ -5,7 +5,15 @@
|
|
|
5
5
|
import ColorPicker from './ColorPicker.svelte';
|
|
6
6
|
|
|
7
7
|
let controlledColor = $state('#00ff00');
|
|
8
|
-
const
|
|
8
|
+
const handleFullColorChange = (fullColor: {
|
|
9
|
+
hex: string;
|
|
10
|
+
rgb: { r: number; g: number; b: number; value: string };
|
|
11
|
+
rgba: { r: number; g: number; b: number; a: number; value: string };
|
|
12
|
+
hsb: { h: number; s: number; b: number; value: string };
|
|
13
|
+
alpha: number;
|
|
14
|
+
}) => {
|
|
15
|
+
console.log('Full color object:', fullColor);
|
|
16
|
+
};
|
|
9
17
|
|
|
10
18
|
const { Story } = defineMeta({
|
|
11
19
|
title: 'UI/ColorPicker',
|
|
@@ -16,7 +24,7 @@
|
|
|
16
24
|
control: { type: 'color' },
|
|
17
25
|
description: 'Selected color (hex string or writable store)'
|
|
18
26
|
},
|
|
19
|
-
|
|
27
|
+
oncolorchange: { action: 'fullColorChanged' }
|
|
20
28
|
},
|
|
21
29
|
parameters: {
|
|
22
30
|
layout: 'centered',
|
|
@@ -26,7 +34,7 @@
|
|
|
26
34
|
},
|
|
27
35
|
args: {
|
|
28
36
|
color: '#ff0000',
|
|
29
|
-
|
|
37
|
+
oncolorchange: fn()
|
|
30
38
|
}
|
|
31
39
|
});
|
|
32
40
|
</script>
|
|
@@ -40,3 +48,59 @@
|
|
|
40
48
|
<Story name="Edge: No Color" args={{ color: undefined }} />
|
|
41
49
|
|
|
42
50
|
<Story name="Disabled Picker" args={{ color: '#ebebeb', disabled: true }} />
|
|
51
|
+
|
|
52
|
+
<Story
|
|
53
|
+
name="Full Color Object Demo"
|
|
54
|
+
args={{ color: '#ff6600' }}
|
|
55
|
+
story={{
|
|
56
|
+
parameters: {
|
|
57
|
+
docs: {
|
|
58
|
+
description: {
|
|
59
|
+
story:
|
|
60
|
+
'Demonstrates the full color object callback. Open the color picker and interact with it to see the complete color object with hex, rgb, rgba, hsb, and alpha values in the Actions panel.'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}}
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
<Story
|
|
68
|
+
name="Alpha Channel Demo"
|
|
69
|
+
args={{
|
|
70
|
+
color: '#ff0000',
|
|
71
|
+
oncolorchange: (fullColor: {
|
|
72
|
+
hex: string;
|
|
73
|
+
rgb: { r: number; g: number; b: number; value: string };
|
|
74
|
+
rgba: { r: number; g: number; b: number; a: number; value: string };
|
|
75
|
+
hsb: { h: number; s: number; b: number; value: string };
|
|
76
|
+
alpha: number;
|
|
77
|
+
}) => {
|
|
78
|
+
console.log('Full color object:', fullColor);
|
|
79
|
+
}
|
|
80
|
+
}}
|
|
81
|
+
story={{
|
|
82
|
+
parameters: {
|
|
83
|
+
docs: {
|
|
84
|
+
description: {
|
|
85
|
+
story:
|
|
86
|
+
'Shows how alpha channel values are handled, oncolorchange now receive the same hex value with alpha channel when alpha < 100%. Check the console to see both callbacks receiving consistent values.'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<Story
|
|
94
|
+
name="Controlled Component"
|
|
95
|
+
args={{ color: controlledColor, oncolorchange: handleFullColorChange }}
|
|
96
|
+
story={{
|
|
97
|
+
parameters: {
|
|
98
|
+
docs: {
|
|
99
|
+
description: {
|
|
100
|
+
story:
|
|
101
|
+
'A controlled component example that demonstrates oncolorchange callback working together.'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
import Tooltip from '../tooltip/Tooltip.svelte';
|
|
3
3
|
import ColorSelect from './ColorSelect.svelte';
|
|
4
4
|
|
|
5
|
+
// Color object type definition
|
|
6
|
+
interface ColorObject {
|
|
7
|
+
hex: string;
|
|
8
|
+
rgb: { r: number; g: number; b: number; value: string };
|
|
9
|
+
rgba: { r: number; g: number; b: number; a: number; value: string };
|
|
10
|
+
hsb: { h: number; s: number; b: number; value: string };
|
|
11
|
+
alpha: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
interface Props {
|
|
6
15
|
/**
|
|
7
16
|
* The color to display in the picker.
|
|
8
17
|
*/
|
|
9
18
|
color?: string;
|
|
10
19
|
/**
|
|
11
|
-
* The function to call when the color changes.
|
|
20
|
+
* The function to call when the color changes with full color object.
|
|
12
21
|
*/
|
|
13
|
-
|
|
22
|
+
oncolorchange?: (fullColor: ColorObject) => void;
|
|
14
23
|
/**
|
|
15
24
|
* The width of the picker.
|
|
16
25
|
*/
|
|
@@ -21,14 +30,20 @@
|
|
|
21
30
|
disabled?: boolean;
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
let {
|
|
33
|
+
let {
|
|
34
|
+
color = $bindable('#fff'),
|
|
35
|
+
oncolorchange,
|
|
36
|
+
width = '80px',
|
|
37
|
+
disabled = false
|
|
38
|
+
}: Props = $props();
|
|
25
39
|
|
|
26
40
|
function normalizeHex(value: string): string {
|
|
27
41
|
let v = value.trim();
|
|
28
42
|
|
|
29
43
|
if (!v.startsWith('#')) v = `#${v}`;
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
// Keep original case for consistency with tests
|
|
46
|
+
return v;
|
|
32
47
|
}
|
|
33
48
|
|
|
34
49
|
function isValidColor(value: string): boolean {
|
|
@@ -36,6 +51,62 @@
|
|
|
36
51
|
return hexRegex.test(value.startsWith('#') ? value.slice(1) : value);
|
|
37
52
|
}
|
|
38
53
|
|
|
54
|
+
function createColorObject(hex: string): ColorObject {
|
|
55
|
+
// Remove # if present and normalize to 6 digits
|
|
56
|
+
let normalizedHex = hex.startsWith('#') ? hex.slice(1) : hex;
|
|
57
|
+
|
|
58
|
+
// Expand 3-digit hex to 6-digit
|
|
59
|
+
if (normalizedHex.length === 3) {
|
|
60
|
+
normalizedHex = normalizedHex
|
|
61
|
+
.split('')
|
|
62
|
+
.map((char) => char + char)
|
|
63
|
+
.join('');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Remove alpha channel if present (8-digit hex)
|
|
67
|
+
if (normalizedHex.length === 8) {
|
|
68
|
+
normalizedHex = normalizedHex.substring(0, 6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const r = parseInt(normalizedHex.slice(0, 2), 16);
|
|
72
|
+
const g = parseInt(normalizedHex.slice(2, 4), 16);
|
|
73
|
+
const b = parseInt(normalizedHex.slice(4, 6), 16);
|
|
74
|
+
|
|
75
|
+
// Convert to HSB
|
|
76
|
+
const max = Math.max(r, g, b);
|
|
77
|
+
const min = Math.min(r, g, b);
|
|
78
|
+
const diff = max - min;
|
|
79
|
+
let h = 0;
|
|
80
|
+
let s = max === 0 ? 0 : diff / max;
|
|
81
|
+
let brightness = max;
|
|
82
|
+
|
|
83
|
+
if (diff !== 0) {
|
|
84
|
+
if (max === r) {
|
|
85
|
+
h = ((g - b) / diff) % 6;
|
|
86
|
+
} else if (max === g) {
|
|
87
|
+
h = (b - r) / diff + 2;
|
|
88
|
+
} else {
|
|
89
|
+
h = (r - g) / diff + 4;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
h = Math.round(h * 60);
|
|
94
|
+
if (h < 0) h += 360;
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
hex: `#${normalizedHex}`,
|
|
98
|
+
rgb: { r, g, b, value: `rgb(${r}, ${g}, ${b})` },
|
|
99
|
+
rgba: { r, g, b, a: 100, value: `rgba(${r}, ${g}, ${b}, 1)` },
|
|
100
|
+
hsb: {
|
|
101
|
+
h,
|
|
102
|
+
s: Math.round(s * 100),
|
|
103
|
+
b: Math.round((brightness * 100) / 255),
|
|
104
|
+
value: `hsb(${h}, ${Math.round(s * 100)}%, ${Math.round((brightness * 100) / 255)}%)`
|
|
105
|
+
},
|
|
106
|
+
alpha: 100
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
39
110
|
function handleInputPaste(event: ClipboardEvent) {
|
|
40
111
|
event.preventDefault();
|
|
41
112
|
|
|
@@ -48,7 +119,9 @@
|
|
|
48
119
|
if (isValidColor(cleanText)) {
|
|
49
120
|
const normalizedValue = normalizeHex(cleanText);
|
|
50
121
|
color = normalizedValue;
|
|
51
|
-
|
|
122
|
+
// Call oncolorchange with the new color
|
|
123
|
+
const colorObject = createColorObject(normalizedValue);
|
|
124
|
+
oncolorchange?.(colorObject);
|
|
52
125
|
}
|
|
53
126
|
}
|
|
54
127
|
|
|
@@ -58,10 +131,10 @@
|
|
|
58
131
|
|
|
59
132
|
if (isValidColor(value)) {
|
|
60
133
|
const normalizedValue = normalizeHex(value);
|
|
61
|
-
|
|
62
134
|
color = normalizedValue;
|
|
63
|
-
|
|
64
|
-
|
|
135
|
+
// Call oncolorchange with the new color
|
|
136
|
+
const colorObject = createColorObject(normalizedValue);
|
|
137
|
+
oncolorchange?.(colorObject);
|
|
65
138
|
}
|
|
66
139
|
}
|
|
67
140
|
|
|
@@ -73,9 +146,11 @@
|
|
|
73
146
|
|
|
74
147
|
function handleColorChange(newColor: string) {
|
|
75
148
|
const normalizedValue = normalizeHex(newColor);
|
|
76
|
-
|
|
77
149
|
color = normalizedValue;
|
|
78
|
-
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function handleFullColorChange(fullColor: ColorObject) {
|
|
153
|
+
oncolorchange?.(fullColor);
|
|
79
154
|
}
|
|
80
155
|
</script>
|
|
81
156
|
|
|
@@ -97,7 +172,7 @@
|
|
|
97
172
|
</div>
|
|
98
173
|
{/snippet}
|
|
99
174
|
{#snippet tooltipContent()}
|
|
100
|
-
<ColorSelect {color}
|
|
175
|
+
<ColorSelect {color} oncolorchange={handleFullColorChange} />
|
|
101
176
|
{/snippet}
|
|
102
177
|
</Tooltip>
|
|
103
178
|
|
|
@@ -1,12 +1,35 @@
|
|
|
1
|
+
interface ColorObject {
|
|
2
|
+
hex: string;
|
|
3
|
+
rgb: {
|
|
4
|
+
r: number;
|
|
5
|
+
g: number;
|
|
6
|
+
b: number;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
rgba: {
|
|
10
|
+
r: number;
|
|
11
|
+
g: number;
|
|
12
|
+
b: number;
|
|
13
|
+
a: number;
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
hsb: {
|
|
17
|
+
h: number;
|
|
18
|
+
s: number;
|
|
19
|
+
b: number;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
alpha: number;
|
|
23
|
+
}
|
|
1
24
|
interface Props {
|
|
2
25
|
/**
|
|
3
26
|
* The color to display in the picker.
|
|
4
27
|
*/
|
|
5
28
|
color?: string;
|
|
6
29
|
/**
|
|
7
|
-
* The function to call when the color changes.
|
|
30
|
+
* The function to call when the color changes with full color object.
|
|
8
31
|
*/
|
|
9
|
-
|
|
32
|
+
oncolorchange?: (fullColor: ColorObject) => void;
|
|
10
33
|
/**
|
|
11
34
|
* The width of the picker.
|
|
12
35
|
*/
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
control: { type: 'color' },
|
|
14
14
|
description: 'Initial color value (hex)'
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
oncolorchange: { action: 'fullColorChanged' }
|
|
17
17
|
},
|
|
18
18
|
args: {
|
|
19
19
|
color: '#ff0000',
|
|
20
|
-
|
|
20
|
+
oncolorchange: fn()
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
</script>
|
|
@@ -28,10 +28,18 @@
|
|
|
28
28
|
|
|
29
29
|
<Story
|
|
30
30
|
name="Alpha Channel"
|
|
31
|
-
args={{
|
|
31
|
+
args={{
|
|
32
|
+
color: '#0000ff',
|
|
33
|
+
oncolorchange: (fullColor) => console.log('Full color object:', fullColor)
|
|
34
|
+
}}
|
|
32
35
|
story={{
|
|
33
36
|
parameters: {
|
|
34
|
-
docs: {
|
|
37
|
+
docs: {
|
|
38
|
+
description: {
|
|
39
|
+
story:
|
|
40
|
+
'Shows alpha slider and allows changing opacity. Both callbacks receive consistent hex values with alpha channel when alpha < 100%.'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
35
43
|
}
|
|
36
44
|
}}
|
|
37
45
|
/>
|
|
@@ -59,3 +67,18 @@
|
|
|
59
67
|
}
|
|
60
68
|
}}
|
|
61
69
|
/>
|
|
70
|
+
|
|
71
|
+
<Story
|
|
72
|
+
name="Full Color Object Demo"
|
|
73
|
+
args={{ color: '#ff6600' }}
|
|
74
|
+
story={{
|
|
75
|
+
parameters: {
|
|
76
|
+
docs: {
|
|
77
|
+
description: {
|
|
78
|
+
story:
|
|
79
|
+
'Demonstrates the full color object callback with hex, rgb, rgba, hsb, and alpha values. Check the Actions panel to see the complete color object structure.'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
@@ -1,14 +1,60 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// Color object type definition
|
|
5
|
+
interface ColorObject {
|
|
6
|
+
hex: string;
|
|
7
|
+
rgb: { r: number; g: number; b: number; value: string };
|
|
8
|
+
rgba: { r: number; g: number; b: number; a: number; value: string };
|
|
9
|
+
hsb: { h: number; s: number; b: number; value: string };
|
|
10
|
+
alpha: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { color = $bindable('#fff'), oncolorchange } = $props<{
|
|
5
14
|
color?: string;
|
|
6
|
-
|
|
15
|
+
oncolorchange?: (fullColor: ColorObject) => void;
|
|
7
16
|
}>();
|
|
8
17
|
|
|
9
18
|
function setColor(newColor: string) {
|
|
10
19
|
color = newColor;
|
|
11
|
-
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function createColorObject(hex: string, alpha: number): ColorObject {
|
|
23
|
+
const [r, g, b] = hexToRgb(hex);
|
|
24
|
+
const [h, s, brightness] = hexToHsb(hex);
|
|
25
|
+
|
|
26
|
+
// Create hex with alpha channel if alpha < 100%
|
|
27
|
+
const hexWithAlpha =
|
|
28
|
+
alpha < 100
|
|
29
|
+
? hex +
|
|
30
|
+
Math.round((alpha / 100) * 255)
|
|
31
|
+
.toString(16)
|
|
32
|
+
.padStart(2, '0')
|
|
33
|
+
.toUpperCase()
|
|
34
|
+
: hex;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
hex: hexWithAlpha,
|
|
38
|
+
rgb: { r, g, b, value: `rgb(${r}, ${g}, ${b})` },
|
|
39
|
+
rgba: { r, g, b, a: alpha, value: `rgba(${r}, ${g}, ${b}, ${alpha / 100})` },
|
|
40
|
+
hsb: { h, s, b: brightness, value: `hsb(${h}, ${s}%, ${brightness}%)` },
|
|
41
|
+
alpha
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getHexWithAlpha(hex: string, alpha: number): string {
|
|
46
|
+
return alpha < 100
|
|
47
|
+
? hex +
|
|
48
|
+
Math.round((alpha / 100) * 255)
|
|
49
|
+
.toString(16)
|
|
50
|
+
.padStart(2, '0')
|
|
51
|
+
.toUpperCase()
|
|
52
|
+
: hex;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function emitColorChange(hex: string, alpha: number) {
|
|
56
|
+
const colorObject = createColorObject(hex, alpha);
|
|
57
|
+
oncolorchange?.(colorObject);
|
|
12
58
|
}
|
|
13
59
|
|
|
14
60
|
let hue = $state(0);
|
|
@@ -90,6 +136,27 @@
|
|
|
90
136
|
);
|
|
91
137
|
}
|
|
92
138
|
|
|
139
|
+
function hexToRgb(hex: string): [number, number, number] {
|
|
140
|
+
// Handle different hex formats
|
|
141
|
+
let normalizedHex = hex;
|
|
142
|
+
if (hex.startsWith('#')) {
|
|
143
|
+
// Expand 3-digit hex to 6-digit
|
|
144
|
+
if (hex.length === 4) {
|
|
145
|
+
normalizedHex = '#' + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
|
|
146
|
+
}
|
|
147
|
+
// Remove alpha channel if present (8-digit hex)
|
|
148
|
+
if (hex.length === 9) {
|
|
149
|
+
normalizedHex = hex.substring(0, 7);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const r = parseInt(normalizedHex.slice(1, 3), 16);
|
|
154
|
+
const g = parseInt(normalizedHex.slice(3, 5), 16);
|
|
155
|
+
const b = parseInt(normalizedHex.slice(5, 7), 16);
|
|
156
|
+
|
|
157
|
+
return [r, g, b];
|
|
158
|
+
}
|
|
159
|
+
|
|
93
160
|
function hexToHsb(hex: string): [number, number, number] {
|
|
94
161
|
// Handle different hex formats
|
|
95
162
|
let normalizedHex = hex;
|
|
@@ -166,7 +233,9 @@
|
|
|
166
233
|
}
|
|
167
234
|
|
|
168
235
|
hexValue = rgbToHex(r, g, b).toUpperCase();
|
|
169
|
-
|
|
236
|
+
const hexWithAlpha = getHexWithAlpha(hexValue, alpha);
|
|
237
|
+
setColor(hexWithAlpha);
|
|
238
|
+
emitColorChange(hexValue, alpha);
|
|
170
239
|
updateColorPickerPosition();
|
|
171
240
|
}
|
|
172
241
|
|
|
@@ -216,7 +285,7 @@
|
|
|
216
285
|
const rect = alphaBar.getBoundingClientRect();
|
|
217
286
|
const x = Math.max(0, Math.min(rect.width, event.clientX - rect.left));
|
|
218
287
|
alpha = Math.round((x / rect.width) * 100);
|
|
219
|
-
|
|
288
|
+
emitColorChange(hexValue, alpha);
|
|
220
289
|
}
|
|
221
290
|
|
|
222
291
|
function handleHexChange(event: Event) {
|
|
@@ -229,7 +298,9 @@
|
|
|
229
298
|
|
|
230
299
|
if (isValidColor(value)) {
|
|
231
300
|
hexValue = value.toUpperCase();
|
|
232
|
-
|
|
301
|
+
const hexWithAlpha = getHexWithAlpha(hexValue, alpha);
|
|
302
|
+
setColor(hexWithAlpha);
|
|
303
|
+
emitColorChange(hexValue, alpha);
|
|
233
304
|
const [h, s, b] = hexToHsb(value);
|
|
234
305
|
hue = h;
|
|
235
306
|
saturation = s;
|
|
@@ -272,7 +343,9 @@
|
|
|
272
343
|
|
|
273
344
|
hexValue = normalizedValue.toUpperCase();
|
|
274
345
|
|
|
275
|
-
|
|
346
|
+
const hexWithAlpha = getHexWithAlpha(hexValue, alpha);
|
|
347
|
+
setColor(hexWithAlpha);
|
|
348
|
+
emitColorChange(hexValue, alpha);
|
|
276
349
|
prevHexValue = hexValue;
|
|
277
350
|
|
|
278
351
|
const hsb = hexToHsb(hexValue);
|
|
@@ -420,7 +493,9 @@
|
|
|
420
493
|
const result = await eyeDropper.open();
|
|
421
494
|
if (result && result.sRGBHex) {
|
|
422
495
|
hexValue = result.sRGBHex.toUpperCase();
|
|
423
|
-
|
|
496
|
+
const hexWithAlpha = getHexWithAlpha(hexValue, alpha);
|
|
497
|
+
setColor(hexWithAlpha);
|
|
498
|
+
emitColorChange(hexValue, alpha);
|
|
424
499
|
const [h, s, b] = hexToHsb(hexValue);
|
|
425
500
|
hue = h;
|
|
426
501
|
saturation = s;
|
|
@@ -661,11 +736,17 @@
|
|
|
661
736
|
<div class="input-wrapper">
|
|
662
737
|
<input
|
|
663
738
|
class="input input--number"
|
|
664
|
-
|
|
739
|
+
value={alpha}
|
|
665
740
|
min="0"
|
|
666
741
|
max="100"
|
|
667
742
|
role="spinbutton"
|
|
668
743
|
aria-label="Alpha"
|
|
744
|
+
oninput={(e) => {
|
|
745
|
+
const target = e.target as HTMLInputElement;
|
|
746
|
+
if (!target) return;
|
|
747
|
+
alpha = +target.value;
|
|
748
|
+
emitColorChange(hexValue, alpha);
|
|
749
|
+
}}
|
|
669
750
|
/>
|
|
670
751
|
</div>
|
|
671
752
|
<span class="label">A</span>
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
interface ColorObject {
|
|
2
|
+
hex: string;
|
|
3
|
+
rgb: {
|
|
4
|
+
r: number;
|
|
5
|
+
g: number;
|
|
6
|
+
b: number;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
rgba: {
|
|
10
|
+
r: number;
|
|
11
|
+
g: number;
|
|
12
|
+
b: number;
|
|
13
|
+
a: number;
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
hsb: {
|
|
17
|
+
h: number;
|
|
18
|
+
s: number;
|
|
19
|
+
b: number;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
alpha: number;
|
|
23
|
+
}
|
|
1
24
|
type $$ComponentProps = {
|
|
2
25
|
color?: string;
|
|
3
|
-
|
|
26
|
+
oncolorchange?: (fullColor: ColorObject) => void;
|
|
4
27
|
};
|
|
5
28
|
declare const ColorSelect: import("svelte").Component<$$ComponentProps, {}, "color">;
|
|
6
29
|
type ColorSelect = ReturnType<typeof ColorSelect>;
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
const isTestEnv =
|
|
205
205
|
(typeof process !== 'undefined' && process.env?.NODE_ENV === 'test') ||
|
|
206
206
|
(typeof globalThis !== 'undefined' && '__vitest__' in globalThis);
|
|
207
|
-
const delay = isTestEnv ? 0 :
|
|
207
|
+
const delay = isTestEnv ? 0 : 100;
|
|
208
208
|
|
|
209
209
|
setTimeout(() => {
|
|
210
210
|
tooltipEl.style.display = 'none';
|
|
@@ -316,6 +316,24 @@
|
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
318
|
|
|
319
|
+
$effect(() => {
|
|
320
|
+
if (tooltipElement) {
|
|
321
|
+
const handleTooltipInteraction = (evt: Event) => {
|
|
322
|
+
evt.stopPropagation();
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
tooltipElement.addEventListener('click', handleTooltipInteraction, true);
|
|
326
|
+
tooltipElement.addEventListener('mousedown', handleTooltipInteraction, true);
|
|
327
|
+
tooltipElement.addEventListener('mouseup', handleTooltipInteraction, true);
|
|
328
|
+
|
|
329
|
+
return () => {
|
|
330
|
+
tooltipElement.removeEventListener('click', handleTooltipInteraction, true);
|
|
331
|
+
tooltipElement.removeEventListener('mousedown', handleTooltipInteraction, true);
|
|
332
|
+
tooltipElement.removeEventListener('mouseup', handleTooltipInteraction, true);
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
|
|
319
337
|
// Initialize tooltip when component mounts
|
|
320
338
|
$effect(() => {
|
|
321
339
|
if (targetElement && tooltipElement) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
2
|
+
<g clip-path="url(#clip0_5690_27828)">
|
|
3
|
+
<path
|
|
4
|
+
d="M10.5 9.91797H3.5V8.7513H10.5V9.91797ZM10.5 7.58464H3.5V6.41797H10.5V7.58464ZM10.5 5.2513H3.5V4.08464H10.5V5.2513ZM1.75 12.8346L2.625 11.9596L3.5 12.8346L4.375 11.9596L5.25 12.8346L6.125 11.9596L7 12.8346L7.875 11.9596L8.75 12.8346L9.625 11.9596L10.5 12.8346L11.375 11.9596L12.25 12.8346V1.16797L11.375 2.04297L10.5 1.16797L9.625 2.04297L8.75 1.16797L7.875 2.04297L7 1.16797L6.125 2.04297L5.25 1.16797L4.375 2.04297L3.5 1.16797L2.625 2.04297L1.75 1.16797V12.8346Z"
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_5690_27828">
|
|
10
|
+
<rect width="14" height="14" fill="currentColor" />
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default ReceiptIcon;
|
|
2
|
+
type ReceiptIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ReceiptIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="15" viewBox="0 0 14 15" fill="none">
|
|
2
|
+
<g clip-path="url(#clip0_5690_28327)">
|
|
3
|
+
<path
|
|
4
|
+
d="M6.99935 4.58333V2.25H1.16602V12.75H12.8327V4.58333H6.99935ZM5.83268 11.5833H2.33268V10.4167H5.83268V11.5833ZM5.83268 9.25H2.33268V8.08333H5.83268V9.25ZM5.83268 6.91667H2.33268V5.75H5.83268V6.91667ZM5.83268 4.58333H2.33268V3.41667H5.83268V4.58333ZM11.666 11.5833H6.99935V5.75H11.666V11.5833ZM10.4993 6.91667H8.16602V8.08333H10.4993V6.91667ZM10.4993 9.25H8.16602V10.4167H10.4993V9.25Z"
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_5690_28327">
|
|
10
|
+
<rect width="14" height="14" fill="currentColor" transform="translate(0 0.5)" />
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default WorkspaceIcon;
|
|
2
|
+
type WorkspaceIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const WorkspaceIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
package/dist/ui/icons/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ import PreviewEyeIcon from './PreviewEyeIcon.svelte';
|
|
|
81
81
|
import ProfileIcon from './ProfileIcon.svelte';
|
|
82
82
|
import PublishCancelIcon from './PublishCancelIcon.svelte';
|
|
83
83
|
import PublishIcon from './PublishIcon.svelte';
|
|
84
|
+
import ReceiptIcon from './ReceiptIcon.svelte';
|
|
84
85
|
import RefreshIcon from './RefreshIcon.svelte';
|
|
85
86
|
import RepairIcon from './RepairIcon.svelte';
|
|
86
87
|
import SaveIcon from './SaveIcon.svelte';
|
|
@@ -116,7 +117,8 @@ import WebflowComponentIcon from './WebflowComponentIcon.svelte';
|
|
|
116
117
|
import WebflowComponentOutlinedIcon from './WebflowComponentOutlinedIcon.svelte';
|
|
117
118
|
import WebflowInsightsIcon from './WebflowInsightsIcon.svelte';
|
|
118
119
|
import WizedLogoIcon from './WizedLogoIcon.svelte';
|
|
120
|
+
import WorkspaceIcon from './WorkspaceIcon.svelte';
|
|
119
121
|
import XL from './XL.svelte';
|
|
120
122
|
import XXL from './XXL.svelte';
|
|
121
123
|
import XXXL from './XXXL.svelte';
|
|
122
|
-
export { AccordionDownArrow, AccordionUpArrow, AccountIcon, ArrowIcon, BackIcon, BodyIcon, BookmarkIcon, BoxAddIcon, BrushIcon, BuilderEditIcon, BuilderIcon, CheckboxCheckedIcon, CheckCircleIcon, CheckCircleOutlinedIcon, CheckIcon, ChevronIcon, ChevronRightIcon, CircleIcon, CloseCircleIcon, CloseIcon, CMSIcon, CodeIcon, ComponentsIcon, CookieIcon, CopyIcon, CrossIcon, DeleteIcon, DeleteOutlinedIcon, Desktop, DesktopWithStar, DivBlock, DOMElement, EditIcon, ExpertIcon, EyeCancelIcon, EyeIcon, FavouriteIcon, FileUploadIcon, FilterIcon, FinsweetLibraryIcon, FinsweetLogoIcon, FinsweetLogoOutlineIcon, FolderIcon, FolderOutlinedIcon, FolderPlusIcon, FreeComponentIcon, GlobeIcon, HandPointUpIcon, HeartIcon, HeartIconOutlined, HelpAltIcon, HelpIcon, HomeIcon, InfoIcon, LineChartIcon, ListIcon, LockIcon, MessageIcon, MobileLandscape, MobilePortrait, NavigatorIcon, OpenBookIcon, PageDraftIcon, PageIcon, PageLockedIcon, PageOutlinedIcon, PageSectionIcon, Pencil, PencilOutlinedIcon, PinIcon, PlayIcon, PlusIcon, PreviewEyeIcon, ProfileIcon, PublishCancelIcon, PublishIcon, RefreshIcon, RepairIcon, SaveIcon, SearchIcon, SelectIcon, SettingsIcon, SidebarToggleIcon, SliderAppIcon, SquareCheckIcon, StarIcon, StarOutlinedIcon, StaticContentIcon, SubtractIcon, TableAppIcon, Tablet, TabletPreview, TabNewIcon, TabsIcon, ThreeDotsIcon, TimesIcon, TooltipInfoCircleFilled, ToolTipInfoCircleIcon, TooltipInfoSquaredIcon, TriangleDownIcon, TriangleDownIconToggle, UndoIcon, UploadFileIcon, WarningCircleIcon, WarningCircleOutlineIcon, WarningTriangleIcon, WarningTriangleOutlineIcon, WebflowComponentIcon, WebflowComponentOutlinedIcon, WebflowInsightsIcon, WizedLogoIcon, XL, XXL, XXXL };
|
|
124
|
+
export { AccordionDownArrow, AccordionUpArrow, AccountIcon, ArrowIcon, BackIcon, BodyIcon, BookmarkIcon, BoxAddIcon, BrushIcon, BuilderEditIcon, BuilderIcon, CheckboxCheckedIcon, CheckCircleIcon, CheckCircleOutlinedIcon, CheckIcon, ChevronIcon, ChevronRightIcon, CircleIcon, CloseCircleIcon, CloseIcon, CMSIcon, CodeIcon, ComponentsIcon, CookieIcon, CopyIcon, CrossIcon, DeleteIcon, DeleteOutlinedIcon, Desktop, DesktopWithStar, DivBlock, DOMElement, EditIcon, ExpertIcon, EyeCancelIcon, EyeIcon, FavouriteIcon, FileUploadIcon, FilterIcon, FinsweetLibraryIcon, FinsweetLogoIcon, FinsweetLogoOutlineIcon, FolderIcon, FolderOutlinedIcon, FolderPlusIcon, FreeComponentIcon, GlobeIcon, HandPointUpIcon, HeartIcon, HeartIconOutlined, HelpAltIcon, HelpIcon, HomeIcon, InfoIcon, LineChartIcon, ListIcon, LockIcon, MessageIcon, MobileLandscape, MobilePortrait, NavigatorIcon, OpenBookIcon, PageDraftIcon, PageIcon, PageLockedIcon, PageOutlinedIcon, PageSectionIcon, Pencil, PencilOutlinedIcon, PinIcon, PlayIcon, PlusIcon, PreviewEyeIcon, ProfileIcon, PublishCancelIcon, PublishIcon, RefreshIcon, ReceiptIcon, RepairIcon, SaveIcon, SearchIcon, SelectIcon, SettingsIcon, SidebarToggleIcon, SliderAppIcon, SquareCheckIcon, StarIcon, StarOutlinedIcon, StaticContentIcon, SubtractIcon, TableAppIcon, Tablet, TabletPreview, TabNewIcon, TabsIcon, ThreeDotsIcon, TimesIcon, TooltipInfoCircleFilled, ToolTipInfoCircleIcon, TooltipInfoSquaredIcon, TriangleDownIcon, TriangleDownIconToggle, UndoIcon, UploadFileIcon, WarningCircleIcon, WarningCircleOutlineIcon, WarningTriangleIcon, WarningTriangleOutlineIcon, WebflowComponentIcon, WebflowComponentOutlinedIcon, WebflowInsightsIcon, WizedLogoIcon, WorkspaceIcon, XL, XXL, XXXL };
|
package/dist/ui/icons/index.js
CHANGED
|
@@ -81,6 +81,7 @@ import PreviewEyeIcon from './PreviewEyeIcon.svelte';
|
|
|
81
81
|
import ProfileIcon from './ProfileIcon.svelte';
|
|
82
82
|
import PublishCancelIcon from './PublishCancelIcon.svelte';
|
|
83
83
|
import PublishIcon from './PublishIcon.svelte';
|
|
84
|
+
import ReceiptIcon from './ReceiptIcon.svelte';
|
|
84
85
|
import RefreshIcon from './RefreshIcon.svelte';
|
|
85
86
|
import RepairIcon from './RepairIcon.svelte';
|
|
86
87
|
import SaveIcon from './SaveIcon.svelte';
|
|
@@ -116,7 +117,8 @@ import WebflowComponentIcon from './WebflowComponentIcon.svelte';
|
|
|
116
117
|
import WebflowComponentOutlinedIcon from './WebflowComponentOutlinedIcon.svelte';
|
|
117
118
|
import WebflowInsightsIcon from './WebflowInsightsIcon.svelte';
|
|
118
119
|
import WizedLogoIcon from './WizedLogoIcon.svelte';
|
|
120
|
+
import WorkspaceIcon from './WorkspaceIcon.svelte';
|
|
119
121
|
import XL from './XL.svelte';
|
|
120
122
|
import XXL from './XXL.svelte';
|
|
121
123
|
import XXXL from './XXXL.svelte';
|
|
122
|
-
export { AccordionDownArrow, AccordionUpArrow, AccountIcon, ArrowIcon, BackIcon, BodyIcon, BookmarkIcon, BoxAddIcon, BrushIcon, BuilderEditIcon, BuilderIcon, CheckboxCheckedIcon, CheckCircleIcon, CheckCircleOutlinedIcon, CheckIcon, ChevronIcon, ChevronRightIcon, CircleIcon, CloseCircleIcon, CloseIcon, CMSIcon, CodeIcon, ComponentsIcon, CookieIcon, CopyIcon, CrossIcon, DeleteIcon, DeleteOutlinedIcon, Desktop, DesktopWithStar, DivBlock, DOMElement, EditIcon, ExpertIcon, EyeCancelIcon, EyeIcon, FavouriteIcon, FileUploadIcon, FilterIcon, FinsweetLibraryIcon, FinsweetLogoIcon, FinsweetLogoOutlineIcon, FolderIcon, FolderOutlinedIcon, FolderPlusIcon, FreeComponentIcon, GlobeIcon, HandPointUpIcon, HeartIcon, HeartIconOutlined, HelpAltIcon, HelpIcon, HomeIcon, InfoIcon, LineChartIcon, ListIcon, LockIcon, MessageIcon, MobileLandscape, MobilePortrait, NavigatorIcon, OpenBookIcon, PageDraftIcon, PageIcon, PageLockedIcon, PageOutlinedIcon, PageSectionIcon, Pencil, PencilOutlinedIcon, PinIcon, PlayIcon, PlusIcon, PreviewEyeIcon, ProfileIcon, PublishCancelIcon, PublishIcon, RefreshIcon, RepairIcon, SaveIcon, SearchIcon, SelectIcon, SettingsIcon, SidebarToggleIcon, SliderAppIcon, SquareCheckIcon, StarIcon, StarOutlinedIcon, StaticContentIcon, SubtractIcon, TableAppIcon, Tablet, TabletPreview, TabNewIcon, TabsIcon, ThreeDotsIcon, TimesIcon, TooltipInfoCircleFilled, ToolTipInfoCircleIcon, TooltipInfoSquaredIcon, TriangleDownIcon, TriangleDownIconToggle, UndoIcon, UploadFileIcon, WarningCircleIcon, WarningCircleOutlineIcon, WarningTriangleIcon, WarningTriangleOutlineIcon, WebflowComponentIcon, WebflowComponentOutlinedIcon, WebflowInsightsIcon, WizedLogoIcon, XL, XXL, XXXL };
|
|
124
|
+
export { AccordionDownArrow, AccordionUpArrow, AccountIcon, ArrowIcon, BackIcon, BodyIcon, BookmarkIcon, BoxAddIcon, BrushIcon, BuilderEditIcon, BuilderIcon, CheckboxCheckedIcon, CheckCircleIcon, CheckCircleOutlinedIcon, CheckIcon, ChevronIcon, ChevronRightIcon, CircleIcon, CloseCircleIcon, CloseIcon, CMSIcon, CodeIcon, ComponentsIcon, CookieIcon, CopyIcon, CrossIcon, DeleteIcon, DeleteOutlinedIcon, Desktop, DesktopWithStar, DivBlock, DOMElement, EditIcon, ExpertIcon, EyeCancelIcon, EyeIcon, FavouriteIcon, FileUploadIcon, FilterIcon, FinsweetLibraryIcon, FinsweetLogoIcon, FinsweetLogoOutlineIcon, FolderIcon, FolderOutlinedIcon, FolderPlusIcon, FreeComponentIcon, GlobeIcon, HandPointUpIcon, HeartIcon, HeartIconOutlined, HelpAltIcon, HelpIcon, HomeIcon, InfoIcon, LineChartIcon, ListIcon, LockIcon, MessageIcon, MobileLandscape, MobilePortrait, NavigatorIcon, OpenBookIcon, PageDraftIcon, PageIcon, PageLockedIcon, PageOutlinedIcon, PageSectionIcon, Pencil, PencilOutlinedIcon, PinIcon, PlayIcon, PlusIcon, PreviewEyeIcon, ProfileIcon, PublishCancelIcon, PublishIcon, RefreshIcon, ReceiptIcon, RepairIcon, SaveIcon, SearchIcon, SelectIcon, SettingsIcon, SidebarToggleIcon, SliderAppIcon, SquareCheckIcon, StarIcon, StarOutlinedIcon, StaticContentIcon, SubtractIcon, TableAppIcon, Tablet, TabletPreview, TabNewIcon, TabsIcon, ThreeDotsIcon, TimesIcon, TooltipInfoCircleFilled, ToolTipInfoCircleIcon, TooltipInfoSquaredIcon, TriangleDownIcon, TriangleDownIconToggle, UndoIcon, UploadFileIcon, WarningCircleIcon, WarningCircleOutlineIcon, WarningTriangleIcon, WarningTriangleOutlineIcon, WebflowComponentIcon, WebflowComponentOutlinedIcon, WebflowInsightsIcon, WizedLogoIcon, WorkspaceIcon, XL, XXL, XXXL };
|