@uxf/ui 11.76.0 → 11.77.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/_input-with-popover/input-with-popover.d.ts +2 -0
- package/_input-with-popover/input-with-popover.js +1 -1
- package/checkbox-input/checkbox-input.d.ts +1 -0
- package/checkbox-input/checkbox-input.js +6 -3
- package/combobox/combobox.d.ts +1 -0
- package/combobox/combobox.js +3 -1
- package/date-picker-input/date-picker-input.d.ts +1 -0
- package/date-picker-input/date-picker-input.js +3 -2
- package/datetime-picker-input/datetime-picker-input.d.ts +1 -0
- package/datetime-picker-input/datetime-picker-input.js +3 -2
- package/dropzone/dropzone-input.d.ts +1 -0
- package/dropzone/dropzone-input.js +5 -4
- package/flash-messages/flash-messages.d.ts +1 -0
- package/flash-messages/flash-messages.js +3 -2
- package/flash-messages/flash-messages.stories.js +14 -32
- package/form-component/form-component.d.ts +1 -0
- package/form-component/form-component.js +1 -1
- package/multi-combobox/multi-combobox.d.ts +1 -0
- package/multi-combobox/multi-combobox.js +3 -2
- package/multi-select/multi-select.d.ts +1 -0
- package/multi-select/multi-select.js +3 -2
- package/package.json +1 -1
- package/radio-group/radio-group.d.ts +1 -0
- package/radio-group/radio-group.js +4 -3
- package/select/select.d.ts +1 -0
- package/select/select.js +3 -1
- package/text-input/text-input.d.ts +1 -0
- package/text-input/text-input.js +3 -2
- package/textarea/textarea.d.ts +1 -0
- package/textarea/textarea.js +3 -2
- package/toggle/toggle.d.ts +1 -0
- package/toggle/toggle.js +3 -2
|
@@ -21,5 +21,7 @@ export interface InputWithPopoverProps<ValueType = string> extends FormControlPr
|
|
|
21
21
|
rightAddon?: ReactNode;
|
|
22
22
|
rightElement?: ReactNode;
|
|
23
23
|
triggerElement: ReactNode;
|
|
24
|
+
"data-component"?: string;
|
|
25
|
+
"data-name"?: string;
|
|
24
26
|
}
|
|
25
27
|
export declare const _InputWithPopover: React.ForwardRefExoticComponent<InputWithPopoverProps<string> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -73,7 +73,7 @@ exports._InputWithPopover = (0, react_3.forwardRef)((props, ref) => {
|
|
|
73
73
|
});
|
|
74
74
|
const isInteractive = !props.isDisabled && !props.isReadOnly;
|
|
75
75
|
const showRemoveButton = Boolean(props.value && isInteractive && props.isClearable);
|
|
76
|
-
return (react_3.default.createElement(form_component_1.FormComponent, { className: rootClassName, errorId: error.errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
76
|
+
return (react_3.default.createElement(form_component_1.FormComponent, { className: rootClassName, "data-component": props["data-component"], "data-name": props["data-name"], errorId: error.errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
77
77
|
react_3.default.createElement(react_2.Popover, { as: react_3.Fragment }, (renderProps) => (react_3.default.createElement(react_3.default.Fragment, null,
|
|
78
78
|
react_3.default.createElement(input_1.Input, { inputFocus: input, inputGroupRef: floatingPopover.refs.setReference, ref: (0, compose_refs_1.composeRefs)(innerRef, ref), size: props.size, variant: props.variant },
|
|
79
79
|
props.leftAddon && react_3.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
@@ -11,4 +11,5 @@ export interface CheckboxInputProps extends FormControlProps<boolean | undefined
|
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
helperText?: ReactNode;
|
|
13
13
|
}
|
|
14
|
+
export declare const CHECKBOX_INPUT_COMPONENT_NAME = "checkboxInput";
|
|
14
15
|
export declare const CheckboxInput: React.ForwardRefExoticComponent<CheckboxInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -24,17 +24,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.CheckboxInput = void 0;
|
|
27
|
+
exports.CheckboxInput = exports.CHECKBOX_INPUT_COMPONENT_NAME = void 0;
|
|
28
28
|
const react_1 = require("@headlessui/react");
|
|
29
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
30
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
29
31
|
const checkbox_1 = require("@uxf/ui/checkbox");
|
|
30
32
|
const react_2 = __importStar(require("react"));
|
|
33
|
+
exports.CHECKBOX_INPUT_COMPONENT_NAME = "checkboxInput";
|
|
31
34
|
exports.CheckboxInput = (0, react_2.forwardRef)((props, ref) => {
|
|
32
|
-
var _a
|
|
35
|
+
var _a;
|
|
33
36
|
const generatedId = (0, react_2.useId)();
|
|
34
37
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
35
38
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
36
39
|
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
37
|
-
react_2.default.createElement("div", { className:
|
|
40
|
+
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-checkbox-input__wrapper", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className), "data-component": exports.CHECKBOX_INPUT_COMPONENT_NAME, "data-name": props.name, style: props.style },
|
|
38
41
|
react_2.default.createElement(react_1.Switch, { as: react_2.Fragment, checked: props.value, name: props.name, onChange: props.onChange }, ({ checked }) => (react_2.default.createElement(checkbox_1.Checkbox, { className: "uxf-checkbox-input", id: props.id, indeterminate: props.indeterminate, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, name: props.name, onChange: props.onChange, ref: ref, size: props.size, value: checked }))),
|
|
39
42
|
react_2.default.createElement(react_1.Switch.Label, { className: `uxf-checkbox-input__label ${props.hiddenLabel ? "uxf-checkbox-input__label--hidden" : ""}` },
|
|
40
43
|
react_2.default.createElement("span", { className: "uxf-checkbox-input__label--text" }, props.label),
|
package/combobox/combobox.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export interface ComboboxProps<Id = ComboboxValueId, Option = ComboboxOption<Id>
|
|
|
45
45
|
inputRef?: Ref<HTMLInputElement> | undefined;
|
|
46
46
|
inputWrapperRef?: Ref<ComboboxTypeRef> | undefined;
|
|
47
47
|
}
|
|
48
|
+
export declare const COMBOBOX_COMPONENT_NAME = "combobox";
|
|
48
49
|
export declare function Combobox<Id = ComboboxValueId, Option = ComboboxOption<Id>, Value = Option>(props: ComboboxProps<Id, Option, Value>): React.JSX.Element;
|
|
49
50
|
export declare namespace Combobox {
|
|
50
51
|
var displayName: string;
|
package/combobox/combobox.js
CHANGED
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.COMBOBOX_COMPONENT_NAME = void 0;
|
|
27
28
|
exports.Combobox = Combobox;
|
|
28
29
|
const react_1 = require("@floating-ui/react");
|
|
29
30
|
const react_2 = require("@headlessui/react");
|
|
@@ -59,6 +60,7 @@ function Options(props) {
|
|
|
59
60
|
})) : (react_3.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, props.emptyMessage))));
|
|
60
61
|
}
|
|
61
62
|
Options.displayName = "UxfUiComboboxOptions";
|
|
63
|
+
exports.COMBOBOX_COMPONENT_NAME = "combobox";
|
|
62
64
|
// eslint-disable-next-line complexity
|
|
63
65
|
function Combobox(props) {
|
|
64
66
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -86,7 +88,7 @@ function Combobox(props) {
|
|
|
86
88
|
const dropdown = (0, use_dropdown_1.useDropdown)((_h = props.dropdownPlacement) !== null && _h !== void 0 ? _h : "bottom", (_j = props.dropdownMatchesInputWidth) !== null && _j !== void 0 ? _j : true, props.dropdownMaxHeight, props.dropdownStrategy);
|
|
87
89
|
const stableRef = (0, react_3.useMemo)(() => (0, compose_refs_1.composeRefs)(innerRef, props.inputGroupRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.inputGroupRef]);
|
|
88
90
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
89
|
-
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component 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), "data-name": props.name, disabled: isNotInteractive, form: props.form, name: props.name, onChange: onChange, style: props.style, value: selectedOption }, (renderProps) => (react_3.default.createElement(react_3.default.Fragment, null,
|
|
91
|
+
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component 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), "data-component": exports.COMBOBOX_COMPONENT_NAME, "data-name": props.name, disabled: isNotInteractive, form: props.form, name: props.name, onChange: onChange, style: props.style, value: selectedOption }, (renderProps) => (react_3.default.createElement(react_3.default.Fragment, null,
|
|
90
92
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
91
93
|
react_3.default.createElement(react_2.Combobox.Label, { as: label_1.Label, isHidden: props.hiddenLabel, isRequired: props.isRequired, onClick: isNotInteractive ? undefined : input.focus }, props.label)),
|
|
92
94
|
react_3.default.createElement("div", { className: "uxf-form-component__input" },
|
|
@@ -20,4 +20,5 @@ export interface DatePickerInputProps extends Omit<InputWithPopoverProps<string
|
|
|
20
20
|
/** @deprecated */
|
|
21
21
|
unavailableDates?: Date[];
|
|
22
22
|
}
|
|
23
|
+
export declare const DATE_PICKER_INPUT_COMPONENT_NAME = "datePickerInput";
|
|
23
24
|
export declare const DatePickerInput: React.ForwardRefExoticComponent<DatePickerInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.DatePickerInput = exports.OUTPUT_DATE_FORMAT = exports.DISPLAY_DATE_FORMAT = exports.ALLOWED_DATE_FORMAT = void 0;
|
|
30
|
+
exports.DatePickerInput = exports.DATE_PICKER_INPUT_COMPONENT_NAME = exports.OUTPUT_DATE_FORMAT = exports.DISPLAY_DATE_FORMAT = exports.ALLOWED_DATE_FORMAT = void 0;
|
|
31
31
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
32
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
33
33
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
@@ -60,6 +60,7 @@ function getBoundaryDate(value) {
|
|
|
60
60
|
}
|
|
61
61
|
return undefined;
|
|
62
62
|
}
|
|
63
|
+
exports.DATE_PICKER_INPUT_COMPONENT_NAME = "datePickerInput";
|
|
63
64
|
exports.DatePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
64
65
|
var _a, _b, _c;
|
|
65
66
|
const onChange = props.onChange;
|
|
@@ -83,6 +84,6 @@ exports.DatePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
83
84
|
const selectedDate = getSelectedDate(props.value);
|
|
84
85
|
const parsedMinDate = getBoundaryDate(props.minDate);
|
|
85
86
|
const parsedMaxDate = getBoundaryDate(props.maxDate);
|
|
86
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_c = props.triggerElement) !== null && _c !== void 0 ? _c : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: value }, ({ close }) => (react_1.default.createElement(date_picker_1.DatePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, customButtonTitles: props.customButtonTitles, datesConfig: props.datesConfig, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onDatePickerChange, onMonthChange: props.onMonthChange, preventScroll: true, selectedDate: selectedDate, style: props.style, unavailableDates: props.unavailableDates }))));
|
|
87
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, "data-component": exports.DATE_PICKER_INPUT_COMPONENT_NAME, "data-name": props.name, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_c = props.triggerElement) !== null && _c !== void 0 ? _c : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: value }, ({ close }) => (react_1.default.createElement(date_picker_1.DatePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, customButtonTitles: props.customButtonTitles, datesConfig: props.datesConfig, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onDatePickerChange, onMonthChange: props.onMonthChange, preventScroll: true, selectedDate: selectedDate, style: props.style, unavailableDates: props.unavailableDates }))));
|
|
87
88
|
});
|
|
88
89
|
exports.DatePickerInput.displayName = "UxfUiDatePickerInput";
|
|
@@ -17,5 +17,6 @@ export interface DatetimePickerInputProps extends Omit<InputWithPopoverProps<str
|
|
|
17
17
|
bottomContent?: ReactNode;
|
|
18
18
|
CustomDatetimePicker?: (props: DatetimePickerProps) => ReactNode;
|
|
19
19
|
}
|
|
20
|
+
export declare const DATETIME_PICKER_INPUT_COMPONENT_NAME = "datetimePickerInput";
|
|
20
21
|
export declare const DatetimePickerInput: React.ForwardRefExoticComponent<DatetimePickerInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
22
|
export {};
|
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.DatetimePickerInput = exports.BOUNDARY_DATE_FORMAT = exports.DISPLAY_DATETIME_FORMAT = exports.ALLOWED_DATETIME_FORMAT = void 0;
|
|
30
|
+
exports.DatetimePickerInput = exports.DATETIME_PICKER_INPUT_COMPONENT_NAME = exports.BOUNDARY_DATE_FORMAT = exports.DISPLAY_DATETIME_FORMAT = exports.ALLOWED_DATETIME_FORMAT = void 0;
|
|
31
31
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
32
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
33
33
|
const dayjs_1 = __importStar(require("dayjs"));
|
|
@@ -64,6 +64,7 @@ function getBoundaryDate(value) {
|
|
|
64
64
|
}
|
|
65
65
|
return undefined;
|
|
66
66
|
}
|
|
67
|
+
exports.DATETIME_PICKER_INPUT_COMPONENT_NAME = "datetimePickerInput";
|
|
67
68
|
exports.DatetimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
68
69
|
var _a;
|
|
69
70
|
const onChange = props.onChange;
|
|
@@ -80,6 +81,6 @@ exports.DatetimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
80
81
|
const value = getValue(props.value); // hodnota zobrazená v textinputu (human readable)
|
|
81
82
|
const parsedMinDate = getBoundaryDate(props.minDate);
|
|
82
83
|
const parsedMaxDate = getBoundaryDate(props.maxDate);
|
|
83
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: value }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomDatetimePicker) ? (react_1.default.createElement(props.CustomDatetimePicker, { onChange: onChange, onClose: close, value: (0, get_datetime_string_1.getDatetimeString)(props.value) })) : (react_1.default.createElement(datetime_picker_1.DatetimePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onChange, unavailableDates: props.unavailableDates, value: props.value }))));
|
|
84
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, "data-component": exports.DATETIME_PICKER_INPUT_COMPONENT_NAME, "data-name": props.name, onChange: onInputChange, placeholder: props.placeholder, ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: value }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomDatetimePicker) ? (react_1.default.createElement(props.CustomDatetimePicker, { onChange: onChange, onClose: close, value: (0, get_datetime_string_1.getDatetimeString)(props.value) })) : (react_1.default.createElement(datetime_picker_1.DatetimePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onChange, unavailableDates: props.unavailableDates, value: props.value }))));
|
|
84
85
|
});
|
|
85
86
|
exports.DatetimePickerInput.displayName = "UxfUiDatePickerInput";
|
|
@@ -21,4 +21,5 @@ export interface DropzoneInputProps extends FormControlProps<DropzoneFile[] | un
|
|
|
21
21
|
onUploadError?: (err: unknown) => void;
|
|
22
22
|
style?: CSSProperties;
|
|
23
23
|
}
|
|
24
|
+
export declare const DROPZONE_COMPONENT_NAME = "dropzone";
|
|
24
25
|
export declare const DropzoneInput: React.ForwardRefExoticComponent<DropzoneInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.DropzoneInput = void 0;
|
|
27
|
+
exports.DropzoneInput = exports.DROPZONE_COMPONENT_NAME = void 0;
|
|
28
28
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
29
29
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
30
30
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
@@ -68,8 +68,9 @@ function fileRejectedHandler(err, dropzoneFile, onValuesChange, values, onUpload
|
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
|
+
exports.DROPZONE_COMPONENT_NAME = "dropzone";
|
|
71
72
|
exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
72
|
-
var _a, _b
|
|
73
|
+
var _a, _b;
|
|
73
74
|
const refValue = (0, react_1.useRef)();
|
|
74
75
|
refValue.current = props.value;
|
|
75
76
|
const handleFileDrop = async (acceptedFiles, inputRef) => {
|
|
@@ -129,12 +130,12 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
129
130
|
e.stopPropagation();
|
|
130
131
|
};
|
|
131
132
|
const dropzoneState = (0, get_dropzone_state_1.getDropzoneState)((_a = props.value) !== null && _a !== void 0 ? _a : []);
|
|
132
|
-
return (react_1.default.createElement("div", { className:
|
|
133
|
+
return (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-dropzone", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className), "data-component": exports.DROPZONE_COMPONENT_NAME, "data-name": props.name, "data-state": dropzoneState.status, style: props.style },
|
|
133
134
|
react_1.default.createElement("label", { ...getRootProps({
|
|
134
135
|
className: (0, cx_1.cx)("uxf-dropzone__label", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isNotClickable && "cursor-auto"),
|
|
135
136
|
onClick: labelOnCLick,
|
|
136
137
|
}), ref: (0, compose_refs_1.composeRefs)(ref, rootRef) },
|
|
137
|
-
react_1.default.createElement(icon_1.Icon, { className: "uxf-dropzone__label__icon", name: (
|
|
138
|
+
react_1.default.createElement(icon_1.Icon, { className: "uxf-dropzone__label__icon", name: (_b = props.icon) !== null && _b !== void 0 ? _b : "cloud" }),
|
|
138
139
|
typeof props.label === "string" ? react_1.default.createElement("span", null, props.label) : props.label,
|
|
139
140
|
react_1.default.createElement("input", { ...getInputProps({
|
|
140
141
|
className: "uxf-dropzone__input",
|
|
@@ -5,4 +5,5 @@ export interface FlashMessagesRef {
|
|
|
5
5
|
closeAll: () => void;
|
|
6
6
|
open: (notification: Notification) => void;
|
|
7
7
|
}
|
|
8
|
+
export declare const FLASH_MESSAGES_COMPONENT_NAME = "flashMessages";
|
|
8
9
|
export declare const FlashMessages: React.ForwardRefExoticComponent<React.RefAttributes<FlashMessagesRef>>;
|
|
@@ -23,12 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.FlashMessages = void 0;
|
|
26
|
+
exports.FlashMessages = exports.FLASH_MESSAGES_COMPONENT_NAME = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
28
|
const use_clickable_props_1 = require("@uxf/core-react/clickable/use-clickable-props");
|
|
29
29
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
30
30
|
const react_2 = __importStar(require("react"));
|
|
31
31
|
const flash_message_1 = require("./flash-message");
|
|
32
|
+
exports.FLASH_MESSAGES_COMPONENT_NAME = "flashMessages";
|
|
32
33
|
exports.FlashMessages = (0, react_2.forwardRef)((props, ref) => {
|
|
33
34
|
const [notifications, setNotifications] = (0, react_2.useState)([]);
|
|
34
35
|
const permanentNotificationsRef = (0, react_2.useRef)(null);
|
|
@@ -95,7 +96,7 @@ exports.FlashMessages = (0, react_2.forwardRef)((props, ref) => {
|
|
|
95
96
|
setIsCollapsed(true);
|
|
96
97
|
},
|
|
97
98
|
});
|
|
98
|
-
return notifications.length > 0 ? (react_2.default.createElement("div", { className: "uxf-flash-messages", style: { "--last-flash-message-height": `${lastToastHeight}px` } },
|
|
99
|
+
return notifications.length > 0 ? (react_2.default.createElement("div", { className: "uxf-flash-messages", "data-component": exports.FLASH_MESSAGES_COMPONENT_NAME, style: { "--last-flash-message-height": `${lastToastHeight}px` } },
|
|
99
100
|
dismissableNotifications.length > 0 && (react_2.default.createElement("div", { ref: dismissableContainerRef, ...clickableProps },
|
|
100
101
|
react_2.default.createElement("div", null, dismissableNotifications.map((notification, index) => {
|
|
101
102
|
const isLast = index === dismissableNotifications.length - 1;
|
|
@@ -8,63 +8,45 @@ const button_1 = require("@uxf/ui/button");
|
|
|
8
8
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const flash_messages_service_1 = require("./flash-messages-service");
|
|
11
|
-
// Random texts for flash message height testing
|
|
12
|
-
const randomTexts = [
|
|
13
|
-
"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa ex fuga neque. Delectus error, esse eum exercitationem iste iure maiores mollitia officia quasi reiciendis saepe voluptates voluptatum? Commodi, nulla, quo!",
|
|
14
|
-
"ulpa ex fuga neque. Delectus error",
|
|
15
|
-
"consectetur adipisicing elit. Culpa ex fuga neque. Delectus error, esse eum exercit",
|
|
16
|
-
];
|
|
17
11
|
function Default() {
|
|
18
12
|
return (react_1.default.createElement("div", { className: "inline-flex flex-col space-y-4" },
|
|
19
13
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
20
14
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
21
15
|
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
22
|
-
react_1.default.createElement("span", null, "
|
|
23
|
-
}) }, "
|
|
16
|
+
react_1.default.createElement("span", null, "Success message"))),
|
|
17
|
+
}) }, "Success"),
|
|
24
18
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
25
19
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
26
20
|
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
27
|
-
react_1.default.createElement("span", null, "
|
|
21
|
+
react_1.default.createElement("span", null, "Error message"))),
|
|
28
22
|
variant: "error",
|
|
29
|
-
}) }, "
|
|
23
|
+
}) }, "Error"),
|
|
30
24
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
31
25
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
32
26
|
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
33
|
-
react_1.default.createElement("span", null, "
|
|
27
|
+
react_1.default.createElement("span", null, "Info message"))),
|
|
34
28
|
variant: "info",
|
|
35
|
-
}) }, "
|
|
29
|
+
}) }, "Info"),
|
|
36
30
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
37
31
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
38
32
|
react_1.default.createElement(icon_1.Icon, { name: "xmarkLarge", size: 20 }),
|
|
39
|
-
react_1.default.createElement("span", null, "
|
|
33
|
+
react_1.default.createElement("span", null, "AutoDismiss error message"))),
|
|
40
34
|
autoDismiss: false,
|
|
41
35
|
variant: "error",
|
|
42
|
-
}) }, "AutoDismiss
|
|
36
|
+
}) }, "AutoDismiss Error"),
|
|
43
37
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
44
38
|
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
45
39
|
react_1.default.createElement(icon_1.Icon, { name: "clock", size: 20 }),
|
|
46
|
-
react_1.default.createElement("span", null, "
|
|
40
|
+
react_1.default.createElement("span", null, "Warning message"))),
|
|
47
41
|
autoDismiss: false,
|
|
48
42
|
variant: "warning",
|
|
49
|
-
}) }, "
|
|
43
|
+
}) }, "Warning"),
|
|
50
44
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
51
|
-
message:
|
|
52
|
-
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
53
|
-
react_1.default.createElement("span", null, "Just letting you know"))),
|
|
45
|
+
message: "Small info message",
|
|
54
46
|
autoDismiss: false,
|
|
55
47
|
variant: "info",
|
|
56
|
-
}) }, "
|
|
48
|
+
}) }, "Small info"),
|
|
57
49
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, flash_messages_service_1.flashMessage)({
|
|
58
|
-
message: "
|
|
59
|
-
|
|
60
|
-
variant: "info",
|
|
61
|
-
}) }, "Small flash message"),
|
|
62
|
-
react_1.default.createElement(button_1.Button, { onClick: () => {
|
|
63
|
-
const randomNumber = Math.floor(Math.random() * randomTexts.length);
|
|
64
|
-
return (0, flash_messages_service_1.flashMessage)({
|
|
65
|
-
message: (react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
66
|
-
react_1.default.createElement(icon_1.Icon, { name: "check", size: 20 }),
|
|
67
|
-
react_1.default.createElement("span", null, randomTexts[randomNumber]))),
|
|
68
|
-
});
|
|
69
|
-
} }, "Flash message, variant success, random text")));
|
|
50
|
+
message: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa ex fuga neque. Delectus error, esse eum exercitationem iste iure maiores mollitia officia quasi reiciendis saepe voluptates voluptatum? Commodi, nulla, quo!",
|
|
51
|
+
}) }, "Long text")));
|
|
70
52
|
}
|
|
@@ -31,7 +31,7 @@ const label_1 = require("../label");
|
|
|
31
31
|
exports.FormComponent = (0, react_1.forwardRef)((props, ref) => {
|
|
32
32
|
var _a;
|
|
33
33
|
const helperTextClassName = (0, cx_1.cx)("uxf-helper-text", props.errorId && classes_1.CLASSES.IS_INVALID);
|
|
34
|
-
return (react_1.default.createElement("div", { className: `uxf-form-component ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, "data-name": props.name, ref: ref },
|
|
34
|
+
return (react_1.default.createElement("div", { className: `uxf-form-component ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, "data-component": props["data-component"], "data-name": props.name, ref: ref },
|
|
35
35
|
react_1.default.createElement("div", { className: "uxf-form-component__label" },
|
|
36
36
|
react_1.default.createElement(label_1.Label, { form: props.form, htmlFor: props.inputId, isHidden: props.hiddenLabel, isRequired: props.isRequired }, props.label)),
|
|
37
37
|
react_1.default.createElement("div", { className: "uxf-form-component__input" },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MultiComboboxOption, MultiComboboxProps, MultiComboboxValueId } from "./types";
|
|
3
|
+
export declare const MULTI_COMBOBOX_COMPONENT_NAME = "multiCombobox";
|
|
3
4
|
export declare const MultiCombobox: React.ForwardRefExoticComponent<MultiComboboxProps<MultiComboboxValueId, MultiComboboxOption<MultiComboboxValueId>> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.MultiCombobox = void 0;
|
|
27
|
+
exports.MultiCombobox = exports.MULTI_COMBOBOX_COMPONENT_NAME = void 0;
|
|
28
28
|
const react_1 = require("@floating-ui/react");
|
|
29
29
|
const react_2 = require("@headlessui/react");
|
|
30
30
|
const show_1 = require("@uxf/core-react/components/show");
|
|
@@ -90,6 +90,7 @@ function useMultiComboboxOptions(query, props) {
|
|
|
90
90
|
filteredOptions,
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
+
exports.MULTI_COMBOBOX_COMPONENT_NAME = "multiCombobox";
|
|
93
94
|
exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
94
95
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
95
96
|
const t = (0, translations_1.useUxfTranslation)();
|
|
@@ -150,7 +151,7 @@ exports.MultiCombobox = (0, react_3.forwardRef)((props, ref) => {
|
|
|
150
151
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
151
152
|
};
|
|
152
153
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
153
|
-
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-multi-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), "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: changeHandler, style: props.style, value: selectedOptions }, (renderProps) => {
|
|
154
|
+
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-multi-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), "data-component": exports.MULTI_COMBOBOX_COMPONENT_NAME, "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: changeHandler, style: props.style, value: selectedOptions }, (renderProps) => {
|
|
154
155
|
var _a, _b;
|
|
155
156
|
return (react_3.default.createElement(react_3.default.Fragment, null,
|
|
156
157
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MultiSelectOption, MultiSelectProps, MultiSelectValueId } from "./types";
|
|
3
|
+
export declare const MULTI_SELECT_COMPONENT_NAME = "multiSelect";
|
|
3
4
|
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<MultiSelectValueId, MultiSelectOption<MultiSelectValueId>> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.MultiSelect = void 0;
|
|
27
|
+
exports.MultiSelect = exports.MULTI_SELECT_COMPONENT_NAME = void 0;
|
|
28
28
|
const react_1 = require("@floating-ui/react");
|
|
29
29
|
const react_2 = require("@headlessui/react");
|
|
30
30
|
const show_1 = require("@uxf/core-react/components/show");
|
|
@@ -72,6 +72,7 @@ function Options(props) {
|
|
|
72
72
|
})) : (react_3.default.createElement("div", { className: "uxf-dropdown__empty-wrapper" }, props.emptyMessage))));
|
|
73
73
|
}
|
|
74
74
|
Options.displayName = "UxfUiMultiSelectOptions";
|
|
75
|
+
exports.MULTI_SELECT_COMPONENT_NAME = "multiSelect";
|
|
75
76
|
exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
76
77
|
var _a, _b, _c, _d, _e, _f;
|
|
77
78
|
const t = (0, translations_1.useUxfTranslation)();
|
|
@@ -112,7 +113,7 @@ exports.MultiSelect = (0, react_3.forwardRef)((props, ref) => {
|
|
|
112
113
|
? ((_e = props.allOptionsSelectedMessage) !== null && _e !== void 0 ? _e : t("uxf-ui-multi-select:all-options-selected"))
|
|
113
114
|
: ((_f = props.noOptionsMessage) !== null && _f !== void 0 ? _f : t("uxf-ui-multi-select:no-options-message"));
|
|
114
115
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
115
|
-
return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-multi-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), "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: props.onChange, value: selectedOptions }, (renderProps) => {
|
|
116
|
+
return (react_3.default.createElement(react_2.Listbox, { as: "div", className: (0, cx_1.cx)("uxf-form-component uxf-multi-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), "data-component": exports.MULTI_SELECT_COMPONENT_NAME, "data-name": props.name, disabled: isNotInteractive, form: props.form, multiple: true, name: props.name, onChange: props.onChange, value: selectedOptions }, (renderProps) => {
|
|
116
117
|
var _a, _b;
|
|
117
118
|
return (react_3.default.createElement(react_3.default.Fragment, null,
|
|
118
119
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
package/package.json
CHANGED
|
@@ -20,4 +20,5 @@ export interface RadioGroupProps extends FormControlProps<RadioGroupOptionValueI
|
|
|
20
20
|
style?: CSSProperties;
|
|
21
21
|
variant?: RadioGroupVariant;
|
|
22
22
|
}
|
|
23
|
+
export declare const RADIO_GROUP_COMPONENT_NAME = "radioGroup";
|
|
23
24
|
export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLLabelElement>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.RadioGroup = void 0;
|
|
26
|
+
exports.RadioGroup = exports.RADIO_GROUP_COMPONENT_NAME = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
28
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
@@ -31,6 +31,7 @@ const radio_1 = require("@uxf/ui/radio");
|
|
|
31
31
|
const react_2 = __importStar(require("react"));
|
|
32
32
|
const use_input_submit_1 = require("../hooks/use-input-submit");
|
|
33
33
|
const label_1 = require("../label");
|
|
34
|
+
exports.RADIO_GROUP_COMPONENT_NAME = "radioGroup";
|
|
34
35
|
exports.RadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
35
36
|
var _a, _b;
|
|
36
37
|
const innerRef = (0, react_2.useRef)(null);
|
|
@@ -38,8 +39,8 @@ exports.RadioGroup = (0, react_2.forwardRef)((props, ref) => {
|
|
|
38
39
|
const errorId = props.isInvalid ? `${props.id}--errormessage` : undefined;
|
|
39
40
|
const variant = (_a = props.variant) !== null && _a !== void 0 ? _a : "list";
|
|
40
41
|
const radioSize = (_b = props.radioSize) !== null && _b !== void 0 ? _b : "default";
|
|
41
|
-
const rootClassName = (0, cx_1.cx)("uxf-form-component uxf-radio-group", `uxf-radio-group--${variant}`, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.className);
|
|
42
|
-
return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, "data-name": props.name, disabled: props.isDisabled, id: props.id, onChange: props.onChange, style: props.style, value: props.value },
|
|
42
|
+
const rootClassName = (0, cx_1.cx)("uxf-form-component uxf-radio-group", `uxf-radio-group--${variant}`, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
43
|
+
return (react_2.default.createElement(react_1.RadioGroup, { className: rootClassName, "data-component": exports.RADIO_GROUP_COMPONENT_NAME, "data-name": props.name, disabled: props.isDisabled, id: props.id, onChange: props.onChange, style: props.style, value: props.value },
|
|
43
44
|
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
44
45
|
react_2.default.createElement(react_1.RadioGroup.Label, { as: label_1.Label, className: "uxf-radio-group__label", isHidden: props.hiddenLabel, isRequired: props.isRequired, ref: ref }, props.label)),
|
|
45
46
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
package/select/select.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface SelectProps<Value = SelectValue, Option = SelectOption<Value>>
|
|
|
41
41
|
inputRef?: Ref<HTMLButtonElement> | undefined;
|
|
42
42
|
inputWrapperRef?: Ref<SelectTypeRef> | undefined;
|
|
43
43
|
}
|
|
44
|
+
export declare const SELECT_COMPONENT_NAME = "select";
|
|
44
45
|
export declare function Select<Value = SelectValue, Option = SelectOption<Value>>(props: SelectProps<Value, Option>): React.JSX.Element;
|
|
45
46
|
export declare namespace Select {
|
|
46
47
|
var displayName: string;
|
package/select/select.js
CHANGED
|
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SELECT_COMPONENT_NAME = void 0;
|
|
27
28
|
exports.Select = Select;
|
|
28
29
|
const react_1 = require("@floating-ui/react");
|
|
29
30
|
const react_2 = require("@headlessui/react");
|
|
@@ -61,6 +62,7 @@ const SelectedValue = (0, react_3.forwardRef)((props, ref) => {
|
|
|
61
62
|
react_3.default.createElement("span", { className: "uxf-input__element-text" }, props.children)));
|
|
62
63
|
});
|
|
63
64
|
SelectedValue.displayName = "UxUiSelectSelectedValue";
|
|
65
|
+
exports.SELECT_COMPONENT_NAME = "select";
|
|
64
66
|
function Select(props) {
|
|
65
67
|
var _a, _b, _c, _d, _e;
|
|
66
68
|
const t = (0, translations_1.useUxfTranslation)();
|
|
@@ -76,7 +78,7 @@ function Select(props) {
|
|
|
76
78
|
const value = selectedOption;
|
|
77
79
|
const emptyMessage = (_e = props.noOptionsMessage) !== null && _e !== void 0 ? _e : t("uxf-ui-select:no-options-message");
|
|
78
80
|
const isNotInteractive = props.isDisabled || props.isReadOnly;
|
|
79
|
-
return (react_3.default.createElement(react_2.Listbox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component 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), "data-name": props.name, disabled: isNotInteractive, form: props.form, name: props.name, onChange: onChange, style: props.style, value: value }, (renderProps) => {
|
|
81
|
+
return (react_3.default.createElement(react_2.Listbox, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component 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), "data-component": exports.SELECT_COMPONENT_NAME, "data-name": props.name, disabled: isNotInteractive, form: props.form, name: props.name, onChange: onChange, style: props.style, value: value }, (renderProps) => {
|
|
80
82
|
var _a, _b, _c;
|
|
81
83
|
return (react_3.default.createElement(react_3.default.Fragment, null,
|
|
82
84
|
react_3.default.createElement("div", { className: "uxf-form-component__label" },
|
|
@@ -29,5 +29,6 @@ export interface TextInputProps extends FormControlProps<string>, Pick<InputProp
|
|
|
29
29
|
step?: number | string;
|
|
30
30
|
style?: CSSProperties;
|
|
31
31
|
}
|
|
32
|
+
export declare const TEXT_INPUT_COMPONENT_NAME = "textInput";
|
|
32
33
|
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
33
34
|
export {};
|
package/text-input/text-input.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.TextInput = void 0;
|
|
27
|
+
exports.TextInput = exports.TEXT_INPUT_COMPONENT_NAME = void 0;
|
|
28
28
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
29
29
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
30
30
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
@@ -32,6 +32,7 @@ const cx_1 = require("@uxf/core/utils/cx");
|
|
|
32
32
|
const input_1 = require("@uxf/ui/input");
|
|
33
33
|
const react_1 = __importStar(require("react"));
|
|
34
34
|
const form_component_1 = require("../form-component");
|
|
35
|
+
exports.TEXT_INPUT_COMPONENT_NAME = "textInput";
|
|
35
36
|
exports.TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
36
37
|
var _a, _b;
|
|
37
38
|
const innerRef = (0, react_1.useRef)(null);
|
|
@@ -40,7 +41,7 @@ exports.TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
40
41
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
41
42
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
42
43
|
const rootClassName = (0, cx_1.cx)("uxf-text-input", ((_b = props.isFocused) !== null && _b !== void 0 ? _b : input.focused) && classes_1.CLASSES.IS_FOCUSED, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className);
|
|
43
|
-
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
44
|
+
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, "data-component": exports.TEXT_INPUT_COMPONENT_NAME, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
44
45
|
react_1.default.createElement(input_1.Input, { inputFocus: input, ref: (0, compose_refs_1.composeRefs)(innerRef, ref), size: props.size, style: props.style, variant: props.variant },
|
|
45
46
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
46
47
|
props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export interface TextareaProps extends FormControlProps<string, HTMLTextAreaElem
|
|
|
15
15
|
rows?: number;
|
|
16
16
|
style?: CSSProperties;
|
|
17
17
|
}
|
|
18
|
+
export declare const TEXTAREA_COMPONENT_NAME = "textarea";
|
|
18
19
|
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
package/textarea/textarea.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.Textarea = void 0;
|
|
27
|
+
exports.Textarea = exports.TEXTAREA_COMPONENT_NAME = void 0;
|
|
28
28
|
const use_input_focus_1 = require("@uxf/core-react/hooks/use-input-focus");
|
|
29
29
|
const use_isomorphic_layout_effect_1 = require("@uxf/core-react/hooks/use-isomorphic-layout-effect");
|
|
30
30
|
const compose_refs_1 = require("@uxf/core-react/utils/compose-refs");
|
|
@@ -33,6 +33,7 @@ const adjust_textarea_height_1 = require("@uxf/core/utils/adjust-textarea-height
|
|
|
33
33
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
34
34
|
const react_1 = __importStar(require("react"));
|
|
35
35
|
const form_component_1 = require("../form-component");
|
|
36
|
+
exports.TEXTAREA_COMPONENT_NAME = "textarea";
|
|
36
37
|
exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
|
|
37
38
|
var _a, _b, _c;
|
|
38
39
|
const innerRef = (0, react_1.useRef)(null);
|
|
@@ -52,7 +53,7 @@ exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
|
|
|
52
53
|
const cleanup = (0, adjust_textarea_height_1.adjustTextareaHeight)(node, rows);
|
|
53
54
|
return () => cleanup();
|
|
54
55
|
}, [props.disableAutoHeight, rows]);
|
|
55
|
-
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
56
|
+
return (react_1.default.createElement(form_component_1.FormComponent, { className: rootClassName, "data-component": exports.TEXTAREA_COMPONENT_NAME, errorId: errorId, form: props.form, helperText: props.helperText, hiddenLabel: props.hiddenLabel, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
56
57
|
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: focusTextareaOnWrapperClick, style: props.style },
|
|
57
58
|
react_1.default.createElement("textarea", { "aria-describedby": errorId, "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, className: (0, cx_1.cx)("uxf-textarea__element", !props.disableAutoHeight && rows >= 1 && "uxf-textarea__element--is-auto-height-enabled"), disabled: props.isDisabled, form: props.form, id: id, maxLength: props.maxLength, minLength: props.minLength, name: props.name, onBlur: input.onBlur, onChange: handleChange, onFocus: input.onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: (0, compose_refs_1.composeRefs)(innerRef, ref), required: props.isRequired, rows: rows, value: props.value }))));
|
|
58
59
|
});
|
package/toggle/toggle.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export interface ToggleProps extends FormControlProps<boolean | undefined> {
|
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
variant?: ToggleVariant;
|
|
12
12
|
}
|
|
13
|
+
export declare const TOGGLE_COMPONENT_NAME = "toggle";
|
|
13
14
|
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
package/toggle/toggle.js
CHANGED
|
@@ -23,15 +23,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Toggle = void 0;
|
|
26
|
+
exports.Toggle = exports.TOGGLE_COMPONENT_NAME = void 0;
|
|
27
27
|
const react_1 = require("@headlessui/react");
|
|
28
28
|
const classes_1 = require("@uxf/core/constants/classes");
|
|
29
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
30
|
const react_2 = __importStar(require("react"));
|
|
31
|
+
exports.TOGGLE_COMPONENT_NAME = "toggle";
|
|
31
32
|
exports.Toggle = (0, react_2.forwardRef)((props, ref) => {
|
|
32
33
|
var _a, _b, _c, _d;
|
|
33
34
|
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
34
|
-
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, `uxf-toggle__wrapper--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.className), "data-name": props.name },
|
|
35
|
+
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, `uxf-toggle__wrapper--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.className), "data-component": exports.TOGGLE_COMPONENT_NAME, "data-name": props.name },
|
|
35
36
|
react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED, "uxf-toggle", `uxf-toggle--${(_c = props.variant) !== null && _c !== void 0 ? _c : "default"}`, `uxf-toggle--size-${(_d = props.size) !== null && _d !== void 0 ? _d : "default"}`), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
|
|
36
37
|
react_2.default.createElement("span", { className: "uxf-toggle__inner" })),
|
|
37
38
|
react_2.default.createElement(react_1.Switch.Label, { className: "uxf-toggle__label", hidden: props.hiddenLabel }, props.label))));
|