@povio/ui 2.2.9-rc.38 → 2.2.9-rc.39
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.
|
@@ -165,10 +165,12 @@ var NumberInput = ({ renderStaticInput, ...props }) => {
|
|
|
165
165
|
renderStatic: true,
|
|
166
166
|
onStaticInteract: renderRealInput,
|
|
167
167
|
inputClassName: props.inputClassName,
|
|
168
|
+
wrapContentAndTrailing: true,
|
|
168
169
|
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
169
170
|
type: "text",
|
|
170
171
|
ref: inputRef,
|
|
171
172
|
disabled: isDisabled,
|
|
173
|
+
inputMode: "numeric",
|
|
172
174
|
tabIndex: -1,
|
|
173
175
|
value: displayValue,
|
|
174
176
|
placeholder: as === "floating" ? "" : props.placeholder,
|
|
@@ -160,6 +160,7 @@ var TextInput = ({ renderStaticInput, ...props }) => {
|
|
|
160
160
|
renderStatic: true,
|
|
161
161
|
onStaticInteract: renderRealInput,
|
|
162
162
|
inputClassName: props.inputClassName,
|
|
163
|
+
wrapContentAndTrailing: true,
|
|
163
164
|
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
164
165
|
ref: inputRef,
|
|
165
166
|
type: inputType === "hidden" ? "password" : inputType,
|
|
@@ -69,6 +69,7 @@ export interface InputFrameProps extends InputVariantProps, Partial<FormFieldPro
|
|
|
69
69
|
inputClassName?: string;
|
|
70
70
|
contentClassName?: string;
|
|
71
71
|
contentWrapperClassName?: string;
|
|
72
|
+
wrapContentAndTrailing?: boolean;
|
|
72
73
|
labelPlacement?: InputFrameLabelPlacement;
|
|
73
74
|
trailingClassName?: string;
|
|
74
75
|
}
|
|
@@ -8,7 +8,7 @@ import { InputClear } from "../shared/InputClear.js";
|
|
|
8
8
|
import { inputBase, inputContentWrapper, inputSize } from "../shared/input.cva.js";
|
|
9
9
|
import { FormField } from "../FormField/FormField.js";
|
|
10
10
|
import { TooltipWrapper } from "../shared/TooltipWrapper.js";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { clsx } from "clsx";
|
|
13
13
|
import { isValidElement, useId } from "react";
|
|
14
14
|
//#region src/components/inputs/Skeleton/InputFrame.tsx
|
|
@@ -19,7 +19,7 @@ var InputFrame = (props) => {
|
|
|
19
19
|
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
20
20
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
21
21
|
const generatedInputId = useId();
|
|
22
|
-
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement = "content-wrapper", trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, labelPlacement = "content-wrapper", trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
|
|
22
|
+
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement = "content-wrapper", trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, wrapContentAndTrailing, labelPlacement = "content-wrapper", trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
|
|
23
23
|
const as = asProp ?? ui.input.as;
|
|
24
24
|
const size = sizeProp ?? ui.input.size;
|
|
25
25
|
const variant = variantProp ?? ui.input.variant;
|
|
@@ -70,6 +70,75 @@ var InputFrame = (props) => {
|
|
|
70
70
|
...resolvedHeaderProps
|
|
71
71
|
}) : null;
|
|
72
72
|
const resolvedContentWrapperClassName = contentWrapperClassName ?? inputContentWrapperCva({ as });
|
|
73
|
+
const contentRow = /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full", inputSizeCva({
|
|
75
|
+
size,
|
|
76
|
+
as
|
|
77
|
+
}), typographySize && typographyCva({ size: typographySize }), contentClassName),
|
|
78
|
+
children: [
|
|
79
|
+
leadingContent,
|
|
80
|
+
leadingIcon && /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
82
|
+
children: renderIconVisual(leadingIcon)
|
|
83
|
+
}),
|
|
84
|
+
labelPlacement === "content-row" && labelContent,
|
|
85
|
+
actionContentPlacement === "content-row" && actionContent,
|
|
86
|
+
/* @__PURE__ */ jsxs("div", {
|
|
87
|
+
className: resolvedContentWrapperClassName,
|
|
88
|
+
children: [
|
|
89
|
+
labelPlacement === "content-wrapper" && labelContent,
|
|
90
|
+
actionContentPlacement === "content-wrapper" && actionContent,
|
|
91
|
+
typeof children === "function" ? children({
|
|
92
|
+
...dataAttributeProps,
|
|
93
|
+
id: inputId
|
|
94
|
+
}) : children
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
const trailingRow = hasTrailingContent ? /* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
101
|
+
size,
|
|
102
|
+
as
|
|
103
|
+
}), !isTrailingInteractive && "pointer-events-none", trailingClassName),
|
|
104
|
+
children: [
|
|
105
|
+
hasClear && /* @__PURE__ */ jsx(InputClear, {
|
|
106
|
+
onClear: () => onClear?.(),
|
|
107
|
+
className: clearClassName,
|
|
108
|
+
show: !!showClear,
|
|
109
|
+
renderStatic
|
|
110
|
+
}),
|
|
111
|
+
trailingContent,
|
|
112
|
+
unit && /* @__PURE__ */ jsx("span", {
|
|
113
|
+
className: typographyCva({
|
|
114
|
+
size: "label-2",
|
|
115
|
+
sizeMobile: "label-2",
|
|
116
|
+
variant: "prominent-1",
|
|
117
|
+
className: "text-text-default-3"
|
|
118
|
+
}),
|
|
119
|
+
children: unit
|
|
120
|
+
}),
|
|
121
|
+
isLoading && /* @__PURE__ */ jsx("div", {
|
|
122
|
+
className: "inline-flex",
|
|
123
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
124
|
+
}),
|
|
125
|
+
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
126
|
+
color: "secondary",
|
|
127
|
+
icon: action.icon,
|
|
128
|
+
isDisabled,
|
|
129
|
+
onPress: action.onClick,
|
|
130
|
+
excludeFromTabOrder: true,
|
|
131
|
+
label: action.altText,
|
|
132
|
+
className: clsx("border-0!", action.className)
|
|
133
|
+
}),
|
|
134
|
+
!isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
|
|
135
|
+
trailingAction
|
|
136
|
+
]
|
|
137
|
+
}) : null;
|
|
138
|
+
const inputFrameContent = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
|
|
139
|
+
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
140
|
+
children: [contentRow, trailingRow]
|
|
141
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
|
|
73
142
|
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
74
143
|
as,
|
|
75
144
|
error,
|
|
@@ -89,7 +158,7 @@ var InputFrame = (props) => {
|
|
|
89
158
|
onFocusCapture?.(event);
|
|
90
159
|
if (renderStatic) onStaticInteract?.(true);
|
|
91
160
|
},
|
|
92
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
93
162
|
ref,
|
|
94
163
|
...dataAttributeProps,
|
|
95
164
|
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
@@ -107,70 +176,7 @@ var InputFrame = (props) => {
|
|
|
107
176
|
if (renderStatic) onStaticInteract?.(true);
|
|
108
177
|
},
|
|
109
178
|
"data-rac": "",
|
|
110
|
-
children:
|
|
111
|
-
className: clsx("group/input-frame flex min-w-0 w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full", inputSizeCva({
|
|
112
|
-
size,
|
|
113
|
-
as
|
|
114
|
-
}), typographySize && typographyCva({ size: typographySize }), contentClassName),
|
|
115
|
-
children: [
|
|
116
|
-
leadingContent,
|
|
117
|
-
leadingIcon && /* @__PURE__ */ jsx("div", {
|
|
118
|
-
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
119
|
-
children: renderIconVisual(leadingIcon)
|
|
120
|
-
}),
|
|
121
|
-
labelPlacement === "content-row" && labelContent,
|
|
122
|
-
actionContentPlacement === "content-row" && actionContent,
|
|
123
|
-
/* @__PURE__ */ jsxs("div", {
|
|
124
|
-
className: resolvedContentWrapperClassName,
|
|
125
|
-
children: [
|
|
126
|
-
labelPlacement === "content-wrapper" && labelContent,
|
|
127
|
-
actionContentPlacement === "content-wrapper" && actionContent,
|
|
128
|
-
typeof children === "function" ? children({
|
|
129
|
-
...dataAttributeProps,
|
|
130
|
-
id: inputId
|
|
131
|
-
}) : children
|
|
132
|
-
]
|
|
133
|
-
})
|
|
134
|
-
]
|
|
135
|
-
}), hasTrailingContent && /* @__PURE__ */ jsxs("div", {
|
|
136
|
-
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
137
|
-
size,
|
|
138
|
-
as
|
|
139
|
-
}), !isTrailingInteractive && "pointer-events-none", trailingClassName),
|
|
140
|
-
children: [
|
|
141
|
-
hasClear && /* @__PURE__ */ jsx(InputClear, {
|
|
142
|
-
onClear: () => onClear?.(),
|
|
143
|
-
className: clearClassName,
|
|
144
|
-
show: !!showClear,
|
|
145
|
-
renderStatic
|
|
146
|
-
}),
|
|
147
|
-
trailingContent,
|
|
148
|
-
unit && /* @__PURE__ */ jsx("span", {
|
|
149
|
-
className: typographyCva({
|
|
150
|
-
size: "label-2",
|
|
151
|
-
sizeMobile: "label-2",
|
|
152
|
-
variant: "prominent-1",
|
|
153
|
-
className: "text-text-default-3"
|
|
154
|
-
}),
|
|
155
|
-
children: unit
|
|
156
|
-
}),
|
|
157
|
-
isLoading && /* @__PURE__ */ jsx("div", {
|
|
158
|
-
className: "inline-flex",
|
|
159
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
160
|
-
}),
|
|
161
|
-
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
162
|
-
color: "secondary",
|
|
163
|
-
icon: action.icon,
|
|
164
|
-
isDisabled,
|
|
165
|
-
onPress: action.onClick,
|
|
166
|
-
excludeFromTabOrder: true,
|
|
167
|
-
label: action.altText,
|
|
168
|
-
className: clsx("border-0!", action.className)
|
|
169
|
-
}),
|
|
170
|
-
!isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
|
|
171
|
-
trailingAction
|
|
172
|
-
]
|
|
173
|
-
})]
|
|
179
|
+
children: inputFrameContent
|
|
174
180
|
})
|
|
175
181
|
})
|
|
176
182
|
});
|