react-better-html 1.1.152 → 1.1.154
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/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +94 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -52
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3084,6 +3084,7 @@ var DivComponent = forwardRef4(function Div({
|
|
|
3084
3084
|
as = "div",
|
|
3085
3085
|
value,
|
|
3086
3086
|
isTabAccessed,
|
|
3087
|
+
htmlContentTranslate,
|
|
3087
3088
|
onClickWithValue,
|
|
3088
3089
|
role,
|
|
3089
3090
|
onClick,
|
|
@@ -3119,6 +3120,7 @@ var DivComponent = forwardRef4(function Div({
|
|
|
3119
3120
|
{
|
|
3120
3121
|
as,
|
|
3121
3122
|
tabIndex: isTabAccessed && !isMobileDevice ? 0 : void 0,
|
|
3123
|
+
translate: htmlContentTranslate,
|
|
3122
3124
|
role: role ?? (onClick ? "button" : void 0),
|
|
3123
3125
|
onClick: onClickElement,
|
|
3124
3126
|
onKeyDown: onKeyDownElement,
|
|
@@ -5944,7 +5946,9 @@ var colorPickerSpacing = 4;
|
|
|
5944
5946
|
var colorPickerColorWidth = 12 + 27 + colorPickerSpacing;
|
|
5945
5947
|
var colorPickerValueWidth = 12 + 74 + colorPickerSpacing;
|
|
5946
5948
|
var InputElement = styled10.input.withConfig({
|
|
5947
|
-
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(
|
|
5949
|
+
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "withPrefix", "withSuffix", "normalStyle", "hoverStyle"].includes(
|
|
5950
|
+
prop
|
|
5951
|
+
)
|
|
5948
5952
|
})`
|
|
5949
5953
|
position: relative;
|
|
5950
5954
|
width: 100%;
|
|
@@ -5955,10 +5959,14 @@ var InputElement = styled10.input.withConfig({
|
|
|
5955
5959
|
background: ${(props) => props.theme.colors.backgroundContent};
|
|
5956
5960
|
border: 1px solid ${(props) => props.theme.colors.border};
|
|
5957
5961
|
border-radius: ${(props) => props.theme.styles.borderRadius}px;
|
|
5962
|
+
border-top-left-radius: ${(props) => props.withPrefix ? 0 : void 0};
|
|
5963
|
+
border-bottom-left-radius: ${(props) => props.withPrefix ? 0 : void 0};
|
|
5964
|
+
border-top-right-radius: ${(props) => props.withSuffix ? 0 : void 0};
|
|
5965
|
+
border-bottom-right-radius: ${(props) => props.withSuffix ? 0 : void 0};
|
|
5958
5966
|
outline: none;
|
|
5959
|
-
padding: ${(props) => `${(props.theme.styles.space + props.theme.styles.gap) / 2}px ${props.theme.styles.space
|
|
5960
|
-
padding-left: ${(props) => props.withLeftIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : void 0};
|
|
5961
|
-
padding-right: ${(props) => props.withRightIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : void 0};
|
|
5967
|
+
padding: ${(props) => `${(props.theme.styles.space + props.theme.styles.gap) / 2}px ${props.theme.styles.space}px`};
|
|
5968
|
+
padding-left: ${(props) => props.withLeftIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : props.withPrefix ? `${props.theme.styles.space}px` : void 0};
|
|
5969
|
+
padding-right: ${(props) => props.withRightIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : props.withSuffix ? `${props.theme.styles.space}px` : void 0};
|
|
5962
5970
|
transition: ${(props) => props.theme.styles.transition};
|
|
5963
5971
|
|
|
5964
5972
|
&::placeholder {
|
|
@@ -6065,7 +6073,7 @@ var TextareaElement = styled10.textarea.withConfig({
|
|
|
6065
6073
|
border: 1px solid ${(props) => props.theme.colors.border};
|
|
6066
6074
|
border-radius: ${(props) => props.theme.styles.borderRadius}px;
|
|
6067
6075
|
outline: none;
|
|
6068
|
-
padding: ${(props) => `${(props.theme.styles.gap + props.theme.styles.space) / 2}px ${props.theme.styles.space
|
|
6076
|
+
padding: ${(props) => `${(props.theme.styles.gap + props.theme.styles.space) / 2}px ${props.theme.styles.space}px`};
|
|
6069
6077
|
padding-left: ${(props) => props.withLeftIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : void 0};
|
|
6070
6078
|
padding-right: ${(props) => props.withRightIcon ? `${props.theme.styles.space + 16 + props.theme.styles.space - 1}px` : void 0};
|
|
6071
6079
|
resize: vertical;
|
|
@@ -6094,6 +6102,8 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
6094
6102
|
infoText,
|
|
6095
6103
|
leftIcon,
|
|
6096
6104
|
rightIcon,
|
|
6105
|
+
prefix,
|
|
6106
|
+
suffix,
|
|
6097
6107
|
insideInputFieldComponent,
|
|
6098
6108
|
withDebounce,
|
|
6099
6109
|
debounceDelay = 0.5,
|
|
@@ -6143,58 +6153,90 @@ var InputFieldComponent = forwardRef11(function InputField({
|
|
|
6143
6153
|
const readyId = id ?? internalId;
|
|
6144
6154
|
return /* @__PURE__ */ jsxs12(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...styledComponentStylesWithExcluded, children: [
|
|
6145
6155
|
label && /* @__PURE__ */ jsx17(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
|
|
6146
|
-
/* @__PURE__ */ jsxs12(Div_default, {
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
{
|
|
6150
|
-
name: leftIcon,
|
|
6151
|
-
position: "absolute",
|
|
6152
|
-
top: (props.type === "date" || props.type === "time" || props.type === "datetime-local" ? 48 : 46) / 2,
|
|
6153
|
-
left: theme2.styles.space + 1,
|
|
6154
|
-
transform: "translateY(-50%)",
|
|
6155
|
-
pointerEvents: "none",
|
|
6156
|
-
zIndex: leftIconZIndex
|
|
6157
|
-
}
|
|
6158
|
-
),
|
|
6159
|
-
/* @__PURE__ */ jsx17(
|
|
6160
|
-
InputElement,
|
|
6156
|
+
/* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "stretch", width: "100%", children: [
|
|
6157
|
+
prefix && /* @__PURE__ */ jsx17(
|
|
6158
|
+
Div_default.row,
|
|
6161
6159
|
{
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
...ariaProps,
|
|
6172
|
-
...restProps,
|
|
6173
|
-
ref
|
|
6160
|
+
alignItems: "center",
|
|
6161
|
+
justifyContent: "center",
|
|
6162
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
6163
|
+
borderRight: "none",
|
|
6164
|
+
backgroundColor: lightenColor(theme2.colors.border, 0.8),
|
|
6165
|
+
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
6166
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
6167
|
+
paddingInline: theme2.styles.space,
|
|
6168
|
+
children: prefix
|
|
6174
6169
|
}
|
|
6175
6170
|
),
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6171
|
+
/* @__PURE__ */ jsxs12(Div_default, { position: "relative", width: "100%", height: "fit-content", ref: holderRef, children: [
|
|
6172
|
+
leftIcon && /* @__PURE__ */ jsx17(
|
|
6173
|
+
Icon_default,
|
|
6174
|
+
{
|
|
6175
|
+
name: leftIcon,
|
|
6176
|
+
position: "absolute",
|
|
6177
|
+
top: (props.type === "date" || props.type === "time" || props.type === "datetime-local" ? 48 : 46) / 2,
|
|
6178
|
+
left: theme2.styles.space + 1,
|
|
6179
|
+
transform: "translateY(-50%)",
|
|
6180
|
+
pointerEvents: "none",
|
|
6181
|
+
zIndex: leftIconZIndex
|
|
6182
|
+
}
|
|
6183
|
+
),
|
|
6184
|
+
/* @__PURE__ */ jsx17(
|
|
6185
|
+
InputElement,
|
|
6186
|
+
{
|
|
6187
|
+
theme: theme2,
|
|
6188
|
+
withLeftIcon: leftIcon !== void 0,
|
|
6189
|
+
withRightIcon: rightIcon !== void 0,
|
|
6190
|
+
withPrefix: prefix !== void 0,
|
|
6191
|
+
withSuffix: suffix !== void 0,
|
|
6192
|
+
required,
|
|
6193
|
+
placeholder: placeholder ?? label,
|
|
6194
|
+
id: readyId,
|
|
6195
|
+
onChange: onChangeElement,
|
|
6196
|
+
...styledComponentStylesWithoutExcluded,
|
|
6197
|
+
...dataProps,
|
|
6198
|
+
...ariaProps,
|
|
6199
|
+
...restProps,
|
|
6200
|
+
ref
|
|
6201
|
+
}
|
|
6202
|
+
),
|
|
6203
|
+
rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx17(
|
|
6204
|
+
Button_default.icon,
|
|
6205
|
+
{
|
|
6206
|
+
icon: rightIcon,
|
|
6207
|
+
position: "absolute",
|
|
6208
|
+
top: 46 / 2,
|
|
6209
|
+
right: theme2.styles.space + 1 - theme2.styles.space / 2,
|
|
6210
|
+
transform: "translateY(-50%)",
|
|
6211
|
+
onClick: onClickRightIcon
|
|
6212
|
+
}
|
|
6213
|
+
) : /* @__PURE__ */ jsx17(
|
|
6214
|
+
Icon_default,
|
|
6215
|
+
{
|
|
6216
|
+
name: rightIcon,
|
|
6217
|
+
position: "absolute",
|
|
6218
|
+
top: 46 / 2,
|
|
6219
|
+
right: theme2.styles.space + 1,
|
|
6220
|
+
transform: "translateY(-50%)",
|
|
6221
|
+
pointerEvents: "none"
|
|
6222
|
+
}
|
|
6223
|
+
) : void 0,
|
|
6224
|
+
insideInputFieldComponent
|
|
6225
|
+
] }),
|
|
6226
|
+
suffix && /* @__PURE__ */ jsx17(
|
|
6227
|
+
Div_default.row,
|
|
6188
6228
|
{
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6229
|
+
alignItems: "center",
|
|
6230
|
+
justifyContent: "center",
|
|
6231
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
6232
|
+
borderLeft: "none",
|
|
6233
|
+
backgroundColor: lightenColor(theme2.colors.border, 0.8),
|
|
6234
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
6235
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
6236
|
+
paddingInline: theme2.styles.space,
|
|
6237
|
+
children: suffix
|
|
6195
6238
|
}
|
|
6196
|
-
)
|
|
6197
|
-
insideInputFieldComponent
|
|
6239
|
+
)
|
|
6198
6240
|
] }),
|
|
6199
6241
|
(errorText || infoText) && /* @__PURE__ */ jsx17(
|
|
6200
6242
|
Text_default,
|