@urcolor/vue 0.0.1
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 +155 -0
- package/dist/components/ColorArea/ColorAreaCheckerboard.vue.d.ts +10 -0
- package/dist/components/ColorArea/ColorAreaGradient.vue.d.ts +36 -0
- package/dist/components/ColorArea/ColorAreaImpl.vue.d.ts +45 -0
- package/dist/components/ColorArea/ColorAreaRegion.vue.d.ts +15 -0
- package/dist/components/ColorArea/ColorAreaRoot.vue.d.ts +101 -0
- package/dist/components/ColorArea/ColorAreaThumb.vue.d.ts +17 -0
- package/dist/components/ColorArea/ColorAreaThumbX.vue.d.ts +17 -0
- package/dist/components/ColorArea/ColorAreaThumbY.vue.d.ts +17 -0
- package/dist/components/ColorArea/ColorAreaTrack.vue.d.ts +17 -0
- package/dist/components/ColorArea/index.d.ts +9 -0
- package/dist/components/ColorArea/utils.d.ts +62 -0
- package/dist/components/ColorField/ColorFieldDecrement.vue.d.ts +19 -0
- package/dist/components/ColorField/ColorFieldIncrement.vue.d.ts +19 -0
- package/dist/components/ColorField/ColorFieldInput.vue.d.ts +17 -0
- package/dist/components/ColorField/ColorFieldRoot.vue.d.ts +74 -0
- package/dist/components/ColorField/ColorFieldSwatch.vue.d.ts +15 -0
- package/dist/components/ColorField/index.d.ts +5 -0
- package/dist/components/ColorField/utils.d.ts +8 -0
- package/dist/components/ColorSlider/ColorSliderCheckerboard.vue.d.ts +10 -0
- package/dist/components/ColorSlider/ColorSliderGradient.vue.d.ts +33 -0
- package/dist/components/ColorSlider/ColorSliderRange.vue.d.ts +13 -0
- package/dist/components/ColorSlider/ColorSliderRoot.vue.d.ts +49 -0
- package/dist/components/ColorSlider/ColorSliderThumb.vue.d.ts +13 -0
- package/dist/components/ColorSlider/ColorSliderTrack.vue.d.ts +13 -0
- package/dist/components/ColorSlider/index.d.ts +6 -0
- package/dist/components/ColorSwatch/ColorSwatchRoot.vue.d.ts +26 -0
- package/dist/components/ColorSwatch/index.d.ts +2 -0
- package/dist/components/ColorSwatchGroup/ColorSwatchGroupItem.vue.d.ts +25 -0
- package/dist/components/ColorSwatchGroup/ColorSwatchGroupRoot.vue.d.ts +58 -0
- package/dist/components/ColorSwatchGroup/index.d.ts +5 -0
- package/dist/composables/useColor.d.ts +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2852 -0
- package/package.json +58 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ColorFieldRoot, type ColorFieldRootProps, type ColorFieldRootEmits, type ColorFieldRootContext, } from "./ColorFieldRoot.vue";
|
|
2
|
+
export { default as ColorFieldInput, type ColorFieldInputProps, } from "./ColorFieldInput.vue";
|
|
3
|
+
export { default as ColorFieldIncrement, type ColorFieldIncrementProps, } from "./ColorFieldIncrement.vue";
|
|
4
|
+
export { default as ColorFieldDecrement, type ColorFieldDecrementProps, } from "./ColorFieldDecrement.vue";
|
|
5
|
+
export { default as ColorFieldSwatch, type ColorFieldSwatchProps, } from "./ColorFieldSwatch.vue";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
2
|
+
export interface ColorSliderCheckerboardProps extends /* @vue-ignore */ PrimitiveProps {
|
|
3
|
+
as?: string;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<ColorSliderCheckerboardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSliderCheckerboardProps> & Readonly<{}>, {
|
|
9
|
+
as: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "internationalized-color/css";
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
3
|
+
export interface ColorSliderGradientProps extends /* @vue-ignore */ PrimitiveProps {
|
|
4
|
+
as?: string;
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
/** Array of color stops. When omitted, auto-computes from the slider's channel and current color. */
|
|
7
|
+
colors?: string[];
|
|
8
|
+
/** If true, gradient runs top-to-bottom instead of left-to-right. */
|
|
9
|
+
vertical?: boolean;
|
|
10
|
+
/** When set to a non-RGB color space, interpolates stops in that space for perceptual accuracy. */
|
|
11
|
+
interpolationSpace?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Lock specific channels to fixed values in the gradient.
|
|
14
|
+
* - `{ alpha: 1 }` (default) — lock alpha to 1
|
|
15
|
+
* - `{ s: 1, v: 1 }` — lock saturation and value
|
|
16
|
+
* - `false` — no overrides, gradient reflects all channels from current color
|
|
17
|
+
*/
|
|
18
|
+
channelOverrides?: Record<string, number> | false;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSliderGradientProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSliderGradientProps> & Readonly<{}>, {
|
|
23
|
+
as: string;
|
|
24
|
+
vertical: boolean;
|
|
25
|
+
channelOverrides: Record<string, number> | false;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
27
|
+
default?: (props: {}) => any;
|
|
28
|
+
}>;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SliderRangeProps } from "reka-ui";
|
|
2
|
+
export interface ColorSliderRangeProps extends /* @vue-ignore */ SliderRangeProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSliderRangeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSliderRangeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
7
|
+
default?: (props: {}) => any;
|
|
8
|
+
}>;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import "internationalized-color/css";
|
|
3
|
+
import { Color } from "internationalized-color";
|
|
4
|
+
export interface ColorSliderRootProps {
|
|
5
|
+
/** The controlled color value. Can be bind as `v-model`. */
|
|
6
|
+
modelValue?: Color | string | null;
|
|
7
|
+
/** The color space mode (e.g. 'hsl', 'oklch'). */
|
|
8
|
+
colorSpace?: string;
|
|
9
|
+
/** Which channel this slider controls (e.g. 'h', 's', 'l'). */
|
|
10
|
+
channel?: string;
|
|
11
|
+
/** When `true`, prevents the user from interacting with the slider. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** The reading direction. */
|
|
14
|
+
dir?: "ltr" | "rtl";
|
|
15
|
+
/** Whether the slider is visually inverted. */
|
|
16
|
+
inverted?: boolean;
|
|
17
|
+
/** The orientation of the slider. */
|
|
18
|
+
orientation?: "horizontal" | "vertical";
|
|
19
|
+
}
|
|
20
|
+
export type ColorSliderRootEmits = {
|
|
21
|
+
"update:modelValue": [payload: Color | undefined];
|
|
22
|
+
"valueCommit": [payload: Color];
|
|
23
|
+
};
|
|
24
|
+
export interface ColorSliderRootContext {
|
|
25
|
+
colorRef: Ref<Color | undefined>;
|
|
26
|
+
channel: Ref<string>;
|
|
27
|
+
colorSpace: Ref<string>;
|
|
28
|
+
}
|
|
29
|
+
export declare const injectColorSliderRootContext: <T extends ColorSliderRootContext | null | undefined = ColorSliderRootContext>(fallback?: T | undefined) => T extends null ? ColorSliderRootContext | null : ColorSliderRootContext, provideColorSliderRootContext: (contextValue: ColorSliderRootContext) => ColorSliderRootContext;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSliderRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (payload: Color | undefined) => any;
|
|
34
|
+
valueCommit: (payload: Color) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<ColorSliderRootProps> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((payload: Color | undefined) => any) | undefined;
|
|
37
|
+
onValueCommit?: ((payload: Color) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
colorSpace: string;
|
|
41
|
+
channel: string;
|
|
42
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
43
|
+
default?: (props: {}) => any;
|
|
44
|
+
}>;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SliderThumbProps } from "reka-ui";
|
|
2
|
+
export interface ColorSliderThumbProps extends /* @vue-ignore */ SliderThumbProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSliderThumbProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSliderThumbProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
7
|
+
default?: (props: {}) => any;
|
|
8
|
+
}>;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SliderTrackProps } from "reka-ui";
|
|
2
|
+
export interface ColorSliderTrackProps extends /* @vue-ignore */ SliderTrackProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSliderTrackProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSliderTrackProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
7
|
+
default?: (props: {}) => any;
|
|
8
|
+
}>;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ColorSliderRoot, type ColorSliderRootProps, type ColorSliderRootEmits, injectColorSliderRootContext, } from "./ColorSliderRoot.vue";
|
|
2
|
+
export { default as ColorSliderTrack, type ColorSliderTrackProps, } from "./ColorSliderTrack.vue";
|
|
3
|
+
export { default as ColorSliderRange, type ColorSliderRangeProps, } from "./ColorSliderRange.vue";
|
|
4
|
+
export { default as ColorSliderThumb, type ColorSliderThumbProps, } from "./ColorSliderThumb.vue";
|
|
5
|
+
export { default as ColorSliderGradient, type ColorSliderGradientProps, } from "./ColorSliderGradient.vue";
|
|
6
|
+
export { default as ColorSliderCheckerboard, type ColorSliderCheckerboardProps, } from "./ColorSliderCheckerboard.vue";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
2
|
+
import "internationalized-color/css";
|
|
3
|
+
import { Color } from "internationalized-color";
|
|
4
|
+
export interface ColorSwatchRootProps extends /* @vue-ignore */ PrimitiveProps {
|
|
5
|
+
as?: string;
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
/** The color value to display. */
|
|
8
|
+
modelValue?: Color | string | null;
|
|
9
|
+
/** The checkerboard size in pixels. */
|
|
10
|
+
checkerSize?: number;
|
|
11
|
+
/** When true, reflects the color's alpha channel. When false, displays the color as fully opaque. */
|
|
12
|
+
alpha?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSwatchRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchRootProps> & Readonly<{}>, {
|
|
17
|
+
as: string;
|
|
18
|
+
checkerSize: number;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
default?: (props: {}) => any;
|
|
21
|
+
}>;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ColorSwatchRootProps } from "../ColorSwatch/ColorSwatchRoot.vue";
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
3
|
+
export interface ColorSwatchGroupItemProps extends PrimitiveProps, Pick<ColorSwatchRootProps, "checkerSize" | "alpha"> {
|
|
4
|
+
as?: string;
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
/** The color value. Serves as both the selection value and the displayed color. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** When `true`, prevents the user from interacting with this item. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSwatchGroupItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorSwatchGroupItemProps> & Readonly<{}>, {
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
as: string;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
17
|
+
default?: (props: {}) => any;
|
|
18
|
+
} & {
|
|
19
|
+
default?: (props: {}) => any;
|
|
20
|
+
}>;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
3
|
+
export type SelectionType = "single" | "multiple";
|
|
4
|
+
export interface ColorSwatchGroupRootProps extends /* @vue-ignore */ PrimitiveProps {
|
|
5
|
+
as?: string;
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
/** Whether to allow single or multiple selection. */
|
|
8
|
+
type?: SelectionType;
|
|
9
|
+
/** The controlled selected value(s). Can be bound as `v-model`. */
|
|
10
|
+
modelValue?: string[];
|
|
11
|
+
/** The default selected value(s) when uncontrolled. */
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
/** When `true`, prevents the user from interacting with the group. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** The orientation of the group for arrow key navigation. */
|
|
16
|
+
orientation?: "horizontal" | "vertical";
|
|
17
|
+
/** Whether keyboard navigation should loop around. */
|
|
18
|
+
loop?: boolean;
|
|
19
|
+
/** Whether to use roving focus for keyboard navigation. */
|
|
20
|
+
rovingFocus?: boolean;
|
|
21
|
+
/** The reading direction. */
|
|
22
|
+
dir?: "ltr" | "rtl";
|
|
23
|
+
}
|
|
24
|
+
export type ColorSwatchGroupRootEmits = {
|
|
25
|
+
"update:modelValue": [value: string[]];
|
|
26
|
+
};
|
|
27
|
+
export interface ColorSwatchGroupContext {
|
|
28
|
+
modelValue: Ref<string[]>;
|
|
29
|
+
type: Ref<SelectionType>;
|
|
30
|
+
disabled: Ref<boolean>;
|
|
31
|
+
rovingFocus: Ref<boolean>;
|
|
32
|
+
changeModelValue: (value: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const injectColorSwatchGroupContext: <T extends ColorSwatchGroupContext | null | undefined = ColorSwatchGroupContext>(fallback?: T | undefined) => T extends null ? ColorSwatchGroupContext | null : ColorSwatchGroupContext, provideColorSwatchGroupContext: (contextValue: ColorSwatchGroupContext) => ColorSwatchGroupContext;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
37
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ColorSwatchGroupRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
"update:modelValue": (value: string[]) => any;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<ColorSwatchGroupRootProps> & Readonly<{
|
|
40
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
type: SelectionType;
|
|
44
|
+
as: string;
|
|
45
|
+
defaultValue: string[];
|
|
46
|
+
orientation: "horizontal" | "vertical";
|
|
47
|
+
loop: boolean;
|
|
48
|
+
rovingFocus: boolean;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
50
|
+
default?: (props: {}) => any;
|
|
51
|
+
} & {
|
|
52
|
+
default?: (props: {}) => any;
|
|
53
|
+
}>;
|
|
54
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as ColorSwatchGroupRoot } from "./ColorSwatchGroupRoot.vue";
|
|
2
|
+
export type { ColorSwatchGroupRootProps, ColorSwatchGroupRootEmits, ColorSwatchGroupContext, } from "./ColorSwatchGroupRoot.vue";
|
|
3
|
+
export { injectColorSwatchGroupContext } from "./ColorSwatchGroupRoot.vue";
|
|
4
|
+
export { default as ColorSwatchGroupItem } from "./ColorSwatchGroupItem.vue";
|
|
5
|
+
export type { ColorSwatchGroupItemProps } from "./ColorSwatchGroupItem.vue";
|