@uxf/ui 11.28.1 → 11.28.2
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/avatar-file-input/avatar-file-input.js +2 -2
- package/button/button.d.ts +0 -4
- package/button/button.js +1 -3
- package/button/button.stories.js +3 -3
- package/button-list/button-list.stories.js +1 -1
- package/date-picker/date-picker-month.js +2 -2
- package/date-picker/date-picker-year.js +2 -2
- package/date-range-picker/date-range-picker-month.js +2 -2
- package/date-range-picker/date-range-picker-year.js +2 -2
- package/package.json +1 -1
- package/text-input/text-input.stories.js +1 -1
|
@@ -63,7 +63,7 @@ exports.AvatarFileInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
63
63
|
onSelectFile,
|
|
64
64
|
onRemoveFile,
|
|
65
65
|
})) : (react_1.default.createElement("div", { className: "uxf-avatar-file-input__controls-buttons" },
|
|
66
|
-
react_1.default.createElement(button_1.Button, { className: "uxf-avatar-file-input__controls-button uxf-avatar-file-input__controls-button--select",
|
|
67
|
-
!!props.value && !props.isDisabled && (react_1.default.createElement(button_1.Button, { className: "uxf-avatar-file-input__controls-button uxf-avatar-file-input__controls-button--remove", color: "negative",
|
|
66
|
+
react_1.default.createElement(button_1.Button, { className: "uxf-avatar-file-input__controls-button uxf-avatar-file-input__controls-button--select", isDisabled: props.isDisabled, onClick: onSelectFile, size: "sm", variant: "secondary" }, (_e = props.selectFileLabel) !== null && _e !== void 0 ? _e : "Upload image"),
|
|
67
|
+
!!props.value && !props.isDisabled && (react_1.default.createElement(button_1.Button, { className: "uxf-avatar-file-input__controls-button uxf-avatar-file-input__controls-button--remove", color: "negative", isDisabled: props.isDisabled, onClick: onRemoveFile, size: "sm", variant: "secondary" }, (_f = props.removeFileLabel) !== null && _f !== void 0 ? _f : "Remove avatar"))))))));
|
|
68
68
|
});
|
|
69
69
|
exports.AvatarFileInput.displayName = "UxfUiAvatarFileInput";
|
package/button/button.d.ts
CHANGED
|
@@ -12,11 +12,7 @@ export interface ButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement
|
|
|
12
12
|
isIconButton?: boolean;
|
|
13
13
|
size?: ButtonSize;
|
|
14
14
|
variant?: ButtonVariant;
|
|
15
|
-
/** @deprecated use isLoading */
|
|
16
|
-
loading?: boolean;
|
|
17
15
|
isLoading?: boolean;
|
|
18
|
-
/** @deprecated use isDisabled */
|
|
19
|
-
disabled?: boolean;
|
|
20
16
|
isDisabled?: boolean;
|
|
21
17
|
}
|
|
22
18
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLAnchorElement>>;
|
package/button/button.js
CHANGED
|
@@ -29,10 +29,8 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
exports.Button = (0, react_1.forwardRef)((props, ref) => {
|
|
31
31
|
// eslint-disable-next-line react/destructuring-assignment
|
|
32
|
-
const { as = "a", color, isIconButton, isFullWidth, size, variant, className, ...restProps } = props;
|
|
32
|
+
const { as = "a", color, isIconButton, isFullWidth, size, variant, className, isDisabled, isLoading, ...restProps } = props;
|
|
33
33
|
const Component = as;
|
|
34
|
-
const isDisabled = props.isDisabled || props.disabled;
|
|
35
|
-
const isLoading = props.isLoading || props.loading;
|
|
36
34
|
const anchorProps = (0, use_anchor_props_1.useAnchorProps)({
|
|
37
35
|
...restProps,
|
|
38
36
|
disabled: isDisabled,
|
package/button/button.stories.js
CHANGED
|
@@ -71,11 +71,11 @@ function Default() {
|
|
|
71
71
|
react_1.default.createElement("span", { className: "font-semibold" }, size)),
|
|
72
72
|
react_1.default.createElement("div", { className: "flex flex-row items-start gap-2" },
|
|
73
73
|
react_1.default.createElement(button_1.Button, { color: color, onClick: onClick, size: size, variant: variant }, "Default"),
|
|
74
|
-
react_1.default.createElement(button_1.Button, { color: color,
|
|
75
|
-
react_1.default.createElement(button_1.Button, { color: color,
|
|
74
|
+
react_1.default.createElement(button_1.Button, { color: color, isLoading: true, onClick: onClick, size: size, variant: variant }, "Loading"),
|
|
75
|
+
react_1.default.createElement(button_1.Button, { color: color, isDisabled: true, onClick: onClick, size: size, variant: variant }, "Disabled"),
|
|
76
76
|
react_1.default.createElement(button_1.Button, { color: color, isIconButton: true, onClick: onClick, size: size, variant: variant },
|
|
77
77
|
react_1.default.createElement(icon_1.Icon, { name: "check" })),
|
|
78
|
-
react_1.default.createElement(button_1.Button, { color: color, isIconButton: true, onClick: onClick, size: size, variant: variant,
|
|
78
|
+
react_1.default.createElement(button_1.Button, { color: color, isIconButton: true, onClick: onClick, size: size, variant: variant, isLoading: true },
|
|
79
79
|
react_1.default.createElement(icon_1.Icon, { name: "check" })),
|
|
80
80
|
react_1.default.createElement(button_1.Button, { className: "w-[200px]", color: color, onClick: onClick, size: size, variant: variant }, "Custom width")),
|
|
81
81
|
react_1.default.createElement(button_1.Button, { color: color, isFullWidth: true, onClick: onClick, size: size, variant: variant }, "Full width"),
|
|
@@ -16,7 +16,7 @@ const Default = () => {
|
|
|
16
16
|
{ label: "First item" },
|
|
17
17
|
{ label: "Second item" },
|
|
18
18
|
{ label: "Third item" },
|
|
19
|
-
{ label: "Fourth item",
|
|
19
|
+
{ label: "Fourth item", isDisabled: true },
|
|
20
20
|
{ label: "Fifth item" },
|
|
21
21
|
{ label: "Sixth item" },
|
|
22
22
|
{ label: "Seventh item" },
|
|
@@ -60,11 +60,11 @@ exports.DatePickerMonth = (0, react_1.memo)((props) => {
|
|
|
60
60
|
}, [setViewMode]);
|
|
61
61
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
62
62
|
react_1.default.createElement(calendar_1.CalendarNavigation, { prevButtonProps: {
|
|
63
|
-
|
|
63
|
+
isDisabled: !canGoToPrevMonth,
|
|
64
64
|
onClick: canGoToPrevMonth ? handleGoToPrevMonth : undefined,
|
|
65
65
|
title: "Předchozí měsíc",
|
|
66
66
|
}, nextButtonProps: {
|
|
67
|
-
|
|
67
|
+
isDisabled: !canGoToNextMonth,
|
|
68
68
|
onClick: canGoToNextMonth ? handleGoToNextMonth : undefined,
|
|
69
69
|
title: "Nadcházející měsíc",
|
|
70
70
|
}, selectButtonProps: {
|
|
@@ -62,11 +62,11 @@ exports.DatePickerYear = (0, react_1.memo)((props) => {
|
|
|
62
62
|
}, [canGoToMonth, props]);
|
|
63
63
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
64
64
|
react_1.default.createElement(calendar_1.CalendarNavigation, { prevButtonProps: {
|
|
65
|
-
|
|
65
|
+
isDisabled: !canGoToPrevYear,
|
|
66
66
|
onClick: canGoToPrevYear ? handleGoToPrevYear : undefined,
|
|
67
67
|
title: "Předchozí rok",
|
|
68
68
|
}, nextButtonProps: {
|
|
69
|
-
|
|
69
|
+
isDisabled: !canGoToNextYear,
|
|
70
70
|
onClick: canGoToNextYear ? handleGoToNextYear : undefined,
|
|
71
71
|
title: "Nadcházející rok",
|
|
72
72
|
}, selectButtonProps: {
|
|
@@ -52,11 +52,11 @@ exports.DateRangePickerMonth = (0, react_1.memo)((props) => {
|
|
|
52
52
|
}, [props]);
|
|
53
53
|
return (react_1.default.createElement("div", { className: "uxf-date-range-picker__month" },
|
|
54
54
|
react_1.default.createElement(calendar_1.CalendarNavigation, { prevButtonProps: {
|
|
55
|
-
|
|
55
|
+
isDisabled: !canGoToPrevMonth,
|
|
56
56
|
onClick: canGoToPrevMonth ? handleGoToPrevMonth : undefined,
|
|
57
57
|
title: "Předchozí měsíc",
|
|
58
58
|
}, nextButtonProps: {
|
|
59
|
-
|
|
59
|
+
isDisabled: !canGoToNextMonth,
|
|
60
60
|
onClick: canGoToNextMonth ? handleGoToNextMonth : undefined,
|
|
61
61
|
title: "Nadcházející měsíc",
|
|
62
62
|
}, selectButtonProps: {
|
|
@@ -63,11 +63,11 @@ exports.DateRangePickerYear = (0, react_1.memo)((props) => {
|
|
|
63
63
|
}, [canGoToMonth, props]);
|
|
64
64
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
65
|
react_1.default.createElement(calendar_1.CalendarNavigation, { prevButtonProps: {
|
|
66
|
-
|
|
66
|
+
isDisabled: !canGoToPrevYear,
|
|
67
67
|
onClick: canGoToPrevYear ? handleGoToPrevYear : undefined,
|
|
68
68
|
title: "Předchozí rok",
|
|
69
69
|
}, nextButtonProps: {
|
|
70
|
-
|
|
70
|
+
isDisabled: !canGoToNextYear,
|
|
71
71
|
onClick: canGoToNextYear ? handleGoToNextYear : undefined,
|
|
72
72
|
title: "Nadcházející rok",
|
|
73
73
|
}, selectButtonProps: {
|
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@ function Default() {
|
|
|
53
53
|
react_1.default.createElement(text_input_1.TextInput, { name: "readOnly", label: "Read only input", value: value, onChange: onChange, helperText: "Error helper text", leftAddon: "https://", rightAddon: ".cz", leftElement: "\uD83C\uDF37", rightElement: "\uD83D\uDD14", placeholder: "Some beautiful placeholder...", isReadOnly: true }),
|
|
54
54
|
react_1.default.createElement(text_input_1.TextInput, { name: "disabled", label: "Disabled input", value: value, onChange: onChange, helperText: "Error helper text", leftAddon: "https://", rightAddon: ".cz", leftElement: "\uD83C\uDF37", rightElement: "\uD83D\uDD14", placeholder: "Some beautiful placeholder...", isDisabled: true }),
|
|
55
55
|
react_1.default.createElement(text_input_1.TextInput, { name: "defaultHtmlTime", label: "Default html time input", value: timeValue, onChange: onTimeChange, placeholder: "Some beautiful placeholder...", type: "time" }),
|
|
56
|
-
react_1.default.createElement(text_input_1.TextInput, { name: "copyToClipboard", label: "Copy to clipboard input", leftAddon: "I can be copied!", onChange: onChange, placeholder: "Some beautiful placeholder...", rightAddon: react_1.default.createElement(button_1.Button, { className: "size-full rounded-l-none border-none",
|
|
56
|
+
react_1.default.createElement(text_input_1.TextInput, { name: "copyToClipboard", label: "Copy to clipboard input", leftAddon: "I can be copied!", onChange: onChange, placeholder: "Some beautiful placeholder...", rightAddon: react_1.default.createElement(button_1.Button, { className: "size-full rounded-l-none border-none", isDisabled: value === "", onClick: onCopy, variant: "secondary" },
|
|
57
57
|
react_1.default.createElement(icon_1.Icon, { className: "w-4", name: "copy" })), value: value })));
|
|
58
58
|
}
|
|
59
59
|
exports.Default = Default;
|