@kaio-xyz/design-system 1.1.59 → 1.1.61

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 CHANGED
@@ -394,15 +394,17 @@ var TextField = React.forwardRef(function (_a, ref) {
394
394
  var className = _a.className, disabled = _a.disabled, hint = _a.hint, id = _a.id, label = _a.label, onChange = _a.onChange, readOnly = _a.readOnly, invalid = _a.invalid, 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", "invalid", "button", "fullWidth", "size", "noPadding", "floatingLabel", "value", "defaultValue", "onFocus", "onBlur"]);
395
395
  var _f = React.useState(false), isFocused = _f[0], setIsFocused = _f[1];
396
396
  var _g = React.useState(false), isAutofilled = _g[0], setIsAutofilled = _g[1];
397
- var _h = React.useState(false), hasValue = _h[0], setHasValue = _h[1];
397
+ var _h = React.useState(function () { return Boolean(value || defaultValue); }), hasValue = _h[0], setHasValue = _h[1];
398
398
  var internalRef = React.useRef(null);
399
399
  var inputRef = ref || internalRef;
400
+ React.useEffect(function () {
401
+ if (value !== undefined)
402
+ setHasValue(value !== '');
403
+ }, [value]);
400
404
  React.useEffect(function () {
401
405
  var input = inputRef.current;
402
406
  if (!input)
403
407
  return;
404
- if (input.value)
405
- setHasValue(true);
406
408
  var handleAnimationStart = function (e) {
407
409
  if (e.animationName === 'onAutoFillStart')
408
410
  return setIsAutofilled(true);
@@ -578,7 +580,7 @@ var Stepper = function (_a) {
578
580
  var style$g = {"root":"step-module__root__Tk1Yq","container":"step-module__container__XbQSB","label":"step-module__label__UNF3I","emptyIcon":"step-module__emptyIcon__-xNcB","checkIcon":"step-module__checkIcon__MWBUM","loadingIcon":"step-module__loadingIcon__-VoCZ"};
579
581
 
580
582
  var Step = function (_a) {
581
- var keyIndex = _a.keyIndex, label = _a.label, dataTest = _a.dataTest, className = _a.className, _b = _a.iconSize, iconSize = _b === void 0 ? 16 : _b, _c = _a.isCompleted, isCompleted = _c === void 0 ? false : _c, _d = _a.isCurrent, isCurrent = _d === void 0 ? false : _d, _e = _a.direction, direction = _e === void 0 ? 'vertical' : _e;
583
+ var label = _a.label, dataTest = _a.dataTest, className = _a.className, _b = _a.iconSize, iconSize = _b === void 0 ? 16 : _b, _c = _a.isCompleted, isCompleted = _c === void 0 ? false : _c, _d = _a.isCurrent, isCurrent = _d === void 0 ? false : _d, _e = _a.direction, direction = _e === void 0 ? 'vertical' : _e, props = __rest(_a, ["label", "dataTest", "className", "iconSize", "isCompleted", "isCurrent", "direction"]);
582
584
  var icon = React.useMemo(function () {
583
585
  switch (true) {
584
586
  case isCompleted: return jsxRuntime.jsx(SvgCheck, { className: style$g.checkIcon, viewBox: "0 0 24 24" });
@@ -586,7 +588,7 @@ var Step = function (_a) {
586
588
  default: return jsxRuntime.jsx("span", { className: style$g.emptyIcon });
587
589
  }
588
590
  }, [isCompleted, isCurrent, iconSize]);
589
- return (jsxRuntime.jsx("li", { className: clsx(style$g.root, className), "data-is-current": isCurrent, "data-direction": direction, "data-test": dataTest, style: { '--icon-size': "".concat(iconSize, "px") }, children: jsxRuntime.jsxs(Stack, { className: style$g.container, position: "horizontal", children: [icon, jsxRuntime.jsx("span", { className: style$g.label, children: label })] }) }, keyIndex));
591
+ return (jsxRuntime.jsx("li", __assign({ className: clsx(style$g.root, className), "data-is-current": isCurrent, "data-direction": direction, "data-test": dataTest, style: { '--icon-size': "".concat(iconSize, "px") } }, props, { children: jsxRuntime.jsxs(Stack, { className: style$g.container, position: "horizontal", children: [icon, jsxRuntime.jsx("span", { className: style$g.label, children: label })] }) })));
590
592
  };
591
593
 
592
594
  var style$f = {"root":"list-module__root__OXx93"};