Implemented support for inline variant of the Link component. Outstanding issues with accessibility moved to #186 (not done yet) and did not test in flagship, deferring that to that ticket as it may meaningfully alter behavior for inline links.
Added new story for Link: 'Inline'
Added new utility hook useIsScreenReaderEnabled that tracks screen reader activation/deactivation (modified/cleaned up version from flagship utils)
Significantly updated Link component to support inline variant:
New Link type of inline which takes an array (paragraphText) of text between links (optional a11yLabel override) and Link component data (LinkProps)
New general prop inlineSingle which was needed to pass back into calling the Link component for each link within the paragraphText array to otherwise build them identical to a singular Link
Split out building the icon display to differentiate Pressable vs Text built links
Reworked/cleaned up existing display logic (no visible change, but more concise code-wise)
Added special display logic for when inlineSingle prop is set which builds the link as Text instead of Pressable
Added new internal to Link ParagraphText component which formats up the non-link paragraph text between Links
Added new internal to Link inlineLink component which processes the paragraphText array into display logic, routing each array item to ParagraphText or Link components as appropriate
Also splits out the special iOS w/ screen reader enabled display (the same except an RN View instead of RN Text)
Known outstanding issues moved to #186 or split to bugs:
Android:
The icon (or something there) reads "0" for the screen reader when it should not
The a11yLabel override for the first link is not being read
iOS:
Overriding to read so the links are separable, the wrapping goes goofy
Adjusting size upscales the icon (slowly), but does not downscale the icon when reverted (ticket #203 created)
Web:
On press bolding does not work (ticket #197 created)
[x] PR has changelog label applied if it's to be included in the changelog
[x] Acceptance criteria:
All satisfied or
Documented reason for not being performed or
Split to separate ticket and ticket is linked by relevant AC(s)
[x] Above PR sections adequately filled out
[x] If any breaking changes, in accordance with the pre-1.0.0 versioning guidelines: a CU ticket has been created for the VA Mobile App detailing necessary adjustments with the package version that will be published by this ticket
Code
[x] Tests are included if appropriate (or split to separate ticket)
[x] New functions have proper TSDoc annotations
Publish
While changes warrant a new version per the versioning guidelines, Link component is still undergoing enhancements towards MVP and deferring to later.
Description of Change
Implemented support for inline variant of the Link component. Outstanding issues with accessibility moved to #186 (not done yet) and did not test in flagship, deferring that to that ticket as it may meaningfully alter behavior for inline links.
useIsScreenReaderEnabled
that tracks screen reader activation/deactivation (modified/cleaned up version from flagship utils)inline
which takes an array (paragraphText) of text between links (optional a11yLabel override) and Link component data (LinkProps)inlineSingle
which was needed to pass back into calling the Link component for each link within theparagraphText
array to otherwise build them identical to a singular LinkinlineSingle
prop is set which builds the link as Text instead of PressableParagraphText
component which formats up the non-link paragraph text between LinksinlineLink
component which processes theparagraphText
array into display logic, routing each array item to ParagraphText or Link components as appropriateKnown outstanding issues moved to #186 or split to bugs:
Screenshots/Video
Android:
https://github.com/department-of-veterans-affairs/va-mobile-library/assets/8690976/c7661a25-d255-4686-a197-cc089465242f
iOS:
https://github.com/department-of-veterans-affairs/va-mobile-library/assets/8690976/b55aca48-804e-4bae-9ba8-a2865bb803f3
Web:
https://github.com/department-of-veterans-affairs/va-mobile-library/assets/8690976/2a67934d-bf25-48b8-bede-1f2c23345bcb
Testing
PR Checklist
Code reviewer validation:
changelog
label applied if it's to be included in the changelogPublish
While changes warrant a new version per the versioning guidelines, Link component is still undergoing enhancements towards MVP and deferring to later.