krl-alfred 2.23.26 → 2.24.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/dist/components/ColorCard/ColorCard.d.ts +4 -0
- package/dist/components/ColorCard/ColorCard.js +69 -0
- package/dist/components/ColorCard/ColorCard.styled.d.ts +21 -0
- package/dist/components/ColorCard/ColorCard.styled.js +21 -0
- package/dist/components/ColorCard/ColorCard.test.d.ts +1 -0
- package/dist/components/ColorCard/ColorCard.test.js +257 -0
- package/dist/components/ColorCard/ColorPicker.d.ts +7 -0
- package/dist/components/ColorCard/ColorPicker.js +75 -0
- package/dist/components/ColorCard/index.d.ts +1 -0
- package/dist/components/ColorCard/index.js +8 -0
- package/dist/components/ColorCard/props.d.ts +18 -0
- package/dist/components/ColorCard/props.js +15 -0
- package/dist/components/ColorCard/stories/ColorCard.stories.d.ts +106 -0
- package/dist/components/ColorCard/stories/ColorCard.stories.js +73 -0
- package/dist/components/ColorCard/utils/color.d.ts +17 -0
- package/dist/components/ColorCard/utils/color.js +125 -0
- package/dist/components/ColorCard/utils/color.test.d.ts +1 -0
- package/dist/components/ColorCard/utils/color.test.js +57 -0
- package/dist/components/ColorPalette/ColorPalette.js +1 -1
- package/dist/components/ColorPalette/ColorPalette.styled.d.ts +7 -1
- package/dist/components/ColorPalette/ColorPalette.styled.js +5 -5
- package/dist/components/ColorPalette/ColorPalette.test.d.ts +1 -0
- package/dist/components/ColorPalette/ColorPalette.test.js +31 -0
- package/dist/components/DescriptionCard/DescriptionCard.d.ts +1 -1
- package/dist/components/DescriptionCard/DescriptionCard.js +9 -6
- package/dist/components/DescriptionCard/DescriptionCard.styled.d.ts +1 -1
- package/dist/components/DescriptionCard/DescriptionCard.styled.js +4 -4
- package/dist/components/DescriptionCard/DescriptionCard.test.js +36 -4
- package/dist/components/DescriptionCard/SortableDescriptionCard.js +1 -1
- package/dist/components/DescriptionCard/props.d.ts +3 -0
- package/dist/components/DescriptionCard/props.js +1 -0
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.d.ts +33 -1
- package/dist/components/DescriptionCard/stories/DescriptionCard.stories.js +6 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +57 -15
- package/dist/components/Input/Input.test.js +69 -11
- package/dist/components/Input/props.d.ts +3 -0
- package/dist/components/Input/props.js +2 -0
- package/dist/components/Input/stories/Input.stories.d.ts +17 -0
- package/dist/components/Input/stories/Input.stories.js +20 -1
- package/dist/i18n/locales/english.json +4 -1
- package/dist/i18n/locales/turkish.json +4 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +7 -7
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var react_i18next_1 = require("react-i18next");
|
|
20
|
+
var props_1 = require("./props");
|
|
21
|
+
var ColorCard_styled_1 = require("./ColorCard.styled");
|
|
22
|
+
var Input_1 = __importDefault(require("../Input"));
|
|
23
|
+
var ColorPicker_1 = __importDefault(require("./ColorPicker"));
|
|
24
|
+
var useOnClickOutside_1 = __importDefault(require("../../hooks/useOnClickOutside"));
|
|
25
|
+
var color_1 = require("./utils/color");
|
|
26
|
+
var ColorCard = function (_a) {
|
|
27
|
+
var _b = _a.title, title = _b === void 0 ? props_1.ColorCardDefault.title : _b, _c = _a.hint, hint = _c === void 0 ? props_1.ColorCardDefault.hint : _c, _d = _a.value, value = _d === void 0 ? props_1.ColorCardDefault.value : _d, _e = _a.placeholder, placeholder = _e === void 0 ? props_1.ColorCardDefault.placeholder : _e, _f = _a.hasError, hasError = _f === void 0 ? props_1.ColorCardDefault.hasError : _f, _g = _a.errorMessage, errorMessage = _g === void 0 ? props_1.ColorCardDefault.errorMessage : _g, _h = _a.disabled, disabled = _h === void 0 ? props_1.ColorCardDefault.disabled : _h, _j = _a.name, name = _j === void 0 ? props_1.ColorCardDefault.name : _j, _k = _a.id, id = _k === void 0 ? props_1.ColorCardDefault.id : _k, _l = _a.onChange, onChange = _l === void 0 ? props_1.ColorCardDefault.onChange : _l;
|
|
28
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
29
|
+
var pickerRef = (0, react_1.useRef)(null);
|
|
30
|
+
var _m = (0, react_1.useState)(false), isOpen = _m[0], setIsOpen = _m[1];
|
|
31
|
+
var _o = (0, react_1.useState)(function () { return (0, color_1.formatHexInput)(value); }), hex = _o[0], setHex = _o[1];
|
|
32
|
+
var swatchColor = (0, color_1.toSwatchColor)(hex);
|
|
33
|
+
var pickerValue = (0, color_1.normalizeHex)(hex) || '#000000';
|
|
34
|
+
(0, useOnClickOutside_1.default)(pickerRef, function () { return setIsOpen(false); }, true);
|
|
35
|
+
(0, react_1.useEffect)(function () {
|
|
36
|
+
setHex((0, color_1.formatHexInput)(value));
|
|
37
|
+
}, [value]);
|
|
38
|
+
(0, react_1.useEffect)(function () {
|
|
39
|
+
if (!isOpen)
|
|
40
|
+
return undefined;
|
|
41
|
+
var handleKeyDown = function (event) {
|
|
42
|
+
if (event.key === 'Escape')
|
|
43
|
+
setIsOpen(false);
|
|
44
|
+
};
|
|
45
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
46
|
+
return function () { return document.removeEventListener('keydown', handleKeyDown); };
|
|
47
|
+
}, [isOpen]);
|
|
48
|
+
var emitHex = function (next) {
|
|
49
|
+
var formatted = (0, color_1.nextHexInput)(hex, next);
|
|
50
|
+
setHex(formatted);
|
|
51
|
+
if (formatted === hex)
|
|
52
|
+
return;
|
|
53
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
54
|
+
target: { value: formatted, name: name, id: id },
|
|
55
|
+
currentTarget: { value: formatted, name: name, id: id },
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var handleHexBlur = function (event) {
|
|
59
|
+
var _a;
|
|
60
|
+
var raw = (_a = event.target.value) !== null && _a !== void 0 ? _a : hex;
|
|
61
|
+
emitHex((0, color_1.formatHexInput)(raw).toUpperCase());
|
|
62
|
+
};
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)(ColorCard_styled_1.ColorCardStyled, { children: [(0, jsx_runtime_1.jsxs)(ColorCard_styled_1.SwatchWrap, __assign({ ref: pickerRef }, { children: [(0, jsx_runtime_1.jsx)(ColorCard_styled_1.ColorSwatch, { type: "button", "$color": swatchColor, "$disabled": disabled, disabled: disabled, "aria-label": title || t('pickColor'), "aria-expanded": isOpen, "aria-haspopup": "dialog", onClick: function () {
|
|
64
|
+
if (disabled)
|
|
65
|
+
return;
|
|
66
|
+
setIsOpen(function (open) { return !open; });
|
|
67
|
+
} }), isOpen && !disabled && ((0, jsx_runtime_1.jsx)(ColorCard_styled_1.ColorPickerPopover, __assign({ role: "dialog", "aria-label": t('pickColor') }, { children: (0, jsx_runtime_1.jsx)(ColorPicker_1.default, { value: pickerValue, onChange: emitHex }) })))] })), (0, jsx_runtime_1.jsx)(ColorCard_styled_1.ColorCardField, __assign({ onBlur: handleHexBlur }, { children: (0, jsx_runtime_1.jsx)(Input_1.default, { label: title, description: hint, value: hex, placeholder: placeholder, hasError: hasError, errorMessage: errorMessage, disabled: disabled, name: name, id: id, mask: null, format: null, maxLength: 7, onChange: function (event) { var _a; return emitHex((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value); }, width: "100%" }) }))] }));
|
|
68
|
+
};
|
|
69
|
+
exports.default = ColorCard;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorCardStyledProps } from './props';
|
|
3
|
+
export declare const ColorCardStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
4
|
+
export declare const SwatchWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
5
|
+
export declare const ColorSwatch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof ColorCardStyledProps> & ColorCardStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof ColorCardStyledProps> & ColorCardStyledProps, never>>> & string;
|
|
6
|
+
export declare const ColorCardField: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
7
|
+
export declare const ColorPickerPopover: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
8
|
+
export declare const PickerBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
9
|
+
export declare const Saturation: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hue"> & {
|
|
10
|
+
$hue: number;
|
|
11
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hue"> & {
|
|
12
|
+
$hue: number;
|
|
13
|
+
}, never>>> & string;
|
|
14
|
+
export declare const HueSlider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
15
|
+
export declare const Thumb: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$x" | "$y"> & {
|
|
16
|
+
$x: number;
|
|
17
|
+
$y: number;
|
|
18
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$x" | "$y"> & {
|
|
19
|
+
$x: number;
|
|
20
|
+
$y: number;
|
|
21
|
+
}, never>>> & string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Thumb = exports.HueSlider = exports.Saturation = exports.PickerBody = exports.ColorPickerPopover = exports.ColorCardField = exports.ColorSwatch = exports.SwatchWrap = exports.ColorCardStyled = void 0;
|
|
11
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
exports.ColorCardStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 1.5rem;\n padding: 1.5rem;\n border-radius: 0.5rem;\n border: 1px solid var(--dark-opacity-10);\n background: white;\n box-sizing: border-box;\n background: var(--dark-opacity-3);\n"], ["\n display: flex;\n align-items: center;\n gap: 1.5rem;\n padding: 1.5rem;\n border-radius: 0.5rem;\n border: 1px solid var(--dark-opacity-10);\n background: white;\n box-sizing: border-box;\n background: var(--dark-opacity-3);\n"])));
|
|
13
|
+
exports.SwatchWrap = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n width: 56px;\n height: 56px;\n border: 1px solid var(--dark-opacity-10);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 0.5rem;\n"], ["\n position: relative;\n flex-shrink: 0;\n width: 56px;\n height: 56px;\n border: 1px solid var(--dark-opacity-10);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 0.5rem;\n"])));
|
|
14
|
+
exports.ColorSwatch = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 40px;\n height: 40px;\n padding: 0;\n flex-shrink: 0;\n box-sizing: border-box;\n border-radius: 0.25rem;\n border: none;\n background-color: ", ";\n opacity: ", ";\n cursor: ", ";\n appearance: none;\n\n &:focus-visible {\n outline: 2px solid var(--primary);\n outline-offset: 2px;\n }\n"], ["\n width: 40px;\n height: 40px;\n padding: 0;\n flex-shrink: 0;\n box-sizing: border-box;\n border-radius: 0.25rem;\n border: none;\n background-color: ", ";\n opacity: ", ";\n cursor: ", ";\n appearance: none;\n\n &:focus-visible {\n outline: 2px solid var(--primary);\n outline-offset: 2px;\n }\n"])), function (props) { return props.$color || 'transparent'; }, function (props) { return props.$disabled ? 0.4 : 1; }, function (props) { return props.$disabled ? 'not-allowed' : 'pointer'; });
|
|
15
|
+
exports.ColorCardField = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n min-width: 0;\n"], ["\n flex: 1;\n min-width: 0;\n"])));
|
|
16
|
+
exports.ColorPickerPopover = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: calc(100% + 8px);\n left: 0;\n z-index: 9;\n padding: 1rem;\n border-radius: 0.5rem;\n border: 1px solid var(--dark-opacity-10);\n background: white;\n box-shadow: 0 6px 30px 0 var(--box-shadow-color);\n box-sizing: border-box;\n user-select: none;\n"], ["\n position: absolute;\n top: calc(100% + 8px);\n left: 0;\n z-index: 9;\n padding: 1rem;\n border-radius: 0.5rem;\n border: 1px solid var(--dark-opacity-10);\n background: white;\n box-shadow: 0 6px 30px 0 var(--box-shadow-color);\n box-sizing: border-box;\n user-select: none;\n"])));
|
|
17
|
+
exports.PickerBody = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])));
|
|
18
|
+
exports.Saturation = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n width: 192px;\n height: 140px;\n border-radius: 0.5rem;\n cursor: crosshair;\n touch-action: none;\n background:\n linear-gradient(to top, #000, transparent),\n linear-gradient(to right, #fff, hsl(", ", 100%, 50%));\n"], ["\n position: relative;\n width: 192px;\n height: 140px;\n border-radius: 0.5rem;\n cursor: crosshair;\n touch-action: none;\n background:\n linear-gradient(to top, #000, transparent),\n linear-gradient(to right, #fff, hsl(", ", 100%, 50%));\n"])), function (props) { return props.$hue; });
|
|
19
|
+
exports.HueSlider = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: relative;\n width: 192px;\n height: 12px;\n border-radius: 0.5rem;\n cursor: pointer;\n touch-action: none;\n background: linear-gradient(to right, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00);\n"], ["\n position: relative;\n width: 192px;\n height: 12px;\n border-radius: 0.5rem;\n cursor: pointer;\n touch-action: none;\n background: linear-gradient(to right, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00);\n"])));
|
|
20
|
+
exports.Thumb = styled_components_1.default.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n left: ", "%;\n top: ", "%;\n width: 16px;\n height: 16px;\n border: 2px solid white;\n border-radius: 50%;\n box-shadow: 0 0 0 1px var(--dark-opacity-25);\n transform: translate(-50%, -50%);\n pointer-events: none;\n box-sizing: border-box;\n"], ["\n position: absolute;\n left: ", "%;\n top: ", "%;\n width: 16px;\n height: 16px;\n border: 2px solid white;\n border-radius: 50%;\n box-shadow: 0 0 0 1px var(--dark-opacity-25);\n transform: translate(-50%, -50%);\n pointer-events: none;\n box-sizing: border-box;\n"])), function (props) { return props.$x * 100; }, function (props) { return props.$y * 100; });
|
|
21
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
+
var react_1 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
56
|
+
var ColorCard_1 = __importDefault(require("./ColorCard"));
|
|
57
|
+
var props_1 = require("./props");
|
|
58
|
+
jest.mock('react-i18next', function () { return ({
|
|
59
|
+
useTranslation: function () { return ({
|
|
60
|
+
t: function (key) { return key; },
|
|
61
|
+
}); },
|
|
62
|
+
}); });
|
|
63
|
+
var mockRect = function (element, width, height) {
|
|
64
|
+
jest.spyOn(element, 'getBoundingClientRect').mockReturnValue({
|
|
65
|
+
width: width,
|
|
66
|
+
height: height,
|
|
67
|
+
left: 0,
|
|
68
|
+
top: 0,
|
|
69
|
+
right: width,
|
|
70
|
+
bottom: height,
|
|
71
|
+
x: 0,
|
|
72
|
+
y: 0,
|
|
73
|
+
toJSON: function () { },
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
var renderColorCard = function (props) {
|
|
77
|
+
if (props === void 0) { props = {}; }
|
|
78
|
+
return (0, react_1.render)((0, jsx_runtime_1.jsx)(ColorCard_1.default, __assign({}, props_1.ColorCardDefault, { title: "Birincil renk", hint: "Ana buton ve vurgular", value: "#9763F6", id: "color-card-test", onChange: jest.fn() }, props)));
|
|
79
|
+
};
|
|
80
|
+
var hexField = function () { return react_1.screen.getByRole('textbox'); };
|
|
81
|
+
describe('ColorCard', function () {
|
|
82
|
+
it('renders title, hex value and hint through Input', function () {
|
|
83
|
+
renderColorCard();
|
|
84
|
+
expect(react_1.screen.getByText('Birincil renk')).toBeInTheDocument();
|
|
85
|
+
expect(hexField()).toHaveDisplayValue('#9763F6');
|
|
86
|
+
expect(react_1.screen.getByText('Ana buton ve vurgular')).toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
it('keeps the hex field editable', function () {
|
|
89
|
+
renderColorCard();
|
|
90
|
+
expect(hexField()).toBeEnabled();
|
|
91
|
+
expect(hexField()).toHaveProperty('readOnly', false);
|
|
92
|
+
});
|
|
93
|
+
it('paints the swatch from a valid hex value', function () {
|
|
94
|
+
renderColorCard({ value: '#0A103D' });
|
|
95
|
+
expect(react_1.screen.getByRole('button', { name: 'Birincil renk' })).toHaveStyle({
|
|
96
|
+
width: '40px',
|
|
97
|
+
height: '40px',
|
|
98
|
+
backgroundColor: 'rgb(10, 16, 61)',
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
it('keeps a hash prefix and at most 6 hex digits', function () {
|
|
102
|
+
renderColorCard();
|
|
103
|
+
react_1.fireEvent.change(hexField(), { target: { value: '##zz0a103dzzzz' } });
|
|
104
|
+
expect(hexField()).toHaveDisplayValue('#0a103d');
|
|
105
|
+
expect(hexField()).toHaveAttribute('maxLength', '7');
|
|
106
|
+
});
|
|
107
|
+
it('keeps a full 6-digit hex after blur', function () {
|
|
108
|
+
renderColorCard({ value: '#' });
|
|
109
|
+
react_1.fireEvent.change(hexField(), { target: { value: '#abcdef' } });
|
|
110
|
+
react_1.fireEvent.focusOut(hexField());
|
|
111
|
+
expect(hexField()).toHaveDisplayValue('#ABCDEF');
|
|
112
|
+
});
|
|
113
|
+
it('uppercases the hex field on blur', function () {
|
|
114
|
+
renderColorCard();
|
|
115
|
+
react_1.fireEvent.change(hexField(), { target: { value: '#aa11bb' } });
|
|
116
|
+
react_1.fireEvent.focusOut(hexField());
|
|
117
|
+
expect(hexField()).toHaveDisplayValue('#AA11BB');
|
|
118
|
+
});
|
|
119
|
+
it('ignores invalid letters while typing instead of deleting them on the next key', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var user;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
user = user_event_1.default.setup();
|
|
125
|
+
renderColorCard({ value: '#' });
|
|
126
|
+
return [4 /*yield*/, user.type(hexField(), 'asd', { initialSelectionStart: 1, initialSelectionEnd: 1 })];
|
|
127
|
+
case 1:
|
|
128
|
+
_a.sent();
|
|
129
|
+
expect(hexField()).toHaveDisplayValue('#ad');
|
|
130
|
+
return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); });
|
|
134
|
+
it('keeps existing hex digits when an invalid letter is typed in the middle', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
+
var user, field;
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
switch (_a.label) {
|
|
138
|
+
case 0:
|
|
139
|
+
user = user_event_1.default.setup();
|
|
140
|
+
renderColorCard({ value: '#ACE' });
|
|
141
|
+
field = hexField();
|
|
142
|
+
field.focus();
|
|
143
|
+
field.setSelectionRange(2, 2);
|
|
144
|
+
return [4 /*yield*/, user.keyboard('sb')];
|
|
145
|
+
case 1:
|
|
146
|
+
_a.sent();
|
|
147
|
+
expect(field).toHaveDisplayValue('#AbCE');
|
|
148
|
+
return [2 /*return*/];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}); });
|
|
152
|
+
it('inserts a hex digit in the middle without shifting the rest', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
153
|
+
var user, field;
|
|
154
|
+
return __generator(this, function (_a) {
|
|
155
|
+
switch (_a.label) {
|
|
156
|
+
case 0:
|
|
157
|
+
user = user_event_1.default.setup();
|
|
158
|
+
renderColorCard({ value: '#ACE' });
|
|
159
|
+
field = hexField();
|
|
160
|
+
field.focus();
|
|
161
|
+
field.setSelectionRange(2, 2);
|
|
162
|
+
return [4 /*yield*/, user.keyboard('b')];
|
|
163
|
+
case 1:
|
|
164
|
+
_a.sent();
|
|
165
|
+
expect(field).toHaveDisplayValue('#AbCE');
|
|
166
|
+
return [2 /*return*/];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}); });
|
|
170
|
+
it('restores the hash and keeps digits when the hash is deleted', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
+
var user, field;
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
switch (_a.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
user = user_event_1.default.setup();
|
|
176
|
+
renderColorCard({ value: '#ab' });
|
|
177
|
+
field = hexField();
|
|
178
|
+
field.focus();
|
|
179
|
+
field.setSelectionRange(0, 1);
|
|
180
|
+
return [4 /*yield*/, user.keyboard('{Backspace}')];
|
|
181
|
+
case 1:
|
|
182
|
+
_a.sent();
|
|
183
|
+
expect(field).toHaveDisplayValue('#ab');
|
|
184
|
+
return [2 /*return*/];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}); });
|
|
188
|
+
it('does not accept more than 6 hex digits', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
189
|
+
var user;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
user = user_event_1.default.setup();
|
|
194
|
+
renderColorCard({ value: '#ABCDEF' });
|
|
195
|
+
return [4 /*yield*/, user.type(hexField(), '1', { initialSelectionStart: 7, initialSelectionEnd: 7 })];
|
|
196
|
+
case 1:
|
|
197
|
+
_a.sent();
|
|
198
|
+
expect(hexField()).toHaveDisplayValue('#ABCDEF');
|
|
199
|
+
return [2 /*return*/];
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}); });
|
|
203
|
+
it('replaces a fully selected value key by key without stripping later letters', function () {
|
|
204
|
+
renderColorCard({ value: '#9763F6' });
|
|
205
|
+
var field = hexField();
|
|
206
|
+
field.setSelectionRange(0, field.value.length);
|
|
207
|
+
react_1.fireEvent.select(field);
|
|
208
|
+
react_1.fireEvent.change(field, { target: { value: 'a' } });
|
|
209
|
+
expect(field).toHaveDisplayValue('#a');
|
|
210
|
+
react_1.fireEvent.change(field, { target: { value: '#as' } });
|
|
211
|
+
expect(field).toHaveDisplayValue('#a');
|
|
212
|
+
react_1.fireEvent.change(field, { target: { value: '#ad' } });
|
|
213
|
+
expect(field).toHaveDisplayValue('#ad');
|
|
214
|
+
});
|
|
215
|
+
it('updates the swatch when a valid hex is typed', function () {
|
|
216
|
+
renderColorCard();
|
|
217
|
+
react_1.fireEvent.change(hexField(), { target: { value: '#0A103D' } });
|
|
218
|
+
expect(react_1.screen.getByRole('button', { name: 'Birincil renk' })).toHaveStyle({
|
|
219
|
+
backgroundColor: 'rgb(10, 16, 61)',
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
it('updates the hex field when the picker changes', function () {
|
|
223
|
+
renderColorCard();
|
|
224
|
+
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'Birincil renk' }));
|
|
225
|
+
var hue = react_1.screen.getByRole('slider', { name: 'colorHue' });
|
|
226
|
+
mockRect(hue, 360, 12);
|
|
227
|
+
react_1.fireEvent.pointerDown(hue, { clientX: 0, clientY: 6, buttons: 1, pointerId: 1 });
|
|
228
|
+
expect(hexField()).toHaveDisplayValue(/^#[0-9A-F]{6}$/);
|
|
229
|
+
expect(hexField()).not.toHaveDisplayValue('#9763F6');
|
|
230
|
+
});
|
|
231
|
+
it('opens the color picker from the swatch', function () {
|
|
232
|
+
renderColorCard();
|
|
233
|
+
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'Birincil renk' }));
|
|
234
|
+
expect(react_1.screen.getByRole('dialog', { name: 'pickColor' })).toBeInTheDocument();
|
|
235
|
+
});
|
|
236
|
+
it('does not open the picker when disabled', function () {
|
|
237
|
+
renderColorCard({ disabled: true });
|
|
238
|
+
react_1.fireEvent.click(react_1.screen.getByRole('button', { name: 'Birincil renk' }));
|
|
239
|
+
expect(react_1.screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
240
|
+
});
|
|
241
|
+
it('renders error message when hasError is true', function () {
|
|
242
|
+
renderColorCard({ hasError: true, errorMessage: 'Geçersiz renk' });
|
|
243
|
+
expect(react_1.screen.getByText('Geçersiz renk')).toBeInTheDocument();
|
|
244
|
+
});
|
|
245
|
+
it('renders title, hint and value as text, not HTML', function () {
|
|
246
|
+
renderColorCard({
|
|
247
|
+
title: '<script>alert(1)</script>',
|
|
248
|
+
hint: '<img src=x onerror=alert(1)>',
|
|
249
|
+
value: '<script>alert(1)</script>',
|
|
250
|
+
});
|
|
251
|
+
expect(react_1.screen.getByText('<script>alert(1)</script>')).toBeInTheDocument();
|
|
252
|
+
expect(react_1.screen.getByText('<img src=x onerror=alert(1)>')).toBeInTheDocument();
|
|
253
|
+
expect(react_1.screen.getByDisplayValue(/^#[0-9A-Fa-f]{0,6}$/)).toBeInTheDocument();
|
|
254
|
+
expect(document.querySelector('script')).not.toBeInTheDocument();
|
|
255
|
+
expect(document.querySelector('img')).not.toBeInTheDocument();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
var react_1 = require("react");
|
|
16
|
+
var react_i18next_1 = require("react-i18next");
|
|
17
|
+
var ColorCard_styled_1 = require("./ColorCard.styled");
|
|
18
|
+
var color_1 = require("./utils/color");
|
|
19
|
+
var FALLBACK_HSV = { h: 0, s: 0, v: 0 };
|
|
20
|
+
var toHsv = function (value, fallback) {
|
|
21
|
+
if (fallback === void 0) { fallback = FALLBACK_HSV; }
|
|
22
|
+
var next = (0, color_1.hexToHsv)(value);
|
|
23
|
+
if (!next)
|
|
24
|
+
return fallback;
|
|
25
|
+
if (next.s === 0)
|
|
26
|
+
return __assign(__assign({}, next), { h: fallback.h });
|
|
27
|
+
return next;
|
|
28
|
+
};
|
|
29
|
+
var ColorPicker = function (_a) {
|
|
30
|
+
var value = _a.value, onChange = _a.onChange;
|
|
31
|
+
var t = (0, react_i18next_1.useTranslation)().t;
|
|
32
|
+
var _b = (0, react_1.useState)(function () { return toHsv(value); }), hsv = _b[0], setHsv = _b[1];
|
|
33
|
+
(0, react_1.useEffect)(function () {
|
|
34
|
+
setHsv(function (current) {
|
|
35
|
+
var next = toHsv(value, current);
|
|
36
|
+
if (next.h === current.h && next.s === current.s && next.v === current.v)
|
|
37
|
+
return current;
|
|
38
|
+
return next;
|
|
39
|
+
});
|
|
40
|
+
}, [value]);
|
|
41
|
+
var commit = function (next) {
|
|
42
|
+
setHsv(next);
|
|
43
|
+
onChange((0, color_1.hsvToHex)(next.h, next.s, next.v));
|
|
44
|
+
};
|
|
45
|
+
var pointFromEvent = function (event) {
|
|
46
|
+
var rect = event.currentTarget.getBoundingClientRect();
|
|
47
|
+
var clientX = Number.isFinite(event.clientX) ? event.clientX : 0;
|
|
48
|
+
var clientY = Number.isFinite(event.clientY) ? event.clientY : 0;
|
|
49
|
+
return {
|
|
50
|
+
x: (0, color_1.clamp)((clientX - rect.left) / (rect.width || 1), 0, 1),
|
|
51
|
+
y: (0, color_1.clamp)((clientY - rect.top) / (rect.height || 1), 0, 1),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
var handleSaturation = function (event) {
|
|
55
|
+
if (event.buttons !== 1 && event.type !== 'pointerdown')
|
|
56
|
+
return;
|
|
57
|
+
var _a = pointFromEvent(event), x = _a.x, y = _a.y;
|
|
58
|
+
commit(__assign(__assign({}, hsv), { s: x, v: 1 - y }));
|
|
59
|
+
};
|
|
60
|
+
var handleHue = function (event) {
|
|
61
|
+
if (event.buttons !== 1 && event.type !== 'pointerdown')
|
|
62
|
+
return;
|
|
63
|
+
commit(__assign(__assign({}, hsv), { h: pointFromEvent(event).x * 360 }));
|
|
64
|
+
};
|
|
65
|
+
var bindDrag = function (handler) { return ({
|
|
66
|
+
onPointerDown: function (event) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
(_b = (_a = event.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
|
|
69
|
+
handler(event);
|
|
70
|
+
},
|
|
71
|
+
onPointerMove: handler,
|
|
72
|
+
}); };
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)(ColorCard_styled_1.PickerBody, { children: [(0, jsx_runtime_1.jsx)(ColorCard_styled_1.Saturation, __assign({ "$hue": hsv.h, role: "slider", "aria-label": t('colorSaturation'), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(hsv.s * 100) }, bindDrag(handleSaturation), { children: (0, jsx_runtime_1.jsx)(ColorCard_styled_1.Thumb, { "$x": hsv.s, "$y": 1 - hsv.v }) })), (0, jsx_runtime_1.jsx)(ColorCard_styled_1.HueSlider, __assign({ role: "slider", "aria-label": t('colorHue'), "aria-valuemin": 0, "aria-valuemax": 360, "aria-valuenow": Math.round(hsv.h) }, bindDrag(handleHue), { children: (0, jsx_runtime_1.jsx)(ColorCard_styled_1.Thumb, { "$x": hsv.h / 360, "$y": 0.5 }) }))] }));
|
|
74
|
+
};
|
|
75
|
+
exports.default = ColorPicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ColorCard';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var ColorCard_1 = require("./ColorCard");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ColorCard_1).default; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ColorCard {
|
|
2
|
+
title?: string;
|
|
3
|
+
hint?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
hasError?: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
onChange?(e: any): void;
|
|
12
|
+
}
|
|
13
|
+
export interface ColorCardStyledProps {
|
|
14
|
+
$color?: string;
|
|
15
|
+
$disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const ColorCardDefault: ColorCard;
|
|
18
|
+
export type ColorCardProps = typeof ColorCardDefault;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorCardDefault = void 0;
|
|
4
|
+
exports.ColorCardDefault = {
|
|
5
|
+
title: '',
|
|
6
|
+
hint: '',
|
|
7
|
+
value: '',
|
|
8
|
+
placeholder: '#000000',
|
|
9
|
+
hasError: false,
|
|
10
|
+
errorMessage: '',
|
|
11
|
+
disabled: false,
|
|
12
|
+
name: null,
|
|
13
|
+
id: null,
|
|
14
|
+
onChange: null,
|
|
15
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: any) => React.JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {
|
|
7
|
+
title: {
|
|
8
|
+
control: string;
|
|
9
|
+
};
|
|
10
|
+
hint: {
|
|
11
|
+
control: string;
|
|
12
|
+
};
|
|
13
|
+
value: {
|
|
14
|
+
control: string;
|
|
15
|
+
};
|
|
16
|
+
placeholder: {
|
|
17
|
+
control: string;
|
|
18
|
+
};
|
|
19
|
+
hasError: {
|
|
20
|
+
control: string;
|
|
21
|
+
};
|
|
22
|
+
errorMessage: {
|
|
23
|
+
control: string;
|
|
24
|
+
};
|
|
25
|
+
disabled: {
|
|
26
|
+
control: string;
|
|
27
|
+
};
|
|
28
|
+
onChange: {
|
|
29
|
+
action: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
34
|
+
export declare const Default: {
|
|
35
|
+
args: {
|
|
36
|
+
title: string;
|
|
37
|
+
hint: string;
|
|
38
|
+
value: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
hasError: boolean;
|
|
41
|
+
errorMessage: string;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
onChange: (e: any) => void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const TextColor: {
|
|
49
|
+
args: {
|
|
50
|
+
title: string;
|
|
51
|
+
hint: string;
|
|
52
|
+
value: string;
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
placeholder: string;
|
|
56
|
+
hasError: boolean;
|
|
57
|
+
errorMessage: string;
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
onChange: (e: any) => void;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const Empty: {
|
|
63
|
+
args: {
|
|
64
|
+
title: string;
|
|
65
|
+
hint: string;
|
|
66
|
+
value: string;
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
placeholder: string;
|
|
70
|
+
hasError: boolean;
|
|
71
|
+
errorMessage: string;
|
|
72
|
+
disabled: boolean;
|
|
73
|
+
onChange: (e: any) => void;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const WithError: {
|
|
77
|
+
args: {
|
|
78
|
+
value: string;
|
|
79
|
+
hasError: boolean;
|
|
80
|
+
errorMessage: string;
|
|
81
|
+
id: string;
|
|
82
|
+
title: string;
|
|
83
|
+
hint: string;
|
|
84
|
+
placeholder: string;
|
|
85
|
+
disabled: boolean;
|
|
86
|
+
name: string;
|
|
87
|
+
onChange: (e: any) => void;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export declare const Disabled: {
|
|
91
|
+
args: {
|
|
92
|
+
disabled: boolean;
|
|
93
|
+
id: string;
|
|
94
|
+
title: string;
|
|
95
|
+
hint: string;
|
|
96
|
+
value: string;
|
|
97
|
+
placeholder: string;
|
|
98
|
+
hasError: boolean;
|
|
99
|
+
errorMessage: string;
|
|
100
|
+
name: string;
|
|
101
|
+
onChange: (e: any) => void;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export declare const Palette: {
|
|
105
|
+
render: () => React.JSX.Element;
|
|
106
|
+
};
|