@uxf/ui 1.0.0-beta.61 → 1.0.0-beta.63
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/color-radio-group/color-radio-group.js +1 -1
- package/combobox/combobox.d.ts +1 -0
- package/combobox/combobox.js +1 -1
- package/css/button.css +9 -9
- package/css/color-radio-group.css +0 -4
- package/css/icon.css +1 -1
- package/css/label.css +3 -3
- package/css/radio-group.css +0 -4
- package/css/toggle.css +21 -8
- package/date-picker-input/date-picker-input.d.ts +1 -0
- package/date-picker-input/date-picker-input.js +1 -1
- package/form-control/form-control.d.ts +1 -0
- package/form-control/form-control.js +1 -1
- package/form-control/form-control.stories.js +3 -1
- package/label/label.d.ts +1 -0
- package/label/label.js +1 -1
- package/package.json +1 -1
- package/radio-group/radio-group.js +1 -1
- package/select/select.d.ts +1 -0
- package/select/select.js +1 -1
- package/select/select.stories.js +2 -1
- package/text-input/text-input.d.ts +1 -0
- package/text-input/text-input.js +2 -2
- package/textarea/textarea.d.ts +1 -0
- package/textarea/textarea.js +1 -1
- package/toggle/toggle.d.ts +1 -0
- package/toggle/toggle.js +7 -5
- package/toggle/toggle.stories.js +12 -14
|
@@ -39,7 +39,7 @@ exports.ColorRadioGroup = (0, forwardRef_1.forwardRef)("ColorRadioGroup", (props
|
|
|
39
39
|
(0, use_input_submit_1.useInputSubmit)(innerRef, "radio-group", isDisabled);
|
|
40
40
|
const rootClassName = (0, cx_1.cx)("uxf-color-radio-group-group", className);
|
|
41
41
|
return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, id: id, onChange: onChange, style: style, value: value },
|
|
42
|
-
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className:
|
|
42
|
+
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-color-radio-group__label", isHidden: hiddenLabel, ref: ref }, label),
|
|
43
43
|
react_2.default.createElement("div", { className: "uxf-color-radio-group__options-wrapper" }, options.map((option) => {
|
|
44
44
|
const optionStyle = { "--option-color": option.value };
|
|
45
45
|
return (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-color-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), key: option.value.toString(), value: option.value, style: optionStyle }, (o) => (react_2.default.createElement(color_radio_1.ColorRadio, { isDisabled: isDisabled || o.disabled, colorLabel: option.label, color: option.value, ref: o.checked ? innerRef : undefined, value: o.checked }))));
|
package/combobox/combobox.d.ts
CHANGED
package/combobox/combobox.js
CHANGED
|
@@ -51,7 +51,7 @@ exports.Combobox = (0, forwardRef_1.forwardRef)("Combobox", (props, ref) => {
|
|
|
51
51
|
const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "caretDown";
|
|
52
52
|
const iconSize = (_d = props.iconSize) !== null && _d !== void 0 ? _d : 24;
|
|
53
53
|
return (react_2.default.createElement(react_1.Combobox, { as: "div", className: (0, cx_1.cx)("uxf-combobox", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), onChange: (v) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, v.id); }, value: selectedOption, disabled: props.isDisabled || props.isReadOnly }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
54
|
-
react_2.default.createElement(react_1.Combobox.Label, { as: label_1.Label, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label),
|
|
54
|
+
react_2.default.createElement(react_1.Combobox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label),
|
|
55
55
|
react_2.default.createElement(react_1.Combobox.Button, { as: "div", className: (0, cx_1.cx)("uxf-combobox__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && "is-open--bottom", dropdown.placement === "top" && "is-open--top", renderProps.open && "is-open"), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef, "aria-invalid": props.isInvalid, "aria-describedby": errorId },
|
|
56
56
|
react_2.default.createElement(react_1.Combobox.Input, { className: (0, cx_1.cx)("uxf-combobox__input"), displayValue: (item) => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.label) !== null && _a !== void 0 ? _a : ""; }, onBlur: props.onBlur, onChange: (event) => setQuery(event.target.value), placeholder: props.placeholder, ref: stableRef, type: "text" }),
|
|
57
57
|
react_2.default.createElement(icon_1.Icon, { className: getIconClassName(renderProps.open), name: iconName, size: iconSize })),
|
package/css/button.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.uxf-button {
|
|
8
|
-
@apply inline-flex items-center justify-center text-center rounded-lg before:rounded-lg font-semibold
|
|
8
|
+
@apply inline-flex items-center justify-center shrink-0 text-center rounded-lg before:rounded-lg font-semibold
|
|
9
9
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 relative cursor-pointer transition before:transition;
|
|
10
10
|
|
|
11
11
|
&__text {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&.is-loading:after {
|
|
28
|
-
|
|
29
|
-
width: 20px;
|
|
30
|
-
height: 20px;
|
|
28
|
+
animation: spinner .8s linear infinite;
|
|
31
29
|
border-radius: 50%;
|
|
32
|
-
border-top: 2px solid;
|
|
33
30
|
border-right: 2px solid transparent;
|
|
34
|
-
|
|
31
|
+
border-top: 2px solid;
|
|
32
|
+
content: '';
|
|
33
|
+
height: 20px;
|
|
35
34
|
margin-left: 8px;
|
|
35
|
+
width: 20px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&--size-xs {
|
|
39
39
|
@apply px-2.5 py-1.5 text-xs;
|
|
40
40
|
|
|
41
41
|
&.is-loading:after {
|
|
42
|
-
width: 14px;
|
|
43
42
|
height: 14px;
|
|
43
|
+
width: 14px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&.uxf-button--icon-button {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
@apply px-3 py-2 text-sm leading-4;
|
|
53
53
|
|
|
54
54
|
&.is-loading:after {
|
|
55
|
-
width: 16px;
|
|
56
55
|
height: 16px;
|
|
56
|
+
width: 16px;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&.uxf-button--icon-button {
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
:root .dark & {
|
|
100
|
-
@apply before:border-gray-
|
|
100
|
+
@apply before:border-gray-700 hover:bg-gray-700 hover:before:border-gray-300 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
101
101
|
|
|
102
102
|
&.is-disabled {
|
|
103
103
|
@apply before:border-gray-700 text-gray-600;
|
package/css/icon.css
CHANGED
package/css/label.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.uxf-label {
|
|
2
|
-
@apply mb-
|
|
2
|
+
@apply mb-2 block font-medium;
|
|
3
3
|
|
|
4
4
|
:root .light & {
|
|
5
5
|
@apply text-gray-900;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@apply text-white;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
&--hidden {
|
|
12
|
+
@apply sr-only;
|
|
13
13
|
}
|
|
14
14
|
}
|
package/css/radio-group.css
CHANGED
package/css/toggle.css
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
.uxf-toggle {
|
|
2
|
-
@apply relative inline-flex h-6 w-12 items-center rounded-full p-0.5 outline-none ring-offset-2
|
|
3
|
-
focus-visible:ring-2;
|
|
2
|
+
@apply relative inline-flex shrink-0 h-6 w-12 items-center rounded-full p-0.5 outline-none ring-offset-2
|
|
3
|
+
focus-visible:ring-2 [&>*]:active:w-[30px];
|
|
4
|
+
|
|
5
|
+
&__wrapper {
|
|
6
|
+
@apply flex items-center justify-between space-x-4 p-4;
|
|
7
|
+
}
|
|
4
8
|
|
|
5
9
|
&__label {
|
|
6
|
-
@apply
|
|
10
|
+
@apply w-full;
|
|
11
|
+
|
|
12
|
+
:root .light & {
|
|
13
|
+
@apply text-gray-600;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:root .dark & {
|
|
17
|
+
@apply text-gray-400;
|
|
18
|
+
}
|
|
7
19
|
}
|
|
8
20
|
|
|
9
21
|
&__inner {
|
|
10
|
-
@apply inline-block h-5 w-5 transform rounded-full bg-white transition;
|
|
22
|
+
@apply inline-block h-5 w-5 transform rounded-full bg-white transition transition-all;
|
|
11
23
|
}
|
|
12
24
|
|
|
13
|
-
&.is-
|
|
14
|
-
|
|
15
|
-
@apply translate-x-6;
|
|
16
|
-
}
|
|
25
|
+
&.is-disabled {
|
|
26
|
+
@apply pointer-events-none;
|
|
17
27
|
}
|
|
18
28
|
|
|
29
|
+
&.is-selected {
|
|
30
|
+
@apply [&>*]:translate-x-6 [&>*]:active:translate-x-[14px];
|
|
31
|
+
}
|
|
19
32
|
|
|
20
33
|
:root .light & {
|
|
21
34
|
@apply bg-gray-200 focus-visible:ring-primary-500;
|
|
@@ -49,7 +49,7 @@ exports.DatePickerInput = (0, forwardRef_1.forwardRef)("DatePickerInput", (props
|
|
|
49
49
|
setIsFocused(false);
|
|
50
50
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
51
51
|
};
|
|
52
|
-
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
52
|
+
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
53
53
|
react_1.default.createElement(react_2.Popover, { className: "relative" },
|
|
54
54
|
react_1.default.createElement(react_2.Popover.Button, { as: "div", className: "uxf-date-picker-input__wrapper" },
|
|
55
55
|
react_1.default.createElement("span", { className: "uxf-date-picker-input__left-element" }, props.leftElement),
|
|
@@ -13,7 +13,7 @@ const label_1 = require("../label");
|
|
|
13
13
|
exports.FormControl = (0, forwardRef_1.forwardRef)("FormControl", (props, ref) => {
|
|
14
14
|
const helperTextClassName = (0, cx_1.cx)("uxf-helper-text", props.errorId && classes_1.CLASSES.IS_INVALID);
|
|
15
15
|
return (react_1.default.createElement("div", { className: props.className, ref: ref },
|
|
16
|
-
react_1.default.createElement(label_1.Label, { isRequired: props.isRequired, htmlFor: props.inputId, form: props.form }, props.label),
|
|
16
|
+
react_1.default.createElement(label_1.Label, { isHidden: props.hiddenLabel, isRequired: props.isRequired, htmlFor: props.inputId, form: props.form }, props.label),
|
|
17
17
|
props.children,
|
|
18
18
|
props.helperText && (react_1.default.createElement("div", { className: helperTextClassName, id: props.errorId }, props.helperText))));
|
|
19
19
|
});
|
|
@@ -18,6 +18,8 @@ function Default() {
|
|
|
18
18
|
react_1.default.createElement(form_control_1.FormControl, { inputId: "default", helperText: "helper text", label: "Default", isRequired: true },
|
|
19
19
|
react_1.default.createElement("div", null, "Is required")),
|
|
20
20
|
react_1.default.createElement(form_control_1.FormControl, { inputId: "error", helperText: "helper text", label: "Default", errorId: "error--error", isRequired: true },
|
|
21
|
-
react_1.default.createElement("div", null, "Is invalid"))
|
|
21
|
+
react_1.default.createElement("div", null, "Is invalid")),
|
|
22
|
+
react_1.default.createElement(form_control_1.FormControl, { inputId: "error", helperText: "helper text", label: "Default", errorId: "error--error", hiddenLabel: true },
|
|
23
|
+
react_1.default.createElement("div", null, "hidden label"))));
|
|
22
24
|
}
|
|
23
25
|
exports.Default = Default;
|
package/label/label.d.ts
CHANGED
package/label/label.js
CHANGED
|
@@ -9,6 +9,6 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
9
9
|
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
10
10
|
const react_1 = __importDefault(require("react"));
|
|
11
11
|
exports.Label = (0, forwardRef_1.forwardRef)("Label", (props, ref) => {
|
|
12
|
-
const className = (0, cx_1.cx)("uxf-label", props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
12
|
+
const className = (0, cx_1.cx)("uxf-label", props.isHidden && "uxf-label--hidden", props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
13
13
|
return (react_1.default.createElement("label", { className: className, form: props.form, htmlFor: props.htmlFor, id: props.id, onClick: props.onClick, ref: ref }, props.children));
|
|
14
14
|
});
|
package/package.json
CHANGED
|
@@ -41,7 +41,7 @@ exports.RadioGroup = (0, forwardRef_1.forwardRef)("RadioGroup", (props, ref) =>
|
|
|
41
41
|
const errorId = isInvalid ? `${id}--errormessage` : undefined;
|
|
42
42
|
const rootClassName = (0, cx_1.cx)("uxf-radio-group", variant === "list" && "uxf-radio-group--list", variant === "radioButton" && "uxf-radio-group--radioButton", isDisabled && classes_1.CLASSES.IS_DISABLED, isInvalid && classes_1.CLASSES.IS_INVALID, className);
|
|
43
43
|
return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, disabled: isDisabled, id: id, onChange: onChange, style: style, value: value },
|
|
44
|
-
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className:
|
|
44
|
+
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-radio-group__label", isHidden: hiddenLabel, ref: ref }, label),
|
|
45
45
|
react_2.default.createElement("div", { className: "uxf-radio-group__options-wrapper" }, options.map((option) => (react_2.default.createElement(react_1.RadioGroup.Option, { className: (0, cx_1.cx)("uxf-radio-group__option", props.isDisabled && classes_1.CLASSES.IS_DISABLED), disabled: option.disabled, key: option.value.toString(), value: option.value }, (o) => (react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-radio-group__option__wrapper", o.checked && classes_1.CLASSES.IS_SELECTED) },
|
|
46
46
|
react_2.default.createElement("span", { className: "uxf-radio-group__option__label" }, option.label),
|
|
47
47
|
react_2.default.createElement(radio_1.Radio, { isDisabled: isDisabled || o.disabled, isInvalid: isInvalid, label: option.label, ref: o.checked ? innerRef : undefined, value: o.checked }))))))),
|
package/select/select.d.ts
CHANGED
package/select/select.js
CHANGED
|
@@ -48,7 +48,7 @@ exports.Select = (0, forwardRef_1.forwardRef)("Select", (props, ref) => {
|
|
|
48
48
|
const iconName = (_c = props.iconName) !== null && _c !== void 0 ? _c : "caretDown";
|
|
49
49
|
const iconSize = (_d = props.iconSize) !== null && _d !== void 0 ? _d : 24;
|
|
50
50
|
return (react_2.default.createElement(react_1.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-select", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), onChange: (v) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, v.id); }, value: selectedOption, disabled: props.isDisabled || props.isReadOnly }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
51
|
-
react_2.default.createElement(react_1.Listbox.Label, { as: label_1.Label, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label),
|
|
51
|
+
react_2.default.createElement(react_1.Listbox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label),
|
|
52
52
|
react_2.default.createElement(react_1.Listbox.Button, { as: "div", className: (0, cx_1.cx)("uxf-select__button", (renderProps.open || input.focused) && classes_1.CLASSES.IS_FOCUSED, renderProps.disabled && classes_1.CLASSES.IS_DISABLED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID, dropdown.placement === "bottom" && "is-open--bottom", dropdown.placement === "top" && "is-open--top", renderProps.open && "is-open"), onBlur: input.onBlur, onFocus: input.onFocus, tabIndex: props.isDisabled || props.isReadOnly ? undefined : 0, ref: stableRef, "aria-invalid": props.isInvalid, "aria-describedby": errorId },
|
|
53
53
|
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-select__button-text", !(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) && "is-empty") }, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || props.placeholder),
|
|
54
54
|
react_2.default.createElement(icon_1.Icon, { className: getIconClassName(renderProps.open), name: iconName, size: iconSize })),
|
package/select/select.stories.js
CHANGED
|
@@ -52,7 +52,8 @@ function Default() {
|
|
|
52
52
|
react_1.default.createElement(index_1.Select, { helperText: "Helper text", isDisabled: true, label: "Disabled select", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value }),
|
|
53
53
|
react_1.default.createElement(index_1.Select, { helperText: "Helper text", isReadOnly: true, label: "Read only select", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value }),
|
|
54
54
|
react_1.default.createElement(index_1.Select, { helperText: "Helper text", isRequired: true, label: "Required select", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value }),
|
|
55
|
-
react_1.default.createElement(index_1.Select, { dropdownPlacement: "top", isRequired: true, label: "Select with dropdown top", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value })
|
|
55
|
+
react_1.default.createElement(index_1.Select, { dropdownPlacement: "top", isRequired: true, label: "Select with dropdown top", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value }),
|
|
56
|
+
react_1.default.createElement(index_1.Select, { helperText: "Helper text of Select with hidden label", hiddenLabel: true, label: "Hidden label", onChange: handleChange, options: options, placeholder: "Vyberte ..", value: value })));
|
|
56
57
|
return (react_1.default.createElement("div", { className: "flex flex-col lg:flex-row" },
|
|
57
58
|
react_1.default.createElement("div", { className: "light space-y-2 p-20 lg:w-1/2" }, storySelects),
|
|
58
59
|
react_1.default.createElement("div", { className: "dark space-y-2 bg-gray-900 p-20 lg:w-1/2" }, storySelects)));
|
package/text-input/text-input.js
CHANGED
|
@@ -36,7 +36,7 @@ exports.TextInput = (0, forwardRef_1.forwardRef)("TextInput", (props, ref) => {
|
|
|
36
36
|
const generatedId = (0, react_1.useId)();
|
|
37
37
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
38
38
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
39
|
-
const rootClassName = (0, cx_1.cx)("uxf-text-input", isFocused && classes_1.CLASSES.IS_FOCUSED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED);
|
|
39
|
+
const rootClassName = (0, cx_1.cx)("uxf-text-input", isFocused && classes_1.CLASSES.IS_FOCUSED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
40
40
|
const onFocus = (e) => {
|
|
41
41
|
var _a;
|
|
42
42
|
setIsFocused(true);
|
|
@@ -47,7 +47,7 @@ exports.TextInput = (0, forwardRef_1.forwardRef)("TextInput", (props, ref) => {
|
|
|
47
47
|
setIsFocused(false);
|
|
48
48
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
49
49
|
};
|
|
50
|
-
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
50
|
+
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
51
51
|
react_1.default.createElement(input_1.Input, { size: props.size, variant: props.variant },
|
|
52
52
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
53
53
|
props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
package/textarea/textarea.d.ts
CHANGED
package/textarea/textarea.js
CHANGED
|
@@ -75,7 +75,7 @@ exports.Textarea = (0, forwardRef_1.forwardRef)("Textarea", (props, ref) => {
|
|
|
75
75
|
window.removeEventListener("resize", handler);
|
|
76
76
|
};
|
|
77
77
|
}, [props.disableAutoHeight, latestRows]);
|
|
78
|
-
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
78
|
+
return (react_1.default.createElement(form_control_1.FormControl, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label },
|
|
79
79
|
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: () => { var _a; return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } },
|
|
80
80
|
react_1.default.createElement("textarea", { "aria-describedby": errorId, "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: "uxf-textarea__element", disabled: props.isDisabled, form: props.form, id: id, maxLength: props.maxLength, minLength: props.minLength, name: props.name, onBlur: onBlur, onChange: (event) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value, event); }, onFocus: onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), required: props.isRequired, value: props.value }))));
|
|
81
81
|
});
|
package/toggle/toggle.d.ts
CHANGED
package/toggle/toggle.js
CHANGED
|
@@ -4,13 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Toggle = void 0;
|
|
7
|
-
const react_1 = require("@headlessui/react");
|
|
8
7
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
9
8
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
10
9
|
const forwardRef_1 = require("@uxf/core/utils/forwardRef");
|
|
11
|
-
const
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
11
|
+
const react_2 = require("@headlessui/react");
|
|
12
12
|
exports.Toggle = (0, forwardRef_1.forwardRef)("Toggle", (props, ref) => {
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return (react_1.default.createElement(react_2.Switch.Group, null,
|
|
14
|
+
react_1.default.createElement("div", { className: `uxf-toggle__wrapper ${props.hiddenLabel ? "uxf-toggle__wrapper--hiddenLabel" : ""}` },
|
|
15
|
+
react_1.default.createElement(react_2.Switch, { checked: props.value, className: (0, cx_1.cx)(props.value && classes_1.CLASSES.IS_SELECTED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, "uxf-toggle", props.className), disabled: props.isDisabled, onChange: props.onChange, style: props.style, ref: ref },
|
|
16
|
+
react_1.default.createElement("span", { className: "uxf-toggle__inner" })),
|
|
17
|
+
react_1.default.createElement(react_2.Switch.Label, { hidden: props.hiddenLabel, className: "uxf-toggle__label" }, props.label))));
|
|
16
18
|
});
|
package/toggle/toggle.stories.js
CHANGED
|
@@ -32,20 +32,18 @@ exports.default = {
|
|
|
32
32
|
};
|
|
33
33
|
function Default() {
|
|
34
34
|
const [checked, setChecked] = (0, react_1.useState)(true);
|
|
35
|
+
const storyToggles = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
|
+
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
37
|
+
setChecked((prev) => !prev);
|
|
38
|
+
}, value: checked }),
|
|
39
|
+
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
40
|
+
setChecked((prev) => !prev);
|
|
41
|
+
}, value: checked, isDisabled: true }),
|
|
42
|
+
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
43
|
+
setChecked((prev) => !prev);
|
|
44
|
+
}, value: checked, hiddenLabel: true })));
|
|
35
45
|
return (react_1.default.createElement("div", { className: "flex" },
|
|
36
|
-
react_1.default.createElement("div", { className: "light flex gap-4 p-20" },
|
|
37
|
-
|
|
38
|
-
setChecked((prev) => !prev);
|
|
39
|
-
}, value: checked }),
|
|
40
|
-
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
41
|
-
setChecked((prev) => !prev);
|
|
42
|
-
}, value: checked, isDisabled: true })),
|
|
43
|
-
react_1.default.createElement("div", { className: "dark flex gap-4 bg-gray-900 p-20" },
|
|
44
|
-
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
45
|
-
setChecked((prev) => !prev);
|
|
46
|
-
}, value: checked }),
|
|
47
|
-
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: () => {
|
|
48
|
-
setChecked((prev) => !prev);
|
|
49
|
-
}, value: checked, isDisabled: true }))));
|
|
46
|
+
react_1.default.createElement("div", { className: "light flex gap-4 p-20" }, storyToggles),
|
|
47
|
+
react_1.default.createElement("div", { className: "dark flex gap-4 bg-gray-900 p-20" }, storyToggles)));
|
|
50
48
|
}
|
|
51
49
|
exports.Default = Default;
|