@telus-uds/components-base 1.59.1 → 1.60.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/component-docs.json +245 -6
  3. package/lib/Button/ButtonLink.js +7 -3
  4. package/lib/ExpandCollapse/Panel.js +7 -0
  5. package/lib/IconButton/IconButton.js +8 -0
  6. package/lib/Link/ChevronLink.js +9 -2
  7. package/lib/Link/LinkBase.js +14 -0
  8. package/lib/Link/TextButton.js +12 -1
  9. package/lib/Listbox/PressableItem.js +1 -3
  10. package/lib/Pagination/dictionary.js +3 -3
  11. package/lib/Progress/ProgressBarBackground.js +2 -2
  12. package/lib/SideNav/Item.js +15 -5
  13. package/lib/Tags/Tags.js +6 -1
  14. package/lib/Tooltip/Tooltip.js +6 -1
  15. package/lib/Tooltip/Tooltip.native.js +6 -1
  16. package/lib/Tooltip/shared.js +5 -0
  17. package/lib-module/Button/ButtonLink.js +4 -1
  18. package/lib-module/ExpandCollapse/Panel.js +7 -0
  19. package/lib-module/IconButton/IconButton.js +8 -0
  20. package/lib-module/Link/ChevronLink.js +10 -3
  21. package/lib-module/Link/LinkBase.js +14 -0
  22. package/lib-module/Link/TextButton.js +11 -1
  23. package/lib-module/Listbox/PressableItem.js +1 -3
  24. package/lib-module/Pagination/dictionary.js +3 -3
  25. package/lib-module/Progress/ProgressBarBackground.js +2 -2
  26. package/lib-module/SideNav/Item.js +15 -5
  27. package/lib-module/Tags/Tags.js +6 -1
  28. package/lib-module/Tooltip/Tooltip.js +6 -1
  29. package/lib-module/Tooltip/Tooltip.native.js +6 -1
  30. package/lib-module/Tooltip/shared.js +5 -0
  31. package/package.json +2 -2
  32. package/src/Button/ButtonLink.jsx +4 -1
  33. package/src/ExpandCollapse/Panel.jsx +11 -1
  34. package/src/IconButton/IconButton.jsx +7 -0
  35. package/src/Link/ChevronLink.jsx +10 -3
  36. package/src/Link/LinkBase.jsx +11 -0
  37. package/src/Link/TextButton.jsx +8 -2
  38. package/src/Listbox/PressableItem.jsx +1 -3
  39. package/src/Pagination/dictionary.js +3 -3
  40. package/src/Progress/ProgressBarBackground.jsx +2 -2
  41. package/src/SideNav/Item.jsx +13 -5
  42. package/src/Tags/Tags.jsx +5 -1
  43. package/src/Tooltip/Tooltip.jsx +16 -2
  44. package/src/Tooltip/Tooltip.native.jsx +15 -2
  45. package/src/Tooltip/shared.js +4 -0
@@ -82,7 +82,10 @@ const defaultControl = (pressableState, variant) => (
82
82
  * - Tooltips may also be useful when vertical space is an issue.
83
83
  */
84
84
  const Tooltip = forwardRef(
85
- ({ children, content, position = 'auto', copy = 'en', tokens, variant, ...rest }, ref) => {
85
+ (
86
+ { children, content, position = 'auto', copy = 'en', tokens, variant, inline = false, ...rest },
87
+ ref
88
+ ) => {
86
89
  const [isOpen, setIsOpen] = useState(false)
87
90
  const arrowRef = useRef()
88
91
 
@@ -157,7 +160,18 @@ const Tooltip = forwardRef(
157
160
  control === defaultControl ? { top: 10, bottom: 10, left: 10, right: 10 } : undefined
158
161
 
159
162
  return (
160
- <View style={staticStyles.container} {...selectProps(rest)} ref={ref}>
163
+ <View
164
+ style={[
165
+ staticStyles.container,
166
+ Platform.select({
167
+ web: {
168
+ display: inline ? 'inline-block' : 'flex'
169
+ }
170
+ })
171
+ ]}
172
+ {...selectProps(rest)}
173
+ ref={ref}
174
+ >
161
175
  <Pressable
162
176
  onPress={toggleIsOpen}
163
177
  ref={reference}
@@ -108,7 +108,10 @@ const defaultControl = (pressableState, variant) => (
108
108
  * - Tooltips may also be useful when vertical space is an issue.
109
109
  */
110
110
  const Tooltip = forwardRef(
111
- ({ children, content, position = 'auto', copy = 'en', tokens, variant, ...rest }, ref) => {
111
+ (
112
+ { children, content, position = 'auto', copy = 'en', tokens, variant, inline = false, ...rest },
113
+ ref
114
+ ) => {
112
115
  const [isOpen, setIsOpen] = useState(false)
113
116
 
114
117
  const controlRef = useRef()
@@ -217,7 +220,17 @@ const Tooltip = forwardRef(
217
220
  control === defaultControl ? { top: 10, bottom: 10, left: 10, right: 10 } : undefined
218
221
 
219
222
  return (
220
- <View style={staticStyles.container} {...selectProps(rest)}>
223
+ <View
224
+ style={[
225
+ staticStyles.container,
226
+ Platform.select({
227
+ web: {
228
+ display: inline ? 'inline-block' : 'flex'
229
+ }
230
+ })
231
+ ]}
232
+ {...selectProps(rest)}
233
+ >
221
234
  <Pressable
222
235
  onPress={toggleIsOpen}
223
236
  ref={controlRef}
@@ -20,6 +20,10 @@ const propTypes = {
20
20
  * Use to place the tooltip in a specific location (only if it fits within viewport).
21
21
  */
22
22
  position: PropTypes.oneOf(['auto', 'above', 'right', 'below', 'left']),
23
+ /**
24
+ * Display tooltip icon button as an inline element.
25
+ */
26
+ inline: PropTypes.bool,
23
27
  tokens: getTokensPropType('Tooltip'),
24
28
  variant: variantProp.propType
25
29
  }