@vuelor/picker 0.1.0-beta.1 → 0.2.0
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/README.md +7 -2
- package/dist/components/ColorPickerCanvas.vue.d.ts +20 -0
- package/dist/components/ColorPickerEyeDropper.vue.d.ts +20 -0
- package/dist/components/ColorPickerInputHSB.vue.d.ts +18 -0
- package/dist/components/ColorPickerInputHSL.vue.d.ts +18 -0
- package/dist/components/ColorPickerInputHex.vue.d.ts +23 -0
- package/dist/components/ColorPickerInputRGB.vue.d.ts +18 -0
- package/dist/components/ColorPickerRoot.vue.d.ts +111 -0
- package/dist/components/ColorPickerSliderAlpha.vue.d.ts +12 -0
- package/dist/components/ColorPickerSliderBlue.vue.d.ts +12 -0
- package/dist/components/ColorPickerSliderGreen.vue.d.ts +12 -0
- package/dist/components/ColorPickerSliderHue.vue.d.ts +13 -0
- package/dist/components/ColorPickerSliderLightness.vue.d.ts +12 -0
- package/dist/components/ColorPickerSliderRed.vue.d.ts +12 -0
- package/dist/components/ColorPickerSliderSaturation.vue.d.ts +12 -0
- package/dist/components/ColorPickerSwatch.vue.d.ts +14 -0
- package/dist/composables/useColor.d.ts +60 -0
- package/dist/composables/useThumb.d.ts +7 -0
- package/dist/composables/useVModel.d.ts +5 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +723 -625
- package/dist/style.css +1 -1
- package/dist/theme/index.d.ts +70 -0
- package/dist/theme/tailwindcss.d.ts +30 -0
- package/dist/theme/vanillacss.d.ts +30 -0
- package/dist/utils/canvas.d.ts +2 -0
- package/dist/utils/color.d.ts +21 -0
- package/dist/utils/consts.d.ts +1 -0
- package/dist/utils/helpers.d.ts +2 -0
- package/dist/utils/parsers.d.ts +10 -0
- package/dist/utils/styles.d.ts +18 -0
- package/dist/utils/types.d.ts +37 -0
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<h1 align="center">Vuelor</h1>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
Vuelor — a truly flexible, accessible, and Tailwind-ready color picker with developer
|
|
10
|
+
Vuelor — a truly flexible, accessible, and Tailwind-ready color picker with developer experience in mind.
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
@@ -64,9 +64,13 @@ export default {
|
|
|
64
64
|
extend: {
|
|
65
65
|
boxShadow: {
|
|
66
66
|
'vuelor-card': '0 2px 5px 0 #00000026, 0 10px 16px 0 #0000001f, 0 0 .5px 0 #0000001f',
|
|
67
|
-
'vuelor-thumb': '0px 0px .5px #0000002e, 0px 3px 8px #0000001a, 0px 1px 3px #0000001a'
|
|
67
|
+
'vuelor-thumb': '0px 0px .5px #0000002e, 0px 3px 8px #0000001a, 0px 1px 3px #0000001a',
|
|
68
|
+
'vuelor-inner': 'inset 0 0 0 1px #0000001a'
|
|
68
69
|
}
|
|
69
70
|
},
|
|
71
|
+
dropShadow: {
|
|
72
|
+
'vuelor-thumb': ['0px 0px .5px #00000054', '0px 1px 3px #00000026']
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
```
|
|
@@ -128,3 +132,4 @@ const color = ref(null)
|
|
|
128
132
|
| `ColorPickerSliderHue.vue` |
|
|
129
133
|
| `ColorPickerSliderSaturation.vue` |
|
|
130
134
|
| `ColorPickerSliderLightness.vue` |
|
|
135
|
+
| `ColorPickerSwatch.vue` |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface CanvasProps {
|
|
2
|
+
type?: 'HSV' | 'HSL';
|
|
3
|
+
height?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
wheel?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
ui?: {
|
|
8
|
+
root?: string;
|
|
9
|
+
area?: string;
|
|
10
|
+
thumb?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<CanvasProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CanvasProps> & Readonly<{}>, {
|
|
14
|
+
type: "HSV" | "HSL";
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
wheel: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
class?: string;
|
|
3
|
+
as?: string;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_10: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_10) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
|
+
as: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UiInputSlots } from '../utils/styles';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: string;
|
|
4
|
+
ui?: Partial<UiInputSlots>;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
before?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UiInputSlots } from '../utils/styles';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: string;
|
|
4
|
+
ui?: Partial<UiInputSlots>;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
before?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UiInputSlots } from '../utils/styles';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
ui?: Partial<UiInputSlots>;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
before?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:modelValue": (value: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UiInputSlots } from '../utils/styles';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: string;
|
|
4
|
+
ui?: Partial<UiInputSlots>;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
before?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { ThemeSlots } from '../theme';
|
|
3
|
+
import type { HSV, HSVA, HSL, RGB, RGBA, Format, ColorObject } from '../utils/types';
|
|
4
|
+
type ColorPickerRootContext = {
|
|
5
|
+
alpha: Ref<number>;
|
|
6
|
+
hsv: Ref<HSV>;
|
|
7
|
+
hsva: Ref<HSVA>;
|
|
8
|
+
hsl: Ref<HSL>;
|
|
9
|
+
rgb: Ref<RGB>;
|
|
10
|
+
rgba: Ref<RGBA>;
|
|
11
|
+
hex: Ref<string>;
|
|
12
|
+
hexa: Ref<string>;
|
|
13
|
+
uiSlots: Function;
|
|
14
|
+
disabled: Ref<boolean>;
|
|
15
|
+
isAlphaEnabled: Ref<boolean>;
|
|
16
|
+
commitValue: () => void;
|
|
17
|
+
};
|
|
18
|
+
type ModelValue = string | ColorObject | null;
|
|
19
|
+
export declare const injectColorPickerContext: <T extends ColorPickerRootContext | null | undefined = ColorPickerRootContext>(fallback?: T | undefined) => T extends null ? ColorPickerRootContext | null : ColorPickerRootContext, provideColorPickerContext: (contextValue: ColorPickerRootContext) => ColorPickerRootContext;
|
|
20
|
+
export interface ColorPickerRootProps {
|
|
21
|
+
ui?: ThemeSlots;
|
|
22
|
+
class?: string;
|
|
23
|
+
styling?: 'tailwindcss' | 'vanillacss';
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
modelValue: ModelValue;
|
|
27
|
+
format?: Format;
|
|
28
|
+
}
|
|
29
|
+
export type ColorPickerRootEmits = {
|
|
30
|
+
(e: 'valueCommit', value: ModelValue): void;
|
|
31
|
+
(e: 'update:modelValue', value: ModelValue): void;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorPickerRootProps, {
|
|
34
|
+
color: {
|
|
35
|
+
state: Ref<{
|
|
36
|
+
hsv: {
|
|
37
|
+
h: number;
|
|
38
|
+
s: number;
|
|
39
|
+
v: number;
|
|
40
|
+
};
|
|
41
|
+
hsl: {
|
|
42
|
+
h: number;
|
|
43
|
+
s: number;
|
|
44
|
+
l: number;
|
|
45
|
+
};
|
|
46
|
+
rgb: {
|
|
47
|
+
r: number;
|
|
48
|
+
g: number;
|
|
49
|
+
b: number;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
hsv: HSV;
|
|
53
|
+
hsl: HSL;
|
|
54
|
+
rgb: RGB;
|
|
55
|
+
} | {
|
|
56
|
+
hsv: {
|
|
57
|
+
h: number;
|
|
58
|
+
s: number;
|
|
59
|
+
v: number;
|
|
60
|
+
};
|
|
61
|
+
hsl: {
|
|
62
|
+
h: number;
|
|
63
|
+
s: number;
|
|
64
|
+
l: number;
|
|
65
|
+
};
|
|
66
|
+
rgb: {
|
|
67
|
+
r: number;
|
|
68
|
+
g: number;
|
|
69
|
+
b: number;
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
72
|
+
alpha: Ref<number, number>;
|
|
73
|
+
rgb: import("vue").WritableComputedRef<RGB, RGB>;
|
|
74
|
+
rgba: import("vue").WritableComputedRef<RGBA, RGBA>;
|
|
75
|
+
hsl: import("vue").WritableComputedRef<HSL, HSL>;
|
|
76
|
+
hsla: import("vue").WritableComputedRef<import("..").HSLA, import("..").HSLA>;
|
|
77
|
+
hsv: import("vue").WritableComputedRef<HSV, HSV>;
|
|
78
|
+
hsva: import("vue").WritableComputedRef<HSVA, HSVA>;
|
|
79
|
+
hex: import("vue").WritableComputedRef<string, string>;
|
|
80
|
+
hexa: import("vue").WritableComputedRef<string, string>;
|
|
81
|
+
toRGBString: () => string;
|
|
82
|
+
toRGBAString: () => string;
|
|
83
|
+
toHSLString: () => string;
|
|
84
|
+
toHSLAString: () => string;
|
|
85
|
+
toHSVString: () => string;
|
|
86
|
+
toHSVAString: () => string;
|
|
87
|
+
toObject: () => ColorObject;
|
|
88
|
+
toFormat: (format: Format) => string | ColorObject;
|
|
89
|
+
fromFormat: (value: string | ColorObject, format: Format) => void;
|
|
90
|
+
};
|
|
91
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
92
|
+
"update:modelValue": (value: ModelValue) => any;
|
|
93
|
+
valueCommit: (value: ModelValue) => any;
|
|
94
|
+
}, string, import("vue").PublicProps, Readonly<ColorPickerRootProps> & Readonly<{
|
|
95
|
+
"onUpdate:modelValue"?: ((value: ModelValue) => any) | undefined;
|
|
96
|
+
onValueCommit?: ((value: ModelValue) => any) | undefined;
|
|
97
|
+
}>, {
|
|
98
|
+
styling: "tailwindcss" | "vanillacss";
|
|
99
|
+
disabled: boolean;
|
|
100
|
+
defaultValue: string;
|
|
101
|
+
format: Format;
|
|
102
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
103
|
+
default?: (props: {}) => any;
|
|
104
|
+
}>;
|
|
105
|
+
declare const _default: typeof __VLS_export;
|
|
106
|
+
export default _default;
|
|
107
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
108
|
+
new (): {
|
|
109
|
+
$slots: S;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
interface SliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface BlueSliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<BlueSliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlueSliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface GreenSliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<GreenSliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GreenSliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
inverted?: boolean;
|
|
6
|
+
orientation?: SliderRootProps['orientation'];
|
|
7
|
+
ui?: Partial<UiSliderSlots>;
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{}>, {
|
|
10
|
+
orientation: "vertical" | "horizontal";
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface RedSliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<RedSliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RedSliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
import type { UiSliderSlots } from '../utils/styles';
|
|
3
|
+
export interface SliderProps {
|
|
4
|
+
class?: string;
|
|
5
|
+
orientation?: SliderRootProps['orientation'];
|
|
6
|
+
ui?: Partial<UiSliderSlots>;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{}>, {
|
|
9
|
+
orientation: "vertical" | "horizontal";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
as?: string;
|
|
3
|
+
value: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
ui?: Partial<{
|
|
6
|
+
base: string;
|
|
7
|
+
alpha: string;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
as: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { HSV, HSVA, HSL, HSLA, RGB, RGBA, Format, ColorObject } from '../utils/types';
|
|
2
|
+
type ColorState = {
|
|
3
|
+
hsv: HSV;
|
|
4
|
+
hsl: HSL;
|
|
5
|
+
rgb: RGB;
|
|
6
|
+
};
|
|
7
|
+
export declare function useColor(): {
|
|
8
|
+
state: import("vue").Ref<{
|
|
9
|
+
hsv: {
|
|
10
|
+
h: number;
|
|
11
|
+
s: number;
|
|
12
|
+
v: number;
|
|
13
|
+
};
|
|
14
|
+
hsl: {
|
|
15
|
+
h: number;
|
|
16
|
+
s: number;
|
|
17
|
+
l: number;
|
|
18
|
+
};
|
|
19
|
+
rgb: {
|
|
20
|
+
r: number;
|
|
21
|
+
g: number;
|
|
22
|
+
b: number;
|
|
23
|
+
};
|
|
24
|
+
}, ColorState | {
|
|
25
|
+
hsv: {
|
|
26
|
+
h: number;
|
|
27
|
+
s: number;
|
|
28
|
+
v: number;
|
|
29
|
+
};
|
|
30
|
+
hsl: {
|
|
31
|
+
h: number;
|
|
32
|
+
s: number;
|
|
33
|
+
l: number;
|
|
34
|
+
};
|
|
35
|
+
rgb: {
|
|
36
|
+
r: number;
|
|
37
|
+
g: number;
|
|
38
|
+
b: number;
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
41
|
+
alpha: import("vue").Ref<number, number>;
|
|
42
|
+
rgb: import("vue").WritableComputedRef<RGB, RGB>;
|
|
43
|
+
rgba: import("vue").WritableComputedRef<RGBA, RGBA>;
|
|
44
|
+
hsl: import("vue").WritableComputedRef<HSL, HSL>;
|
|
45
|
+
hsla: import("vue").WritableComputedRef<HSLA, HSLA>;
|
|
46
|
+
hsv: import("vue").WritableComputedRef<HSV, HSV>;
|
|
47
|
+
hsva: import("vue").WritableComputedRef<HSVA, HSVA>;
|
|
48
|
+
hex: import("vue").WritableComputedRef<string, string>;
|
|
49
|
+
hexa: import("vue").WritableComputedRef<string, string>;
|
|
50
|
+
toRGBString: () => string;
|
|
51
|
+
toRGBAString: () => string;
|
|
52
|
+
toHSLString: () => string;
|
|
53
|
+
toHSLAString: () => string;
|
|
54
|
+
toHSVString: () => string;
|
|
55
|
+
toHSVAString: () => string;
|
|
56
|
+
toObject: () => ColorObject;
|
|
57
|
+
toFormat: (format: Format) => string | ColorObject;
|
|
58
|
+
fromFormat: (value: string | ColorObject, format: Format) => void;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Ref, CSSProperties } from 'vue';
|
|
2
|
+
export declare function useThumb(canvasRef: Ref<HTMLCanvasElement | null>, type: Ref<'HSV' | 'HSL'>): {
|
|
3
|
+
thumbStyles: import("vue").ComputedRef<CSSProperties>;
|
|
4
|
+
handleWheel: (event: WheelEvent) => void;
|
|
5
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
6
|
+
handlePointerDown: (event: PointerEvent) => void;
|
|
7
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './style/index.css';
|
|
2
|
+
export * from './utils/color';
|
|
3
|
+
export type * from './utils/types';
|
|
4
|
+
export { useVModel } from './composables/useVModel.ts';
|
|
5
|
+
export { injectColorPickerContext } from './components/ColorPickerRoot.vue';
|
|
6
|
+
export { default as ColorPickerRoot } from './components/ColorPickerRoot.vue';
|
|
7
|
+
export { default as ColorPickerCanvas } from './components/ColorPickerCanvas.vue';
|
|
8
|
+
export { default as ColorPickerEyeDropper } from './components/ColorPickerEyeDropper.vue';
|
|
9
|
+
export { default as ColorPickerInputHex } from './components/ColorPickerInputHex.vue';
|
|
10
|
+
export { default as ColorPickerInputRGB } from './components/ColorPickerInputRGB.vue';
|
|
11
|
+
export { default as ColorPickerInputHSL } from './components/ColorPickerInputHSL.vue';
|
|
12
|
+
export { default as ColorPickerInputHSB } from './components/ColorPickerInputHSB.vue';
|
|
13
|
+
export { default as ColorPickerSliderAlpha } from './components/ColorPickerSliderAlpha.vue';
|
|
14
|
+
export { default as ColorPickerSliderHue } from './components/ColorPickerSliderHue.vue';
|
|
15
|
+
export { default as ColorPickerSliderSaturation } from './components/ColorPickerSliderSaturation.vue';
|
|
16
|
+
export { default as ColorPickerSliderLightness } from './components/ColorPickerSliderLightness.vue';
|
|
17
|
+
export { default as ColorPickerSliderRed } from './components/ColorPickerSliderRed.vue';
|
|
18
|
+
export { default as ColorPickerSliderGreen } from './components/ColorPickerSliderGreen.vue';
|
|
19
|
+
export { default as ColorPickerSliderBlue } from './components/ColorPickerSliderBlue.vue';
|
|
20
|
+
export { default as ColorPickerSwatch } from './components/ColorPickerSwatch.vue';
|