@pathscale/ui 0.0.109 → 0.0.111
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/components/colorpicker/AlphaSlider.d.ts +7 -0
- package/dist/components/colorpicker/ColorInput.d.ts +7 -0
- package/dist/components/colorpicker/ColorPicker.d.ts +18 -0
- package/dist/components/colorpicker/ColorPickerFlowerSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPickerGradientSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPickerWheelSelector.d.ts +3 -0
- package/dist/components/colorpicker/ColorPreview.d.ts +11 -0
- package/dist/components/colorpicker/ColorSwatches.d.ts +8 -0
- package/dist/components/colorpicker/ColorUtils.d.ts +58 -0
- package/dist/components/colorpicker/ColorWheel.d.ts +7 -0
- package/dist/components/colorpicker/ColorWheelFlower.d.ts +7 -0
- package/dist/components/colorpicker/HueSlider.d.ts +7 -0
- package/dist/components/colorpicker/LightnessSlider.d.ts +7 -0
- package/dist/components/colorpicker/SaturationBrightness.d.ts +7 -0
- package/dist/components/colorpicker/colorpickerContext.d.ts +11 -0
- package/dist/components/colorpicker/index.d.ts +26 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2536 -1047
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { ColorFormat } from "./ColorUtils";
|
|
3
|
+
import { IComponentBaseProps } from "../types";
|
|
4
|
+
export type { ColorFormat } from "./ColorUtils";
|
|
5
|
+
export type ColorPickerMode = "picker" | "wheel" | "flower";
|
|
6
|
+
export interface ColorPickerProps extends IComponentBaseProps {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (color: string) => void;
|
|
9
|
+
format?: ColorFormat;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
swatches?: string[];
|
|
12
|
+
showAlpha?: boolean;
|
|
13
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
14
|
+
initialMode?: ColorPickerMode;
|
|
15
|
+
"aria-label"?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const ColorPicker: (props: ColorPickerProps) => JSX.Element;
|
|
18
|
+
export default ColorPicker;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { ColorValue } from "./ColorUtils";
|
|
3
|
+
export interface ColorPreviewProps {
|
|
4
|
+
color: ColorValue;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
class?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const ColorPreview: (props: ColorPreviewProps) => JSX.Element;
|
|
11
|
+
export default ColorPreview;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type ColorFormat = "hex" | "rgb" | "rgba" | "hsl" | "hsla";
|
|
2
|
+
export interface RGB {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
export interface RGBA extends RGB {
|
|
8
|
+
a: number;
|
|
9
|
+
}
|
|
10
|
+
export interface HSL {
|
|
11
|
+
h: number;
|
|
12
|
+
s: number;
|
|
13
|
+
l: number;
|
|
14
|
+
}
|
|
15
|
+
export interface HSLA extends HSL {
|
|
16
|
+
a: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ColorValue {
|
|
19
|
+
rgb: RGBA;
|
|
20
|
+
hsl: HSLA;
|
|
21
|
+
hex: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Convert hex color to RGB
|
|
25
|
+
*/
|
|
26
|
+
export declare function hexToRgb(hex: string): RGB | null;
|
|
27
|
+
/**
|
|
28
|
+
* Convert RGB to hex
|
|
29
|
+
*/
|
|
30
|
+
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* Convert RGB to HSL
|
|
33
|
+
*/
|
|
34
|
+
export declare function rgbToHsl(r: number, g: number, b: number): HSL;
|
|
35
|
+
/**
|
|
36
|
+
* Convert HSL to RGB
|
|
37
|
+
*/
|
|
38
|
+
export declare function hslToRgb(h: number, s: number, l: number): RGB;
|
|
39
|
+
/**
|
|
40
|
+
* Parse color string to ColorValue
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseColor(color: string): ColorValue | null;
|
|
43
|
+
/**
|
|
44
|
+
* Format ColorValue to specified format string
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatColor(color: ColorValue, format: ColorFormat): string;
|
|
47
|
+
/**
|
|
48
|
+
* Set alpha channel of a ColorValue
|
|
49
|
+
*/
|
|
50
|
+
export declare function setAlpha(color: ColorValue, alpha: number): ColorValue;
|
|
51
|
+
/**
|
|
52
|
+
* Create ColorValue from HSL values
|
|
53
|
+
*/
|
|
54
|
+
export declare function createColorFromHsl(h: number, s: number, l: number, a?: number): ColorValue;
|
|
55
|
+
/**
|
|
56
|
+
* Get default color value (white)
|
|
57
|
+
*/
|
|
58
|
+
export declare function getDefaultColor(): ColorValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
import type { ColorValue, ColorFormat } from "./ColorUtils";
|
|
3
|
+
export interface ColorPickerContextType {
|
|
4
|
+
color: Accessor<ColorValue>;
|
|
5
|
+
format: Accessor<ColorFormat>;
|
|
6
|
+
disabled: Accessor<boolean>;
|
|
7
|
+
onChange: (color: ColorValue) => void;
|
|
8
|
+
onFormatChange: (format: ColorFormat) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ColorPickerContext: import("solid-js").Context<ColorPickerContextType | undefined>;
|
|
11
|
+
export declare function useColorPickerContext(): ColorPickerContextType;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { default as ColorPicker, default } from "./ColorPicker";
|
|
2
|
+
export type { ColorPickerProps, ColorFormat, ColorPickerMode } from "./ColorPicker";
|
|
3
|
+
export { default as ColorPickerGradientSelector } from "./ColorPickerGradientSelector";
|
|
4
|
+
export { default as ColorPickerWheelSelector } from "./ColorPickerWheelSelector";
|
|
5
|
+
export { default as ColorPickerFlowerSelector } from "./ColorPickerFlowerSelector";
|
|
6
|
+
export { default as SaturationBrightness } from "./SaturationBrightness";
|
|
7
|
+
export { default as HueSlider } from "./HueSlider";
|
|
8
|
+
export { default as LightnessSlider } from "./LightnessSlider";
|
|
9
|
+
export { default as AlphaSlider } from "./AlphaSlider";
|
|
10
|
+
export { default as ColorWheel } from "./ColorWheel";
|
|
11
|
+
export { default as ColorWheelFlower } from "./ColorWheelFlower";
|
|
12
|
+
export { default as ColorSwatches } from "./ColorSwatches";
|
|
13
|
+
export { default as ColorInput } from "./ColorInput";
|
|
14
|
+
export { default as ColorPreview } from "./ColorPreview";
|
|
15
|
+
export { ColorPickerContext, useColorPickerContext } from "./colorpickerContext";
|
|
16
|
+
export type { ColorPickerContextType } from "./colorpickerContext";
|
|
17
|
+
export type { SaturationBrightnessProps } from "./SaturationBrightness";
|
|
18
|
+
export type { HueSliderProps } from "./HueSlider";
|
|
19
|
+
export type { LightnessSliderProps } from "./LightnessSlider";
|
|
20
|
+
export type { AlphaSliderProps } from "./AlphaSlider";
|
|
21
|
+
export type { ColorWheelProps } from "./ColorWheel";
|
|
22
|
+
export type { ColorWheelFlowerProps } from "./ColorWheelFlower";
|
|
23
|
+
export type { ColorSwatchesProps } from "./ColorSwatches";
|
|
24
|
+
export type { ColorInputProps } from "./ColorInput";
|
|
25
|
+
export type { ColorPreviewProps } from "./ColorPreview";
|
|
26
|
+
export type { ColorValue, RGB, RGBA, HSL, HSLA } from "./ColorUtils";
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export { default as Carousel } from "./components/carousel";
|
|
|
15
15
|
export type { CarouselItemProps, CarouselProps } from "./components/carousel";
|
|
16
16
|
export { default as ChatBubble } from "./components/chatbubble";
|
|
17
17
|
export { default as Checkbox } from "./components/checkbox";
|
|
18
|
+
export { default as ColorPicker } from "./components/colorpicker";
|
|
19
|
+
export { AlphaSlider, ColorInput, ColorPickerContext, ColorPickerFlowerSelector, ColorPickerGradientSelector, ColorPickerWheelSelector, ColorPreview, ColorSwatches, ColorWheel, ColorWheelFlower, HueSlider, LightnessSlider, SaturationBrightness, useColorPickerContext, } from "./components/colorpicker";
|
|
20
|
+
export type { AlphaSliderProps, ColorFormat, ColorInputProps, ColorPickerContextType, ColorPickerMode, ColorPickerProps, ColorPreviewProps, ColorSwatchesProps, ColorValue, ColorWheelFlowerProps, ColorWheelProps, HueSliderProps, LightnessSliderProps, SaturationBrightnessProps, } from "./components/colorpicker";
|
|
18
21
|
export { CodeMockup, CodeMockupLine } from "./components/codemockup";
|
|
19
22
|
export { Collapse, CollapseContent, CollapseDetails, CollapseTitle, Summary, } from "./components/collapse";
|
|
20
23
|
export { default as ConnectionStatus } from "./components/connectionstatus";
|