@uxf/ui 11.11.2 → 11.11.3
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/_select-base/_select-base.d.ts +2 -1
- package/_select-base/_select-base.js +1 -1
- package/calendar/calendar.d.ts +1 -1
- package/checkbox-input/checkbox-input.js +2 -2
- package/combobox/combobox.js +1 -1
- package/date-picker/date-picker-content.d.ts +2 -1
- package/date-picker/date-picker-content.js +2 -2
- package/date-picker/date-picker.d.ts +2 -1
- package/date-picker/date-picker.js +1 -1
- package/date-picker-input/date-picker-input.d.ts +2 -1
- package/date-picker-input/date-picker-input.js +1 -1
- package/date-range-picker/date-range-picker-content.d.ts +2 -1
- package/date-range-picker/date-range-picker-content.js +2 -2
- package/date-range-picker/date-range-picker.d.ts +2 -1
- package/date-range-picker/date-range-picker.js +1 -1
- package/date-range-picker-input/date-range-picker-input.d.ts +2 -1
- package/date-range-picker-input/date-range-picker-input.js +1 -1
- package/dropzone/dropzone-input.d.ts +2 -1
- package/dropzone/dropzone-input.js +1 -1
- package/dropzone/dropzone-list.d.ts +3 -1
- package/dropzone/dropzone-list.js +2 -2
- package/input/input-element.d.ts +2 -1
- package/input/input-element.js +1 -1
- package/input/input.d.ts +2 -1
- package/input/input.js +1 -1
- package/multi-combobox/_multi-combobox-base.js +1 -1
- package/multi-combobox/multi-combobox.js +1 -1
- package/multi-combobox/types.d.ts +2 -1
- package/multi-select/multi-select.js +1 -1
- package/multi-select/types.d.ts +2 -1
- package/package.json +5 -5
- package/select/select.js +1 -1
- package/text-input/text-input.d.ts +2 -1
- package/text-input/text-input.js +1 -1
- package/textarea/textarea.d.ts +2 -1
- package/textarea/textarea.js +1 -1
|
@@ -3,7 +3,7 @@ import type { Combobox as HUICombobox, Listbox as HUIListbox } from "@headlessui
|
|
|
3
3
|
import { IconsSet } from "@uxf/ui/icon/theme";
|
|
4
4
|
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
5
5
|
import { Clearable, FormControlProps } from "@uxf/ui/types";
|
|
6
|
-
import React, { ReactElement, ReactNode, Ref } from "react";
|
|
6
|
+
import React, { CSSProperties, ReactElement, ReactNode, Ref } from "react";
|
|
7
7
|
export type SelectBaseValueId = number | string;
|
|
8
8
|
export type SelectBaseValue<ValueId = SelectBaseValueId> = {
|
|
9
9
|
id: ValueId;
|
|
@@ -33,6 +33,7 @@ export interface SelectBaseProps<Value, Option> extends FormControlProps<Value |
|
|
|
33
33
|
placeholder?: string;
|
|
34
34
|
renderOption?: (option: Option, isSelected: boolean) => ReactNode;
|
|
35
35
|
size?: keyof InputGroupSizes;
|
|
36
|
+
style?: CSSProperties;
|
|
36
37
|
variant?: keyof InputGroupVariants;
|
|
37
38
|
leftAddon?: ReactNode;
|
|
38
39
|
leftElement?: ReactNode;
|
|
@@ -82,7 +82,7 @@ const _SelectBase = (props) => {
|
|
|
82
82
|
const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", (_c = props.dropdownMatchesInputWidth) !== null && _c !== void 0 ? _c : true, props.dropdownStrategy);
|
|
83
83
|
const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, props.forwardRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.forwardRef]);
|
|
84
84
|
const HUIComponent = props.HUIComponent;
|
|
85
|
-
return (react_2.default.createElement(HUIComponent, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", 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-testid": id, disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
85
|
+
return (react_2.default.createElement(HUIComponent, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", 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-testid": id, disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, style: props.style, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
86
86
|
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
87
87
|
react_2.default.createElement(HUIComponent.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
88
88
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
package/calendar/calendar.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { UseDatePickerReturnType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
|
2
2
|
import { UseDateRangePickerReturnType } from "@uxf/datepicker/hooks/use-date-range-picker";
|
|
3
3
|
import React from "react";
|
|
4
4
|
export interface CalendarProps {
|
|
5
|
-
datePickerProps: UseDatePickerReturnType | UseDateRangePickerReturnType;
|
|
6
5
|
className?: string;
|
|
6
|
+
datePickerProps: UseDatePickerReturnType | UseDateRangePickerReturnType;
|
|
7
7
|
month?: number;
|
|
8
8
|
onChange?: (data: Date | null) => void;
|
|
9
9
|
selectedDate?: Date | null;
|
|
@@ -33,8 +33,8 @@ exports.CheckboxInput = (0, react_2.forwardRef)((props, ref) => {
|
|
|
33
33
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : generatedId;
|
|
34
34
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
35
35
|
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
36
|
-
react_2.default.createElement("div", { className: `uxf-checkbox-input__wrapper ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}
|
|
37
|
-
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, onChange: props.onChange, ref: ref, size: props.size,
|
|
36
|
+
react_2.default.createElement("div", { className: `uxf-checkbox-input__wrapper ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
|
|
37
|
+
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, onChange: props.onChange, ref: ref, size: props.size, value: checked, name: props.name }))),
|
|
38
38
|
react_2.default.createElement(react_1.Switch.Label, { className: `uxf-checkbox-input__label ${props.hiddenLabel ? "uxf-checkbox-input__label--hidden" : ""}` },
|
|
39
39
|
react_2.default.createElement("span", { className: "uxf-checkbox-input__label--text" }, props.label),
|
|
40
40
|
react_2.default.createElement("span", { id: errorId, className: "uxf-checkbox-input__label--subtitle" }, props.helperText)))));
|
package/combobox/combobox.js
CHANGED
|
@@ -43,7 +43,7 @@ const Combobox = (props) => {
|
|
|
43
43
|
const onInputChange = (event) => setQuery(event.target.value);
|
|
44
44
|
const displayValue = (item) => { var _a; return (_a = item === null || item === void 0 ? void 0 : item.label) !== null && _a !== void 0 ? _a : ""; };
|
|
45
45
|
const selectedOption = (_d = props.value) !== null && _d !== void 0 ? _d : null;
|
|
46
|
-
return (react_2.default.createElement(_select_base_1._SelectBase, { HUIComponent: react_1.Combobox, className: props.className, customInputElementDisplayName: react_1.Combobox.Input.displayName, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, emptyMessage: emptyMessage, forwardRef: props.forwardRef, helperText: props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: props.id, isClearable: props.isClearable, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onOptionsUnmount: clearQuery, options: filteredData, placeholder: props.placeholder, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, value: selectedOption, variant: props.variant },
|
|
46
|
+
return (react_2.default.createElement(_select_base_1._SelectBase, { HUIComponent: react_1.Combobox, className: props.className, customInputElementDisplayName: react_1.Combobox.Input.displayName, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, emptyMessage: emptyMessage, forwardRef: props.forwardRef, helperText: props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: props.id, isClearable: props.isClearable, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onOptionsUnmount: clearQuery, options: filteredData, placeholder: props.placeholder, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, value: selectedOption, variant: props.variant },
|
|
47
47
|
react_2.default.createElement(react_1.Combobox.Input, { autoComplete: "off", className: "uxf-input__element", displayValue: displayValue, onBlur: props.onBlur, onChange: onInputChange, placeholder: props.placeholder, type: "text" })));
|
|
48
48
|
};
|
|
49
49
|
exports.Combobox = Combobox;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
1
|
+
import { CSSProperties, FC, PropsWithChildren, ReactNode } from "react";
|
|
2
2
|
export interface DatePickerContentProps {
|
|
3
3
|
bottomContent?: ReactNode;
|
|
4
|
+
style?: CSSProperties;
|
|
4
5
|
}
|
|
5
6
|
export declare const DatePickerContent: FC<PropsWithChildren<DatePickerContentProps>>;
|
|
@@ -46,8 +46,8 @@ const DatePickerContent = (props) => {
|
|
|
46
46
|
month: activeMonths.map((month) => (react_1.default.createElement(date_picker_month_1.DatePickerMonth, { key: `${month.year}-${month.month}`, setViewMode: setViewMode }))),
|
|
47
47
|
year: react_1.default.createElement(date_picker_year_1.DatePickerYear, { onMonthSelect: (date) => onMonthSelect(date), onYearSelect: onYearSelect }),
|
|
48
48
|
decade: react_1.default.createElement(date_picker_decade_1.DatePickerDecade, { onYearSelect: (date) => onDecadeYearSelect(date) }),
|
|
49
|
-
}), [
|
|
50
|
-
return (react_1.default.createElement("div", { className: "uxf-date-picker" },
|
|
49
|
+
}), [activeMonths, onYearSelect, onMonthSelect, onDecadeYearSelect]);
|
|
50
|
+
return (react_1.default.createElement("div", { className: "uxf-date-picker", style: props.style },
|
|
51
51
|
props.children,
|
|
52
52
|
datePickerComponents[viewMode],
|
|
53
53
|
props.bottomContent && react_1.default.createElement("div", { className: "uxf-date-picker__bottom-content" }, props.bottomContent)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnDateChangeType } from "@uxf/datepicker/hooks/use-date-picker";
|
|
2
2
|
import { DatesConfig } from "@uxf/datepicker/utils/types";
|
|
3
|
-
import { FC, ReactNode } from "react";
|
|
3
|
+
import { CSSProperties, FC, ReactNode } from "react";
|
|
4
4
|
export interface DatePickerProps {
|
|
5
5
|
bottomContent?: ReactNode;
|
|
6
6
|
closePopoverHandler?: () => void;
|
|
@@ -10,6 +10,7 @@ export interface DatePickerProps {
|
|
|
10
10
|
onChange: (data: OnDateChangeType) => void;
|
|
11
11
|
preventScroll?: boolean;
|
|
12
12
|
selectedDate: Date | null;
|
|
13
|
+
style?: CSSProperties;
|
|
13
14
|
/** @deprecated */
|
|
14
15
|
unavailableDates?: Date[];
|
|
15
16
|
}
|
|
@@ -24,7 +24,7 @@ const DatePicker = (props) => {
|
|
|
24
24
|
unavailableDates: props.unavailableDates,
|
|
25
25
|
});
|
|
26
26
|
return (react_1.default.createElement(date_picker_context_1.DatePickerContext.Provider, { value: datePickerProps },
|
|
27
|
-
react_1.default.createElement(date_picker_content_1.DatePickerContent, { bottomContent: props.bottomContent })));
|
|
27
|
+
react_1.default.createElement(date_picker_content_1.DatePickerContent, { bottomContent: props.bottomContent, style: props.style })));
|
|
28
28
|
};
|
|
29
29
|
exports.DatePicker = DatePicker;
|
|
30
30
|
exports.DatePicker.displayName = "UxfUiDatePicker";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatesConfig } from "@uxf/datepicker/utils/types";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
2
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
3
3
|
import { InputWithPopoverProps } from "../_input-with-popover";
|
|
4
4
|
export declare const ALLOWED_DATE_FORMAT: string[];
|
|
5
5
|
export declare const DISPLAY_DATE_FORMAT = "D. M. YYYY";
|
|
@@ -12,6 +12,7 @@ export interface DatePickerInputProps extends Omit<InputWithPopoverProps<string
|
|
|
12
12
|
maxDate?: string;
|
|
13
13
|
minDate?: string;
|
|
14
14
|
placeholder?: string;
|
|
15
|
+
style?: CSSProperties;
|
|
15
16
|
triggerElement?: ReactNode;
|
|
16
17
|
/** @deprecated */
|
|
17
18
|
unavailableDates?: Date[];
|
|
@@ -82,6 +82,6 @@ exports.DatePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
82
82
|
const selectedDate = getSelectedDate(props.value);
|
|
83
83
|
const parsedMinDate = getBoundaryDate(props.minDate);
|
|
84
84
|
const parsedMaxDate = getBoundaryDate(props.maxDate);
|
|
85
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : (0, dayjs_1.default)().format(displayDateFormat), ref: ref, value: value, triggerElement: (_d = props.triggerElement) !== null && _d !== void 0 ? _d : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }) }, ({ close }) => (react_1.default.createElement(date_picker_1.DatePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, datesConfig: props.datesConfig, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onDatePickerChange, preventScroll: true, selectedDate: selectedDate, unavailableDates: props.unavailableDates }))));
|
|
85
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : (0, dayjs_1.default)().format(displayDateFormat), ref: ref, value: value, triggerElement: (_d = props.triggerElement) !== null && _d !== void 0 ? _d : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }) }, ({ close }) => (react_1.default.createElement(date_picker_1.DatePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, datesConfig: props.datesConfig, maxDate: parsedMaxDate, minDate: parsedMinDate, onChange: onDatePickerChange, preventScroll: true, selectedDate: selectedDate, style: props.style, unavailableDates: props.unavailableDates }))));
|
|
86
86
|
});
|
|
87
87
|
exports.DatePickerInput.displayName = "UxfUiDatePickerInput";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
1
|
+
import { CSSProperties, FC, PropsWithChildren, ReactNode } from "react";
|
|
2
2
|
export interface DateRangePickerContentProps {
|
|
3
3
|
bottomContent?: ReactNode;
|
|
4
|
+
style?: CSSProperties;
|
|
4
5
|
}
|
|
5
6
|
export declare const DateRangePickerContent: FC<PropsWithChildren<DateRangePickerContentProps>>;
|
|
@@ -46,8 +46,8 @@ const DateRangePickerContent = (props) => {
|
|
|
46
46
|
month: (react_1.default.createElement("div", { className: "uxf-date-range-picker__months" }, activeMonths.map((activeMonth) => (react_1.default.createElement(date_range_picker_month_1.DateRangePickerMonth, { key: `${activeMonth.year}-${activeMonth.month}`, month: activeMonth.month, setViewMode: setViewMode, year: activeMonth.year }))))),
|
|
47
47
|
year: react_1.default.createElement(date_range_picker_year_1.DateRangePickerYear, { onMonthSelect: (date) => onMonthSelect(date), onYearSelect: onYearSelect }),
|
|
48
48
|
decade: react_1.default.createElement(date_range_picker_decade_1.DateRangePickerDecade, { onYearSelect: (date) => onDecadeYearSelect(date) }),
|
|
49
|
-
}), [
|
|
50
|
-
return (react_1.default.createElement("div", { className: `uxf-date-range-picker ${activeMonths.length > 1 ? "uxf-date-range-picker--multi-month" : ""}
|
|
49
|
+
}), [activeMonths, onYearSelect, onMonthSelect, onDecadeYearSelect]);
|
|
50
|
+
return (react_1.default.createElement("div", { className: `uxf-date-range-picker ${activeMonths.length > 1 ? "uxf-date-range-picker--multi-month" : ""}`, style: props.style },
|
|
51
51
|
props.children,
|
|
52
52
|
datePickerComponents[viewMode],
|
|
53
53
|
props.bottomContent && react_1.default.createElement("div", { className: "uxf-date-range-picker__bottom-content" }, props.bottomContent)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatesConfig } from "@uxf/datepicker/utils/types";
|
|
2
|
-
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
2
|
+
import { CSSProperties, FC, PropsWithChildren, ReactNode } from "react";
|
|
3
3
|
import { DateRangePickerValueType } from "./types";
|
|
4
4
|
export interface DateRangePickerProps {
|
|
5
5
|
bottomContent?: ReactNode;
|
|
@@ -8,6 +8,7 @@ export interface DateRangePickerProps {
|
|
|
8
8
|
numberOfMonths?: number;
|
|
9
9
|
onChange: (data: DateRangePickerValueType) => void;
|
|
10
10
|
selectedDates: DateRangePickerValueType;
|
|
11
|
+
style?: CSSProperties;
|
|
11
12
|
/** @deprecated */
|
|
12
13
|
unavailableDates?: Date[];
|
|
13
14
|
}
|
|
@@ -46,7 +46,7 @@ const DateRangePicker = (props) => {
|
|
|
46
46
|
unavailableDates: props.unavailableDates,
|
|
47
47
|
});
|
|
48
48
|
return (react_1.default.createElement(date_range_picker_context_1.DateRangePickerContext.Provider, { value: dateRangePickerProps },
|
|
49
|
-
react_1.default.createElement(date_range_picker_content_1.DateRangePickerContent, { bottomContent: props.bottomContent })));
|
|
49
|
+
react_1.default.createElement(date_range_picker_content_1.DateRangePickerContent, { bottomContent: props.bottomContent, style: props.style })));
|
|
50
50
|
};
|
|
51
51
|
exports.DateRangePicker = DateRangePicker;
|
|
52
52
|
exports.DateRangePicker.displayName = "UxfUiDatePicker";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatesConfig } from "@uxf/datepicker/utils/types";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
2
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
3
3
|
import { InputWithPopoverProps } from "../_input-with-popover";
|
|
4
4
|
export declare const ALLOWED_DATE_FORMAT: string[];
|
|
5
5
|
export declare const DISPLAY_DATE_FORMAT = "D. M. YYYY";
|
|
@@ -13,6 +13,7 @@ export interface DateRangePickerInputProps extends Omit<InputWithPopoverProps<st
|
|
|
13
13
|
datesConfig?: DatesConfig[];
|
|
14
14
|
numberOfMonths?: number;
|
|
15
15
|
placeholder?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
16
17
|
triggerElement?: ReactNode;
|
|
17
18
|
/** @deprecated */
|
|
18
19
|
unavailableDates?: Date[];
|
|
@@ -57,6 +57,6 @@ exports.DateRangePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
57
57
|
const selectedDates = props.value
|
|
58
58
|
? { from: parsedFrom.isValid() ? parsedFrom.toDate() : null, to: parsedTo.isValid() ? parsedTo.toDate() : null }
|
|
59
59
|
: null;
|
|
60
|
-
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...restProps, placeholder: props.placeholder || "Vyberte datum...", ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: (_b = props.value) !== null && _b !== void 0 ? _b : "" }, ({ close }) => (react_1.default.createElement(date_range_picker_1.DateRangePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, datesConfig: props.datesConfig, numberOfMonths: numberOfMonths, onChange: onDatePickerChange, selectedDates: selectedDates, unavailableDates: props.unavailableDates }))));
|
|
60
|
+
return (react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...restProps, placeholder: props.placeholder || "Vyberte datum...", ref: ref, triggerElement: (_a = props.triggerElement) !== null && _a !== void 0 ? _a : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }), value: (_b = props.value) !== null && _b !== void 0 ? _b : "" }, ({ close }) => (react_1.default.createElement(date_range_picker_1.DateRangePicker, { bottomContent: props.bottomContent, closePopoverHandler: close, datesConfig: props.datesConfig, numberOfMonths: numberOfMonths, onChange: onDatePickerChange, selectedDates: selectedDates, style: props.style, unavailableDates: props.unavailableDates }))));
|
|
61
61
|
});
|
|
62
62
|
exports.DateRangePickerInput.displayName = "UxfUiDatePickerInput";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileResponse, FormControlProps, UploadOptions } from "@uxf/ui/types";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
2
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
3
3
|
import { IconName } from "../icon/types";
|
|
4
4
|
import { Accept, DropzoneFile } from "./types";
|
|
5
5
|
export interface DropzoneInputProps extends FormControlProps<DropzoneFile[] | undefined> {
|
|
@@ -16,5 +16,6 @@ export interface DropzoneInputProps extends FormControlProps<DropzoneFile[] | un
|
|
|
16
16
|
noDrag?: boolean;
|
|
17
17
|
onUploadError?: (err: unknown) => void;
|
|
18
18
|
onUploadFile: (file: File, options?: UploadOptions) => Promise<FileResponse>;
|
|
19
|
+
style?: CSSProperties;
|
|
19
20
|
}
|
|
20
21
|
export declare const DropzoneInput: React.ForwardRefExoticComponent<DropzoneInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -125,7 +125,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
125
125
|
const labelOnCLick = (e) => {
|
|
126
126
|
e.stopPropagation();
|
|
127
127
|
};
|
|
128
|
-
return (react_1.default.createElement("div", { className: `uxf-dropzone ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}
|
|
128
|
+
return (react_1.default.createElement("div", { className: `uxf-dropzone ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
129
129
|
react_1.default.createElement("label", { ...getRootProps({
|
|
130
130
|
className: (0, cx_1.cx)("uxf-dropzone__label", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.noClick && "cursor-auto"),
|
|
131
131
|
onClick: labelOnCLick,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { FormControlProps } from "@uxf/ui/types";
|
|
2
|
-
import { FC, ReactNode } from "react";
|
|
2
|
+
import { CSSProperties, FC, ReactNode } from "react";
|
|
3
3
|
import { DropzoneFile } from "./types";
|
|
4
4
|
export interface DropzoneListProps extends FormControlProps<DropzoneFile[] | undefined> {
|
|
5
5
|
className?: string;
|
|
6
6
|
errorText?: string;
|
|
7
|
+
isDownloadableOnClick?: boolean;
|
|
7
8
|
onRemoveConfirm?: (file: DropzoneFile) => Promise<boolean>;
|
|
8
9
|
renderItem?: (file: DropzoneFile) => ReactNode;
|
|
10
|
+
style?: CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
export declare const DropzoneList: FC<DropzoneListProps>;
|
|
@@ -65,14 +65,14 @@ const DropzoneList = (props) => {
|
|
|
65
65
|
if (((_a = props.value) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
return (react_1.default.createElement("ul", { className: `uxf-dropzone-list ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}
|
|
68
|
+
return (react_1.default.createElement("ul", { className: `uxf-dropzone-list ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style }, (_c = props.value) === null || _c === void 0 ? void 0 : _c.map((file) => {
|
|
69
69
|
var _a, _b, _c;
|
|
70
70
|
const isUploading = file.id < 0 && !file.error;
|
|
71
71
|
return ((_b = (_a = props.renderItem) === null || _a === void 0 ? void 0 : _a.call(props, file)) !== null && _b !== void 0 ? _b : (react_1.default.createElement("li", { className: "uxf-dropzone-list__item-wrapper", key: file.id },
|
|
72
72
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-dropzone-list__item", !!file.error && classes_1.CLASSES.IS_INVALID) },
|
|
73
73
|
react_1.default.createElement("div", { className: "uxf-dropzone-list__item__block" },
|
|
74
74
|
react_1.default.createElement(icon_1.Icon, { className: "uxf-dropzone-list__item__block__icon", name: (0, get_file_icon_1.getIconNameFromFileExtension)(file.extension.toLowerCase()) }),
|
|
75
|
-
(context === null || context === void 0 ? void 0 : context.domain) && file.id > 0 ? (react_1.default.createElement("a", { className: "uxf-dropzone-list__item__block__file-name-link", href: (0, get_file_url_1.getFileUrl)(context.domain, file),
|
|
75
|
+
(context === null || context === void 0 ? void 0 : context.domain) && file.id > 0 ? (react_1.default.createElement("a", { className: "uxf-dropzone-list__item__block__file-name-link", download: props.isDownloadableOnClick ? file.name : undefined, href: (0, get_file_url_1.getFileUrl)(context.domain, file), rel: !props.isDownloadableOnClick ? "noreferrer noopenner" : undefined, target: !props.isDownloadableOnClick ? "_blank" : undefined }, file.name)) : (react_1.default.createElement("span", { className: "uxf-dropzone-list__item__block__file-name" }, file.name))),
|
|
76
76
|
react_1.default.createElement("div", { className: "uxf-dropzone-list__item__block" },
|
|
77
77
|
isUploading ? (react_1.default.createElement(loader_1.Loader, { size: "sm" })) : (!file.error &&
|
|
78
78
|
((_c = file.originalFile) === null || _c === void 0 ? void 0 : _c.size) && (react_1.default.createElement("span", { className: "uxf-dropzone-list__item__block__file-size" }, formatBytes(file.originalFile.size)))),
|
package/input/input-element.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormControlProps } from "@uxf/ui/types/form-control-props";
|
|
2
|
-
import React, { KeyboardEventHandler } from "react";
|
|
2
|
+
import React, { CSSProperties, KeyboardEventHandler } from "react";
|
|
3
3
|
type InputMode = "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
4
4
|
export interface InputElementProps extends FormControlProps<string> {
|
|
5
5
|
"aria-describedby"?: string;
|
|
@@ -18,6 +18,7 @@ export interface InputElementProps extends FormControlProps<string> {
|
|
|
18
18
|
min?: number | string;
|
|
19
19
|
pattern?: string;
|
|
20
20
|
step?: number | string;
|
|
21
|
+
style?: CSSProperties;
|
|
21
22
|
}
|
|
22
23
|
export declare const InputElement: React.ForwardRefExoticComponent<InputElementProps & React.RefAttributes<HTMLInputElement>>;
|
|
23
24
|
export {};
|
package/input/input-element.js
CHANGED
|
@@ -28,6 +28,6 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
exports.InputElement = (0, react_1.forwardRef)((props, ref) => {
|
|
29
29
|
const onChange = (event) => props.onChange(event.target.value, event);
|
|
30
30
|
const filteredProps = Object.fromEntries(Object.entries(props).filter((p) => p[0].startsWith("aria-") || p[0].startsWith("data-")));
|
|
31
|
-
return (react_1.default.createElement("input", { ...filteredProps, "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, autoFocus: props.autoFocus, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, inputMode: props.inputMode, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, step: props.step, tabIndex: props.isReadOnly ? -1 : undefined, type: props.type, value: props.value }));
|
|
31
|
+
return (react_1.default.createElement("input", { ...filteredProps, "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, autoComplete: props.autoComplete, autoFocus: props.autoFocus, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, inputMode: props.inputMode, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, step: props.step, style: props.style, tabIndex: props.isReadOnly ? -1 : undefined, type: props.type, value: props.value }));
|
|
32
32
|
});
|
|
33
33
|
exports.InputElement.displayName = "UxfUiInputElement";
|
package/input/input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useInputFocus } from "@uxf/core/hooks/useInputFocus";
|
|
2
2
|
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
|
-
import React, { ReactNode, Ref } from "react";
|
|
3
|
+
import React, { CSSProperties, ReactNode, Ref } from "react";
|
|
4
4
|
export interface InputProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
customInputElementDisplayName?: string;
|
|
@@ -8,6 +8,7 @@ export interface InputProps {
|
|
|
8
8
|
inputFocus?: ReturnType<typeof useInputFocus>;
|
|
9
9
|
variant?: keyof InputGroupVariants;
|
|
10
10
|
size?: keyof InputGroupSizes;
|
|
11
|
+
style?: CSSProperties;
|
|
11
12
|
isDisabled?: boolean;
|
|
12
13
|
isFocused?: boolean;
|
|
13
14
|
isInvalid?: boolean;
|
package/input/input.js
CHANGED
|
@@ -48,7 +48,7 @@ exports.Input = (0, react_1.forwardRef)((props, ref) => {
|
|
|
48
48
|
const rightElement = getChildrenById(children, "UxfUiInputRightElement");
|
|
49
49
|
const input = (0, useInputFocus_1.useInputFocus)(inputRef, (_a = inputFocus === null || inputFocus === void 0 ? void 0 : inputFocus.onBlur) !== null && _a !== void 0 ? _a : mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.onBlur, (_b = inputFocus === null || inputFocus === void 0 ? void 0 : inputFocus.onFocus) !== null && _b !== void 0 ? _b : mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.onFocus);
|
|
50
50
|
const inputGroupClasses = (0, cx_1.cx)("uxf-input", leftAddon && "uxf-input--has-left-addon", leftElement && "uxf-input--has-left-element", rightElement && "uxf-input--has-right-element", rightAddon && "uxf-input--has-right-addon", isApplicable(isFocused, mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isFocused, inputFocus === null || inputFocus === void 0 ? void 0 : inputFocus.focused, input.focused) && classes_1.CLASSES.IS_FOCUSED, isApplicable(isInvalid, mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isInvalid) && classes_1.CLASSES.IS_INVALID, isApplicable(isDisabled, mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isDisabled) && classes_1.CLASSES.IS_DISABLED, isApplicable(isReadOnly, mainInput === null || mainInput === void 0 ? void 0 : mainInput.props.isReadOnly) && classes_1.CLASSES.IS_READONLY, `uxf-input--size-${size !== null && size !== void 0 ? size : "default"}`, `uxf-input--variant-${variant !== null && variant !== void 0 ? variant : "default"}`, className);
|
|
51
|
-
return (react_1.default.createElement("div", { className: inputGroupClasses, ref: wrapperRef, tabIndex: tabIndex },
|
|
51
|
+
return (react_1.default.createElement("div", { className: inputGroupClasses, ref: wrapperRef, style: props.style, tabIndex: tabIndex },
|
|
52
52
|
leftAddon,
|
|
53
53
|
react_1.default.createElement("div", { className: "uxf-input__wrapper", onClick: input.focus, ...restProps },
|
|
54
54
|
leftElement,
|
|
@@ -114,7 +114,7 @@ exports._MultiComboboxBase = (0, react_3.forwardRef)((props, ref) => {
|
|
|
114
114
|
var _a;
|
|
115
115
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
116
116
|
};
|
|
117
|
-
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)(withoutPopover && "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), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleComboboxValueChange, value: selectedOptions }, (renderProps) => {
|
|
117
|
+
return (react_3.default.createElement(react_2.Combobox, { as: "div", by: "id", className: (0, cx_1.cx)(withoutPopover && "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), disabled: props.isDisabled || props.isReadOnly, multiple: true, onChange: handleComboboxValueChange, style: props.style, value: selectedOptions }, (renderProps) => {
|
|
118
118
|
var _a, _b;
|
|
119
119
|
const inputElement = (react_3.default.createElement(react_3.default.Fragment, null,
|
|
120
120
|
react_3.default.createElement(react_2.Combobox.Button, { "aria-invalid": props.isInvalid, "aria-describedby": props.errorId, as: "div", className: (0, cx_1.cx)("uxf-multi-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" && `${classes_1.CLASSES.IS_OPEN}--bottom`, dropdown.placement === "top" && `${classes_1.CLASSES.IS_OPEN}--top`, renderProps.open && classes_1.CLASSES.IS_OPEN), onBlur: input.onBlur, onFocus: input.onFocus, ref: stableRef },
|
|
@@ -54,7 +54,7 @@ exports.MultiCombobox = (0, react_2.forwardRef)((props, ref) => {
|
|
|
54
54
|
return react_2.default.createElement(_multi_combobox_base_1._MultiComboboxBase, { ...props, errorId: errorId, ref: ref });
|
|
55
55
|
}
|
|
56
56
|
return (react_2.default.createElement(form_component_1.FormComponent, { 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), errorId: errorId, form: props.form, helperText: props.helperText, inputId: fakeInputId, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
57
|
-
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("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) }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
57
|
+
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("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), style: props.style }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
58
58
|
react_2.default.createElement(react_1.Popover.Button, { className: (0, cx_1.cx)("uxf-multi-combobox__button uxf-multi-combobox__button--with-popover", popoverRenderProps.open && classes_1.CLASSES.IS_OPEN, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID), id: fakeInputId, onKeyDown: handlePopoverButtonKeyPress, ref: fakeInputRef },
|
|
59
59
|
react_2.default.createElement("span", { className: (0, cx_1.cx)("uxf-multi-combobox__input uxf-multi-combobox__input--with-popover", selectedOptions.length === 0 &&
|
|
60
60
|
"uxf-multi-combobox__input-placeholder--with-popover") }, selectedOptions.length > 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement, Strategy } from "@floating-ui/react";
|
|
2
2
|
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
import { ChipColor } from "../chip";
|
|
5
5
|
import { IconsSet } from "../icon/theme";
|
|
6
6
|
import { FormControlProps } from "../types";
|
|
@@ -36,6 +36,7 @@ export interface MultiComboboxProps<ValueId = MultiComboboxValueId, Option = Mul
|
|
|
36
36
|
rightAddon?: ReactNode;
|
|
37
37
|
rightElement?: ReactNode;
|
|
38
38
|
size?: keyof InputGroupSizes;
|
|
39
|
+
style?: CSSProperties;
|
|
39
40
|
variant?: keyof InputGroupVariants;
|
|
40
41
|
withCheckboxes?: boolean;
|
|
41
42
|
withPopover?: boolean;
|
|
@@ -42,7 +42,7 @@ exports.MultiSelect = (0, react_2.forwardRef)((props, ref) => {
|
|
|
42
42
|
return react_2.default.createElement(_multi_select_base_1._MultiSelectBase, { ...props, errorId: errorId, id: id, ref: ref });
|
|
43
43
|
}
|
|
44
44
|
return (react_2.default.createElement(form_component_1.FormComponent, { 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), errorId: errorId, form: props.form, helperText: props.helperText, inputId: id, isRequired: props.isRequired, label: props.label, name: props.name },
|
|
45
|
-
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("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) }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
45
|
+
react_2.default.createElement(react_1.Popover, { className: (0, cx_1.cx)("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), style: props.style }, (popoverRenderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
46
46
|
react_2.default.createElement(react_1.Popover.Button, { className: (0, cx_1.cx)("uxf-multi-combobox__button uxf-multi-combobox__button--with-popover", popoverRenderProps.open && classes_1.CLASSES.IS_OPEN, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isInvalid && classes_1.CLASSES.IS_INVALID) },
|
|
47
47
|
react_2.default.createElement("span", { className: (0, cx_1.cx)("uxf-multi-combobox__input uxf-multi-combobox__input--with-popover", selectedOptions.length === 0 &&
|
|
48
48
|
"uxf-multi-combobox__input-placeholder--with-popover") }, selectedOptions.length > 0
|
package/multi-select/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement, Strategy } from "@floating-ui/react";
|
|
2
2
|
import { InputGroupSizes, InputGroupVariants } from "@uxf/ui/input/theme";
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
import { ChipColor } from "../chip";
|
|
5
5
|
import { IconsSet } from "../icon/theme";
|
|
6
6
|
import { FormControlProps } from "../types";
|
|
@@ -26,6 +26,7 @@ export interface MultiSelectProps<ValueId = MultiSelectValueId, Option = MultiSe
|
|
|
26
26
|
placeholder?: string;
|
|
27
27
|
renderOption?: (option: Option) => ReactNode;
|
|
28
28
|
size?: keyof InputGroupSizes;
|
|
29
|
+
style?: CSSProperties;
|
|
29
30
|
variant?: keyof InputGroupVariants;
|
|
30
31
|
withPopover?: boolean;
|
|
31
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/ui",
|
|
3
|
-
"version": "11.11.
|
|
3
|
+
"version": "11.11.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@floating-ui/react": "0.26.9",
|
|
19
19
|
"@headlessui/react": "1.7.14",
|
|
20
|
-
"@uxf/core": "11.
|
|
21
|
-
"@uxf/datepicker": "11.
|
|
22
|
-
"@uxf/styles": "11.
|
|
20
|
+
"@uxf/core": "11.11.3",
|
|
21
|
+
"@uxf/datepicker": "11.11.3",
|
|
22
|
+
"@uxf/styles": "11.11.3",
|
|
23
23
|
"color2k": "2.0.3",
|
|
24
24
|
"dayjs": "1.11.10",
|
|
25
25
|
"jump.js": "1.0.2",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jump.js": "1.0.6",
|
|
35
|
-
"@types/react": "18.2.
|
|
35
|
+
"@types/react": "18.2.63",
|
|
36
36
|
"@types/react-dom": "18.2.19"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/select/select.js
CHANGED
|
@@ -12,7 +12,7 @@ const Select = (props) => {
|
|
|
12
12
|
var _a, _b, _c, _d;
|
|
13
13
|
const onChange = (v) => { var _a; return props.onChange((_a = v === null || v === void 0 ? void 0 : v.id) !== null && _a !== void 0 ? _a : null); };
|
|
14
14
|
const selectedOption = (_a = props.options.find((option) => option.id === props.value)) !== null && _a !== void 0 ? _a : null;
|
|
15
|
-
return (react_2.default.createElement(_select_base_1._SelectBase, { HUIComponent: react_1.Listbox, className: `uxf-select ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, customInputElementDisplayName: react_1.Listbox.Button.displayName, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, emptyMessage: "", forwardRef: props.forwardRef, helperText: props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: props.id, isClearable: props.isClearable, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, value: selectedOption, variant: props.variant },
|
|
15
|
+
return (react_2.default.createElement(_select_base_1._SelectBase, { HUIComponent: react_1.Listbox, className: `uxf-select ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, customInputElementDisplayName: react_1.Listbox.Button.displayName, dropdownClassName: props.dropdownClassName, dropdownMatchesInputWidth: props.dropdownMatchesInputWidth, dropdownPlacement: props.dropdownPlacement, dropdownStrategy: props.dropdownStrategy, emptyMessage: "", forwardRef: props.forwardRef, helperText: props.helperText, hiddenLabel: props.hiddenLabel, iconName: props.iconName, id: props.id, isClearable: props.isClearable, isDisabled: props.isDisabled, isFocused: props.isFocused, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, keyExtractor: props.keyExtractor, label: props.label, leftAddon: props.leftAddon, leftElement: props.leftElement, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, options: props.options, placeholder: props.placeholder, renderOption: props.renderOption, rightAddon: props.rightAddon, rightElement: props.rightElement, size: props.size, style: props.style, value: selectedOption, variant: props.variant },
|
|
16
16
|
react_2.default.createElement(react_1.Listbox.Button, { className: `uxf-input__element ${!(selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) && classes_1.CLASSES.IS_EMPTY}` },
|
|
17
17
|
react_2.default.createElement("span", { className: "uxf-input__element-text" }, selectedOption
|
|
18
18
|
? (_d = (_c = props.renderSelectedOption) === null || _c === void 0 ? void 0 : _c.call(props, selectedOption)) !== null && _d !== void 0 ? _d : selectedOption.label
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputProps } from "@uxf/ui/input/input";
|
|
2
2
|
import { FormControlProps } from "@uxf/ui/types";
|
|
3
|
-
import React, { KeyboardEventHandler, ReactNode } from "react";
|
|
3
|
+
import React, { CSSProperties, KeyboardEventHandler, ReactNode } from "react";
|
|
4
4
|
type EnterKeyHint = "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
5
5
|
type InputMode = "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
6
6
|
export interface TextInputProps extends FormControlProps<string>, Pick<InputProps, "size" | "variant"> {
|
|
@@ -27,6 +27,7 @@ export interface TextInputProps extends FormControlProps<string>, Pick<InputProp
|
|
|
27
27
|
min?: number | string;
|
|
28
28
|
pattern?: string;
|
|
29
29
|
step?: number | string;
|
|
30
|
+
style?: CSSProperties;
|
|
30
31
|
}
|
|
31
32
|
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
32
33
|
export {};
|
package/text-input/text-input.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
40
40
|
const errorId = props.isInvalid ? `${id}--error-message` : undefined;
|
|
41
41
|
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);
|
|
42
42
|
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 },
|
|
43
|
-
react_1.default.createElement(input_1.Input, { inputFocus: input, size: props.size, variant: props.variant },
|
|
43
|
+
react_1.default.createElement(input_1.Input, { inputFocus: input, size: props.size, style: props.style, variant: props.variant },
|
|
44
44
|
props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
|
|
45
45
|
props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
|
|
46
46
|
react_1.default.createElement(input_1.Input.Element, { "aria-describedby": errorId, autoComplete: props.autoComplete, autoFocus: props.autoFocus, form: props.form, id: id, inputMode: props.inputMode, isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onChange: props.onChange, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), step: props.step, type: props.type, value: props.value }),
|
package/textarea/textarea.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { FormControlProps } from "../types";
|
|
3
3
|
export interface TextareaProps extends FormControlProps<string, HTMLTextAreaElement> {
|
|
4
4
|
autoComplete?: string;
|
|
@@ -13,5 +13,6 @@ export interface TextareaProps extends FormControlProps<string, HTMLTextAreaElem
|
|
|
13
13
|
minLength?: number | undefined;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
rows?: number;
|
|
16
|
+
style?: CSSProperties;
|
|
16
17
|
}
|
|
17
18
|
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
package/textarea/textarea.js
CHANGED
|
@@ -67,7 +67,7 @@ exports.Textarea = (0, react_1.forwardRef)((props, ref) => {
|
|
|
67
67
|
}, [props.disableAutoHeight, latestRows]);
|
|
68
68
|
const onWrapperClick = () => { var _a; return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); };
|
|
69
69
|
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 },
|
|
70
|
-
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: onWrapperClick },
|
|
70
|
+
react_1.default.createElement("div", { className: "uxf-textarea__wrapper", onClick: onWrapperClick, style: props.style },
|
|
71
71
|
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: input.onBlur, onChange: (event) => props.onChange(event.target.value, event), onFocus: input.onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, rows: props.rows, ref: (0, composeRefs_1.composeRefs)(innerRef, ref), required: props.isRequired, value: props.value }))));
|
|
72
72
|
});
|
|
73
73
|
exports.Textarea.displayName = "UxfUiTextarea";
|