bianic-ui 1.10.2 → 1.11.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 +26 -27
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Snippet/ContextualButtonsTable.d.ts +3 -0
- package/dist/cjs/types/components/Typography/Text/index.d.ts +2 -1
- package/dist/cjs/types/stories/Snippet/ContextualButtonsTable/Story.stories.d.ts +13 -0
- package/dist/esm/index.js +26 -27
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Snippet/ContextualButtonsTable.d.ts +3 -0
- package/dist/esm/types/components/Typography/Text/index.d.ts +2 -1
- package/dist/esm/types/stories/Snippet/ContextualButtonsTable/Story.stories.d.ts +13 -0
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/tailwind.config.js +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -309,12 +309,17 @@ var variantUnion$2 = [
|
|
|
309
309
|
'link',
|
|
310
310
|
];
|
|
311
311
|
function Text(_a) {
|
|
312
|
-
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children;
|
|
312
|
+
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children, _c = _a.className, className = _c === void 0 ? '' : _c;
|
|
313
313
|
var validatedVariant = validUnion(variant, variantUnion$2);
|
|
314
|
-
|
|
314
|
+
var defaultColor = extended.includes('text-bia') || (className === null || className === void 0 ? void 0 : className.includes('text-bia'))
|
|
315
|
+
? ''
|
|
316
|
+
: 'text-bia-black';
|
|
317
|
+
var extendedClasses = "".concat(className, " ").concat(extended);
|
|
318
|
+
return (React.createElement("span", { className: "bianic-text ".concat(textClasses[validatedVariant], " ").concat(defaultColor, " ").concat(extendedClasses) }, childrenElement(children)));
|
|
315
319
|
}
|
|
316
320
|
Text.defaultProps = {
|
|
317
321
|
extended: '',
|
|
322
|
+
className: '',
|
|
318
323
|
};
|
|
319
324
|
|
|
320
325
|
/******************************************************************************
|
|
@@ -440,10 +445,10 @@ var minWidthConfig$1 = {
|
|
|
440
445
|
tn: 'min-w-[64px]',
|
|
441
446
|
};
|
|
442
447
|
var iconOnlySizeConfig$1 = {
|
|
443
|
-
lg: '
|
|
444
|
-
md: '
|
|
445
|
-
sm: '
|
|
446
|
-
tn: '
|
|
448
|
+
lg: 'py-[13px] flex items-center justify-center gap-[10px]',
|
|
449
|
+
md: 'py-[11px] flex items-center justify-center gap-[5px]',
|
|
450
|
+
sm: 'py-[8px] flex items-center justify-center gap-[5px] ',
|
|
451
|
+
tn: 'py-[4px] flex items-center justify-center gap-[3px]',
|
|
447
452
|
};
|
|
448
453
|
var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
|
|
449
454
|
var variantConfig$2 = {
|
|
@@ -481,7 +486,7 @@ var variantUnion$1 = [
|
|
|
481
486
|
'primary-outlined',
|
|
482
487
|
'success-outlined',
|
|
483
488
|
'warning-outlined',
|
|
484
|
-
'form-group'
|
|
489
|
+
'form-group',
|
|
485
490
|
];
|
|
486
491
|
var radiusUnion = ['default', 'full-rounded'];
|
|
487
492
|
var sizeUnion$5 = ['md', 'lg', 'sm', 'tn'];
|
|
@@ -506,7 +511,7 @@ function Button(_a) {
|
|
|
506
511
|
}
|
|
507
512
|
var sizeClass = label || variant === 'form-group'
|
|
508
513
|
? " ".concat(minWidthRules, " ").concat(sizingRules)
|
|
509
|
-
: iconOnlySizeConfig$1[validatedSize];
|
|
514
|
+
: "".concat(iconOnlySizeConfig$1[validatedSize], " ").concat(variant.includes('link') ? '' : "".concat(sidePaddingConfig[validatedSize]));
|
|
510
515
|
var classString = "\n ".concat(variantConfig$2[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig$1[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
511
516
|
return (React.createElement("button", __assign({ type: "button", className: "bianic-button bianic-fgc-target flex items-center justify-center font-semibold ".concat(classString), disabled: disabled }, props),
|
|
512
517
|
childrenElement(iconLeft || left),
|
|
@@ -1588,7 +1593,7 @@ function Color() {
|
|
|
1588
1593
|
'light-30',
|
|
1589
1594
|
'light-20',
|
|
1590
1595
|
'light-10',
|
|
1591
|
-
'
|
|
1596
|
+
'',
|
|
1592
1597
|
'dark-10',
|
|
1593
1598
|
'dark-20',
|
|
1594
1599
|
'dark-30',
|
|
@@ -1599,14 +1604,8 @@ function Color() {
|
|
|
1599
1604
|
'dark-80',
|
|
1600
1605
|
'dark-90',
|
|
1601
1606
|
];
|
|
1602
|
-
var aliases = {
|
|
1603
|
-
'light-90': 'pastel',
|
|
1604
|
-
'light-50': 'disabled',
|
|
1605
|
-
'light-10': 'hover',
|
|
1606
|
-
'dark-10': 'active',
|
|
1607
|
-
};
|
|
1608
1607
|
return (React.createElement("div", { className: "color-pallete flex flex-col gap-y-10" },
|
|
1609
|
-
React.createElement("div", { className: "flex gap-x-5
|
|
1608
|
+
React.createElement("div", { className: "flex justify-center gap-x-5" },
|
|
1610
1609
|
React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3" },
|
|
1611
1610
|
React.createElement("div", { className: "text-center text-xs font-semibold" }, "Black"),
|
|
1612
1611
|
React.createElement("div", { className: "aspect-square w-10 rounded-lg", style: {
|
|
@@ -1621,13 +1620,13 @@ function Color() {
|
|
|
1621
1620
|
React.createElement("div", { className: "flex flex-col items-end justify-center space-y-3" },
|
|
1622
1621
|
React.createElement("div", { className: "h-10 min-w-10" }),
|
|
1623
1622
|
lightLevels.map(function (level) { return (React.createElement("div", { key: level, className: "flex h-10 w-fit items-center justify-end" },
|
|
1624
|
-
React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" },
|
|
1623
|
+
React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" }, level))); })),
|
|
1625
1624
|
colors.map(function (color, index) {
|
|
1626
1625
|
return (React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3", key: index },
|
|
1627
1626
|
React.createElement("div", { className: "h-10 w-fit" },
|
|
1628
1627
|
React.createElement("div", { className: "text-center text-xs font-semibold" }, color.tailwind)),
|
|
1629
1628
|
lightLevels.map(function (level) {
|
|
1630
|
-
var suffix = level === '
|
|
1629
|
+
var suffix = level === '' ? '' : "-".concat(level);
|
|
1631
1630
|
return (React.createElement("div", { key: level, className: "aspect-square w-10 rounded-lg", style: {
|
|
1632
1631
|
backgroundColor: "var(--".concat(color.css).concat(suffix, ")"),
|
|
1633
1632
|
} }));
|
|
@@ -1728,18 +1727,18 @@ var TreeItem = function (_a) {
|
|
|
1728
1727
|
};
|
|
1729
1728
|
|
|
1730
1729
|
var MenuContainer = React.forwardRef(function MenuContainer(propsComp, ref) {
|
|
1731
|
-
var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.zIndex, zIndex = _f === void 0 ?
|
|
1730
|
+
var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.zIndex, zIndex = _f === void 0 ? 100 : _f, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex"]);
|
|
1732
1731
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
1733
1732
|
return (open && (React.createElement(React.Fragment, null,
|
|
1734
|
-
isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); } })),
|
|
1733
|
+
isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); }, style: { zIndex: zIndex } })),
|
|
1735
1734
|
React.createElement("div", __assign({ className: "w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), ref: ref, style: {
|
|
1736
|
-
zIndex: zIndex,
|
|
1735
|
+
zIndex: zIndex + 10,
|
|
1737
1736
|
} }, restProps), React.Children.map(children, function (child) {
|
|
1738
1737
|
return React.isValidElement(child)
|
|
1739
1738
|
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
|
1740
1739
|
React.cloneElement(child, {
|
|
1741
1740
|
onClose: function () { return onClose(); },
|
|
1742
|
-
zIndex: zIndex,
|
|
1741
|
+
zIndex: zIndex + 10,
|
|
1743
1742
|
})
|
|
1744
1743
|
: child;
|
|
1745
1744
|
})))));
|
|
@@ -1749,7 +1748,7 @@ MenuContainer.defaultProps = {
|
|
|
1749
1748
|
};
|
|
1750
1749
|
|
|
1751
1750
|
function MenuItem(_a) {
|
|
1752
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.caption, caption = _d === void 0 ? undefined : _d, _e = _a.isChecked, isChecked = _e === void 0 ? undefined : _e, _f = _a.onClose, onClose = _f === void 0 ? function () { } : _f, children = _a.children, _g = _a.zIndex, zIndex = _g === void 0 ?
|
|
1751
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.caption, caption = _d === void 0 ? undefined : _d, _e = _a.isChecked, isChecked = _e === void 0 ? undefined : _e, _f = _a.onClose, onClose = _f === void 0 ? function () { } : _f, children = _a.children, _g = _a.zIndex, zIndex = _g === void 0 ? 100 : _g, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children", "zIndex"]);
|
|
1753
1752
|
var _h = React.useState(false), isHovered = _h[0], setIsHovered = _h[1];
|
|
1754
1753
|
var _j = React.useState(false), isLeft = _j[0], setIsLeft = _j[1];
|
|
1755
1754
|
var isWithChecked = isChecked !== undefined;
|
|
@@ -1778,14 +1777,14 @@ function MenuItem(_a) {
|
|
|
1778
1777
|
React.createElement("div", __assign({ className: "relative flex items-center py-[5px] hover:bg-bia-blue-pastel ".concat(itemClass), role: "button", tabIndex: 0, onClick: function (e) {
|
|
1779
1778
|
onClick(e);
|
|
1780
1779
|
}, onKeyDown: function () { }, style: {
|
|
1781
|
-
zIndex: isHovered ? currentZIndex :
|
|
1780
|
+
zIndex: isHovered ? currentZIndex : currentZIndex + 15,
|
|
1782
1781
|
} }, props),
|
|
1783
1782
|
isWithChecked && (React.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked && React.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
|
|
1784
1783
|
React.createElement("span", { className: "whitespace-nowrap font-arial text-[11px] text-bia-black" }, label),
|
|
1785
1784
|
React.createElement("div", { className: "ml-auto flex items-center" },
|
|
1786
1785
|
children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),
|
|
1787
1786
|
children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] text-bia-coolgrey" }, caption)))),
|
|
1788
|
-
children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex }, children))));
|
|
1787
|
+
children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex + 10 }, children))));
|
|
1789
1788
|
}
|
|
1790
1789
|
MenuItem.defaultProps = {
|
|
1791
1790
|
className: '',
|
|
@@ -2128,7 +2127,7 @@ var fontConfig = {
|
|
|
2128
2127
|
};
|
|
2129
2128
|
|
|
2130
2129
|
var DropdownContainer = React.forwardRef(function DropdownContainer(propsComp, ref) {
|
|
2131
|
-
var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ?
|
|
2130
|
+
var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ? 100 : _h, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "size", "onClickItem", "zIndex"]);
|
|
2132
2131
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
2133
2132
|
var sizeClass = containerSizeConfig[size] || containerSizeConfig['md'];
|
|
2134
2133
|
var containerClass = "".concat(sizeClass, " ").concat(radiusClass, " ").concat(className);
|
|
@@ -2157,7 +2156,7 @@ DropdownContainer.defaultProps = {
|
|
|
2157
2156
|
};
|
|
2158
2157
|
|
|
2159
2158
|
function DropdownItem(_a) {
|
|
2160
|
-
var children = _a.children, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.onClickItem, onClickItem = _c === void 0 ? function () { } : _c, _d = _a.onClose, onClose = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.value, value = _f === void 0 ? '' : _f, content = _a.content, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.zIndex, zIndex = _h === void 0 ?
|
|
2159
|
+
var children = _a.children, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.onClickItem, onClickItem = _c === void 0 ? function () { } : _c, _d = _a.onClose, onClose = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.value, value = _f === void 0 ? '' : _f, content = _a.content, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 100 : _h, props = __rest(_a, ["children", "className", "onClickItem", "onClose", "size", "value", "content", "disabled", "zIndex"]);
|
|
2161
2160
|
var _j = React.useState(false), isHovered = _j[0], setIsHovered = _j[1];
|
|
2162
2161
|
var _k = React.useState(false), isLeft = _k[0], setIsLeft = _k[1];
|
|
2163
2162
|
var fontClass = fontConfig[size] || fontConfig['md'];
|