@taikai/rocket-kit 3.0.5 → 3.0.6

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.
@@ -448,7 +448,7 @@ const CheckboxLabel = /*#__PURE__*/_styled.span.withConfig({
448
448
  const CheckboxInput = /*#__PURE__*/_styled.input.withConfig({
449
449
  displayName: "styles__CheckboxInput",
450
450
  componentId: "sc-w5t014-2"
451
- })(["position:absolute;left:0;opacity:0;cursor:pointer;&:checked:not(:disabled)[aria-checked='true'] ~ span{background-color:", ";border-color:", ";&:after{display:block;}}&:checked:disabled[aria-checked='true'] ~ span{border-color:transparent;background-color:", ";color:", ";&:after{display:block;}}&:not(:checked):disabled ~ span{border-color:", ";background-color:", ";}&:hover:not(:disabled){border-color:", ";&:checked ~ span{border-color:", ";}}"], props => props.error ? field.errorBackgroundColor : field.successBackgroundColor, props => props.error ? field.errorBorderColor : field.successBorderColor, field.disabledBackgroundColor, field.disabledColor, field.disabledBackgroundColor, field.backgroundColor, props => props.error ? field.errorBorderColor : field.activeBorderColor, props => props.error ? field.errorBorderColor : field.successBorderColor);
451
+ })(["position:absolute;left:0;opacity:0;cursor:pointer;"]);
452
452
  const Checkmark = /*#__PURE__*/_styled.span.withConfig({
453
453
  displayName: "styles__Checkmark",
454
454
  componentId: "sc-w5t014-3"
@@ -5327,24 +5327,23 @@ const Field = _styled.div`
5327
5327
  }
5328
5328
  `;
5329
5329
 
5330
- const FieldWidthButton = props => {
5331
- const {
5332
- label,
5333
- type = 'text',
5334
- name,
5335
- placeholder,
5336
- value,
5337
- onChange,
5338
- dataTestId,
5339
- buttonIcon,
5340
- buttonValue,
5341
- buttonAction,
5342
- buttonDisabled,
5343
- disabled = true,
5344
- clearFieldAfterSubmit = false
5345
- } = props;
5330
+ const FieldWidthButton = ({
5331
+ label,
5332
+ type = 'text',
5333
+ name,
5334
+ placeholder,
5335
+ value,
5336
+ onChange,
5337
+ dataTestId,
5338
+ buttonIcon,
5339
+ buttonValue,
5340
+ buttonAction,
5341
+ buttonDisabled,
5342
+ disabled = true,
5343
+ clearFieldAfterSubmit = false
5344
+ }) => {
5346
5345
  const [loading, setLoading] = useState(false);
5347
- const [fieldValue, setFieldValue] = useState(value ?? null);
5346
+ const [fieldValue, setFieldValue] = useState(value ?? '');
5348
5347
  const handleOnClickAction = async () => {
5349
5348
  if ((buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction.constructor.name) !== 'AsyncFunction') {
5350
5349
  buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction(fieldValue);
@@ -5355,6 +5354,10 @@ const FieldWidthButton = props => {
5355
5354
  }
5356
5355
  clearFieldAfterSubmit && setFieldValue('');
5357
5356
  };
5357
+ useEffect(() => {
5358
+ if (!value) return;
5359
+ setFieldValue(value);
5360
+ }, [value]);
5358
5361
  return /*#__PURE__*/React.createElement(Wrapper$e, null, label && /*#__PURE__*/React.createElement(Label, {
5359
5362
  value: label
5360
5363
  }), /*#__PURE__*/React.createElement(Field, null, /*#__PURE__*/React.createElement(TextField, {