@telus-uds/components-base 1.4.0 → 1.6.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 (110) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/.turbo/turbo-lint.log +13 -0
  3. package/CHANGELOG.json +140 -1
  4. package/CHANGELOG.md +42 -2
  5. package/__tests__/FlexGrid/Row.test.jsx +100 -25
  6. package/__tests__/utils/containUniqueFields.test.js +25 -0
  7. package/component-docs.json +94 -16
  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/HorizontalScroll/HorizontalScroll.js +0 -1
  18. package/lib/HorizontalScroll/HorizontalScrollButton.js +23 -49
  19. package/lib/InputLabel/InputLabel.js +27 -25
  20. package/lib/Link/LinkBase.js +19 -6
  21. package/lib/Link/TextButton.js +1 -10
  22. package/lib/Modal/Modal.js +18 -18
  23. package/lib/Radio/Radio.js +23 -12
  24. package/lib/Radio/RadioGroup.js +12 -3
  25. package/lib/RadioCard/RadioCard.js +1 -1
  26. package/lib/RadioCard/RadioCardGroup.js +11 -2
  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/utils/containUniqueFields.js +34 -0
  36. package/lib/utils/index.js +10 -1
  37. package/lib/utils/props/handlerProps.js +72 -0
  38. package/lib/utils/props/index.js +14 -0
  39. package/lib/utils/props/inputSupportsProps.js +3 -5
  40. package/lib/utils/props/linkProps.js +3 -7
  41. package/lib-module/Button/ButtonBase.js +2 -2
  42. package/lib-module/Button/ButtonGroup.js +15 -6
  43. package/lib-module/Card/PressableCardBase.js +2 -2
  44. package/lib-module/Checkbox/Checkbox.js +28 -17
  45. package/lib-module/Checkbox/CheckboxGroup.js +20 -7
  46. package/lib-module/ExpandCollapse/Panel.js +10 -10
  47. package/lib-module/FlexGrid/Col/Col.js +13 -3
  48. package/lib-module/FlexGrid/Row/Row.js +8 -2
  49. package/lib-module/HorizontalScroll/HorizontalScroll.js +0 -1
  50. package/lib-module/HorizontalScroll/HorizontalScrollButton.js +24 -49
  51. package/lib-module/InputLabel/InputLabel.js +28 -25
  52. package/lib-module/Link/LinkBase.js +19 -6
  53. package/lib-module/Link/TextButton.js +1 -10
  54. package/lib-module/Modal/Modal.js +19 -19
  55. package/lib-module/Radio/Radio.js +24 -13
  56. package/lib-module/Radio/RadioGroup.js +13 -4
  57. package/lib-module/RadioCard/RadioCard.js +2 -2
  58. package/lib-module/RadioCard/RadioCardGroup.js +12 -3
  59. package/lib-module/Select/Select.js +2 -3
  60. package/lib-module/Tags/Tags.js +18 -11
  61. package/lib-module/TextInput/TextArea.js +3 -3
  62. package/lib-module/TextInput/TextInput.js +11 -3
  63. package/lib-module/TextInput/TextInputBase.js +2 -2
  64. package/lib-module/TextInput/propTypes.js +7 -1
  65. package/lib-module/ToggleSwitch/ToggleSwitch.js +6 -3
  66. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +15 -6
  67. package/lib-module/utils/containUniqueFields.js +26 -0
  68. package/lib-module/utils/index.js +2 -1
  69. package/lib-module/utils/props/handlerProps.js +59 -0
  70. package/lib-module/utils/props/index.js +1 -0
  71. package/lib-module/utils/props/inputSupportsProps.js +3 -5
  72. package/lib-module/utils/props/linkProps.js +3 -7
  73. package/package.json +5 -5
  74. package/src/Button/ButtonBase.jsx +8 -2
  75. package/src/Button/ButtonGroup.jsx +51 -34
  76. package/src/Card/PressableCardBase.jsx +6 -1
  77. package/src/Checkbox/Checkbox.jsx +35 -23
  78. package/src/Checkbox/CheckboxGroup.jsx +52 -22
  79. package/src/ExpandCollapse/Panel.jsx +9 -9
  80. package/src/FlexGrid/Col/Col.jsx +11 -2
  81. package/src/FlexGrid/Row/Row.jsx +8 -2
  82. package/src/HorizontalScroll/HorizontalScroll.jsx +1 -1
  83. package/src/HorizontalScroll/HorizontalScrollButton.jsx +21 -58
  84. package/src/InputLabel/InputLabel.jsx +36 -27
  85. package/src/Link/LinkBase.jsx +20 -4
  86. package/src/Link/TextButton.jsx +1 -19
  87. package/src/Modal/Modal.jsx +30 -26
  88. package/src/Radio/Radio.jsx +26 -14
  89. package/src/Radio/RadioGroup.jsx +39 -21
  90. package/src/RadioCard/RadioCard.jsx +6 -1
  91. package/src/RadioCard/RadioCardGroup.jsx +17 -1
  92. package/src/Select/Select.jsx +2 -2
  93. package/src/Tags/Tags.jsx +23 -9
  94. package/src/TextInput/TextArea.jsx +5 -1
  95. package/src/TextInput/TextInput.jsx +13 -3
  96. package/src/TextInput/TextInputBase.jsx +6 -1
  97. package/src/TextInput/propTypes.js +7 -1
  98. package/src/ToggleSwitch/ToggleSwitch.jsx +11 -2
  99. package/src/ToggleSwitch/ToggleSwitchGroup.jsx +19 -6
  100. package/src/utils/containUniqueFields.js +32 -0
  101. package/src/utils/index.js +1 -0
  102. package/src/utils/props/handlerProps.js +47 -0
  103. package/src/utils/props/index.js +1 -0
  104. package/src/utils/props/inputSupportsProps.js +3 -4
  105. package/src/utils/props/linkProps.js +3 -6
  106. package/stories/InputLabel/InputLabel.stories.jsx +25 -28
  107. package/stories/Modal/Modal.stories.jsx +25 -0
  108. package/stories/Search/Search.stories.jsx +4 -1
  109. package/stories/TextInput/TextInput.stories.jsx +40 -2
  110. package/__tests__/Link/LinkBase.test.jsx +0 -22
@@ -1,8 +1,8 @@
1
- @telus-uds/components-base:build: cache hit, replaying output 875a557dac68c9fc
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 (7019ms).
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 (5391ms).
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 5b52d282f98ddfb3
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 217 files with Babel (4961ms).
6
+ @telus-uds/components-base:build: $ babel src -d lib-module --env-name module
7
+ @telus-uds/components-base:build: Successfully compiled 217 files with Babel (3447ms).
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 311834e1773df30e
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,146 @@
2
2
  "name": "@telus-uds/components-base",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 01 Apr 2022 14:15:14 GMT",
5
+ "date": "Fri, 06 May 2022 15:31:22 GMT",
6
+ "tag": "@telus-uds/components-base_v1.6.1",
7
+ "version": "1.6.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "alan.slater@nearform.com",
12
+ "package": "@telus-uds/components-base",
13
+ "commit": "d0967886e4328b789fd5490f068c74fa24379b87",
14
+ "comment": "don't throw if no href/onPress in link/button"
15
+ },
16
+ {
17
+ "author": "ruslan.bredikhin@nearform.com",
18
+ "package": "@telus-uds/components-base",
19
+ "commit": "d0967886e4328b789fd5490f068c74fa24379b87",
20
+ "comment": "fix: allow parsing tokens inherited from multiple components"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Thu, 28 Apr 2022 15:40:29 GMT",
27
+ "tag": "@telus-uds/components-base_v1.6.0",
28
+ "version": "1.6.0",
29
+ "comments": {
30
+ "minor": [
31
+ {
32
+ "author": "shahzaibkhalidmalik@outlook.com",
33
+ "package": "@telus-uds/components-base",
34
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
35
+ "comment": "Add `pattern` prop for `TextInput` (web)"
36
+ },
37
+ {
38
+ "author": "ruslan.bredikhin@nearform.com",
39
+ "package": "@telus-uds/components-base",
40
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
41
+ "comment": "feat: add unique ids validation to the group components"
42
+ },
43
+ {
44
+ "author": "eugene@michasiw.com",
45
+ "package": "@telus-uds/components-base",
46
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
47
+ "comment": "use IconButton for modal close"
48
+ },
49
+ {
50
+ "author": "alan.slater@nearform.com",
51
+ "package": "@telus-uds/components-base",
52
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
53
+ "comment": "Add flex prop to FlexGrid.Col"
54
+ },
55
+ {
56
+ "author": "ruslan.bredikhin@nearform.com",
57
+ "package": "@telus-uds/components-base",
58
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
59
+ "comment": "feat: add handler props whitelisting to the input components"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@telus-uds/components-base",
64
+ "comment": "Bump @telus-uds/system-theme-tokens to v1.5.0",
65
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5"
66
+ }
67
+ ],
68
+ "patch": [
69
+ {
70
+ "author": "alan.slater@nearform.com",
71
+ "package": "@telus-uds/components-base",
72
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
73
+ "comment": "V-align Checkbox/Radio with label first line"
74
+ },
75
+ {
76
+ "author": "shahzaibkhalidmalik@outlook.com",
77
+ "package": "@telus-uds/components-base",
78
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
79
+ "comment": "Fix ExpandCollapse unable to response to window resize"
80
+ },
81
+ {
82
+ "author": "ruslan.bredikhin@nearform.com",
83
+ "package": "@telus-uds/components-base",
84
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
85
+ "comment": "fix: move link underline to the inline pressable becoming the anchor tag on web"
86
+ },
87
+ {
88
+ "author": "shahzaibkhalidmalik@outlook.com",
89
+ "package": "@telus-uds/components-base",
90
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
91
+ "comment": "Fix scenario where `reverse` props might not work when elements wrap"
92
+ },
93
+ {
94
+ "author": "alan.slater@nearform.com",
95
+ "package": "@telus-uds/components-base",
96
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
97
+ "comment": "Fix input label text wrap"
98
+ },
99
+ {
100
+ "author": "alan.slater@nearform.com",
101
+ "package": "@telus-uds/components-base",
102
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
103
+ "comment": "fix Select validation icons"
104
+ }
105
+ ],
106
+ "none": [
107
+ {
108
+ "author": "simon.lawrence@nearform.com",
109
+ "package": "@telus-uds/components-base",
110
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
111
+ "comment": "update babel plugin used for docs generation to maintained fork"
112
+ },
113
+ {
114
+ "author": "cody.zuschlag@nearform.com",
115
+ "package": "@telus-uds/components-base",
116
+ "commit": "3db648cd2964f06f91e5d34140cb9f44ede740d5",
117
+ "comment": "improve linting"
118
+ }
119
+ ]
120
+ }
121
+ },
122
+ {
123
+ "date": "Thu, 07 Apr 2022 20:33:56 GMT",
124
+ "tag": "@telus-uds/components-base_v1.5.0",
125
+ "version": "1.5.0",
126
+ "comments": {
127
+ "minor": [
128
+ {
129
+ "author": "ruslan.bredikhin@nearform.com",
130
+ "package": "@telus-uds/components-base",
131
+ "commit": "63472330f9144ba99c34c7524dcc2d2f4f716e69",
132
+ "comment": "extend HorizontalScrollButton via IconButton"
133
+ },
134
+ {
135
+ "author": "beachball",
136
+ "package": "@telus-uds/components-base",
137
+ "comment": "Bump @telus-uds/system-theme-tokens to v1.4.0",
138
+ "commit": "63472330f9144ba99c34c7524dcc2d2f4f716e69"
139
+ }
140
+ ]
141
+ }
142
+ },
143
+ {
144
+ "date": "Fri, 01 Apr 2022 14:15:21 GMT",
6
145
  "tag": "@telus-uds/components-base_v1.4.0",
7
146
  "version": "1.4.0",
8
147
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,52 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 01 Apr 2022 14:15:14 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 06 May 2022 15:31:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.6.1
8
+
9
+ Fri, 06 May 2022 15:31:22 GMT
10
+
11
+ ### Patches
12
+
13
+ - don't throw if no href/onPress in link/button (alan.slater@nearform.com)
14
+ - fix: allow parsing tokens inherited from multiple components (ruslan.bredikhin@nearform.com)
15
+
16
+ ## 1.6.0
17
+
18
+ Thu, 28 Apr 2022 15:40:29 GMT
19
+
20
+ ### Minor changes
21
+
22
+ - Add `pattern` prop for `TextInput` (web) (shahzaibkhalidmalik@outlook.com)
23
+ - feat: add unique ids validation to the group components (ruslan.bredikhin@nearform.com)
24
+ - use IconButton for modal close (eugene@michasiw.com)
25
+ - Add flex prop to FlexGrid.Col (alan.slater@nearform.com)
26
+ - feat: add handler props whitelisting to the input components (ruslan.bredikhin@nearform.com)
27
+ - Bump @telus-uds/system-theme-tokens to v1.5.0
28
+
29
+ ### Patches
30
+
31
+ - V-align Checkbox/Radio with label first line (alan.slater@nearform.com)
32
+ - Fix ExpandCollapse unable to response to window resize (shahzaibkhalidmalik@outlook.com)
33
+ - fix: move link underline to the inline pressable becoming the anchor tag on web (ruslan.bredikhin@nearform.com)
34
+ - Fix scenario where `reverse` props might not work when elements wrap (shahzaibkhalidmalik@outlook.com)
35
+ - Fix input label text wrap (alan.slater@nearform.com)
36
+ - fix Select validation icons (alan.slater@nearform.com)
37
+
38
+ ## 1.5.0
39
+
40
+ Thu, 07 Apr 2022 20:33:56 GMT
41
+
42
+ ### Minor changes
43
+
44
+ - extend HorizontalScrollButton via IconButton (ruslan.bredikhin@nearform.com)
45
+ - Bump @telus-uds/system-theme-tokens to v1.4.0
46
+
7
47
  ## 1.4.0
8
48
 
9
- Fri, 01 Apr 2022 14:15:14 GMT
49
+ Fri, 01 Apr 2022 14:15:21 GMT
10
50
 
11
51
  ### Minor changes
12
52
 
@@ -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
+ })
@@ -172,14 +172,20 @@
172
172
  "iconGap": "size"
173
173
  },
174
174
  "HorizontalScrollButton": {
175
- "borderRadius": "radius",
176
175
  "backgroundColor": "color",
176
+ "borderRadius": "radius",
177
177
  "borderColor": "color",
178
178
  "borderWidth": "border",
179
- "padding": "size",
180
- "shadow": "shadow",
179
+ "iconColor": "color",
181
180
  "iconSize": "size",
182
- "iconColor": "color"
181
+ "iconScale": "iconScale",
182
+ "iconTranslateX": "size",
183
+ "iconTranslateY": "size",
184
+ "outerBorderWidth": "border",
185
+ "outerBorderColor": "color",
186
+ "outerBorderGap": "size",
187
+ "padding": "size",
188
+ "shadow": "shadow"
183
189
  },
184
190
  "Icon": {
185
191
  "size": "size",
@@ -277,7 +283,8 @@
277
283
  "paddingBottom": "size",
278
284
  "closeIcon": "icon",
279
285
  "closeIconColor": "color",
280
- "closeIconSize": "size"
286
+ "closeIconSize": "size",
287
+ "closePadding": "size"
281
288
  },
282
289
  "Notification": {
283
290
  "backgroundColor": "color",
@@ -3887,6 +3894,13 @@
3887
3894
  },
3888
3895
  "required": false,
3889
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)."
3890
3904
  }
3891
3905
  },
3892
3906
  "attributes": {
@@ -4751,7 +4765,8 @@
4751
4765
  "paddingBottom": "size",
4752
4766
  "closeIcon": "icon",
4753
4767
  "closeIconColor": "color",
4754
- "closeIconSize": "size"
4768
+ "closeIconSize": "size",
4769
+ "closePadding": "size"
4755
4770
  }
4756
4771
  },
4757
4772
  "required": false,
@@ -4777,6 +4792,13 @@
4777
4792
  },
4778
4793
  "required": false,
4779
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."
4780
4802
  }
4781
4803
  },
4782
4804
  "attributes": {
@@ -6969,14 +6991,20 @@
6969
6991
  "type": {
6970
6992
  "name": "custom",
6971
6993
  "raw": {
6972
- "borderRadius": "radius",
6973
6994
  "backgroundColor": "color",
6995
+ "borderRadius": "radius",
6974
6996
  "borderColor": "color",
6975
6997
  "borderWidth": "border",
6976
- "padding": "size",
6977
- "shadow": "shadow",
6998
+ "iconColor": "color",
6978
6999
  "iconSize": "size",
6979
- "iconColor": "color"
7000
+ "iconScale": "iconScale",
7001
+ "iconTranslateX": "size",
7002
+ "iconTranslateY": "size",
7003
+ "outerBorderWidth": "border",
7004
+ "outerBorderColor": "color",
7005
+ "outerBorderGap": "size",
7006
+ "padding": "size",
7007
+ "shadow": "shadow"
6980
7008
  }
6981
7009
  },
6982
7010
  "required": false,
@@ -8278,14 +8306,20 @@
8278
8306
  "type": {
8279
8307
  "name": "custom",
8280
8308
  "raw": {
8281
- "borderRadius": "radius",
8282
8309
  "backgroundColor": "color",
8310
+ "borderRadius": "radius",
8283
8311
  "borderColor": "color",
8284
8312
  "borderWidth": "border",
8285
- "padding": "size",
8286
- "shadow": "shadow",
8313
+ "iconColor": "color",
8287
8314
  "iconSize": "size",
8288
- "iconColor": "color"
8315
+ "iconScale": "iconScale",
8316
+ "iconTranslateX": "size",
8317
+ "iconTranslateY": "size",
8318
+ "outerBorderWidth": "border",
8319
+ "outerBorderColor": "color",
8320
+ "outerBorderGap": "size",
8321
+ "padding": "size",
8322
+ "shadow": "shadow"
8289
8323
  }
8290
8324
  },
8291
8325
  "required": false,
@@ -8475,7 +8509,29 @@
8475
8509
  "tokens": {
8476
8510
  "type": {
8477
8511
  "name": "custom",
8478
- "raw": "getTokensPropType('ChevronLink', 'Link')"
8512
+ "raw": {
8513
+ "leftIcon": "icon",
8514
+ "rightIcon": "icon",
8515
+ "iconDisplace": "size",
8516
+ "iconSize": "size",
8517
+ "iconSpace": "integer",
8518
+ "textLine": "textLine",
8519
+ "color": "color",
8520
+ "textLineStyle": "textLineStyle",
8521
+ "outerBorderColor": "color",
8522
+ "outerBorderWidth": "border",
8523
+ "outerBorderGap": "size",
8524
+ "outerBorderOutline": "borderStyle",
8525
+ "borderRadius": "radius",
8526
+ "blockFontName": "fontName",
8527
+ "blockFontWeight": "fontWeight",
8528
+ "blockFontSize": "fontSize",
8529
+ "blockLineHeight": "lineHeight",
8530
+ "icon": "icon",
8531
+ "iconTranslateX": "size",
8532
+ "iconTranslateY": "size",
8533
+ "alignSelf": "flexAlign"
8534
+ }
8479
8535
  },
8480
8536
  "required": false,
8481
8537
  "description": ""
@@ -9425,7 +9481,29 @@
9425
9481
  "tokens": {
9426
9482
  "type": {
9427
9483
  "name": "custom",
9428
- "raw": "getTokensPropType('TextArea', 'TextInput')"
9484
+ "raw": {
9485
+ "minLines": "integer",
9486
+ "maxLines": "integer",
9487
+ "backgroundColor": "color",
9488
+ "color": "color",
9489
+ "borderWidth": "border",
9490
+ "borderColor": "color",
9491
+ "borderRadius": "radius",
9492
+ "paddingTop": "size",
9493
+ "paddingBottom": "size",
9494
+ "paddingLeft": "size",
9495
+ "paddingRight": "size",
9496
+ "outerBackgroundColor": "color",
9497
+ "outerBorderWidth": "border",
9498
+ "outerBorderColor": "color",
9499
+ "fontName": "fontName",
9500
+ "fontWeight": "fontWeight",
9501
+ "fontSize": "fontSize",
9502
+ "lineHeight": "lineHeight",
9503
+ "icon": "icon",
9504
+ "iconSize": "size",
9505
+ "iconColor": "color"
9506
+ }
9429
9507
  },
9430
9508
  "required": false,
9431
9509
  "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,