@telus-uds/components-base 4.0.0-alpha.2 → 4.0.0-beta.1

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 (120) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/lib/cjs/Autocomplete/Autocomplete.js +13 -1
  3. package/lib/cjs/Autocomplete/constants.js +1 -1
  4. package/lib/cjs/Button/ButtonGroup.js +91 -23
  5. package/lib/cjs/Card/CardBase.js +75 -47
  6. package/lib/cjs/ColourToggle/ColourBubble.js +66 -13
  7. package/lib/cjs/ColourToggle/ColourToggle.js +41 -11
  8. package/lib/cjs/ColourToggle/constants.js +15 -0
  9. package/lib/cjs/ColourToggle/dictionary.js +14 -0
  10. package/lib/cjs/Listbox/ListboxOverlay.js +7 -1
  11. package/lib/cjs/MultiSelectFilter/ModalOverlay.js +7 -1
  12. package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +2 -28
  13. package/lib/cjs/TextInput/TextInputBase.js +2 -1
  14. package/lib/cjs/Validator/Validator.js +5 -1
  15. package/lib/cjs/utils/useOverlaidPosition.js +83 -42
  16. package/lib/esm/Autocomplete/Autocomplete.js +13 -1
  17. package/lib/esm/Autocomplete/constants.js +1 -1
  18. package/lib/esm/Button/ButtonGroup.js +91 -23
  19. package/lib/esm/Card/CardBase.js +75 -47
  20. package/lib/esm/ColourToggle/ColourBubble.js +67 -14
  21. package/lib/esm/ColourToggle/ColourToggle.js +41 -11
  22. package/lib/esm/ColourToggle/constants.js +8 -0
  23. package/lib/esm/ColourToggle/dictionary.js +8 -0
  24. package/lib/esm/Listbox/ListboxOverlay.js +7 -1
  25. package/lib/esm/MultiSelectFilter/ModalOverlay.js +8 -2
  26. package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +2 -28
  27. package/lib/esm/TextInput/TextInputBase.js +2 -1
  28. package/lib/esm/Validator/Validator.js +5 -1
  29. package/lib/esm/utils/useOverlaidPosition.js +83 -42
  30. package/lib/package.json +3 -3
  31. package/package.json +3 -3
  32. package/src/Autocomplete/Autocomplete.jsx +11 -2
  33. package/src/Autocomplete/constants.js +1 -1
  34. package/src/Button/ButtonGroup.jsx +93 -24
  35. package/src/Card/CardBase.jsx +94 -75
  36. package/src/ColourToggle/ColourBubble.jsx +62 -7
  37. package/src/ColourToggle/ColourToggle.jsx +43 -9
  38. package/src/ColourToggle/constants.js +10 -0
  39. package/src/ColourToggle/dictionary.js +4 -0
  40. package/src/Listbox/ListboxOverlay.jsx +6 -2
  41. package/src/MultiSelectFilter/ModalOverlay.jsx +9 -3
  42. package/src/MultiSelectFilter/MultiSelectFilter.jsx +1 -31
  43. package/src/TextInput/TextInputBase.jsx +2 -1
  44. package/src/Validator/Validator.jsx +5 -1
  45. package/src/utils/useOverlaidPosition.js +84 -34
  46. package/types/A11yInfoProvider.d.ts +9 -0
  47. package/types/A11yText.d.ts +13 -0
  48. package/types/ActionCard.d.ts +19 -0
  49. package/types/ActivityIndicator.d.ts +13 -0
  50. package/types/Autocomplete.d.ts +27 -0
  51. package/types/Badge.d.ts +15 -4
  52. package/types/BaseProvider.d.ts +26 -0
  53. package/types/Box.d.ts +13 -3
  54. package/types/Button.d.ts +35 -0
  55. package/types/Card.d.ts +19 -0
  56. package/types/CardGroup.d.ts +23 -0
  57. package/types/Carousel.d.ts +25 -0
  58. package/types/Checkbox.d.ts +15 -2
  59. package/types/CheckboxCard.d.ts +20 -0
  60. package/types/CheckboxCardGroup.d.ts +10 -4
  61. package/types/ChevronLink.d.ts +9 -2
  62. package/types/ColourToggle.d.ts +16 -0
  63. package/types/Common.d.ts +7 -3
  64. package/types/Divider.d.ts +13 -1
  65. package/types/DownloadApp.d.ts +19 -0
  66. package/types/ExpandCollapse.d.ts +16 -9
  67. package/types/ExpandCollapseMini.d.ts +16 -0
  68. package/types/Feedback.d.ts +16 -0
  69. package/types/Fieldset.d.ts +17 -0
  70. package/types/FileUpload.d.ts +6 -0
  71. package/types/FlexGrid.d.ts +57 -0
  72. package/types/Footnote.d.ts +18 -0
  73. package/types/HorizontalScroll.d.ts +15 -0
  74. package/types/HorizontalScrollButton.d.ts +17 -1
  75. package/types/Icon.d.ts +13 -2
  76. package/types/IconButton.d.ts +19 -0
  77. package/types/InputLabel.d.ts +12 -0
  78. package/types/InputSupports.d.ts +19 -0
  79. package/types/Link.d.ts +20 -4
  80. package/types/List.d.ts +11 -4
  81. package/types/Listbox.d.ts +13 -3
  82. package/types/Modal.d.ts +25 -0
  83. package/types/MultiSelectFilter.d.ts +24 -0
  84. package/types/Notification.d.ts +19 -0
  85. package/types/OrderedList.d.ts +17 -0
  86. package/types/Pagination.d.ts +25 -0
  87. package/types/Portal.d.ts +5 -1
  88. package/types/PriceLockup.d.ts +28 -0
  89. package/types/ProductCard.d.ts +20 -0
  90. package/types/ProductCardGroup.d.ts +21 -0
  91. package/types/Progress.d.ts +22 -0
  92. package/types/QuickLinks.d.ts +27 -0
  93. package/types/QuickLinksFeature.d.ts +27 -0
  94. package/types/Radio.d.ts +22 -0
  95. package/types/RadioCard.d.ts +21 -0
  96. package/types/Responsive.d.ts +14 -0
  97. package/types/Scroll.d.ts +2 -2
  98. package/types/Search.d.ts +15 -2
  99. package/types/Select.d.ts +12 -4
  100. package/types/SideNav.d.ts +38 -0
  101. package/types/Skeleton.d.ts +17 -0
  102. package/types/SkipLink.d.ts +14 -0
  103. package/types/Spacer.d.ts +8 -1
  104. package/types/StackView.d.ts +8 -2
  105. package/types/Status.d.ts +2 -3
  106. package/types/StepTracker.d.ts +16 -0
  107. package/types/TabBar.d.ts +25 -0
  108. package/types/Tabs.d.ts +12 -3
  109. package/types/Tags.d.ts +24 -0
  110. package/types/TextButton.d.ts +11 -4
  111. package/types/TextInput.d.ts +38 -0
  112. package/types/ThemeProvider.d.ts +29 -0
  113. package/types/Timeline.d.ts +16 -0
  114. package/types/ToggleSwitch.d.ts +11 -2
  115. package/types/ToolTip.d.ts +7 -3
  116. package/types/TooltipButton.d.ts +20 -0
  117. package/types/Typography.d.ts +8 -2
  118. package/types/Validator.d.ts +16 -0
  119. package/types/ViewportProvider.d.ts +12 -0
  120. package/types/index.d.ts +197 -50
@@ -54,11 +54,6 @@ function getOverlaidPosition({
54
54
  offsets = {},
55
55
  align
56
56
  }) {
57
- // Web-only: this will be difficult to mimic on native because there's no global scroll position.
58
- // TODO: wire something in e.g. a scroll ref accessible from a provider included in Allium provider
59
- // that can be passed to the appropriate ScrollView?
60
- const { scrollX = 0, scrollY = 0 } = typeof window === 'object' ? window : {}
61
-
62
57
  // Will have top, bottom, left and/or right offsets depending on `align`
63
58
  const positioning = {}
64
59
 
@@ -68,40 +63,44 @@ function getOverlaidPosition({
68
63
  if (align.top)
69
64
  positioning.top = getPosition({
70
65
  edge: getEdgeType(align, 'top'),
71
- fromEdge: sourceLayout.y + scrollY + verticalOffset,
66
+ fromEdge: sourceLayout.y + verticalOffset,
72
67
  sourceSize: sourceLayout.height
73
68
  })
74
69
  if (align.middle)
75
70
  positioning.top = getPosition({
76
71
  edge: getEdgeType(align, 'middle'),
77
- fromEdge: sourceLayout.y + scrollY + verticalOffset - targetDimensions.height / 2,
78
- sourceSize: sourceLayout.height
79
- })
80
- if (align.bottom)
81
- positioning.bottom = getPosition({
82
- edge: getEdgeType(align, 'bottom'),
83
- fromEdge:
84
- windowDimensions.height - (sourceLayout.y + scrollY + sourceLayout.height - verticalOffset),
72
+ fromEdge: sourceLayout.y + verticalOffset - targetDimensions.height / 2,
85
73
  sourceSize: sourceLayout.height
86
74
  })
75
+ if (align.bottom) {
76
+ if (Platform.OS !== 'web') {
77
+ // On native, position:absolute is parent-relative, so use negative top offset instead of window-based bottom math.
78
+ positioning.top = sourceLayout.y - targetDimensions.height - verticalOffset
79
+ } else {
80
+ positioning.bottom = getPosition({
81
+ edge: getEdgeType(align, 'bottom'),
82
+ fromEdge: windowDimensions.height - (sourceLayout.y + sourceLayout.height - verticalOffset),
83
+ sourceSize: sourceLayout.height
84
+ })
85
+ }
86
+ }
87
87
 
88
88
  if (align.left)
89
89
  positioning.left = getPosition({
90
90
  edge: getEdgeType(align, 'left'),
91
- fromEdge: sourceLayout.x + scrollX + horizontalOffset,
91
+ fromEdge: sourceLayout.x + horizontalOffset,
92
92
  sourceSize: sourceLayout.width
93
93
  })
94
94
  if (align.center)
95
95
  positioning.left = getPosition({
96
96
  edge: getEdgeType(align, 'center'),
97
- fromEdge: sourceLayout.x + scrollX + horizontalOffset - targetDimensions.width / 2,
97
+ fromEdge: sourceLayout.x + horizontalOffset - targetDimensions.width / 2,
98
98
  sourceSize: sourceLayout.width
99
99
  })
100
100
  if (align.right)
101
101
  positioning.right = getPosition({
102
102
  edge: getEdgeType(align, 'right'),
103
- fromEdge:
104
- windowDimensions.width - (sourceLayout.x + scrollX + sourceLayout.width - horizontalOffset),
103
+ fromEdge: windowDimensions.width - (sourceLayout.x + sourceLayout.width - horizontalOffset),
105
104
  sourceSize: sourceLayout.width
106
105
  })
107
106
 
@@ -149,6 +148,34 @@ export const useOverlaidPosition = ({
149
148
 
150
149
  const [windowDimensions, setWindowDimensions] = useState(null)
151
150
 
151
+ const hasRemeasuredRef = useRef(false)
152
+
153
+ const applySourceLayout = useCallback((dims, x, y, width, height) => {
154
+ setWindowDimensions(dims)
155
+ setSourceLayout({ x, y, width, height })
156
+ }, [])
157
+
158
+ const measureSourceOnWeb = useCallback(
159
+ (windowDims) => {
160
+ const el = sourceRef.current
161
+ if (!el) return
162
+ const domNode = el._nativeTag ?? el
163
+ const dims = windowDims ?? Dimensions.get('window')
164
+ const rect =
165
+ typeof domNode.getBoundingClientRect === 'function' ? domNode.getBoundingClientRect() : null
166
+ if (rect) {
167
+ const x = rect.left + (typeof window.scrollX === 'number' ? window.scrollX : 0)
168
+ const y = rect.top + (typeof window.scrollY === 'number' ? window.scrollY : 0)
169
+ applySourceLayout(dims, x, y, rect.width, rect.height)
170
+ } else {
171
+ el.measureInWindow((mx, my, width, height) => {
172
+ applySourceLayout(dims, mx, my, width, height)
173
+ })
174
+ }
175
+ },
176
+ [applySourceLayout]
177
+ )
178
+
152
179
  const onTargetLayout = useCallback(
153
180
  ({
154
181
  nativeEvent: {
@@ -173,12 +200,14 @@ export const useOverlaidPosition = ({
173
200
  const readyToShow = Boolean(isShown && sourceRef.current)
174
201
  useEffect(() => {
175
202
  const handleDimensionsChange = ({ window }) => {
176
- const measurementFunction = Platform.OS === 'web' ? 'measureInWindow' : 'measure'
177
-
178
- sourceRef.current?.[measurementFunction]((x, y, width, height) => {
179
- setWindowDimensions(window)
180
- setSourceLayout({ x, y, width, height })
181
- })
203
+ if (Platform.OS === 'web') {
204
+ measureSourceOnWeb(window)
205
+ } else {
206
+ sourceRef.current?.measure((x, y, width, height) => {
207
+ setWindowDimensions(window)
208
+ setSourceLayout({ x, y, width, height })
209
+ })
210
+ }
182
211
  }
183
212
 
184
213
  let subscription
@@ -192,6 +221,7 @@ export const useOverlaidPosition = ({
192
221
  }
193
222
  setSourceLayout(null)
194
223
  setTargetDimensions(null)
224
+ hasRemeasuredRef.current = false
195
225
  }
196
226
 
197
227
  if (readyToShow) {
@@ -202,19 +232,29 @@ export const useOverlaidPosition = ({
202
232
  }
203
233
 
204
234
  return unsubscribe
205
- }, [readyToShow])
235
+ }, [readyToShow, measureSourceOnWeb])
236
+
237
+ // Re-measure source when targetDimensions first becomes available.
238
+ // Without this, there is a race condition: getBoundingClientRect() resolves faster than
239
+ // measureInWindow used to, so sourceLayout may be set before the dropdown has rendered
240
+ // and reported its dimensions via onTargetLayout. When targetDimensions finally arrives,
241
+ // sourceLayout is stale (no scroll has occurred to trigger handleScroll).
242
+ // Setting hasRemeasuredRef.current=true here also prevents the blink: isReady (on web)
243
+ // won't become true until this effect completes, guaranteeing the dropdown is always shown
244
+ // at its final correct position without an intermediate incorrect-position frame.
245
+ useEffect(() => {
246
+ if (!isShown || !sourceRef.current || !targetDimensions || Platform.OS !== 'web') return
247
+
248
+ measureSourceOnWeb()
249
+ hasRemeasuredRef.current = true
250
+ }, [targetDimensions, isShown, measureSourceOnWeb])
206
251
 
207
252
  useEffect(() => {
208
253
  if (Platform.OS !== 'web') {
209
254
  return undefined
210
255
  }
211
256
 
212
- const handleScroll = debounce(() => {
213
- sourceRef.current?.measureInWindow((x, y, width, height) => {
214
- setWindowDimensions(window)
215
- setSourceLayout({ x, y, width, height })
216
- })
217
- }, DEBOUNCE_DELAY)
257
+ const handleScroll = debounce(measureSourceOnWeb, DEBOUNCE_DELAY)
218
258
 
219
259
  window.addEventListener('scroll', handleScroll)
220
260
 
@@ -222,9 +262,19 @@ export const useOverlaidPosition = ({
222
262
  window.removeEventListener('scroll', handleScroll)
223
263
  handleScroll.cancel()
224
264
  }
225
- }, [sourceRef])
265
+ }, [measureSourceOnWeb])
226
266
 
227
- const isReady = Boolean(isShown && sourceLayout && windowDimensions && targetDimensions)
267
+ // On web, require hasRemeasuredRef to be true before declaring isReady. This ensures
268
+ // the dropdown is never shown with an intermediate stale position (the blink).
269
+ // On native, hasRemeasuredRef stays false (the web-only effect never runs), so we skip
270
+ // that check to preserve the original native behaviour.
271
+ const isReady = Boolean(
272
+ isShown &&
273
+ sourceLayout &&
274
+ windowDimensions &&
275
+ targetDimensions &&
276
+ (Platform.OS !== 'web' || hasRemeasuredRef.current)
277
+ )
228
278
 
229
279
  const overlaidPosition = isReady
230
280
  ? getOverlaidPosition({
@@ -234,7 +284,7 @@ export const useOverlaidPosition = ({
234
284
  offsets,
235
285
  align
236
286
  })
237
- : {}
287
+ : { top: 0, left: 0 }
238
288
 
239
289
  return {
240
290
  overlaidPosition,
@@ -0,0 +1,9 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface A11yInfoProviderProps {
4
+ children: ReactNode
5
+ }
6
+
7
+ declare const A11yInfoProvider: ComponentType<A11yInfoProviderProps>
8
+
9
+ export { A11yInfoProvider }
@@ -0,0 +1,13 @@
1
+ import type { ComponentType } from 'react'
2
+
3
+ export interface A11yTextProps {
4
+ text: string
5
+ heading?: boolean
6
+ role?: string
7
+ testID?: string
8
+ dataSet?: Record<string, any>
9
+ }
10
+
11
+ declare const A11yText: ComponentType<A11yTextProps>
12
+
13
+ export { A11yText }
@@ -0,0 +1,19 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface ActionCardProps {
4
+ icon?: ComponentType<any>
5
+ title?: string
6
+ children?: ReactNode
7
+ href?: string
8
+ direction?: boolean
9
+ accessibilityRole?: string
10
+ tokens?: Record<string, string | number | boolean | object>
11
+ variant?: Record<string, string | number | boolean | undefined>
12
+ testID?: string
13
+ dataSet?: Record<string, any>
14
+ onPress?: () => void
15
+ }
16
+
17
+ declare const ActionCard: ComponentType<ActionCardProps>
18
+
19
+ export { ActionCard }
@@ -0,0 +1,13 @@
1
+ import type { ComponentType } from 'react'
2
+
3
+ export interface ActivityIndicatorProps {
4
+ tokens?: Record<string, string | number | boolean | object>
5
+ variant?: Record<string, string | number | boolean | undefined>
6
+ testID?: string
7
+ dataSet?: Record<string, any>
8
+ accessibilityLabel?: string
9
+ }
10
+
11
+ declare const ActivityIndicator: ComponentType<ActivityIndicatorProps>
12
+
13
+ export { ActivityIndicator }
@@ -0,0 +1,27 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface AutocompleteItem {
4
+ id: string
5
+ label: string
6
+ value?: string
7
+ }
8
+
9
+ export interface AutocompleteProps {
10
+ children?: (props: Record<string, any>) => ReactNode
11
+ tokens?: Record<string, string | number | boolean | object>
12
+ copy?: 'en' | 'fr'
13
+ items?: AutocompleteItem[]
14
+ value?: string
15
+ onChange?: (value: string) => void
16
+ onSearch?: (value: string) => void
17
+ onSelect?: (item: AutocompleteItem) => void
18
+ loading?: boolean
19
+ loadingMessage?: string
20
+ emptyText?: string
21
+ testID?: string
22
+ dataSet?: Record<string, any>
23
+ }
24
+
25
+ declare const Autocomplete: ComponentType<AutocompleteProps>
26
+
27
+ export { Autocomplete }
package/types/Badge.d.ts CHANGED
@@ -1,10 +1,17 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
1
3
  export interface BadgeProps {
2
- text: string
3
- borderColor?: string
4
- textColor?: string
4
+ children?: ReactNode
5
+ variant?: BadgeVariants
6
+ tokens?: BadgeTokens
7
+ pointerEvents?: 'all' | 'none' | 'box-only' | 'box-none'
8
+ onLayout?: (event: any) => void
9
+ nativeID?: string
10
+ testID?: string
11
+ dataSet?: Record<string, any>
5
12
  }
6
13
 
7
- type BadgeVariants = {
14
+ export type BadgeVariants = {
8
15
  alternative?: boolean
9
16
  inverse?: boolean
10
17
  outline?: boolean
@@ -26,3 +33,7 @@ export type BadgeTokens = {
26
33
  paddingRight?: number
27
34
  paddingTop?: number
28
35
  }
36
+
37
+ declare const Badge: ComponentType<BadgeProps>
38
+
39
+ export { Badge }
@@ -0,0 +1,26 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface ThemeMetadata {
4
+ themeTokensVersion: string
5
+ name: string
6
+ }
7
+
8
+ export interface Theme {
9
+ metadata: ThemeMetadata
10
+ }
11
+
12
+ export interface ThemeOptions {
13
+ forceAbsoluteFontSizing?: boolean
14
+ forceZIndex?: boolean
15
+ defaultViewport?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
16
+ }
17
+
18
+ export interface BaseProviderProps {
19
+ children: ReactNode
20
+ defaultTheme: Theme
21
+ themeOptions?: ThemeOptions
22
+ }
23
+
24
+ declare const BaseProvider: ComponentType<BaseProviderProps>
25
+
26
+ export { BaseProvider }
package/types/Box.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ReactNode, ReactElement } from 'react'
1
+ import type { ComponentType, ReactNode, ReactElement } from 'react'
2
2
  import { ScrollViewProps } from 'react-native'
3
3
  import { ResponsiveSpacing, SemanticTag } from './Common'
4
4
 
5
- type BoxVariants = {
5
+ export type BoxVariants = {
6
6
  background?:
7
7
  | 'lightest'
8
8
  | 'lighter'
@@ -21,7 +21,7 @@ type BoxVariants = {
21
21
  | 'featureBrand'
22
22
  }
23
23
 
24
- type BoxTokens = {
24
+ export type BoxTokens = {
25
25
  backgroundColor?: string
26
26
  gradient?: string
27
27
  borderWidth?: number
@@ -49,4 +49,14 @@ export interface BoxProps {
49
49
  testID?: string
50
50
  accessibilityLabel?: string
51
51
  accessible?: boolean
52
+ customGradient?: (...args: any[]) => ReactNode
53
+ backgroundImage?: any
54
+ pointerEvents?: 'all' | 'none' | 'box-only' | 'box-none'
55
+ onLayout?: (event: any) => void
56
+ nativeID?: string
57
+ dataSet?: Record<string, any>
52
58
  }
59
+
60
+ declare const Box: ComponentType<BoxProps>
61
+
62
+ export { Box }
@@ -0,0 +1,35 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+ import { IconProps } from './Icon'
3
+
4
+ export interface ButtonProps {
5
+ children: ReactNode | ((state: ButtonPressableState) => ReactNode)
6
+ onPress?: () => void
7
+ inactive?: boolean
8
+ disabled?: boolean
9
+ heightFull?: boolean
10
+ iconPosition?: 'left' | 'right'
11
+ icon?: ComponentType<any>
12
+ iconProps?: IconProps
13
+ tokens?: Record<string, string | number | boolean | object>
14
+ variant?: Record<string, string | number | boolean | undefined>
15
+ accessibilityLabel?: string
16
+ accessibilityRole?: string
17
+ accessible?: boolean
18
+ testID?: string
19
+ dataSet?: Record<string, any>
20
+ href?: string
21
+ hrefAttrs?: Record<string, string>
22
+ }
23
+
24
+ export type ButtonPressableState = {
25
+ hovered: boolean
26
+ focused: boolean
27
+ pressed: boolean
28
+ inactive: boolean
29
+ selected: boolean
30
+ textStyles: Record<string, any>
31
+ }
32
+
33
+ declare const Button: ComponentType<ButtonProps>
34
+
35
+ export { Button }
@@ -0,0 +1,19 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface CardProps {
4
+ children?: ReactNode
5
+ tokens?: Record<string, string | number | boolean | object>
6
+ variant?: Record<string, string | number | boolean | undefined>
7
+ onPress?: () => void
8
+ id?: string
9
+ interactiveCard?: Record<string, any>
10
+ backgroundImage?: any
11
+ testID?: string
12
+ dataSet?: Record<string, any>
13
+ accessibilityLabel?: string
14
+ accessibilityRole?: string
15
+ }
16
+
17
+ declare const Card: ComponentType<CardProps>
18
+
19
+ export { Card }
@@ -0,0 +1,23 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface CardGroupItem {
4
+ id: string
5
+ image?: Record<string, any>
6
+ dictionary?: Record<string, any>
7
+ [key: string]: any
8
+ }
9
+
10
+ export interface CardGroupProps {
11
+ copy?: 'en' | 'fr'
12
+ dictionary?: Record<string, any>
13
+ tokens?: Record<string, string | number | boolean | object>
14
+ variant?: Record<string, string | number | boolean | undefined>
15
+ items?: CardGroupItem[]
16
+ children?: ReactNode
17
+ testID?: string
18
+ dataSet?: Record<string, any>
19
+ }
20
+
21
+ declare const CardGroup: ComponentType<CardGroupProps>
22
+
23
+ export { CardGroup }
@@ -0,0 +1,25 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface CarouselProps {
4
+ children: ReactNode
5
+ tokens?: Record<string, string | number | boolean | object>
6
+ variant?: Record<string, string | number | boolean | undefined>
7
+ stepTrackerVariant?: Record<string, string | number | boolean | undefined>
8
+ progressBarVariant?: Record<string, string | number | boolean | undefined>
9
+ itemLabel?: string
10
+ previousNextNavigationPosition?: 'inside' | 'outside' | 'edge'
11
+ copy?: 'en' | 'fr'
12
+ testID?: string
13
+ dataSet?: Record<string, any>
14
+ accessibilityLabel?: string
15
+ }
16
+
17
+ export interface CarouselItemProps {
18
+ children: ReactNode
19
+ }
20
+
21
+ declare const Carousel: ComponentType<CarouselProps> & {
22
+ Item: ComponentType<CarouselItemProps>
23
+ }
24
+
25
+ export { Carousel }
@@ -1,6 +1,7 @@
1
+ import type { ComponentType } from 'react'
1
2
  import { StyleProp, ViewStyle, TextStyle } from 'react-native'
2
3
 
3
- type CheckboxTokens = {
4
+ export type CheckboxTokens = {
4
5
  containerBackgroundColor?: string
5
6
  feedbackMarginBottom?: number
6
7
  feedbackMarginTop?: number
@@ -33,7 +34,7 @@ type CheckboxTokens = {
33
34
  descriptionFontColor?: string
34
35
  }
35
36
 
36
- type CheckboxProps = {
37
+ export type CheckboxProps = {
37
38
  checked?: boolean
38
39
  defaultChecked?: boolean
39
40
  error?: boolean
@@ -50,4 +51,16 @@ type CheckboxProps = {
50
51
  style?: StyleProp<ViewStyle>
51
52
  labelStyle?: StyleProp<TextStyle>
52
53
  containerStyle?: StyleProp<ViewStyle>
54
+ pointerEvents?: 'all' | 'none' | 'box-only' | 'box-none'
55
+ onLayout?: (event: any) => void
56
+ nativeID?: string
57
+ testID?: string
58
+ dataSet?: Record<string, any>
59
+ accessibilityLabel?: string
60
+ accessibilityRole?: string
61
+ accessible?: boolean
53
62
  }
63
+
64
+ declare const Checkbox: ComponentType<CheckboxProps>
65
+
66
+ export { Checkbox }
@@ -0,0 +1,20 @@
1
+ import type { ComponentType, ReactNode } from 'react'
2
+
3
+ export interface CheckboxCardProps {
4
+ title?: string
5
+ children?: ReactNode | ((state: Record<string, any>) => ReactNode)
6
+ checked?: boolean
7
+ defaultChecked?: boolean
8
+ inactive?: boolean
9
+ id?: string
10
+ onChange?: (checked: boolean) => void
11
+ tokens?: Record<string, string | number | boolean | object>
12
+ variant?: Record<string, string | number | boolean | undefined>
13
+ testID?: string
14
+ dataSet?: Record<string, any>
15
+ accessibilityLabel?: string
16
+ }
17
+
18
+ declare const CheckboxCard: ComponentType<CheckboxCardProps>
19
+
20
+ export { CheckboxCard }
@@ -1,7 +1,7 @@
1
- import * as React from 'react'
1
+ import type { ComponentType } from 'react'
2
2
  import { Direction, ResponsiveDirection } from './Common'
3
3
 
4
- type CheckboxCardGroupProps = {
4
+ export type CheckboxCardGroupProps = {
5
5
  copy?: 'en' | 'fr'
6
6
  variant?: 'fullWidth'
7
7
  legend?: string
@@ -15,9 +15,11 @@ type CheckboxCardGroupProps = {
15
15
  onChange?: (checkedIds: string[]) => void
16
16
  readOnly?: boolean
17
17
  inactive?: boolean
18
+ items?: any[]
19
+ name?: string
18
20
  }
19
21
 
20
- type CheckboxCardGroupTokens = {
22
+ export type CheckboxCardGroupTokens = {
21
23
  borderBottomLeftRadius?: number
22
24
  borderBottomRightRadius?: number
23
25
  borderTopLeftRadius?: number
@@ -30,7 +32,7 @@ type CheckboxCardGroupTokens = {
30
32
  space?: number
31
33
  }
32
34
 
33
- type checkboxCardTokens = {
35
+ export type CheckboxCardTokens = {
34
36
  outerBorderColer?: string
35
37
  outerBorderWidth?: number
36
38
  outerBorderGap?: number
@@ -70,3 +72,7 @@ type checkboxCardTokens = {
70
72
  checkboxSpace?: number
71
73
  contentSpace?: number
72
74
  }
75
+
76
+ declare const CheckboxCardGroup: ComponentType<CheckboxCardGroupProps>
77
+
78
+ export { CheckboxCardGroup }
@@ -1,7 +1,8 @@
1
+ import type { ComponentType, ReactNode } from 'react'
1
2
  import { IconProps, IconPositionLeftRight } from './Icon'
2
3
  import { LinkAndTextButtonVariants } from './Link'
3
4
 
4
- type ChevronLinkTokens = {
5
+ export type ChevronLinkTokens = {
5
6
  fontSize?: number
6
7
  color?: string
7
8
  outerBorderColor?: string
@@ -24,9 +25,10 @@ type ChevronLinkTokens = {
24
25
  iconTranslateY?: number
25
26
  alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
26
27
  }
28
+
27
29
  export interface ChevronLinkProps {
28
30
  testID?: string
29
- children?: React.ReactNode
31
+ children?: ReactNode
30
32
  onPress?: () => void
31
33
  onPressIn?: () => void
32
34
  onPressOut?: () => void
@@ -38,6 +40,7 @@ export interface ChevronLinkProps {
38
40
  tokens?: ChevronLinkTokens
39
41
  direction?: IconPositionLeftRight
40
42
  variant?: LinkAndTextButtonVariants
43
+ dataSet?: Record<string, any>
41
44
  }
42
45
 
43
46
  export interface HrefProps {
@@ -45,3 +48,7 @@ export interface HrefProps {
45
48
  rel: string
46
49
  target: string
47
50
  }
51
+
52
+ declare const ChevronLink: ComponentType<ChevronLinkProps>
53
+
54
+ export { ChevronLink }
@@ -0,0 +1,16 @@
1
+ import type { ComponentType } from 'react'
2
+
3
+ export interface ColourToggleProps {
4
+ id?: string
5
+ colourHexCode?: string
6
+ colourName?: string
7
+ isSelected?: boolean
8
+ tokens?: Record<string, string | number | boolean | object>
9
+ onPress?: () => void
10
+ testID?: string
11
+ dataSet?: Record<string, any>
12
+ }
13
+
14
+ declare const ColourToggle: ComponentType<ColourToggleProps>
15
+
16
+ export { ColourToggle }
package/types/Common.d.ts CHANGED
@@ -72,7 +72,7 @@ export type SemanticTag =
72
72
  | 'section'
73
73
  | 'label'
74
74
 
75
- type headingType = {
75
+ export type headingType = {
76
76
  H1: 'h1'
77
77
  H2: 'h2'
78
78
  H3: 'h1'
@@ -81,7 +81,7 @@ type headingType = {
81
81
  H6: 'h2'
82
82
  }
83
83
 
84
- type tagType = {
84
+ export type tagType = {
85
85
  HEADING: headingType
86
86
  BLOCKQUOTE: 'blockquote'
87
87
  CODE: 'code'
@@ -93,7 +93,7 @@ type tagType = {
93
93
  LABEL: 'label'
94
94
  }
95
95
 
96
- type alignType = {
96
+ export type alignType = {
97
97
  AUTO: 'auto'
98
98
  LEFT: 'left'
99
99
  RIGHT: 'right'
@@ -104,3 +104,7 @@ type alignType = {
104
104
  export type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'
105
105
 
106
106
  export type FlexJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around'
107
+
108
+ export type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify'
109
+
110
+ export type Variant = Record<string, string | number | boolean | undefined>