bianic-ui 2.2.0-beta.0 → 2.2.0-beta.1

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 CHANGED
@@ -1989,15 +1989,15 @@ MenuItem.defaultProps = {
1989
1989
  };
1990
1990
 
1991
1991
  function Tooltip(props) {
1992
- 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 ? undefined : _b;
1992
+ 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 ? undefined : _b, _c = props.zIndex, zIndex = _c === void 0 ? 150 : _c, className = props.className, style = props.style;
1993
1993
  var timeout;
1994
- var _c = React.useState(false), active = _c[0], setActive = _c[1];
1994
+ var _d = React.useState(false), active = _d[0], setActive = _d[1];
1995
1995
  var anchorRef = React.useRef(null);
1996
1996
  var tooltipContainerRef = React.useRef(null);
1997
- var _d = React.useState({
1997
+ var _e = React.useState({
1998
1998
  maxWidth: maxWidth + 'px',
1999
1999
  whiteSpace: 'nowrap',
2000
- }), tooltipContainerStyle = _d[0], setTooltipContainerStyle = _d[1];
2000
+ }), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
2001
2001
  var showTip = function () {
2002
2002
  timeout = setTimeout(function () {
2003
2003
  setActive(true);
@@ -2041,12 +2041,12 @@ function Tooltip(props) {
2041
2041
  }, [content, maxWidth, scrollWidth, offsetHeight]);
2042
2042
  return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
2043
2043
  children,
2044
- active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle }))));
2044
+ active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle, zIndex: zIndex, className: className, style: style }))));
2045
2045
  }
2046
2046
  var TooltipItem = function (_a) {
2047
- var anchorRef = _a.anchorRef, direction = _a.direction, content = _a.content, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle;
2047
+ var anchorRef = _a.anchorRef, className = _a.className, content = _a.content, direction = _a.direction, style = _a.style, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle, zIndex = _a.zIndex;
2048
2048
  var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
2049
- return reactDom.createPortal(React.createElement("div", { className: "tooltip-container break-word absolute z-50 inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white", style: __assign(__assign({}, positionStyle), tooltipContainerStyle), ref: tooltipContainerRef }, content), document.body);
2049
+ return reactDom.createPortal(React.createElement("div", { className: "tooltip-container break-word absolute inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(className), style: __assign(__assign(__assign({ zIndex: zIndex }, positionStyle), tooltipContainerStyle), style), ref: tooltipContainerRef }, content), document.body);
2050
2050
  };
2051
2051
  Tooltip.defaultProps = {
2052
2052
  delay: 400,
@@ -3709,20 +3709,19 @@ var classConfig = {
3709
3709
  };
3710
3710
 
3711
3711
  function Popover(_a) {
3712
- 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;
3712
+ var className = _a.className, children = _a.children, content = _a.content, _b = _a.direction, direction = _b === void 0 ? 'bottom' : _b; _a.maxWidth; var _c = _a.title, title = _c === void 0 ? '' : _c, style = _a.style, zIndex = _a.zIndex;
3713
3713
  var wrapperRef = React.useRef(null);
3714
- React.useRef(null);
3715
- var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
3714
+ var _d = useDetectOutsideClick(wrapperRef, false), isOpen = _d[0], setIsOpen = _d[1];
3716
3715
  return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
3717
3716
  children,
3718
- isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction }))));
3717
+ isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction, className: className, style: style, zIndex: zIndex }))));
3719
3718
  }
3720
3719
  var PopoverItem = function (_a) {
3721
- var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction;
3720
+ var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction, className = _a.className, style = _a.style, zIndex = _a.zIndex;
3722
3721
  var popoverRef = React.useRef(null);
3723
3722
  var positionStyle = usePopupPosition(anchorRef, popoverRef, direction)[0];
3724
3723
  var _b = classConfig[direction], triangleContainer = _b.triangleContainer, triangleShape = _b.triangleShape;
3725
- return reactDom.createPortal(React.createElement("div", { ref: popoverRef, style: positionStyle, 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" },
3724
+ return reactDom.createPortal(React.createElement("div", { ref: popoverRef, style: __assign(__assign(__assign({}, positionStyle), style), { zIndex: zIndex }), 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(className) },
3726
3725
  React.createElement("div", { className: "flex flex-col" },
3727
3726
  React.createElement("div", { className: "mb-[5px] font-humnst777 text-[16px] font-bold leading-[19.42px]" }, title),
3728
3727
  React.createElement("div", { className: "break-words font-segoe text-[12px] font-normal" }, content)),
@@ -3730,7 +3729,6 @@ var PopoverItem = function (_a) {
3730
3729
  React.createElement("div", { className: "h-0 w-0 ".concat(triangleShape) }))), document.body);
3731
3730
  };
3732
3731
  Popover.defaultProps = {
3733
- delay: 400,
3734
3732
  direction: 'top',
3735
3733
  title: '',
3736
3734
  };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export interface PopoverProps {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ content: string;
6
+ delay?: number;
7
+ maxWidth?: string;
8
+ title?: string;
9
+ style?: React.CSSProperties;
10
+ zIndex?: number;
11
+ direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
12
+ }
13
+ export interface PopoverItemProps {
14
+ anchorRef: React.RefObject<HTMLElement>;
15
+ className?: string;
16
+ content: string;
17
+ style?: React.CSSProperties;
18
+ title: string;
19
+ zIndex?: number;
20
+ direction: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
21
+ }
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
- interface PopoverProps {
3
- children: React.ReactNode;
4
- content: string;
5
- delay?: number;
6
- direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
7
- title?: string;
8
- maxWidth?: string;
9
- }
10
- declare function Popover({ children, content, delay, direction, title, maxWidth, }: PopoverProps): React.JSX.Element;
2
+ import { PopoverProps } from './PropInterface';
3
+ declare function Popover({ className, children, content, direction, maxWidth, title, style, zIndex, }: PopoverProps): React.JSX.Element;
11
4
  declare namespace Popover {
12
5
  var defaultProps: {
13
- delay: number;
14
6
  direction: string;
15
7
  title: string;
16
8
  };
@@ -1,16 +1,20 @@
1
- import { ComponentPropsWithoutRef, ReactNode, RefObject } from 'react';
1
+ import { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode, RefObject } from 'react';
2
2
  interface TooltipProps extends Omit<ComponentPropsWithoutRef<'div'>, 'content'> {
3
3
  children: ReactNode;
4
4
  content: ReactNode | string;
5
5
  delay?: number;
6
6
  maxWidth?: string;
7
+ zIndex?: number;
7
8
  direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
8
9
  }
9
10
  interface TooltipItemProps {
10
11
  anchorRef: RefObject<HTMLDivElement>;
11
- direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
12
+ className?: string;
12
13
  content: ReactNode | string;
13
14
  tooltipContainerRef: React.RefObject<HTMLDivElement>;
14
15
  tooltipContainerStyle: React.CSSProperties;
16
+ style?: ComponentPropsWithRef<'div'>['style'];
17
+ zIndex: number;
18
+ direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
15
19
  }
16
20
  export { TooltipProps, TooltipItemProps };
package/dist/esm/index.js CHANGED
@@ -1987,15 +1987,15 @@ MenuItem.defaultProps = {
1987
1987
  };
1988
1988
 
1989
1989
  function Tooltip(props) {
1990
- 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 ? undefined : _b;
1990
+ 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 ? undefined : _b, _c = props.zIndex, zIndex = _c === void 0 ? 150 : _c, className = props.className, style = props.style;
1991
1991
  var timeout;
1992
- var _c = useState(false), active = _c[0], setActive = _c[1];
1992
+ var _d = useState(false), active = _d[0], setActive = _d[1];
1993
1993
  var anchorRef = useRef(null);
1994
1994
  var tooltipContainerRef = useRef(null);
1995
- var _d = useState({
1995
+ var _e = useState({
1996
1996
  maxWidth: maxWidth + 'px',
1997
1997
  whiteSpace: 'nowrap',
1998
- }), tooltipContainerStyle = _d[0], setTooltipContainerStyle = _d[1];
1998
+ }), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
1999
1999
  var showTip = function () {
2000
2000
  timeout = setTimeout(function () {
2001
2001
  setActive(true);
@@ -2039,12 +2039,12 @@ function Tooltip(props) {
2039
2039
  }, [content, maxWidth, scrollWidth, offsetHeight]);
2040
2040
  return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
2041
2041
  children,
2042
- active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle }))));
2042
+ active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle, zIndex: zIndex, className: className, style: style }))));
2043
2043
  }
2044
2044
  var TooltipItem = function (_a) {
2045
- var anchorRef = _a.anchorRef, direction = _a.direction, content = _a.content, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle;
2045
+ var anchorRef = _a.anchorRef, className = _a.className, content = _a.content, direction = _a.direction, style = _a.style, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle, zIndex = _a.zIndex;
2046
2046
  var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
2047
- return createPortal(React.createElement("div", { className: "tooltip-container break-word absolute z-50 inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white", style: __assign(__assign({}, positionStyle), tooltipContainerStyle), ref: tooltipContainerRef }, content), document.body);
2047
+ return createPortal(React.createElement("div", { className: "tooltip-container break-word absolute inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(className), style: __assign(__assign(__assign({ zIndex: zIndex }, positionStyle), tooltipContainerStyle), style), ref: tooltipContainerRef }, content), document.body);
2048
2048
  };
2049
2049
  Tooltip.defaultProps = {
2050
2050
  delay: 400,
@@ -3707,20 +3707,19 @@ var classConfig = {
3707
3707
  };
3708
3708
 
3709
3709
  function Popover(_a) {
3710
- 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;
3710
+ var className = _a.className, children = _a.children, content = _a.content, _b = _a.direction, direction = _b === void 0 ? 'bottom' : _b; _a.maxWidth; var _c = _a.title, title = _c === void 0 ? '' : _c, style = _a.style, zIndex = _a.zIndex;
3711
3711
  var wrapperRef = useRef(null);
3712
- useRef(null);
3713
- var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
3712
+ var _d = useDetectOutsideClick(wrapperRef, false), isOpen = _d[0], setIsOpen = _d[1];
3714
3713
  return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
3715
3714
  children,
3716
- isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction }))));
3715
+ isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction, className: className, style: style, zIndex: zIndex }))));
3717
3716
  }
3718
3717
  var PopoverItem = function (_a) {
3719
- var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction;
3718
+ var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction, className = _a.className, style = _a.style, zIndex = _a.zIndex;
3720
3719
  var popoverRef = useRef(null);
3721
3720
  var positionStyle = usePopupPosition(anchorRef, popoverRef, direction)[0];
3722
3721
  var _b = classConfig[direction], triangleContainer = _b.triangleContainer, triangleShape = _b.triangleShape;
3723
- return createPortal(React.createElement("div", { ref: popoverRef, style: positionStyle, 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" },
3722
+ return createPortal(React.createElement("div", { ref: popoverRef, style: __assign(__assign(__assign({}, positionStyle), style), { zIndex: zIndex }), 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(className) },
3724
3723
  React.createElement("div", { className: "flex flex-col" },
3725
3724
  React.createElement("div", { className: "mb-[5px] font-humnst777 text-[16px] font-bold leading-[19.42px]" }, title),
3726
3725
  React.createElement("div", { className: "break-words font-segoe text-[12px] font-normal" }, content)),
@@ -3728,7 +3727,6 @@ var PopoverItem = function (_a) {
3728
3727
  React.createElement("div", { className: "h-0 w-0 ".concat(triangleShape) }))), document.body);
3729
3728
  };
3730
3729
  Popover.defaultProps = {
3731
- delay: 400,
3732
3730
  direction: 'top',
3733
3731
  title: '',
3734
3732
  };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export interface PopoverProps {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ content: string;
6
+ delay?: number;
7
+ maxWidth?: string;
8
+ title?: string;
9
+ style?: React.CSSProperties;
10
+ zIndex?: number;
11
+ direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
12
+ }
13
+ export interface PopoverItemProps {
14
+ anchorRef: React.RefObject<HTMLElement>;
15
+ className?: string;
16
+ content: string;
17
+ style?: React.CSSProperties;
18
+ title: string;
19
+ zIndex?: number;
20
+ direction: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
21
+ }
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
- interface PopoverProps {
3
- children: React.ReactNode;
4
- content: string;
5
- delay?: number;
6
- direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
7
- title?: string;
8
- maxWidth?: string;
9
- }
10
- declare function Popover({ children, content, delay, direction, title, maxWidth, }: PopoverProps): React.JSX.Element;
2
+ import { PopoverProps } from './PropInterface';
3
+ declare function Popover({ className, children, content, direction, maxWidth, title, style, zIndex, }: PopoverProps): React.JSX.Element;
11
4
  declare namespace Popover {
12
5
  var defaultProps: {
13
- delay: number;
14
6
  direction: string;
15
7
  title: string;
16
8
  };
@@ -1,16 +1,20 @@
1
- import { ComponentPropsWithoutRef, ReactNode, RefObject } from 'react';
1
+ import { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode, RefObject } from 'react';
2
2
  interface TooltipProps extends Omit<ComponentPropsWithoutRef<'div'>, 'content'> {
3
3
  children: ReactNode;
4
4
  content: ReactNode | string;
5
5
  delay?: number;
6
6
  maxWidth?: string;
7
+ zIndex?: number;
7
8
  direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
8
9
  }
9
10
  interface TooltipItemProps {
10
11
  anchorRef: RefObject<HTMLDivElement>;
11
- direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
12
+ className?: string;
12
13
  content: ReactNode | string;
13
14
  tooltipContainerRef: React.RefObject<HTMLDivElement>;
14
15
  tooltipContainerStyle: React.CSSProperties;
16
+ style?: ComponentPropsWithRef<'div'>['style'];
17
+ zIndex: number;
18
+ direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
15
19
  }
16
20
  export { TooltipProps, TooltipItemProps };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import React$1, { ComponentPropsWithoutRef, ComponentPropsWithRef, ChangeEvent, ReactNode, MouseEvent, HTMLAttributes } from 'react';
2
3
 
3
4
  interface AccordionsProps extends ComponentPropsWithoutRef<'div'> {
@@ -605,17 +606,20 @@ declare namespace Pills {
605
606
  }
606
607
 
607
608
  interface PopoverProps {
608
- children: React$1.ReactNode;
609
+ className?: string;
610
+ children: React.ReactNode;
609
611
  content: string;
610
612
  delay?: number;
611
- direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
612
- title?: string;
613
613
  maxWidth?: string;
614
+ title?: string;
615
+ style?: React.CSSProperties;
616
+ zIndex?: number;
617
+ direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
614
618
  }
615
- declare function Popover({ children, content, delay, direction, title, maxWidth, }: PopoverProps): React$1.JSX.Element;
619
+
620
+ declare function Popover({ className, children, content, direction, maxWidth, title, style, zIndex, }: PopoverProps): React$1.JSX.Element;
616
621
  declare namespace Popover {
617
622
  var defaultProps: {
618
- delay: number;
619
623
  direction: string;
620
624
  title: string;
621
625
  };
@@ -739,6 +743,7 @@ interface TooltipProps extends Omit<ComponentPropsWithoutRef<'div'>, 'content'>
739
743
  content: ReactNode | string;
740
744
  delay?: number;
741
745
  maxWidth?: string;
746
+ zIndex?: number;
742
747
  direction?: 'top' | 'right' | 'bottom' | 'left' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
743
748
  }
744
749
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "@biaenergi:registry": "https://gitlab.com/api/v4/projects/50905269/packages/npm/"
5
5
  },
6
- "version": "2.2.0-beta.0",
6
+ "version": "2.2.0-beta.1",
7
7
  "description": "Design Language System develop by BIAENERGI",
8
8
  "scripts": {
9
9
  "rollup": "rollup -c",