@telus-uds/components-base 1.5.0 → 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.
Files changed (125) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +13 -0
  3. package/CHANGELOG.json +154 -1
  4. package/CHANGELOG.md +47 -2
  5. package/__tests__/FlexGrid/Row.test.jsx +100 -25
  6. package/__tests__/utils/containUniqueFields.test.js +25 -0
  7. package/component-docs.json +78 -26
  8. package/generate-component-docs.js +20 -7
  9. package/lib/Button/ButtonBase.js +1 -1
  10. package/lib/Button/ButtonGroup.js +20 -12
  11. package/lib/Card/PressableCardBase.js +1 -1
  12. package/lib/Checkbox/Checkbox.js +27 -16
  13. package/lib/Checkbox/CheckboxGroup.js +19 -5
  14. package/lib/ExpandCollapse/Panel.js +10 -10
  15. package/lib/FlexGrid/Col/Col.js +13 -3
  16. package/lib/FlexGrid/Row/Row.js +8 -2
  17. package/lib/InputLabel/InputLabel.js +27 -25
  18. package/lib/Link/LinkBase.js +19 -6
  19. package/lib/Link/TextButton.js +1 -10
  20. package/lib/List/ListItem.js +22 -12
  21. package/lib/Modal/Modal.js +18 -18
  22. package/lib/Radio/Radio.js +23 -12
  23. package/lib/Radio/RadioGroup.js +12 -3
  24. package/lib/RadioCard/RadioCard.js +1 -1
  25. package/lib/RadioCard/RadioCardGroup.js +11 -2
  26. package/lib/Search/Search.js +27 -19
  27. package/lib/Select/Select.js +2 -3
  28. package/lib/Tags/Tags.js +23 -17
  29. package/lib/TextInput/TextArea.js +2 -2
  30. package/lib/TextInput/TextInput.js +12 -2
  31. package/lib/TextInput/TextInputBase.js +1 -1
  32. package/lib/TextInput/propTypes.js +8 -1
  33. package/lib/ToggleSwitch/ToggleSwitch.js +5 -2
  34. package/lib/ToggleSwitch/ToggleSwitchGroup.js +20 -12
  35. package/lib/Typography/Typography.js +12 -10
  36. package/lib/index.js +22 -1
  37. package/lib/utils/containUniqueFields.js +34 -0
  38. package/lib/utils/index.js +10 -1
  39. package/lib/utils/input.js +5 -6
  40. package/lib/utils/props/handlerProps.js +72 -0
  41. package/lib/utils/props/index.js +32 -0
  42. package/lib/utils/props/inputSupportsProps.js +3 -5
  43. package/lib/utils/props/linkProps.js +3 -7
  44. package/lib/utils/props/textInputProps.js +206 -0
  45. package/lib/utils/props/textProps.js +72 -0
  46. package/lib-module/Button/ButtonBase.js +2 -2
  47. package/lib-module/Button/ButtonGroup.js +15 -6
  48. package/lib-module/Card/PressableCardBase.js +2 -2
  49. package/lib-module/Checkbox/Checkbox.js +28 -17
  50. package/lib-module/Checkbox/CheckboxGroup.js +20 -7
  51. package/lib-module/ExpandCollapse/Panel.js +10 -10
  52. package/lib-module/FlexGrid/Col/Col.js +13 -3
  53. package/lib-module/FlexGrid/Row/Row.js +8 -2
  54. package/lib-module/InputLabel/InputLabel.js +28 -25
  55. package/lib-module/Link/LinkBase.js +19 -6
  56. package/lib-module/Link/TextButton.js +1 -10
  57. package/lib-module/List/ListItem.js +22 -12
  58. package/lib-module/Modal/Modal.js +19 -19
  59. package/lib-module/Radio/Radio.js +24 -13
  60. package/lib-module/Radio/RadioGroup.js +13 -4
  61. package/lib-module/RadioCard/RadioCard.js +2 -2
  62. package/lib-module/RadioCard/RadioCardGroup.js +12 -3
  63. package/lib-module/Search/Search.js +29 -21
  64. package/lib-module/Select/Select.js +2 -3
  65. package/lib-module/Tags/Tags.js +18 -11
  66. package/lib-module/TextInput/TextArea.js +3 -3
  67. package/lib-module/TextInput/TextInput.js +11 -3
  68. package/lib-module/TextInput/TextInputBase.js +2 -2
  69. package/lib-module/TextInput/propTypes.js +7 -1
  70. package/lib-module/ToggleSwitch/ToggleSwitch.js +6 -3
  71. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +15 -6
  72. package/lib-module/Typography/Typography.js +13 -11
  73. package/lib-module/index.js +1 -1
  74. package/lib-module/utils/containUniqueFields.js +26 -0
  75. package/lib-module/utils/index.js +2 -1
  76. package/lib-module/utils/input.js +6 -6
  77. package/lib-module/utils/props/handlerProps.js +59 -0
  78. package/lib-module/utils/props/index.js +3 -0
  79. package/lib-module/utils/props/inputSupportsProps.js +3 -5
  80. package/lib-module/utils/props/linkProps.js +3 -7
  81. package/lib-module/utils/props/textInputProps.js +193 -0
  82. package/lib-module/utils/props/textProps.js +59 -0
  83. package/package.json +5 -5
  84. package/src/Button/ButtonBase.jsx +8 -2
  85. package/src/Button/ButtonGroup.jsx +51 -34
  86. package/src/Card/PressableCardBase.jsx +6 -1
  87. package/src/Checkbox/Checkbox.jsx +35 -23
  88. package/src/Checkbox/CheckboxGroup.jsx +52 -22
  89. package/src/ExpandCollapse/Panel.jsx +9 -9
  90. package/src/FlexGrid/Col/Col.jsx +11 -2
  91. package/src/FlexGrid/Row/Row.jsx +8 -2
  92. package/src/InputLabel/InputLabel.jsx +36 -27
  93. package/src/Link/LinkBase.jsx +20 -4
  94. package/src/Link/TextButton.jsx +1 -19
  95. package/src/List/ListItem.jsx +17 -9
  96. package/src/Modal/Modal.jsx +30 -26
  97. package/src/Radio/Radio.jsx +26 -14
  98. package/src/Radio/RadioGroup.jsx +39 -21
  99. package/src/RadioCard/RadioCard.jsx +6 -1
  100. package/src/RadioCard/RadioCardGroup.jsx +17 -1
  101. package/src/Search/Search.jsx +33 -21
  102. package/src/Select/Select.jsx +2 -2
  103. package/src/Tags/Tags.jsx +23 -9
  104. package/src/TextInput/TextArea.jsx +7 -1
  105. package/src/TextInput/TextInput.jsx +15 -3
  106. package/src/TextInput/TextInputBase.jsx +8 -1
  107. package/src/TextInput/propTypes.js +7 -1
  108. package/src/ToggleSwitch/ToggleSwitch.jsx +11 -2
  109. package/src/ToggleSwitch/ToggleSwitchGroup.jsx +19 -6
  110. package/src/Typography/Typography.jsx +13 -9
  111. package/src/index.js +4 -1
  112. package/src/utils/containUniqueFields.js +32 -0
  113. package/src/utils/index.js +1 -0
  114. package/src/utils/input.js +5 -7
  115. package/src/utils/props/handlerProps.js +47 -0
  116. package/src/utils/props/index.js +3 -0
  117. package/src/utils/props/inputSupportsProps.js +3 -4
  118. package/src/utils/props/linkProps.js +3 -6
  119. package/src/utils/props/textInputProps.js +177 -0
  120. package/src/utils/props/textProps.js +58 -0
  121. package/stories/InputLabel/InputLabel.stories.jsx +25 -28
  122. package/stories/Modal/Modal.stories.jsx +25 -0
  123. package/stories/Search/Search.stories.jsx +53 -3
  124. package/stories/TextInput/TextInput.stories.jsx +40 -2
  125. package/__tests__/Link/LinkBase.test.jsx +0 -22
@@ -1,8 +1,8 @@
1
- @telus-uds/components-base:build: cache hit, replaying output 6a69e9bf21c07998
2
- @telus-uds/components-base:build: $ yarn build:code && yarn build:docs
3
- @telus-uds/components-base:build: $ yarn build:main && yarn build:module
4
- @telus-uds/components-base:build: $ babel src -d lib
5
- @telus-uds/components-base:build: Successfully compiled 215 files with Babel (4882ms).
6
- @telus-uds/components-base:build: $ babel src -d lib-module --env-name module
7
- @telus-uds/components-base:build: Successfully compiled 215 files with Babel (3426ms).
8
- @telus-uds/components-base:build: $ babel-node --plugins=react-docgen-alpha generate-component-docs.js
1
+ @telus-uds/components-base:build: cache hit, replaying output 1881992cce187510
2
+ @telus-uds/components-base:build: $ yarn build:code && yarn build:docs
3
+ @telus-uds/components-base:build: $ yarn build:main && yarn build:module
4
+ @telus-uds/components-base:build: $ babel src -d lib
5
+ @telus-uds/components-base:build: Successfully compiled 219 files with Babel (6264ms).
6
+ @telus-uds/components-base:build: $ babel src -d lib-module --env-name module
7
+ @telus-uds/components-base:build: Successfully compiled 219 files with Babel (4314ms).
8
+ @telus-uds/components-base:build: $ babel-node --plugins=@nearform/babel-plugin-react-docgen generate-component-docs.js
@@ -0,0 +1,13 @@
1
+ @telus-uds/components-base:lint: cache hit, replaying output b72941df2cdfe4ea
2
+ @telus-uds/components-base:lint: $ yarn --cwd ../.. lint:path --color packages/components-base
3
+ @telus-uds/components-base:lint: $ eslint --ignore-path .gitignore --ext .js,.jsx,.mjs,.cjs --color packages/components-base
4
+ @telus-uds/components-base:lint: 
5
+ @telus-uds/components-base:lint: /home/runner/work/universal-design-system/universal-design-system/packages/components-base/__tests__/FlexGrid/Col.test.jsx
6
+ @telus-uds/components-base:lint:  51:71 warning Expect must have a corresponding matcher call jest/valid-expect
7
+ @telus-uds/components-base:lint:  106:71 warning Expect must have a corresponding matcher call jest/valid-expect
8
+ @telus-uds/components-base:lint:  155:63 warning Expect must have a corresponding matcher call jest/valid-expect
9
+ @telus-uds/components-base:lint:  200:71 warning Expect must have a corresponding matcher call jest/valid-expect
10
+ @telus-uds/components-base:lint:  248:71 warning Expect must have a corresponding matcher call jest/valid-expect
11
+ @telus-uds/components-base:lint: 
12
+ @telus-uds/components-base:lint: ✖ 5 problems (0 errors, 5 warnings)
13
+ @telus-uds/components-base:lint: 
package/CHANGELOG.json CHANGED
@@ -2,7 +2,160 @@
2
2
  "name": "@telus-uds/components-base",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 07 Apr 2022 20:33:50 GMT",
5
+ "date": "Tue, 17 May 2022 15:04:41 GMT",
6
+ "tag": "@telus-uds/components-base_v1.7.0",
7
+ "version": "1.7.0",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "alan.slater@nearform.com",
12
+ "package": "@telus-uds/components-base",
13
+ "commit": "70105ac8b165247e3cd29a78e3247f7a475b287a",
14
+ "comment": "align List bullets like icons"
15
+ },
16
+ {
17
+ "author": "alan.slater@nearform.com",
18
+ "package": "@telus-uds/components-base",
19
+ "commit": "70105ac8b165247e3cd29a78e3247f7a475b287a",
20
+ "comment": "Add text props to Typography"
21
+ },
22
+ {
23
+ "author": "alan.slater@nearform.com",
24
+ "package": "@telus-uds/components-base",
25
+ "commit": "70105ac8b165247e3cd29a78e3247f7a475b287a",
26
+ "comment": "fix(components): support TextInput props"
27
+ }
28
+ ],
29
+ "minor": [
30
+ {
31
+ "author": "alan.slater@nearform.com",
32
+ "package": "@telus-uds/components-base",
33
+ "commit": "70105ac8b165247e3cd29a78e3247f7a475b287a",
34
+ "comment": "Allow Search component to be controlled"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "date": "Fri, 06 May 2022 15:31:28 GMT",
41
+ "tag": "@telus-uds/components-base_v1.6.1",
42
+ "version": "1.6.1",
43
+ "comments": {
44
+ "patch": [
45
+ {
46
+ "author": "alan.slater@nearform.com",
47
+ "package": "@telus-uds/components-base",
48
+ "commit": "d0967886e4328b789fd5490f068c74fa24379b87",
49
+ "comment": "don't throw if no href/onPress in link/button"
50
+ },
51
+ {
52
+ "author": "ruslan.bredikhin@nearform.com",
53
+ "package": "@telus-uds/components-base",
54
+ "commit": "d0967886e4328b789fd5490f068c74fa24379b87",
55
+ "comment": "fix: allow parsing tokens inherited from multiple components"
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "date": "Thu, 28 Apr 2022 15:40:29 GMT",
62
+ "tag": "@telus-uds/components-base_v1.6.0",
63
+ "version": "1.6.0",
64
+ "comments": {
65
+ "minor": [
66
+ {
67
+ "author": "shahzaibkhalidmalik@outlook.com",
68
+ "package": "@telus-uds/components-base",
69
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
70
+ "comment": "Add `pattern` prop for `TextInput` (web)"
71
+ },
72
+ {
73
+ "author": "ruslan.bredikhin@nearform.com",
74
+ "package": "@telus-uds/components-base",
75
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
76
+ "comment": "feat: add unique ids validation to the group components"
77
+ },
78
+ {
79
+ "author": "eugene@michasiw.com",
80
+ "package": "@telus-uds/components-base",
81
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
82
+ "comment": "use IconButton for modal close"
83
+ },
84
+ {
85
+ "author": "alan.slater@nearform.com",
86
+ "package": "@telus-uds/components-base",
87
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
88
+ "comment": "Add flex prop to FlexGrid.Col"
89
+ },
90
+ {
91
+ "author": "ruslan.bredikhin@nearform.com",
92
+ "package": "@telus-uds/components-base",
93
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
94
+ "comment": "feat: add handler props whitelisting to the input components"
95
+ },
96
+ {
97
+ "author": "beachball",
98
+ "package": "@telus-uds/components-base",
99
+ "comment": "Bump @telus-uds/system-theme-tokens to v1.5.0",
100
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5"
101
+ }
102
+ ],
103
+ "patch": [
104
+ {
105
+ "author": "alan.slater@nearform.com",
106
+ "package": "@telus-uds/components-base",
107
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
108
+ "comment": "V-align Checkbox/Radio with label first line"
109
+ },
110
+ {
111
+ "author": "shahzaibkhalidmalik@outlook.com",
112
+ "package": "@telus-uds/components-base",
113
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
114
+ "comment": "Fix ExpandCollapse unable to response to window resize"
115
+ },
116
+ {
117
+ "author": "ruslan.bredikhin@nearform.com",
118
+ "package": "@telus-uds/components-base",
119
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
120
+ "comment": "fix: move link underline to the inline pressable becoming the anchor tag on web"
121
+ },
122
+ {
123
+ "author": "shahzaibkhalidmalik@outlook.com",
124
+ "package": "@telus-uds/components-base",
125
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
126
+ "comment": "Fix scenario where `reverse` props might not work when elements wrap"
127
+ },
128
+ {
129
+ "author": "alan.slater@nearform.com",
130
+ "package": "@telus-uds/components-base",
131
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
132
+ "comment": "Fix input label text wrap"
133
+ },
134
+ {
135
+ "author": "alan.slater@nearform.com",
136
+ "package": "@telus-uds/components-base",
137
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
138
+ "comment": "fix Select validation icons"
139
+ }
140
+ ],
141
+ "none": [
142
+ {
143
+ "author": "simon.lawrence@nearform.com",
144
+ "package": "@telus-uds/components-base",
145
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
146
+ "comment": "update babel plugin used for docs generation to maintained fork"
147
+ },
148
+ {
149
+ "author": "cody.zuschlag@nearform.com",
150
+ "package": "@telus-uds/components-base",
151
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
152
+ "comment": "improve linting"
153
+ }
154
+ ]
155
+ }
156
+ },
157
+ {
158
+ "date": "Thu, 07 Apr 2022 20:33:56 GMT",
6
159
  "tag": "@telus-uds/components-base_v1.5.0",
7
160
  "version": "1.5.0",
8
161
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,57 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Thu, 07 Apr 2022 20:33:50 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 17 May 2022 15:04:41 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.7.0
8
+
9
+ Tue, 17 May 2022 15:04:41 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Allow Search component to be controlled (alan.slater@nearform.com)
14
+
15
+ ### Patches
16
+
17
+ - align List bullets like icons (alan.slater@nearform.com)
18
+ - Add text props to Typography (alan.slater@nearform.com)
19
+ - fix(components): support TextInput props (alan.slater@nearform.com)
20
+
21
+ ## 1.6.1
22
+
23
+ Fri, 06 May 2022 15:31:28 GMT
24
+
25
+ ### Patches
26
+
27
+ - don't throw if no href/onPress in link/button (alan.slater@nearform.com)
28
+ - fix: allow parsing tokens inherited from multiple components (ruslan.bredikhin@nearform.com)
29
+
30
+ ## 1.6.0
31
+
32
+ Thu, 28 Apr 2022 15:40:29 GMT
33
+
34
+ ### Minor changes
35
+
36
+ - Add `pattern` prop for `TextInput` (web) (shahzaibkhalidmalik@outlook.com)
37
+ - feat: add unique ids validation to the group components (ruslan.bredikhin@nearform.com)
38
+ - use IconButton for modal close (eugene@michasiw.com)
39
+ - Add flex prop to FlexGrid.Col (alan.slater@nearform.com)
40
+ - feat: add handler props whitelisting to the input components (ruslan.bredikhin@nearform.com)
41
+ - Bump @telus-uds/system-theme-tokens to v1.5.0
42
+
43
+ ### Patches
44
+
45
+ - V-align Checkbox/Radio with label first line (alan.slater@nearform.com)
46
+ - Fix ExpandCollapse unable to response to window resize (shahzaibkhalidmalik@outlook.com)
47
+ - fix: move link underline to the inline pressable becoming the anchor tag on web (ruslan.bredikhin@nearform.com)
48
+ - Fix scenario where `reverse` props might not work when elements wrap (shahzaibkhalidmalik@outlook.com)
49
+ - Fix input label text wrap (alan.slater@nearform.com)
50
+ - fix Select validation icons (alan.slater@nearform.com)
51
+
7
52
  ## 1.5.0
8
53
 
9
- Thu, 07 Apr 2022 20:33:50 GMT
54
+ Thu, 07 Apr 2022 20:33:56 GMT
10
55
 
11
56
  ### Minor changes
12
57
 
@@ -151,48 +151,123 @@ describe('FlexGrid Row', () => {
151
151
 
152
152
  it('applies correct row order for each reverse prop at viewport "xs"', () => {
153
153
  const { getByText } = renderEachReverseProp('xs')
154
- expect(getByText('xs--xsReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
155
- expect(getByText('xs--smReverse').parent).toHaveStyle({ flexDirection: 'row' })
156
- expect(getByText('xs--mdReverse').parent).toHaveStyle({ flexDirection: 'row' })
157
- expect(getByText('xs--lgReverse').parent).toHaveStyle({ flexDirection: 'row' })
158
- expect(getByText('xs--xlReverse').parent).toHaveStyle({ flexDirection: 'row' })
154
+ expect(getByText('xs--xsReverse').parent).toHaveStyle({
155
+ flexDirection: 'row-reverse',
156
+ flexWrap: 'wrap-reverse'
157
+ })
158
+ expect(getByText('xs--smReverse').parent).toHaveStyle({
159
+ flexDirection: 'row',
160
+ flexWrap: 'wrap'
161
+ })
162
+ expect(getByText('xs--mdReverse').parent).toHaveStyle({
163
+ flexDirection: 'row',
164
+ flexWrap: 'wrap'
165
+ })
166
+ expect(getByText('xs--lgReverse').parent).toHaveStyle({
167
+ flexDirection: 'row',
168
+ flexWrap: 'wrap'
169
+ })
170
+ expect(getByText('xs--xlReverse').parent).toHaveStyle({
171
+ flexDirection: 'row',
172
+ flexWrap: 'wrap'
173
+ })
159
174
  })
160
175
 
161
176
  it('applies correct row order for each reverse prop at viewport "sm"', () => {
162
177
  const { getByText } = renderEachReverseProp('sm')
163
- expect(getByText('sm--xsReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
164
- expect(getByText('sm--smReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
165
- expect(getByText('sm--mdReverse').parent).toHaveStyle({ flexDirection: 'row' })
166
- expect(getByText('sm--lgReverse').parent).toHaveStyle({ flexDirection: 'row' })
167
- expect(getByText('sm--xlReverse').parent).toHaveStyle({ flexDirection: 'row' })
178
+ expect(getByText('sm--xsReverse').parent).toHaveStyle({
179
+ flexDirection: 'row-reverse',
180
+ flexWrap: 'wrap-reverse'
181
+ })
182
+ expect(getByText('sm--smReverse').parent).toHaveStyle({
183
+ flexDirection: 'row-reverse',
184
+ flexWrap: 'wrap-reverse'
185
+ })
186
+ expect(getByText('sm--mdReverse').parent).toHaveStyle({
187
+ flexDirection: 'row',
188
+ flexWrap: 'wrap'
189
+ })
190
+ expect(getByText('sm--lgReverse').parent).toHaveStyle({
191
+ flexDirection: 'row',
192
+ flexWrap: 'wrap'
193
+ })
194
+ expect(getByText('sm--xlReverse').parent).toHaveStyle({
195
+ flexDirection: 'row',
196
+ flexWrap: 'wrap'
197
+ })
168
198
  })
169
199
 
170
200
  it('applies correct row order for each reverse prop at viewport "md"', () => {
171
201
  const { getByText } = renderEachReverseProp('md')
172
- expect(getByText('md--xsReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
173
- expect(getByText('md--smReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
174
- expect(getByText('md--mdReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
175
- expect(getByText('md--lgReverse').parent).toHaveStyle({ flexDirection: 'row' })
176
- expect(getByText('md--xlReverse').parent).toHaveStyle({ flexDirection: 'row' })
202
+ expect(getByText('md--xsReverse').parent).toHaveStyle({
203
+ flexDirection: 'row-reverse',
204
+ flexWrap: 'wrap-reverse'
205
+ })
206
+ expect(getByText('md--smReverse').parent).toHaveStyle({
207
+ flexDirection: 'row-reverse',
208
+ flexWrap: 'wrap-reverse'
209
+ })
210
+ expect(getByText('md--mdReverse').parent).toHaveStyle({
211
+ flexDirection: 'row-reverse',
212
+ flexWrap: 'wrap-reverse'
213
+ })
214
+ expect(getByText('md--lgReverse').parent).toHaveStyle({
215
+ flexDirection: 'row',
216
+ flexWrap: 'wrap'
217
+ })
218
+ expect(getByText('md--xlReverse').parent).toHaveStyle({
219
+ flexDirection: 'row',
220
+ flexWrap: 'wrap'
221
+ })
177
222
  })
178
223
 
179
224
  it('applies correct row order for each reverse prop at viewport "lg"', () => {
180
225
  const { getByText } = renderEachReverseProp('lg')
181
226
 
182
- expect(getByText('lg--xsReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
183
- expect(getByText('lg--smReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
184
- expect(getByText('lg--mdReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
185
- expect(getByText('lg--lgReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
186
- expect(getByText('lg--xlReverse').parent).toHaveStyle({ flexDirection: 'row' })
227
+ expect(getByText('lg--xsReverse').parent).toHaveStyle({
228
+ flexDirection: 'row-reverse',
229
+ flexWrap: 'wrap-reverse'
230
+ })
231
+ expect(getByText('lg--smReverse').parent).toHaveStyle({
232
+ flexDirection: 'row-reverse',
233
+ flexWrap: 'wrap-reverse'
234
+ })
235
+ expect(getByText('lg--mdReverse').parent).toHaveStyle({
236
+ flexDirection: 'row-reverse',
237
+ flexWrap: 'wrap-reverse'
238
+ })
239
+ expect(getByText('lg--lgReverse').parent).toHaveStyle({
240
+ flexDirection: 'row-reverse',
241
+ flexWrap: 'wrap-reverse'
242
+ })
243
+ expect(getByText('lg--xlReverse').parent).toHaveStyle({
244
+ flexDirection: 'row',
245
+ flexWrap: 'wrap'
246
+ })
187
247
  })
188
248
 
189
249
  it('applies correct row order for each reverse prop at viewport "xl"', () => {
190
250
  const { getByText } = renderEachReverseProp('xl')
191
251
 
192
- expect(getByText('xl--xsReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
193
- expect(getByText('xl--smReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
194
- expect(getByText('xl--mdReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
195
- expect(getByText('xl--lgReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
196
- expect(getByText('xl--xlReverse').parent).toHaveStyle({ flexDirection: 'row-reverse' })
252
+ expect(getByText('xl--xsReverse').parent).toHaveStyle({
253
+ flexDirection: 'row-reverse',
254
+ flexWrap: 'wrap-reverse'
255
+ })
256
+ expect(getByText('xl--smReverse').parent).toHaveStyle({
257
+ flexDirection: 'row-reverse',
258
+ flexWrap: 'wrap-reverse'
259
+ })
260
+ expect(getByText('xl--mdReverse').parent).toHaveStyle({
261
+ flexDirection: 'row-reverse',
262
+ flexWrap: 'wrap-reverse'
263
+ })
264
+ expect(getByText('xl--lgReverse').parent).toHaveStyle({
265
+ flexDirection: 'row-reverse',
266
+ flexWrap: 'wrap-reverse'
267
+ })
268
+ expect(getByText('xl--xlReverse').parent).toHaveStyle({
269
+ flexDirection: 'row-reverse',
270
+ flexWrap: 'wrap-reverse'
271
+ })
197
272
  })
198
273
  })
@@ -0,0 +1,25 @@
1
+ import { containUniqueFields } from '../../src'
2
+
3
+ const unique = [
4
+ { a: 1, b: 'B' },
5
+ { a: 2, b: 'A' }
6
+ ]
7
+
8
+ const notUnique = [
9
+ { a: 1, b: 'B' },
10
+ { a: 1, b: 'A' }
11
+ ]
12
+
13
+ describe('containUniqueFields util', () => {
14
+ it('returns true if no specified fields have duplicates', () => {
15
+ expect(containUniqueFields(unique, ['a', 'b'])).toBe(true)
16
+ })
17
+
18
+ it('returns false if specified fields have duplicates', () => {
19
+ expect(containUniqueFields(notUnique, ['a'])).toBe(false)
20
+ })
21
+
22
+ it('returns false if fields have duplicates, but not the specified ones', () => {
23
+ expect(containUniqueFields(notUnique, ['b'])).toBe(true)
24
+ })
25
+ })
@@ -283,7 +283,8 @@
283
283
  "paddingBottom": "size",
284
284
  "closeIcon": "icon",
285
285
  "closeIconColor": "color",
286
- "closeIconSize": "size"
286
+ "closeIconSize": "size",
287
+ "closePadding": "size"
287
288
  },
288
289
  "Notification": {
289
290
  "backgroundColor": "color",
@@ -3893,6 +3894,13 @@
3893
3894
  },
3894
3895
  "required": false,
3895
3896
  "description": "Align content horizontally within the column.\n\nAccepts a `PropType.string` following the [responsive prop](#/Layout?id=responsive) structure."
3897
+ },
3898
+ "flex": {
3899
+ "type": {
3900
+ "name": "bool"
3901
+ },
3902
+ "required": false,
3903
+ "description": "(web only) Stretches the column to fill vertical space using `display: flex`.\nIn native apps, FlexGrid.Col behaves as if this is always true (as do all `View`s)."
3896
3904
  }
3897
3905
  },
3898
3906
  "attributes": {
@@ -4757,7 +4765,8 @@
4757
4765
  "paddingBottom": "size",
4758
4766
  "closeIcon": "icon",
4759
4767
  "closeIconColor": "color",
4760
- "closeIconSize": "size"
4768
+ "closeIconSize": "size",
4769
+ "closePadding": "size"
4761
4770
  }
4762
4771
  },
4763
4772
  "required": false,
@@ -4783,6 +4792,13 @@
4783
4792
  },
4784
4793
  "required": false,
4785
4794
  "description": ""
4795
+ },
4796
+ "closeButton": {
4797
+ "type": {
4798
+ "name": "node"
4799
+ },
4800
+ "required": false,
4801
+ "description": "Pass a react node to override the default close button or pass `null` to hide the close button."
4786
4802
  }
4787
4803
  },
4788
4804
  "attributes": {
@@ -5685,28 +5701,6 @@
5685
5701
  "docs": {
5686
5702
  "description": "The `Search` component is a combination of a `TextInput` and 2 different kinds of custom buttons.\nUse `Search` to feature autocomplete interactions.\n\nThis component includes a clear button, which will appear as text is entered and pressing it will\ncause the input's internal state value to be set to an empty string.\n\nThis component may only be used as uncontrolled, as the search value is managed within an internal state.\nYou can use the `onChange` prop to react to value changes and the `onSubmit` prop to react on search submission.\n\nUse the following props to supply additional accessibility labels for the input - `accessibilityLabel`,\nclear button - `clearButtonAccessibilityLabel`, and submit button - `submitButtonAccessibilityLabel`.",
5687
5703
  "props": {
5688
- "initialValue": {
5689
- "defaultValue": {
5690
- "value": "''",
5691
- "computed": false
5692
- },
5693
- "type": {
5694
- "name": "string"
5695
- },
5696
- "required": false,
5697
- "description": "Use this to set the initial value of the search input.\nUpdating `initialValue` will **not** update the actual value."
5698
- },
5699
- "placeholder": {
5700
- "defaultValue": {
5701
- "value": "'Search'",
5702
- "computed": false
5703
- },
5704
- "type": {
5705
- "name": "string"
5706
- },
5707
- "required": false,
5708
- "description": "Label rendered in the search input when it has no value."
5709
- },
5710
5704
  "copy": {
5711
5705
  "defaultValue": {
5712
5706
  "value": "'en'",
@@ -5750,6 +5744,20 @@
5750
5744
  "required": false,
5751
5745
  "description": "Select english or french copy for the accessible labels.\nYou may also pass in a custom dictionary object."
5752
5746
  },
5747
+ "initialValue": {
5748
+ "type": {
5749
+ "name": "string"
5750
+ },
5751
+ "required": false,
5752
+ "description": "Use this to set the initial value of the search input.\nUpdating `initialValue` will **not** update the actual value."
5753
+ },
5754
+ "placeholder": {
5755
+ "type": {
5756
+ "name": "string"
5757
+ },
5758
+ "required": false,
5759
+ "description": "Label rendered in the search input when it has no value."
5760
+ },
5753
5761
  "inactive": {
5754
5762
  "type": {
5755
5763
  "name": "bool"
@@ -8493,7 +8501,29 @@
8493
8501
  "tokens": {
8494
8502
  "type": {
8495
8503
  "name": "custom",
8496
- "raw": "getTokensPropType('ChevronLink', 'Link')"
8504
+ "raw": {
8505
+ "leftIcon": "icon",
8506
+ "rightIcon": "icon",
8507
+ "iconDisplace": "size",
8508
+ "iconSize": "size",
8509
+ "iconSpace": "integer",
8510
+ "textLine": "textLine",
8511
+ "color": "color",
8512
+ "textLineStyle": "textLineStyle",
8513
+ "outerBorderColor": "color",
8514
+ "outerBorderWidth": "border",
8515
+ "outerBorderGap": "size",
8516
+ "outerBorderOutline": "borderStyle",
8517
+ "borderRadius": "radius",
8518
+ "blockFontName": "fontName",
8519
+ "blockFontWeight": "fontWeight",
8520
+ "blockFontSize": "fontSize",
8521
+ "blockLineHeight": "lineHeight",
8522
+ "icon": "icon",
8523
+ "iconTranslateX": "size",
8524
+ "iconTranslateY": "size",
8525
+ "alignSelf": "flexAlign"
8526
+ }
8497
8527
  },
8498
8528
  "required": false,
8499
8529
  "description": ""
@@ -9443,7 +9473,29 @@
9443
9473
  "tokens": {
9444
9474
  "type": {
9445
9475
  "name": "custom",
9446
- "raw": "getTokensPropType('TextArea', 'TextInput')"
9476
+ "raw": {
9477
+ "minLines": "integer",
9478
+ "maxLines": "integer",
9479
+ "backgroundColor": "color",
9480
+ "color": "color",
9481
+ "borderWidth": "border",
9482
+ "borderColor": "color",
9483
+ "borderRadius": "radius",
9484
+ "paddingTop": "size",
9485
+ "paddingBottom": "size",
9486
+ "paddingLeft": "size",
9487
+ "paddingRight": "size",
9488
+ "outerBackgroundColor": "color",
9489
+ "outerBorderWidth": "border",
9490
+ "outerBorderColor": "color",
9491
+ "fontName": "fontName",
9492
+ "fontWeight": "fontWeight",
9493
+ "fontSize": "fontSize",
9494
+ "lineHeight": "lineHeight",
9495
+ "icon": "icon",
9496
+ "iconSize": "size",
9497
+ "iconColor": "color"
9498
+ }
9447
9499
  },
9448
9500
  "required": false,
9449
9501
  "description": ""
@@ -23,13 +23,26 @@ const parseComponentDocs = (name, generated) => {
23
23
 
24
24
  const out = { ...prop }
25
25
 
26
- // check if this prop references the tokens schema
27
- const tokensProp = out.type?.raw?.match(/getTokensPropType\('([A-z]+)'\)/)?.[1]
28
- if (tokensProp) {
29
- if (!schema.components[tokensProp]) {
30
- throw new Error(`Unknown schema component reference: ${tokensProp} from component: ${name}`)
31
- }
32
- out.type = { ...out.type, raw: schema.components[tokensProp] }
26
+ // check if this prop references the tokens schema;
27
+ // this regex extracts unquoted parameter strings from function
28
+ // calls like `getTokensPropType('ChevronLink', 'Link')` with the result
29
+ // being an array: `['ChevronLink', 'Link']`
30
+ const tokensProp = out.type?.raw?.match(/(?<=getTokensPropType\(.*)(\w+)+(?=.*\))/gs)
31
+
32
+ // if so, try and read the schema from the base components
33
+ if (tokensProp && tokensProp.length > 0) {
34
+ let raw = {}
35
+
36
+ tokensProp.forEach((componentName) => {
37
+ if (!schema.components[componentName]) {
38
+ // this would be a run-time error in the base components
39
+ throw new Error(
40
+ `Unknown schema component reference: ${componentName} from component: ${name}`
41
+ )
42
+ }
43
+ raw = { ...raw, ...schema.components[componentName] }
44
+ })
45
+ out.type = { ...out.type, raw }
33
46
  }
34
47
  props[propName] = out
35
48
  })
@@ -31,7 +31,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
31
 
32
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
33
 
34
- const [selectProps, selectedSystemPropTypes] = (0, _utils2.selectSystemProps)([_utils2.a11yProps, _utils2.linkProps, _utils2.viewProps]);
34
+ const [selectProps, selectedSystemPropTypes] = (0, _utils2.selectSystemProps)([_utils2.a11yProps, _utils2.focusHandlerProps, _utils2.linkProps, _utils2.viewProps]);
35
35
 
36
36
  const getOuterBorderOffset = ({
37
37
  outerBorderGap = 0,