@povio/ui 2.2.9-rc.5 → 2.2.9-rc.7
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/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +2 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +2 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +2 -2
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiConfig.context.js +1 -0
- package/dist/config/uiStyle.context.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Ref, FocusEvent } from 'react';
|
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { DatePickerStateOptions } from 'react-stately';
|
|
5
5
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
6
|
-
import { DatePickerTodayIcon } from '../shared/datePicker.types';
|
|
6
|
+
import { DatePickerTodayIcon, DatePickerTodayIconButtonSize } from '../shared/datePicker.types';
|
|
7
7
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
8
8
|
import { ControlProps } from '../../shared/form.types';
|
|
9
9
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
@@ -13,6 +13,7 @@ interface DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
|
|
|
13
13
|
isClearable?: boolean;
|
|
14
14
|
className?: string;
|
|
15
15
|
todayIcon?: DatePickerTodayIcon;
|
|
16
|
+
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
16
17
|
isDirty?: boolean;
|
|
17
18
|
disableManualEntry?: boolean;
|
|
18
19
|
placeholder?: string;
|
|
@@ -20,7 +20,7 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
20
20
|
var PLACEHOLDER_VALUE = new CalendarDate(2024, 1, 1);
|
|
21
21
|
var DatePickerBase = (props) => {
|
|
22
22
|
const ui = UIConfig.useConfig();
|
|
23
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
23
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, todayIconButtonSize = ui.dateInput.todayIconButtonSize, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
24
24
|
const formFieldProps = {
|
|
25
25
|
error,
|
|
26
26
|
label,
|
|
@@ -138,6 +138,7 @@ var DatePickerBase = (props) => {
|
|
|
138
138
|
isClearable,
|
|
139
139
|
headerProps,
|
|
140
140
|
todayIcon,
|
|
141
|
+
todayIconButtonSize,
|
|
141
142
|
onOpenDropdown: () => state.toggle(),
|
|
142
143
|
placeholder,
|
|
143
144
|
className: inputClassName
|
|
@@ -4,7 +4,7 @@ import { DateValue } from 'react-aria';
|
|
|
4
4
|
import { FieldValues } from 'react-hook-form';
|
|
5
5
|
import { DateRangePickerStateOptions } from 'react-stately';
|
|
6
6
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
7
|
-
import { DatePickerTodayIcon } from '../shared/datePicker.types';
|
|
7
|
+
import { DatePickerTodayIcon, DatePickerTodayIconButtonSize } from '../shared/datePicker.types';
|
|
8
8
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
9
9
|
import { ControlProps } from '../../shared/form.types';
|
|
10
10
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
@@ -15,6 +15,7 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
|
|
|
15
15
|
hideSidebar?: boolean;
|
|
16
16
|
className?: string;
|
|
17
17
|
todayIcon?: DatePickerTodayIcon;
|
|
18
|
+
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
18
19
|
isDirty?: boolean;
|
|
19
20
|
disableManualEntry?: boolean;
|
|
20
21
|
placeholder?: string;
|
|
@@ -24,7 +24,7 @@ import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
|
|
|
24
24
|
var DateRangePickerBase = (props) => {
|
|
25
25
|
const ui = UIConfig.useConfig();
|
|
26
26
|
const { t } = useTranslation();
|
|
27
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
27
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, todayIconButtonSize = ui.dateInput.todayIconButtonSize, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
28
28
|
const [validationRangeError, setValidationRangeError] = useState();
|
|
29
29
|
const datePickerInputRef = useRef(null);
|
|
30
30
|
const dateRangePickerRef = useMemo(() => ({ get current() {
|
|
@@ -484,6 +484,7 @@ var DateRangePickerBase = (props) => {
|
|
|
484
484
|
isClearable,
|
|
485
485
|
headerProps,
|
|
486
486
|
todayIcon,
|
|
487
|
+
todayIconButtonSize,
|
|
487
488
|
isDirty,
|
|
488
489
|
disableManualEntry,
|
|
489
490
|
placeholder,
|
|
@@ -3,7 +3,7 @@ import { DateValue } from 'react-aria';
|
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
4
|
import { DatePickerStateOptions } from 'react-stately';
|
|
5
5
|
import { DatePickerInputHandle } from '../shared/DatePickerInput';
|
|
6
|
-
import { DatePickerTodayIcon } from '../shared/datePicker.types';
|
|
6
|
+
import { DatePickerTodayIcon, DatePickerTodayIconButtonSize } from '../shared/datePicker.types';
|
|
7
7
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
8
8
|
import { ControlProps } from '../../shared/form.types';
|
|
9
9
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
@@ -13,6 +13,7 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
13
13
|
isTimeOptional?: boolean;
|
|
14
14
|
isClearable?: boolean;
|
|
15
15
|
todayIcon?: DatePickerTodayIcon;
|
|
16
|
+
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
16
17
|
isDirty?: boolean;
|
|
17
18
|
disableManualEntry?: boolean;
|
|
18
19
|
placeholder?: string;
|
|
@@ -17,7 +17,7 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
17
17
|
//#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
|
|
18
18
|
var DateTimePickerBase = (props) => {
|
|
19
19
|
const ui = UIConfig.useConfig();
|
|
20
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
20
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, todayIconButtonSize = ui.dateInput.todayIconButtonSize, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
|
|
21
21
|
const formFieldProps = {
|
|
22
22
|
error,
|
|
23
23
|
label,
|
|
@@ -153,6 +153,7 @@ var DateTimePickerBase = (props) => {
|
|
|
153
153
|
isClearable,
|
|
154
154
|
headerProps,
|
|
155
155
|
todayIcon,
|
|
156
|
+
todayIconButtonSize,
|
|
156
157
|
isRequired,
|
|
157
158
|
disableManualEntry,
|
|
158
159
|
placeholder,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { DatePickerAria } from 'react-aria';
|
|
3
|
-
import { DatePickerTodayIcon } from './datePicker.types';
|
|
3
|
+
import { DatePickerTodayIcon, DatePickerTodayIconButtonSize } from './datePicker.types';
|
|
4
4
|
import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
|
|
5
5
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
6
6
|
export interface DatePickerInputHandle {
|
|
@@ -20,6 +20,7 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
20
20
|
isClearable?: boolean;
|
|
21
21
|
headerProps?: FormFieldHeaderProps;
|
|
22
22
|
todayIcon?: DatePickerTodayIcon;
|
|
23
|
+
todayIconButtonSize?: DatePickerTodayIconButtonSize;
|
|
23
24
|
isDirty?: boolean;
|
|
24
25
|
isRequired?: boolean;
|
|
25
26
|
disableManualEntry?: boolean;
|
|
@@ -27,5 +28,5 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
27
28
|
className?: string;
|
|
28
29
|
onOpenDropdown?: () => void;
|
|
29
30
|
}
|
|
30
|
-
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -16,7 +16,7 @@ import { Button } from "react-aria-components";
|
|
|
16
16
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
17
17
|
import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
|
|
18
18
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
19
|
-
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, ...props }) => {
|
|
19
|
+
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, ...props }) => {
|
|
20
20
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
21
21
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
22
22
|
const [canClear, setCanClear] = useState(false);
|
|
@@ -112,7 +112,7 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonP
|
|
|
112
112
|
todayIconComponent && /* @__PURE__ */ jsx(IconButton, {
|
|
113
113
|
label: "",
|
|
114
114
|
icon: todayIconComponent,
|
|
115
|
-
size:
|
|
115
|
+
size: todayIconButtonSize,
|
|
116
116
|
onPress: onToday,
|
|
117
117
|
className: "relative z-1"
|
|
118
118
|
}),
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { InfoIcon } from "../../../assets/icons/Info.js";
|
|
2
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
3
|
import { Typography } from "../../text/Typography/Typography.js";
|
|
3
4
|
import { Tooltip as Tooltip$1 } from "../../overlays/Tooltip/Tooltip.js";
|
|
4
5
|
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
6
|
+
import { formFieldHeader } from "./formFieldHeader.cva.js";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { clsx } from "clsx";
|
|
7
9
|
import { Focusable } from "react-aria-components";
|
|
8
10
|
//#region src/components/inputs/FormField/FormFieldHeader.tsx
|
|
9
11
|
var FormFieldHeader = ({ label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, isDisabled, className, labelProps }) => {
|
|
10
12
|
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
-
className: clsx(
|
|
13
|
+
className: clsx(UIStyle.useCva("formField.headerCva", formFieldHeader)({ visible: !isHeaderHidden }), className),
|
|
12
14
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
13
15
|
className: "flex items-start justify-between",
|
|
14
16
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const formFieldHeader: (props?: ({
|
|
3
|
+
visible?: boolean | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export interface FormFieldHeaderVariantProps extends VariantProps<typeof formFieldHeader> {
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/inputs/FormField/formFieldHeader.cva.ts
|
|
3
|
+
var formFieldHeader = cva("", {
|
|
4
|
+
variants: { visible: {
|
|
5
|
+
true: "mb-1",
|
|
6
|
+
false: "sr-only"
|
|
7
|
+
} },
|
|
8
|
+
defaultVariants: { visible: true }
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { formFieldHeader };
|
|
@@ -33,7 +33,7 @@ export declare namespace UIConfig {
|
|
|
33
33
|
};
|
|
34
34
|
toggle: Pick<ToggleProps, "variant">;
|
|
35
35
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
36
|
-
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
|
|
36
|
+
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "shouldForceLeadingZeros" | "disableManualEntry">;
|
|
37
37
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
38
38
|
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
39
39
|
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
@@ -5,6 +5,7 @@ import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
|
|
|
5
5
|
import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
|
|
6
6
|
import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
|
|
7
7
|
import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
|
|
8
|
+
import { FormFieldHeaderVariantProps } from '../components/inputs/FormField/formFieldHeader.cva';
|
|
8
9
|
import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
|
|
9
10
|
import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
10
11
|
import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
@@ -145,6 +146,7 @@ export declare namespace UIStyle {
|
|
|
145
146
|
cva?: Cva<PopoverVariantProps>;
|
|
146
147
|
};
|
|
147
148
|
formField: {
|
|
149
|
+
headerCva?: Cva<FormFieldHeaderVariantProps>;
|
|
148
150
|
errorLabelCva?: Cva<FormFieldErrorVariantProps>;
|
|
149
151
|
helperLabelCva?: Cva<FormFieldHelperVariantProps>;
|
|
150
152
|
};
|