@mrpelz/uikit-ish 7.10.0 → 7.11.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/dist/components/color-picker/color.d.ts +23 -0
- package/dist/components/color-picker/color.d.ts.map +1 -0
- package/dist/components/color-picker/color.js +150 -0
- package/dist/components/color-picker/color.js.map +1 -0
- package/dist/components/color-picker/main.d.ts +16 -3
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +451 -92
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/named-colors.d.ts +3 -0
- package/dist/components/color-picker/named-colors.d.ts.map +1 -0
- package/dist/components/color-picker/named-colors.js +152 -0
- package/dist/components/color-picker/named-colors.js.map +1 -0
- package/dist/components/color-picker/props.d.ts +60 -12
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +201 -21
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +10 -8
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/style.css +17 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/menu/main.d.ts +6 -2
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +207 -7
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/style.css +6 -2
- package/dist/components/popover/main.d.ts +1 -1
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +24 -3
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +149 -14
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/props.d.ts +7 -0
- package/dist/components/segmented/props.d.ts.map +1 -1
- package/dist/components/segmented/style.css +135 -6
- package/dist/components/sheet/main.d.ts +5 -4
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +35 -13
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +28 -0
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/style.css +124 -25
- package/dist/components/utils/main.d.ts +5 -0
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +8 -1
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/viewport/main.d.ts +1 -1
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +1 -1
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts.map +1 -1
- package/dist/components/viewport/padding.js +5 -1
- package/dist/components/viewport/padding.js.map +1 -1
- package/dist/components/viewport/style.css +22 -3
- package/package.json +2 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Rgba } from './props.js';
|
|
2
|
+
/**
|
|
3
|
+
* A CSS color (any syntax of the spaces above: hex, `rgb()`, `oklch()`,
|
|
4
|
+
* `color(display-p3 …)`, …) as the picker's: in sRGB (out of it, mapped into
|
|
5
|
+
* it); not one, none.
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseCssColor: (text: string) => Rgba | undefined;
|
|
8
|
+
/** A code to copy (see `codeGroups`): its format, its values, its CSS. */
|
|
9
|
+
export type ColorCode = {
|
|
10
|
+
code: string;
|
|
11
|
+
label: string;
|
|
12
|
+
subtitle: string;
|
|
13
|
+
/** Its color shown (hex's: opaque, or with its alpha). */
|
|
14
|
+
well?: string;
|
|
15
|
+
};
|
|
16
|
+
/** A group of codes: its title, its codes. */
|
|
17
|
+
export type CodeGroup = readonly [title: string, codes: readonly ColorCode[]];
|
|
18
|
+
/**
|
|
19
|
+
* A color's codes, by group: hex (without its alpha, with it), sRGB's CSS
|
|
20
|
+
* functions, the perceptual ones, the wide gamut's.
|
|
21
|
+
*/
|
|
22
|
+
export declare const codeGroups: (color: Rgba, hex: string) => readonly CodeGroup[];
|
|
23
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAyBvC;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,IAAI,GAAG,SAWnD,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC,CAAC;AA+F9E;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,IAAI,EAAE,KAAK,MAAM,KAAG,SAAS,SAAS,EAwCvE,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ColorSpace, HSL, HWB, Lab, LCH, OKLab, OKLCH, P3, parse, sRGB, to, toGamut, } from 'colorjs.io/fn';
|
|
2
|
+
// The picker's colors in CSS's color syntaxes (Color.js, its functional API:
|
|
3
|
+
// only these spaces bundled): parsed (a color input's value, see
|
|
4
|
+
// `SystemColors`), and as codes to copy (see `CodeCopy`).
|
|
5
|
+
// (Registered: their syntaxes parsed by `parse`.)
|
|
6
|
+
for (const space of [sRGB, HSL, HWB, Lab, LCH, OKLab, OKLCH, P3]) {
|
|
7
|
+
ColorSpace.register(space);
|
|
8
|
+
}
|
|
9
|
+
/** A coordinate, given (`none`, missing: 0). */
|
|
10
|
+
const given = (coord) => coord === null || Number.isNaN(coord) ? 0 : coord;
|
|
11
|
+
/** A number, to at most three decimals (a code's coordinate, an alpha). */
|
|
12
|
+
const decimals = (value) => String(Math.round(value * 1000) / 1000);
|
|
13
|
+
/** A color as Color.js's: sRGB, its channels 0–1. */
|
|
14
|
+
const fromRgba = ({ a, b, g, r }) => ({
|
|
15
|
+
alpha: a,
|
|
16
|
+
coords: [r / 255, g / 255, b / 255],
|
|
17
|
+
space: sRGB,
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* A CSS color (any syntax of the spaces above: hex, `rgb()`, `oklch()`,
|
|
21
|
+
* `color(display-p3 …)`, …) as the picker's: in sRGB (out of it, mapped into
|
|
22
|
+
* it); not one, none.
|
|
23
|
+
*/
|
|
24
|
+
export const parseCssColor = (text) => {
|
|
25
|
+
let color;
|
|
26
|
+
try {
|
|
27
|
+
color = toGamut(to(parse(text), sRGB), { space: sRGB });
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const [r = 0, g = 0, b = 0] = color.coords.map((coord) => Math.min(Math.max(given(coord) * 255, 0), 255));
|
|
33
|
+
return { a: typeof color.alpha === 'number' ? color.alpha : 1, b, g, r };
|
|
34
|
+
};
|
|
35
|
+
const formats = {
|
|
36
|
+
hsl: {
|
|
37
|
+
coords: [['h'], ['s', '%'], ['l', '%']],
|
|
38
|
+
css: 'hsl(',
|
|
39
|
+
label: 'hsl()',
|
|
40
|
+
space: HSL,
|
|
41
|
+
},
|
|
42
|
+
hwb: {
|
|
43
|
+
coords: [['h'], ['w', '%'], ['b', '%']],
|
|
44
|
+
css: 'hwb(',
|
|
45
|
+
label: 'hwb()',
|
|
46
|
+
space: HWB,
|
|
47
|
+
},
|
|
48
|
+
lab: {
|
|
49
|
+
coords: [['l'], ['a'], ['b']],
|
|
50
|
+
css: 'lab(',
|
|
51
|
+
label: 'lab()',
|
|
52
|
+
space: Lab,
|
|
53
|
+
},
|
|
54
|
+
lch: {
|
|
55
|
+
coords: [['l'], ['c'], ['h']],
|
|
56
|
+
css: 'lch(',
|
|
57
|
+
label: 'lch()',
|
|
58
|
+
space: LCH,
|
|
59
|
+
},
|
|
60
|
+
oklab: {
|
|
61
|
+
coords: [['l'], ['a'], ['b']],
|
|
62
|
+
css: 'oklab(',
|
|
63
|
+
label: 'oklab()',
|
|
64
|
+
space: OKLab,
|
|
65
|
+
},
|
|
66
|
+
oklch: {
|
|
67
|
+
coords: [['l'], ['c'], ['h']],
|
|
68
|
+
css: 'oklch(',
|
|
69
|
+
label: 'oklch()',
|
|
70
|
+
space: OKLCH,
|
|
71
|
+
},
|
|
72
|
+
p3: {
|
|
73
|
+
coords: [['r'], ['g'], ['b']],
|
|
74
|
+
css: 'color(display-p3 ',
|
|
75
|
+
label: 'color(display-p3)',
|
|
76
|
+
space: P3,
|
|
77
|
+
},
|
|
78
|
+
rgb: {
|
|
79
|
+
coords: [['r'], ['g'], ['b']],
|
|
80
|
+
css: 'rgb(',
|
|
81
|
+
isWhole: true,
|
|
82
|
+
label: 'rgb()',
|
|
83
|
+
scale: 255,
|
|
84
|
+
space: sRGB,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* A color in a format: its CSS (its coordinates to three decimals, as its
|
|
89
|
+
* subtitle's; a gray's hue 0, not `none`), its subtitle (each coordinate
|
|
90
|
+
* named, e.g. “r: 255 / g: 127 / b: 0”; translucent, its alpha last).
|
|
91
|
+
*/
|
|
92
|
+
const code = (color, format) => {
|
|
93
|
+
const values = to(color, format.space).coords.map((coord) => {
|
|
94
|
+
const value = given(coord) * (format.scale ?? 1);
|
|
95
|
+
return format.isWhole ? String(Math.round(value)) : decimals(value);
|
|
96
|
+
});
|
|
97
|
+
const alpha = typeof color.alpha === 'number' ? color.alpha : 1;
|
|
98
|
+
const coords = format.coords.map(([, unit = ''], index) => `${values[index] ?? '0'}${unit}`);
|
|
99
|
+
const named = format.coords.map(([name], index) => `${name}: ${coords[index] ?? '0'}`);
|
|
100
|
+
return {
|
|
101
|
+
code: `${format.css}${coords.join(' ')}${alpha < 1 ? ` / ${decimals(alpha)}` : ''})`,
|
|
102
|
+
label: format.label,
|
|
103
|
+
subtitle: [...named, ...(alpha < 1 ? [`a: ${decimals(alpha)}`] : [])].join(' / '),
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* A color's codes, by group: hex (without its alpha, with it), sRGB's CSS
|
|
108
|
+
* functions, the perceptual ones, the wide gamut's.
|
|
109
|
+
*/
|
|
110
|
+
export const codeGroups = (color, hex) => {
|
|
111
|
+
const plain = fromRgba(color);
|
|
112
|
+
const alphaHex = Math.round(color.a * 255)
|
|
113
|
+
.toString(16)
|
|
114
|
+
.padStart(2, '0')
|
|
115
|
+
.toUpperCase();
|
|
116
|
+
const withAlpha = `${hex}${alphaHex}`;
|
|
117
|
+
return [
|
|
118
|
+
[
|
|
119
|
+
'Hex',
|
|
120
|
+
[
|
|
121
|
+
{ code: hex, label: 'Hex', subtitle: hex, well: hex },
|
|
122
|
+
{
|
|
123
|
+
code: withAlpha,
|
|
124
|
+
label: 'Hex with alpha',
|
|
125
|
+
subtitle: withAlpha,
|
|
126
|
+
well: withAlpha,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
'sRGB',
|
|
132
|
+
[
|
|
133
|
+
code(plain, formats.rgb),
|
|
134
|
+
code(plain, formats.hsl),
|
|
135
|
+
code(plain, formats.hwb),
|
|
136
|
+
],
|
|
137
|
+
],
|
|
138
|
+
[
|
|
139
|
+
'Perceptual',
|
|
140
|
+
[
|
|
141
|
+
code(plain, formats.oklch),
|
|
142
|
+
code(plain, formats.oklab),
|
|
143
|
+
code(plain, formats.lab),
|
|
144
|
+
code(plain, formats.lch),
|
|
145
|
+
],
|
|
146
|
+
],
|
|
147
|
+
['Wide gamut', [code(plain, formats.p3)]],
|
|
148
|
+
];
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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G,CAAC;aACzB;SACF;QACD,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;KAC1C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import '../button/style.css';
|
|
2
|
+
import '../list/style.css';
|
|
2
3
|
import '../menu/style.css';
|
|
3
4
|
import '../page-control/style.css';
|
|
4
5
|
import '../segmented/style.css';
|
|
5
6
|
import './style.css';
|
|
6
7
|
import { FunctionComponent } from 'react';
|
|
7
|
-
import type { ColorPickerEyedropperProps, ColorPickerModeProps, ColorPickerModesProps,
|
|
8
|
-
export type { ColorPickerChangeEventDetails, ColorPickerEyedropperProps, ColorPickerModeProps, ColorPickerModesProps, ColorPickerPanelProps, ColorPickerRootProps, ColorPickerSavedColorsChangeEventDetails, ColorPickerSlidersModel, ColorPickerSlidersProps, ColorPickerSwatchesProps, ColorPickerViewProps, ColorWellProps, } from './props.js';
|
|
8
|
+
import type { ColorPickerCodeCopyProps, ColorPickerEyedropperProps, ColorPickerModeProps, ColorPickerModesProps, ColorPickerNamedColorProps, ColorPickerRootProps, ColorPickerSlidersProps, ColorPickerSwatchesProps, ColorPickerSystemColorsProps, ColorPickerViewProps, ColorWellProps, Rgba } from './props.js';
|
|
9
|
+
export type { ColorPickerChangeEventDetails, ColorPickerCodeCopyProps, ColorPickerCodeProps, ColorPickerEyedropperProps, ColorPickerModeProps, ColorPickerModesProps, ColorPickerNamedColorProps, ColorPickerNamedProps, ColorPickerPanelProps, ColorPickerRootProps, ColorPickerSavedColorsChangeEventDetails, ColorPickerSlidersModel, ColorPickerSlidersProps, ColorPickerSlidersRange, ColorPickerSwatchesProps, ColorPickerSystemColorsProps, ColorPickerViewProps, ColorWellProps, } from './props.js';
|
|
9
10
|
/** A hex color (#rgb, #rrggbb, #rrggbbaa) as channels (0–255, alpha 0–1). */
|
|
10
11
|
export declare const parseColor: (hex: string) => Rgba;
|
|
11
12
|
/** Channels as a hex color (#rrggbb, or #rrggbbaa if not opaque). */
|
|
@@ -19,7 +20,7 @@ export declare const ColorPicker: {
|
|
|
19
20
|
Header: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
20
21
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
21
22
|
}>;
|
|
22
|
-
Panel: import("preact").FunctionalComponent<import("react").PropsWithoutRef<
|
|
23
|
+
Panel: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
23
24
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
24
25
|
}>;
|
|
25
26
|
Modes: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorPickerModesProps> & {
|
|
@@ -47,6 +48,18 @@ export declare const ColorPicker: {
|
|
|
47
48
|
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
48
49
|
}>;
|
|
49
50
|
Eyedropper: FunctionComponent<ColorPickerEyedropperProps>;
|
|
51
|
+
SystemColors: FunctionComponent<ColorPickerSystemColorsProps>;
|
|
52
|
+
Code: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
53
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
CodeCopy: FunctionComponent<ColorPickerCodeCopyProps>;
|
|
56
|
+
Named: import("preact").FunctionalComponent<import("react").PropsWithoutRef<import("preact").HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
+
ref?: import("preact").Ref<HTMLDivElement> | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
NamedColor: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorPickerNamedColorProps> & {
|
|
60
|
+
ref?: import("preact").Ref<HTMLElement> | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
CssNamedColors: FunctionComponent<{}>;
|
|
50
63
|
Well: import("preact").FunctionalComponent<import("react").PropsWithoutRef<ColorWellProps> & {
|
|
51
64
|
ref?: import("preact").Ref<HTMLButtonElement> | undefined;
|
|
52
65
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/main.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/main.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAChC,OAAO,aAAa,CAAC;AAKrB,OAAO,EASL,iBAAiB,EAYlB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAEV,wBAAwB,EAExB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAG1B,oBAAoB,EAGpB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,EAKd,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,wCAAwC,EACxC,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AAyCpB,6EAA6E;AAC7E,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,IAexC,CAAC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