bianic-ui 2.8.1-beta.0 → 2.10.0-alpha.0

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
@@ -1576,24 +1576,19 @@ var ContextualButton = React.forwardRef(function (_a, ref) {
1576
1576
  });
1577
1577
 
1578
1578
  var config$2 = {
1579
- 'dark-background': 'bg-white hover:bg-bia-grey-light-90 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-80',
1580
- 'light-background': 'bg-bia-grey-light-90 hover:bg-bia-grey-light-80 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-70',
1581
- 'outline-light-background': 'bg-white border border-bia-grey-light-40 hover:bg-bia-grey-light-90 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-80',
1579
+ 'dark-background': 'bg-white enabled:hover:bg-bia-grey-light-90 outline-none focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 enabled:active:bg-bia-grey-light-80',
1580
+ 'light-background': 'bg-bia-grey-light-90 enabled:hover:bg-bia-grey-light-80 outline-none focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 enabled:active:bg-bia-grey-light-70',
1581
+ 'outline-light-background': 'bg-white border border-bia-grey-light-40 enabled:hover:bg-bia-grey-light-90 outline-none focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 enabled:active:bg-bia-grey-light-80',
1582
1582
  };
1583
1583
 
1584
1584
  var Card = function (_a) {
1585
- var children = _a.children, disabled = _a.disabled, variant = _a.variant;
1586
- var base = config$2[variant || 'dark-background'];
1587
- var removeStateClasses = function (cls) {
1588
- return cls
1589
- .replace(/\b(?:hover|active|focus-visible|focus):[^\s]+/g, '')
1590
- .replace(/\s+/g, ' ')
1591
- .trim();
1592
- };
1593
- var cardClassName = disabled
1594
- ? "".concat(removeStateClasses(base), " cursor-not-allowed")
1595
- : base;
1596
- return (React.createElement("button", { disabled: disabled, "aria-disabled": disabled, className: "rounded-radius-md p-5 ".concat(cardClassName), tabIndex: disabled ? -1 : 0 }, children));
1585
+ var children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.variant, variant = _c === void 0 ? 'dark-background' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.type, type = _e === void 0 ? 'button' : _e, rest = __rest(_a, ["children", "disabled", "variant", "className", "type"]);
1586
+ var baseStyles = config$2[variant];
1587
+ var stateStyles = disabled
1588
+ ? 'opacity-50 cursor-not-allowed pointer-events-none'
1589
+ : '';
1590
+ var combinedClassName = "rounded-radius-md p-5 ".concat(baseStyles, " ").concat(stateStyles, " ").concat(className).trim();
1591
+ return (React.createElement("button", __assign({ type: type, disabled: disabled, "aria-disabled": disabled, className: combinedClassName }, rest), children));
1597
1592
  };
1598
1593
 
1599
1594
  function Color() {
@@ -2458,9 +2453,13 @@ var sizeConfig$9 = {
2458
2453
  checkClass: 'w-4 h-4',
2459
2454
  labelClass: 'text-size-sm font-normal',
2460
2455
  },
2456
+ tn: {
2457
+ checkClass: 'w-3 h-3',
2458
+ labelClass: 'text-size-sm font-normal',
2459
+ },
2461
2460
  };
2462
2461
 
2463
- var sizeUnion$3 = ['md', 'sm'];
2462
+ var sizeUnion$3 = ['md', 'sm', 'tn'];
2464
2463
  function Checkbox(_a) {
2465
2464
  var _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, props = __rest(_a, ["disabled", "id", "size", "label", "onChange"]);
2466
2465
  var _e = sizeConfig$9[validUnion(size, sizeUnion$3)], checkClass = _e.checkClass, labelClass = _e.labelClass;
@@ -4539,56 +4538,66 @@ var radiusConfig = {
4539
4538
  var variantConfig = {
4540
4539
  default: 'pb-[7.5px] pt-[8.5px] ps-[15px] pe-[10px] gap-[10px]',
4541
4540
  alternative: 'pt-[4.8px] pb-[4.0px] px-[20px] relative',
4541
+ 'alternative-more': 'pt-[4.8px] pb-[4.0px] px-[10px] relative',
4542
4542
  };
4543
4543
  var defaultConfigs = {
4544
- true: 'cursor-default bg-bia-grey-light-80 hover:bg-bia-coolgrey-light-90 text-primary-black ',
4545
- false: 'cursor-pointer bg-bia-grey hover:bg-bia-grey-light-50 text-bia-coolgrey-dark-10',
4546
- };
4547
- var defaultButtonConfigs = {
4548
- true: 'text-primary-black',
4549
- false: 'text-primary-black',
4544
+ active: 'cursor-default bg-bia-grey-light-80 hover:bg-bia-coolgrey-light-90 text-primary-black',
4545
+ inactive: 'cursor-pointer bg-bia-grey hover:bg-bia-grey-light-50 text-bia-coolgrey-dark-10',
4550
4546
  };
4551
4547
  var alternativeConfigs = {
4552
- true: 'cursor-default bg-primary-white text-primary-black overflow-hidden',
4553
- false: 'cursor-pointer bg-bia-verdantgreen-dark-40 hover:bg-bia-verdantgreen-dark-50 text-primary-white overflow-hidden',
4548
+ active: 'cursor-default bg-primary-white text-primary-black overflow-hidden',
4549
+ inactive: 'cursor-pointer bg-bia-verdantgreen-dark-40 hover:bg-bia-verdantgreen-dark-50 text-primary-white overflow-hidden',
4550
+ };
4551
+ var defaultButtonConfigs = {
4552
+ active: 'text-primary-black',
4553
+ inactive: 'text-primary-black',
4554
4554
  };
4555
4555
  var alternativeButtonConfigs = {
4556
- true: 'absolute px-[5px] opacity-0 group-hover/container:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
4557
- false: ' absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-bia-verdantgreen-dark-50 from-50% to-bia-verdantgreen-dark-50/[.0] inset-y-0 right-0',
4556
+ active: 'absolute px-[5px] opacity-0 group-hover/container:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
4557
+ inactive: 'absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-bia-verdantgreen-dark-50 from-50% to-bia-verdantgreen-dark-50/[.0] inset-y-0 right-0',
4558
4558
  };
4559
4559
  var actionButtonConfig = {
4560
- true: 'text-[#979797] group-hover:bg-primary-black/10 group-hover:text-primary-black group-active:bg-primary-black/20 group-active:text-primary-black',
4561
- false: 'text-[#95b491] group-hover:bg-primary-black/40 group-hover:text-primary-white group-active:bg-primary-black/60 group-hover:text-primary-white',
4560
+ active: 'text-[#979797] group-hover:bg-primary-black/10 group-hover:text-primary-black group-active:bg-primary-black/20 group-active:text-primary-black',
4561
+ inactive: 'text-[#95b491] group-hover:bg-primary-black/40 group-hover:text-primary-white group-active:bg-primary-black/60 group-hover:text-primary-white',
4562
4562
  };
4563
4563
 
4564
- var TabMenu = function (_a) {
4565
- var variant = _a.variant, _b = _a.text, text = _b === void 0 ? '' : _b, _c = _a.rounded, rounded = _c === void 0 ? 'none' : _c, _d = _a.isActive, isActive = _d === void 0 ? false : _d, _e = _a.onClose, onClose = _e === void 0 ? function () { } : _e, rest = __rest(_a, ["variant", "text", "rounded", "isActive", "onClose"]);
4566
- // valiated parameter
4564
+ var TabMenu = React.forwardRef(function (props, ref) {
4565
+ var variant = props.variant, rounded = props.rounded, _a = props.text, text = _a === void 0 ? '' : _a, _b = props.isActive, isActive = _b === void 0 ? false : _b, _c = props.moreCount, moreCount = _c === void 0 ? 1 : _c, onClose = props.onClose, onClickMore = props.onClickMore, _d = props.className, className = _d === void 0 ? '' : _d, rest = __rest(props, ["variant", "rounded", "text", "isActive", "moreCount", "onClose", "onClickMore", "className"]);
4566
+ var _e = React.useState(false), isMoreExpand = _e[0], setIsMoreExpand = _e[1];
4567
4567
  var validatedVariant = validUnion(variant, [
4568
4568
  'default',
4569
4569
  'alternative',
4570
+ 'alternative-more',
4570
4571
  ]);
4571
- var validatedRadius = validUnion(rounded, ['none', 'all', 'top', 'right', 'left']);
4572
- var usedBaseConfig;
4573
- var usedButtonConfig;
4574
- var usedActionButtonConfig;
4575
- if (validatedVariant === 'alternative') {
4576
- usedBaseConfig = alternativeConfigs[isActive];
4577
- usedButtonConfig = alternativeButtonConfigs[isActive];
4578
- usedActionButtonConfig = actionButtonConfig[isActive];
4579
- }
4580
- else {
4581
- usedBaseConfig = defaultConfigs[isActive];
4582
- usedButtonConfig = defaultButtonConfigs[isActive];
4583
- usedActionButtonConfig = '';
4584
- }
4585
- return (React.createElement("div", __assign({ className: "tab-menu group/container flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(usedBaseConfig, " ").concat(rest.className) }, rest),
4586
- text,
4587
- React.createElement("div", { className: "grid ".concat(usedButtonConfig, " ") },
4588
- validatedVariant === 'alternative' && React.createElement("div", { className: "order-first" }),
4589
- React.createElement("button", { className: "group order-last", onClick: onClose },
4590
- React.createElement(TbX, { className: "rounded-radius-sm ".concat(usedActionButtonConfig), size: 14 })))));
4591
- };
4572
+ var validatedRadius = validUnion(rounded, [
4573
+ 'none',
4574
+ 'all',
4575
+ 'top',
4576
+ 'right',
4577
+ 'left',
4578
+ ]);
4579
+ var isAlternative = validatedVariant.startsWith('alternative');
4580
+ var isMoreDropdown = validatedVariant === 'alternative-more';
4581
+ var stateKey = isActive ? 'active' : 'inactive';
4582
+ var baseStyles = isAlternative
4583
+ ? alternativeConfigs[stateKey]
4584
+ : defaultConfigs[stateKey];
4585
+ var actionButtonStyles = isAlternative ? actionButtonConfig[stateKey] : '';
4586
+ var itemButtonStyles = validatedVariant === 'alternative'
4587
+ ? alternativeButtonConfigs[stateKey]
4588
+ : defaultButtonConfigs[stateKey];
4589
+ var handleMoreClick = function (e) {
4590
+ setIsMoreExpand(function (prev) { return !prev; });
4591
+ onClickMore === null || onClickMore === void 0 ? void 0 : onClickMore(e);
4592
+ };
4593
+ return (React.createElement("div", __assign({ ref: ref, className: "tab-menu group/container flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(baseStyles, " ").concat(className).trim() }, rest),
4594
+ isMoreDropdown ? "More (".concat(moreCount, ")") : text,
4595
+ React.createElement("div", { className: "grid ".concat(itemButtonStyles) },
4596
+ isAlternative && React.createElement("div", { className: "order-first" }),
4597
+ isMoreDropdown ? (React.createElement("button", { type: "button", className: "group order-last pl-[2px]", onClick: handleMoreClick }, isMoreExpand ? (React.createElement(TbChevronUp, { className: "rounded-radius-sm ".concat(isActive ? 'text-primary-black' : 'text-primary-white'), size: 14 })) : (React.createElement(TbChevronDown, { className: "rounded-radius-sm ".concat(isActive ? 'text-primary-black' : 'text-primary-white'), size: 14 })))) : (React.createElement("button", { type: "button", className: "group order-last", onClick: onClose },
4598
+ React.createElement(TbX, { className: "rounded-radius-sm ".concat(actionButtonStyles), size: 14 }))))));
4599
+ });
4600
+ TabMenu.displayName = 'TabMenu';
4592
4601
 
4593
4602
  var sizeConfig$1 = {
4594
4603
  md: 'px-2.5 py-[9px]',