hazo_ui 2.1.1 → 2.1.2

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 CHANGED
@@ -28,6 +28,7 @@ var FiIcons = require('react-icons/fi');
28
28
  var IoIcons = require('react-icons/io5');
29
29
  var RiIcons = require('react-icons/ri');
30
30
  var TbIcons = require('react-icons/tb');
31
+ var CiIcons = require('react-icons/ci');
31
32
 
32
33
  function _interopNamespace(e) {
33
34
  if (e && e.__esModule) return e;
@@ -64,6 +65,7 @@ var FiIcons__namespace = /*#__PURE__*/_interopNamespace(FiIcons);
64
65
  var IoIcons__namespace = /*#__PURE__*/_interopNamespace(IoIcons);
65
66
  var RiIcons__namespace = /*#__PURE__*/_interopNamespace(RiIcons);
66
67
  var TbIcons__namespace = /*#__PURE__*/_interopNamespace(TbIcons);
68
+ var CiIcons__namespace = /*#__PURE__*/_interopNamespace(CiIcons);
67
69
 
68
70
  var ExampleComponent = ({ children, className = "" }) => {
69
71
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `cls_example_component ${className}`, children });
@@ -1230,7 +1232,8 @@ var iconSetMap = {
1230
1232
  io: IoIcons__namespace,
1231
1233
  io5: IoIcons__namespace,
1232
1234
  ri: RiIcons__namespace,
1233
- tb: TbIcons__namespace
1235
+ tb: TbIcons__namespace,
1236
+ ci: CiIcons__namespace
1234
1237
  };
1235
1238
  function getIconLibrary(iconSet) {
1236
1239
  if (!iconSet) return null;
@@ -1376,6 +1379,10 @@ function MultiStateRadio({
1376
1379
  const SelectedIcon = icon_set && item.icon_selected ? getIconComponent(icon_set, item.icon_selected) : null;
1377
1380
  const UnselectedIcon = icon_set && item.icon_unselected ? getIconComponent(icon_set, item.icon_unselected) : null;
1378
1381
  const IconComponent = selected && SelectedIcon ? SelectedIcon : UnselectedIcon || SelectedIcon;
1382
+ const buttonStyles = {};
1383
+ if (item.bgcolor) {
1384
+ buttonStyles.backgroundColor = item.bgcolor;
1385
+ }
1379
1386
  const buttonContent = /* @__PURE__ */ jsxRuntime.jsxs(
1380
1387
  Button,
1381
1388
  {
@@ -1386,9 +1393,11 @@ function MultiStateRadio({
1386
1393
  layout === "horizontal" ? "flex-row" : "flex-col",
1387
1394
  "gap-2 h-auto",
1388
1395
  compressed ? "py-0 px-0" : "py-2 px-3 sm:py-3 sm:px-4",
1389
- selected && "bg-primary text-primary-foreground",
1390
- !selected && "hover:bg-accent"
1396
+ // Only apply default colors if custom colors are not provided
1397
+ !item.bgcolor && selected && "bg-primary text-primary-foreground",
1398
+ !item.bgcolor && !selected && "hover:bg-accent"
1391
1399
  ),
1400
+ style: Object.keys(buttonStyles).length > 0 ? buttonStyles : void 0,
1392
1401
  onClick: () => {
1393
1402
  if (selection === "single") {
1394
1403
  handleSingleSelection(item.value);
@@ -1399,8 +1408,21 @@ function MultiStateRadio({
1399
1408
  "aria-label": item.label,
1400
1409
  "aria-pressed": selected,
1401
1410
  children: [
1402
- IconComponent && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "cls_icon h-4 w-4 sm:h-5 sm:w-5" }),
1403
- display_label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_icon_label text-sm font-medium", children: item.label })
1411
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsx(
1412
+ IconComponent,
1413
+ {
1414
+ className: "cls_icon h-4 w-4 sm:h-5 sm:w-5",
1415
+ style: item.fgcolor ? { color: item.fgcolor } : void 0
1416
+ }
1417
+ ),
1418
+ display_label && /* @__PURE__ */ jsxRuntime.jsx(
1419
+ "span",
1420
+ {
1421
+ className: "cls_icon_label text-sm font-medium",
1422
+ style: item.fgcolor ? { color: item.fgcolor } : void 0,
1423
+ children: item.label
1424
+ }
1425
+ )
1404
1426
  ]
1405
1427
  }
1406
1428
  );