hiver-ui-kit-extended 1.0.0-beta.2 → 1.0.0-beta.5

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.
@@ -5,11 +5,11 @@ import { DataTableProps as DataTableProps_2 } from 'primereact/datatable';
5
5
  import { default as default_2 } from 'react';
6
6
  import { ElementType } from 'react';
7
7
  import { HTMLAttributes } from 'react';
8
- import { JSX } from 'react/jsx-runtime';
8
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
9
9
  import { MouseEvent as MouseEvent_2 } from 'react';
10
10
  import { ReactNode } from 'react';
11
11
 
12
- export declare function Breadcrumb({ items, className, style, ...rest }: BreadcrumbProps): JSX.Element;
12
+ export declare function Breadcrumb({ items, className, style, ...rest }: BreadcrumbProps): JSX_2.Element;
13
13
 
14
14
  export declare interface BreadcrumbItem {
15
15
  label?: string;
@@ -23,7 +23,7 @@ export declare interface BreadcrumbProps extends Omit<BreadCrumbProps, 'model' |
23
23
  style?: React.CSSProperties;
24
24
  }
25
25
 
26
- export declare function Button(props: ButtonProps): JSX.Element;
26
+ export declare function Button(props: ButtonProps): JSX_2.Element;
27
27
 
28
28
  export declare interface ButtonProps {
29
29
  label?: string;
@@ -40,7 +40,7 @@ export declare interface ButtonProps {
40
40
  badge?: string;
41
41
  }
42
42
 
43
- export declare function Chip(props: ChipProps): JSX.Element;
43
+ export declare function Chip(props: ChipProps): JSX_2.Element;
44
44
 
45
45
  export declare interface ChipProps extends Omit<ChipProps_2, 'label'> {
46
46
  label?: string | ReactNode;
@@ -59,7 +59,7 @@ declare interface ColumnConfig {
59
59
  [key: string]: any;
60
60
  }
61
61
 
62
- export declare function DataTable<T extends DataTableValueArray = DataTableValueArray>(props: DataTableProps<T>): JSX.Element;
62
+ export declare function DataTable<T extends DataTableValueArray = DataTableValueArray>(props: DataTableProps<T>): JSX_2.Element;
63
63
 
64
64
  export declare interface DataTableProps<T extends DataTableValueArray = DataTableValueArray> extends Omit<DataTableProps_2<T>, 'children' | 'rows' | 'onRowClick'> {
65
65
  children?: ReactNode;
@@ -74,7 +74,7 @@ export declare interface DataTableProps<T extends DataTableValueArray = DataTabl
74
74
 
75
75
  declare type DataTableValueArray = Array<Record<string, any>>;
76
76
 
77
- export declare function Dialog(props: DialogProps): JSX.Element;
77
+ export declare function Dialog(props: DialogProps): JSX_2.Element;
78
78
 
79
79
  export declare interface DialogProps {
80
80
  children: ReactNode;
@@ -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>;
@@ -147,7 +149,7 @@ export declare type TabsTextColor = 'primary' | 'secondary' | 'inherit';
147
149
 
148
150
  export declare type TabsVariant = 'standard' | 'scrollable' | 'fullWidth';
149
151
 
150
- export declare function TextField(props: TextFieldProps): JSX.Element;
152
+ export declare function TextField(props: TextFieldProps): JSX_2.Element;
151
153
 
152
154
  export declare interface TextFieldProps {
153
155
  value?: string;
@@ -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
  }
@@ -203,7 +204,7 @@ export declare interface ToastRef {
203
204
 
204
205
  export declare type ToastSeverity = 'success' | 'error' | 'warning' | 'info';
205
206
 
206
- export declare function Typography({ text, variant, tag, noWrap, children, className, ...rest }: TypographyProps): JSX.Element;
207
+ export declare function Typography({ text, variant, tag, noWrap, children, className, ...rest }: TypographyProps): JSX_2.Element;
207
208
 
208
209
  export declare interface TypographyProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
209
210
  text?: string;
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",