@kaio-xyz/design-system 1.1.67 → 1.1.69
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/index.cjs.js +31 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +23 -3
- package/dist/index.esm.js +32 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -381,34 +381,40 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
381
381
|
});
|
|
382
382
|
Button.displayName = "Button";
|
|
383
383
|
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
var Hint = function (_a) {
|
|
387
|
-
var children = _a.children, className = _a.className, _b = _a.kind, kind = _b === void 0 ? "info" : _b, attributes = __rest(_a, ["children", "className", "kind"]);
|
|
388
|
-
return (jsxRuntime.jsxs(Stack, __assign({ space: "xs", position: "horizontal", className: clsx(style$r.hint, className), "data-type": kind }, attributes, { children: [jsxRuntime.jsx(SvgInfo, {}), jsxRuntime.jsx("span", { className: style$r.children, children: children })] })));
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
var style$q = {"field":"text-field-module__field__iZ0TF","label":"text-field-module__label__ClJkz","container":"text-field-module__container__IKtNZ","fieldWrapper":"text-field-module__fieldWrapper__nQ7l8","textField":"text-field-module__textField__756eR","hint":"text-field-module__hint__Ad6VA"};
|
|
392
|
-
|
|
393
|
-
var TextField = React.forwardRef(function (_a, ref) {
|
|
394
|
-
var className = _a.className, disabled = _a.disabled, hint = _a.hint, id = _a.id, label = _a.label, onChange = _a.onChange, readOnly = _a.readOnly, button = _a.button, _b = _a.fullWidth, fullWidth = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? "default" : _c, _d = _a.noPadding, noPadding = _d === void 0 ? false : _d, _e = _a.floatingLabel, floatingLabel = _e === void 0 ? true : _e, value = _a.value, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, attributes = __rest(_a, ["className", "disabled", "hint", "id", "label", "onChange", "readOnly", "button", "fullWidth", "size", "noPadding", "floatingLabel", "value", "defaultValue", "onFocus", "onBlur"]);
|
|
395
|
-
var _f = React.useState(false), isAutofilled = _f[0], setIsAutofilled = _f[1];
|
|
384
|
+
var useFieldAutofill = function () {
|
|
385
|
+
var _a = React.useState(false), isAutofilled = _a[0], setIsAutofilled = _a[1];
|
|
396
386
|
var internalRef = React.useRef(null);
|
|
397
|
-
React.useImperativeHandle(ref, function () { return internalRef.current; });
|
|
398
387
|
React.useEffect(function () {
|
|
399
388
|
var input = internalRef.current;
|
|
400
389
|
if (!input)
|
|
401
390
|
return;
|
|
402
391
|
var handleAnimationStart = function (e) {
|
|
403
|
-
|
|
392
|
+
var animationEvent = e;
|
|
393
|
+
if (animationEvent.animationName.indexOf('onAutoFillStart') !== -1)
|
|
404
394
|
setIsAutofilled(true);
|
|
405
|
-
if (
|
|
395
|
+
if (animationEvent.animationName.indexOf('onAutoFillCancel') !== -1)
|
|
406
396
|
setIsAutofilled(false);
|
|
407
397
|
};
|
|
408
398
|
input.addEventListener('animationstart', handleAnimationStart);
|
|
409
399
|
return function () { return input.removeEventListener('animationstart', handleAnimationStart); };
|
|
410
400
|
}, []);
|
|
411
|
-
return
|
|
401
|
+
return { isAutofilled: isAutofilled, internalRef: internalRef };
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
var style$r = {"hint":"hint-module__hint__0cpje","children":"hint-module__children__GSZxg"};
|
|
405
|
+
|
|
406
|
+
var Hint = function (_a) {
|
|
407
|
+
var children = _a.children, className = _a.className, _b = _a.kind, kind = _b === void 0 ? "info" : _b, attributes = __rest(_a, ["children", "className", "kind"]);
|
|
408
|
+
return (jsxRuntime.jsxs(Stack, __assign({ space: "xs", position: "horizontal", className: clsx(style$r.hint, className), "data-type": kind }, attributes, { children: [jsxRuntime.jsx(SvgInfo, {}), jsxRuntime.jsx("span", { className: style$r.children, children: children })] })));
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
var style$q = {"field":"text-field-module__field__iZ0TF","label":"text-field-module__label__ClJkz","container":"text-field-module__container__IKtNZ","fieldWrapper":"text-field-module__fieldWrapper__nQ7l8","textField":"text-field-module__textField__756eR","hint":"text-field-module__hint__Ad6VA"};
|
|
412
|
+
|
|
413
|
+
var TextField = React.forwardRef(function (_a, ref) {
|
|
414
|
+
var className = _a.className, disabled = _a.disabled, hint = _a.hint, id = _a.id, label = _a.label, onChange = _a.onChange, readOnly = _a.readOnly, button = _a.button, _b = _a.fullWidth, fullWidth = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? "default" : _c, _d = _a.noPadding, noPadding = _d === void 0 ? false : _d, _e = _a.floatingLabel, floatingLabel = _e === void 0 ? true : _e, value = _a.value, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, _f = _a.type, type = _f === void 0 ? "text" : _f, attributes = __rest(_a, ["className", "disabled", "hint", "id", "label", "onChange", "readOnly", "button", "fullWidth", "size", "noPadding", "floatingLabel", "value", "defaultValue", "onFocus", "onBlur", "type"]);
|
|
415
|
+
var _g = useFieldAutofill(), isAutofilled = _g.isAutofilled, internalRef = _g.internalRef;
|
|
416
|
+
React.useImperativeHandle(ref, function () { return internalRef.current; });
|
|
417
|
+
return (jsxRuntime.jsx("fieldset", { "aria-disabled": disabled, disabled: disabled, className: clsx(style$q.textField, className), "data-no-padding": noPadding, "data-full-width": fullWidth, children: jsxRuntime.jsx("div", { className: style$q.container, "data-has-label": !!label, "data-has-hint": !!hint, "data-has-button": !!button, "data-floating-label": floatingLabel, children: jsxRuntime.jsxs("div", { className: style$q.fieldWrapper, children: [jsxRuntime.jsx("input", __assign({}, attributes, { id: id, ref: internalRef, type: type, value: value, defaultValue: defaultValue, placeholder: " ", className: style$q.field, "data-size": size, "data-autofilled": isAutofilled, onFocus: onFocus, onBlur: onBlur, onChange: onChange, readOnly: readOnly })), label && (jsxRuntime.jsx("label", { className: style$q.label, htmlFor: id, "data-floating": floatingLabel, children: label })), button ? button : null, hint && jsxRuntime.jsx(Hint, { kind: "error", className: style$q.hint, children: hint })] }) }) }));
|
|
412
418
|
});
|
|
413
419
|
TextField.displayName = "TextField";
|
|
414
420
|
|
|
@@ -942,6 +948,14 @@ var Tabs = {
|
|
|
942
948
|
TriggerWithCounter: TriggerWithCounter,
|
|
943
949
|
};
|
|
944
950
|
|
|
951
|
+
var TextArea = React.forwardRef(function (_a, ref) {
|
|
952
|
+
var className = _a.className, disabled = _a.disabled, hint = _a.hint, id = _a.id, label = _a.label, onChange = _a.onChange, readOnly = _a.readOnly, _b = _a.fullWidth, fullWidth = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? "default" : _c, _d = _a.noPadding, noPadding = _d === void 0 ? false : _d, _e = _a.floatingLabel, floatingLabel = _e === void 0 ? true : _e, value = _a.value, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, _f = _a.rows, rows = _f === void 0 ? 3 : _f, attributes = __rest(_a, ["className", "disabled", "hint", "id", "label", "onChange", "readOnly", "fullWidth", "size", "noPadding", "floatingLabel", "value", "defaultValue", "onFocus", "onBlur", "rows"]);
|
|
953
|
+
var _g = useFieldAutofill(), isAutofilled = _g.isAutofilled, internalRef = _g.internalRef;
|
|
954
|
+
React.useImperativeHandle(ref, function () { return internalRef.current; });
|
|
955
|
+
return (jsxRuntime.jsx("fieldset", { "aria-disabled": disabled, disabled: disabled, className: clsx(style$q.textField, className), "data-no-padding": noPadding, "data-full-width": fullWidth, children: jsxRuntime.jsx("div", { className: style$q.container, "data-has-label": !!label, "data-has-hint": !!hint, "data-floating-label": floatingLabel, children: jsxRuntime.jsxs("div", { className: style$q.fieldWrapper, children: [jsxRuntime.jsx("textarea", __assign({}, attributes, { id: id, ref: internalRef, value: value, defaultValue: defaultValue, placeholder: " ", className: style$q.field, "data-size": size, "data-autofilled": isAutofilled, onFocus: onFocus, onBlur: onBlur, onChange: onChange, readOnly: readOnly, rows: rows })), label && (jsxRuntime.jsx("label", { className: style$q.label, htmlFor: id, "data-floating": floatingLabel, children: label })), hint && jsxRuntime.jsx(Hint, { kind: "error", className: style$q.hint, children: hint })] }) }) }));
|
|
956
|
+
});
|
|
957
|
+
TextArea.displayName = "TextArea";
|
|
958
|
+
|
|
945
959
|
exports.Accordion = Accordion;
|
|
946
960
|
exports.Alert = Alert;
|
|
947
961
|
exports.Badge = Badge;
|
|
@@ -971,6 +985,7 @@ exports.Step = Step;
|
|
|
971
985
|
exports.Stepper = Stepper;
|
|
972
986
|
exports.Table = Table;
|
|
973
987
|
exports.Tabs = Tabs;
|
|
988
|
+
exports.TextArea = TextArea;
|
|
974
989
|
exports.TextField = TextField;
|
|
975
990
|
exports.Timeframes = Timeframes;
|
|
976
991
|
exports.Tooltip = Tooltip;
|