bianic-ui 2.9.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 +56 -51
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Card/config.d.ts +4 -3
- package/dist/cjs/types/components/Card/index.d.ts +6 -6
- package/dist/cjs/types/components/TabMenu/TabMenu.d.ts +9 -5
- package/dist/cjs/types/components/TabMenu/configs.d.ts +10 -31
- package/dist/cjs/types/stories/Card/Card.stories.d.ts +1 -5
- package/dist/cjs/types/stories/TabMenu/TabMenu.stories.d.ts +1 -1
- package/dist/esm/index.js +56 -51
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Card/config.d.ts +4 -3
- package/dist/esm/types/components/Card/index.d.ts +6 -6
- package/dist/esm/types/components/TabMenu/TabMenu.d.ts +9 -5
- package/dist/esm/types/components/TabMenu/configs.d.ts +10 -31
- package/dist/esm/types/stories/Card/Card.stories.d.ts +1 -5
- package/dist/esm/types/stories/TabMenu/TabMenu.stories.d.ts +1 -1
- package/dist/index.d.ts +20 -8
- package/package.json +1 -1
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
|
|
1580
|
-
'light-background': 'bg-bia-grey-light-90 hover:bg-bia-grey-light-80 outline-none focus
|
|
1581
|
-
'outline-light-background': 'bg-white border border-bia-grey-light-40 hover:bg-bia-grey-light-90 outline-none focus
|
|
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,
|
|
1586
|
-
var
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
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() {
|
|
@@ -4543,56 +4538,66 @@ var radiusConfig = {
|
|
|
4543
4538
|
var variantConfig = {
|
|
4544
4539
|
default: 'pb-[7.5px] pt-[8.5px] ps-[15px] pe-[10px] gap-[10px]',
|
|
4545
4540
|
alternative: 'pt-[4.8px] pb-[4.0px] px-[20px] relative',
|
|
4541
|
+
'alternative-more': 'pt-[4.8px] pb-[4.0px] px-[10px] relative',
|
|
4546
4542
|
};
|
|
4547
4543
|
var defaultConfigs = {
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
};
|
|
4551
|
-
var defaultButtonConfigs = {
|
|
4552
|
-
true: 'text-primary-black',
|
|
4553
|
-
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',
|
|
4554
4546
|
};
|
|
4555
4547
|
var alternativeConfigs = {
|
|
4556
|
-
|
|
4557
|
-
|
|
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',
|
|
4558
4554
|
};
|
|
4559
4555
|
var alternativeButtonConfigs = {
|
|
4560
|
-
|
|
4561
|
-
|
|
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',
|
|
4562
4558
|
};
|
|
4563
4559
|
var actionButtonConfig = {
|
|
4564
|
-
|
|
4565
|
-
|
|
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',
|
|
4566
4562
|
};
|
|
4567
4563
|
|
|
4568
|
-
var TabMenu = function (
|
|
4569
|
-
var variant =
|
|
4570
|
-
|
|
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];
|
|
4571
4567
|
var validatedVariant = validUnion(variant, [
|
|
4572
4568
|
'default',
|
|
4573
4569
|
'alternative',
|
|
4570
|
+
'alternative-more',
|
|
4574
4571
|
]);
|
|
4575
|
-
var validatedRadius = validUnion(rounded, [
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
};
|
|
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';
|
|
4596
4601
|
|
|
4597
4602
|
var sizeConfig$1 = {
|
|
4598
4603
|
md: 'px-2.5 py-[9px]',
|