@pingux/astro 1.17.0-alpha.9 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ delete variants.ICON;
35
35
  delete variants.ICON_BUTTON;
36
36
  delete variants.INVERTED; // add designer approved variants for devs to use here
37
37
 
38
- var variantOptions = ['critical', 'danger', 'default', 'inline', 'link', 'primary', 'success', 'text'];
38
+ var variantOptions = ['critical', 'danger', 'default', 'inline', 'inlinePrimary', 'link', 'primary', 'success', 'text'];
39
39
  var _default = {
40
40
  title: 'Button',
41
41
  component: _index.Button,
@@ -101,10 +101,15 @@ var TextIconButton = function TextIconButton() {
101
101
  exports.TextIconButton = TextIconButton;
102
102
 
103
103
  var InlineButton = function InlineButton() {
104
- return (0, _react2.jsx)(_index.Button, {
104
+ return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
105
105
  mb: "sm",
106
+ mr: "auto",
106
107
  variant: "inline"
107
- }, "Inline");
108
+ }, "Inline"), (0, _react2.jsx)(_index.Button, {
109
+ mb: "sm",
110
+ mr: "auto",
111
+ variant: "inlinePrimary"
112
+ }, "Inline primary"));
108
113
  };
109
114
 
110
115
  exports.InlineButton = InlineButton;
@@ -137,6 +137,11 @@ test('color block button renders in default state', function () {
137
137
 
138
138
  expect(button).toHaveClass('is-focused');
139
139
  expect(button).toHaveFocus();
140
+
141
+ _userEvent["default"].tab();
142
+
143
+ expect(button).not.toHaveClass('is-focused');
144
+ expect(button).not.toHaveFocus();
140
145
  });
141
146
  test('color block button renders in configured state', function () {
142
147
  getComponent({
@@ -8,7 +8,7 @@ _Object$defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
 
11
- exports["default"] = exports.Default = exports.ChipWithIcon = exports.ChipWithCustomColors = void 0;
11
+ exports["default"] = exports.Default = exports.Count = exports.ChipWithIcon = exports.ChipWithCustomColors = void 0;
12
12
 
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
14
 
@@ -30,6 +30,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
30
30
 
31
31
  var _IconButton = _interopRequireDefault(require("../IconButton"));
32
32
 
33
+ var _Box = _interopRequireDefault(require("../Box"));
34
+
33
35
  var _colors = require("../../styles/colors.js");
34
36
 
35
37
  var _react2 = require("@emotion/react");
@@ -88,6 +90,21 @@ var Default = function Default(_ref5) {
88
90
 
89
91
  exports.Default = Default;
90
92
 
93
+ var Count = function Count(_ref6) {
94
+ var args = (0, _extends2["default"])({}, _ref6);
95
+ return (0, _react2.jsx)(_Box["default"], null, (0, _react2.jsx)(_Chip["default"], (0, _extends2["default"])({
96
+ color: "white"
97
+ }, args, {
98
+ label: "1",
99
+ variant: "boxes.chipCount"
100
+ })), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_Chip["default"], (0, _extends2["default"])({}, args, {
101
+ label: "1",
102
+ variant: "boxes.countNeutral"
103
+ })));
104
+ };
105
+
106
+ exports.Count = Count;
107
+
91
108
  var ChipWithCustomColors = function ChipWithCustomColors() {
92
109
  return (0, _react2.jsx)(_Chip["default"], {
93
110
  label: "Custom Colors",
@@ -65,6 +65,11 @@ test('link shows focus status', function () {
65
65
 
66
66
  expect(link).toHaveFocus();
67
67
  expect(link).toHaveClass('is-focused');
68
+
69
+ _userEvent["default"].tab();
70
+
71
+ expect(link).not.toHaveFocus();
72
+ expect(link).not.toHaveClass('is-focused');
68
73
  });
69
74
  test('link shows disabled status', function () {
70
75
  // Needs href to have a tabindex
@@ -134,6 +134,23 @@ var chip = {
134
134
  };
135
135
  exports.chip = chip;
136
136
 
137
+ var countDefault = _objectSpread(_objectSpread({}, chip), {}, {
138
+ width: 'fit-content',
139
+ minWidth: '17px',
140
+ height: '17px'
141
+ });
142
+
143
+ var chipCount = _objectSpread(_objectSpread({}, countDefault), {}, {
144
+ backgroundColor: '#640099 !important'
145
+ });
146
+
147
+ var countNeutral = _objectSpread(_objectSpread({}, chipCount), {}, {
148
+ backgroundColor: '#E4E6E9 !important',
149
+ '& span': {
150
+ color: 'neutral.20'
151
+ }
152
+ });
153
+
137
154
  var multivaluesChip = _objectSpread(_objectSpread({}, chip), {}, {
138
155
  alignSelf: 'center',
139
156
  cursor: 'default',
@@ -336,6 +353,8 @@ var _default = {
336
353
  base: base,
337
354
  card: card,
338
355
  chip: chip,
356
+ chipCount: chipCount,
357
+ countNeutral: countNeutral,
339
358
  selectedItemChip: selectedItemChip,
340
359
  readOnlyChip: readOnlyChip,
341
360
  copy: copy,
@@ -391,6 +391,18 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
391
391
  '&.is-focused': _objectSpread({}, defaultFocus)
392
392
  });
393
393
 
394
+ var inlinePrimary = _objectSpread(_objectSpread(_objectSpread({}, inline), defaultActive), {}, {
395
+ '&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
396
+ backgroundColor: 'accent.40',
397
+ color: 'white'
398
+ }),
399
+ '&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
400
+ backgroundColor: 'accent.20',
401
+ border: '1px solid',
402
+ borderColor: 'accent.20'
403
+ })
404
+ });
405
+
394
406
  var text = _objectSpread(_objectSpread({}, base), {}, {
395
407
  display: 'inline-flex',
396
408
  bg: 'transparent',
@@ -490,9 +502,7 @@ var colorField = {
490
502
  '&:focus-visible': {
491
503
  outline: 'none'
492
504
  },
493
- '&.is-focused': {
494
- borderColor: 'accent.80'
495
- }
505
+ '&.is-focused': _objectSpread({}, defaultFocus)
496
506
  };
497
507
 
498
508
  var imageUpload = _objectSpread(_objectSpread({}, base), {}, {
@@ -717,6 +727,7 @@ var _default = {
717
727
  iconButton: iconButton,
718
728
  imageUpload: imageUpload,
719
729
  inline: inline,
730
+ inlinePrimary: inlinePrimary,
720
731
  inverted: inverted,
721
732
  link: link,
722
733
  primary: primary,
@@ -14,7 +14,7 @@ delete variants.ICON;
14
14
  delete variants.ICON_BUTTON;
15
15
  delete variants.INVERTED; // add designer approved variants for devs to use here
16
16
 
17
- var variantOptions = ['critical', 'danger', 'default', 'inline', 'link', 'primary', 'success', 'text'];
17
+ var variantOptions = ['critical', 'danger', 'default', 'inline', 'inlinePrimary', 'link', 'primary', 'success', 'text'];
18
18
  export default {
19
19
  title: 'Button',
20
20
  component: Button,
@@ -69,10 +69,15 @@ export var TextIconButton = function TextIconButton() {
69
69
  }), "Add a Form"));
70
70
  };
71
71
  export var InlineButton = function InlineButton() {
72
- return ___EmotionJSX(Button, {
72
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
73
73
  mb: "sm",
74
+ mr: "auto",
74
75
  variant: "inline"
75
- }, "Inline");
76
+ }, "Inline"), ___EmotionJSX(Button, {
77
+ mb: "sm",
78
+ mr: "auto",
79
+ variant: "inlinePrimary"
80
+ }, "Inline primary"));
76
81
  };
77
82
  export var ColorBlockButton = function ColorBlockButton(args) {
78
83
  // Change `isConfigured` property in storybook controls
@@ -100,6 +100,9 @@ test('color block button renders in default state', function () {
100
100
  userEvent.tab();
101
101
  expect(button).toHaveClass('is-focused');
102
102
  expect(button).toHaveFocus();
103
+ userEvent.tab();
104
+ expect(button).not.toHaveClass('is-focused');
105
+ expect(button).not.toHaveFocus();
103
106
  });
104
107
  test('color block button renders in configured state', function () {
105
108
  getComponent({
@@ -8,6 +8,7 @@ import Earth from 'mdi-react/EarthIcon';
8
8
  import Chip from '../Chip';
9
9
  import Icon from '../Icon';
10
10
  import IconButton from '../IconButton';
11
+ import Box from '../Box';
11
12
  import { flatColorList } from '../../styles/colors.js';
12
13
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
14
  export default {
@@ -60,6 +61,19 @@ export var Default = function Default(_ref5) {
60
61
  color: "white"
61
62
  }, args));
62
63
  };
64
+ export var Count = function Count(_ref6) {
65
+ var args = _extends({}, _ref6);
66
+
67
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Chip, _extends({
68
+ color: "white"
69
+ }, args, {
70
+ label: "1",
71
+ variant: "boxes.chipCount"
72
+ })), ___EmotionJSX("br", null), ___EmotionJSX(Chip, _extends({}, args, {
73
+ label: "1",
74
+ variant: "boxes.countNeutral"
75
+ })));
76
+ };
63
77
  export var ChipWithCustomColors = function ChipWithCustomColors() {
64
78
  return ___EmotionJSX(Chip, {
65
79
  label: "Custom Colors",
@@ -43,6 +43,9 @@ test('link shows focus status', function () {
43
43
  userEvent.tab();
44
44
  expect(link).toHaveFocus();
45
45
  expect(link).toHaveClass('is-focused');
46
+ userEvent.tab();
47
+ expect(link).not.toHaveFocus();
48
+ expect(link).not.toHaveClass('is-focused');
46
49
  });
47
50
  test('link shows disabled status', function () {
48
51
  // Needs href to have a tabindex
@@ -114,6 +114,23 @@ export var chip = {
114
114
  }
115
115
  };
116
116
 
117
+ var countDefault = _objectSpread(_objectSpread({}, chip), {}, {
118
+ width: 'fit-content',
119
+ minWidth: '17px',
120
+ height: '17px'
121
+ });
122
+
123
+ var chipCount = _objectSpread(_objectSpread({}, countDefault), {}, {
124
+ backgroundColor: '#640099 !important'
125
+ });
126
+
127
+ var countNeutral = _objectSpread(_objectSpread({}, chipCount), {}, {
128
+ backgroundColor: '#E4E6E9 !important',
129
+ '& span': {
130
+ color: 'neutral.20'
131
+ }
132
+ });
133
+
117
134
  var multivaluesChip = _objectSpread(_objectSpread({}, chip), {}, {
118
135
  alignSelf: 'center',
119
136
  cursor: 'default',
@@ -316,6 +333,8 @@ export default {
316
333
  base: base,
317
334
  card: card,
318
335
  chip: chip,
336
+ chipCount: chipCount,
337
+ countNeutral: countNeutral,
319
338
  selectedItemChip: selectedItemChip,
320
339
  readOnlyChip: readOnlyChip,
321
340
  copy: copy,
@@ -371,6 +371,18 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
371
371
  '&.is-focused': _objectSpread({}, defaultFocus)
372
372
  });
373
373
 
374
+ var inlinePrimary = _objectSpread(_objectSpread(_objectSpread({}, inline), defaultActive), {}, {
375
+ '&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
376
+ backgroundColor: 'accent.40',
377
+ color: 'white'
378
+ }),
379
+ '&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
380
+ backgroundColor: 'accent.20',
381
+ border: '1px solid',
382
+ borderColor: 'accent.20'
383
+ })
384
+ });
385
+
374
386
  var text = _objectSpread(_objectSpread({}, base), {}, {
375
387
  display: 'inline-flex',
376
388
  bg: 'transparent',
@@ -470,9 +482,7 @@ var colorField = {
470
482
  '&:focus-visible': {
471
483
  outline: 'none'
472
484
  },
473
- '&.is-focused': {
474
- borderColor: 'accent.80'
475
- }
485
+ '&.is-focused': _objectSpread({}, defaultFocus)
476
486
  };
477
487
 
478
488
  var imageUpload = _objectSpread(_objectSpread({}, base), {}, {
@@ -697,6 +707,7 @@ export default {
697
707
  iconButton: iconButton,
698
708
  imageUpload: imageUpload,
699
709
  inline: inline,
710
+ inlinePrimary: inlinePrimary,
700
711
  inverted: inverted,
701
712
  link: link,
702
713
  primary: primary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.17.0-alpha.9",
3
+ "version": "1.19.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",