bianic-ui 1.5.1-beta.7 → 1.5.1-beta.9

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/cjs/index.js CHANGED
@@ -1473,6 +1473,28 @@ var ButtonApp = function (_a) {
1473
1473
  return (React.createElement("button", __assign({ className: "button-app px-[10px] pb-[8.8px] pt-[8px] text-size-tiny ".concat(colorConfig$1[color][buttonState], " "), type: "button", disabled: disabled }, rest), label));
1474
1474
  };
1475
1475
 
1476
+ var textColorConfig = {
1477
+ dark: 'text-primary-black disabled:text-bia-coolgrey-disabled',
1478
+ light: 'text-primary-white disabled:opacity-30',
1479
+ };
1480
+ var stateColorConfig = {
1481
+ selected: 'bg-black/15 cursor-default',
1482
+ default: 'enabled:hover:bg-black/10 enabled:focus-visible:border-bia-blue-disabled enabled:focus-visible:outline-2 enabled:focus-visible:-outline-offset-1 enabled:focus-visible:outline-bia-blue-disabled enabled:active:bg-black/15',
1483
+ };
1484
+
1485
+ var ContextualButton = function (_a) {
1486
+ var label = _a.label, icon = _a.icon, _b = _a.variant, variant = _b === void 0 ? 'dark' : _b, disabled = _a.disabled; _a.isNotified; var _d = _a.isSelected, isSelected = _d === void 0 ? false : _d, props = __rest(_a, ["label", "icon", "variant", "disabled", "isNotified", "isSelected"]);
1487
+ var textColor = isSelected
1488
+ ? variant === 'dark'
1489
+ ? 'text-primary-black'
1490
+ : 'text-primary-white'
1491
+ : textColorConfig[variant];
1492
+ var stateColor = stateColorConfig[isSelected ? 'selected' : 'default'];
1493
+ return (React.createElement("button", __assign({ className: "contextual-button box-border flex flex-row items-center rounded-radius-sm border border-transparent p-[1px] outline-none ".concat(stateColor, " ").concat(textColor) }, props, { disabled: disabled }),
1494
+ icon,
1495
+ label && (React.createElement("div", { className: "label max-h-[46px] px-[5px] text-[12px] leading-none" }, label))));
1496
+ };
1497
+
1476
1498
  function Color() {
1477
1499
  var colorList = [
1478
1500
  'bg-bia-red',
@@ -2868,6 +2890,7 @@ exports.Button = Button;
2868
2890
  exports.ButtonApp = ButtonApp;
2869
2891
  exports.Checkbox = Checkbox;
2870
2892
  exports.Color = Color;
2893
+ exports.ContextualButton = ContextualButton;
2871
2894
  exports.Display = Display;
2872
2895
  exports.Divider = Divider;
2873
2896
  exports.FileTree = FileTree;