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
|
@@ -4,10 +4,11 @@ interface TextProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
variant: 'large-text' | 'large-text-semibold' | 'medium-text' | 'medium-text-semibold' | 'caption' | 'caption-semibold' | 'normal-text' | 'normal-text-semilight' | 'normal-text-semibold' | 'normal-text-bold' | 'small-text' | 'small-text-semibold' | 'tiny-text' | 'tiny-text-bold' | 'script' | 'link';
|
|
6
6
|
}
|
|
7
|
-
declare function Text({ extended, variant, children }: TextProps): React.JSX.Element;
|
|
7
|
+
declare function Text({ extended, variant, children, className }: TextProps): React.JSX.Element;
|
|
8
8
|
declare namespace Text {
|
|
9
9
|
var defaultProps: {
|
|
10
10
|
extended: string;
|
|
11
|
+
className: string;
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
export default Text;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: () => import("react").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Demo: Story;
|
package/dist/esm/index.js
CHANGED
|
@@ -307,12 +307,17 @@ var variantUnion$2 = [
|
|
|
307
307
|
'link',
|
|
308
308
|
];
|
|
309
309
|
function Text(_a) {
|
|
310
|
-
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children;
|
|
310
|
+
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children, _c = _a.className, className = _c === void 0 ? '' : _c;
|
|
311
311
|
var validatedVariant = validUnion(variant, variantUnion$2);
|
|
312
|
-
|
|
312
|
+
var defaultColor = extended.includes('text-bia') || (className === null || className === void 0 ? void 0 : className.includes('text-bia'))
|
|
313
|
+
? ''
|
|
314
|
+
: 'text-bia-black';
|
|
315
|
+
var extendedClasses = "".concat(className, " ").concat(extended);
|
|
316
|
+
return (React.createElement("span", { className: "bianic-text ".concat(textClasses[validatedVariant], " ").concat(defaultColor, " ").concat(extendedClasses) }, childrenElement(children)));
|
|
313
317
|
}
|
|
314
318
|
Text.defaultProps = {
|
|
315
319
|
extended: '',
|
|
320
|
+
className: '',
|
|
316
321
|
};
|
|
317
322
|
|
|
318
323
|
/******************************************************************************
|
|
@@ -438,10 +443,10 @@ var minWidthConfig$1 = {
|
|
|
438
443
|
tn: 'min-w-[64px]',
|
|
439
444
|
};
|
|
440
445
|
var iconOnlySizeConfig$1 = {
|
|
441
|
-
lg: '
|
|
442
|
-
md: '
|
|
443
|
-
sm: '
|
|
444
|
-
tn: '
|
|
446
|
+
lg: 'py-[13px] flex items-center justify-center gap-[10px]',
|
|
447
|
+
md: 'py-[11px] flex items-center justify-center gap-[5px]',
|
|
448
|
+
sm: 'py-[8px] flex items-center justify-center gap-[5px] ',
|
|
449
|
+
tn: 'py-[4px] flex items-center justify-center gap-[3px]',
|
|
445
450
|
};
|
|
446
451
|
var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
|
|
447
452
|
var variantConfig$2 = {
|
|
@@ -479,7 +484,7 @@ var variantUnion$1 = [
|
|
|
479
484
|
'primary-outlined',
|
|
480
485
|
'success-outlined',
|
|
481
486
|
'warning-outlined',
|
|
482
|
-
'form-group'
|
|
487
|
+
'form-group',
|
|
483
488
|
];
|
|
484
489
|
var radiusUnion = ['default', 'full-rounded'];
|
|
485
490
|
var sizeUnion$5 = ['md', 'lg', 'sm', 'tn'];
|
|
@@ -504,7 +509,7 @@ function Button(_a) {
|
|
|
504
509
|
}
|
|
505
510
|
var sizeClass = label || variant === 'form-group'
|
|
506
511
|
? " ".concat(minWidthRules, " ").concat(sizingRules)
|
|
507
|
-
: iconOnlySizeConfig$1[validatedSize];
|
|
512
|
+
: "".concat(iconOnlySizeConfig$1[validatedSize], " ").concat(variant.includes('link') ? '' : "".concat(sidePaddingConfig[validatedSize]));
|
|
508
513
|
var classString = "\n ".concat(variantConfig$2[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig$1[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
509
514
|
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),
|
|
510
515
|
childrenElement(iconLeft || left),
|
|
@@ -1586,7 +1591,7 @@ function Color() {
|
|
|
1586
1591
|
'light-30',
|
|
1587
1592
|
'light-20',
|
|
1588
1593
|
'light-10',
|
|
1589
|
-
'
|
|
1594
|
+
'',
|
|
1590
1595
|
'dark-10',
|
|
1591
1596
|
'dark-20',
|
|
1592
1597
|
'dark-30',
|
|
@@ -1597,14 +1602,8 @@ function Color() {
|
|
|
1597
1602
|
'dark-80',
|
|
1598
1603
|
'dark-90',
|
|
1599
1604
|
];
|
|
1600
|
-
var aliases = {
|
|
1601
|
-
'light-90': 'pastel',
|
|
1602
|
-
'light-50': 'disabled',
|
|
1603
|
-
'light-10': 'hover',
|
|
1604
|
-
'dark-10': 'active',
|
|
1605
|
-
};
|
|
1606
1605
|
return (React.createElement("div", { className: "color-pallete flex flex-col gap-y-10" },
|
|
1607
|
-
React.createElement("div", { className: "flex gap-x-5
|
|
1606
|
+
React.createElement("div", { className: "flex justify-center gap-x-5" },
|
|
1608
1607
|
React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3" },
|
|
1609
1608
|
React.createElement("div", { className: "text-center text-xs font-semibold" }, "Black"),
|
|
1610
1609
|
React.createElement("div", { className: "aspect-square w-10 rounded-lg", style: {
|
|
@@ -1619,13 +1618,13 @@ function Color() {
|
|
|
1619
1618
|
React.createElement("div", { className: "flex flex-col items-end justify-center space-y-3" },
|
|
1620
1619
|
React.createElement("div", { className: "h-10 min-w-10" }),
|
|
1621
1620
|
lightLevels.map(function (level) { return (React.createElement("div", { key: level, className: "flex h-10 w-fit items-center justify-end" },
|
|
1622
|
-
React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" },
|
|
1621
|
+
React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" }, level))); })),
|
|
1623
1622
|
colors.map(function (color, index) {
|
|
1624
1623
|
return (React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3", key: index },
|
|
1625
1624
|
React.createElement("div", { className: "h-10 w-fit" },
|
|
1626
1625
|
React.createElement("div", { className: "text-center text-xs font-semibold" }, color.tailwind)),
|
|
1627
1626
|
lightLevels.map(function (level) {
|
|
1628
|
-
var suffix = level === '
|
|
1627
|
+
var suffix = level === '' ? '' : "-".concat(level);
|
|
1629
1628
|
return (React.createElement("div", { key: level, className: "aspect-square w-10 rounded-lg", style: {
|
|
1630
1629
|
backgroundColor: "var(--".concat(color.css).concat(suffix, ")"),
|
|
1631
1630
|
} }));
|
|
@@ -1726,18 +1725,18 @@ var TreeItem = function (_a) {
|
|
|
1726
1725
|
};
|
|
1727
1726
|
|
|
1728
1727
|
var MenuContainer = forwardRef(function MenuContainer(propsComp, ref) {
|
|
1729
|
-
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 ?
|
|
1728
|
+
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"]);
|
|
1730
1729
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
1731
1730
|
return (open && (React.createElement(React.Fragment, null,
|
|
1732
|
-
isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); } })),
|
|
1731
|
+
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 } })),
|
|
1733
1732
|
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: {
|
|
1734
|
-
zIndex: zIndex,
|
|
1733
|
+
zIndex: zIndex + 10,
|
|
1735
1734
|
} }, restProps), Children.map(children, function (child) {
|
|
1736
1735
|
return React.isValidElement(child)
|
|
1737
1736
|
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
|
1738
1737
|
cloneElement(child, {
|
|
1739
1738
|
onClose: function () { return onClose(); },
|
|
1740
|
-
zIndex: zIndex,
|
|
1739
|
+
zIndex: zIndex + 10,
|
|
1741
1740
|
})
|
|
1742
1741
|
: child;
|
|
1743
1742
|
})))));
|
|
@@ -1747,7 +1746,7 @@ MenuContainer.defaultProps = {
|
|
|
1747
1746
|
};
|
|
1748
1747
|
|
|
1749
1748
|
function MenuItem(_a) {
|
|
1750
|
-
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 ?
|
|
1749
|
+
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"]);
|
|
1751
1750
|
var _h = useState(false), isHovered = _h[0], setIsHovered = _h[1];
|
|
1752
1751
|
var _j = useState(false), isLeft = _j[0], setIsLeft = _j[1];
|
|
1753
1752
|
var isWithChecked = isChecked !== undefined;
|
|
@@ -1776,14 +1775,14 @@ function MenuItem(_a) {
|
|
|
1776
1775
|
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) {
|
|
1777
1776
|
onClick(e);
|
|
1778
1777
|
}, onKeyDown: function () { }, style: {
|
|
1779
|
-
zIndex: isHovered ? currentZIndex :
|
|
1778
|
+
zIndex: isHovered ? currentZIndex : currentZIndex + 15,
|
|
1780
1779
|
} }, props),
|
|
1781
1780
|
isWithChecked && (React.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked && React.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
|
|
1782
1781
|
React.createElement("span", { className: "whitespace-nowrap font-arial text-[11px] text-bia-black" }, label),
|
|
1783
1782
|
React.createElement("div", { className: "ml-auto flex items-center" },
|
|
1784
1783
|
children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),
|
|
1785
1784
|
children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] text-bia-coolgrey" }, caption)))),
|
|
1786
|
-
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))));
|
|
1785
|
+
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))));
|
|
1787
1786
|
}
|
|
1788
1787
|
MenuItem.defaultProps = {
|
|
1789
1788
|
className: '',
|
|
@@ -2126,7 +2125,7 @@ var fontConfig = {
|
|
|
2126
2125
|
};
|
|
2127
2126
|
|
|
2128
2127
|
var DropdownContainer = forwardRef(function DropdownContainer(propsComp, ref) {
|
|
2129
|
-
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 ?
|
|
2128
|
+
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"]);
|
|
2130
2129
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
2131
2130
|
var sizeClass = containerSizeConfig[size] || containerSizeConfig['md'];
|
|
2132
2131
|
var containerClass = "".concat(sizeClass, " ").concat(radiusClass, " ").concat(className);
|
|
@@ -2155,7 +2154,7 @@ DropdownContainer.defaultProps = {
|
|
|
2155
2154
|
};
|
|
2156
2155
|
|
|
2157
2156
|
function DropdownItem(_a) {
|
|
2158
|
-
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 ?
|
|
2157
|
+
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"]);
|
|
2159
2158
|
var _j = useState(false), isHovered = _j[0], setIsHovered = _j[1];
|
|
2160
2159
|
var _k = useState(false), isLeft = _k[0], setIsLeft = _k[1];
|
|
2161
2160
|
var fontClass = fontConfig[size] || fontConfig['md'];
|