bianic-ui 1.5.1-beta.8 → 1.6.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 +209 -88
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Button/ButtonApp.d.ts +2 -1
- package/dist/cjs/types/components/Color.d.ts +1 -0
- package/dist/cjs/types/components/Forms/LiveSearch/PropsInterface.d.ts +1 -0
- package/dist/cjs/types/components/Forms/LiveSearch/index.d.ts +1 -1
- package/dist/cjs/types/components/Forms/TextArea/index.d.ts +2 -1
- package/dist/cjs/types/components/Forms/TextInput/index.d.ts +2 -1
- package/dist/cjs/types/components/Popover/configs.d.ts +20 -0
- package/dist/cjs/types/components/Popover/index.d.ts +3 -4
- package/dist/cjs/types/components/TagLabel/configs.d.ts +2 -2
- package/dist/cjs/types/components/TagLabel/index.d.ts +5 -4
- package/dist/cjs/types/components/index.d.ts +1 -1
- package/dist/cjs/types/stories/{Color.stories.d.ts → ColorPallete/Color.stories.d.ts} +2 -2
- package/dist/cjs/types/utility/helper.d.ts +3 -1
- package/dist/esm/index.js +210 -90
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Button/ButtonApp.d.ts +2 -1
- package/dist/esm/types/components/Color.d.ts +1 -0
- package/dist/esm/types/components/Forms/LiveSearch/PropsInterface.d.ts +1 -0
- package/dist/esm/types/components/Forms/LiveSearch/index.d.ts +1 -1
- package/dist/esm/types/components/Forms/TextArea/index.d.ts +2 -1
- package/dist/esm/types/components/Forms/TextInput/index.d.ts +2 -1
- package/dist/esm/types/components/Popover/configs.d.ts +20 -0
- package/dist/esm/types/components/Popover/index.d.ts +3 -4
- package/dist/esm/types/components/TagLabel/configs.d.ts +2 -2
- package/dist/esm/types/components/TagLabel/index.d.ts +5 -4
- package/dist/esm/types/components/index.d.ts +1 -1
- package/dist/esm/types/stories/{Color.stories.d.ts → ColorPallete/Color.stories.d.ts} +2 -2
- package/dist/esm/types/utility/helper.d.ts +3 -1
- package/dist/index.d.ts +26 -13
- package/package.json +1 -1
- package/src/style/color.css +626 -344
- package/tailwind.config.js +13 -13
package/dist/cjs/index.js
CHANGED
|
@@ -263,6 +263,22 @@ var childrenElement = function (element) {
|
|
|
263
263
|
var validUnion = function (value, union) {
|
|
264
264
|
return union.includes(value) ? value : union[0];
|
|
265
265
|
};
|
|
266
|
+
var useDetectOutsideClick = function (ref, initialState) {
|
|
267
|
+
var _a = React.useState(initialState), isActive = _a[0], setIsActive = _a[1];
|
|
268
|
+
React.useEffect(function () {
|
|
269
|
+
var pageClickEvent = function (event) {
|
|
270
|
+
// If the active element exists and is clicked outside of
|
|
271
|
+
if (ref.current !== null && !ref.current.contains(event.target)) {
|
|
272
|
+
setIsActive(!isActive);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
// If the item is active (ie open) then listen for clicks
|
|
276
|
+
if (isActive)
|
|
277
|
+
window.addEventListener('click', pageClickEvent);
|
|
278
|
+
return function () { return window.removeEventListener('click', pageClickEvent); };
|
|
279
|
+
}, [isActive, ref]);
|
|
280
|
+
return [isActive, setIsActive];
|
|
281
|
+
};
|
|
266
282
|
|
|
267
283
|
var variantUnion$2 = [
|
|
268
284
|
'normal-text',
|
|
@@ -1468,53 +1484,143 @@ var colorConfig$1 = {
|
|
|
1468
1484
|
};
|
|
1469
1485
|
|
|
1470
1486
|
var ButtonApp = function (_a) {
|
|
1471
|
-
_a.icon; _a.isNotified; var _c = _a.isActive, isActive = _c === void 0 ? false : _c, disabled = _a.disabled, _d = _a.color, color = _d === void 0 ? 'green' : _d, label = _a.label, rest = __rest(_a, ["icon", "isNotified", "isActive", "disabled", "color", "label"]);
|
|
1487
|
+
_a.icon; _a.isNotified; var _c = _a.isActive, isActive = _c === void 0 ? false : _c, disabled = _a.disabled, _d = _a.color, color = _d === void 0 ? 'green' : _d, label = _a.label, extended = _a.extended, rest = __rest(_a, ["icon", "isNotified", "isActive", "disabled", "color", "label", "extended"]);
|
|
1472
1488
|
var buttonState = isActive ? 'active' : 'default';
|
|
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));
|
|
1489
|
+
return (React.createElement("button", __assign({ className: "button-app px-[10px] pb-[8.8px] pt-[8px] text-size-tiny ".concat(colorConfig$1[color][buttonState], " ").concat(extended, " "), type: "button", disabled: disabled }, rest), label));
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1492
|
+
var textColorConfig = {
|
|
1493
|
+
dark: 'text-primary-black disabled:text-bia-coolgrey-disabled',
|
|
1494
|
+
light: 'text-primary-white disabled:opacity-30',
|
|
1495
|
+
};
|
|
1496
|
+
var stateColorConfig = {
|
|
1497
|
+
selected: 'bg-black/15 cursor-default',
|
|
1498
|
+
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',
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1501
|
+
var ContextualButton = function (_a) {
|
|
1502
|
+
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"]);
|
|
1503
|
+
var textColor = isSelected
|
|
1504
|
+
? variant === 'dark'
|
|
1505
|
+
? 'text-primary-black'
|
|
1506
|
+
: 'text-primary-white'
|
|
1507
|
+
: textColorConfig[variant];
|
|
1508
|
+
var stateColor = stateColorConfig[isSelected ? 'selected' : 'default'];
|
|
1509
|
+
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 }),
|
|
1510
|
+
icon,
|
|
1511
|
+
label && (React.createElement("div", { className: "label max-h-[46px] px-[5px] text-[12px] leading-none" }, label))));
|
|
1474
1512
|
};
|
|
1475
1513
|
|
|
1476
1514
|
function Color() {
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1515
|
+
var colors = [
|
|
1516
|
+
{
|
|
1517
|
+
css: 'red',
|
|
1518
|
+
tailwind: 'red',
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
css: 'orange',
|
|
1522
|
+
tailwind: 'orange',
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
css: 'yellow',
|
|
1526
|
+
tailwind: 'yellow',
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
css: 'green',
|
|
1530
|
+
tailwind: 'green',
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
css: 'verdant',
|
|
1534
|
+
tailwind: 'verdantgreen',
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
css: 'teal',
|
|
1538
|
+
tailwind: 'teal',
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
css: 'marguerite',
|
|
1542
|
+
tailwind: 'margueriteblue',
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
css: 'blue',
|
|
1546
|
+
tailwind: 'blue',
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
css: 'olympic',
|
|
1550
|
+
tailwind: 'olympicblue',
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
css: 'sky',
|
|
1554
|
+
tailwind: 'skyblue',
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
css: 'coolgrey',
|
|
1558
|
+
tailwind: 'coolgrey',
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
css: 'grey',
|
|
1562
|
+
tailwind: 'grey',
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
css: 'pink',
|
|
1566
|
+
tailwind: 'pink',
|
|
1567
|
+
},
|
|
1568
|
+
];
|
|
1569
|
+
var lightLevels = [
|
|
1570
|
+
'light-90',
|
|
1571
|
+
'light-80',
|
|
1572
|
+
'light-70',
|
|
1573
|
+
'light-60',
|
|
1574
|
+
'light-50',
|
|
1575
|
+
'light-40',
|
|
1576
|
+
'light-30',
|
|
1577
|
+
'light-20',
|
|
1578
|
+
'light-10',
|
|
1579
|
+
'primary',
|
|
1580
|
+
'dark-10',
|
|
1581
|
+
'dark-20',
|
|
1582
|
+
'dark-30',
|
|
1583
|
+
'dark-40',
|
|
1584
|
+
'dark-50',
|
|
1585
|
+
'dark-60',
|
|
1586
|
+
'dark-70',
|
|
1587
|
+
'dark-80',
|
|
1588
|
+
'dark-90',
|
|
1514
1589
|
];
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1590
|
+
var aliases = {
|
|
1591
|
+
'light-90': 'pastel',
|
|
1592
|
+
'light-50': 'disabled',
|
|
1593
|
+
'light-10': 'hover',
|
|
1594
|
+
'dark-10': 'active',
|
|
1595
|
+
};
|
|
1596
|
+
return (React.createElement("div", { className: "color-pallete flex flex-col gap-y-10" },
|
|
1597
|
+
React.createElement("div", { className: "flex gap-x-5 justify-center" },
|
|
1598
|
+
React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3" },
|
|
1599
|
+
React.createElement("div", { className: "text-center text-xs font-semibold" }, "Black"),
|
|
1600
|
+
React.createElement("div", { className: "aspect-square w-10 rounded-lg", style: {
|
|
1601
|
+
backgroundColor: "var(--primary-black)",
|
|
1602
|
+
} })),
|
|
1603
|
+
React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3" },
|
|
1604
|
+
React.createElement("div", { className: "text-center text-xs font-semibold" }, "White"),
|
|
1605
|
+
React.createElement("div", { className: "aspect-square w-10 rounded-lg border border-bia-black", style: {
|
|
1606
|
+
backgroundColor: "var(--primary-white)",
|
|
1607
|
+
} }))),
|
|
1608
|
+
React.createElement("div", { className: "flex gap-x-5" },
|
|
1609
|
+
React.createElement("div", { className: "flex flex-col items-end justify-center space-y-3" },
|
|
1610
|
+
React.createElement("div", { className: "h-10 min-w-10" }),
|
|
1611
|
+
lightLevels.map(function (level) { return (React.createElement("div", { key: level, className: "flex h-10 w-fit items-center justify-end" },
|
|
1612
|
+
React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" }, aliases[level] ? "(".concat(aliases[level], ") ").concat(level) : level))); })),
|
|
1613
|
+
colors.map(function (color, index) {
|
|
1614
|
+
return (React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3", key: index },
|
|
1615
|
+
React.createElement("div", { className: "h-10 w-fit" },
|
|
1616
|
+
React.createElement("div", { className: "text-center text-xs font-semibold" }, color.tailwind)),
|
|
1617
|
+
lightLevels.map(function (level) {
|
|
1618
|
+
var suffix = level === 'primary' ? '' : "-".concat(level);
|
|
1619
|
+
return (React.createElement("div", { key: level, className: "aspect-square w-10 rounded-lg", style: {
|
|
1620
|
+
backgroundColor: "var(--".concat(color.css).concat(suffix, ")"),
|
|
1621
|
+
} }));
|
|
1622
|
+
})));
|
|
1623
|
+
}))));
|
|
1518
1624
|
}
|
|
1519
1625
|
|
|
1520
1626
|
var DividerConfig = {
|
|
@@ -1670,13 +1776,13 @@ function PasswordIcon(_a) {
|
|
|
1670
1776
|
}
|
|
1671
1777
|
|
|
1672
1778
|
function TextInput(_a) {
|
|
1673
|
-
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l, _m = _a.maxLength, maxLength = _m === void 0 ? undefined : _m, _o = _a.inputClassName, inputClassName = _o === void 0 ? '' : _o; _a.isFlatRight; var actionElement = _a.actionElement, props = __rest(_a, ["descText", "disabled", "icon", "id", "size", "isValid", "label", "placeholder", "readOnly", "required", "variant", "value", "onChange", "maxLength", "inputClassName", "isFlatRight", "actionElement"]);
|
|
1779
|
+
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l, _m = _a.maxLength, maxLength = _m === void 0 ? undefined : _m, _o = _a.inputClassName, inputClassName = _o === void 0 ? '' : _o; _a.isFlatRight; var actionElement = _a.actionElement, _q = _a.autoComplete, autoComplete = _q === void 0 ? 'off' : _q, props = __rest(_a, ["descText", "disabled", "icon", "id", "size", "isValid", "label", "placeholder", "readOnly", "required", "variant", "value", "onChange", "maxLength", "inputClassName", "isFlatRight", "actionElement", "autoComplete"]);
|
|
1674
1780
|
var isTransparent = variant.includes('transparent');
|
|
1675
|
-
var
|
|
1676
|
-
var
|
|
1677
|
-
var
|
|
1781
|
+
var _r = React.useState(false), isShow = _r[0], setIsShow = _r[1];
|
|
1782
|
+
var _s = styleConfig[variant], fieldStyle = _s.fieldStyle, iconStyle = _s.iconStyle;
|
|
1783
|
+
var _t = isTransparent
|
|
1678
1784
|
? __assign(__assign({}, sizeConfig$b[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$b[size].fieldSize +
|
|
1679
|
-
" pe-[".concat(9 + sizeConfig$b[size].iconSize, "px]") }) : sizeConfig$b[size], iconSize =
|
|
1785
|
+
" pe-[".concat(9 + sizeConfig$b[size].iconSize, "px]") }) : sizeConfig$b[size], iconSize = _t.iconSize, fieldSize = _t.fieldSize, iconPosition = _t.iconPosition;
|
|
1680
1786
|
var borderStyle = isTransparent
|
|
1681
1787
|
? 'border-transparent bg-transparent' // customize border rule for transparent variant
|
|
1682
1788
|
: 'border border-bia-grey-dark-10 bg-primary-white';
|
|
@@ -1713,7 +1819,7 @@ function TextInput(_a) {
|
|
|
1713
1819
|
label,
|
|
1714
1820
|
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
1715
1821
|
React.createElement("div", { className: "relative w-full" },
|
|
1716
|
-
React.createElement("input", __assign({ className: "field w-full rounded read-only:pointer-events-none read-only:border-bia-grey-light-50 hover:rounded-b-none focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName), disabled: disabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); }, maxLength: maxLength }, props)),
|
|
1822
|
+
React.createElement("input", __assign({ className: "field w-full rounded read-only:pointer-events-none read-only:border-bia-grey-light-50 hover:rounded-b-none focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName), disabled: disabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); }, maxLength: maxLength, autoComplete: autoComplete }, props)),
|
|
1717
1823
|
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(actionElement ? '' : iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
|
|
1718
1824
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs ".concat(descColor) },
|
|
1719
1825
|
descText && React.createElement("span", null, descText),
|
|
@@ -1793,7 +1899,7 @@ var ResizeIcon = function (_a) {
|
|
|
1793
1899
|
};
|
|
1794
1900
|
|
|
1795
1901
|
function TextArea(_a) {
|
|
1796
|
-
var descText = _a.descText, _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.placeholder, placeholder = _d === void 0 ? '' : _d, required = _a.required, rows = _a.rows, _e = _a.maxLength, maxLength = _e === void 0 ? undefined : _e, value = _a.value, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, props = __rest(_a, ["descText", "disabled", "id", "size", "label", "placeholder", "required", "rows", "maxLength", "value", "readOnly"]);
|
|
1902
|
+
var descText = _a.descText, _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.placeholder, placeholder = _d === void 0 ? '' : _d, required = _a.required, rows = _a.rows, _e = _a.maxLength, maxLength = _e === void 0 ? undefined : _e, value = _a.value, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, _g = _a.autoComplete, autoComplete = _g === void 0 ? 'off' : _g, props = __rest(_a, ["descText", "disabled", "id", "size", "label", "placeholder", "required", "rows", "maxLength", "value", "readOnly", "autoComplete"]);
|
|
1797
1903
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
1798
1904
|
var inputClass = sizeConfig$9[size].inputClass;
|
|
1799
1905
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
@@ -1803,7 +1909,7 @@ function TextArea(_a) {
|
|
|
1803
1909
|
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
1804
1910
|
React.createElement("div", { className: "relative h-full w-full min-w-[250px]" },
|
|
1805
1911
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
1806
|
-
React.createElement("textarea", __assign({ className: "field w-full rounded border border-bia-grey-dark-10 bg-primary-white p-2.5 read-only:pointer-events-none focus-visible:outline-none enabled:hover:rounded-b-none enabled:hover:border-b-bia-blue enabled:focus:rounded-b-none enabled:focus:border-b-bia-blue disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(inputClass), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value
|
|
1912
|
+
React.createElement("textarea", __assign({ className: "field bianic-text-area w-full rounded border border-bia-grey-dark-10 bg-primary-white p-2.5 read-only:pointer-events-none focus-visible:outline-none enabled:hover:rounded-b-none enabled:hover:border-b-bia-blue enabled:focus:rounded-b-none enabled:focus:border-b-bia-blue disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(inputClass), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value, autoComplete: autoComplete, readOnly: readOnly }, props))),
|
|
1807
1913
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs text-primary-cool" },
|
|
1808
1914
|
descText && React.createElement("span", null, descText),
|
|
1809
1915
|
maxLength && (React.createElement("span", null,
|
|
@@ -2021,9 +2127,9 @@ var sizeConfig$5 = {
|
|
|
2021
2127
|
|
|
2022
2128
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2023
2129
|
function LiveSearch(_a) {
|
|
2024
|
-
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, placeholder = _a.placeholder, _d = _a.required, required = _d === void 0 ? false : _d, options = _a.options, setValue = _a.setValue, value = _a.value, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.onChangeText, onChangeText = _f === void 0 ? function () { } : _f, _g = _a.onClickDropdown, onClickDropdown = _g === void 0 ? function () { } : _g;
|
|
2025
|
-
var
|
|
2026
|
-
var
|
|
2130
|
+
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, placeholder = _a.placeholder, _d = _a.required, required = _d === void 0 ? false : _d, options = _a.options, setValue = _a.setValue, value = _a.value, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.onChangeText, onChangeText = _f === void 0 ? function () { } : _f, _g = _a.onClickDropdown, onClickDropdown = _g === void 0 ? function () { } : _g, _h = _a.autoComplete, autoComplete = _h === void 0 ? 'off' : _h;
|
|
2131
|
+
var _j = React.useState(false), isOpen = _j[0], setIsOpen = _j[1];
|
|
2132
|
+
var _k = sizeConfig$5[size], iconClass = _k.iconClass, iconSize = _k.iconSize, inputClass = _k.inputClass;
|
|
2027
2133
|
var inputRef = React.useRef(null);
|
|
2028
2134
|
var handleOutsideClick = function (e) {
|
|
2029
2135
|
if (inputRef.current && !inputRef.current.contains(e.target)) {
|
|
@@ -2047,7 +2153,7 @@ function LiveSearch(_a) {
|
|
|
2047
2153
|
React.createElement("input", { className: "field peer w-full rounded border border-bia-grey-dark-10 bg-primary-white read-only:pointer-events-none read-only:border-bia-grey-disabled focus-visible:outline-none enabled:hover:rounded-b-none enabled:hover:border-b-bia-blue enabled:focus:rounded-b-none enabled:focus:border-b-bia-blue disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-10 disabled:text-bia-coolgrey ".concat(inputClass), onClick: function () { return setIsOpen(!isOpen); }, value: value.label, required: required, disabled: disabled, id: id, placeholder: placeholder, onChange: function (e) {
|
|
2048
2154
|
onChangeText(e);
|
|
2049
2155
|
setValue({ id: null, label: e.target.value });
|
|
2050
|
-
}, type: "search", readOnly: readOnly }),
|
|
2156
|
+
}, type: "search", readOnly: readOnly, autoComplete: autoComplete }),
|
|
2051
2157
|
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 peer-hover:hidden peer-focus:hidden ".concat(iconClass) },
|
|
2052
2158
|
React.createElement(TbZoom, { className: "text-primary-black", style: { fontSize: iconSize } })),
|
|
2053
2159
|
isOpen && (React.createElement("div", { className: "border-grey-100 absolute z-10 max-h-60 w-full overflow-y-auto rounded-b-md border bg-primary-white shadow-lg", onClick: onClickDropdown }, filteredOptions.map(function (option) {
|
|
@@ -2267,48 +2373,60 @@ Piils.defaultProps = {
|
|
|
2267
2373
|
|
|
2268
2374
|
var classConfig$1 = {
|
|
2269
2375
|
top: {
|
|
2270
|
-
tooltipContainer: 'bottom-[100
|
|
2376
|
+
tooltipContainer: 'bottom-[calc(100%+10px)] left-1/2 -translate-x-1/2',
|
|
2271
2377
|
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
2272
|
-
triangleShape: '
|
|
2378
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2273
2379
|
},
|
|
2274
2380
|
right: {
|
|
2275
|
-
tooltipContainer: 'left-[100
|
|
2381
|
+
tooltipContainer: 'left-[calc(100%+10px)] top-1/2 -translate-y-1/2',
|
|
2276
2382
|
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
2277
|
-
triangleShape: '
|
|
2383
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
2278
2384
|
},
|
|
2279
2385
|
bottom: {
|
|
2280
|
-
tooltipContainer: 'top-[100
|
|
2281
|
-
triangleContainer: 'left-0 -top-[
|
|
2282
|
-
triangleShape: '
|
|
2386
|
+
tooltipContainer: 'top-[calc(100%+10px)] left-1/2 -translate-x-1/2',
|
|
2387
|
+
triangleContainer: 'px-[10px] left-0 -top-[9px] flex justify-center w-full h-auto',
|
|
2388
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2283
2389
|
},
|
|
2284
2390
|
left: {
|
|
2285
|
-
tooltipContainer: 'right-[100
|
|
2391
|
+
tooltipContainer: 'right-[calc(100%+10px)] top-1/2 -translate-y-1/2',
|
|
2286
2392
|
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
2287
|
-
triangleShape: '
|
|
2393
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
2394
|
+
},
|
|
2395
|
+
'top-right': {
|
|
2396
|
+
tooltipContainer: 'bottom-[calc(100%+10px)] right-0',
|
|
2397
|
+
triangleContainer: 'px-[10px] left-0 -bottom-[4px] flex justify-end w-full h-auto',
|
|
2398
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2399
|
+
},
|
|
2400
|
+
'top-left': {
|
|
2401
|
+
tooltipContainer: 'bottom-[calc(100%+10px)] left-0',
|
|
2402
|
+
triangleContainer: 'px-[10px] left-0 -bottom-[4px] flex justify-start w-full h-auto',
|
|
2403
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2404
|
+
},
|
|
2405
|
+
'bottom-right': {
|
|
2406
|
+
tooltipContainer: 'top-[calc(100%+10px)] right-0',
|
|
2407
|
+
triangleContainer: 'px-[10px] left-0 -top-[9px] flex justify-end w-full h-auto',
|
|
2408
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2409
|
+
},
|
|
2410
|
+
'bottom-left': {
|
|
2411
|
+
tooltipContainer: 'top-[calc(100%+10px)] left-0',
|
|
2412
|
+
triangleContainer: 'px-[10px] left-0 -top-[9px] flex justify-start w-full h-auto',
|
|
2413
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2288
2414
|
},
|
|
2289
2415
|
};
|
|
2290
2416
|
|
|
2291
2417
|
function Popover(_a) {
|
|
2292
|
-
var children = _a.children, content = _a.content
|
|
2293
|
-
var
|
|
2294
|
-
var
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}, delay);
|
|
2298
|
-
};
|
|
2299
|
-
var hidePopover = function () {
|
|
2300
|
-
clearInterval(timeout);
|
|
2301
|
-
setOpen(false);
|
|
2302
|
-
};
|
|
2303
|
-
var _e = classConfig$1[direction], tooltipContainer = _e.tooltipContainer, triangleContainer = _e.triangleContainer, triangleShape = _e.triangleShape;
|
|
2304
|
-
return (React.createElement("div", { className: "Popover-Wrapper relative block w-fit h-fit", onMouseEnter: showPopover, onMouseLeave: hidePopover },
|
|
2418
|
+
var children = _a.children, content = _a.content; _a.delay; var _c = _a.direction, direction = _c === void 0 ? 'bottom' : _c, _d = _a.title, title = _d === void 0 ? '' : _d; _a.maxWidth;
|
|
2419
|
+
var wrapperRef = React.useRef(null);
|
|
2420
|
+
var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
|
|
2421
|
+
var _f = classConfig$1[direction], tooltipContainer = _f.tooltipContainer, triangleContainer = _f.triangleContainer, triangleShape = _f.triangleShape;
|
|
2422
|
+
return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
|
|
2305
2423
|
children,
|
|
2306
|
-
|
|
2424
|
+
isOpen && (React.createElement("div", { className: "Bianic-popover-Tip text-bia-sm absolute z-50 w-[245px] space-y-[5px] rounded-[4px] bg-primary-black px-[20px] py-[17.5px] text-primary-white ".concat(tooltipContainer) },
|
|
2307
2425
|
React.createElement("div", { className: "flex flex-col" },
|
|
2308
|
-
React.createElement("div", { className: "
|
|
2309
|
-
React.createElement("div", { className: "text-[12px] font-
|
|
2310
|
-
React.createElement("div", { className: "absolute ".concat(triangleContainer) },
|
|
2311
|
-
React.createElement("div", { className: "
|
|
2426
|
+
React.createElement("div", { className: "mb-[5px] font-humnst777 text-[16px] font-bold leading-[19.42px]" }, title),
|
|
2427
|
+
React.createElement("div", { className: "break-words font-segoe text-[12px] font-normal" }, content)),
|
|
2428
|
+
React.createElement("div", { className: "triangle absolute ".concat(triangleContainer) },
|
|
2429
|
+
React.createElement("div", { className: "h-0 w-0 ".concat(triangleShape) }))))));
|
|
2312
2430
|
}
|
|
2313
2431
|
Popover.defaultProps = {
|
|
2314
2432
|
delay: 400,
|
|
@@ -2630,7 +2748,8 @@ var colorConfig = {
|
|
|
2630
2748
|
blue: 'bg-bia-blue text-primary-white',
|
|
2631
2749
|
teal: 'bg-bia-teal text-primary-white',
|
|
2632
2750
|
green: 'bg-bia-green text-primary-white',
|
|
2633
|
-
yellow: 'bg-bia-yellow text-primary-
|
|
2751
|
+
// yellow: 'bg-bia-yellow text-primary-black',
|
|
2752
|
+
orange: 'bg-bia-orange text-primary-white',
|
|
2634
2753
|
red: 'bg-bia-red text-primary-white',
|
|
2635
2754
|
black: 'bg-primary-black text-primary-white',
|
|
2636
2755
|
white: 'bg-primary-white text-primary-black border border-primary-black',
|
|
@@ -2671,7 +2790,7 @@ var colorUnion = [
|
|
|
2671
2790
|
'blue',
|
|
2672
2791
|
'teal',
|
|
2673
2792
|
'green',
|
|
2674
|
-
'
|
|
2793
|
+
'orange',
|
|
2675
2794
|
'red',
|
|
2676
2795
|
'black',
|
|
2677
2796
|
'white',
|
|
@@ -2680,12 +2799,12 @@ var colorUnion = [
|
|
|
2680
2799
|
var sizeUnion = ['md', 'sm', 'tn'];
|
|
2681
2800
|
var variantUnion = ['label', 'icon', 'closeable'];
|
|
2682
2801
|
var TagLabel = function (_a) {
|
|
2683
|
-
var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var
|
|
2802
|
+
var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var _c = _a.bgColor, bgColor = _c === void 0 ? 'grey-light-50' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'black' : _d, outlineColor = _a.outlineColor, isBlock = _a.isBlock, maxWidth = _a.maxWidth, isDark = _a.isDark; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
|
|
2684
2803
|
var validatedColor = validUnion(color, colorUnion);
|
|
2685
2804
|
var validatedSize = validUnion(size, sizeUnion);
|
|
2686
2805
|
var validatedVariant = validUnion(variant, variantUnion);
|
|
2687
2806
|
var containerRef = React.useRef(null);
|
|
2688
|
-
var
|
|
2807
|
+
var _e = React.useState(null), sizeCount = _e[0], setSizeCount = _e[1];
|
|
2689
2808
|
React.useEffect(function () {
|
|
2690
2809
|
if (variant === 'icon') {
|
|
2691
2810
|
// Get the size of the icon
|
|
@@ -2702,13 +2821,14 @@ var TagLabel = function (_a) {
|
|
|
2702
2821
|
}
|
|
2703
2822
|
}, []);
|
|
2704
2823
|
var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
|
|
2824
|
+
var borderColorRules = outlineColor || bgColor;
|
|
2705
2825
|
var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
|
|
2706
2826
|
var sizeClass = validatedVariant === 'icon'
|
|
2707
2827
|
? iconOnlySizeConfig[validatedSize]
|
|
2708
2828
|
: sizeConfig[validatedSize];
|
|
2709
2829
|
var isCloseableClass = validatedVariant === 'closeable' && rightPaddingConfig[validatedSize];
|
|
2710
2830
|
var colorClass = validatedColor === 'custom'
|
|
2711
|
-
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor)
|
|
2831
|
+
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
|
|
2712
2832
|
: colorConfig[validatedColor];
|
|
2713
2833
|
var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
|
|
2714
2834
|
var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
|
|
@@ -2745,8 +2865,8 @@ TagLabel.defaultProps = {
|
|
|
2745
2865
|
rightIcon: null,
|
|
2746
2866
|
left: null,
|
|
2747
2867
|
right: null,
|
|
2748
|
-
bgColor:
|
|
2749
|
-
textColor:
|
|
2868
|
+
bgColor: 'grey-light-50',
|
|
2869
|
+
textColor: 'black',
|
|
2750
2870
|
isBlock: false,
|
|
2751
2871
|
maxWidth: 300,
|
|
2752
2872
|
isDark: false,
|
|
@@ -2868,6 +2988,7 @@ exports.Button = Button;
|
|
|
2868
2988
|
exports.ButtonApp = ButtonApp;
|
|
2869
2989
|
exports.Checkbox = Checkbox;
|
|
2870
2990
|
exports.Color = Color;
|
|
2991
|
+
exports.ContextualButton = ContextualButton;
|
|
2871
2992
|
exports.Display = Display;
|
|
2872
2993
|
exports.Divider = Divider;
|
|
2873
2994
|
exports.FileTree = FileTree;
|