hazo_ui 2.1.0 → 2.1.1
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.cjs +17 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -77,11 +77,12 @@ interface MultiStateRadioProps {
|
|
|
77
77
|
value: string | string[];
|
|
78
78
|
onChange: (value: string | string[]) => void;
|
|
79
79
|
className?: string;
|
|
80
|
+
compressed?: boolean;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
83
|
* Multi State Radio Component
|
|
83
84
|
* Supports single and multi-selection with radio buttons or icons
|
|
84
85
|
*/
|
|
85
|
-
declare function MultiStateRadio({ layout, style, display_label, icon_set, data, selection, value, onChange, className, }: MultiStateRadioProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function MultiStateRadio({ layout, style, display_label, icon_set, data, selection, value, onChange, className, compressed, }: MultiStateRadioProps): react_jsx_runtime.JSX.Element;
|
|
86
87
|
|
|
87
88
|
export { ExampleComponent, type FilterConfig, type FilterField, MultiFilterDialog, MultiSortDialog, MultiStateRadio, type MultiStateRadioItem, type MultiStateRadioProps, type SortConfig, type SortField };
|
package/dist/index.js
CHANGED
|
@@ -1216,7 +1216,8 @@ function MultiStateRadio({
|
|
|
1216
1216
|
selection = "single",
|
|
1217
1217
|
value,
|
|
1218
1218
|
onChange,
|
|
1219
|
-
className
|
|
1219
|
+
className,
|
|
1220
|
+
compressed = false
|
|
1220
1221
|
}) {
|
|
1221
1222
|
const handleSingleSelection = (selectedValue) => {
|
|
1222
1223
|
onChange(selectedValue);
|
|
@@ -1247,7 +1248,8 @@ function MultiStateRadio({
|
|
|
1247
1248
|
className: cn(
|
|
1248
1249
|
"cls_radio_option flex items-center gap-2",
|
|
1249
1250
|
layout === "horizontal" ? "flex-row" : "flex-col",
|
|
1250
|
-
"p-2 rounded-md
|
|
1251
|
+
compressed ? "" : "p-2 rounded-md",
|
|
1252
|
+
"hover:bg-accent transition-colors",
|
|
1251
1253
|
selected && "bg-accent"
|
|
1252
1254
|
),
|
|
1253
1255
|
children: [
|
|
@@ -1281,7 +1283,8 @@ function MultiStateRadio({
|
|
|
1281
1283
|
className: cn(
|
|
1282
1284
|
"cls_radio_option flex items-center gap-2 cursor-pointer",
|
|
1283
1285
|
layout === "horizontal" ? "flex-row" : "flex-col",
|
|
1284
|
-
"p-2 rounded-md
|
|
1286
|
+
compressed ? "" : "p-2 rounded-md",
|
|
1287
|
+
"hover:bg-accent transition-colors",
|
|
1285
1288
|
selected && "bg-accent"
|
|
1286
1289
|
),
|
|
1287
1290
|
onClick: () => handleMultiSelection(item.value),
|
|
@@ -1344,7 +1347,8 @@ function MultiStateRadio({
|
|
|
1344
1347
|
className: cn(
|
|
1345
1348
|
"cls_icon_option border-0",
|
|
1346
1349
|
layout === "horizontal" ? "flex-row" : "flex-col",
|
|
1347
|
-
"gap-2 h-auto
|
|
1350
|
+
"gap-2 h-auto",
|
|
1351
|
+
compressed ? "py-0 px-0" : "py-2 px-3 sm:py-3 sm:px-4",
|
|
1348
1352
|
selected && "bg-primary text-primary-foreground",
|
|
1349
1353
|
!selected && "hover:bg-accent"
|
|
1350
1354
|
),
|
|
@@ -1369,8 +1373,15 @@ function MultiStateRadio({
|
|
|
1369
1373
|
] }, item.value);
|
|
1370
1374
|
};
|
|
1371
1375
|
const containerClasses = cn(
|
|
1372
|
-
"cls_multi_state_radio border border-input rounded-md
|
|
1373
|
-
|
|
1376
|
+
"cls_multi_state_radio border border-input rounded-md",
|
|
1377
|
+
compressed ? "" : "p-2 sm:p-3",
|
|
1378
|
+
layout === "horizontal" ? cn(
|
|
1379
|
+
"flex flex-row flex-wrap",
|
|
1380
|
+
compressed ? "gap-0" : "gap-2 sm:gap-3"
|
|
1381
|
+
) : cn(
|
|
1382
|
+
"flex flex-col",
|
|
1383
|
+
compressed ? "gap-0" : "gap-2 sm:gap-3"
|
|
1384
|
+
),
|
|
1374
1385
|
className
|
|
1375
1386
|
);
|
|
1376
1387
|
const radioGroupClasses = cn(
|