@channel.io/bezier-react 1.6.2 → 1.7.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/components/Forms/Slider/Slider.js +73 -51
- package/dist/cjs/components/Forms/Slider/Slider.js.map +1 -1
- package/dist/cjs/components/Forms/Slider/Slider.styled.js +24 -83
- package/dist/cjs/components/Forms/Slider/Slider.styled.js.map +1 -1
- package/dist/cjs/components/Help/Help.js +10 -7
- package/dist/cjs/components/Help/Help.js.map +1 -1
- package/dist/cjs/components/Help/Help.styled.js +4 -5
- package/dist/cjs/components/Help/Help.styled.js.map +1 -1
- package/dist/cjs/components/KeyValueListItem/common/ItemActions/ItemAction.js +2 -9
- package/dist/cjs/components/KeyValueListItem/common/ItemActions/ItemAction.js.map +1 -1
- package/dist/cjs/components/KeyValueListItem/common/ItemActions/ItemAction.styled.js +3 -20
- package/dist/cjs/components/KeyValueListItem/common/ItemActions/ItemAction.styled.js.map +1 -1
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.js +101 -0
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.js.map +1 -0
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.styled.js +41 -0
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.styled.js.map +1 -0
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.types.js +20 -0
- package/dist/cjs/components/LegacyTooltip/LegacyTooltip.types.js.map +1 -0
- package/dist/cjs/components/{Tooltip/TooltipContent.js → LegacyTooltip/LegacyTooltipContent.js} +9 -12
- package/dist/cjs/components/LegacyTooltip/LegacyTooltipContent.js.map +1 -0
- package/dist/cjs/components/{Tooltip → LegacyTooltip}/utils.js +33 -33
- package/dist/cjs/components/LegacyTooltip/utils.js.map +1 -0
- package/dist/cjs/components/ListItem/ListItem.styled.js +1 -1
- package/dist/cjs/components/ListMenuTitle/ListMenuTitle.js +11 -10
- package/dist/cjs/components/ListMenuTitle/ListMenuTitle.js.map +1 -1
- package/dist/cjs/components/Modals/Modal/Modal.types.js.map +1 -1
- package/dist/cjs/components/Navigator/NavGroup/NavGroup.js +10 -11
- package/dist/cjs/components/Navigator/NavGroup/NavGroup.js.map +1 -1
- package/dist/cjs/components/Navigator/NavItem/NavItem.js +10 -10
- package/dist/cjs/components/Navigator/NavItem/NavItem.js.map +1 -1
- package/dist/cjs/components/SectionLabel/SectionLabel.js +10 -17
- package/dist/cjs/components/SectionLabel/SectionLabel.js.map +1 -1
- package/dist/cjs/components/SectionLabel/SectionLabel.styled.js +4 -4
- package/dist/cjs/components/SectionLabel/SectionLabel.styled.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +10 -7
- package/dist/cjs/components/Spinner/Spinner.js.map +1 -1
- package/dist/cjs/components/Spinner/Spinner.styled.js +1 -1
- package/dist/cjs/components/Spinner/Spinner.types.js.map +1 -1
- package/dist/cjs/components/Stack/Stack/Stack.styled.js +1 -1
- package/dist/cjs/components/TagBadge/Badge/Badge.js +9 -8
- package/dist/cjs/components/TagBadge/Badge/Badge.js.map +1 -1
- package/dist/cjs/components/TagBadge/Tag/Tag.js +4 -3
- package/dist/cjs/components/TagBadge/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/Text/Text.styled.js +1 -1
- package/dist/cjs/components/Toast/Toast.types.js +2 -1
- package/dist/cjs/components/Toast/Toast.types.js.map +1 -1
- package/dist/cjs/components/Toast/ToastElement.js +5 -6
- package/dist/cjs/components/Toast/ToastElement.js.map +1 -1
- package/dist/cjs/components/Toast/ToastProvider.js +2 -2
- package/dist/cjs/components/Toast/ToastProvider.js.map +1 -1
- package/dist/cjs/components/Toast/utils.js +6 -5
- package/dist/cjs/components/Toast/utils.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +211 -83
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.styled.js +96 -25
- package/dist/cjs/components/Tooltip/Tooltip.styled.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.types.js +3 -0
- package/dist/cjs/components/Tooltip/Tooltip.types.js.map +1 -1
- package/dist/cjs/index.js +15 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.js +886 -0
- package/dist/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +691 -0
- package/dist/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/cjs/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js +296 -0
- package/dist/cjs/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js.map +1 -0
- package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js +265 -0
- package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -0
- package/dist/cjs/node_modules/@radix-ui/react-slider/dist/index.js +21 -21
- package/dist/cjs/node_modules/@radix-ui/react-tooltip/dist/index.js +521 -0
- package/dist/cjs/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -0
- package/dist/cjs/providers/BezierProvider.js +3 -2
- package/dist/cjs/providers/BezierProvider.js.map +1 -1
- package/dist/esm/components/Forms/Slider/Slider.mjs +76 -53
- package/dist/esm/components/Forms/Slider/Slider.mjs.map +1 -1
- package/dist/esm/components/Forms/Slider/Slider.styled.mjs +22 -82
- package/dist/esm/components/Forms/Slider/Slider.styled.mjs.map +1 -1
- package/dist/esm/components/Help/Help.mjs +11 -8
- package/dist/esm/components/Help/Help.mjs.map +1 -1
- package/dist/esm/components/Help/Help.styled.mjs +4 -5
- package/dist/esm/components/Help/Help.styled.mjs.map +1 -1
- package/dist/esm/components/KeyValueListItem/common/ItemActions/ItemAction.mjs +3 -10
- package/dist/esm/components/KeyValueListItem/common/ItemActions/ItemAction.mjs.map +1 -1
- package/dist/esm/components/KeyValueListItem/common/ItemActions/ItemAction.styled.mjs +4 -19
- package/dist/esm/components/KeyValueListItem/common/ItemActions/ItemAction.styled.mjs.map +1 -1
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.mjs +97 -0
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.mjs.map +1 -0
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.styled.mjs +36 -0
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.styled.mjs.map +1 -0
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.types.mjs +18 -0
- package/dist/esm/components/LegacyTooltip/LegacyTooltip.types.mjs.map +1 -0
- package/dist/esm/components/{Tooltip/TooltipContent.mjs → LegacyTooltip/LegacyTooltipContent.mjs} +8 -9
- package/dist/esm/components/LegacyTooltip/LegacyTooltipContent.mjs.map +1 -0
- package/dist/esm/components/{Tooltip → LegacyTooltip}/utils.mjs +33 -33
- package/dist/esm/components/LegacyTooltip/utils.mjs.map +1 -0
- package/dist/esm/components/ListItem/ListItem.styled.mjs +1 -1
- package/dist/esm/components/ListMenuTitle/ListMenuTitle.mjs +12 -11
- package/dist/esm/components/ListMenuTitle/ListMenuTitle.mjs.map +1 -1
- package/dist/esm/components/Modals/Modal/Modal.types.mjs.map +1 -1
- package/dist/esm/components/Navigator/NavGroup/NavGroup.mjs +11 -12
- package/dist/esm/components/Navigator/NavGroup/NavGroup.mjs.map +1 -1
- package/dist/esm/components/Navigator/NavItem/NavItem.mjs +11 -11
- package/dist/esm/components/Navigator/NavItem/NavItem.mjs.map +1 -1
- package/dist/esm/components/Overlay/Overlay.mjs +2 -2
- package/dist/esm/components/Overlay/Overlay.mjs.map +1 -1
- package/dist/esm/components/SectionLabel/SectionLabel.mjs +11 -17
- package/dist/esm/components/SectionLabel/SectionLabel.mjs.map +1 -1
- package/dist/esm/components/SectionLabel/SectionLabel.styled.mjs +4 -4
- package/dist/esm/components/SectionLabel/SectionLabel.styled.mjs.map +1 -1
- package/dist/esm/components/Spinner/Spinner.mjs +11 -8
- package/dist/esm/components/Spinner/Spinner.mjs.map +1 -1
- package/dist/esm/components/Spinner/Spinner.styled.mjs +1 -1
- package/dist/esm/components/Spinner/Spinner.types.mjs.map +1 -1
- package/dist/esm/components/Stack/Stack/Stack.styled.mjs +1 -1
- package/dist/esm/components/TagBadge/Badge/Badge.mjs +10 -9
- package/dist/esm/components/TagBadge/Badge/Badge.mjs.map +1 -1
- package/dist/esm/components/TagBadge/Tag/Tag.mjs +5 -4
- package/dist/esm/components/TagBadge/Tag/Tag.mjs.map +1 -1
- package/dist/esm/components/Text/Text.styled.mjs +1 -1
- package/dist/esm/components/Toast/Toast.types.mjs +2 -1
- package/dist/esm/components/Toast/Toast.types.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastElement.mjs +5 -6
- package/dist/esm/components/Toast/ToastElement.mjs.map +1 -1
- package/dist/esm/components/Toast/ToastProvider.mjs +2 -2
- package/dist/esm/components/Toast/ToastProvider.mjs.map +1 -1
- package/dist/esm/components/Toast/utils.mjs +6 -5
- package/dist/esm/components/Toast/utils.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.mjs +213 -82
- package/dist/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.styled.mjs +93 -23
- package/dist/esm/components/Tooltip/Tooltip.styled.mjs.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.types.mjs +3 -0
- package/dist/esm/components/Tooltip/Tooltip.types.mjs.map +1 -1
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +875 -0
- package/dist/esm/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.map +1 -0
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +679 -0
- package/dist/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.map +1 -0
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.mjs +265 -0
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.mjs.map +1 -0
- package/dist/esm/node_modules/@radix-ui/react-popper/dist/index.mjs +257 -0
- package/dist/esm/node_modules/@radix-ui/react-popper/dist/index.mjs.map +1 -0
- package/dist/esm/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
- package/dist/esm/node_modules/@radix-ui/react-slider/dist/index.mjs +1 -1
- package/dist/esm/node_modules/@radix-ui/react-tooltip/dist/index.mjs +509 -0
- package/dist/esm/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map +1 -0
- package/dist/esm/providers/BezierProvider.mjs +3 -2
- package/dist/esm/providers/BezierProvider.mjs.map +1 -1
- package/dist/types/components/Forms/Slider/Slider.d.ts +18 -2
- package/dist/types/components/Forms/Slider/Slider.d.ts.map +1 -1
- package/dist/types/components/Forms/Slider/Slider.styled.d.ts +14 -24
- package/dist/types/components/Forms/Slider/Slider.styled.d.ts.map +1 -1
- package/dist/types/components/Forms/Slider/Slider.types.d.ts +52 -13
- package/dist/types/components/Forms/Slider/Slider.types.d.ts.map +1 -1
- package/dist/types/components/Help/Help.d.ts +1 -4
- package/dist/types/components/Help/Help.d.ts.map +1 -1
- package/dist/types/components/Help/Help.styled.d.ts +1 -1
- package/dist/types/components/Help/Help.styled.d.ts.map +1 -1
- package/dist/types/components/Help/Help.types.d.ts +1 -1
- package/dist/types/components/Help/Help.types.d.ts.map +1 -1
- package/dist/types/components/KeyValueListItem/common/ItemActions/ItemAction.d.ts.map +1 -1
- package/dist/types/components/KeyValueListItem/common/ItemActions/ItemAction.styled.d.ts +1 -7
- package/dist/types/components/KeyValueListItem/common/ItemActions/ItemAction.styled.d.ts.map +1 -1
- package/dist/types/components/KeyValueListItem/common/ItemActions/ItemAction.types.d.ts +3 -3
- package/dist/types/components/KeyValueListItem/common/ItemActions/ItemAction.types.d.ts.map +1 -1
- package/dist/types/components/KeyValueListItem/common/KeyItem/KeyItem.types.d.ts +2 -2
- package/dist/types/components/KeyValueListItem/common/KeyItem/KeyItem.types.d.ts.map +1 -1
- package/dist/types/components/LegacyTooltip/LegacyTooltip.d.ts +6 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltip.d.ts.map +1 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltip.styled.d.ts +18 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltip.styled.d.ts.map +1 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltip.types.d.ts +40 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltip.types.d.ts.map +1 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltipContent.d.ts +4 -0
- package/dist/types/components/LegacyTooltip/LegacyTooltipContent.d.ts.map +1 -0
- package/dist/types/components/LegacyTooltip/index.d.ts +4 -0
- package/dist/types/components/LegacyTooltip/index.d.ts.map +1 -0
- package/dist/types/components/{Tooltip → LegacyTooltip}/utils.d.ts +2 -2
- package/dist/types/components/LegacyTooltip/utils.d.ts.map +1 -0
- package/dist/types/components/ListMenuTitle/ListMenuTitle.d.ts +1 -1
- package/dist/types/components/ListMenuTitle/ListMenuTitle.d.ts.map +1 -1
- package/dist/types/components/ListMenuTitle/ListMenuTitle.types.d.ts +1 -2
- package/dist/types/components/ListMenuTitle/ListMenuTitle.types.d.ts.map +1 -1
- package/dist/types/components/Modals/Modal/Modal.types.d.ts +2 -2
- package/dist/types/components/Modals/Modal/Modal.types.d.ts.map +1 -1
- package/dist/types/components/Navigator/NavGroup/NavGroup.d.ts +1 -2
- package/dist/types/components/Navigator/NavGroup/NavGroup.d.ts.map +1 -1
- package/dist/types/components/Navigator/NavGroup/NavGroup.types.d.ts +3 -3
- package/dist/types/components/Navigator/NavGroup/NavGroup.types.d.ts.map +1 -1
- package/dist/types/components/Navigator/NavItem/NavItem.d.ts +1 -2
- package/dist/types/components/Navigator/NavItem/NavItem.d.ts.map +1 -1
- package/dist/types/components/Navigator/NavItem/NavItem.types.d.ts +3 -3
- package/dist/types/components/Navigator/NavItem/NavItem.types.d.ts.map +1 -1
- package/dist/types/components/SectionLabel/SectionLabel.d.ts +1 -2
- package/dist/types/components/SectionLabel/SectionLabel.d.ts.map +1 -1
- package/dist/types/components/SectionLabel/SectionLabel.styled.d.ts +1 -1
- package/dist/types/components/SectionLabel/SectionLabel.styled.d.ts.map +1 -1
- package/dist/types/components/SectionLabel/SectionLabel.types.d.ts +2 -7
- package/dist/types/components/SectionLabel/SectionLabel.types.d.ts.map +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/types/components/Spinner/Spinner.types.d.ts +2 -1
- package/dist/types/components/Spinner/Spinner.types.d.ts.map +1 -1
- package/dist/types/components/TagBadge/Badge/Badge.d.ts +1 -1
- package/dist/types/components/TagBadge/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/TagBadge/Badge/Badge.types.d.ts +2 -2
- package/dist/types/components/TagBadge/Badge/Badge.types.d.ts.map +1 -1
- package/dist/types/components/TagBadge/Tag/Tag.d.ts +1 -1
- package/dist/types/components/TagBadge/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/Toast/Toast.types.d.ts +4 -4
- package/dist/types/components/Toast/Toast.types.d.ts.map +1 -1
- package/dist/types/components/Toast/ToastElement.d.ts.map +1 -1
- package/dist/types/components/Toast/utils.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +31 -5
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.styled.d.ts +22 -12
- package/dist/types/components/Tooltip/Tooltip.styled.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.types.d.ts +105 -24
- package/dist/types/components/Tooltip/Tooltip.types.d.ts.map +1 -1
- package/dist/types/components/Tooltip/index.d.ts +3 -5
- package/dist/types/components/Tooltip/index.d.ts.map +1 -1
- package/dist/types/components/VisuallyHidden/VisuallyHidden.types.d.ts +2 -1
- package/dist/types/components/VisuallyHidden/VisuallyHidden.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/providers/BezierProvider.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/Avatars/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +17 -17
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +15 -15
- package/src/components/Forms/FormControl/__snapshots__/FormControl.test.tsx.snap +119 -119
- package/src/components/Forms/Slider/Slider.stories.tsx +10 -63
- package/src/components/Forms/Slider/Slider.styled.ts +46 -95
- package/src/components/Forms/Slider/Slider.test.tsx +130 -97
- package/src/components/Forms/Slider/Slider.tsx +117 -96
- package/src/components/Forms/Slider/Slider.types.ts +55 -17
- package/src/components/Forms/Slider/__snapshots__/Slider.test.tsx.snap +156 -0
- package/src/components/Help/Help.styled.ts +4 -7
- package/src/components/Help/Help.tsx +19 -12
- package/src/components/Help/Help.types.ts +1 -1
- package/src/components/KeyValueListItem/KeyValueListItem.test.tsx +10 -6
- package/src/components/KeyValueListItem/__snapshots__/KeyValueListItem.test.tsx.snap +13 -13
- package/src/components/KeyValueListItem/common/ItemActions/ItemAction.styled.ts +5 -15
- package/src/components/KeyValueListItem/common/ItemActions/ItemAction.tsx +6 -13
- package/src/components/KeyValueListItem/common/ItemActions/ItemAction.types.ts +3 -6
- package/src/components/KeyValueListItem/common/KeyItem/KeyItem.types.ts +2 -5
- package/src/components/LegacyTooltip/LegacyTooltip.stories.tsx +105 -0
- package/src/components/LegacyTooltip/LegacyTooltip.styled.ts +46 -0
- package/src/components/LegacyTooltip/LegacyTooltip.test.tsx +100 -0
- package/src/components/LegacyTooltip/LegacyTooltip.tsx +152 -0
- package/src/components/LegacyTooltip/LegacyTooltip.types.ts +69 -0
- package/src/components/{Tooltip/TooltipContent.test.tsx → LegacyTooltip/LegacyTooltipContent.test.tsx} +9 -8
- package/src/components/{Tooltip/TooltipContent.tsx → LegacyTooltip/LegacyTooltipContent.tsx} +6 -7
- package/src/components/LegacyTooltip/index.ts +5 -0
- package/src/components/{Tooltip → LegacyTooltip}/utils.ts +35 -35
- package/src/components/ListMenuTitle/ListMenuTitle.tsx +10 -6
- package/src/components/ListMenuTitle/ListMenuTitle.types.ts +1 -1
- package/src/components/Modals/Modal/Modal.types.ts +2 -2
- package/src/components/Navigator/NavGroup/NavGroup.stories.tsx +5 -2
- package/src/components/Navigator/NavGroup/NavGroup.test.tsx +1 -1
- package/src/components/Navigator/NavGroup/NavGroup.tsx +13 -16
- package/src/components/Navigator/NavGroup/NavGroup.types.ts +3 -2
- package/src/components/Navigator/NavItem/NavItem.test.tsx +3 -1
- package/src/components/Navigator/NavItem/NavItem.tsx +13 -12
- package/src/components/Navigator/NavItem/NavItem.types.ts +3 -2
- package/src/components/SectionLabel/SectionLabel.stories.tsx +1 -1
- package/src/components/SectionLabel/SectionLabel.styled.ts +2 -4
- package/src/components/SectionLabel/SectionLabel.test.tsx +5 -25
- package/src/components/SectionLabel/SectionLabel.tsx +11 -17
- package/src/components/SectionLabel/SectionLabel.types.ts +2 -8
- package/src/components/Spinner/Spinner.tsx +7 -4
- package/src/components/Spinner/Spinner.types.ts +2 -1
- package/src/components/TagBadge/Badge/Badge.stories.tsx +2 -1
- package/src/components/TagBadge/Badge/Badge.tsx +15 -10
- package/src/components/TagBadge/Badge/Badge.types.ts +2 -2
- package/src/components/TagBadge/Tag/Tag.tsx +9 -4
- package/src/components/TagBadge/TagBadge.mdx +1 -1
- package/src/components/TagBadge/TagBadge.stories.tsx +48 -33
- package/src/components/Toast/Toast.stories.tsx +9 -8
- package/src/components/Toast/Toast.types.ts +8 -5
- package/src/components/Toast/ToastElement.tsx +4 -5
- package/src/components/Toast/ToastProvider.tsx +2 -2
- package/src/components/Toast/ToastService.test.ts +3 -1
- package/src/components/Toast/useToastContextValues.test.tsx +5 -4
- package/src/components/Toast/utils.ts +13 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +28 -67
- package/src/components/Tooltip/Tooltip.styled.ts +109 -19
- package/src/components/Tooltip/Tooltip.test.tsx +136 -63
- package/src/components/Tooltip/Tooltip.tsx +262 -120
- package/src/components/Tooltip/Tooltip.types.ts +111 -47
- package/src/components/Tooltip/index.ts +8 -8
- package/src/components/VisuallyHidden/VisuallyHidden.types.ts +1 -1
- package/src/index.ts +1 -0
- package/src/providers/BezierProvider.tsx +10 -6
- package/dist/cjs/components/Tooltip/TooltipContent.js.map +0 -1
- package/dist/cjs/components/Tooltip/utils.js.map +0 -1
- package/dist/esm/components/Tooltip/TooltipContent.mjs.map +0 -1
- package/dist/esm/components/Tooltip/utils.mjs.map +0 -1
- package/dist/types/components/Tooltip/TooltipContent.d.ts +0 -5
- package/dist/types/components/Tooltip/TooltipContent.d.ts.map +0 -1
- package/dist/types/components/Tooltip/utils.d.ts.map +0 -1
- /package/src/components/{Tooltip/__snapshots__/Tooltip.test.tsx.snap → LegacyTooltip/__snapshots__/LegacyTooltip.test.tsx.snap} +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Slider Snapshot should match snapshot 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
--bezier-slider-width: auto;
|
|
6
|
+
--bezier-slider-thumb-size: 20px;
|
|
7
|
+
position: relative;
|
|
8
|
+
display: -webkit-box;
|
|
9
|
+
display: -webkit-flex;
|
|
10
|
+
display: -ms-flexbox;
|
|
11
|
+
display: flex;
|
|
12
|
+
-webkit-align-items: center;
|
|
13
|
+
-webkit-box-align: center;
|
|
14
|
+
-ms-flex-align: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: var(--bezier-slider-width);
|
|
17
|
+
height: var(--bezier-slider-thumb-size);
|
|
18
|
+
touch-action: none;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
-webkit-user-select: none;
|
|
21
|
+
-moz-user-select: none;
|
|
22
|
+
-ms-user-select: none;
|
|
23
|
+
user-select: none;
|
|
24
|
+
-webkit-transition-delay: 0ms;
|
|
25
|
+
transition-delay: 0ms;
|
|
26
|
+
-webkit-transition-timing-function: cubic-bezier(.3,0,0,1);
|
|
27
|
+
transition-timing-function: cubic-bezier(.3,0,0,1);
|
|
28
|
+
-webkit-transition-duration: 150ms;
|
|
29
|
+
transition-duration: 150ms;
|
|
30
|
+
-webkit-transition-property: opacity;
|
|
31
|
+
transition-property: opacity;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.c0[data-disabled] {
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
opacity: 0.4;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.c1 {
|
|
40
|
+
position: relative;
|
|
41
|
+
-webkit-flex: 1;
|
|
42
|
+
-ms-flex: 1;
|
|
43
|
+
flex: 1;
|
|
44
|
+
height: 6px;
|
|
45
|
+
background-color: var(--bg-black-dark);
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.c2 {
|
|
50
|
+
position: absolute;
|
|
51
|
+
height: 100%;
|
|
52
|
+
background-color: var(--bgtxt-green-normal);
|
|
53
|
+
border-radius: 3px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.c3 {
|
|
57
|
+
--bezier-slider-guide-height: 8px;
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: calc(-1 * (var(--bezier-slider-guide-height) + 3px));
|
|
60
|
+
left: calc(var(--bezier-slider-thumb-size) / 2);
|
|
61
|
+
width: calc(100% - var(--bezier-slider-thumb-size));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.c4 {
|
|
65
|
+
--bezier-slider-guide-left: 0;
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: var(--bezier-slider-guide-left);
|
|
69
|
+
width: 2px;
|
|
70
|
+
height: var(--bezier-slider-guide-height);
|
|
71
|
+
background-color: var(--bg-black-light);
|
|
72
|
+
border-radius: 1px;
|
|
73
|
+
-webkit-transform: translateX(-50%);
|
|
74
|
+
-ms-transform: translateX(-50%);
|
|
75
|
+
transform: translateX(-50%);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.c5 {
|
|
79
|
+
all: unset;
|
|
80
|
+
display: block;
|
|
81
|
+
width: var(--bezier-slider-thumb-size);
|
|
82
|
+
height: var(--bezier-slider-thumb-size);
|
|
83
|
+
border-radius: 12px;
|
|
84
|
+
background-color: #FFFFFF;
|
|
85
|
+
box-shadow: inset 0 0 2px 0 #FFFFFF1F, 0 0 2px 1px #0000000D, 0 2px 6px #00000014;
|
|
86
|
+
background-color: var(--bgtxt-absolute-white-dark);
|
|
87
|
+
-webkit-transition-delay: 0ms;
|
|
88
|
+
transition-delay: 0ms;
|
|
89
|
+
-webkit-transition-timing-function: cubic-bezier(.3,0,0,1);
|
|
90
|
+
transition-timing-function: cubic-bezier(.3,0,0,1);
|
|
91
|
+
-webkit-transition-duration: 150ms;
|
|
92
|
+
transition-duration: 150ms;
|
|
93
|
+
-webkit-transition-property: box-shadow;
|
|
94
|
+
transition-property: box-shadow;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.c5:hover {
|
|
98
|
+
background-color: #FFFFFF;
|
|
99
|
+
box-shadow: inset 0 0 2px 0 #FFFFFF1F, 0 0 2px 1px #0000000D, 0 4px 12px #00000026;
|
|
100
|
+
background-color: var(--bgtxt-absolute-white-dark);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.c5:focus-visible {
|
|
104
|
+
box-shadow: 0 0 0 3px #5E56F04D, inset 0 0 0 1px #5E56F0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
<div>
|
|
108
|
+
<span
|
|
109
|
+
aria-disabled="false"
|
|
110
|
+
class="c0"
|
|
111
|
+
data-orientation="horizontal"
|
|
112
|
+
data-testid="bezier-react-slider"
|
|
113
|
+
dir="ltr"
|
|
114
|
+
foundation="[object Object]"
|
|
115
|
+
style="--bezier-slider-width: 36px; --radix-slider-thumb-transform: translateX(-50%);"
|
|
116
|
+
>
|
|
117
|
+
<span
|
|
118
|
+
class="c1"
|
|
119
|
+
data-orientation="horizontal"
|
|
120
|
+
foundation="[object Object]"
|
|
121
|
+
>
|
|
122
|
+
<span
|
|
123
|
+
class="c2"
|
|
124
|
+
data-orientation="horizontal"
|
|
125
|
+
foundation="[object Object]"
|
|
126
|
+
style="left: 0%; right: 50%;"
|
|
127
|
+
/>
|
|
128
|
+
<div
|
|
129
|
+
class="c3"
|
|
130
|
+
>
|
|
131
|
+
<div
|
|
132
|
+
class="c4"
|
|
133
|
+
style="--bezier-slider-guide-left: 50%;"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
</span>
|
|
137
|
+
<span
|
|
138
|
+
style="transform: var(--radix-slider-thumb-transform); position: absolute; left: calc(50% + 0px);"
|
|
139
|
+
>
|
|
140
|
+
<div
|
|
141
|
+
aria-orientation="horizontal"
|
|
142
|
+
aria-valuemax="10"
|
|
143
|
+
aria-valuemin="0"
|
|
144
|
+
aria-valuenow="5"
|
|
145
|
+
class="c5"
|
|
146
|
+
data-orientation="horizontal"
|
|
147
|
+
data-radix-collection-item=""
|
|
148
|
+
data-state="closed"
|
|
149
|
+
role="slider"
|
|
150
|
+
style=""
|
|
151
|
+
tabindex="0"
|
|
152
|
+
/>
|
|
153
|
+
</span>
|
|
154
|
+
</span>
|
|
155
|
+
</div>
|
|
156
|
+
`;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { styled } from '~/src/foundation'
|
|
2
2
|
|
|
3
3
|
import { Icon as BaseIcon } from '~/src/components/Icon'
|
|
4
|
-
import { Tooltip as BaseTooltip } from '~/src/components/Tooltip'
|
|
5
4
|
|
|
6
5
|
export const Icon = styled(BaseIcon)``
|
|
7
6
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
7
|
+
export const Trigger = styled.div`
|
|
8
|
+
line-height: 0;
|
|
12
9
|
|
|
13
|
-
&:
|
|
14
|
-
|
|
10
|
+
&:not([data-state="closed"]) {
|
|
11
|
+
${Icon} {
|
|
15
12
|
color: ${({ foundation }) => foundation?.theme?.['txt-black-darkest']};
|
|
16
13
|
}
|
|
17
14
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import { HelpFilledIcon } from '@channel.io/bezier-icons'
|
|
4
4
|
|
|
5
5
|
import { isEmpty } from '~/src/utils/typeUtils'
|
|
6
6
|
|
|
7
7
|
import { IconSize } from '~/src/components/Icon'
|
|
8
|
+
import { Tooltip } from '~/src/components/Tooltip'
|
|
8
9
|
|
|
9
10
|
import type HelpProps from './Help.types'
|
|
10
11
|
|
|
@@ -13,23 +14,29 @@ import * as Styled from './Help.styled'
|
|
|
13
14
|
export const HELP_TEST_ID = 'bezier-react-help'
|
|
14
15
|
export const HELP_DISPLAY_NAME = 'Help'
|
|
15
16
|
|
|
16
|
-
function Help({
|
|
17
|
+
const Help = forwardRef<HTMLDivElement, HelpProps>(function Help({
|
|
17
18
|
children,
|
|
18
19
|
...rest
|
|
19
|
-
}
|
|
20
|
+
}, forwardedRef) {
|
|
20
21
|
if (isEmpty(children)) { return null }
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<Tooltip
|
|
25
|
+
{...rest}
|
|
26
|
+
ref={forwardedRef}
|
|
27
|
+
content={children}
|
|
28
|
+
>
|
|
29
|
+
<Styled.Trigger>
|
|
30
|
+
<Styled.Icon
|
|
31
|
+
testId={HELP_TEST_ID}
|
|
32
|
+
source={HelpFilledIcon}
|
|
33
|
+
size={IconSize.XS}
|
|
34
|
+
color="txt-black-dark"
|
|
35
|
+
/>
|
|
36
|
+
</Styled.Trigger>
|
|
37
|
+
</Tooltip>
|
|
31
38
|
)
|
|
32
|
-
}
|
|
39
|
+
})
|
|
33
40
|
|
|
34
41
|
Help.displayName = HELP_DISPLAY_NAME
|
|
35
42
|
|
|
@@ -8,8 +8,6 @@ import userEvent from '@testing-library/user-event'
|
|
|
8
8
|
|
|
9
9
|
import { render } from '~/src/utils/testUtils'
|
|
10
10
|
|
|
11
|
-
import { TOOLTIP_TEST_ID } from '~/src/components/Tooltip/Tooltip'
|
|
12
|
-
|
|
13
11
|
import KeyValueListItem from './KeyValueListItem'
|
|
14
12
|
import { TEST_ID_MAP } from './KeyValueListItem.const'
|
|
15
13
|
import { type KeyValueListItemProps } from './KeyValueListItem.types'
|
|
@@ -168,11 +166,17 @@ describe('KeyValueListItem', () => {
|
|
|
168
166
|
expect(actions.onClick).toBeCalledTimes(2)
|
|
169
167
|
})
|
|
170
168
|
|
|
171
|
-
it('actions의 tooltip이 있으면, tooltip이 렌더링된다.', () => {
|
|
169
|
+
it('actions의 tooltip이 있으면, tooltip이 렌더링된다.', async () => {
|
|
170
|
+
const user = userEvent.setup()
|
|
171
|
+
|
|
172
172
|
const actions: KeyValueListItemActionProps = { icon: BadgeIcon, tooltip: 'tooltip' }
|
|
173
|
-
const { getByTestId } = renderComponent({ actions })
|
|
174
|
-
const rendered = getByTestId(
|
|
175
|
-
|
|
173
|
+
const { getByRole, getByTestId } = renderComponent({ actions })
|
|
174
|
+
const rendered = getByTestId(TEST_ID_MAP.ACTIONS_ITEM)
|
|
175
|
+
const actionItemIconWrapper = rendered?.firstChild
|
|
176
|
+
const actionItemIcon = actionItemIconWrapper?.firstChild
|
|
177
|
+
|
|
178
|
+
await user.hover(actionItemIcon as HTMLElement)
|
|
179
|
+
expect(getByRole('tooltip')).toBeInTheDocument()
|
|
176
180
|
})
|
|
177
181
|
})
|
|
178
182
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`KeyValueListItem Snapshot > 1`] = `
|
|
4
|
-
.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
text-overflow: ellipsis;
|
|
10
|
-
white-space: nowrap;
|
|
4
|
+
.c5 {
|
|
5
|
+
-webkit-flex: 0 0 auto;
|
|
6
|
+
-ms-flex: 0 0 auto;
|
|
7
|
+
flex: 0 0 auto;
|
|
11
8
|
margin: 0px 0px 0px 0px;
|
|
12
|
-
font-style: normal;
|
|
13
|
-
font-weight: bold;
|
|
14
9
|
color: #00000066;
|
|
15
10
|
-webkit-transition-delay: 0ms;
|
|
16
11
|
transition-delay: 0ms;
|
|
@@ -22,11 +17,16 @@ exports[`KeyValueListItem Snapshot > 1`] = `
|
|
|
22
17
|
transition-property: color;
|
|
23
18
|
}
|
|
24
19
|
|
|
25
|
-
.
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
20
|
+
.c6 {
|
|
21
|
+
font-size: 1.2rem;
|
|
22
|
+
line-height: 1.6rem;
|
|
23
|
+
display: block;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
29
27
|
margin: 0px 0px 0px 0px;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: bold;
|
|
30
30
|
color: #00000066;
|
|
31
31
|
-webkit-transition-delay: 0ms;
|
|
32
32
|
transition-delay: 0ms;
|
|
@@ -7,8 +7,6 @@ import { type AdditionalColorProps } from '~/src/types/ComponentProps'
|
|
|
7
7
|
import { isNil } from '~/src/utils/typeUtils'
|
|
8
8
|
|
|
9
9
|
import { Icon } from '~/src/components/Icon'
|
|
10
|
-
import { LegacyIcon } from '~/src/components/LegacyIcon'
|
|
11
|
-
import { Tooltip } from '~/src/components/Tooltip'
|
|
12
10
|
|
|
13
11
|
export const ItemActionWrapper = styled.div`
|
|
14
12
|
display: flex;
|
|
@@ -19,9 +17,10 @@ interface ActionWrapperProps extends AdditionalColorProps<['hoverBackground', 'h
|
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
export const ActionIcon = styled(Icon)``
|
|
22
|
-
export const ActionLegacyIcon = styled(LegacyIcon)``
|
|
23
20
|
|
|
24
|
-
export const ActionIconWrapper = styled.
|
|
21
|
+
export const ActionIconWrapper = styled.button<ActionWrapperProps>`
|
|
22
|
+
all: unset;
|
|
23
|
+
|
|
25
24
|
display: ${({ show }) => (show ? 'flex' : 'none')};
|
|
26
25
|
align-items: center;
|
|
27
26
|
justify-content: center;
|
|
@@ -31,7 +30,8 @@ export const ActionIconWrapper = styled.div<ActionWrapperProps>`
|
|
|
31
30
|
|
|
32
31
|
${({ foundation }) => foundation?.rounding?.round6}
|
|
33
32
|
|
|
34
|
-
&:hover
|
|
33
|
+
&:hover,
|
|
34
|
+
&:focus-visible {
|
|
35
35
|
${({ foundation, hoverBackgroundColor }) => !isNil(hoverBackgroundColor) && css`
|
|
36
36
|
background-color: ${foundation?.theme?.[hoverBackgroundColor]};
|
|
37
37
|
`}
|
|
@@ -41,15 +41,5 @@ export const ActionIconWrapper = styled.div<ActionWrapperProps>`
|
|
|
41
41
|
color: ${foundation?.theme?.[hoverIconColor]};
|
|
42
42
|
`}
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
${ActionLegacyIcon} {
|
|
46
|
-
${({ foundation, hoverIconColor }) => !isNil(hoverIconColor) && css`
|
|
47
|
-
color: ${foundation?.theme?.[hoverIconColor]};
|
|
48
|
-
`}
|
|
49
|
-
}
|
|
50
44
|
}
|
|
51
45
|
`
|
|
52
|
-
|
|
53
|
-
export const ActionIconTooltip = styled(Tooltip)`
|
|
54
|
-
margin-left: auto;
|
|
55
|
-
`
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
|
|
19
19
|
import { IconSize } from '~/src/components/Icon'
|
|
20
20
|
import { TEST_ID_MAP } from '~/src/components/KeyValueListItem/KeyValueListItem.const'
|
|
21
|
-
import {
|
|
21
|
+
import { Tooltip } from '~/src/components/Tooltip'
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
type ItemActionProps,
|
|
@@ -32,16 +32,6 @@ function ActionIcon({
|
|
|
32
32
|
icon,
|
|
33
33
|
iconColor,
|
|
34
34
|
}: ItemActionWithIcon) {
|
|
35
|
-
if (isIconName(icon)) {
|
|
36
|
-
return (
|
|
37
|
-
<Styled.ActionLegacyIcon
|
|
38
|
-
name={icon}
|
|
39
|
-
color={iconColor ?? 'txt-black-dark'}
|
|
40
|
-
size={IconSize.XS}
|
|
41
|
-
/>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
35
|
return (
|
|
46
36
|
<Styled.ActionIcon
|
|
47
37
|
source={icon}
|
|
@@ -75,9 +65,12 @@ function ItemAction(
|
|
|
75
65
|
|
|
76
66
|
if (!isEmpty(action.tooltip)) {
|
|
77
67
|
return (
|
|
78
|
-
<
|
|
68
|
+
<Tooltip
|
|
69
|
+
key={key}
|
|
70
|
+
content={action.tooltip}
|
|
71
|
+
>
|
|
79
72
|
{ iconElement }
|
|
80
|
-
</
|
|
73
|
+
</Tooltip>
|
|
81
74
|
)
|
|
82
75
|
}
|
|
83
76
|
return iconElement
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type React from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
type BezierIcon,
|
|
5
|
-
type IconName,
|
|
6
|
-
} from '@channel.io/bezier-icons'
|
|
3
|
+
import { type BezierIcon } from '@channel.io/bezier-icons'
|
|
7
4
|
|
|
8
5
|
import type {
|
|
9
6
|
AdditionalColorProps,
|
|
@@ -12,10 +9,10 @@ import type {
|
|
|
12
9
|
} from '~/src/types/ComponentProps'
|
|
13
10
|
|
|
14
11
|
export type ItemActionWithIcon = {
|
|
15
|
-
icon:
|
|
12
|
+
icon: BezierIcon
|
|
16
13
|
tooltip?: string
|
|
17
14
|
show?: boolean
|
|
18
|
-
onClick?: React.MouseEventHandler<
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>
|
|
19
16
|
} & AdditionalColorProps<['icon', 'hoverBackground', 'hoverIcon']>
|
|
20
17
|
|
|
21
18
|
export type KeyValueListItemActionProps = ItemActionWithIcon | React.ReactElement
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type React from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
type BezierIcon,
|
|
5
|
-
type IconName,
|
|
6
|
-
} from '@channel.io/bezier-icons'
|
|
3
|
+
import { type BezierIcon } from '@channel.io/bezier-icons'
|
|
7
4
|
|
|
8
5
|
import type {
|
|
9
6
|
BezierComponentProps,
|
|
@@ -11,7 +8,7 @@ import type {
|
|
|
11
8
|
} from '~/src/types/ComponentProps'
|
|
12
9
|
|
|
13
10
|
interface KeyItemOptions {
|
|
14
|
-
keyIcon?:
|
|
11
|
+
keyIcon?: BezierIcon | React.ReactNode
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
export interface KeyItemProps extends
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type Meta,
|
|
5
|
+
type Story,
|
|
6
|
+
} from '@storybook/react'
|
|
7
|
+
import { base } from 'paths.macro'
|
|
8
|
+
|
|
9
|
+
import { styled } from '~/src/foundation'
|
|
10
|
+
|
|
11
|
+
import { getTitle } from '~/src/utils/storyUtils'
|
|
12
|
+
|
|
13
|
+
import { LegacyTooltip } from './LegacyTooltip'
|
|
14
|
+
import { type LegacyTooltipProps } from './LegacyTooltip.types'
|
|
15
|
+
import { LegacyTooltipPosition } from './LegacyTooltip.types'
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
title: getTitle(base),
|
|
19
|
+
component: LegacyTooltip,
|
|
20
|
+
argTypes: {
|
|
21
|
+
content: {
|
|
22
|
+
control: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
placement: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'radio',
|
|
29
|
+
options: [
|
|
30
|
+
LegacyTooltipPosition.TopCenter,
|
|
31
|
+
LegacyTooltipPosition.TopLeft,
|
|
32
|
+
LegacyTooltipPosition.TopRight,
|
|
33
|
+
LegacyTooltipPosition.RightCenter,
|
|
34
|
+
LegacyTooltipPosition.RightTop,
|
|
35
|
+
LegacyTooltipPosition.RightBottom,
|
|
36
|
+
LegacyTooltipPosition.BottomCenter,
|
|
37
|
+
LegacyTooltipPosition.BottomLeft,
|
|
38
|
+
LegacyTooltipPosition.BottomRight,
|
|
39
|
+
LegacyTooltipPosition.LeftCenter,
|
|
40
|
+
LegacyTooltipPosition.LeftTop,
|
|
41
|
+
LegacyTooltipPosition.LeftBottom,
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
offset: {
|
|
46
|
+
control: {
|
|
47
|
+
type: 'range',
|
|
48
|
+
min: 0,
|
|
49
|
+
max: 50,
|
|
50
|
+
step: 1,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
delayShow: {
|
|
54
|
+
control: {
|
|
55
|
+
type: 'range',
|
|
56
|
+
min: 0,
|
|
57
|
+
max: 5000,
|
|
58
|
+
step: 100,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
delayHide: {
|
|
62
|
+
control: {
|
|
63
|
+
type: 'range',
|
|
64
|
+
min: 0,
|
|
65
|
+
max: 5000,
|
|
66
|
+
step: 100,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
} as Meta
|
|
71
|
+
|
|
72
|
+
const Target = styled.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 100px;
|
|
77
|
+
height: 40px;
|
|
78
|
+
background-color: ${props => props.foundation?.theme?.['bg-black-dark']};
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
`
|
|
81
|
+
|
|
82
|
+
const Template: Story<LegacyTooltipProps> = (props) => (
|
|
83
|
+
<LegacyTooltip
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<Target>
|
|
87
|
+
Target
|
|
88
|
+
</Target>
|
|
89
|
+
</LegacyTooltip>
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
export const Primary = Template.bind({})
|
|
93
|
+
|
|
94
|
+
Primary.args = {
|
|
95
|
+
// eslint-disable-next-line max-len
|
|
96
|
+
content: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',
|
|
97
|
+
lazy: true,
|
|
98
|
+
placement: LegacyTooltipPosition.BottomCenter,
|
|
99
|
+
offset: 4,
|
|
100
|
+
disabled: false,
|
|
101
|
+
keepInContainer: false,
|
|
102
|
+
allowHover: false,
|
|
103
|
+
delayShow: 0,
|
|
104
|
+
delayHide: 0,
|
|
105
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LineHeightAbsoluteNumber,
|
|
3
|
+
css,
|
|
4
|
+
ellipsis,
|
|
5
|
+
styled,
|
|
6
|
+
} from '~/src/foundation'
|
|
7
|
+
|
|
8
|
+
import { ZIndex } from '~/src/constants/ZIndex'
|
|
9
|
+
import type { InterpolationProps } from '~/src/types/Foundation'
|
|
10
|
+
|
|
11
|
+
interface ContentWrapperProps {
|
|
12
|
+
disabled: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Container = styled.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
`
|
|
18
|
+
export const ContentWrapper = styled.div<ContentWrapperProps>`
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
z-index: ${ZIndex.Tooltip};
|
|
23
|
+
|
|
24
|
+
${({ disabled }) => disabled && css`
|
|
25
|
+
display: none;
|
|
26
|
+
`}
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const Content = styled.div<InterpolationProps>`
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
width: max-content;
|
|
32
|
+
max-width: 260px;
|
|
33
|
+
height: max-content;
|
|
34
|
+
padding: 8px 14px;
|
|
35
|
+
color: ${({ foundation }) => foundation?.subTheme?.['txt-black-darkest']};
|
|
36
|
+
word-break: normal;
|
|
37
|
+
word-wrap: break-word;
|
|
38
|
+
${({ foundation }) => foundation?.elevation?.ev2(true)};
|
|
39
|
+
${({ foundation }) => foundation?.rounding?.round8};
|
|
40
|
+
|
|
41
|
+
${({ interpolation }) => interpolation}
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export const EllipsisableContent = styled.div`
|
|
45
|
+
${ellipsis(20, LineHeightAbsoluteNumber.Lh18)}
|
|
46
|
+
`
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { fireEvent } from '@testing-library/dom'
|
|
4
|
+
import { act } from '@testing-library/react'
|
|
5
|
+
|
|
6
|
+
import { css } from '~/src/foundation'
|
|
7
|
+
|
|
8
|
+
import { render } from '~/src/utils/testUtils'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
LegacyTooltip,
|
|
12
|
+
TOOLTIP_CONTENT_TEST_ID,
|
|
13
|
+
TOOLTIP_TEST_ID,
|
|
14
|
+
} from './LegacyTooltip'
|
|
15
|
+
import { type LegacyTooltipProps } from './LegacyTooltip.types'
|
|
16
|
+
|
|
17
|
+
const RootTooltip: React.FC<LegacyTooltipProps> = ({ children, ...rests }) => (
|
|
18
|
+
<LegacyTooltip {...rests}>
|
|
19
|
+
{ children }
|
|
20
|
+
</LegacyTooltip>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
describe('Tooltip test >', () => {
|
|
24
|
+
let props: LegacyTooltipProps
|
|
25
|
+
|
|
26
|
+
const content = 'Hovered'
|
|
27
|
+
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
props = {
|
|
30
|
+
children: 'Text',
|
|
31
|
+
content,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
jest.useFakeTimers()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
afterEach(() => {
|
|
38
|
+
jest.useRealTimers()
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const renderTooltip = (optionProps?: LegacyTooltipProps) => render(
|
|
42
|
+
<RootTooltip {...props} {...optionProps} />,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
it('Tooltip with default props', () => {
|
|
46
|
+
const { baseElement, getByTestId } = renderTooltip()
|
|
47
|
+
|
|
48
|
+
act(() => {
|
|
49
|
+
fireEvent.mouseOver(getByTestId(TOOLTIP_TEST_ID))
|
|
50
|
+
|
|
51
|
+
jest.runAllTimers()
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
expect(baseElement).toMatchSnapshot()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('Tooltip with contentInterpolation prop', async () => {
|
|
58
|
+
const { baseElement, getByTestId } = renderTooltip({
|
|
59
|
+
contentInterpolation: css`background-color: black;`,
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
act(() => {
|
|
63
|
+
fireEvent.mouseOver(getByTestId(TOOLTIP_TEST_ID))
|
|
64
|
+
|
|
65
|
+
jest.runAllTimers()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
expect(baseElement).toMatchSnapshot()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('TooltipContent not rendered at first', async () => {
|
|
72
|
+
const { queryByTestId } = renderTooltip()
|
|
73
|
+
|
|
74
|
+
expect(queryByTestId(TOOLTIP_CONTENT_TEST_ID)).toBeNull()
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('TooltipContent rendered after mouseover', async () => {
|
|
78
|
+
const { getByTestId, queryByTestId } = renderTooltip()
|
|
79
|
+
|
|
80
|
+
act(() => {
|
|
81
|
+
fireEvent.mouseOver(getByTestId(TOOLTIP_TEST_ID))
|
|
82
|
+
|
|
83
|
+
jest.runAllTimers()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
expect(queryByTestId(TOOLTIP_CONTENT_TEST_ID)).toBeVisible()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('Tooltip with disabled prop not rendered even after mouseover', async () => {
|
|
90
|
+
const { getByTestId, queryByTestId } = renderTooltip({ disabled: true })
|
|
91
|
+
|
|
92
|
+
act(() => {
|
|
93
|
+
fireEvent.mouseOver(getByTestId(TOOLTIP_TEST_ID))
|
|
94
|
+
|
|
95
|
+
jest.runAllTimers()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
expect(queryByTestId(TOOLTIP_CONTENT_TEST_ID)).toBeNull()
|
|
99
|
+
})
|
|
100
|
+
})
|