From f6bbe65d21183de86cb298ca68fa2b7b6c81cadf Mon Sep 17 00:00:00 2001 From: Daniel Barion Date: Fri, 3 Feb 2023 10:45:21 -0300 Subject: [PATCH 1/3] refactor: Tooltip component always receives a wrapper from Controller --- src/components/Tooltip/Tooltip.tsx | 4 ++-- src/components/Tooltip/TooltipTypes.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index e3458f29..a20bd053 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -19,7 +19,7 @@ const Tooltip = ({ events = ['hover'], positionStrategy = 'absolute', middlewares, - wrapper: WrapperElement = 'div', + wrapper: WrapperElement, children = null, delayShow = 0, delayHide = 0, @@ -38,7 +38,7 @@ const Tooltip = ({ setIsOpen, }: ITooltip) => { const tooltipRef = useRef(null) - const tooltipArrowRef = useRef(null) + const tooltipArrowRef = useRef(null) const tooltipShowDelayTimerRef = useRef(null) const tooltipHideDelayTimerRef = useRef(null) const [inlineStyles, setInlineStyles] = useState({}) diff --git a/src/components/Tooltip/TooltipTypes.d.ts b/src/components/Tooltip/TooltipTypes.d.ts index f16ca8c3..ba552f1c 100644 --- a/src/components/Tooltip/TooltipTypes.d.ts +++ b/src/components/Tooltip/TooltipTypes.d.ts @@ -43,7 +43,7 @@ export interface ITooltip { id?: string variant?: VariantType anchorId?: string - wrapper?: WrapperType + wrapper: WrapperType children?: ChildrenType events?: EventsType[] positionStrategy?: PositionStrategy From 1d1d395d4dced83d318afdcf2c08f6d87d275a46 Mon Sep 17 00:00:00 2001 From: Daniel Barion Date: Fri, 3 Feb 2023 10:45:50 -0300 Subject: [PATCH 2/3] fix: apply correct wrapper when watching data attributes --- src/components/TooltipController/TooltipController.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TooltipController/TooltipController.tsx b/src/components/TooltipController/TooltipController.tsx index f93c69c6..6b98b188 100644 --- a/src/components/TooltipController/TooltipController.tsx +++ b/src/components/TooltipController/TooltipController.tsx @@ -85,7 +85,7 @@ const TooltipController = ({ setTooltipOffset(value === null ? offset : Number(value)) }, wrapper: (value) => { - setTooltipWrapper((value as WrapperType) ?? 'div') + setTooltipWrapper((value as WrapperType) ?? wrapper) }, events: (value) => { const parsed = value?.split(' ') as EventsType[] From ca56886694700c908d2a06fd2919a318ce7701d6 Mon Sep 17 00:00:00 2001 From: Daniel Barion Date: Fri, 3 Feb 2023 10:54:17 -0300 Subject: [PATCH 3/3] chore: add root files to npm ignore --- .npmignore | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index c70c6556..6c86b701 100644 --- a/.npmignore +++ b/.npmignore @@ -21,7 +21,15 @@ coverage/ .travis.yml .editorconfig -// others +// misc folders .vscode/ .husky/ .github/ + +// misc files +bundlesize.config.json + +// bundler - rollup +rollup.config.dev.js +rollup.config.prod.js +rollup.config.types.js