@povio/ui 2.2.9-rc.27 → 2.2.9-rc.28

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.
@@ -235,7 +235,8 @@ var DatePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput, ...pr
235
235
  isDisabled,
236
236
  className: clsx("relative inline-flex w-full flex-col text-left", props.className),
237
237
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
238
- contentClassName: datePickerInputContentRowCva({ size }),
238
+ contentWrapperClassName: datePickerInputContentRowCva({ size }),
239
+ labelPlacement: "content-row",
239
240
  dataAttributes: {
240
241
  dataIsEmpty: dateValue === null,
241
242
  dataIsFilled: dateValue !== null,
@@ -636,7 +636,8 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
636
636
  isDisabled,
637
637
  className: clsx("relative inline-flex w-full flex-col text-left", props.className),
638
638
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
639
- contentClassName: datePickerInputContentRowCva({ size }),
639
+ contentWrapperClassName: datePickerInputContentRowCva({ size }),
640
+ labelPlacement: "content-row",
640
641
  dataAttributes: {
641
642
  dataIsEmpty: !hasProvidedRangeValue,
642
643
  dataIsFilled: hasProvidedRangeValue,
@@ -249,7 +249,8 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
249
249
  isDisabled,
250
250
  className: clsx("relative inline-flex w-full flex-col text-left", props.className),
251
251
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
252
- contentClassName: datePickerInputContentRowCva({ size }),
252
+ contentWrapperClassName: datePickerInputContentRowCva({ size }),
253
+ labelPlacement: "content-row",
253
254
  dataAttributes: {
254
255
  dataIsEmpty: dateTimeValue === null,
255
256
  dataIsFilled: dateTimeValue !== null,
@@ -192,6 +192,7 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
192
192
  isDisabled,
193
193
  className: clsx("relative inline-flex w-full flex-col text-left", props.className),
194
194
  inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
195
+ labelPlacement: "content-row",
195
196
  dataAttributes: {
196
197
  dataIsEmpty: timeValue === null,
197
198
  dataIsFilled: timeValue !== null,
@@ -1,20 +1,21 @@
1
- import { UIStyle } from "../../../../config/uiStyle.context.js";
2
- import { buttonIconSize } from "../../../buttons/Button/button.cva.js";
1
+ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
3
2
  import { TodayIcon } from "../../../../assets/icons/Today.js";
4
3
  import { jsx } from "react/jsx-runtime";
5
- import { clsx } from "clsx";
6
- import { isValidElement } from "react";
7
4
  //#region src/components/inputs/DateTime/shared/datePickerTodayIcon.tsx
8
5
  var getDatePickerTodayIcon = (todayIcon) => {
9
6
  if (!todayIcon) return null;
10
7
  return todayIcon === true ? TodayIcon : todayIcon;
11
8
  };
12
9
  var renderDatePickerTodayIcon = (todayIcon, size = "none", className) => {
13
- const buttonIconSizeCva = UIStyle.useCva("button.iconSize", buttonIconSize);
14
10
  const icon = getDatePickerTodayIcon(todayIcon);
15
11
  if (!icon) return;
16
- if (isValidElement(icon)) return icon;
17
- return /* @__PURE__ */ jsx(icon, { className: clsx(buttonIconSizeCva({ size }), "text-interactive-text-secondary-idle", className) });
12
+ return /* @__PURE__ */ jsx(InlineIconButton, {
13
+ label: "",
14
+ icon,
15
+ size,
16
+ staticRender: true,
17
+ className: className ?? "relative z-1 !border-none"
18
+ });
18
19
  };
19
20
  //#endregion
20
21
  export { getDatePickerTodayIcon, renderDatePickerTodayIcon };
@@ -56,8 +56,8 @@ var renderStaticSegments = (value, options) => {
56
56
  className: "flex",
57
57
  children: tokenizeStaticSegmentText(value).map((token, index) => /* @__PURE__ */ jsx(DateSegmentItemView, {
58
58
  type: token.type,
59
- text: token.text,
60
- placeholder: token.text,
59
+ text: getStaticSegmentText(token),
60
+ placeholder: getStaticSegmentText(token),
61
61
  isPlaceholder: options.isPlaceholder && token.type !== "literal",
62
62
  isInputEmpty: options.isInputEmpty,
63
63
  isDisabled: options.isDisabled,
@@ -72,5 +72,9 @@ var tokenizeStaticSegmentText = (value) => {
72
72
  type: /^[^\p{Letter}\p{Number}]+$/u.test(text) ? "literal" : "day"
73
73
  }));
74
74
  };
75
+ var getStaticSegmentText = (token) => {
76
+ if (token.type !== "literal") return token.text;
77
+ return token.text.replaceAll(" ", "\xA0");
78
+ };
75
79
  //#endregion
76
80
  export { getStaticCalendarDateSegments, getStaticCalendarDateTimeSegments, getStaticDateRangeSegments, getStaticTimeSegments };
@@ -79,6 +79,7 @@ function Autocomplete({ renderStaticInput, ...props }) {
79
79
  isDisabled,
80
80
  className: clsx("w-full", props.containerClassName),
81
81
  inputClassName: clsx(props.className, props.inputClassName),
82
+ labelPlacement: "content-row",
82
83
  dataAttributes: {
83
84
  dataIsEmpty: isEmpty,
84
85
  dataIsFilled: !isEmpty,
@@ -77,6 +77,7 @@ function Select({ renderStaticInput, ...props }) {
77
77
  className: clsx("w-full", props.containerClassName),
78
78
  inputClassName: clsx(props.className, props.inputClassName),
79
79
  typographySize: "label-1",
80
+ labelPlacement: "content-row",
80
81
  dataAttributes: {
81
82
  dataIsEmpty: isEmpty,
82
83
  dataIsFilled: !isEmpty,
@@ -22,6 +22,7 @@ interface InputFrameDataAttributes {
22
22
  dataIsFilled?: boolean;
23
23
  dataIsRequired?: boolean;
24
24
  }
25
+ type InputFrameLabelPlacement = "content-wrapper" | "content-row";
25
26
  export interface InputFrameProps extends InputVariantProps, Partial<FormFieldProps> {
26
27
  ref?: Ref<HTMLDivElement>;
27
28
  children: ReactNode;
@@ -48,7 +49,8 @@ export interface InputFrameProps extends InputVariantProps, Partial<FormFieldPro
48
49
  inputClassName?: string;
49
50
  contentClassName?: string;
50
51
  contentWrapperClassName?: string;
52
+ labelPlacement?: InputFrameLabelPlacement;
51
53
  trailingClassName?: string;
52
54
  }
53
- export declare const InputFrame: ({ ref, children, formFieldRef, labelProps, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, inputClassName, contentClassName, contentWrapperClassName, trailingClassName, variant, as, size, }: InputFrameProps) => import("react/jsx-runtime").JSX.Element;
55
+ export declare const InputFrame: ({ ref, children, formFieldRef, labelProps, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, inputClassName, contentClassName, contentWrapperClassName, labelPlacement, trailingClassName, variant, as, size, }: InputFrameProps) => import("react/jsx-runtime").JSX.Element;
54
56
  export {};
@@ -11,7 +11,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { clsx } from "clsx";
12
12
  import { isValidElement } from "react";
13
13
  //#region src/components/inputs/Skeleton/InputFrame.tsx
14
- var InputFrame = ({ ref, children, formFieldRef, labelProps, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, inputClassName, contentClassName, contentWrapperClassName, trailingClassName, variant, as, size }) => {
14
+ var InputFrame = ({ ref, children, formFieldRef, labelProps, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, inputClassName, contentClassName, contentWrapperClassName, labelPlacement = "content-wrapper", trailingClassName, variant, as, size }) => {
15
15
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
16
16
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
17
17
  const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
@@ -47,6 +47,11 @@ var InputFrame = ({ ref, children, formFieldRef, labelProps, headerProps, error,
47
47
  className: headerClassName,
48
48
  labelProps
49
49
  };
50
+ const labelContent = as && ["filter", "floating"].includes(as) ? /* @__PURE__ */ jsx(FormFieldLabel, {
51
+ as,
52
+ size,
53
+ ...resolvedHeaderProps
54
+ }) : null;
50
55
  return /* @__PURE__ */ jsx(TooltipWrapper, {
51
56
  as,
52
57
  error,
@@ -92,15 +97,13 @@ var InputFrame = ({ ref, children, formFieldRef, labelProps, headerProps, error,
92
97
  className: clsx(!isLeadingIconElement && "pointer-events-none"),
93
98
  children: renderIconVisual(leadingIcon)
94
99
  }),
100
+ labelPlacement === "content-row" && labelContent,
101
+ labelPlacement === "content-row" && actionContent,
95
102
  /* @__PURE__ */ jsxs("div", {
96
103
  className: clsx(inputContentWrapperCva({ as }), contentWrapperClassName),
97
104
  children: [
98
- as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
99
- as,
100
- size,
101
- ...resolvedHeaderProps
102
- }),
103
- actionContent,
105
+ labelPlacement === "content-wrapper" && labelContent,
106
+ labelPlacement === "content-wrapper" && actionContent,
104
107
  children
105
108
  ]
106
109
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.2.9-rc.27",
3
+ "version": "2.2.9-rc.28",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",