@povio/ui 2.2.9-rc.24 → 2.2.9-rc.25
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/DateRangePicker/DateRangePicker.js +18 -15
- package/dist/components/inputs/Input/shared/InputContent.js +3 -2
- package/dist/components/inputs/shared/input.cva.d.ts +5 -0
- package/dist/components/inputs/shared/input.cva.js +10 -1
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
|
13
13
|
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
14
14
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
15
15
|
import { RangeCalendar } from "../shared/RangeCalendar.js";
|
|
16
|
-
import {
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { clsx } from "clsx";
|
|
18
18
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
19
19
|
import { Button } from "react-aria-components";
|
|
@@ -626,20 +626,23 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
|
|
|
626
626
|
};
|
|
627
627
|
const start = formatStaticDate(rawValue?.start ?? null);
|
|
628
628
|
const end = formatStaticDate(rawValue?.end ?? null);
|
|
629
|
-
const displayValue = /* @__PURE__ */ jsxs(
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
629
|
+
const displayValue = /* @__PURE__ */ jsxs("div", {
|
|
630
|
+
className: datePickerInputContentRowCva({ size }),
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ jsx("span", {
|
|
633
|
+
className: rawValue?.start ? "" : "text-text-default-3",
|
|
634
|
+
children: rawValue?.start ? start : defaultDatePlaceholder
|
|
635
|
+
}),
|
|
636
|
+
/* @__PURE__ */ jsx("span", {
|
|
637
|
+
className: "pointer-events-none select-none",
|
|
638
|
+
children: "–"
|
|
639
|
+
}),
|
|
640
|
+
/* @__PURE__ */ jsx("span", {
|
|
641
|
+
className: rawValue?.end ? "" : "text-text-default-3",
|
|
642
|
+
children: rawValue?.end ? end : defaultDatePlaceholder
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
});
|
|
643
646
|
return /* @__PURE__ */ jsx(StaticInput, {
|
|
644
647
|
...props,
|
|
645
648
|
onInteract: (focus) => {
|
|
@@ -4,7 +4,7 @@ import { Loader } from "../../../status/Loader/Loader.js";
|
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import { inputSize } from "../../shared/input.cva.js";
|
|
7
|
+
import { inputContentWrapper, inputSize } from "../../shared/input.cva.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { clsx } from "clsx";
|
|
10
10
|
import { isValidElement } from "react";
|
|
@@ -12,6 +12,7 @@ import { isValidElement } from "react";
|
|
|
12
12
|
var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size }) => {
|
|
13
13
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
14
14
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
15
|
+
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
15
16
|
const isLeadingIconElement = LeadingIcon && isValidElement(LeadingIcon);
|
|
16
17
|
const isTrailingIconElement = TrailingIcon && isValidElement(TrailingIcon);
|
|
17
18
|
const showClear = value != null && value !== "" && !isDisabled;
|
|
@@ -26,7 +27,7 @@ var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit
|
|
|
26
27
|
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
27
28
|
children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
28
29
|
}), /* @__PURE__ */ jsxs("div", {
|
|
29
|
-
className:
|
|
30
|
+
className: inputContentWrapperCva({ as }),
|
|
30
31
|
children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
31
32
|
as,
|
|
32
33
|
size,
|
|
@@ -12,6 +12,11 @@ export declare const inputSize: (props?: ({
|
|
|
12
12
|
} & ClassProp) | undefined) => string;
|
|
13
13
|
export interface InputSizeProps extends VariantProps<typeof inputSize> {
|
|
14
14
|
}
|
|
15
|
+
export declare const inputContentWrapper: (props?: ({
|
|
16
|
+
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
17
|
+
} & ClassProp) | undefined) => string;
|
|
18
|
+
export interface InputContentWrapperProps extends VariantProps<typeof inputContentWrapper> {
|
|
19
|
+
}
|
|
15
20
|
export declare const inputClearClass: (props?: ({
|
|
16
21
|
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
17
22
|
} & ClassProp) | undefined) => string;
|
|
@@ -191,6 +191,15 @@ var inputSize = cva("", {
|
|
|
191
191
|
as: "default"
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
+
var inputContentWrapper = cva("flex w-full", {
|
|
195
|
+
variants: { as: {
|
|
196
|
+
default: "",
|
|
197
|
+
floating: "flex-col",
|
|
198
|
+
filter: "gap-input-gap-input-text-to-elements",
|
|
199
|
+
inline: ""
|
|
200
|
+
} },
|
|
201
|
+
defaultVariants: { as: "default" }
|
|
202
|
+
});
|
|
194
203
|
var inputClearClass = cva("", {
|
|
195
204
|
variants: { as: {
|
|
196
205
|
default: "",
|
|
@@ -286,4 +295,4 @@ var useInputCva = () => {
|
|
|
286
295
|
};
|
|
287
296
|
};
|
|
288
297
|
//#endregion
|
|
289
|
-
export { inputBase, inputClearClass, inputSide, inputSize, useInputCva };
|
|
298
|
+
export { inputBase, inputClearClass, inputContentWrapper, inputSide, inputSize, useInputCva };
|
|
@@ -11,7 +11,7 @@ import { FormFieldHelperVariantProps } from '../components/inputs/FormField/form
|
|
|
11
11
|
import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
|
|
12
12
|
import { SelectPopoverCva } from '../components/inputs/Selection/shared/selectDesktop.cva';
|
|
13
13
|
import { SelectListBoxItemCva } from '../components/inputs/Selection/shared/selectItem.cva';
|
|
14
|
-
import { InputBaseProps, InputClearClassProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
14
|
+
import { InputBaseProps, InputClearClassProps, InputContentWrapperProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
|
|
15
15
|
import { LabelBaseProps } from '../components/inputs/shared/label.cva';
|
|
16
16
|
import { TooltipWrapperTriggerVariantProps } from '../components/inputs/shared/tooltipWrapper.cva';
|
|
17
17
|
import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
|
|
@@ -71,6 +71,7 @@ export declare namespace UIStyle {
|
|
|
71
71
|
input: {
|
|
72
72
|
baseCva?: Cva<InputBaseProps>;
|
|
73
73
|
clearClassCva?: Cva<InputClearClassProps>;
|
|
74
|
+
contentWrapperCva?: Cva<InputContentWrapperProps>;
|
|
74
75
|
sizeCva?: Cva<InputSizeProps>;
|
|
75
76
|
sideCva?: Cva<InputSideProps>;
|
|
76
77
|
};
|