@occmundial/occ-atomic 2.0.0-beta.9 → 3.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +178 -0
- package/build/Autocomplete/Autocomplete.js +2 -5
- package/build/Autocomplete/Autocomplete.test.js +17 -9
- package/build/Autocomplete/styles.js +5 -5
- package/build/Button/Button.js +28 -7
- package/build/Button/__snapshots__/Button.test.js.snap +4 -4
- package/build/Button/styles.js +4 -4
- package/build/Droplist/Droplist.js +37 -49
- package/build/Droplist/Droplist.test.js +2 -2
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +57 -25
- package/build/Droplist/styles.js +62 -32
- package/build/Fab/Fab.js +81 -0
- package/build/Fab/Fab.test.js +64 -0
- package/build/Fab/__snapshots__/Fab.test.js.snap +17 -0
- package/build/Fab/index.js +18 -0
- package/build/Fab/styles.js +45 -0
- package/build/Pager/Pager.js +15 -7
- package/build/Pager/Pager.test.js +11 -11
- package/build/Pager/__snapshots__/Pager.test.js.snap +12 -9
- package/build/Pager/styles.js +12 -9
- package/build/Radio/Radio.js +8 -1
- package/build/Radio/__snapshots__/Radio.test.js.snap +80 -25
- package/build/Radio/styles.js +84 -25
- package/build/Text/styles.js +2 -1
- package/build/TextField/TextField.js +77 -104
- package/build/TextField/TextField.test.js +7 -15
- package/build/TextField/__snapshots__/TextField.test.js.snap +59 -145
- package/build/TextField/styles.js +81 -149
- package/build/Tip/Tip.js +4 -4
- package/build/Toaster/Toast/Toast.js +4 -4
- package/build/index.js +4 -1
- package/build/plugin/babel.js +1 -1
- package/build/subatomic/icons/occDart.js +2 -2
- package/build/subatomic/icons/occHorizontal.js +2 -2
- package/build/subatomic/icons/occLogo.js +2 -2
- package/build/subatomic/icons/occVertical.js +2 -2
- package/build/subatomic/mappedIcons.js +2 -3
- package/build/tokens/colors.json +38 -11
- package/catalog-info.yaml +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,181 @@
|
|
1
|
+
# [3.0.0-beta.1](https://github.com/occmundial/occ-atomic/compare/v2.0.0...v3.0.0-beta.1) (2024-05-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Add events to Button ([cbac2b8](https://github.com/occmundial/occ-atomic/commit/cbac2b8a19cc93c76529a2aa4f91a685a5b7f9c7))
|
7
|
+
* Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
|
8
|
+
* Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
|
9
|
+
* Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
|
10
|
+
* Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* Update Autocomplete styles ([fa449be](https://github.com/occmundial/occ-atomic/commit/fa449be2322c75857e6350ee9dee596cd441b033))
|
16
|
+
* Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
|
17
|
+
* Update TextField styles ([0d0218e](https://github.com/occmundial/occ-atomic/commit/0d0218ea0df146da1b07482676eb99ad57d186b7))
|
18
|
+
|
19
|
+
|
20
|
+
### BREAKING CHANGES
|
21
|
+
|
22
|
+
* Remove the lockHeight and searchField properties
|
23
|
+
|
24
|
+
# [2.0.0](https://github.com/occmundial/occ-atomic/compare/v1.39.1...v2.0.0) (2024-05-27)
|
25
|
+
|
26
|
+
|
27
|
+
### Bug Fixes
|
28
|
+
|
29
|
+
* Add exception for the provider in the babel plugin ([4383e87](https://github.com/occmundial/occ-atomic/commit/4383e876ef28bb773dca3ff9149dfe1ad7cc53a1))
|
30
|
+
* Add missed icons ([a5527c5](https://github.com/occmundial/occ-atomic/commit/a5527c5eff5afb23c142c0b412756ee8f6a11b02))
|
31
|
+
* Adjust icon in prev and next button ([8d78c19](https://github.com/occmundial/occ-atomic/commit/8d78c196ce2a27990084683fbeb95b0b9e49be02))
|
32
|
+
* Adjust styles for ghostPink theme and button icons ([942a2c9](https://github.com/occmundial/occ-atomic/commit/942a2c967cea88479154a65a98f2961bfbd406ce))
|
33
|
+
* Adjust styles for ghostPink theme and button icons ([9e2576e](https://github.com/occmundial/occ-atomic/commit/9e2576efb42856f1a91ab271ea4b823fbbfbf45d))
|
34
|
+
* Change font tokens in Button ([7b0b47a](https://github.com/occmundial/occ-atomic/commit/7b0b47ab608530cf4fa6ea31afb2592ad70958c9))
|
35
|
+
* Change logic to fallback legacy icons ([60f37f4](https://github.com/occmundial/occ-atomic/commit/60f37f48391713faba97f6d4f93e60519d79b348))
|
36
|
+
* Change name of the import for AtomicProvider in babel ([d0157de](https://github.com/occmundial/occ-atomic/commit/d0157de2321bce412dc0662a98f89a6196dbc917))
|
37
|
+
* Change tabs to spaces ([ba606c3](https://github.com/occmundial/occ-atomic/commit/ba606c3951a779fd05937fed49f785cc529cd611))
|
38
|
+
* Change the import declaration for the provider ([4fae96e](https://github.com/occmundial/occ-atomic/commit/4fae96e40028fc5d93438f7df3fd7342c0f6392a))
|
39
|
+
* Changed font variable to the old one ([75dc28b](https://github.com/occmundial/occ-atomic/commit/75dc28bc0bd174057449c45d4ebe79366ffc8433))
|
40
|
+
* Fix loading icon size ([2cf2248](https://github.com/occmundial/occ-atomic/commit/2cf22486a65eb78ce9e7fb18da00a7e237fbcb55))
|
41
|
+
* Force padding of 0 in ghostPink button ([778ef27](https://github.com/occmundial/occ-atomic/commit/778ef27301183f43ace721b625582c14c353009b))
|
42
|
+
* Include the tokens into the build ([d3d0e1e](https://github.com/occmundial/occ-atomic/commit/d3d0e1eea096847bfcaf99d6c8f56b17d45faa5f))
|
43
|
+
* Update design tokens ([6c96339](https://github.com/occmundial/occ-atomic/commit/6c963392e0b3af43978a5189bdbe0304e046f47c))
|
44
|
+
* Update tip and toast icons ([07f3474](https://github.com/occmundial/occ-atomic/commit/07f347420e2f3d278274018cd9039508cbd7e504))
|
45
|
+
|
46
|
+
|
47
|
+
### Features
|
48
|
+
|
49
|
+
* Add hover shadow ([207b7a2](https://github.com/occmundial/occ-atomic/commit/207b7a2819771ff7384c7c53448f37d5dfb7e146))
|
50
|
+
* Add logic to use atomic icons and static icons ([6fe277e](https://github.com/occmundial/occ-atomic/commit/6fe277ed83927d29af3cf06573cb6d08a0f399ab))
|
51
|
+
* Add logic to use atomic icons and static icons ([0b9a9e4](https://github.com/occmundial/occ-atomic/commit/0b9a9e41c37a4fcff6c14c8e79da4885662ccba1))
|
52
|
+
* Add new design tokens files ([6b8fbcf](https://github.com/occmundial/occ-atomic/commit/6b8fbcf03f272603020686e229cf3ad1bd3e3a3e))
|
53
|
+
* Add new fab component ([2164eea](https://github.com/occmundial/occ-atomic/commit/2164eea04ed268165609db2bcd80be4dd02df6a2))
|
54
|
+
* Add to mapped icons stars solid icon ([5c96982](https://github.com/occmundial/occ-atomic/commit/5c9698235dc690bb8e1c913cc140854fc64c530b))
|
55
|
+
* Adds testing icon to legacy icons ([a0bca6c](https://github.com/occmundial/occ-atomic/commit/a0bca6c33f54e731b645a953499dbc5b96d03d90))
|
56
|
+
* Change Button themes and styles ([114375d](https://github.com/occmundial/occ-atomic/commit/114375d8a7a3b56622c00416a007e52a333ed8d4))
|
57
|
+
* Change occ logo blue color to blue token ([4b7d63d](https://github.com/occmundial/occ-atomic/commit/4b7d63d0743a8caecc019f8326733c4cf2017b2f))
|
58
|
+
* Changed some examples with tables ([3efe252](https://github.com/occmundial/occ-atomic/commit/3efe252c3d8651976f28e951081c717861c0ad56))
|
59
|
+
* Map arrow down to chevron down ([9bd47fa](https://github.com/occmundial/occ-atomic/commit/9bd47fab659f3f7743d6f0b6a48dc9ecf599022d))
|
60
|
+
* Remove fab border transition ([485e64c](https://github.com/occmundial/occ-atomic/commit/485e64ca574f3300a159b8c4a5bedf11ee49b32d))
|
61
|
+
* Remove fab border transition ([9561c59](https://github.com/occmundial/occ-atomic/commit/9561c599981f8ccfc76ccdb00b35576d01f53578))
|
62
|
+
* Update atomic icons ([cdaa9bd](https://github.com/occmundial/occ-atomic/commit/cdaa9bda879f0d8aabe44a79cd16a0eedd3a7e8d))
|
63
|
+
* Update fab snapshot test ([d75b525](https://github.com/occmundial/occ-atomic/commit/d75b525dd32c4f4b38cebf4f5cd8e0dd1034752e))
|
64
|
+
* Update ghost pink loading icon ([9292276](https://github.com/occmundial/occ-atomic/commit/92922766abe7c0010b9f4f4b8265c2105c019f3c))
|
65
|
+
* Update snapshots ([438e896](https://github.com/occmundial/occ-atomic/commit/438e8968d5d228d1b9bad3883be676fa1bc8f2b1))
|
66
|
+
* Update snapshots ([0395996](https://github.com/occmundial/occ-atomic/commit/0395996ad4f21e6db5b917005c9ccf1c8a9dd0df))
|
67
|
+
* Update tokens path and add outline offset ([a7e6807](https://github.com/occmundial/occ-atomic/commit/a7e6807e1936d98c8f72e483b1b131dcfa714877))
|
68
|
+
* Update tokens path and add outline offset ([89eeb16](https://github.com/occmundial/occ-atomic/commit/89eeb16a797cb4996069f369bce34b9efb025a3d))
|
69
|
+
* Updated radio styles and documentation ([2c39496](https://github.com/occmundial/occ-atomic/commit/2c39496186092fe20434ce4a030c28e42cebff91))
|
70
|
+
* Updated Text component documentation ([73e4b21](https://github.com/occmundial/occ-atomic/commit/73e4b21d488ba012df82d2e4fb85c18689c5d586))
|
71
|
+
* Updated text component with new tokens ([b5f75ee](https://github.com/occmundial/occ-atomic/commit/b5f75eec430126b36c06dcd60bb320ccdf7eee0f))
|
72
|
+
* Upgrade font tokens ([069bf92](https://github.com/occmundial/occ-atomic/commit/069bf9237f5b52492961f96f0a6f4a79469f4448))
|
73
|
+
* Validate render icon in button logic ([c445f00](https://github.com/occmundial/occ-atomic/commit/c445f00b7f89b94c102b0e113b503d0e1a5193d4))
|
74
|
+
* Validate render icon in button logic ([91dbc46](https://github.com/occmundial/occ-atomic/commit/91dbc464acceec6b1c7c9d2dde28976d04a5bf30))
|
75
|
+
|
76
|
+
|
77
|
+
### BREAKING CHANGES
|
78
|
+
|
79
|
+
* The themes of the Button component have changed to match the styles of the button in the new design system. The current themes have slightly different names to the new ones but they all have a corresponding new theme that matches, except for the ghostPink theme.
|
80
|
+
|
81
|
+
# [2.0.0-beta.19](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.18...v2.0.0-beta.19) (2024-05-27)
|
82
|
+
|
83
|
+
|
84
|
+
### Features
|
85
|
+
|
86
|
+
* Update Autocomplete styles ([fa449be](https://github.com/occmundial/occ-atomic/commit/fa449be2322c75857e6350ee9dee596cd441b033))
|
87
|
+
|
88
|
+
# [2.0.0-beta.18](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.17...v2.0.0-beta.18) (2024-05-21)
|
89
|
+
|
90
|
+
|
91
|
+
### Bug Fixes
|
92
|
+
|
93
|
+
* Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
|
94
|
+
* Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
|
95
|
+
* Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
|
96
|
+
* Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
|
97
|
+
|
98
|
+
|
99
|
+
### Features
|
100
|
+
|
101
|
+
* Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
|
102
|
+
|
103
|
+
# [2.0.0-beta.17](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2024-05-21)
|
104
|
+
|
105
|
+
|
106
|
+
### Bug Fixes
|
107
|
+
|
108
|
+
* Add events to Button ([cbac2b8](https://github.com/occmundial/occ-atomic/commit/cbac2b8a19cc93c76529a2aa4f91a685a5b7f9c7))
|
109
|
+
|
110
|
+
|
111
|
+
### Features
|
112
|
+
|
113
|
+
* Update TextField styles ([0d0218e](https://github.com/occmundial/occ-atomic/commit/0d0218ea0df146da1b07482676eb99ad57d186b7))
|
114
|
+
|
115
|
+
|
116
|
+
### BREAKING CHANGES
|
117
|
+
|
118
|
+
* Remove the lockHeight and searchField properties
|
119
|
+
|
120
|
+
# [2.0.0-beta.16](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.15...v2.0.0-beta.16) (2024-05-14)
|
121
|
+
|
122
|
+
|
123
|
+
### Bug Fixes
|
124
|
+
|
125
|
+
* Adjust icon in prev and next button ([8d78c19](https://github.com/occmundial/occ-atomic/commit/8d78c196ce2a27990084683fbeb95b0b9e49be02))
|
126
|
+
* Change tabs to spaces ([ba606c3](https://github.com/occmundial/occ-atomic/commit/ba606c3951a779fd05937fed49f785cc529cd611))
|
127
|
+
|
128
|
+
# [2.0.0-beta.15](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2024-05-10)
|
129
|
+
|
130
|
+
|
131
|
+
### Features
|
132
|
+
|
133
|
+
* Updated radio styles and documentation ([2c39496](https://github.com/occmundial/occ-atomic/commit/2c39496186092fe20434ce4a030c28e42cebff91))
|
134
|
+
|
135
|
+
# [2.0.0-beta.14](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.13...v2.0.0-beta.14) (2024-05-07)
|
136
|
+
|
137
|
+
|
138
|
+
### Features
|
139
|
+
|
140
|
+
* Add hover shadow ([207b7a2](https://github.com/occmundial/occ-atomic/commit/207b7a2819771ff7384c7c53448f37d5dfb7e146))
|
141
|
+
* Add new fab component ([2164eea](https://github.com/occmundial/occ-atomic/commit/2164eea04ed268165609db2bcd80be4dd02df6a2))
|
142
|
+
* Remove fab border transition ([485e64c](https://github.com/occmundial/occ-atomic/commit/485e64ca574f3300a159b8c4a5bedf11ee49b32d))
|
143
|
+
* Remove fab border transition ([9561c59](https://github.com/occmundial/occ-atomic/commit/9561c599981f8ccfc76ccdb00b35576d01f53578))
|
144
|
+
* Update fab snapshot test ([d75b525](https://github.com/occmundial/occ-atomic/commit/d75b525dd32c4f4b38cebf4f5cd8e0dd1034752e))
|
145
|
+
* Update ghost pink loading icon ([9292276](https://github.com/occmundial/occ-atomic/commit/92922766abe7c0010b9f4f4b8265c2105c019f3c))
|
146
|
+
* Update snapshots ([438e896](https://github.com/occmundial/occ-atomic/commit/438e8968d5d228d1b9bad3883be676fa1bc8f2b1))
|
147
|
+
* Update snapshots ([0395996](https://github.com/occmundial/occ-atomic/commit/0395996ad4f21e6db5b917005c9ccf1c8a9dd0df))
|
148
|
+
* Update tokens path and add outline offset ([a7e6807](https://github.com/occmundial/occ-atomic/commit/a7e6807e1936d98c8f72e483b1b131dcfa714877))
|
149
|
+
* Update tokens path and add outline offset ([89eeb16](https://github.com/occmundial/occ-atomic/commit/89eeb16a797cb4996069f369bce34b9efb025a3d))
|
150
|
+
|
151
|
+
# [2.0.0-beta.13](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2024-04-29)
|
152
|
+
|
153
|
+
|
154
|
+
### Features
|
155
|
+
|
156
|
+
* Map arrow down to chevron down ([9bd47fa](https://github.com/occmundial/occ-atomic/commit/9bd47fab659f3f7743d6f0b6a48dc9ecf599022d))
|
157
|
+
|
158
|
+
# [2.0.0-beta.12](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2024-04-26)
|
159
|
+
|
160
|
+
|
161
|
+
### Bug Fixes
|
162
|
+
|
163
|
+
* Change name of the import for AtomicProvider in babel ([d0157de](https://github.com/occmundial/occ-atomic/commit/d0157de2321bce412dc0662a98f89a6196dbc917))
|
164
|
+
|
165
|
+
# [2.0.0-beta.11](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.10...v2.0.0-beta.11) (2024-04-25)
|
166
|
+
|
167
|
+
|
168
|
+
### Bug Fixes
|
169
|
+
|
170
|
+
* Update tip and toast icons ([07f3474](https://github.com/occmundial/occ-atomic/commit/07f347420e2f3d278274018cd9039508cbd7e504))
|
171
|
+
|
172
|
+
# [2.0.0-beta.10](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.9...v2.0.0-beta.10) (2024-04-25)
|
173
|
+
|
174
|
+
|
175
|
+
### Bug Fixes
|
176
|
+
|
177
|
+
* Change the import declaration for the provider ([4fae96e](https://github.com/occmundial/occ-atomic/commit/4fae96e40028fc5d93438f7df3fd7342c0f6392a))
|
178
|
+
|
1
179
|
# [2.0.0-beta.9](https://github.com/occmundial/occ-atomic/compare/v2.0.0-beta.8...v2.0.0-beta.9) (2024-04-25)
|
2
180
|
|
3
181
|
|
@@ -243,7 +243,8 @@ Autocomplete.propTypes = {
|
|
243
243
|
className: _propTypes["default"].string,
|
244
244
|
inputClassName: _propTypes["default"].string,
|
245
245
|
disabled: _propTypes["default"].bool,
|
246
|
-
testId: _propTypes["default"].string
|
246
|
+
testId: _propTypes["default"].string,
|
247
|
+
disableAutoComplete: _propTypes["default"].bool
|
247
248
|
}).isRequired,
|
248
249
|
|
249
250
|
/** Object with the props for the Droplist component. Check their descriptions in the Droplist docs. */
|
@@ -279,9 +280,6 @@ Autocomplete.propTypes = {
|
|
279
280
|
/** Function to call on mouse down (Droplist item). */
|
280
281
|
onMouseDown: _propTypes["default"].func,
|
281
282
|
onRef: _propTypes["default"].func,
|
282
|
-
|
283
|
-
/** Disables native autoComplete on browsers. */
|
284
|
-
disableAutoComplete: _propTypes["default"].bool,
|
285
283
|
id: _propTypes["default"].string,
|
286
284
|
className: _propTypes["default"].string,
|
287
285
|
style: _propTypes["default"].object,
|
@@ -292,7 +290,6 @@ Autocomplete.propTypes = {
|
|
292
290
|
Autocomplete.defaultProps = {
|
293
291
|
textfieldProps: {},
|
294
292
|
droplistProps: {},
|
295
|
-
disableAutoComplete: false,
|
296
293
|
showInitialData: false
|
297
294
|
};
|
298
295
|
var _default = Autocomplete;
|
@@ -36,7 +36,7 @@ var items = [{
|
|
36
36
|
textRight: '(6)',
|
37
37
|
id: 4
|
38
38
|
}];
|
39
|
-
describe(
|
39
|
+
describe('Autocomplete', function () {
|
40
40
|
it('matches the snapshot', function () {
|
41
41
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Autocomplete["default"], {
|
42
42
|
droplistProps: {
|
@@ -64,7 +64,7 @@ describe("Autocomplete", function () {
|
|
64
64
|
expect(wrapper.find('.input').at(0).length).toBe(1);
|
65
65
|
expect(wrapper.find('.droplist').at(0).length).toBe(1);
|
66
66
|
});
|
67
|
-
it(
|
67
|
+
it("hides the droplist when there's no value or the input has no focus", function () {
|
68
68
|
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Autocomplete["default"], {
|
69
69
|
textfieldProps: {
|
70
70
|
valueProp: 'a',
|
@@ -147,14 +147,17 @@ describe("Autocomplete", function () {
|
|
147
147
|
},
|
148
148
|
droplistProps: {
|
149
149
|
items: items,
|
150
|
-
className: 'droplist'
|
150
|
+
className: 'droplist',
|
151
|
+
testId: 'test-component'
|
151
152
|
},
|
152
153
|
classes: classes
|
153
154
|
}));
|
154
155
|
wrapper.setState({
|
155
156
|
focus: true
|
156
157
|
});
|
157
|
-
wrapper.find(
|
158
|
+
wrapper.find({
|
159
|
+
"data-testid": 'test-component__droplist-item-0'
|
160
|
+
}).simulate('mousedown');
|
158
161
|
expect(onMouseDown.mock.calls[0][0]).toEqual({
|
159
162
|
id: 1,
|
160
163
|
text: 'Administrador',
|
@@ -164,7 +167,9 @@ describe("Autocomplete", function () {
|
|
164
167
|
focus: true,
|
165
168
|
value: 'a'
|
166
169
|
});
|
167
|
-
wrapper.find(
|
170
|
+
wrapper.find({
|
171
|
+
"data-testid": 'test-component__droplist-item-1'
|
172
|
+
}).simulate('mousedown');
|
168
173
|
expect(onMouseDown.mock.calls[1][0]).toEqual({
|
169
174
|
id: 2,
|
170
175
|
text: 'Administrador Sr',
|
@@ -202,14 +207,17 @@ describe("Autocomplete", function () {
|
|
202
207
|
},
|
203
208
|
droplistProps: {
|
204
209
|
items: items,
|
205
|
-
className: 'droplist'
|
210
|
+
className: 'droplist',
|
211
|
+
testId: "test-component"
|
206
212
|
},
|
207
213
|
classes: classes
|
208
214
|
}));
|
209
215
|
wrapper.setState({
|
210
216
|
focus: true
|
211
217
|
});
|
212
|
-
wrapper.find(
|
218
|
+
wrapper.find({
|
219
|
+
"data-testid": 'test-component__droplist-item-0'
|
220
|
+
}).simulate('mousedown');
|
213
221
|
expect(onMouseDown.mock.calls.length).toBe(1);
|
214
222
|
});
|
215
223
|
it('calls the onFocus function', function () {
|
@@ -247,7 +255,7 @@ describe("Autocomplete", function () {
|
|
247
255
|
expect(onBlur.mock.calls.length).toBe(1);
|
248
256
|
});
|
249
257
|
});
|
250
|
-
describe(
|
258
|
+
describe('AutocompleteJSS', function () {
|
251
259
|
it('matches the snapshot', function () {
|
252
260
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
253
261
|
droplistProps: {
|
@@ -258,7 +266,7 @@ describe("AutocompleteJSS", function () {
|
|
258
266
|
expect(wrapper).toMatchSnapshot();
|
259
267
|
});
|
260
268
|
});
|
261
|
-
describe(
|
269
|
+
describe('Autocomplete styles', function () {
|
262
270
|
it('matches the snapshot', function () {
|
263
271
|
expect(_styles["default"]).toMatchSnapshot();
|
264
272
|
});
|
@@ -7,8 +7,6 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _idx = _interopRequireDefault(require("idx"));
|
9
9
|
|
10
|
-
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
11
|
-
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
11
|
|
14
12
|
var _default = {
|
@@ -20,10 +18,12 @@ var _default = {
|
|
20
18
|
zIndex: 2,
|
21
19
|
top: function top(props) {
|
22
20
|
return (0, _idx["default"])(props, function (_) {
|
23
|
-
return _.textfieldProps.
|
21
|
+
return _.textfieldProps.assistiveText;
|
24
22
|
}) || (0, _idx["default"])(props, function (_) {
|
25
|
-
return _.textfieldProps.
|
26
|
-
})
|
23
|
+
return _.textfieldProps.counter;
|
24
|
+
}) && (0, _idx["default"])(props, function (_) {
|
25
|
+
return _.textfieldProps.maxLength;
|
26
|
+
}) ? 'calc(100% - 21px)' : 'calc(100% + 8px)';
|
27
27
|
},
|
28
28
|
left: 0,
|
29
29
|
width: '100%'
|
package/build/Button/Button.js
CHANGED
@@ -17,6 +17,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
19
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
21
|
+
|
20
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
21
23
|
|
22
24
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -66,6 +68,9 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
66
68
|
target = _this$props.target,
|
67
69
|
rel = _this$props.rel,
|
68
70
|
onClick = _this$props.onClick,
|
71
|
+
onMouseDown = _this$props.onMouseDown,
|
72
|
+
onMouseUp = _this$props.onMouseUp,
|
73
|
+
onMouseOut = _this$props.onMouseOut,
|
69
74
|
theme = _this$props.theme,
|
70
75
|
size = _this$props.size,
|
71
76
|
block = _this$props.block,
|
@@ -112,26 +117,33 @@ var Button = /*#__PURE__*/function (_React$Component) {
|
|
112
117
|
width: iconSize,
|
113
118
|
height: iconSize
|
114
119
|
})) : null;
|
120
|
+
var eventProps = !disabled ? {
|
121
|
+
onClick: onClick,
|
122
|
+
onMouseDown: onMouseDown,
|
123
|
+
onMouseUp: onMouseUp,
|
124
|
+
onMouseOut: onMouseOut
|
125
|
+
} : {};
|
115
126
|
|
116
127
|
if (href) {
|
117
|
-
return /*#__PURE__*/_react["default"].createElement("a", {
|
128
|
+
return /*#__PURE__*/_react["default"].createElement("a", _extends({
|
118
129
|
className: classNames,
|
119
130
|
href: !disabled ? href : '',
|
120
131
|
target: target,
|
121
|
-
rel: rel
|
122
|
-
|
132
|
+
rel: rel
|
133
|
+
}, eventProps, {
|
123
134
|
id: id,
|
124
135
|
style: style,
|
125
136
|
"data-testid": testId
|
126
|
-
}, content, loadingLayer);
|
137
|
+
}), content, loadingLayer);
|
127
138
|
} else {
|
128
|
-
return /*#__PURE__*/_react["default"].createElement("button", {
|
139
|
+
return /*#__PURE__*/_react["default"].createElement("button", _extends({
|
129
140
|
className: classNames,
|
130
|
-
|
141
|
+
disabled: disabled
|
142
|
+
}, eventProps, {
|
131
143
|
id: id,
|
132
144
|
style: style,
|
133
145
|
"data-testid": testId
|
134
|
-
}, content, loadingLayer);
|
146
|
+
}), content, loadingLayer);
|
135
147
|
}
|
136
148
|
}
|
137
149
|
}]);
|
@@ -176,6 +188,15 @@ Button.propTypes = {
|
|
176
188
|
/** The function to call when the button is clicked. */
|
177
189
|
onClick: _propTypes["default"].func,
|
178
190
|
|
191
|
+
/** The function to call when the mouse is down on the button. */
|
192
|
+
onMouseDown: _propTypes["default"].func,
|
193
|
+
|
194
|
+
/** The function to call when the mouse is up on the button. */
|
195
|
+
onMouseUp: _propTypes["default"].func,
|
196
|
+
|
197
|
+
/** The function to call when the mouse moves out of the button. */
|
198
|
+
onMouseOut: _propTypes["default"].func,
|
199
|
+
|
179
200
|
/** Optionally, you can set the href property and use it like a link. */
|
180
201
|
href: _propTypes["default"].string,
|
181
202
|
|
@@ -49,7 +49,7 @@ Object {
|
|
49
49
|
},
|
50
50
|
"ghostGrey": Object {
|
51
51
|
"& $loadIcon": Object {
|
52
|
-
"
|
52
|
+
"fill": "#5A5D7B",
|
53
53
|
},
|
54
54
|
"& span span": Object {
|
55
55
|
"background": [Function],
|
@@ -75,7 +75,7 @@ Object {
|
|
75
75
|
},
|
76
76
|
"ghostPink": Object {
|
77
77
|
"& $loadIcon": Object {
|
78
|
-
"
|
78
|
+
"fill": "#f13465",
|
79
79
|
},
|
80
80
|
"& span span": Object {
|
81
81
|
"background": [Function],
|
@@ -232,7 +232,7 @@ Object {
|
|
232
232
|
},
|
233
233
|
"secondary": Object {
|
234
234
|
"& $loadIcon": Object {
|
235
|
-
"
|
235
|
+
"fill": "#083CAE",
|
236
236
|
},
|
237
237
|
"& span span": Object {
|
238
238
|
"background": [Function],
|
@@ -258,7 +258,7 @@ Object {
|
|
258
258
|
},
|
259
259
|
"tertiary": Object {
|
260
260
|
"& $loadIcon": Object {
|
261
|
-
"
|
261
|
+
"fill": "#083CAE",
|
262
262
|
},
|
263
263
|
"& span span": Object {
|
264
264
|
"background": [Function],
|
package/build/Button/styles.js
CHANGED
@@ -148,7 +148,7 @@ var _default = {
|
|
148
148
|
}
|
149
149
|
},
|
150
150
|
'& $loadIcon': {
|
151
|
-
|
151
|
+
fill: _colors2["default"].icon.brand["default"]
|
152
152
|
}
|
153
153
|
},
|
154
154
|
tertiary: {
|
@@ -184,7 +184,7 @@ var _default = {
|
|
184
184
|
}
|
185
185
|
},
|
186
186
|
'& $loadIcon': {
|
187
|
-
|
187
|
+
fill: _colors2["default"].icon.brand["default"]
|
188
188
|
}
|
189
189
|
},
|
190
190
|
tertiaryWhite: {
|
@@ -249,7 +249,7 @@ var _default = {
|
|
249
249
|
}
|
250
250
|
},
|
251
251
|
'& $loadIcon': {
|
252
|
-
|
252
|
+
fill: sec
|
253
253
|
}
|
254
254
|
},
|
255
255
|
ghostGrey: {
|
@@ -279,7 +279,7 @@ var _default = {
|
|
279
279
|
}
|
280
280
|
},
|
281
281
|
'& $loadIcon': {
|
282
|
-
|
282
|
+
fill: _colors2["default"].icon["default"]["default"]
|
283
283
|
}
|
284
284
|
},
|
285
285
|
ghostWhite: {
|
@@ -21,11 +21,9 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
21
21
|
|
22
22
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
23
23
|
|
24
|
-
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
25
|
-
|
26
24
|
var _functions = require("./functions");
|
27
25
|
|
28
|
-
var
|
26
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
29
27
|
|
30
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
31
29
|
|
@@ -54,9 +52,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
54
52
|
var arrowDown = 40;
|
55
53
|
var arrowUp = 38;
|
56
54
|
var enter = 13;
|
57
|
-
var inkLighter = _colors["default"].inkLighter,
|
58
|
-
ink = _colors["default"].ink;
|
59
|
-
var iconSmall = _iconSizes["default"].small;
|
60
55
|
/**
|
61
56
|
* The Droplist component displays a list and filters it with the prop 'term'.
|
62
57
|
* The value of 'term' es highlighted in every item that matches.
|
@@ -408,7 +403,7 @@ var Droplist = /*#__PURE__*/function (_React$Component) {
|
|
408
403
|
term = _this$props5.term,
|
409
404
|
testId = _this$props5.testId;
|
410
405
|
var itemsDOM = items.map(function (item, i) {
|
411
|
-
var index = (0, _functions.compareText)(item[itemTextKey], term);
|
406
|
+
var index = term ? (0, _functions.compareText)(item[itemTextKey], term) : -1;
|
412
407
|
|
413
408
|
if (index >= 0) {
|
414
409
|
var text = (0, _functions.separateText)(item[itemTextKey], index, term);
|
@@ -423,65 +418,58 @@ var Droplist = /*#__PURE__*/function (_React$Component) {
|
|
423
418
|
onMouseUp: function onMouseUp(e) {
|
424
419
|
return _this4.onMouseUp(item, e);
|
425
420
|
},
|
426
|
-
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '').concat(!item.disabled ? " ".concat(classes.itemPointer) :
|
421
|
+
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '').concat(!item.disabled ? " ".concat(classes.itemPointer) : " ".concat(classes.disabled))
|
427
422
|
}, testId && {
|
428
423
|
'data-testid': "".concat(testId, "__droplist-item-").concat(i)
|
429
|
-
}), /*#__PURE__*/_react["default"].createElement("div",
|
424
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
425
|
+
className: classes.itemContainer
|
426
|
+
}, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
430
427
|
iconName: item.iconName,
|
431
|
-
width:
|
432
|
-
height:
|
428
|
+
width: 24,
|
429
|
+
height: 24,
|
433
430
|
display: "inline-block",
|
434
431
|
className: classes.icon,
|
435
|
-
colors: [item.disabled ?
|
436
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
437
|
-
className: item.
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
low: item.disabled
|
443
|
-
}, text[1].length ? text[1] : ''), text[2].length ? text[2] : '', item.extraText && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
444
|
-
tag: "span",
|
445
|
-
strong: true,
|
446
|
-
low: item.disabled,
|
447
|
-
className: "".concat(classes.extraText).concat(!item.disabled ? " ".concat(classes.extraTextColor) : '')
|
432
|
+
colors: [item.disabled ? _colors["default"].icon["default"].disabled : _colors["default"].icon["default"]["default"]]
|
433
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
434
|
+
className: "".concat(classes.text, " ").concat(classes.mainText).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
435
|
+
}, text[0].length ? text[0] : '', /*#__PURE__*/_react["default"].createElement("b", {
|
436
|
+
className: "".concat(classes.highlighted).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
437
|
+
}, text[1].length ? text[1] : ''), text[2].length ? text[2] : '', item.extraText && /*#__PURE__*/_react["default"].createElement("span", {
|
438
|
+
className: "".concat(classes.text, " ").concat(classes.extraText).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
448
439
|
}, item.extraText))), item[itemTextRightKey] && /*#__PURE__*/_react["default"].createElement("span", {
|
449
|
-
className: classes.
|
450
|
-
},
|
451
|
-
tag: "span",
|
452
|
-
low: true
|
453
|
-
}, item[itemTextRightKey])));
|
440
|
+
className: "".concat(classes.text, " ").concat(classes.rightText).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
441
|
+
}, item[itemTextRightKey]));
|
454
442
|
} else {
|
455
443
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
456
444
|
key: item[itemIdKey],
|
457
|
-
onClick: function
|
445
|
+
onClick: !item.disabled ? function (e) {
|
458
446
|
return _this4.onClick(item, e);
|
459
|
-
},
|
447
|
+
} : null,
|
460
448
|
onMouseDown: function onMouseDown(e) {
|
461
449
|
return _this4.onMouseDown(item, e);
|
462
450
|
},
|
463
451
|
onMouseUp: function onMouseUp(e) {
|
464
452
|
return _this4.onMouseUp(item, e);
|
465
453
|
},
|
466
|
-
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '')
|
454
|
+
className: "".concat(classes.item).concat(selectedGroup && currentItem === i ? " ".concat(classes.onFocus) : '').concat(!item.disabled ? " ".concat(classes.itemPointer) : " ".concat(classes.disabled))
|
467
455
|
}, testId && {
|
468
456
|
'data-testid': "".concat(testId, "__droplist-item-").concat(i)
|
469
|
-
}), /*#__PURE__*/_react["default"].createElement("div",
|
457
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
458
|
+
className: classes.itemContainer
|
459
|
+
}, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
470
460
|
iconName: item.iconName,
|
471
|
-
width:
|
472
|
-
height:
|
461
|
+
width: 24,
|
462
|
+
height: 24,
|
473
463
|
display: "inline-block",
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
464
|
+
className: classes.icon,
|
465
|
+
colors: [item.disabled ? _colors["default"].icon["default"].disabled : _colors["default"].icon["default"]["default"]]
|
466
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
467
|
+
className: "".concat(classes.text, " ").concat(classes.mainText).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
468
|
+
}, item[itemTextKey], item.extraText && /*#__PURE__*/_react["default"].createElement("span", {
|
469
|
+
className: "".concat(classes.text, " ").concat(classes.extraText)
|
479
470
|
}, item.extraText))), item[itemTextRightKey] && /*#__PURE__*/_react["default"].createElement("span", {
|
480
|
-
className: classes.
|
481
|
-
},
|
482
|
-
tag: "span",
|
483
|
-
low: true
|
484
|
-
}, item[itemTextRightKey])));
|
471
|
+
className: "".concat(classes.text, " ").concat(classes.rightText).concat(item.disabled ? " ".concat(classes.corpDisabled) : '')
|
472
|
+
}, item[itemTextRightKey]));
|
485
473
|
}
|
486
474
|
});
|
487
475
|
return itemsDOM;
|
@@ -510,11 +498,11 @@ var Droplist = /*#__PURE__*/function (_React$Component) {
|
|
510
498
|
}, groups ? items.map(function (group, index) {
|
511
499
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
512
500
|
key: group[groupIdKey]
|
513
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
514
|
-
small: true,
|
515
|
-
mid: true,
|
501
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
516
502
|
className: classes.group
|
517
|
-
},
|
503
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
504
|
+
className: "".concat(classes.text, " ").concat(classes.groupText)
|
505
|
+
}, group[groupNameKey])), _this5.renderList(group[groupItemsKey], currentGroup === index));
|
518
506
|
}) : this.renderList(items, true));
|
519
507
|
}
|
520
508
|
}]);
|
@@ -119,7 +119,7 @@ describe("Droplist", function () {
|
|
119
119
|
itemIdKey: "id",
|
120
120
|
classes: classes
|
121
121
|
}));
|
122
|
-
expect(wrapper.find('.block>div').at(0).text()).toBe('
|
122
|
+
expect(wrapper.find('.block>div').at(0).text()).toBe('PaísesMéxico(3405)');
|
123
123
|
});
|
124
124
|
it('filters the items', function () {
|
125
125
|
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Droplist["default"], {
|
@@ -151,7 +151,7 @@ describe("Droplist", function () {
|
|
151
151
|
itemIdKey: "id",
|
152
152
|
classes: classes
|
153
153
|
}));
|
154
|
-
expect(wrapper.find('.item').at(0).find('b').
|
154
|
+
expect(wrapper.find('.item').at(0).find('b').exists()).toBe(false);
|
155
155
|
wrapper.setProps({
|
156
156
|
term: 'Administrador'
|
157
157
|
});
|