hazo_ui 2.6.2 → 2.6.3
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/README.md +151 -53
- package/dist/index.cjs +254 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -4
- package/dist/index.d.ts +81 -4
- package/dist/index.js +252 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as React27 from 'react';
|
|
2
3
|
import React27__default, { useRef, useState, useCallback, useEffect, useMemo, Fragment } from 'react';
|
|
3
4
|
import { Slot } from '@radix-ui/react-slot';
|
|
@@ -113,6 +114,37 @@ var require_objectWithoutPropertiesLoose = __commonJS({
|
|
|
113
114
|
module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
114
115
|
}
|
|
115
116
|
});
|
|
117
|
+
|
|
118
|
+
// src/lib/hazo_ui_config.ts
|
|
119
|
+
var default_config = {
|
|
120
|
+
// Headers use default theme colors by default (no override)
|
|
121
|
+
header_background_color: void 0,
|
|
122
|
+
header_text_color: void 0,
|
|
123
|
+
// Submit buttons use primary/default variant (no override needed for default styling)
|
|
124
|
+
submit_button_background_color: void 0,
|
|
125
|
+
submit_button_text_color: void 0,
|
|
126
|
+
submit_button_hover_color: void 0,
|
|
127
|
+
// Cancel buttons use outline variant (no override needed for default styling)
|
|
128
|
+
cancel_button_background_color: void 0,
|
|
129
|
+
cancel_button_text_color: void 0,
|
|
130
|
+
cancel_button_border_color: void 0,
|
|
131
|
+
cancel_button_hover_color: void 0,
|
|
132
|
+
// Clear buttons use outline variant (no override needed for default styling)
|
|
133
|
+
clear_button_background_color: void 0,
|
|
134
|
+
clear_button_text_color: void 0,
|
|
135
|
+
clear_button_border_color: void 0,
|
|
136
|
+
clear_button_hover_color: void 0
|
|
137
|
+
};
|
|
138
|
+
var global_config = { ...default_config };
|
|
139
|
+
function get_hazo_ui_config() {
|
|
140
|
+
return { ...global_config };
|
|
141
|
+
}
|
|
142
|
+
function set_hazo_ui_config(config) {
|
|
143
|
+
global_config = { ...global_config, ...config };
|
|
144
|
+
}
|
|
145
|
+
function reset_hazo_ui_config() {
|
|
146
|
+
global_config = { ...default_config };
|
|
147
|
+
}
|
|
116
148
|
function cn(...inputs) {
|
|
117
149
|
return twMerge(clsx(inputs));
|
|
118
150
|
}
|
|
@@ -728,8 +760,47 @@ function HazoUiMultiFilterDialog({
|
|
|
728
760
|
onFilterChange,
|
|
729
761
|
initialFilters = [],
|
|
730
762
|
title = "Filter",
|
|
731
|
-
description = "Add multiple fields to filter by. Select a field and set its filter value."
|
|
763
|
+
description = "Add multiple fields to filter by. Select a field and set its filter value.",
|
|
764
|
+
headerBackgroundColor,
|
|
765
|
+
headerTextColor,
|
|
766
|
+
submitButtonBackgroundColor,
|
|
767
|
+
submitButtonTextColor,
|
|
768
|
+
cancelButtonBackgroundColor,
|
|
769
|
+
cancelButtonTextColor,
|
|
770
|
+
cancelButtonBorderColor,
|
|
771
|
+
clearButtonBackgroundColor,
|
|
772
|
+
clearButtonTextColor,
|
|
773
|
+
clearButtonBorderColor
|
|
732
774
|
}) {
|
|
775
|
+
const config = get_hazo_ui_config();
|
|
776
|
+
const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
|
|
777
|
+
const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
|
|
778
|
+
const finalCancelBgColor = cancelButtonBackgroundColor ?? config.cancel_button_background_color;
|
|
779
|
+
const finalCancelTextColor = cancelButtonTextColor ?? config.cancel_button_text_color;
|
|
780
|
+
const finalCancelBorderColor = cancelButtonBorderColor ?? config.cancel_button_border_color;
|
|
781
|
+
const finalClearBgColor = clearButtonBackgroundColor ?? config.clear_button_background_color;
|
|
782
|
+
const finalClearTextColor = clearButtonTextColor ?? config.clear_button_text_color;
|
|
783
|
+
const finalClearBorderColor = clearButtonBorderColor ?? config.clear_button_border_color;
|
|
784
|
+
const submitButtonStyles = {
|
|
785
|
+
...finalSubmitBgColor && { backgroundColor: finalSubmitBgColor, borderColor: finalSubmitBgColor },
|
|
786
|
+
...finalSubmitTextColor && { color: finalSubmitTextColor }
|
|
787
|
+
};
|
|
788
|
+
const cancelButtonStyles = {
|
|
789
|
+
...finalCancelBgColor && { backgroundColor: finalCancelBgColor },
|
|
790
|
+
...finalCancelTextColor && { color: finalCancelTextColor },
|
|
791
|
+
...finalCancelBorderColor && { borderColor: finalCancelBorderColor }
|
|
792
|
+
};
|
|
793
|
+
const clearButtonStyles = {
|
|
794
|
+
...finalClearBgColor && { backgroundColor: finalClearBgColor },
|
|
795
|
+
...finalClearTextColor && { color: finalClearTextColor },
|
|
796
|
+
...finalClearBorderColor && { borderColor: finalClearBorderColor }
|
|
797
|
+
};
|
|
798
|
+
const finalHeaderBgColor = headerBackgroundColor ?? config.header_background_color;
|
|
799
|
+
const finalHeaderTextColor = headerTextColor ?? config.header_text_color;
|
|
800
|
+
const headerStyles = {
|
|
801
|
+
...finalHeaderBgColor && { backgroundColor: finalHeaderBgColor },
|
|
802
|
+
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
803
|
+
};
|
|
733
804
|
const [isOpen, setIsOpen] = useState(false);
|
|
734
805
|
const [filterFields, setFilterFields] = useState(initialFilters);
|
|
735
806
|
const [isComboboxOpen, setIsComboboxOpen] = useState(false);
|
|
@@ -849,7 +920,7 @@ function HazoUiMultiFilterDialog({
|
|
|
849
920
|
/* @__PURE__ */ jsx(TooltipContent, { children: tooltipContent })
|
|
850
921
|
] }) }),
|
|
851
922
|
/* @__PURE__ */ jsxs(DialogContent, { className: "cls_filter_dialog_content max-w-lg w-full max-h-[90vh] overflow-y-auto", children: [
|
|
852
|
-
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
923
|
+
/* @__PURE__ */ jsxs(DialogHeader, { style: headerStyles, children: [
|
|
853
924
|
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
854
925
|
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
855
926
|
] }),
|
|
@@ -919,6 +990,7 @@ function HazoUiMultiFilterDialog({
|
|
|
919
990
|
variant: "outline",
|
|
920
991
|
onClick: handleClearAll,
|
|
921
992
|
className: "cls_clear_all_btn",
|
|
993
|
+
style: clearButtonStyles,
|
|
922
994
|
children: [
|
|
923
995
|
/* @__PURE__ */ jsx(X, { className: "cls_clear_all_icon h-4 w-4 mr-2" }),
|
|
924
996
|
"Clear All"
|
|
@@ -930,6 +1002,7 @@ function HazoUiMultiFilterDialog({
|
|
|
930
1002
|
{
|
|
931
1003
|
onClick: handleApply,
|
|
932
1004
|
className: "cls_apply_btn",
|
|
1005
|
+
style: submitButtonStyles,
|
|
933
1006
|
children: "Apply"
|
|
934
1007
|
}
|
|
935
1008
|
),
|
|
@@ -939,6 +1012,7 @@ function HazoUiMultiFilterDialog({
|
|
|
939
1012
|
variant: "outline",
|
|
940
1013
|
onClick: handleCancel,
|
|
941
1014
|
className: "cls_cancel_btn",
|
|
1015
|
+
style: cancelButtonStyles,
|
|
942
1016
|
children: "Cancel"
|
|
943
1017
|
}
|
|
944
1018
|
)
|
|
@@ -1050,8 +1124,47 @@ function HazoUiMultiSortDialog({
|
|
|
1050
1124
|
onSortChange,
|
|
1051
1125
|
initialSortFields = [],
|
|
1052
1126
|
title = "Sort",
|
|
1053
|
-
description = "Add multiple fields to sort by and reorder them. Use the switch to toggle between ascending and descending."
|
|
1127
|
+
description = "Add multiple fields to sort by and reorder them. Use the switch to toggle between ascending and descending.",
|
|
1128
|
+
headerBackgroundColor,
|
|
1129
|
+
headerTextColor,
|
|
1130
|
+
submitButtonBackgroundColor,
|
|
1131
|
+
submitButtonTextColor,
|
|
1132
|
+
cancelButtonBackgroundColor,
|
|
1133
|
+
cancelButtonTextColor,
|
|
1134
|
+
cancelButtonBorderColor,
|
|
1135
|
+
clearButtonBackgroundColor,
|
|
1136
|
+
clearButtonTextColor,
|
|
1137
|
+
clearButtonBorderColor
|
|
1054
1138
|
}) {
|
|
1139
|
+
const config = get_hazo_ui_config();
|
|
1140
|
+
const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
|
|
1141
|
+
const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
|
|
1142
|
+
const finalCancelBgColor = cancelButtonBackgroundColor ?? config.cancel_button_background_color;
|
|
1143
|
+
const finalCancelTextColor = cancelButtonTextColor ?? config.cancel_button_text_color;
|
|
1144
|
+
const finalCancelBorderColor = cancelButtonBorderColor ?? config.cancel_button_border_color;
|
|
1145
|
+
const finalClearBgColor = clearButtonBackgroundColor ?? config.clear_button_background_color;
|
|
1146
|
+
const finalClearTextColor = clearButtonTextColor ?? config.clear_button_text_color;
|
|
1147
|
+
const finalClearBorderColor = clearButtonBorderColor ?? config.clear_button_border_color;
|
|
1148
|
+
const submitButtonStyles = {
|
|
1149
|
+
...finalSubmitBgColor && { backgroundColor: finalSubmitBgColor, borderColor: finalSubmitBgColor },
|
|
1150
|
+
...finalSubmitTextColor && { color: finalSubmitTextColor }
|
|
1151
|
+
};
|
|
1152
|
+
const cancelButtonStyles = {
|
|
1153
|
+
...finalCancelBgColor && { backgroundColor: finalCancelBgColor },
|
|
1154
|
+
...finalCancelTextColor && { color: finalCancelTextColor },
|
|
1155
|
+
...finalCancelBorderColor && { borderColor: finalCancelBorderColor }
|
|
1156
|
+
};
|
|
1157
|
+
const clearButtonStyles = {
|
|
1158
|
+
...finalClearBgColor && { backgroundColor: finalClearBgColor },
|
|
1159
|
+
...finalClearTextColor && { color: finalClearTextColor },
|
|
1160
|
+
...finalClearBorderColor && { borderColor: finalClearBorderColor }
|
|
1161
|
+
};
|
|
1162
|
+
const finalHeaderBgColor = headerBackgroundColor ?? config.header_background_color;
|
|
1163
|
+
const finalHeaderTextColor = headerTextColor ?? config.header_text_color;
|
|
1164
|
+
const headerStyles = {
|
|
1165
|
+
...finalHeaderBgColor && { backgroundColor: finalHeaderBgColor },
|
|
1166
|
+
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
1167
|
+
};
|
|
1055
1168
|
const [isOpen, setIsOpen] = useState(false);
|
|
1056
1169
|
const [sortFields, setSortFields] = useState(initialSortFields);
|
|
1057
1170
|
const [isComboboxOpen, setIsComboboxOpen] = useState(false);
|
|
@@ -1153,7 +1266,7 @@ function HazoUiMultiSortDialog({
|
|
|
1153
1266
|
/* @__PURE__ */ jsx(TooltipContent, { children: tooltipContent })
|
|
1154
1267
|
] }) }),
|
|
1155
1268
|
/* @__PURE__ */ jsxs(DialogContent, { className: "cls_sort_dialog_content max-w-lg", children: [
|
|
1156
|
-
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
1269
|
+
/* @__PURE__ */ jsxs(DialogHeader, { style: headerStyles, children: [
|
|
1157
1270
|
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
1158
1271
|
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
1159
1272
|
] }),
|
|
@@ -1233,6 +1346,7 @@ function HazoUiMultiSortDialog({
|
|
|
1233
1346
|
variant: "outline",
|
|
1234
1347
|
onClick: handleClearAll,
|
|
1235
1348
|
className: "cls_clear_all_btn",
|
|
1349
|
+
style: clearButtonStyles,
|
|
1236
1350
|
children: [
|
|
1237
1351
|
/* @__PURE__ */ jsx(Trash2, { className: "cls_clear_all_icon h-4 w-4 mr-2" }),
|
|
1238
1352
|
"Clear All"
|
|
@@ -1244,6 +1358,7 @@ function HazoUiMultiSortDialog({
|
|
|
1244
1358
|
{
|
|
1245
1359
|
onClick: handleApply,
|
|
1246
1360
|
className: "cls_apply_btn",
|
|
1361
|
+
style: submitButtonStyles,
|
|
1247
1362
|
children: "Apply"
|
|
1248
1363
|
}
|
|
1249
1364
|
),
|
|
@@ -1253,6 +1368,7 @@ function HazoUiMultiSortDialog({
|
|
|
1253
1368
|
variant: "outline",
|
|
1254
1369
|
onClick: handleCancel,
|
|
1255
1370
|
className: "cls_cancel_btn",
|
|
1371
|
+
style: cancelButtonStyles,
|
|
1256
1372
|
children: "Cancel"
|
|
1257
1373
|
}
|
|
1258
1374
|
)
|
|
@@ -5973,6 +6089,41 @@ var HazoUiTextarea = ({
|
|
|
5973
6089
|
);
|
|
5974
6090
|
};
|
|
5975
6091
|
HazoUiTextarea.displayName = "HazoUiTextarea";
|
|
6092
|
+
var VARIANT_PRESETS = {
|
|
6093
|
+
info: {
|
|
6094
|
+
header_background_color: "rgb(191, 219, 254)",
|
|
6095
|
+
description_background_color: "rgb(219, 234, 254)",
|
|
6096
|
+
header_text_color: "rgb(30, 58, 138)",
|
|
6097
|
+
border_color: "rgb(59, 130, 246)",
|
|
6098
|
+
accent_color: "rgb(59, 130, 246)",
|
|
6099
|
+
overlay_class_name: "bg-blue-950/50"
|
|
6100
|
+
},
|
|
6101
|
+
success: {
|
|
6102
|
+
header_background_color: "rgb(187, 247, 208)",
|
|
6103
|
+
description_background_color: "rgb(220, 252, 231)",
|
|
6104
|
+
header_text_color: "rgb(22, 101, 52)",
|
|
6105
|
+
border_color: "rgb(34, 197, 94)",
|
|
6106
|
+
accent_color: "rgb(34, 197, 94)",
|
|
6107
|
+
overlay_class_name: "bg-green-950/50"
|
|
6108
|
+
},
|
|
6109
|
+
warning: {
|
|
6110
|
+
header_background_color: "rgb(253, 230, 138)",
|
|
6111
|
+
description_background_color: "rgb(254, 249, 195)",
|
|
6112
|
+
header_text_color: "rgb(113, 63, 18)",
|
|
6113
|
+
border_color: "rgb(234, 179, 8)",
|
|
6114
|
+
accent_color: "rgb(234, 179, 8)",
|
|
6115
|
+
overlay_class_name: "bg-yellow-950/50"
|
|
6116
|
+
},
|
|
6117
|
+
danger: {
|
|
6118
|
+
header_background_color: "rgb(254, 202, 202)",
|
|
6119
|
+
description_background_color: "rgb(254, 226, 226)",
|
|
6120
|
+
header_text_color: "rgb(127, 29, 29)",
|
|
6121
|
+
border_color: "rgb(239, 68, 68)",
|
|
6122
|
+
accent_color: "rgb(239, 68, 68)",
|
|
6123
|
+
overlay_class_name: "bg-red-950/50",
|
|
6124
|
+
action_button_variant: "destructive"
|
|
6125
|
+
}
|
|
6126
|
+
};
|
|
5976
6127
|
var ANIMATION_PRESETS = {
|
|
5977
6128
|
zoom: {
|
|
5978
6129
|
open: "animate-dialog-zoom",
|
|
@@ -6026,7 +6177,7 @@ function HazoUiDialog({
|
|
|
6026
6177
|
title = "Action required",
|
|
6027
6178
|
description,
|
|
6028
6179
|
actionButtonText = "Confirm",
|
|
6029
|
-
actionButtonVariant
|
|
6180
|
+
actionButtonVariant,
|
|
6030
6181
|
cancelButtonText = "Cancel",
|
|
6031
6182
|
showCancelButton = true,
|
|
6032
6183
|
actionButtonLoading = false,
|
|
@@ -6037,7 +6188,10 @@ function HazoUiDialog({
|
|
|
6037
6188
|
sizeHeight = "min(80vh, 800px)",
|
|
6038
6189
|
openAnimation = "zoom",
|
|
6039
6190
|
closeAnimation = "zoom",
|
|
6191
|
+
variant = "default",
|
|
6192
|
+
splitHeader = true,
|
|
6040
6193
|
headerBackgroundColor,
|
|
6194
|
+
descriptionBackgroundColor,
|
|
6041
6195
|
headerTextColor,
|
|
6042
6196
|
bodyBackgroundColor,
|
|
6043
6197
|
footerBackgroundColor,
|
|
@@ -6052,6 +6206,9 @@ function HazoUiDialog({
|
|
|
6052
6206
|
footerClassName,
|
|
6053
6207
|
showCloseButton = true
|
|
6054
6208
|
}) {
|
|
6209
|
+
const config = get_hazo_ui_config();
|
|
6210
|
+
const variant_preset = variant !== "default" ? VARIANT_PRESETS[variant] : void 0;
|
|
6211
|
+
const resolved_action_button_variant = actionButtonVariant ?? variant_preset?.action_button_variant ?? "default";
|
|
6055
6212
|
const handleConfirm = () => {
|
|
6056
6213
|
onConfirm?.();
|
|
6057
6214
|
};
|
|
@@ -6060,27 +6217,28 @@ function HazoUiDialog({
|
|
|
6060
6217
|
onOpenChange?.(false);
|
|
6061
6218
|
};
|
|
6062
6219
|
const animationClasses = resolveAnimationClasses(openAnimation, closeAnimation);
|
|
6220
|
+
const resolved_border_color = borderColor ?? variant_preset?.border_color;
|
|
6063
6221
|
const contentStyles = {
|
|
6064
6222
|
width: sizeWidth,
|
|
6065
6223
|
maxHeight: sizeHeight,
|
|
6066
|
-
...
|
|
6224
|
+
...resolved_border_color && { borderColor: resolved_border_color }
|
|
6067
6225
|
};
|
|
6226
|
+
const finalHeaderBackgroundColor = headerBackgroundColor ?? variant_preset?.header_background_color ?? config.header_background_color;
|
|
6227
|
+
const finalDescriptionBgColor = descriptionBackgroundColor ?? variant_preset?.description_background_color;
|
|
6228
|
+
const finalHeaderTextColor = headerTextColor ?? variant_preset?.header_text_color ?? config.header_text_color;
|
|
6229
|
+
const is_variant_active = variant !== "default";
|
|
6230
|
+
const has_split_header = splitHeader && !headerBar && !!finalDescriptionBgColor && !!description;
|
|
6231
|
+
const has_merged_variant_header = !splitHeader && is_variant_active && !headerBar && !!description;
|
|
6068
6232
|
const headerStyles = {
|
|
6069
6233
|
...headerBar && {
|
|
6070
6234
|
backgroundColor: headerBarColor,
|
|
6071
|
-
marginLeft: "-1.5rem",
|
|
6072
|
-
marginRight: "-1.5rem",
|
|
6073
|
-
marginTop: "0",
|
|
6074
|
-
marginBottom: "0",
|
|
6075
6235
|
paddingTop: "1.5rem",
|
|
6076
6236
|
paddingBottom: "1.5rem",
|
|
6077
6237
|
paddingLeft: "1.5rem",
|
|
6078
|
-
paddingRight: "1.5rem"
|
|
6079
|
-
borderTopLeftRadius: "inherit",
|
|
6080
|
-
borderTopRightRadius: "inherit"
|
|
6238
|
+
paddingRight: "1.5rem"
|
|
6081
6239
|
},
|
|
6082
|
-
|
|
6083
|
-
|
|
6240
|
+
...!has_split_header && finalHeaderBackgroundColor && !headerBar && { backgroundColor: finalHeaderBackgroundColor },
|
|
6241
|
+
...!has_split_header && finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
6084
6242
|
};
|
|
6085
6243
|
const titleClassName = cn(
|
|
6086
6244
|
"cls_dialog_title",
|
|
@@ -6096,17 +6254,30 @@ function HazoUiDialog({
|
|
|
6096
6254
|
const footerStyles = {
|
|
6097
6255
|
...footerBackgroundColor && { backgroundColor: footerBackgroundColor }
|
|
6098
6256
|
};
|
|
6257
|
+
const finalSubmitBgColor = accentColor ?? variant_preset?.accent_color ?? config.submit_button_background_color;
|
|
6258
|
+
const finalSubmitTextColor = config.submit_button_text_color;
|
|
6259
|
+
const finalCancelBgColor = config.cancel_button_background_color;
|
|
6260
|
+
const finalCancelTextColor = config.cancel_button_text_color;
|
|
6261
|
+
const finalCancelBorderColor = config.cancel_button_border_color;
|
|
6099
6262
|
const actionButtonStyles = {
|
|
6100
|
-
...
|
|
6101
|
-
backgroundColor:
|
|
6102
|
-
borderColor:
|
|
6263
|
+
...finalSubmitBgColor && resolved_action_button_variant === "default" && {
|
|
6264
|
+
backgroundColor: finalSubmitBgColor,
|
|
6265
|
+
borderColor: finalSubmitBgColor
|
|
6266
|
+
},
|
|
6267
|
+
...finalSubmitTextColor && resolved_action_button_variant === "default" && {
|
|
6268
|
+
color: finalSubmitTextColor
|
|
6103
6269
|
}
|
|
6104
6270
|
};
|
|
6271
|
+
const cancelButtonStyles = {
|
|
6272
|
+
...finalCancelBgColor && { backgroundColor: finalCancelBgColor },
|
|
6273
|
+
...finalCancelTextColor && { color: finalCancelTextColor },
|
|
6274
|
+
...finalCancelBorderColor && { borderColor: finalCancelBorderColor }
|
|
6275
|
+
};
|
|
6105
6276
|
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
6106
6277
|
/* @__PURE__ */ jsx(
|
|
6107
6278
|
DialogOverlay,
|
|
6108
6279
|
{
|
|
6109
|
-
className: cn("cls_hazo_dialog_overlay", overlayClassName)
|
|
6280
|
+
className: cn("cls_hazo_dialog_overlay", overlayClassName ?? variant_preset?.overlay_class_name)
|
|
6110
6281
|
}
|
|
6111
6282
|
),
|
|
6112
6283
|
/* @__PURE__ */ jsxs(
|
|
@@ -6126,27 +6297,69 @@ function HazoUiDialog({
|
|
|
6126
6297
|
),
|
|
6127
6298
|
style: contentStyles,
|
|
6128
6299
|
children: [
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6300
|
+
has_split_header ? (
|
|
6301
|
+
/* Split header: two rows with different backgrounds */
|
|
6302
|
+
/* @__PURE__ */ jsxs(
|
|
6303
|
+
DialogHeader,
|
|
6304
|
+
{
|
|
6305
|
+
className: cn(
|
|
6306
|
+
"cls_dialog_header shrink-0 p-0 space-y-0",
|
|
6307
|
+
headerClassName
|
|
6308
|
+
),
|
|
6309
|
+
children: [
|
|
6310
|
+
/* @__PURE__ */ jsx(
|
|
6311
|
+
"div",
|
|
6312
|
+
{
|
|
6313
|
+
className: "cls_dialog_header_title px-6 pt-6 pb-3",
|
|
6314
|
+
style: {
|
|
6315
|
+
...finalHeaderBackgroundColor && { backgroundColor: finalHeaderBackgroundColor },
|
|
6316
|
+
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
6317
|
+
},
|
|
6318
|
+
children: /* @__PURE__ */ jsx(DialogTitle, { className: titleClassName, children: title })
|
|
6319
|
+
}
|
|
6320
|
+
),
|
|
6321
|
+
/* @__PURE__ */ jsx(
|
|
6322
|
+
"div",
|
|
6323
|
+
{
|
|
6324
|
+
className: "cls_dialog_header_description px-6 py-1.5",
|
|
6325
|
+
style: {
|
|
6326
|
+
backgroundColor: finalDescriptionBgColor,
|
|
6327
|
+
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
6328
|
+
},
|
|
6329
|
+
children: /* @__PURE__ */ jsx(DialogDescription, { className: cn(descriptionClassName, "italic text-xs"), children: description })
|
|
6330
|
+
}
|
|
6331
|
+
)
|
|
6332
|
+
]
|
|
6333
|
+
}
|
|
6334
|
+
)
|
|
6335
|
+
) : (
|
|
6336
|
+
/* Single header: one background, italic description when variant is active */
|
|
6337
|
+
/* @__PURE__ */ jsxs(
|
|
6338
|
+
DialogHeader,
|
|
6339
|
+
{
|
|
6340
|
+
className: cn(
|
|
6341
|
+
"cls_dialog_header shrink-0",
|
|
6342
|
+
!headerBar && "p-6 pb-4",
|
|
6343
|
+
has_merged_variant_header && "pb-3",
|
|
6344
|
+
headerClassName
|
|
6345
|
+
),
|
|
6346
|
+
style: headerStyles,
|
|
6347
|
+
children: [
|
|
6348
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: titleClassName, children: title }),
|
|
6349
|
+
description && /* @__PURE__ */ jsx(DialogDescription, { className: cn(
|
|
6350
|
+
descriptionClassName,
|
|
6351
|
+
has_merged_variant_header && "italic text-xs mt-1"
|
|
6352
|
+
), children: description })
|
|
6353
|
+
]
|
|
6354
|
+
}
|
|
6355
|
+
)
|
|
6143
6356
|
),
|
|
6144
6357
|
/* @__PURE__ */ jsx(
|
|
6145
6358
|
"div",
|
|
6146
6359
|
{
|
|
6147
6360
|
className: cn(
|
|
6148
6361
|
"cls_dialog_body",
|
|
6149
|
-
"px-6 py-4 overflow-y-auto flex-1",
|
|
6362
|
+
"px-6 py-4 overflow-y-auto flex-1 min-h-0",
|
|
6150
6363
|
contentClassName
|
|
6151
6364
|
),
|
|
6152
6365
|
style: bodyStyles,
|
|
@@ -6156,7 +6369,7 @@ function HazoUiDialog({
|
|
|
6156
6369
|
/* @__PURE__ */ jsx(
|
|
6157
6370
|
DialogFooter,
|
|
6158
6371
|
{
|
|
6159
|
-
className: cn("cls_dialog_footer p-6 pt-4", footerClassName),
|
|
6372
|
+
className: cn("cls_dialog_footer shrink-0 p-6 pt-4", footerClassName),
|
|
6160
6373
|
style: footerStyles,
|
|
6161
6374
|
children: footerContent ? (
|
|
6162
6375
|
// Custom footer content replaces default buttons
|
|
@@ -6171,6 +6384,7 @@ function HazoUiDialog({
|
|
|
6171
6384
|
className: "cls_cancel_button",
|
|
6172
6385
|
variant: "outline",
|
|
6173
6386
|
onClick: handleCancel,
|
|
6387
|
+
style: cancelButtonStyles,
|
|
6174
6388
|
children: cancelButtonText
|
|
6175
6389
|
}
|
|
6176
6390
|
),
|
|
@@ -6179,7 +6393,7 @@ function HazoUiDialog({
|
|
|
6179
6393
|
{
|
|
6180
6394
|
type: "button",
|
|
6181
6395
|
className: "cls_confirm_button",
|
|
6182
|
-
variant:
|
|
6396
|
+
variant: resolved_action_button_variant,
|
|
6183
6397
|
onClick: handleConfirm,
|
|
6184
6398
|
style: actionButtonStyles,
|
|
6185
6399
|
disabled: actionButtonLoading || actionButtonDisabled,
|
|
@@ -6197,7 +6411,7 @@ function HazoUiDialog({
|
|
|
6197
6411
|
DialogPrimitive.Close,
|
|
6198
6412
|
{
|
|
6199
6413
|
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
6200
|
-
style: headerBar ? { color: "white" } :
|
|
6414
|
+
style: headerBar ? { color: "white" } : finalHeaderTextColor ? { color: finalHeaderTextColor } : void 0,
|
|
6201
6415
|
children: [
|
|
6202
6416
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
6203
6417
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -6210,6 +6424,6 @@ function HazoUiDialog({
|
|
|
6210
6424
|
] }) });
|
|
6211
6425
|
}
|
|
6212
6426
|
|
|
6213
|
-
export { CommandNodeExtension, CommandPill, CommandPopover, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, HazoUiFlexRadio, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, HazoUiTextarea, HazoUiTextbox, create_command_suggestion_extension, parse_commands_from_text, text_to_tiptap_content };
|
|
6427
|
+
export { CommandNodeExtension, CommandPill, CommandPopover, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiFlexInput, HazoUiFlexRadio, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, HazoUiTextarea, HazoUiTextbox, create_command_suggestion_extension, get_hazo_ui_config, parse_commands_from_text, reset_hazo_ui_config, set_hazo_ui_config, text_to_tiptap_content };
|
|
6214
6428
|
//# sourceMappingURL=index.js.map
|
|
6215
6429
|
//# sourceMappingURL=index.js.map
|