hiver-ui-kit-extended 1.0.0-beta.2 → 1.0.0-beta.4
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/env.hui.d.ts +3 -2
- package/dist/env.hui.js +16 -7
- package/dist/env.hui.js.map +1 -1
- package/dist/env.prime.d.ts +3 -2
- package/dist/env.prime.js +25 -10
- package/dist/env.prime.js.map +1 -1
- package/dist/hiver-ui-kit-extended.css +4 -4
- package/package.json +1 -1
package/dist/env.prime.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ export declare interface DialogProps {
|
|
|
104
104
|
style?: React.CSSProperties;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
declare type IconType = ReactNode | string;
|
|
108
|
+
|
|
107
109
|
export declare type SxProps = React.CSSProperties | ((theme: any) => React.CSSProperties);
|
|
108
110
|
|
|
109
111
|
export declare const Tab: default_2.FC<TabProps>;
|
|
@@ -166,8 +168,7 @@ export declare interface TextFieldProps {
|
|
|
166
168
|
label?: string;
|
|
167
169
|
fullWidth?: boolean;
|
|
168
170
|
size?: 'small' | 'medium';
|
|
169
|
-
icon?:
|
|
170
|
-
endIcon?: ReactNode;
|
|
171
|
+
icon?: IconType;
|
|
171
172
|
iconPosition?: 'left' | 'right';
|
|
172
173
|
children?: ReactNode;
|
|
173
174
|
}
|
package/dist/env.prime.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import At, { useMemo, useId, forwardRef, useImperativeHandle } from 'react';
|
|
3
4
|
import { TabView, TabPanel } from 'primereact/tabview';
|
|
@@ -3060,7 +3061,10 @@ const Tabs = ({ value, onTabChange, items, className }) => {
|
|
|
3060
3061
|
isActive && "omni-tab-header-active"
|
|
3061
3062
|
), children: [
|
|
3062
3063
|
item.icon && /* @__PURE__ */ jsx("span", { className: "omni-tab-icon-wrapper", children: item.icon }),
|
|
3063
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
3064
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
3065
|
+
"omni-tab-label-wrapper",
|
|
3066
|
+
isActive ? "omni-tab-label-active" : "omni-tab-label-inactive"
|
|
3067
|
+
), children: item.label })
|
|
3064
3068
|
] });
|
|
3065
3069
|
};
|
|
3066
3070
|
return /* @__PURE__ */ jsx(
|
|
@@ -3168,6 +3172,12 @@ function Button(props) {
|
|
|
3168
3172
|
);
|
|
3169
3173
|
}
|
|
3170
3174
|
|
|
3175
|
+
function renderIcon(icon) {
|
|
3176
|
+
if (typeof icon === "string") {
|
|
3177
|
+
return /* @__PURE__ */ jsx("img", { src: icon, alt: "", "aria-hidden": "true" });
|
|
3178
|
+
}
|
|
3179
|
+
return icon;
|
|
3180
|
+
}
|
|
3171
3181
|
function TextField(props) {
|
|
3172
3182
|
const {
|
|
3173
3183
|
value,
|
|
@@ -3187,7 +3197,6 @@ function TextField(props) {
|
|
|
3187
3197
|
fullWidth = true,
|
|
3188
3198
|
size = "medium",
|
|
3189
3199
|
icon,
|
|
3190
|
-
endIcon,
|
|
3191
3200
|
iconPosition = "left"
|
|
3192
3201
|
} = props;
|
|
3193
3202
|
const generatedId = useId();
|
|
@@ -3219,14 +3228,20 @@ function TextField(props) {
|
|
|
3219
3228
|
invalid: error
|
|
3220
3229
|
}
|
|
3221
3230
|
);
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3231
|
+
let fieldContent;
|
|
3232
|
+
if (icon && iconPosition === "left") {
|
|
3233
|
+
fieldContent = /* @__PURE__ */ jsxs(IconField, { iconPosition: "left", className: "omni-iconfield", children: [
|
|
3234
|
+
/* @__PURE__ */ jsx(InputIcon, { children: renderIcon(icon) }),
|
|
3235
|
+
inputElement
|
|
3236
|
+
] });
|
|
3237
|
+
} else if (icon && iconPosition === "right") {
|
|
3238
|
+
fieldContent = /* @__PURE__ */ jsxs(IconField, { iconPosition: "right", className: "omni-iconfield", children: [
|
|
3239
|
+
inputElement,
|
|
3240
|
+
/* @__PURE__ */ jsx(InputIcon, { children: renderIcon(icon) })
|
|
3241
|
+
] });
|
|
3242
|
+
} else {
|
|
3243
|
+
fieldContent = inputElement;
|
|
3244
|
+
}
|
|
3230
3245
|
return /* @__PURE__ */ jsxs("div", { className: cn("omni-textfield", { "w-full": fullWidth }), children: [
|
|
3231
3246
|
label && /* @__PURE__ */ jsx(
|
|
3232
3247
|
"label",
|