@uxf/ui 11.28.0 → 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 +5 -5
- package/button-list/button-list.stories.js +1 -1
- package/css/button.css +8 -12
- package/css/colors.css +8 -0
- package/css/icon.css +4 -6
- 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
|
@@ -44,13 +44,13 @@ function Basic() {
|
|
|
44
44
|
config.variants.flatMap((variant) => config.sizes.map((size) => (react_1.default.createElement("div", { key: variant, className: "text-center text-xs text-gray-400" },
|
|
45
45
|
"size=",
|
|
46
46
|
size))))),
|
|
47
|
-
config.colors.map((color) => (react_1.default.createElement("div", { className: color === "inverted" ? "bg-[#1F2A37] dark:bg-white" : undefined, key: color },
|
|
47
|
+
config.colors.map((color) => (react_1.default.createElement("div", { className: color === "inverted" ? "min-w-fit bg-[#1F2A37] dark:bg-white" : undefined, key: color },
|
|
48
48
|
react_1.default.createElement("div", { className: "grid gap-3 py-2", style: { gridTemplateColumns } },
|
|
49
49
|
react_1.default.createElement("div", { className: "flex items-center text-center text-xs text-gray-400" },
|
|
50
50
|
"color=",
|
|
51
51
|
color),
|
|
52
52
|
config.variants.map((variant) => (react_1.default.createElement(react_1.Fragment, { key: variant }, config.sizes.map((size) => (react_1.default.createElement("div", { key: `${size}${color}${variant}`, className: "flex items-center justify-center gap-2" },
|
|
53
|
-
react_1.default.createElement(button_1.Button, { color: color, onClick: onClick, size: size, variant: variant
|
|
53
|
+
react_1.default.createElement(button_1.Button, { color: color, onClick: onClick, size: size, variant: variant }, "Button"),
|
|
54
54
|
react_1.default.createElement(button_1.Button, { color: color, onClick: onClick, size: size, variant: variant, isIconButton: true },
|
|
55
55
|
react_1.default.createElement(icon_1.Icon, { name: "triangle-exclamation" }))))))))))))));
|
|
56
56
|
}
|
|
@@ -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" },
|
package/css/button.css
CHANGED
|
@@ -172,6 +172,7 @@
|
|
|
172
172
|
|
|
173
173
|
&--variant-secondary {
|
|
174
174
|
--uxf-button-background-color-hover: var(--uxf-color-base-surface-main-hover);
|
|
175
|
+
--uxf-button-background-color: var(--uxf-color-base-surface-main);
|
|
175
176
|
|
|
176
177
|
border-style: solid;
|
|
177
178
|
border-width: 1px;
|
|
@@ -204,15 +205,12 @@
|
|
|
204
205
|
&.uxf-button--color-inverted {
|
|
205
206
|
--uxf-button-border-color: var(--uxf-color-base-border-inverted);
|
|
206
207
|
--uxf-button-text-color: var(--uxf-color-base-text-inverted-high-emphasis);
|
|
207
|
-
--uxf-button-background-color
|
|
208
|
+
--uxf-button-background-color: var(--uxf-color-base-surface-inverted-main);
|
|
209
|
+
--uxf-button-background-color-hover: var(--uxf-color-base-surface-inverted-main-hover);
|
|
208
210
|
|
|
209
211
|
&.uxf-button--is-disabled {
|
|
210
|
-
--uxf-button-
|
|
211
|
-
--uxf-button-background-color: var(--uxf-color-base-surface-
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
:root .dark & {
|
|
215
|
-
--uxf-button-background-color-hover: #d2d6db2f;
|
|
212
|
+
--uxf-button-text-color: var(--uxf-color-base-text-inverted-disabled);
|
|
213
|
+
--uxf-button-background-color: var(--uxf-color-base-surface-inverted-main);
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
216
|
|
|
@@ -248,14 +246,12 @@
|
|
|
248
246
|
--uxf-button-text-color: var(--uxf-color-info-text);
|
|
249
247
|
}
|
|
250
248
|
|
|
251
|
-
/** TODO @vejvis - UX musí doladit inverted button... teď je to strašnej hack */
|
|
252
249
|
&.uxf-button--color-inverted {
|
|
253
250
|
--uxf-button-text-color: var(--uxf-color-base-text-inverted-high-emphasis);
|
|
254
|
-
--uxf-button-background-color-hover:
|
|
251
|
+
--uxf-button-background-color-hover: var(--uxf-color-base-surface-inverted-main-hover);
|
|
255
252
|
|
|
256
|
-
|
|
257
|
-
--uxf-button-
|
|
258
|
-
--uxf-button-text-color: #d2d6db;
|
|
253
|
+
&.uxf-button--is-disabled {
|
|
254
|
+
--uxf-button-text-color: var(--uxf-color-base-text-inverted-disabled);
|
|
259
255
|
}
|
|
260
256
|
}
|
|
261
257
|
|
package/css/colors.css
CHANGED
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
--uxf-color-base-surface-main-hover: #f3f4f6;
|
|
7
7
|
--uxf-color-base-surface-input-disabled: #f3f4f6;
|
|
8
8
|
--uxf-color-base-surface-disabled: #d2d6db;
|
|
9
|
+
--uxf-color-base-surface-inverted-main: #ffffff14;
|
|
10
|
+
--uxf-color-base-surface-inverted-main-hover: #ffffff29;
|
|
9
11
|
--uxf-color-base-text-disabled: #9da4ae;
|
|
10
12
|
--uxf-color-base-text-high-emphasis: #111927;
|
|
11
13
|
--uxf-color-base-text-low-emphasis: #4d5761;
|
|
12
14
|
--uxf-color-base-text-inverted-high-emphasis: #fff;
|
|
15
|
+
--uxf-color-base-text-inverted-low-emphasis: #fffc;
|
|
16
|
+
--uxf-color-base-text-inverted-disabled: #ffffffb3;
|
|
13
17
|
|
|
14
18
|
/** primary */
|
|
15
19
|
--uxf-color-primary-surface-default: #155dee;
|
|
@@ -47,10 +51,14 @@
|
|
|
47
51
|
--uxf-color-base-surface-main-hover: #1f2a37;
|
|
48
52
|
--uxf-color-base-surface-input-disabled: #4d5761;
|
|
49
53
|
--uxf-color-base-surface-disabled: #d2d6db;
|
|
54
|
+
--uxf-color-base-surface-inverted-main: #20293914;
|
|
55
|
+
--uxf-color-base-surface-inverted-main-hover: #20293929;
|
|
50
56
|
--uxf-color-base-text-disabled: #ffffff80;
|
|
51
57
|
--uxf-color-base-text-high-emphasis: #fff;
|
|
52
58
|
--uxf-color-base-text-low-emphasis: #ffffffbf;
|
|
53
59
|
--uxf-color-base-text-inverted-high-emphasis: #111927;
|
|
60
|
+
--uxf-color-base-text-inverted-low-emphasis: #202939cc;
|
|
61
|
+
--uxf-color-base-text-inverted-disabled: #202939b3;
|
|
54
62
|
|
|
55
63
|
/** primary */
|
|
56
64
|
--uxf-color-primary-surface-default: #518bff;
|
package/css/icon.css
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
.uxf-icon {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
:
|
|
5
|
-
color: theme("colors.white");
|
|
6
|
-
}
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
height: var(--i-h);
|
|
4
|
+
width: var(--i-w);
|
|
7
5
|
|
|
8
6
|
& > use {
|
|
9
|
-
|
|
7
|
+
pointer-events: none;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
&--color-default {
|
|
@@ -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;
|