hiver-ui-kit-extended 1.0.0-beta.14 → 1.0.0-beta.16

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.
@@ -1,6 +1,8 @@
1
1
  import { BreadCrumbProps } from 'primereact/breadcrumb';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
+ import { ButtonProps as ButtonProps_2 } from 'primereact/button';
3
4
  import { ChipProps as ChipProps_2 } from 'primereact/chip';
5
+ import { CSSProperties } from 'react';
4
6
  import { DataTableProps as DataTableProps_2 } from 'primereact/datatable';
5
7
  import { default as default_2 } from 'react';
6
8
  import { DialogProps as DialogProps_2 } from 'primereact/dialog';
@@ -101,13 +103,94 @@ export declare interface DialogProps {
101
103
  variant?: 'standard' | 'confirmation';
102
104
  /** Callback fired when the back button is clicked (for confirmation variant) */
103
105
  onBack?: () => void;
106
+ /** If true, shows the back button in confirmation variant (defaults to true) */
107
+ showBackButton?: boolean;
108
+ /** If true, shows the close button (defaults to true) */
109
+ showCloseButton?: boolean;
104
110
  className?: string;
105
111
  style?: React.CSSProperties;
106
112
  rest?: DialogProps_2;
107
113
  }
108
114
 
115
+ export declare const IconButton: default_2.FC<IconButtonProps_2>;
116
+
117
+ declare type IconButtonColor = 'default' | 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'inherit';
118
+
119
+ export declare interface IconButtonProps {
120
+ /** The icon element to display (for HUI) */
121
+ children?: ReactNode;
122
+ /** PrimeReact icon class (e.g., 'pi pi-check') */
123
+ icon?: string;
124
+ /** Image source for custom icon (alternative to icon prop) */
125
+ image?: string;
126
+ /** Alt text for the image */
127
+ alt?: string;
128
+ /** The color of the button (for HUI) */
129
+ color?: IconButtonColor;
130
+ /** The size of the button (for HUI) */
131
+ size?: IconButtonSize | PrimeReactSize;
132
+ /** Whether the button is disabled */
133
+ disabled?: boolean;
134
+ /** Click handler */
135
+ onClick?: (event: MouseEvent_2<HTMLButtonElement>) => void;
136
+ /** Additional CSS classes */
137
+ className?: string;
138
+ /** Additional CSS classes for the icon wrapper */
139
+ iconWrapperClassName?: string;
140
+ /** Additional CSS classes for the icon/image */
141
+ iconClassName?: string;
142
+ /** Inline styles */
143
+ style?: CSSProperties;
144
+ /** The edge placement of the button (for HUI) */
145
+ edge?: 'start' | 'end' | false;
146
+ /** Aria label for accessibility */
147
+ ariaLabel?: string;
148
+ /** Aria label for accessibility (alternative) */
149
+ 'aria-label'?: string;
150
+ /** Rounded corners */
151
+ rounded?: boolean;
152
+ /** Outlined style */
153
+ outlined?: boolean;
154
+ /** Text style (no background) */
155
+ text?: boolean;
156
+ /** Raised/elevated style */
157
+ raised?: boolean;
158
+ }
159
+
160
+ declare interface IconButtonProps_2 extends Omit<ButtonProps_2, 'icon' | 'size'> {
161
+ /** PrimeReact icon class (e.g., 'pi pi-check') */
162
+ icon?: string;
163
+ /** Image source for custom icon (alternative to icon prop) */
164
+ image?: string;
165
+ /** Alt text for the image */
166
+ alt?: string;
167
+ /** Click handler */
168
+ onClick?: (event: default_2.MouseEvent<HTMLButtonElement>) => void;
169
+ /** Additional CSS classes for the button */
170
+ className?: string;
171
+ /** Additional CSS classes for the icon wrapper */
172
+ iconWrapperClassName?: string;
173
+ /** Additional CSS classes for the icon/image */
174
+ iconClassName?: string;
175
+ /** Aria label for accessibility */
176
+ ariaLabel?: string;
177
+ /** Whether the button is disabled */
178
+ disabled?: boolean;
179
+ /** Severity/color variant */
180
+ /** Size variant */
181
+ size?: Size;
182
+ /** Rounded corners */
183
+ rounded?: boolean;
184
+ /** Outlined style */
185
+ outlined?: boolean;
186
+ }
187
+
188
+ declare type IconButtonSize = 'small' | 'medium' | 'large';
189
+
109
190
  declare type IconType = ReactNode | string;
110
191
 
192
+ declare type PrimeReactSize = 'sm' | 'md' | 'lg' | 'xl';
193
+
111
194
  export declare const PrimeReactTheme: {
112
195
  primitive: {
113
196
  borderRadius: {
@@ -998,6 +1081,8 @@ declare interface PrimeReactThemeProviderProps {
998
1081
  theme?: typeof PrimeReactTheme;
999
1082
  }
1000
1083
 
1084
+ declare type Size = 'sm' | 'md' | 'lg' | 'xl';
1085
+
1001
1086
  export declare type SxProps = React.CSSProperties | ((theme: any) => React.CSSProperties);
1002
1087
 
1003
1088
  export declare const Tab: default_2.FC<TabProps>;
package/dist/env.prime.js CHANGED
@@ -3392,6 +3392,10 @@ const Toast = forwardRef(({ position = "top-right", className }, ref) => {
3392
3392
  });
3393
3393
  Toast.displayName = "Toast";
3394
3394
 
3395
+ const closeIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%3e%3cpath%20d='M10.5%203.5L3.5%2010.5M3.5%203.5L10.5%2010.5'%20stroke='%2364758B'%20stroke-width='1.1'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
3396
+
3397
+ const backIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M13.3334%208H2.66675M2.66675%208L6.66675%2012M2.66675%208L6.66675%204'%20stroke='%23334155'%20stroke-width='1.3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
3398
+
3395
3399
  function Dialog(props) {
3396
3400
  const {
3397
3401
  children,
@@ -3407,6 +3411,8 @@ function Dialog(props) {
3407
3411
  footer,
3408
3412
  variant = "confirmation",
3409
3413
  onBack,
3414
+ showBackButton = true,
3415
+ showCloseButton = true,
3410
3416
  ...rest
3411
3417
  } = props;
3412
3418
  const handleHide = () => {
@@ -3440,21 +3446,37 @@ function Dialog(props) {
3440
3446
  onClose({}, "backdropClick");
3441
3447
  }
3442
3448
  };
3449
+ const handleClose = () => {
3450
+ if (onClose) {
3451
+ onClose({}, "backdropClick");
3452
+ }
3453
+ };
3443
3454
  const renderHeader = () => {
3444
3455
  if (variant === "confirmation" && title) {
3445
- return /* @__PURE__ */ jsxs("div", { className: "omni-dialog-header-confirmation", children: [
3446
- /* @__PURE__ */ jsx(
3456
+ return /* @__PURE__ */ jsx("div", { className: "omni-dialog-header-confirmation", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
3457
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-start gap-2.5", children: [
3458
+ showBackButton && /* @__PURE__ */ jsx(
3459
+ "button",
3460
+ {
3461
+ type: "button",
3462
+ className: "omni-dialog-back-button",
3463
+ onClick: handleBack,
3464
+ "aria-label": "Go back",
3465
+ children: /* @__PURE__ */ jsx("img", { src: backIcon, alt: "Close" })
3466
+ }
3467
+ ),
3468
+ /* @__PURE__ */ jsx("div", { className: "omni-dialog-title-confirmation", children: title })
3469
+ ] }),
3470
+ showCloseButton && /* @__PURE__ */ jsx(
3447
3471
  "button",
3448
3472
  {
3449
3473
  type: "button",
3450
- className: "omni-dialog-back-button",
3451
- onClick: handleBack,
3452
- "aria-label": "Go back",
3453
- children: /* @__PURE__ */ jsx("i", { className: "pi pi-arrow-left" })
3474
+ className: "omni-dialog-close-button",
3475
+ onClick: handleClose,
3476
+ children: /* @__PURE__ */ jsx("img", { src: closeIcon, alt: "Close" })
3454
3477
  }
3455
- ),
3456
- /* @__PURE__ */ jsx("div", { className: "omni-dialog-title-confirmation", children: title })
3457
- ] });
3478
+ )
3479
+ ] }) });
3458
3480
  }
3459
3481
  return title;
3460
3482
  };
@@ -3657,5 +3679,56 @@ function Typography({
3657
3679
  return /* @__PURE__ */ jsx(Component, { className: classes, ...rest, children: children || text });
3658
3680
  }
3659
3681
 
3660
- export { Breadcrumb, Button, Chip, DataTable, Dialog, Tab, Tabs, TextField, Toast, Typography };
3682
+ const IconButton = ({
3683
+ icon,
3684
+ image,
3685
+ alt = "",
3686
+ onClick,
3687
+ className = "",
3688
+ iconWrapperClassName = "",
3689
+ iconClassName = "",
3690
+ ariaLabel,
3691
+ disabled = false,
3692
+ size = "md",
3693
+ rounded = false,
3694
+ outlined = false,
3695
+ text = false,
3696
+ raised = false,
3697
+ ...rest
3698
+ }) => {
3699
+ const sizeClass = `icon-button--${size}`;
3700
+ const variantClasses = [
3701
+ outlined && "icon-button--outlined",
3702
+ text && "icon-button--text",
3703
+ rounded && "icon-button--rounded",
3704
+ raised && "icon-button--raised"
3705
+ ].filter(Boolean).join(" ");
3706
+ if (image) {
3707
+ return /* @__PURE__ */ jsx(
3708
+ "button",
3709
+ {
3710
+ className: `icon-button ${sizeClass} ${variantClasses} ${className}`.trim(),
3711
+ onClick,
3712
+ "aria-label": ariaLabel,
3713
+ disabled,
3714
+ children: /* @__PURE__ */ jsx("div", { className: `icon-button__icon-wrapper ${iconWrapperClassName}`, children: /* @__PURE__ */ jsx("img", { src: image, alt, className: `icon-button__icon ${iconClassName}` }) })
3715
+ }
3716
+ );
3717
+ }
3718
+ return /* @__PURE__ */ jsx(
3719
+ Button$1,
3720
+ {
3721
+ icon,
3722
+ onClick,
3723
+ className,
3724
+ "aria-label": ariaLabel,
3725
+ disabled,
3726
+ rounded,
3727
+ outlined,
3728
+ ...rest
3729
+ }
3730
+ );
3731
+ };
3732
+
3733
+ export { Breadcrumb, Button, Chip, DataTable, Dialog, IconButton, Tab, Tabs, TextField, Toast, Typography };
3661
3734
  //# sourceMappingURL=env.prime.js.map