@occmundial/occ-atomic 2.0.0-beta.17 → 2.0.0-beta.19

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # [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)
2
+
3
+
4
+ ### Features
5
+
6
+ * Update Autocomplete styles ([fa449be](https://github.com/occmundial/occ-atomic/commit/fa449be2322c75857e6350ee9dee596cd441b033))
7
+
8
+ # [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)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Change icon size ([2b6affe](https://github.com/occmundial/occ-atomic/commit/2b6affe0c6a40c080ebd9281dc8b4901aaffe4c4))
14
+ * Change text component for html tags for text in droplist ([50f4972](https://github.com/occmundial/occ-atomic/commit/50f4972c306351416efe83700a6d4dcffa83f259))
15
+ * Resolve merge conflicts ([b771fab](https://github.com/occmundial/occ-atomic/commit/b771fab5304a66febe94bc808eb383f7b1d47741))
16
+ * Update snapshots ([6f32f65](https://github.com/occmundial/occ-atomic/commit/6f32f65188207312c1fa26ce2e4ffd4338ac99cf))
17
+
18
+
19
+ ### Features
20
+
21
+ * Update droplist styles with new design tokens ([27fdaf2](https://github.com/occmundial/occ-atomic/commit/27fdaf288e82a8493eb05d0315f4385585e71a04))
22
+
1
23
  # [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
24
 
3
25
 
@@ -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("Autocomplete", function () {
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('hides the droplist when there\'s no value or the input has no focus', function () {
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('.Droplist-item-0-1-28').at(0).simulate('mousedown');
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('.Droplist-item-0-1-28').at(1).simulate('mousedown');
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('.Droplist-item-0-1-28').at(0).simulate('mousedown');
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("AutocompleteJSS", function () {
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("Autocomplete styles", function () {
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.label;
21
+ return _.textfieldProps.assistiveText;
24
22
  }) || (0, _idx["default"])(props, function (_) {
25
- return _.textfieldProps.lockHeight;
26
- }) ? _spacing["default"].xLarge : 40;
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%'
@@ -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 _iconSizes = _interopRequireDefault(require("../subatomic/iconSizes"));
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", null, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
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: iconSmall,
432
- height: iconSmall,
428
+ width: 24,
429
+ height: 24,
433
430
  display: "inline-block",
434
431
  className: classes.icon,
435
- colors: [item.disabled ? inkLighter : ink]
436
- }), /*#__PURE__*/_react["default"].createElement(_Text["default"], {
437
- className: item.iconName ? classes.iconText : '',
438
- low: item.disabled
439
- }, text[0].length ? text[0] : '', /*#__PURE__*/_react["default"].createElement(_Text["default"], {
440
- tag: "b",
441
- strong: true,
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.right
450
- }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
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 onClick(e) {
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", null, item.iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
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: 14,
472
- height: 14,
461
+ width: 24,
462
+ height: 24,
473
463
  display: "inline-block",
474
- colors: [inkLighter]
475
- }), /*#__PURE__*/_react["default"].createElement(_Text["default"], null, item[itemTextKey], item.extraText && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
476
- tag: "span",
477
- strong: true,
478
- className: classes.extraText
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.right
481
- }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
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(_Text["default"], {
514
- small: true,
515
- mid: true,
501
+ }, /*#__PURE__*/_react["default"].createElement("span", {
516
502
  className: classes.group
517
- }, group[groupNameKey].toUpperCase()), _this5.renderList(group[groupItemsKey], currentGroup === index));
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('PAÍSESMéxico(3405)');
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').text()).toBe('');
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": "#ffffff",
9
- "border": "1px solid #dddddd",
10
- "borderRadius": 4,
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
- "extraText": Object {
14
- "marginLeft": 8,
15
+ "corpDisabled": Object {
16
+ "color": "#878A9F",
15
17
  },
16
- "extraTextColor": Object {
17
- "color": "#0946CB",
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
- 16,
22
- 16,
23
- 4,
30
+ "8px",
31
+ "16px",
32
+ 0,
24
33
  ],
25
34
  },
26
- "icon": Object {
27
- "marginRight": 8,
28
- "position": "absolute",
29
- "top": 12,
35
+ "groupText": Object {
36
+ "font": "400 14px/1.5 'OccText', sans-serif",
30
37
  },
31
- "iconText": Object {
32
- "display": "inline-block",
33
- "marginLeft": 24,
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": "#fafafa",
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
- 8,
43
- 16,
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": "#e4edff",
80
+ "background": "hsl(221 91.2% 35.7% / 0.1)",
54
81
  },
55
- "background": "#e4edff",
82
+ "background": "hsl(221 91.2% 35.7% / 0.1)",
56
83
  },
57
84
  "right": Object {
58
- "float": "right",
59
- "marginLeft": 16,
60
- "transition": "0.1s all",
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
  `;
@@ -5,70 +5,100 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
 
8
- var _colors = _interopRequireDefault(require("../subatomic/colors"));
8
+ var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
9
9
 
10
- var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
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: bgWhite,
27
- border: "1px solid ".concat(grey200),
28
- borderRadius: xTiny,
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: [small, small, xTiny]
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
- padding: [tiny, small],
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: grey50
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
- "float": 'right',
49
- transition: '0.1s all',
50
- marginLeft: small
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: primLighter,
73
+ background: _colors["default"].dropdown.bg.active,
54
74
  '&:hover': {
55
- background: primLighter
75
+ background: _colors["default"].dropdown.bg.active
56
76
  }
57
77
  },
58
78
  icon: {
59
- marginRight: tiny,
60
- position: 'absolute',
61
- top: gutter
79
+ marginRight: _spacing["default"]['size-2']
62
80
  },
63
- iconText: {
81
+ mainText: {
64
82
  display: 'inline-block',
65
- marginLeft: base
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: tiny
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
- extraTextColor: {
71
- color: textLink
99
+ itemContainer: {
100
+ display: 'flex',
101
+ alignItems: 'center'
72
102
  }
73
103
  };
74
104
  exports["default"] = _default;
@@ -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,
@@ -257,7 +257,7 @@
257
257
  "selected": {
258
258
  "bg": {
259
259
  "default": "#0059CD",
260
- "hover": "#0047A5"
260
+ "hover": "#083CAE"
261
261
  }
262
262
  },
263
263
  "bg": {
@@ -279,7 +279,7 @@
279
279
  "selected": {
280
280
  "bg": {
281
281
  "default": "#0059CD",
282
- "hover": "#0047A5",
282
+ "hover": "#083CAE",
283
283
  "disabled": "#8DA5DA"
284
284
  },
285
285
  "border": {
@@ -310,7 +310,7 @@
310
310
  "selected": {
311
311
  "bg": {
312
312
  "default": "#0059CD",
313
- "hover": "#0047A5",
313
+ "hover": "#083CAE",
314
314
  "disabled": "hsl(221 91.2% 35.7% / 0.1)"
315
315
  },
316
316
  "border": {
@@ -342,7 +342,7 @@
342
342
  "border": "#d7f6e3"
343
343
  },
344
344
  "info": {
345
- "bg": "#f7faff",
345
+ "bg": "#e3efff",
346
346
  "border": "#e3efff"
347
347
  },
348
348
  "neutral": {
@@ -354,7 +354,7 @@
354
354
  "track": {
355
355
  "bg": {
356
356
  "default": "#0059CD",
357
- "hover": "#0047A5",
357
+ "hover": "#083CAE",
358
358
  "disabled": "#8DA5DA"
359
359
  }
360
360
  },
@@ -379,7 +379,7 @@
379
379
  "selected": {
380
380
  "bg": {
381
381
  "default": "#0059CD",
382
- "hover": "#0047A5",
382
+ "hover": "#083CAE",
383
383
  "disabled": "#8DA5DA"
384
384
  },
385
385
  "border": {
@@ -401,7 +401,7 @@
401
401
  "border": "#fff1d3"
402
402
  },
403
403
  "info": {
404
- "bg": "#f7faff",
404
+ "bg": "#e3efff",
405
405
  "border": "#e3efff"
406
406
  },
407
407
  "featured": {
@@ -439,6 +439,30 @@
439
439
  }
440
440
  }
441
441
  },
442
+ "nav": {
443
+ "bg": {
444
+ "inverse": "#083CAE",
445
+ "default": "#fff"
446
+ }
447
+ },
448
+ "pill": {
449
+ "selected": {
450
+ "bg": {
451
+ "default": "#0059CD",
452
+ "hover": "#083CAE",
453
+ "active": "#06308A",
454
+ "disabled": "#8DA5DA"
455
+ }
456
+ },
457
+ "unselected": {
458
+ "bg": {
459
+ "default": "hsl(221 91.2% 35.7% / 0.05)",
460
+ "hover": "hsl(221 91.2% 35.7% / 0.1)",
461
+ "active": "hsl(221 91.2% 35.7% / 0.2)",
462
+ "disabled": "hsl(221 91.2% 35.7% / 0.1)"
463
+ }
464
+ }
465
+ },
442
466
  "bg": {
443
467
  "action": {
444
468
  "primary": {
@@ -469,11 +493,13 @@
469
493
  },
470
494
  "brand": {
471
495
  "default": "#0059CD",
472
- "hover": "#0047A5",
496
+ "hover": "#083CAE",
497
+ "active": "#06308A",
473
498
  "disabled": "#8DA5DA",
474
499
  "subtle": {
475
500
  "default": "#E9EEF8",
476
- "hover": "#CAD5EE"
501
+ "hover": "#CAD5EE",
502
+ "active": "#ABBDE4"
477
503
  }
478
504
  },
479
505
  "ghost": {
@@ -490,7 +516,7 @@
490
516
  "warning": "#fff8e9",
491
517
  "error": "#fce8e8",
492
518
  "success": "#ebfbf1",
493
- "info": "#f7faff",
519
+ "info": "#e3efff",
494
520
  "overlay": "rgba(0,0,0,0.8)",
495
521
  "neutral": "#000"
496
522
  },
@@ -515,7 +541,8 @@
515
541
  },
516
542
  "border": {
517
543
  "inverse": {
518
- "default": "#fff",
544
+ "bold": "#fff",
545
+ "default": "rgba(255,255,255,0.5)",
519
546
  "subtle": "rgba(255,255,255,0.2)"
520
547
  },
521
548
  "default": {
@@ -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.17",
3
+ "version": "2.0.0-beta.19",
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",