@pingux/astro 2.36.0-alpha.1 → 2.36.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/lib/cjs/components/Badge/Badge.d.ts +4 -0
  2. package/lib/cjs/components/Badge/Badge.js +5 -31
  3. package/lib/cjs/components/Badge/Badge.stories.js +1 -1
  4. package/lib/cjs/components/Badge/Badge.styles.d.ts +781 -0
  5. package/lib/cjs/components/Badge/Badge.test.d.ts +1 -0
  6. package/lib/cjs/components/Badge/index.d.ts +1 -0
  7. package/lib/cjs/components/Box/Box.stories.js +1 -1
  8. package/lib/cjs/components/Button/Button.stories.d.ts +51 -5
  9. package/lib/cjs/components/Button/Button.stories.js +89 -40
  10. package/lib/cjs/components/Button/Buttons.styles.d.ts +72 -1
  11. package/lib/cjs/components/Button/Buttons.styles.js +18 -1
  12. package/lib/cjs/components/Calendar/Calendar.stories.js +48 -19
  13. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +16 -10
  14. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumbUniversal.test.js +10 -0
  15. package/lib/cjs/context/BadgeContext/index.d.ts +2 -0
  16. package/lib/cjs/hooks/useColumnStyles/index.d.ts +1 -0
  17. package/lib/cjs/hooks/useColumnStyles/useColumnStyles.d.ts +11 -0
  18. package/lib/cjs/hooks/useColumnStyles/useColumnStyles.js +7 -3
  19. package/lib/cjs/hooks/useField/useField.d.ts +20 -20
  20. package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +3 -3
  21. package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +2 -1
  22. package/lib/cjs/styles/ColorDocumentation.js +1 -1
  23. package/lib/cjs/styles/colors.d.ts +302 -0
  24. package/lib/cjs/types/badge.d.ts +27 -0
  25. package/lib/cjs/types/badge.js +6 -0
  26. package/lib/cjs/types/index.d.ts +1 -0
  27. package/lib/cjs/types/index.js +21 -10
  28. package/lib/cjs/utils/designUtils/figmaLinks.js +14 -2
  29. package/lib/components/Badge/Badge.js +5 -31
  30. package/lib/components/Badge/Badge.stories.js +1 -1
  31. package/lib/components/Box/Box.stories.js +1 -1
  32. package/lib/components/Button/Button.stories.js +83 -34
  33. package/lib/components/Button/Buttons.styles.js +18 -1
  34. package/lib/components/Calendar/Calendar.stories.js +45 -15
  35. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +13 -7
  36. package/lib/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumbUniversal.test.js +8 -0
  37. package/lib/hooks/useColumnStyles/useColumnStyles.js +7 -3
  38. package/lib/styles/ColorDocumentation.js +1 -1
  39. package/lib/types/badge.js +1 -0
  40. package/lib/types/index.js +1 -0
  41. package/lib/utils/designUtils/figmaLinks.js +14 -2
  42. package/package.json +2 -1
  43. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -7
  44. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -4
@@ -34,7 +34,13 @@ var FIGMA_LINKS = {
34
34
  overflowing: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45064-7148&mode=design&t=0RGDgLyKBzT6bOXO-0'
35
35
  },
36
36
  button: {
37
- "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=0-1&t=8Wwd3tIBh3GEjCJB-0'
37
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47047&mode=dev',
38
+ disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54887&mode=dev',
39
+ textIconButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54941&mode=dev',
40
+ inlineButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47247&mode=dev',
41
+ colorBlockButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47405&mode=dev',
42
+ critical: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47237&mode=dev',
43
+ primary: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47151&mode=dev'
38
44
  },
39
45
  buttonBar: {
40
46
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A753&mode=dev',
@@ -43,7 +49,13 @@ var FIGMA_LINKS = {
43
49
  secondaryRightAligned: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A788&mode=dev'
44
50
  },
45
51
  calendar: {
46
- "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=6373%3A25490&t=BoHXzVpQq9Lf7MaU-1'
52
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=47640-5789&mode=design&t=SZGzEV7PufQjYBN5-4',
53
+ defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-14593&mode=design&t=PX1Q47IuuVvOafDQ-4',
54
+ disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15106&mode=design&t=PX1Q47IuuVvOafDQ-4',
55
+ unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15681&mode=design&t=PX1Q47IuuVvOafDQ-4',
56
+ minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16197&mode=design&t=PX1Q47IuuVvOafDQ-4',
57
+ maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16454&mode=design&t=PX1Q47IuuVvOafDQ-4',
58
+ autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
47
59
  },
48
60
  callout: {
49
61
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289-33201&t=VgqEexa1CXAXfPpp-0'
@@ -14,7 +14,6 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
14
14
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
16
16
  import React from 'react';
17
- import PropTypes from 'prop-types';
18
17
  import { Badge as ThemeUIBadge } from 'theme-ui';
19
18
  import { Box, Text } from '../..';
20
19
  import { BadgeContext } from '../../context/BadgeContext';
@@ -49,49 +48,24 @@ var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
49
48
  // The following is to correct a visual regression released in 1.39.0 https://jira.pingidentity.com/browse/UIP-5907.
50
49
  // TODO : Remove in Astro V2 with theme remapping roll out.
51
50
  var oldVariantPaths = ['boxes.countBadge', 'boxes.countNeutral', 'boxes.itemBadgeWithSlot', 'collapsiblePanel.collapsiblePanelBadge', 'boxes.environmentBadge', 'boxes.readOnlyBadge', 'boxes.selectedItemBadge'];
52
- var fixedVariant = _includesInstanceProperty(oldVariantPaths).call(oldVariantPaths, props.variant) ? "variants.".concat(props.variant) : props.variant;
51
+ var fixedVariant = variant && _includesInstanceProperty(oldVariantPaths).call(oldVariantPaths, variant) ? "variants.".concat(variant) : variant;
53
52
  return ___EmotionJSX(BadgeContext.Provider, {
54
53
  value: {
55
54
  bg: bg
56
55
  }
57
- }, ___EmotionJSX(ThemeUIBadge, _extends({
58
- isRow: true
59
- }, badgeProps, {
60
- variant: props.variant ? fixedVariant : 'baseBadge'
56
+ }, ___EmotionJSX(ThemeUIBadge, _extends({}, badgeProps, {
57
+ variant: variant ? fixedVariant : 'baseBadge'
61
58
  }), (slots === null || slots === void 0 ? void 0 : slots.leftIcon) && ___EmotionJSX(Box, {
62
59
  mr: "xs"
63
60
  }, slots.leftIcon), ___EmotionJSX(Text, _extends({
64
61
  variant: "label",
65
62
  color: textColor,
66
- sx: isUppercase && {
63
+ sx: isUppercase ? {
67
64
  textTransform: 'uppercase',
68
65
  fontSize: '11px'
69
- }
66
+ } : {}
70
67
  }, textProps), label), children));
71
68
  });
72
- Badge.propTypes = {
73
- /** The text color of the badge. */
74
- textColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
75
- /** The background color of the badge. */
76
- bg: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
77
- /** Provides a way to insert markup in specified places. */
78
- slots: PropTypes.shape({
79
- /** The given node will be inserted into left side of the badge. */
80
- leftIcon: PropTypes.node
81
- }),
82
- /** The label of the badge. */
83
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
84
- /** Props object that is spread directly into the text. */
85
- textProps: PropTypes.shape({}),
86
- /** When true, display badge label as uppercase. */
87
- isUppercase: PropTypes.bool,
88
- /** Alignment of badge relative to parent container. */
89
- align: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
90
- /** JSX styling that is passed into the component. */
91
- sx: PropTypes.shape({}),
92
- /** The variant of the badge */
93
- variant: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
94
- };
95
69
  Badge.defaultProps = {
96
70
  textColor: 'white',
97
71
  bg: colors.neutral[10],
@@ -9,7 +9,7 @@ import Earth from '@pingux/mdi-react/EarthIcon';
9
9
  import { withDesign } from 'storybook-addon-designs';
10
10
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
11
11
  import { Badge, Box, Icon, IconButton } from '../../index';
12
- import { flatColorList } from '../../styles/colors.js';
12
+ import { flatColorList } from '../../styles/colors';
13
13
  import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
14
14
  import BadgeReadme from './Badge.mdx';
15
15
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -5,7 +5,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
5
5
  import React from 'react';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
7
  import { Box, Image, Text } from '../../index';
8
- import { flatColorList } from '../../styles/colors.js';
8
+ import { flatColorList } from '../../styles/colors';
9
9
  import { htmlElements } from '../../utils/devUtils/constants/htmlElements';
10
10
  import { pingImg } from '../../utils/devUtils/constants/images';
11
11
  import BoxReadme from './Box.mdx';
@@ -51,68 +51,109 @@ Default.parameters = {
51
51
  url: FIGMA_LINKS.button["default"]
52
52
  }
53
53
  };
54
- export var Disabled = function Disabled() {
54
+ export var Primary = function Primary() {
55
55
  return ___EmotionJSX(Button, {
56
- isDisabled: true
56
+ variant: "primary"
57
57
  }, "Button Text");
58
58
  };
59
- export var TextIconButton = function TextIconButton() {
59
+ Primary.parameters = {
60
+ design: {
61
+ type: 'figma',
62
+ url: FIGMA_LINKS.button.primary
63
+ }
64
+ };
65
+ export var Critical = function Critical() {
60
66
  return ___EmotionJSX(Button, {
67
+ variant: "critical"
68
+ }, "Button Text");
69
+ };
70
+ Critical.parameters = {
71
+ design: {
72
+ type: 'figma',
73
+ url: FIGMA_LINKS.button.critical
74
+ }
75
+ };
76
+ export var InlineButton = function InlineButton() {
77
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
78
+ mb: "sm",
79
+ mr: "auto",
80
+ variant: "inline"
81
+ }, "Button Text"), ___EmotionJSX(Button, {
82
+ mb: "sm",
83
+ mr: "auto",
84
+ variant: "inlinePrimary"
85
+ }, "Button Text"));
86
+ };
87
+ InlineButton.parameters = {
88
+ design: {
89
+ type: 'figma',
90
+ url: FIGMA_LINKS.button.inlineButton
91
+ }
92
+ };
93
+ export var TextIconButton = function TextIconButton() {
94
+ return ___EmotionJSX(Box, {
95
+ width: 20
96
+ }, ___EmotionJSX(Button, {
61
97
  mb: "sm",
62
98
  variant: "withIcon"
63
- }, ___EmotionJSX(Box, {
64
- isRow: true,
65
- alignItems: "center"
66
99
  }, ___EmotionJSX(Icon, {
67
100
  icon: PlusIcon,
68
101
  mr: "xs",
69
- color: "active",
102
+ color: "accent.30",
70
103
  size: 20,
71
104
  title: {
72
105
  name: 'Add Circle Icon'
73
106
  }
74
- }), "Add a Form"));
75
- };
76
- export var InlineButton = function InlineButton() {
77
- return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
78
- mb: "sm",
79
- mr: "auto",
80
- variant: "inline"
81
- }, "Inline"), ___EmotionJSX(Button, {
107
+ }), "Button Text"), ___EmotionJSX(Button, {
82
108
  mb: "sm",
83
109
  mr: "auto",
84
110
  variant: "inlineWithIcon"
85
111
  }, ___EmotionJSX(Icon, {
86
112
  icon: PlusIcon,
87
113
  mr: "xs",
88
- color: "active",
114
+ color: "accent.30",
89
115
  size: 15,
90
116
  title: {
91
117
  name: 'Add Circle Icon'
92
118
  }
93
- }), "Inline with icon"), ___EmotionJSX(Button, {
94
- mb: "sm",
95
- mr: "auto",
96
- variant: "inlinePrimary"
97
- }, "Inline primary"), ___EmotionJSX(Button, {
119
+ }), "Button Text"), ___EmotionJSX(Button, {
98
120
  mb: "sm",
99
121
  mr: "auto",
100
122
  variant: "inlinePrimaryWithIcon"
101
123
  }, ___EmotionJSX(Icon, {
102
124
  icon: PlusIcon,
103
125
  mr: "xs",
104
- color: "active",
126
+ color: "accent.30",
105
127
  size: 15,
106
128
  title: {
107
129
  name: 'Add Circle Icon'
108
130
  }
109
- }), "Inline primary with icon"));
131
+ }), "Button Text"));
132
+ };
133
+ TextIconButton.parameters = {
134
+ design: {
135
+ type: 'figma',
136
+ url: FIGMA_LINKS.button.textIconButton
137
+ }
138
+ };
139
+ export var Disabled = function Disabled() {
140
+ return ___EmotionJSX(Button, {
141
+ isDisabled: true
142
+ }, "Button Text");
143
+ };
144
+ Disabled.parameters = {
145
+ design: {
146
+ type: 'figma',
147
+ url: FIGMA_LINKS.button.disabled
148
+ }
110
149
  };
111
150
  export var ColorBlockButton = function ColorBlockButton(args) {
112
151
  // Change `isConfigured` property in storybook controls
113
152
  var isConfigured = args.isConfigured,
114
153
  props = _objectWithoutProperties(args, _excluded);
115
- return ___EmotionJSX(Button, _extends({}, props, {
154
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Button, _extends({
155
+ mb: "sm"
156
+ }, props, {
116
157
  variant: "colorBlock",
117
158
  className: isConfigured ? 'is-configured' : ''
118
159
  }), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
@@ -124,7 +165,19 @@ export var ColorBlockButton = function ColorBlockButton(args) {
124
165
  title: {
125
166
  name: 'Create Icon'
126
167
  }
127
- }));
168
+ })), ___EmotionJSX(Button, _extends({}, props, {
169
+ variant: "colorBlockPrimary",
170
+ className: isConfigured ? 'is-configured' : ''
171
+ }), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
172
+ variant: "buttonTitle"
173
+ }, "Title"), ___EmotionJSX(Text, {
174
+ variant: "buttonSubtitle"
175
+ }, "Info")), ___EmotionJSX(Icon, {
176
+ icon: CreateIcon,
177
+ title: {
178
+ name: 'Create Icon'
179
+ }
180
+ })));
128
181
  };
129
182
  ColorBlockButton.argTypes = {
130
183
  isConfigured: {
@@ -134,13 +187,9 @@ ColorBlockButton.argTypes = {
134
187
  defaultValue: false
135
188
  }
136
189
  };
137
- export var Critical = function Critical() {
138
- return ___EmotionJSX(Button, {
139
- variant: "critical"
140
- }, "Button Text");
141
- };
142
- export var Primary = function Primary() {
143
- return ___EmotionJSX(Button, {
144
- variant: "primary"
145
- }, "Button Text");
190
+ ColorBlockButton.parameters = {
191
+ design: {
192
+ type: 'figma',
193
+ url: FIGMA_LINKS.button.colorBlockButton
194
+ }
146
195
  };
@@ -72,10 +72,11 @@ var primary = _objectSpread(_objectSpread({}, base), {}, {
72
72
  '&.is-focused': _objectSpread({}, defaultFocus)
73
73
  });
74
74
  var withIcon = _objectSpread(_objectSpread({}, base), {}, {
75
- padding: '8.5px 15px 8.5px 10px',
75
+ padding: '10px 15px 10px 10px',
76
76
  bg: 'white',
77
77
  border: '1px solid',
78
78
  borderColor: 'active',
79
+ display: 'inline-flex',
79
80
  '&.is-hovered': _objectSpread({}, defaultHover),
80
81
  '&.is-pressed': _objectSpread({}, defaultActive),
81
82
  '&.is-focused': _objectSpread({}, defaultFocus)
@@ -234,6 +235,21 @@ var colorBlock = {
234
235
  borderColor: 'accent.20'
235
236
  }
236
237
  };
238
+ var colorBlockPrimary = _objectSpread(_objectSpread(_objectSpread({}, colorBlock), defaultActive), {}, {
239
+ '& span': {
240
+ color: 'white',
241
+ textAlign: 'left'
242
+ },
243
+ '&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
244
+ backgroundColor: 'accent.40',
245
+ color: 'white'
246
+ }),
247
+ '&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
248
+ backgroundColor: 'accent.20',
249
+ border: '1px solid',
250
+ borderColor: 'accent.20'
251
+ })
252
+ });
237
253
  var headerBar = _objectSpread(_objectSpread({}, base), {}, {
238
254
  backgroundColor: 'white',
239
255
  '&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
@@ -273,6 +289,7 @@ export default {
273
289
  quiet: quiet,
274
290
  success: success,
275
291
  colorBlock: colorBlock,
292
+ colorBlockPrimary: colorBlockPrimary,
276
293
  exampleText: exampleText,
277
294
  withIcon: withIcon,
278
295
  inlineWithIcon: inlineWithIcon,
@@ -128,16 +128,11 @@ export var DefaultValue = function DefaultValue(args) {
128
128
  defaultValue: "2022-08-10"
129
129
  }));
130
130
  };
131
- export var Controlled = function Controlled(args) {
132
- var _useState = useState(null),
133
- _useState2 = _slicedToArray(_useState, 2),
134
- date = _useState2[0],
135
- setDate = _useState2[1];
136
- return ___EmotionJSX(Calendar, _extends({}, args, {
137
- "aria-label": "calendar-component-controlled",
138
- value: date,
139
- onChange: setDate
140
- }));
131
+ DefaultValue.parameters = {
132
+ design: {
133
+ type: 'figma',
134
+ url: FIGMA_LINKS.calendar.defaultValue
135
+ }
141
136
  };
142
137
  export var Disabled = function Disabled(args) {
143
138
  return ___EmotionJSX(Calendar, _extends({}, args, {
@@ -145,11 +140,11 @@ export var Disabled = function Disabled(args) {
145
140
  isDisabled: true
146
141
  }));
147
142
  };
148
- export var ReadOnly = function ReadOnly(args) {
149
- return ___EmotionJSX(Calendar, _extends({}, args, {
150
- "aria-label": "calendar-component-readonly",
151
- isReadOnly: true
152
- }));
143
+ Disabled.parameters = {
144
+ design: {
145
+ type: 'figma',
146
+ url: FIGMA_LINKS.calendar.disabled
147
+ }
153
148
  };
154
149
  export var UnavailableDates = function UnavailableDates(args) {
155
150
  var unavailableRanges = [['2022-07-29', '2022-08-05'], ['2022-08-15', '2022-08-20'], ['2022-08-25', '2022-08-26']];
@@ -165,6 +160,12 @@ export var UnavailableDates = function UnavailableDates(args) {
165
160
  isDateUnavailable: isDateUnavailable
166
161
  }));
167
162
  };
163
+ UnavailableDates.parameters = {
164
+ design: {
165
+ type: 'figma',
166
+ url: FIGMA_LINKS.calendar.unavailableDates
167
+ }
168
+ };
168
169
  export var MinimumDate = function MinimumDate(args) {
169
170
  return ___EmotionJSX(Calendar, _extends({}, args, {
170
171
  "aria-label": "calendar-component-min-date",
@@ -172,6 +173,12 @@ export var MinimumDate = function MinimumDate(args) {
172
173
  defaultDate: "2022-09-14"
173
174
  }));
174
175
  };
176
+ MinimumDate.parameters = {
177
+ design: {
178
+ type: 'figma',
179
+ url: FIGMA_LINKS.calendar.minimumDate
180
+ }
181
+ };
175
182
  export var MaximumDate = function MaximumDate(args) {
176
183
  return ___EmotionJSX(Calendar, _extends({}, args, {
177
184
  "aria-label": "calendar-component-max-date",
@@ -179,9 +186,32 @@ export var MaximumDate = function MaximumDate(args) {
179
186
  defaultValue: "2022-10-05"
180
187
  }));
181
188
  };
189
+ MaximumDate.parameters = {
190
+ design: {
191
+ type: 'figma',
192
+ url: FIGMA_LINKS.calendar.maximumDate
193
+ }
194
+ };
182
195
  export var Autofocus = function Autofocus(args) {
183
196
  return ___EmotionJSX(Calendar, _extends({}, args, {
184
197
  "aria-label": "calendar-component",
185
198
  hasAutoFocus: true
186
199
  }));
200
+ };
201
+ Autofocus.parameters = {
202
+ design: {
203
+ type: 'figma',
204
+ url: FIGMA_LINKS.calendar.autofocus
205
+ }
206
+ };
207
+ export var Controlled = function Controlled(args) {
208
+ var _useState = useState(null),
209
+ _useState2 = _slicedToArray(_useState, 2),
210
+ date = _useState2[0],
211
+ setDate = _useState2[1];
212
+ return ___EmotionJSX(Calendar, _extends({}, args, {
213
+ "aria-label": "calendar-component-controlled",
214
+ value: date,
215
+ onChange: setDate
216
+ }));
187
217
  };
@@ -83,17 +83,16 @@ var defaultWithSectionsProps = {
83
83
  items: itemsWithSections
84
84
  };
85
85
  var onSelectionChange = jest.fn();
86
- export var getComponent = function getComponent(props) {
87
- return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultProps, props), function (item) {
86
+ export var renderComponent = function renderComponent(props) {
87
+ return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultProps, props), function (item) {
88
88
  return ___EmotionJSX(Item, {
89
89
  key: item.name,
90
90
  "data-testid": item.name
91
91
  }, item.name);
92
- })));
92
+ }));
93
93
  };
94
- export var getSectionsComponent = function getSectionsComponent() {
95
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
96
- return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultWithSectionsProps, props), function (section) {
94
+ export var renderSectionsComponent = function renderSectionsComponent(props) {
95
+ return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultWithSectionsProps, props), function (section) {
97
96
  return (
98
97
  // eslint-disable-next-line testing-library/no-node-access
99
98
  ___EmotionJSX(Section, {
@@ -109,7 +108,14 @@ export var getSectionsComponent = function getSectionsComponent() {
109
108
  }, item.name);
110
109
  })
111
110
  );
112
- })));
111
+ }));
112
+ };
113
+ var getComponent = function getComponent(props) {
114
+ return render(renderComponent(props));
115
+ };
116
+ var getSectionsComponent = function getSectionsComponent() {
117
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
118
+ return render(renderSectionsComponent(props));
113
119
  };
114
120
  beforeAll(function () {
115
121
  jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(function () {
@@ -0,0 +1,8 @@
1
+ import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
2
+ import { renderComponent, renderSectionsComponent } from './EnvironmentBreadcrumb.test';
3
+ universalComponentTests({
4
+ renderComponent: renderComponent
5
+ });
6
+ universalComponentTests({
7
+ renderComponent: renderSectionsComponent
8
+ });
@@ -2,13 +2,17 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
2
2
  import { useEffect, useState } from 'react';
3
3
  var useColumnStyles = function useColumnStyles(_ref) {
4
4
  var labelMode = _ref.labelMode;
5
- var _useState = useState(false),
5
+ var _useState = useState({
6
+ sx: {
7
+ gridTemplateColumns: ''
8
+ }
9
+ }),
6
10
  _useState2 = _slicedToArray(_useState, 2),
7
11
  labelStyleProps = _useState2[0],
8
- setlabelStyleProps = _useState2[1];
12
+ setLabelStyleProps = _useState2[1];
9
13
  useEffect(function () {
10
14
  if (labelMode === 'left') {
11
- setlabelStyleProps({
15
+ setLabelStyleProps({
12
16
  sx: {
13
17
  gridTemplateColumns: '40% auto'
14
18
  }
@@ -14,7 +14,7 @@ import Box from '../components/Box';
14
14
  import SelectField from '../components/SelectField';
15
15
  import Text from '../components/Text';
16
16
  import TextField from '../components/TextField';
17
- import { flatColorList } from './colors.js';
17
+ import { flatColorList } from './colors';
18
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
19
  var exactMatchThreshold = 0.02;
20
20
  function Color(_ref) {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './badge';
1
2
  export * from './box';
2
3
  export * from './button';
3
4
  export * from './icon';
@@ -27,7 +27,13 @@ export var FIGMA_LINKS = {
27
27
  overflowing: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45064-7148&mode=design&t=0RGDgLyKBzT6bOXO-0'
28
28
  },
29
29
  button: {
30
- "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=0-1&t=8Wwd3tIBh3GEjCJB-0'
30
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47047&mode=dev',
31
+ disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54887&mode=dev',
32
+ textIconButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54941&mode=dev',
33
+ inlineButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47247&mode=dev',
34
+ colorBlockButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47405&mode=dev',
35
+ critical: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47237&mode=dev',
36
+ primary: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47151&mode=dev'
31
37
  },
32
38
  buttonBar: {
33
39
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A753&mode=dev',
@@ -36,7 +42,13 @@ export var FIGMA_LINKS = {
36
42
  secondaryRightAligned: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A788&mode=dev'
37
43
  },
38
44
  calendar: {
39
- "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=6373%3A25490&t=BoHXzVpQq9Lf7MaU-1'
45
+ "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=47640-5789&mode=design&t=SZGzEV7PufQjYBN5-4',
46
+ defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-14593&mode=design&t=PX1Q47IuuVvOafDQ-4',
47
+ disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15106&mode=design&t=PX1Q47IuuVvOafDQ-4',
48
+ unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15681&mode=design&t=PX1Q47IuuVvOafDQ-4',
49
+ minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16197&mode=design&t=PX1Q47IuuVvOafDQ-4',
50
+ maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16454&mode=design&t=PX1Q47IuuVvOafDQ-4',
51
+ autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
40
52
  },
41
53
  callout: {
42
54
  "default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289-33201&t=VgqEexa1CXAXfPpp-0'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.36.0-alpha.1",
3
+ "version": "2.36.0-alpha.3",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -139,6 +139,7 @@
139
139
  "@testing-library/react": "^11.0.4",
140
140
  "@testing-library/react-hooks": "^8.0.1",
141
141
  "@testing-library/user-event": "^12.8.3",
142
+ "@types/chroma-js": "^2.4.3",
142
143
  "@types/jest": "^29.5.3",
143
144
  "@types/jest-axe": "^3.5.8",
144
145
  "@types/mdx": "^2.0.5",
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
- var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
5
- var _EnvironmentBreadcrumb = require("./EnvironmentBreadcrumb.test");
6
- (0, _testAxe["default"])(_EnvironmentBreadcrumb.getComponent);
7
- (0, _testAxe["default"])(_EnvironmentBreadcrumb.getSectionsComponent);
@@ -1,4 +0,0 @@
1
- import axeTest from '../../utils/testUtils/testAxe';
2
- import { getComponent, getSectionsComponent } from './EnvironmentBreadcrumb.test';
3
- axeTest(getComponent);
4
- axeTest(getSectionsComponent);