hazo_ui 2.6.2 → 2.6.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/index.d.cts CHANGED
@@ -3,6 +3,54 @@ import * as React from 'react';
3
3
  import { Node, Extension } from '@tiptap/core';
4
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
5
 
6
+ /**
7
+ * hazo_ui_config.ts
8
+ *
9
+ * Purpose: Centralized configuration for hazo_ui component library
10
+ * Provides default colors and styling for buttons, headers, and dialogs
11
+ * Can be overridden globally via set_hazo_ui_config or per-component via props
12
+ */
13
+ interface HazoUiConfig {
14
+ header_background_color?: string;
15
+ header_text_color?: string;
16
+ submit_button_background_color?: string;
17
+ submit_button_text_color?: string;
18
+ submit_button_hover_color?: string;
19
+ cancel_button_background_color?: string;
20
+ cancel_button_text_color?: string;
21
+ cancel_button_border_color?: string;
22
+ cancel_button_hover_color?: string;
23
+ clear_button_background_color?: string;
24
+ clear_button_text_color?: string;
25
+ clear_button_border_color?: string;
26
+ clear_button_hover_color?: string;
27
+ }
28
+ /**
29
+ * Get the current global hazo_ui configuration
30
+ */
31
+ declare function get_hazo_ui_config(): Readonly<HazoUiConfig>;
32
+ /**
33
+ * Set global hazo_ui configuration
34
+ * Merges provided config with existing config (partial update)
35
+ *
36
+ * @param config - Partial configuration to merge with current config
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Set custom submit button color globally
41
+ * set_hazo_ui_config({
42
+ * submit_button_background_color: '#3b82f6',
43
+ * header_background_color: '#1e293b',
44
+ * header_text_color: '#ffffff',
45
+ * });
46
+ * ```
47
+ */
48
+ declare function set_hazo_ui_config(config: Partial<HazoUiConfig>): void;
49
+ /**
50
+ * Reset hazo_ui configuration to defaults
51
+ */
52
+ declare function reset_hazo_ui_config(): void;
53
+
6
54
  interface FilterField {
7
55
  value: string;
8
56
  label: string;
@@ -37,8 +85,18 @@ interface HazoUiMultiFilterDialogProps {
37
85
  initialFilters?: FilterConfig[];
38
86
  title?: string;
39
87
  description?: string;
88
+ headerBackgroundColor?: string;
89
+ headerTextColor?: string;
90
+ submitButtonBackgroundColor?: string;
91
+ submitButtonTextColor?: string;
92
+ cancelButtonBackgroundColor?: string;
93
+ cancelButtonTextColor?: string;
94
+ cancelButtonBorderColor?: string;
95
+ clearButtonBackgroundColor?: string;
96
+ clearButtonTextColor?: string;
97
+ clearButtonBorderColor?: string;
40
98
  }
41
- declare function HazoUiMultiFilterDialog({ availableFields, onFilterChange, initialFilters, title, description, }: HazoUiMultiFilterDialogProps): react_jsx_runtime.JSX.Element;
99
+ declare function HazoUiMultiFilterDialog({ availableFields, onFilterChange, initialFilters, title, description, headerBackgroundColor, headerTextColor, submitButtonBackgroundColor, submitButtonTextColor, cancelButtonBackgroundColor, cancelButtonTextColor, cancelButtonBorderColor, clearButtonBackgroundColor, clearButtonTextColor, clearButtonBorderColor, }: HazoUiMultiFilterDialogProps): react_jsx_runtime.JSX.Element;
42
100
 
43
101
  interface SortField {
44
102
  value: string;
@@ -54,8 +112,18 @@ interface HazoUiMultiSortDialogProps {
54
112
  initialSortFields?: SortConfig[];
55
113
  title?: string;
56
114
  description?: string;
115
+ headerBackgroundColor?: string;
116
+ headerTextColor?: string;
117
+ submitButtonBackgroundColor?: string;
118
+ submitButtonTextColor?: string;
119
+ cancelButtonBackgroundColor?: string;
120
+ cancelButtonTextColor?: string;
121
+ cancelButtonBorderColor?: string;
122
+ clearButtonBackgroundColor?: string;
123
+ clearButtonTextColor?: string;
124
+ clearButtonBorderColor?: string;
57
125
  }
58
- declare function HazoUiMultiSortDialog({ availableFields, onSortChange, initialSortFields, title, description, }: HazoUiMultiSortDialogProps): react_jsx_runtime.JSX.Element;
126
+ declare function HazoUiMultiSortDialog({ availableFields, onSortChange, initialSortFields, title, description, headerBackgroundColor, headerTextColor, submitButtonBackgroundColor, submitButtonTextColor, cancelButtonBackgroundColor, cancelButtonTextColor, cancelButtonBorderColor, clearButtonBackgroundColor, clearButtonTextColor, clearButtonBorderColor, }: HazoUiMultiSortDialogProps): react_jsx_runtime.JSX.Element;
59
127
 
60
128
  interface HazoUiFlexRadioItem {
61
129
  label: string;
@@ -550,6 +618,7 @@ declare const HazoUiTextarea: React.FC<HazoUiTextareaProps>;
550
618
 
551
619
  type AnimationPreset = 'zoom' | 'slide' | 'fade' | 'bounce' | 'scale-up' | 'flip' | 'slide-left' | 'slide-right' | 'slide-top' | 'none';
552
620
  type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
621
+ type DialogVariant = 'default' | 'info' | 'success' | 'warning' | 'danger';
553
622
  interface HazoUiDialogProps {
554
623
  open?: boolean;
555
624
  onOpenChange?: (open: boolean) => void;
@@ -593,7 +662,15 @@ interface HazoUiDialogProps {
593
662
  sizeHeight?: string;
594
663
  openAnimation?: AnimationPreset | string;
595
664
  closeAnimation?: AnimationPreset | string;
665
+ variant?: DialogVariant;
666
+ /**
667
+ * Controls header layout when a variant is active.
668
+ * - true (default): title and description get separate background rows
669
+ * - false: single header background, description rendered as italic subtext
670
+ */
671
+ splitHeader?: boolean;
596
672
  headerBackgroundColor?: string;
673
+ descriptionBackgroundColor?: string;
597
674
  headerTextColor?: string;
598
675
  bodyBackgroundColor?: string;
599
676
  footerBackgroundColor?: string;
@@ -613,7 +690,7 @@ interface HazoUiDialogProps {
613
690
  *
614
691
  * A flexible dialog component with standardized layout and customizable behavior
615
692
  */
616
- declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, openAnimation, closeAnimation, headerBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): react_jsx_runtime.JSX.Element;
693
+ declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): react_jsx_runtime.JSX.Element;
617
694
 
618
695
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
619
696
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -632,4 +709,4 @@ declare const DialogFooter: {
632
709
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
633
710
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
634
711
 
635
- export { type AnimationPreset, type BaseCommandInputProps, type CommandEditContext, type CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type FilterConfig, type FilterField, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, type InsertedCommand, type PrefixColor, type PrefixConfig, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField, type SuggestionState, create_command_suggestion_extension, parse_commands_from_text, text_to_tiptap_content };
712
+ export { type AnimationPreset, type BaseCommandInputProps, type CommandEditContext, type CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type DialogVariant, type FilterConfig, type FilterField, type HazoUiConfig, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, type InsertedCommand, type PrefixColor, type PrefixConfig, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField, type SuggestionState, create_command_suggestion_extension, get_hazo_ui_config, parse_commands_from_text, reset_hazo_ui_config, set_hazo_ui_config, text_to_tiptap_content };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,54 @@ import * as React from 'react';
3
3
  import { Node, Extension } from '@tiptap/core';
4
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
5
 
6
+ /**
7
+ * hazo_ui_config.ts
8
+ *
9
+ * Purpose: Centralized configuration for hazo_ui component library
10
+ * Provides default colors and styling for buttons, headers, and dialogs
11
+ * Can be overridden globally via set_hazo_ui_config or per-component via props
12
+ */
13
+ interface HazoUiConfig {
14
+ header_background_color?: string;
15
+ header_text_color?: string;
16
+ submit_button_background_color?: string;
17
+ submit_button_text_color?: string;
18
+ submit_button_hover_color?: string;
19
+ cancel_button_background_color?: string;
20
+ cancel_button_text_color?: string;
21
+ cancel_button_border_color?: string;
22
+ cancel_button_hover_color?: string;
23
+ clear_button_background_color?: string;
24
+ clear_button_text_color?: string;
25
+ clear_button_border_color?: string;
26
+ clear_button_hover_color?: string;
27
+ }
28
+ /**
29
+ * Get the current global hazo_ui configuration
30
+ */
31
+ declare function get_hazo_ui_config(): Readonly<HazoUiConfig>;
32
+ /**
33
+ * Set global hazo_ui configuration
34
+ * Merges provided config with existing config (partial update)
35
+ *
36
+ * @param config - Partial configuration to merge with current config
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Set custom submit button color globally
41
+ * set_hazo_ui_config({
42
+ * submit_button_background_color: '#3b82f6',
43
+ * header_background_color: '#1e293b',
44
+ * header_text_color: '#ffffff',
45
+ * });
46
+ * ```
47
+ */
48
+ declare function set_hazo_ui_config(config: Partial<HazoUiConfig>): void;
49
+ /**
50
+ * Reset hazo_ui configuration to defaults
51
+ */
52
+ declare function reset_hazo_ui_config(): void;
53
+
6
54
  interface FilterField {
7
55
  value: string;
8
56
  label: string;
@@ -37,8 +85,18 @@ interface HazoUiMultiFilterDialogProps {
37
85
  initialFilters?: FilterConfig[];
38
86
  title?: string;
39
87
  description?: string;
88
+ headerBackgroundColor?: string;
89
+ headerTextColor?: string;
90
+ submitButtonBackgroundColor?: string;
91
+ submitButtonTextColor?: string;
92
+ cancelButtonBackgroundColor?: string;
93
+ cancelButtonTextColor?: string;
94
+ cancelButtonBorderColor?: string;
95
+ clearButtonBackgroundColor?: string;
96
+ clearButtonTextColor?: string;
97
+ clearButtonBorderColor?: string;
40
98
  }
41
- declare function HazoUiMultiFilterDialog({ availableFields, onFilterChange, initialFilters, title, description, }: HazoUiMultiFilterDialogProps): react_jsx_runtime.JSX.Element;
99
+ declare function HazoUiMultiFilterDialog({ availableFields, onFilterChange, initialFilters, title, description, headerBackgroundColor, headerTextColor, submitButtonBackgroundColor, submitButtonTextColor, cancelButtonBackgroundColor, cancelButtonTextColor, cancelButtonBorderColor, clearButtonBackgroundColor, clearButtonTextColor, clearButtonBorderColor, }: HazoUiMultiFilterDialogProps): react_jsx_runtime.JSX.Element;
42
100
 
43
101
  interface SortField {
44
102
  value: string;
@@ -54,8 +112,18 @@ interface HazoUiMultiSortDialogProps {
54
112
  initialSortFields?: SortConfig[];
55
113
  title?: string;
56
114
  description?: string;
115
+ headerBackgroundColor?: string;
116
+ headerTextColor?: string;
117
+ submitButtonBackgroundColor?: string;
118
+ submitButtonTextColor?: string;
119
+ cancelButtonBackgroundColor?: string;
120
+ cancelButtonTextColor?: string;
121
+ cancelButtonBorderColor?: string;
122
+ clearButtonBackgroundColor?: string;
123
+ clearButtonTextColor?: string;
124
+ clearButtonBorderColor?: string;
57
125
  }
58
- declare function HazoUiMultiSortDialog({ availableFields, onSortChange, initialSortFields, title, description, }: HazoUiMultiSortDialogProps): react_jsx_runtime.JSX.Element;
126
+ declare function HazoUiMultiSortDialog({ availableFields, onSortChange, initialSortFields, title, description, headerBackgroundColor, headerTextColor, submitButtonBackgroundColor, submitButtonTextColor, cancelButtonBackgroundColor, cancelButtonTextColor, cancelButtonBorderColor, clearButtonBackgroundColor, clearButtonTextColor, clearButtonBorderColor, }: HazoUiMultiSortDialogProps): react_jsx_runtime.JSX.Element;
59
127
 
60
128
  interface HazoUiFlexRadioItem {
61
129
  label: string;
@@ -550,6 +618,7 @@ declare const HazoUiTextarea: React.FC<HazoUiTextareaProps>;
550
618
 
551
619
  type AnimationPreset = 'zoom' | 'slide' | 'fade' | 'bounce' | 'scale-up' | 'flip' | 'slide-left' | 'slide-right' | 'slide-top' | 'none';
552
620
  type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
621
+ type DialogVariant = 'default' | 'info' | 'success' | 'warning' | 'danger';
553
622
  interface HazoUiDialogProps {
554
623
  open?: boolean;
555
624
  onOpenChange?: (open: boolean) => void;
@@ -593,7 +662,15 @@ interface HazoUiDialogProps {
593
662
  sizeHeight?: string;
594
663
  openAnimation?: AnimationPreset | string;
595
664
  closeAnimation?: AnimationPreset | string;
665
+ variant?: DialogVariant;
666
+ /**
667
+ * Controls header layout when a variant is active.
668
+ * - true (default): title and description get separate background rows
669
+ * - false: single header background, description rendered as italic subtext
670
+ */
671
+ splitHeader?: boolean;
596
672
  headerBackgroundColor?: string;
673
+ descriptionBackgroundColor?: string;
597
674
  headerTextColor?: string;
598
675
  bodyBackgroundColor?: string;
599
676
  footerBackgroundColor?: string;
@@ -613,7 +690,7 @@ interface HazoUiDialogProps {
613
690
  *
614
691
  * A flexible dialog component with standardized layout and customizable behavior
615
692
  */
616
- declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, openAnimation, closeAnimation, headerBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): react_jsx_runtime.JSX.Element;
693
+ declare function HazoUiDialog({ open, onOpenChange, children, onConfirm, onCancel, title, description, actionButtonText, actionButtonVariant, cancelButtonText, showCancelButton, actionButtonLoading, actionButtonDisabled, actionButtonIcon, footerContent, sizeWidth, sizeHeight, openAnimation, closeAnimation, variant, splitHeader, headerBackgroundColor, descriptionBackgroundColor, headerTextColor, bodyBackgroundColor, footerBackgroundColor, borderColor, accentColor, headerBar, headerBarColor, className, contentClassName, overlayClassName, headerClassName, footerClassName, showCloseButton, }: HazoUiDialogProps): react_jsx_runtime.JSX.Element;
617
694
 
618
695
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
619
696
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -632,4 +709,4 @@ declare const DialogFooter: {
632
709
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
633
710
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
634
711
 
635
- export { type AnimationPreset, type BaseCommandInputProps, type CommandEditContext, type CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type FilterConfig, type FilterField, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, type InsertedCommand, type PrefixColor, type PrefixConfig, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField, type SuggestionState, create_command_suggestion_extension, parse_commands_from_text, text_to_tiptap_content };
712
+ export { type AnimationPreset, type BaseCommandInputProps, type CommandEditContext, type CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type DialogVariant, type FilterConfig, type FilterField, type HazoUiConfig, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, type InsertedCommand, type PrefixColor, type PrefixConfig, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField, type SuggestionState, create_command_suggestion_extension, get_hazo_ui_config, parse_commands_from_text, reset_hazo_ui_config, set_hazo_ui_config, text_to_tiptap_content };