@occmundial/occ-atomic 2.0.0-beta.17 → 2.0.0-beta.18
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/build/Autocomplete/Autocomplete.test.js +17 -9
- 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/Text/styles.js +2 -1
- package/catalog-info.yaml +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# [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)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
|
7
|
+
* Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
|
8
|
+
* Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
|
9
|
+
* Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
|
10
|
+
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
|
15
|
+
|
1
16
|
# [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)
|
2
17
|
|
3
18
|
|
@@ -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
|
});
|
@@ -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
|
});
|
@@ -5,59 +5,91 @@ exports[`Droplist matches the snapshot 1`] = `ShallowWrapper {}`;
|
|
5
5
|
exports[`Droplist styles matches the snapshot 1`] = `
|
6
6
|
Object {
|
7
7
|
"block": Object {
|
8
|
-
"background": "#
|
9
|
-
"border": "1px solid #
|
10
|
-
"borderRadius":
|
8
|
+
"background": "#fff",
|
9
|
+
"border": "1px solid #D3D4DC",
|
10
|
+
"borderRadius": "4px",
|
11
|
+
"boxShadow": "0 9px 12px -5px rgba(8,13,56,0.12), 0 10px 32px 0 rgba(9,61,173,0.12)",
|
11
12
|
"overflow": "hidden",
|
13
|
+
"padding": "8px",
|
12
14
|
},
|
13
|
-
"
|
14
|
-
"
|
15
|
+
"corpDisabled": Object {
|
16
|
+
"color": "#878A9F",
|
15
17
|
},
|
16
|
-
"
|
17
|
-
"
|
18
|
+
"disabled": Object {
|
19
|
+
"pointerEvents": "none",
|
20
|
+
},
|
21
|
+
"extraText": Object {
|
22
|
+
"color": "#083CAE",
|
23
|
+
"display": "inline-block",
|
24
|
+
"font": "400 10px/1.5 'OccText', sans-serif",
|
25
|
+
"marginLeft": "4px",
|
18
26
|
},
|
19
27
|
"group": Object {
|
28
|
+
"display": "inline-block",
|
20
29
|
"padding": Array [
|
21
|
-
|
22
|
-
|
23
|
-
|
30
|
+
"8px",
|
31
|
+
"16px",
|
32
|
+
0,
|
24
33
|
],
|
25
34
|
},
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"position": "absolute",
|
29
|
-
"top": 12,
|
35
|
+
"groupText": Object {
|
36
|
+
"font": "400 14px/1.5 'OccText', sans-serif",
|
30
37
|
},
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
38
|
+
"highlighted": Object {
|
39
|
+
"background": "hsl(221 91.2% 35.7% / 0.05)",
|
40
|
+
"font": "400 16px/1.5 'OccText', sans-serif",
|
41
|
+
},
|
42
|
+
"icon": Object {
|
43
|
+
"marginRight": "8px",
|
34
44
|
},
|
35
45
|
"item": Object {
|
46
|
+
"&:active, &:focus": Object {
|
47
|
+
"& > $rightText": Object {
|
48
|
+
"color": "#080D39",
|
49
|
+
},
|
50
|
+
"background": "hsl(221 91.2% 35.7% / 0.1)",
|
51
|
+
},
|
36
52
|
"&:hover": Object {
|
37
|
-
"background": "
|
53
|
+
"background": "hsl(221 91.2% 35.7% / 0.05)",
|
38
54
|
},
|
55
|
+
"alignItems": "center",
|
56
|
+
"borderRadius": "4px",
|
39
57
|
"display": "flex",
|
40
58
|
"justifyContent": "space-between",
|
41
59
|
"padding": Array [
|
42
|
-
|
43
|
-
|
60
|
+
"12px",
|
61
|
+
"16px",
|
44
62
|
],
|
45
63
|
"position": "relative",
|
46
64
|
"transition": "0.1s all",
|
47
65
|
},
|
66
|
+
"itemContainer": Object {
|
67
|
+
"alignItems": "center",
|
68
|
+
"display": "flex",
|
69
|
+
},
|
48
70
|
"itemPointer": Object {
|
49
71
|
"cursor": "pointer",
|
50
72
|
},
|
73
|
+
"mainText": Object {
|
74
|
+
"color": "#080D39",
|
75
|
+
"display": "inline-block",
|
76
|
+
"font": "400 16px/1.5 'OccText', sans-serif",
|
77
|
+
},
|
51
78
|
"onFocus": Object {
|
52
79
|
"&:hover": Object {
|
53
|
-
"background": "
|
80
|
+
"background": "hsl(221 91.2% 35.7% / 0.1)",
|
54
81
|
},
|
55
|
-
"background": "
|
82
|
+
"background": "hsl(221 91.2% 35.7% / 0.1)",
|
56
83
|
},
|
57
84
|
"right": Object {
|
58
|
-
"
|
59
|
-
|
60
|
-
|
85
|
+
"marginLeft": "16px",
|
86
|
+
},
|
87
|
+
"rightText": Object {
|
88
|
+
"color": "#5A5D7B",
|
89
|
+
"font": "400 14px/1.5 'OccText', sans-serif",
|
90
|
+
},
|
91
|
+
"text": Object {
|
92
|
+
"margin": 0,
|
61
93
|
},
|
62
94
|
}
|
63
95
|
`;
|
package/build/Droplist/styles.js
CHANGED
@@ -5,70 +5,100 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
11
|
+
|
12
|
+
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
13
|
+
|
14
|
+
var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
|
15
|
+
|
16
|
+
var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
|
17
|
+
|
18
|
+
var _styles = require("../Text/styles");
|
11
19
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
21
|
|
14
|
-
var gutter = _spacing["default"].gutter,
|
15
|
-
tiny = _spacing["default"].tiny,
|
16
|
-
small = _spacing["default"].small,
|
17
|
-
base = _spacing["default"].base,
|
18
|
-
xTiny = _spacing["default"].xTiny;
|
19
|
-
var primLighter = _colors["default"].primLighter,
|
20
|
-
grey50 = _colors["default"].grey50,
|
21
|
-
grey200 = _colors["default"].grey200,
|
22
|
-
bgWhite = _colors["default"].bgWhite,
|
23
|
-
textLink = _colors["default"].textLink;
|
24
22
|
var _default = {
|
25
23
|
block: {
|
26
|
-
background:
|
27
|
-
border: "1px solid ".concat(
|
28
|
-
borderRadius:
|
29
|
-
overflow: 'hidden'
|
24
|
+
background: _colors["default"]['text-field'].bg["default"],
|
25
|
+
border: "1px solid ".concat(_colors["default"]['text-field'].border["default"]),
|
26
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
27
|
+
overflow: 'hidden',
|
28
|
+
padding: _spacing["default"]['size-2'],
|
29
|
+
boxShadow: _shadows["default"]['elevation-elevation-4']
|
30
|
+
},
|
31
|
+
text: {
|
32
|
+
margin: 0
|
30
33
|
},
|
31
34
|
group: {
|
32
|
-
padding: [
|
35
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-4'], 0],
|
36
|
+
display: 'inline-block'
|
37
|
+
},
|
38
|
+
groupText: {
|
39
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label'])
|
33
40
|
},
|
34
41
|
item: {
|
35
42
|
display: 'flex',
|
36
43
|
justifyContent: 'space-between',
|
37
|
-
|
44
|
+
alignItems: 'center',
|
45
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-4']],
|
38
46
|
transition: '0.1s all',
|
47
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
39
48
|
position: 'relative',
|
40
49
|
'&:hover': {
|
41
|
-
background:
|
50
|
+
background: _colors["default"].dropdown.bg.hover
|
51
|
+
},
|
52
|
+
'&:active, &:focus': {
|
53
|
+
background: _colors["default"].dropdown.bg.active,
|
54
|
+
'& > $rightText': {
|
55
|
+
color: _colors["default"].text.corp.primary
|
56
|
+
}
|
42
57
|
}
|
43
58
|
},
|
44
59
|
itemPointer: {
|
45
60
|
cursor: 'pointer'
|
46
61
|
},
|
62
|
+
disabled: {
|
63
|
+
pointerEvents: 'none'
|
64
|
+
},
|
47
65
|
right: {
|
48
|
-
"
|
49
|
-
|
50
|
-
|
66
|
+
marginLeft: _spacing["default"]['size-4']
|
67
|
+
},
|
68
|
+
rightText: {
|
69
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label']),
|
70
|
+
color: _colors["default"].text.corp.secondary
|
51
71
|
},
|
52
72
|
onFocus: {
|
53
|
-
background:
|
73
|
+
background: _colors["default"].dropdown.bg.active,
|
54
74
|
'&:hover': {
|
55
|
-
background:
|
75
|
+
background: _colors["default"].dropdown.bg.active
|
56
76
|
}
|
57
77
|
},
|
58
78
|
icon: {
|
59
|
-
marginRight:
|
60
|
-
position: 'absolute',
|
61
|
-
top: gutter
|
79
|
+
marginRight: _spacing["default"]['size-2']
|
62
80
|
},
|
63
|
-
|
81
|
+
mainText: {
|
64
82
|
display: 'inline-block',
|
65
|
-
|
83
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder']),
|
84
|
+
color: _colors["default"].text.corp.primary
|
85
|
+
},
|
86
|
+
corpDisabled: {
|
87
|
+
color: _colors["default"].text.corp.disabled
|
66
88
|
},
|
67
89
|
extraText: {
|
68
|
-
marginLeft:
|
90
|
+
marginLeft: _spacing["default"]['size-1'],
|
91
|
+
display: 'inline-block',
|
92
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['heading-tag']),
|
93
|
+
color: _colors["default"].text.indigo.primary
|
94
|
+
},
|
95
|
+
highlighted: {
|
96
|
+
background: _colors["default"].bg.action.secondary["default"],
|
97
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder'])
|
69
98
|
},
|
70
|
-
|
71
|
-
|
99
|
+
itemContainer: {
|
100
|
+
display: 'flex',
|
101
|
+
alignItems: 'center'
|
72
102
|
}
|
73
103
|
};
|
74
104
|
exports["default"] = _default;
|
package/build/Text/styles.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports["default"] = void 0;
|
6
|
+
exports["default"] = exports.parseFontValue = void 0;
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
9
9
|
|
@@ -46,6 +46,7 @@ var parseFontValue = function parseFontValue(font) {
|
|
46
46
|
return "".concat(font.fontWeight, " ").concat(font.fontSize, "/").concat(font.lineHeight, " ").concat(_fonts["default"].body);
|
47
47
|
};
|
48
48
|
|
49
|
+
exports.parseFontValue = parseFontValue;
|
49
50
|
var _default = {
|
50
51
|
text: {
|
51
52
|
letterSpacing: 0,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
apiVersion: backstage.io/v1alpha1
|
2
|
+
kind: Component
|
3
|
+
metadata:
|
4
|
+
name: occ-atomic
|
5
|
+
annotations:
|
6
|
+
github.com/project-slug: occmundial/occ-atomic
|
7
|
+
design-tokens.occdeep.io/platform: tailwind
|
8
|
+
design-tokens.occdeep.io/path: lib/tokens
|
9
|
+
design-tokens.occdeep.io/branch: beta
|
10
|
+
spec:
|
11
|
+
type: service
|
12
|
+
lifecycle: production
|
13
|
+
owner: ui-team
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@occmundial/occ-atomic",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.18",
|
4
4
|
"description": "Collection of shareable styled React components for OCC applications.",
|
5
5
|
"homepage": "http://occmundial.github.io/occ-atomic",
|
6
6
|
"main": "build/index.js",
|