venice-ui 3.0.20 → 3.0.22

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.
@@ -43,7 +43,7 @@ const ButtonsFooter = ({ theme, themeVariant, onPrimaryAction, onSecondaryAction
43
43
  additionalType === 'button' && (react_1.default.createElement(Button_1.Button, { mode: isAdditionalDanger ? 'danger' : 'ghost', onClick: additionAction, isDisabled: additionDisabled, text: labels.additional, size: size })),
44
44
  additionalType === 'toggle' && (react_1.default.createElement(Toggle_1.Toggle, { label: labels.additional, value: additionalValue, handleClick: additionAction, labelPosition: "left", labelInversed: true, size: size })))))),
45
45
  react_1.default.createElement(ButtonsFooter_styles_1.ButtonsFooterGroup, { config: buttonsFooterConfig, theme: resolvedTheme },
46
- !primaryLoading && (react_1.default.createElement(Button_1.Button, { mode: isMultiButtons ? 'ghost' : primaryVariant, onClick: onSecondaryAction, text: labels.secondary || config_2.wordbook.actions.cancel, size: size })),
47
- onPrimaryAction && labels.primary && (react_1.default.createElement(Button_1.Button, { onClick: onPrimaryAction, text: labels.primary, isDisabled: primaryDisabled, loader: primaryLoading, size: size })))))));
46
+ !primaryLoading && (react_1.default.createElement(Button_1.Button, { mode: isMultiButtons ? 'ghost' : primaryVariant ? primaryVariant : 'primary', onClick: onSecondaryAction, text: labels.secondary || config_2.wordbook.actions.cancel, size: size })),
47
+ onPrimaryAction && labels.primary && (react_1.default.createElement(Button_1.Button, { onClick: onPrimaryAction, text: labels.primary, isDisabled: primaryDisabled, loader: primaryLoading, size: size, mode: primaryVariant })))))));
48
48
  };
49
49
  exports.ButtonsFooter = ButtonsFooter;
@@ -48,6 +48,9 @@ const Input = ({ theme, themeVariant = 'default', label, labelPosition = 'top',
48
48
  const { componentsConfig } = resolvedThemeData;
49
49
  const inputConfig = componentsConfig.input;
50
50
  const [inputValue, setInputValue] = (0, react_1.useState)(value || '');
51
+ (0, react_1.useEffect)(() => {
52
+ setInputValue(value || '');
53
+ }, [value]);
51
54
  const [inputType] = (0, react_1.useState)(type);
52
55
  const [showPassword, setShowPassword] = (0, react_1.useState)(false);
53
56
  const onChange = (e) => {
@@ -37,6 +37,6 @@ export const ButtonsFooter = ({ theme, themeVariant, onPrimaryAction, onSecondar
37
37
  additionalType === 'button' && (React.createElement(Button, { mode: isAdditionalDanger ? 'danger' : 'ghost', onClick: additionAction, isDisabled: additionDisabled, text: labels.additional, size: size })),
38
38
  additionalType === 'toggle' && (React.createElement(Toggle, { label: labels.additional, value: additionalValue, handleClick: additionAction, labelPosition: "left", labelInversed: true, size: size })))))),
39
39
  React.createElement(ButtonsFooterGroup, { config: buttonsFooterConfig, theme: resolvedTheme },
40
- !primaryLoading && (React.createElement(Button, { mode: isMultiButtons ? 'ghost' : primaryVariant, onClick: onSecondaryAction, text: labels.secondary || wordbook.actions.cancel, size: size })),
41
- onPrimaryAction && labels.primary && (React.createElement(Button, { onClick: onPrimaryAction, text: labels.primary, isDisabled: primaryDisabled, loader: primaryLoading, size: size })))))));
40
+ !primaryLoading && (React.createElement(Button, { mode: isMultiButtons ? 'ghost' : primaryVariant ? primaryVariant : 'primary', onClick: onSecondaryAction, text: labels.secondary || wordbook.actions.cancel, size: size })),
41
+ onPrimaryAction && labels.primary && (React.createElement(Button, { onClick: onPrimaryAction, text: labels.primary, isDisabled: primaryDisabled, loader: primaryLoading, size: size, mode: primaryVariant })))))));
42
42
  };
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import { resolveThemeWithComponentsConfig } from '../../config';
3
3
  import { InputElement, PrefixWrapper } from './Input.styles';
4
4
  import { Icon } from '../Icon';
@@ -12,6 +12,9 @@ export const Input = ({ theme, themeVariant = 'default', label, labelPosition =
12
12
  const { componentsConfig } = resolvedThemeData;
13
13
  const inputConfig = componentsConfig.input;
14
14
  const [inputValue, setInputValue] = useState(value || '');
15
+ useEffect(() => {
16
+ setInputValue(value || '');
17
+ }, [value]);
15
18
  const [inputType] = useState(type);
16
19
  const [showPassword, setShowPassword] = useState(false);
17
20
  const onChange = (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venice-ui",
3
- "version": "3.0.20",
3
+ "version": "3.0.22",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "module": "./dist/esm/index.js",