colibri-ui 0.8.95 → 0.8.97
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/ColorPicker/ColorPicker.d.ts +3 -0
- package/ColorPicker/ColorPicker.js +116 -0
- package/ColorPicker/ColorPicker.module.css +22 -0
- package/ColorPicker/assets/none.png +0 -0
- package/ColorPicker/components/ColorPreview/ColorPreview.module.css +23 -0
- package/ColorPicker/components/ColorPreview/index.d.ts +10 -0
- package/ColorPicker/components/ColorPreview/index.js +29 -0
- package/ColorPicker/components/CustomColorModal/CustomColorModal.module.css +18 -0
- package/ColorPicker/components/CustomColorModal/index.d.ts +15 -0
- package/ColorPicker/components/CustomColorModal/index.js +107 -0
- package/ColorPicker/components/HueSlider/HueSlider.module.css +31 -0
- package/ColorPicker/components/HueSlider/index.d.ts +10 -0
- package/ColorPicker/components/HueSlider/index.js +73 -0
- package/ColorPicker/components/Palette/Palette.module.css +12 -0
- package/ColorPicker/components/Palette/index.d.ts +19 -0
- package/ColorPicker/components/Palette/index.js +99 -0
- package/ColorPicker/components/SaturationPanel/SaturationPanel.module.css +26 -0
- package/ColorPicker/components/SaturationPanel/index.d.ts +13 -0
- package/ColorPicker/components/SaturationPanel/index.js +86 -0
- package/ColorPicker/components/Swatch/Swatch.module.css +36 -0
- package/ColorPicker/components/Swatch/index.d.ts +14 -0
- package/ColorPicker/components/Swatch/index.js +47 -0
- package/ColorPicker/hooks/useEyeDropper.d.ts +8 -0
- package/ColorPicker/hooks/useEyeDropper.js +38 -0
- package/ColorPicker/hooks/useHexDraft.d.ts +19 -0
- package/ColorPicker/hooks/useHexDraft.js +49 -0
- package/ColorPicker/hooks/usePointerDrag.d.ts +20 -0
- package/ColorPicker/hooks/usePointerDrag.js +55 -0
- package/ColorPicker/index.d.ts +3 -0
- package/ColorPicker/index.js +9 -0
- package/ColorPicker/index.props.d.ts +43 -0
- package/ColorPicker/package.json +9 -0
- package/ColorPicker/presets.d.ts +3 -0
- package/ColorPicker/presets.js +92 -0
- package/ColorPicker/utils/color.d.ts +25 -0
- package/ColorPicker/utils/color.js +162 -0
- package/Icons/Pipette.d.ts +3 -0
- package/Icons/Pipette.js +35 -0
- package/Icons/index.d.ts +1 -0
- package/Icons/index.js +2 -0
- package/Modal/Modal.module.css +10 -0
- package/Modal/index.js +4 -2
- package/Modal/index.props.d.ts +6 -0
- package/esm/ColorPicker/ColorPicker.d.ts +3 -0
- package/esm/ColorPicker/ColorPicker.js +108 -0
- package/esm/ColorPicker/ColorPicker.module.css +22 -0
- package/esm/ColorPicker/assets/none.png +0 -0
- package/esm/ColorPicker/components/ColorPreview/ColorPreview.module.css +23 -0
- package/esm/ColorPicker/components/ColorPreview/index.d.ts +10 -0
- package/esm/ColorPicker/components/ColorPreview/index.js +21 -0
- package/esm/ColorPicker/components/CustomColorModal/CustomColorModal.module.css +18 -0
- package/esm/ColorPicker/components/CustomColorModal/index.d.ts +15 -0
- package/esm/ColorPicker/components/CustomColorModal/index.js +100 -0
- package/esm/ColorPicker/components/HueSlider/HueSlider.module.css +31 -0
- package/esm/ColorPicker/components/HueSlider/index.d.ts +10 -0
- package/esm/ColorPicker/components/HueSlider/index.js +66 -0
- package/esm/ColorPicker/components/Palette/Palette.module.css +12 -0
- package/esm/ColorPicker/components/Palette/index.d.ts +19 -0
- package/esm/ColorPicker/components/Palette/index.js +92 -0
- package/esm/ColorPicker/components/SaturationPanel/SaturationPanel.module.css +26 -0
- package/esm/ColorPicker/components/SaturationPanel/index.d.ts +13 -0
- package/esm/ColorPicker/components/SaturationPanel/index.js +79 -0
- package/esm/ColorPicker/components/Swatch/Swatch.module.css +36 -0
- package/esm/ColorPicker/components/Swatch/index.d.ts +14 -0
- package/esm/ColorPicker/components/Swatch/index.js +38 -0
- package/esm/ColorPicker/hooks/useEyeDropper.d.ts +8 -0
- package/esm/ColorPicker/hooks/useEyeDropper.js +36 -0
- package/esm/ColorPicker/hooks/useHexDraft.d.ts +19 -0
- package/esm/ColorPicker/hooks/useHexDraft.js +47 -0
- package/esm/ColorPicker/hooks/usePointerDrag.d.ts +20 -0
- package/esm/ColorPicker/hooks/usePointerDrag.js +53 -0
- package/esm/ColorPicker/index.d.ts +3 -0
- package/esm/ColorPicker/index.js +2 -0
- package/esm/ColorPicker/index.props.d.ts +43 -0
- package/esm/ColorPicker/presets.d.ts +3 -0
- package/esm/ColorPicker/presets.js +89 -0
- package/esm/ColorPicker/utils/color.d.ts +25 -0
- package/esm/ColorPicker/utils/color.js +152 -0
- package/esm/Icons/Pipette.d.ts +3 -0
- package/esm/Icons/Pipette.js +29 -0
- package/esm/Icons/index.d.ts +1 -0
- package/esm/Icons/index.js +1 -0
- package/esm/Modal/Modal.module.css +10 -0
- package/esm/Modal/index.js +4 -2
- package/esm/Modal/index.props.d.ts +6 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +3 -0
- package/index.d.ts +2 -0
- package/index.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const COLOR_PICKER_PRESETS = [{
|
|
2
|
+
value: "#ad1457",
|
|
3
|
+
label: "Radicchio"
|
|
4
|
+
}, {
|
|
5
|
+
value: "#f4511e",
|
|
6
|
+
label: "Tangerine"
|
|
7
|
+
}, {
|
|
8
|
+
value: "#e4c441",
|
|
9
|
+
label: "Citron"
|
|
10
|
+
}, {
|
|
11
|
+
value: "#0b8043",
|
|
12
|
+
label: "Basil"
|
|
13
|
+
}, {
|
|
14
|
+
value: "#3f51b5",
|
|
15
|
+
label: "Blueberry"
|
|
16
|
+
}, {
|
|
17
|
+
value: "#8e24aa",
|
|
18
|
+
label: "Grape"
|
|
19
|
+
}, {
|
|
20
|
+
value: "#d81b60",
|
|
21
|
+
label: "Cherry blossom"
|
|
22
|
+
}, {
|
|
23
|
+
value: "#ef6c00",
|
|
24
|
+
label: "Pumpkin"
|
|
25
|
+
}, {
|
|
26
|
+
value: "#c0ca33",
|
|
27
|
+
label: "Avocado"
|
|
28
|
+
}, {
|
|
29
|
+
value: "#009688",
|
|
30
|
+
label: "Eucalyptus"
|
|
31
|
+
}, {
|
|
32
|
+
value: "#7986cb",
|
|
33
|
+
label: "Lavender"
|
|
34
|
+
}, {
|
|
35
|
+
value: "#795548",
|
|
36
|
+
label: "Cocoa"
|
|
37
|
+
}, {
|
|
38
|
+
value: "#d50000",
|
|
39
|
+
label: "Tomato"
|
|
40
|
+
}, {
|
|
41
|
+
value: "#f09300",
|
|
42
|
+
label: "Mango"
|
|
43
|
+
}, {
|
|
44
|
+
value: "#7cb342",
|
|
45
|
+
label: "Pistachio"
|
|
46
|
+
}, {
|
|
47
|
+
value: "#039be5",
|
|
48
|
+
label: "Peacock"
|
|
49
|
+
}, {
|
|
50
|
+
value: "#b39ddb",
|
|
51
|
+
label: "Wisteria"
|
|
52
|
+
}, {
|
|
53
|
+
value: "#616161",
|
|
54
|
+
label: "Graphite"
|
|
55
|
+
}, {
|
|
56
|
+
value: "#e67c73",
|
|
57
|
+
label: "Flamingo"
|
|
58
|
+
}, {
|
|
59
|
+
value: "#f6bf26",
|
|
60
|
+
label: "Banana"
|
|
61
|
+
}, {
|
|
62
|
+
value: "#33b679",
|
|
63
|
+
label: "Sage"
|
|
64
|
+
}, {
|
|
65
|
+
value: "#4285f4",
|
|
66
|
+
label: "Cobalt"
|
|
67
|
+
}, {
|
|
68
|
+
value: "#9e69af",
|
|
69
|
+
label: "Amethyst"
|
|
70
|
+
}, {
|
|
71
|
+
value: "#a79b8e",
|
|
72
|
+
label: "Birch"
|
|
73
|
+
}];
|
|
74
|
+
const DEFAULT_LABELS = {
|
|
75
|
+
trigger: "Choose color",
|
|
76
|
+
palette: "Colors",
|
|
77
|
+
addCustom: "Add custom color",
|
|
78
|
+
customTitle: "Choose custom color",
|
|
79
|
+
customDescription: "Choose a background color. The text color will be adjusted automatically.",
|
|
80
|
+
preview: "A",
|
|
81
|
+
hex: "Hex",
|
|
82
|
+
eyeDropper: "Pick a color from the screen",
|
|
83
|
+
saturation: "Saturation and brightness",
|
|
84
|
+
hue: "Hue",
|
|
85
|
+
cancel: "Cancel",
|
|
86
|
+
save: "Save"
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { COLOR_PICKER_PRESETS, DEFAULT_LABELS };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** h: 0–360, s: 0–100, v: 0–100 */
|
|
2
|
+
export interface HSV {
|
|
3
|
+
h: number;
|
|
4
|
+
s: number;
|
|
5
|
+
v: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const clamp: (value: number, min?: number, max?: number) => number;
|
|
8
|
+
/** HSV → `hsl(...)` for inline styles. */
|
|
9
|
+
export declare const hsv2css: ({ h, s, v }: HSV) => string;
|
|
10
|
+
/** `#ABC`, `abc`, `#aabbcc` → `#aabbcc`. Invalid input → `null`. */
|
|
11
|
+
export declare const normalizeHex: (input: string) => string | null;
|
|
12
|
+
export declare const hsv2hex: (hsv: HSV) => string;
|
|
13
|
+
export declare const hex2hsv: (hex: string) => HSV | null;
|
|
14
|
+
/** HEX or `rgb()`/`rgba()` → `#rrggbb`. Invalid input → `null`. */
|
|
15
|
+
export declare const toHex: (input: string) => string | null;
|
|
16
|
+
/**
|
|
17
|
+
* HEX → HSV that keeps hue and saturation from `prev` where the color has
|
|
18
|
+
* none: grey has no hue, black has neither. Without this, typing `#000000`
|
|
19
|
+
* would jump the hue slider to 0 (red).
|
|
20
|
+
*/
|
|
21
|
+
export declare const toHsvPreservingHue: (hex: string, prev: HSV) => HSV | null;
|
|
22
|
+
/** Whether light text reads better than dark text on `background` (HEX). */
|
|
23
|
+
export declare const prefersLightText: (background: string) => boolean;
|
|
24
|
+
/** A light color that merges with a light surface and needs an outline. */
|
|
25
|
+
export declare const isLightColor: (hex: string, threshold?: number) => boolean;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
const clamp = (value, min = 0, max = 1) => Math.min(max, Math.max(min, value));
|
|
2
|
+
const round1 = value => Math.round(value * 10) / 10;
|
|
3
|
+
const hsv2rgb = ({
|
|
4
|
+
h,
|
|
5
|
+
s,
|
|
6
|
+
v
|
|
7
|
+
}) => {
|
|
8
|
+
const sat = s / 100;
|
|
9
|
+
const val = v / 100;
|
|
10
|
+
const channel = n => {
|
|
11
|
+
const k = (n + h / 60) % 6;
|
|
12
|
+
return Math.round((val - val * sat * Math.max(0, Math.min(k, 4 - k, 1))) * 255);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
r: channel(5),
|
|
16
|
+
g: channel(3),
|
|
17
|
+
b: channel(1)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
// Not rounded, so repeated conversions do not accumulate errors.
|
|
21
|
+
const rgb2hsv = ({
|
|
22
|
+
r,
|
|
23
|
+
g,
|
|
24
|
+
b
|
|
25
|
+
}) => {
|
|
26
|
+
const rn = r / 255;
|
|
27
|
+
const gn = g / 255;
|
|
28
|
+
const bn = b / 255;
|
|
29
|
+
const max = Math.max(rn, gn, bn);
|
|
30
|
+
const min = Math.min(rn, gn, bn);
|
|
31
|
+
const delta = max - min;
|
|
32
|
+
let h = 0;
|
|
33
|
+
if (delta !== 0) {
|
|
34
|
+
if (max === rn) {
|
|
35
|
+
h = (gn - bn) / delta % 6;
|
|
36
|
+
} else if (max === gn) {
|
|
37
|
+
h = (bn - rn) / delta + 2;
|
|
38
|
+
} else {
|
|
39
|
+
h = (rn - gn) / delta + 4;
|
|
40
|
+
}
|
|
41
|
+
h *= 60;
|
|
42
|
+
if (h < 0) h += 360;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
h,
|
|
46
|
+
s: max === 0 ? 0 : delta / max * 100,
|
|
47
|
+
v: max * 100
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/** HSV → `hsl(...)` for inline styles. */
|
|
51
|
+
const hsv2css = ({
|
|
52
|
+
h,
|
|
53
|
+
s,
|
|
54
|
+
v
|
|
55
|
+
}) => {
|
|
56
|
+
const sat = s / 100;
|
|
57
|
+
const val = v / 100;
|
|
58
|
+
const l = val * (1 - sat / 2);
|
|
59
|
+
const sl = l === 0 || l === 1 ? 0 : (val - l) / Math.min(l, 1 - l);
|
|
60
|
+
return `hsl(${round1(h)}, ${round1(sl * 100)}%, ${round1(l * 100)}%)`;
|
|
61
|
+
};
|
|
62
|
+
const HEX_RE = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
63
|
+
/** `#ABC`, `abc`, `#aabbcc` → `#aabbcc`. Invalid input → `null`. */
|
|
64
|
+
const normalizeHex = input => {
|
|
65
|
+
const match = HEX_RE.exec(input.trim());
|
|
66
|
+
if (!match) return null;
|
|
67
|
+
const digits = match[1].length === 3 ? match[1].replace(/./g, c => c + c) : match[1];
|
|
68
|
+
return `#${digits.toLowerCase()}`;
|
|
69
|
+
};
|
|
70
|
+
const hex2rgb = hex => {
|
|
71
|
+
const normalized = normalizeHex(hex);
|
|
72
|
+
if (!normalized) return null;
|
|
73
|
+
const int = parseInt(normalized.slice(1), 16);
|
|
74
|
+
return {
|
|
75
|
+
r: int >> 16 & 255,
|
|
76
|
+
g: int >> 8 & 255,
|
|
77
|
+
b: int & 255
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const rgb2hex = ({
|
|
81
|
+
r,
|
|
82
|
+
g,
|
|
83
|
+
b
|
|
84
|
+
}) => `#${[r, g, b].map(c => Math.round(clamp(c, 0, 255)).toString(16).padStart(2, "0")).join("")}`;
|
|
85
|
+
const hsv2hex = hsv => rgb2hex(hsv2rgb(hsv));
|
|
86
|
+
const hex2hsv = hex => {
|
|
87
|
+
const rgb = hex2rgb(hex);
|
|
88
|
+
return rgb ? rgb2hsv(rgb) : null;
|
|
89
|
+
};
|
|
90
|
+
const RGB_RE = /^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i;
|
|
91
|
+
/** HEX or `rgb()`/`rgba()` → `#rrggbb`. Invalid input → `null`. */
|
|
92
|
+
const toHex = input => {
|
|
93
|
+
const rgbMatch = RGB_RE.exec(input.trim());
|
|
94
|
+
if (rgbMatch) {
|
|
95
|
+
const [r, g, b] = rgbMatch.slice(1).map(Number);
|
|
96
|
+
return rgb2hex({
|
|
97
|
+
r,
|
|
98
|
+
g,
|
|
99
|
+
b
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return normalizeHex(input);
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* HEX → HSV that keeps hue and saturation from `prev` where the color has
|
|
106
|
+
* none: grey has no hue, black has neither. Without this, typing `#000000`
|
|
107
|
+
* would jump the hue slider to 0 (red).
|
|
108
|
+
*/
|
|
109
|
+
const toHsvPreservingHue = (hex, prev) => {
|
|
110
|
+
const next = hex2hsv(hex);
|
|
111
|
+
if (!next) return null;
|
|
112
|
+
if (next.v === 0) return {
|
|
113
|
+
h: prev.h,
|
|
114
|
+
s: prev.s,
|
|
115
|
+
v: 0
|
|
116
|
+
};
|
|
117
|
+
if (next.s === 0) return {
|
|
118
|
+
h: prev.h,
|
|
119
|
+
s: 0,
|
|
120
|
+
v: next.v
|
|
121
|
+
};
|
|
122
|
+
return next;
|
|
123
|
+
};
|
|
124
|
+
/** WCAG 2.x relative luminance, 0–1. */
|
|
125
|
+
const relativeLuminance = ({
|
|
126
|
+
r,
|
|
127
|
+
g,
|
|
128
|
+
b
|
|
129
|
+
}) => {
|
|
130
|
+
const [lr, lg, lb] = [r, g, b].map(c => {
|
|
131
|
+
const x = c / 255;
|
|
132
|
+
return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
|
|
133
|
+
});
|
|
134
|
+
return 0.2126 * lr + 0.7152 * lg + 0.0722 * lb;
|
|
135
|
+
};
|
|
136
|
+
const WHITE_LUMINANCE = 1;
|
|
137
|
+
const BLACK_LUMINANCE = 0;
|
|
138
|
+
const contrast = (a, b) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
139
|
+
/** Whether light text reads better than dark text on `background` (HEX). */
|
|
140
|
+
const prefersLightText = background => {
|
|
141
|
+
const rgb = hex2rgb(background);
|
|
142
|
+
if (!rgb) return false;
|
|
143
|
+
const luminance = relativeLuminance(rgb);
|
|
144
|
+
return contrast(luminance, WHITE_LUMINANCE) >= contrast(luminance, BLACK_LUMINANCE);
|
|
145
|
+
};
|
|
146
|
+
/** A light color that merges with a light surface and needs an outline. */
|
|
147
|
+
const isLightColor = (hex, threshold = 0.85) => {
|
|
148
|
+
const rgb = hex2rgb(hex);
|
|
149
|
+
return rgb ? relativeLuminance(rgb) >= threshold : false;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export { clamp, hex2hsv, hsv2css, hsv2hex, isLightColor, normalizeHex, prefersLightText, toHex, toHsvPreservingHue };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
const Pipette = _a => {
|
|
5
|
+
var {
|
|
6
|
+
fill = "currentColor",
|
|
7
|
+
width = 24,
|
|
8
|
+
height = 24,
|
|
9
|
+
ref
|
|
10
|
+
} = _a,
|
|
11
|
+
props = __rest(_a, ["fill", "width", "height", "ref"]);
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: width,
|
|
15
|
+
height: height
|
|
16
|
+
}, props, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
fill: "none"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
21
|
+
stroke: fill,
|
|
22
|
+
strokeWidth: "1.8",
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round",
|
|
25
|
+
d: "M14.5 4.5l5 5M17 2.5a2.12 2.12 0 0 1 3 3L17.5 8l1 1-1.5 1.5-5-5L13.5 4l1 1L17 2.5zM12 7l-8 8v4h4l8-8"
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Pipette };
|
package/esm/Icons/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { Help } from "./Help";
|
|
|
14
14
|
export { Info } from "./Info";
|
|
15
15
|
export { Minus } from "./Minus";
|
|
16
16
|
export { More } from "./More";
|
|
17
|
+
export { Pipette } from "./Pipette";
|
|
17
18
|
export { Plus } from "./Plus";
|
|
18
19
|
export { Setting } from "./Setting";
|
|
19
20
|
export { Shield } from "./Shield";
|
package/esm/Icons/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { Help } from './Help.js';
|
|
|
14
14
|
export { Info } from './Info.js';
|
|
15
15
|
export { Minus } from './Minus.js';
|
|
16
16
|
export { More } from './More.js';
|
|
17
|
+
export { Pipette } from './Pipette.js';
|
|
17
18
|
export { Plus } from './Plus.js';
|
|
18
19
|
export { Setting } from './Setting.js';
|
|
19
20
|
export { Shield } from './Shield.js';
|
|
@@ -61,4 +61,14 @@
|
|
|
61
61
|
max-height: calc(100% - var(--space-8));
|
|
62
62
|
max-width: calc(100% - var(--space-8));
|
|
63
63
|
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.modal-wrapper_contained.modal-wrapper_fill {
|
|
67
|
+
border: 0;
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
height: 100%;
|
|
70
|
+
max-height: none;
|
|
71
|
+
max-width: none;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
width: 100%;
|
|
64
74
|
}
|
package/esm/Modal/index.js
CHANGED
|
@@ -22,7 +22,8 @@ const ModalRoot = ({
|
|
|
22
22
|
className,
|
|
23
23
|
onClose,
|
|
24
24
|
title,
|
|
25
|
-
withinParent = false
|
|
25
|
+
withinParent = false,
|
|
26
|
+
fillParent = false
|
|
26
27
|
}) => {
|
|
27
28
|
const [dialog, setDialog] = useState(null);
|
|
28
29
|
const [container, setContainer] = useState(null);
|
|
@@ -100,7 +101,8 @@ const ModalRoot = ({
|
|
|
100
101
|
className: clsx(styles["modal-wrapper"], {
|
|
101
102
|
[styles["modal-wrapper_desktop"]]: isDesktop,
|
|
102
103
|
[styles["modal-wrapper_mobile"]]: !isDesktop,
|
|
103
|
-
[styles["modal-wrapper_contained"]]: isContained
|
|
104
|
+
[styles["modal-wrapper_contained"]]: isContained,
|
|
105
|
+
[styles["modal-wrapper_fill"]]: isContained && fillParent
|
|
104
106
|
}, className),
|
|
105
107
|
ref: setContainer
|
|
106
108
|
}, content))));
|
|
@@ -13,6 +13,12 @@ export type ModalProps = {
|
|
|
13
13
|
* rendered inside another `Modal`.
|
|
14
14
|
*/
|
|
15
15
|
withinParent?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Makes a `withinParent` modal take the whole parent window, with no
|
|
18
|
+
* offset. The parent border and radius form the edges. Has no effect
|
|
19
|
+
* without `withinParent` or a parent modal.
|
|
20
|
+
*/
|
|
21
|
+
fillParent?: boolean;
|
|
16
22
|
};
|
|
17
23
|
export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
24
|
/**
|
package/esm/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export { Chip } from "./Chip";
|
|
|
18
18
|
export type { ChipProps, ChipSize, ChipVariant } from "./Chip/index.props";
|
|
19
19
|
export { CodeField, ONLY_CHARS_PATTERN, ONLY_DIGITS_AND_CHARS_PATTERN, ONLY_DIGITS_PATTERN, } from "./CodeField";
|
|
20
20
|
export type { CodeErrorBehavior, CodeFieldProps, CodeFieldShape, CodeFieldSize, ItemErrorBehavior, } from "./CodeField";
|
|
21
|
+
export { ColorPicker, COLOR_PICKER_PRESETS } from "./ColorPicker";
|
|
22
|
+
export type { ColorPickerLabels, ColorPickerPreset, ColorPickerProps, } from "./ColorPicker";
|
|
21
23
|
export { Counter } from "./Counter";
|
|
22
24
|
export type { CounterProps } from "./Counter/index.props";
|
|
23
25
|
export { Datepicker } from "./Datepicker";
|
package/esm/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export { Card, CardContent, CardInnerContent } from './Card/Card.js';
|
|
|
8
8
|
export { Checkbox } from './Checkbox/index.js';
|
|
9
9
|
export { Chip } from './Chip/index.js';
|
|
10
10
|
export { CodeField, ONLY_CHARS_PATTERN, ONLY_DIGITS_AND_CHARS_PATTERN, ONLY_DIGITS_PATTERN } from './CodeField/CodeField.js';
|
|
11
|
+
export { ColorPicker } from './ColorPicker/ColorPicker.js';
|
|
12
|
+
export { COLOR_PICKER_PRESETS } from './ColorPicker/presets.js';
|
|
11
13
|
export { Counter } from './Counter/index.js';
|
|
12
14
|
export { Datepicker } from './Datepicker/index.js';
|
|
13
15
|
export { DotsLoader } from './DotsLoader/index.js';
|
|
@@ -63,6 +65,7 @@ export { Help } from './Icons/Help.js';
|
|
|
63
65
|
export { Info } from './Icons/Info.js';
|
|
64
66
|
export { Minus } from './Icons/Minus.js';
|
|
65
67
|
export { More } from './Icons/More.js';
|
|
68
|
+
export { Pipette } from './Icons/Pipette.js';
|
|
66
69
|
export { Plus } from './Icons/Plus.js';
|
|
67
70
|
export { Setting } from './Icons/Setting.js';
|
|
68
71
|
export { Shield } from './Icons/Shield.js';
|
package/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export { Chip } from "./Chip";
|
|
|
18
18
|
export type { ChipProps, ChipSize, ChipVariant } from "./Chip/index.props";
|
|
19
19
|
export { CodeField, ONLY_CHARS_PATTERN, ONLY_DIGITS_AND_CHARS_PATTERN, ONLY_DIGITS_PATTERN, } from "./CodeField";
|
|
20
20
|
export type { CodeErrorBehavior, CodeFieldProps, CodeFieldShape, CodeFieldSize, ItemErrorBehavior, } from "./CodeField";
|
|
21
|
+
export { ColorPicker, COLOR_PICKER_PRESETS } from "./ColorPicker";
|
|
22
|
+
export type { ColorPickerLabels, ColorPickerPreset, ColorPickerProps, } from "./ColorPicker";
|
|
21
23
|
export { Counter } from "./Counter";
|
|
22
24
|
export type { CounterProps } from "./Counter/index.props";
|
|
23
25
|
export { Datepicker } from "./Datepicker";
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ require('./Card/index.js');
|
|
|
10
10
|
var index$4 = require('./Checkbox/index.js');
|
|
11
11
|
var index$5 = require('./Chip/index.js');
|
|
12
12
|
require('./CodeField/index.js');
|
|
13
|
+
require('./ColorPicker/index.js');
|
|
13
14
|
var index$6 = require('./Counter/index.js');
|
|
14
15
|
var index$7 = require('./Datepicker/index.js');
|
|
15
16
|
var index$8 = require('./DotsLoader/index.js');
|
|
@@ -52,6 +53,7 @@ require('./Icons/index.js');
|
|
|
52
53
|
var ArrowNext = require('./Icons/ArrowNext.js');
|
|
53
54
|
var Autocomplete = require('./Autocomplete/Autocomplete.js');
|
|
54
55
|
var breakpoints = require('./Theme/breakpoints.js');
|
|
56
|
+
var presets = require('./ColorPicker/presets.js');
|
|
55
57
|
var Calendar = require('./Calendar/Calendar.js');
|
|
56
58
|
var Card = require('./Card/Card.js');
|
|
57
59
|
var Cart = require('./Icons/Cart.js');
|
|
@@ -59,6 +61,7 @@ var Check = require('./Icons/Check.js');
|
|
|
59
61
|
var Chevron = require('./Icons/Chevron.js');
|
|
60
62
|
var Close = require('./Icons/Close.js');
|
|
61
63
|
var CodeField = require('./CodeField/CodeField.js');
|
|
64
|
+
var ColorPicker = require('./ColorPicker/ColorPicker.js');
|
|
62
65
|
var Copy = require('./Icons/Copy.js');
|
|
63
66
|
var Cross = require('./Icons/Cross.js');
|
|
64
67
|
var CrossFill = require('./Icons/CrossFill.js');
|
|
@@ -80,6 +83,7 @@ var index$k = require('./Modal/components/Title/index.js');
|
|
|
80
83
|
var More = require('./Icons/More.js');
|
|
81
84
|
var NumberInput = require('./NumberInput/NumberInput.js');
|
|
82
85
|
var Pagination = require('./Pagination/Pagination.js');
|
|
86
|
+
var Pipette = require('./Icons/Pipette.js');
|
|
83
87
|
var Plus = require('./Icons/Plus.js');
|
|
84
88
|
var Progress = require('./Progress/Progress.js');
|
|
85
89
|
var Rating = require('./Rating/Rating.js');
|
|
@@ -132,6 +136,7 @@ exports.ArrowNext = ArrowNext.ArrowNext;
|
|
|
132
136
|
exports.Autocomplete = Autocomplete.Autocomplete;
|
|
133
137
|
exports.BREAKPOINTS = breakpoints.BREAKPOINTS;
|
|
134
138
|
exports.media = breakpoints.media;
|
|
139
|
+
exports.COLOR_PICKER_PRESETS = presets.COLOR_PICKER_PRESETS;
|
|
135
140
|
exports.Calendar = Calendar.Calendar;
|
|
136
141
|
exports.Card = Card.Card;
|
|
137
142
|
exports.CardContent = Card.CardContent;
|
|
@@ -144,6 +149,7 @@ exports.CodeField = CodeField.CodeField;
|
|
|
144
149
|
exports.ONLY_CHARS_PATTERN = CodeField.ONLY_CHARS_PATTERN;
|
|
145
150
|
exports.ONLY_DIGITS_AND_CHARS_PATTERN = CodeField.ONLY_DIGITS_AND_CHARS_PATTERN;
|
|
146
151
|
exports.ONLY_DIGITS_PATTERN = CodeField.ONLY_DIGITS_PATTERN;
|
|
152
|
+
exports.ColorPicker = ColorPicker.ColorPicker;
|
|
147
153
|
exports.Copy = Copy.Copy;
|
|
148
154
|
exports.Cross = Cross.Cross;
|
|
149
155
|
exports.CrossFill = CrossFill.CrossFill;
|
|
@@ -170,6 +176,7 @@ exports.ModalTitle = index$k.Title;
|
|
|
170
176
|
exports.More = More.More;
|
|
171
177
|
exports.NumberInput = NumberInput.NumberInput;
|
|
172
178
|
exports.Pagination = Pagination.Pagination;
|
|
179
|
+
exports.Pipette = Pipette.Pipette;
|
|
173
180
|
exports.Plus = Plus.Plus;
|
|
174
181
|
exports.Progress = Progress.Progress;
|
|
175
182
|
exports.Rating = Rating.Rating;
|