diff --git a/deprecated-modules.csv b/deprecated-modules.csv index f2553508..46a841c4 100644 --- a/deprecated-modules.csv +++ b/deprecated-modules.csv @@ -10,4 +10,5 @@ Nri.Ui.SideNav.V2,upgrade to V3 Nri.Ui.Switch.V1,upgrade to V2 Nri.Ui.Table.V4,upgrade to V5 Nri.Ui.Tabs.V6,upgrade to V7 -Nri.Ui.Tooltip.V1,upgrade to V2 +Nri.Ui.Tooltip.V1,upgrade to V3 +Nri.Ui.Tooltip.V2,upgrade to V3 diff --git a/elm.json b/elm.json index b8ac22d9..e3554bf3 100644 --- a/elm.json +++ b/elm.json @@ -72,6 +72,7 @@ "Nri.Ui.TextInput.V7", "Nri.Ui.Tooltip.V1", "Nri.Ui.Tooltip.V2", + "Nri.Ui.Tooltip.V3", "Nri.Ui.UiIcon.V1" ], "elm-version": "0.19.0 <= v < 0.20.0", diff --git a/forbidden-imports.toml b/forbidden-imports.toml index 14c840fc..18034712 100644 --- a/forbidden-imports.toml +++ b/forbidden-imports.toml @@ -149,5 +149,8 @@ hint = 'upgrade to V6' hint = 'upgrade to V7' [forbidden."Nri.Ui.Tooltip.V1"] -hint = 'upgrade to V2' +hint = 'upgrade to V3' usages = ['styleguide/../src/Nri/Ui/Menu/V1.elm'] + +[forbidden."Nri.Ui.Tooltip.V2"] +hint = 'upgrade to V3' diff --git a/src/Nri/Ui/SegmentedControl/V14.elm b/src/Nri/Ui/SegmentedControl/V14.elm index d8b47457..2397addd 100644 --- a/src/Nri/Ui/SegmentedControl/V14.elm +++ b/src/Nri/Ui/SegmentedControl/V14.elm @@ -4,7 +4,11 @@ module Nri.Ui.SegmentedControl.V14 exposing , Positioning(..), Width(..) ) -{-| Changes from V13: +{-| Patch changes: + + - use Tooltip.V3 instead of Tooltip.V2 + +Changes from V13: - Adds tooltip support to `viewRadioGroup` @@ -26,7 +30,7 @@ import Nri.Ui.Colors.Extra exposing (withAlpha) import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Fonts.V1 as Fonts import Nri.Ui.Svg.V1 as Svg exposing (Svg) -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.Util exposing (dashify) import TabsInternal.V2 as TabsInternal diff --git a/src/Nri/Ui/Tabs/V7.elm b/src/Nri/Ui/Tabs/V7.elm index dbe946f4..20c8a665 100644 --- a/src/Nri/Ui/Tabs/V7.elm +++ b/src/Nri/Ui/Tabs/V7.elm @@ -7,7 +7,11 @@ module Nri.Ui.Tabs.V7 exposing , spaHref ) -{-| Changes from V6: +{-| Patch changes: + + - use Tooltip.V3 instead of Tooltip.V2 + +Changes from V6: - Changes Tab construction to follow attributes-based approach - Adds tooltip support @@ -29,7 +33,7 @@ import Nri.Ui import Nri.Ui.Colors.Extra exposing (withAlpha) import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Fonts.V1 as Fonts -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import TabsInternal.V2 as TabsInternal diff --git a/src/Nri/Ui/Tooltip/V3.elm b/src/Nri/Ui/Tooltip/V3.elm index 1444baed..c17ce0db 100644 --- a/src/Nri/Ui/Tooltip/V3.elm +++ b/src/Nri/Ui/Tooltip/V3.elm @@ -1,4 +1,4 @@ -module Nri.Ui.Tooltip.V2 exposing +module Nri.Ui.Tooltip.V3 exposing ( view, toggleTip , Attribute , plaintext, html @@ -15,37 +15,7 @@ module Nri.Ui.Tooltip.V2 exposing , primaryLabel, auxillaryDescription ) -{-| Known issues: - - - tooltips with focusable content (e.g., a link) will not handle focus correctly for - keyboard-only users when using the onHover attribute - -Post-release patches: - - - fix overlay for onClick toolTip having a border - - mark customTriggerAttributes as deprecated - - add containerCss - - adds `nriDescription` and `testId` - - fix - - use `Shadows` - -Changes from V1: - - - {Position, withPosition} -> {onTop, onBottom, onLeft, onRight} - - withTooltipStyleOverrides -> css - - {Width, withWidth} -> {exactWidth, fitToContent} - - {Padding, withPadding} -> {smallPadding, normalPadding} - - adds customPadding - - adds custom for custom attributes - - adds plaintext, html helpers for setting the content - - pass a list of attributes rather than requiring a pipeline to set up the tooltip - - move Trigger into the attributes - - change primaryLabel and auxillaryDescription to attributes, adding view - - move the onTrigger event to the attributes - - extraButtonAttrs becomes attribute `customTriggerAttributes` - - isOpen field becomes the `open` attribute - - fold toggleTip and view into each other, so there's less to maintain - - adds withoutTail +{-| Changes from V2: These tooltips follow the accessibility recommendations from: diff --git a/src/TabsInternal/V2.elm b/src/TabsInternal/V2.elm index a156d7de..a7a77d66 100644 --- a/src/TabsInternal/V2.elm +++ b/src/TabsInternal/V2.elm @@ -21,7 +21,7 @@ import Html.Styled.Events as Events import Html.Styled.Keyed as Keyed import Json.Decode import Nri.Ui.Html.Attributes.V2 as AttributesExtra -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.Util exposing (dashify) diff --git a/styleguide-app/Examples/ClickableSvg.elm b/styleguide-app/Examples/ClickableSvg.elm index b62de2f9..382e5a91 100644 --- a/styleguide-app/Examples/ClickableSvg.elm +++ b/styleguide-app/Examples/ClickableSvg.elm @@ -20,7 +20,7 @@ import Html.Styled.Attributes as Attributes import Nri.Ui.ClickableSvg.V2 as ClickableSvg import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Svg.V1 exposing (Svg) -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.UiIcon.V1 as UiIcon diff --git a/styleguide-app/Examples/SegmentedControl.elm b/styleguide-app/Examples/SegmentedControl.elm index 1727a287..4e714dc4 100644 --- a/styleguide-app/Examples/SegmentedControl.elm +++ b/styleguide-app/Examples/SegmentedControl.elm @@ -26,7 +26,7 @@ import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Fonts.V1 as Fonts import Nri.Ui.SegmentedControl.V14 as SegmentedControl import Nri.Ui.Svg.V1 as Svg exposing (Svg) -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.UiIcon.V1 as UiIcon import String exposing (toLower) import Task diff --git a/styleguide-app/Examples/Tabs.elm b/styleguide-app/Examples/Tabs.elm index 8d596c91..d4633233 100644 --- a/styleguide-app/Examples/Tabs.elm +++ b/styleguide-app/Examples/Tabs.elm @@ -22,7 +22,7 @@ import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Svg.V1 as Svg import Nri.Ui.Tabs.V7 as Tabs exposing (Alignment(..), Tab) import Nri.Ui.Text.V6 as Text -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.UiIcon.V1 as UiIcon import Routes import Task diff --git a/styleguide-app/Examples/Tooltip.elm b/styleguide-app/Examples/Tooltip.elm index f0ab5b24..084a1820 100644 --- a/styleguide-app/Examples/Tooltip.elm +++ b/styleguide-app/Examples/Tooltip.elm @@ -21,13 +21,18 @@ import Nri.Ui.ClickableSvg.V2 as ClickableSvg import Nri.Ui.ClickableText.V3 as ClickableText import Nri.Ui.Heading.V2 as Heading import Nri.Ui.Text.V6 as Text -import Nri.Ui.Tooltip.V2 as Tooltip +import Nri.Ui.Tooltip.V3 as Tooltip import Nri.Ui.UiIcon.V1 as UiIcon version : Int version = - 2 + 3 + + +moduleName : String +moduleName = + "Tooltip" example : Example State Msg @@ -69,11 +74,6 @@ example = } -moduleName : String -moduleName = - "Tooltip" - - type alias State = { openTooltip : Maybe TooltipType , staticExampleSettings : Control (List ( String, Tooltip.Attribute Never )) diff --git a/tests/elm-verify-examples.json b/tests/elm-verify-examples.json index e4b8bea7..a5bd7147 100644 --- a/tests/elm-verify-examples.json +++ b/tests/elm-verify-examples.json @@ -68,6 +68,7 @@ "Nri.Ui.TextInput.V7", "Nri.Ui.Tooltip.V1", "Nri.Ui.Tooltip.V2", + "Nri.Ui.Tooltip.V3", "Nri.Ui.UiIcon.V1" ] }