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.
@@ -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?: ReactNode;
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: "omni-tab-label-wrapper", children: item.label })
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
- const hasIcons = icon || endIcon;
3223
- const leftIcon = icon && iconPosition === "left" ? icon : void 0;
3224
- const rightIcon = endIcon || (icon && iconPosition === "right" ? icon : void 0);
3225
- const fieldContent = hasIcons ? /* @__PURE__ */ jsxs(IconField, { iconPosition, className: "omni-iconfield", children: [
3226
- leftIcon && /* @__PURE__ */ jsx(InputIcon, { children: leftIcon }),
3227
- inputElement,
3228
- rightIcon && /* @__PURE__ */ jsx(InputIcon, { children: rightIcon })
3229
- ] }) : inputElement;
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",