bianic-ui 1.0.0-beta.24 → 1.0.0-beta.25
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 +33 -14
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Tooltip/configs.d.ts +20 -0
- package/dist/cjs/types/components/Tooltip/index.d.ts +4 -1
- package/dist/cjs/types/stories/{Tooltip.stories.d.ts → Tooltip/Tooltip.stories.d.ts} +2 -1
- package/dist/esm/index.js +33 -14
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Tooltip/configs.d.ts +20 -0
- package/dist/esm/types/components/Tooltip/index.d.ts +4 -1
- package/dist/esm/types/stories/{Tooltip.stories.d.ts → Tooltip/Tooltip.stories.d.ts} +2 -1
- package/dist/index.d.ts +4 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1545,9 +1545,9 @@ function TextInput(_a) {
|
|
|
1545
1545
|
descColor = 'text-bia-red';
|
|
1546
1546
|
var bottomBorderColor = 'hover:border-b-bia-blue focus:border-b-bia-blue';
|
|
1547
1547
|
if (!disabled && isExistValidation && isValid)
|
|
1548
|
-
bottomBorderColor = '
|
|
1548
|
+
bottomBorderColor = 'border-b-bia-green';
|
|
1549
1549
|
if (!disabled && isExistValidation && !isValid)
|
|
1550
|
-
bottomBorderColor = '
|
|
1550
|
+
bottomBorderColor = 'border-b-bia-red';
|
|
1551
1551
|
var iconElement = null;
|
|
1552
1552
|
if (!disabled && isExistValidation)
|
|
1553
1553
|
iconElement = React.createElement(ValidationIcon, { isValid: isValid, iconSize: iconSize });
|
|
@@ -2593,31 +2593,51 @@ TagLabel.defaultProps = {
|
|
|
2593
2593
|
|
|
2594
2594
|
var classConfig = {
|
|
2595
2595
|
top: {
|
|
2596
|
-
tooltipContainer: 'bottom-[
|
|
2596
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
2597
2597
|
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
2598
2598
|
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2599
2599
|
},
|
|
2600
2600
|
right: {
|
|
2601
|
-
tooltipContainer: 'left-[
|
|
2601
|
+
tooltipContainer: 'left-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
2602
2602
|
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
2603
2603
|
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
2604
2604
|
},
|
|
2605
2605
|
bottom: {
|
|
2606
|
-
tooltipContainer: 'top-[
|
|
2606
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
2607
2607
|
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
2608
2608
|
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2609
2609
|
},
|
|
2610
2610
|
left: {
|
|
2611
|
-
tooltipContainer: 'right-[
|
|
2611
|
+
tooltipContainer: 'right-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
2612
2612
|
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
2613
2613
|
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
2614
2614
|
},
|
|
2615
|
+
'top-right': {
|
|
2616
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] right-0',
|
|
2617
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
2618
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2619
|
+
},
|
|
2620
|
+
'top-left': {
|
|
2621
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-0',
|
|
2622
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
2623
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
2624
|
+
},
|
|
2625
|
+
'bottom-right': {
|
|
2626
|
+
tooltipContainer: 'top-[calc(100%+5px)] right-0',
|
|
2627
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
2628
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2629
|
+
},
|
|
2630
|
+
'bottom-left': {
|
|
2631
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-0',
|
|
2632
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
2633
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
2634
|
+
},
|
|
2615
2635
|
};
|
|
2616
2636
|
|
|
2617
2637
|
function Tooltip(props) {
|
|
2618
|
-
var children = props.children, content = props.content, delay = props.delay, _a = props.direction, direction = _a === void 0 ? 'top' : _a;
|
|
2638
|
+
var children = props.children, content = props.content, delay = props.delay, _a = props.direction, direction = _a === void 0 ? 'top' : _a, _b = props.maxWidth, maxWidth = _b === void 0 ? '300px' : _b;
|
|
2619
2639
|
var timeout;
|
|
2620
|
-
var
|
|
2640
|
+
var _c = React.useState(false), active = _c[0], setActive = _c[1];
|
|
2621
2641
|
var showTip = function () {
|
|
2622
2642
|
timeout = setTimeout(function () {
|
|
2623
2643
|
setActive(true);
|
|
@@ -2627,17 +2647,16 @@ function Tooltip(props) {
|
|
|
2627
2647
|
clearInterval(timeout);
|
|
2628
2648
|
setActive(false);
|
|
2629
2649
|
};
|
|
2630
|
-
var
|
|
2631
|
-
return (React.createElement("div", { className: "Tooltip-Wrapper relative
|
|
2650
|
+
var _d = classConfig[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
|
|
2651
|
+
return (React.createElement("div", { className: "Tooltip-Wrapper relative flex flex-col w-full h-fit", onMouseEnter: showTip, onMouseLeave: hideTip },
|
|
2632
2652
|
children,
|
|
2633
|
-
active && (React.createElement("div", { className: "Tooltip
|
|
2634
|
-
content
|
|
2635
|
-
React.createElement("div", { className: "absolute ".concat(triangleContainer) },
|
|
2636
|
-
React.createElement("div", { className: "w-0 h-0 ".concat(triangleShape) }))))));
|
|
2653
|
+
active && (React.createElement("div", { className: "Tooltip absolute px-[7px] py-[4px] text-size-sm bg-primary-black text-primary-white z-50 whitespace-nowrap rounded-[4px] ".concat(tooltipContainer), style: { maxWidth: maxWidth } },
|
|
2654
|
+
React.createElement("p", { className: " whitespace-pre-wrap break-words" }, content)))));
|
|
2637
2655
|
}
|
|
2638
2656
|
Tooltip.defaultProps = {
|
|
2639
2657
|
delay: 400,
|
|
2640
2658
|
direction: 'top',
|
|
2659
|
+
maxWidth: '300px',
|
|
2641
2660
|
};
|
|
2642
2661
|
Tooltip.defaultProps = {};
|
|
2643
2662
|
|