@pingux/astro 2.36.0 → 2.36.1-alpha.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.
@@ -40,7 +40,8 @@ var Calendar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
40
40
  var value = props.value,
41
41
  defaultValue = props.defaultValue,
42
42
  minValue = props.minValue,
43
- maxValue = props.maxValue;
43
+ maxValue = props.maxValue,
44
+ hasAutoFocus = props.hasAutoFocus;
44
45
  var _useLocale = (0, _i18n.useLocale)(),
45
46
  locale = _useLocale.locale;
46
47
  var calenderRef = (0, _react.useRef)();
@@ -55,7 +56,9 @@ var Calendar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
55
56
  maxValue: typeof maxValue === 'string' && (0, _date.parseDate)(maxValue) || maxValue,
56
57
  minValue: typeof minValue === 'string' && (0, _date.parseDate)(minValue) || minValue
57
58
  };
58
- var state = (0, _calendar2.useCalendarState)(_objectSpread(_objectSpread(_objectSpread({}, props), parsedDates), {}, {
59
+ var state = (0, _calendar2.useCalendarState)(_objectSpread(_objectSpread(_objectSpread({
60
+ autoFocus: hasAutoFocus
61
+ }, props), parsedDates), {}, {
59
62
  locale: locale,
60
63
  createCalendar: _date.createCalendar
61
64
  }));
@@ -14,7 +14,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
14
14
  _Object$defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- exports["default"] = exports.UnavailableDates = exports.MinimumDate = exports.MaximumDate = exports.Disabled = exports.DefaultValue = exports.Default = exports.Controlled = exports.Autofocus = void 0;
17
+ exports["default"] = exports.UnavailableDates = exports.MinimumDate = exports.MaximumDate = exports.Disabled = exports.DefaultValue = exports.Default = exports.Controlled = void 0;
18
18
  var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
19
19
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
20
20
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
@@ -210,19 +210,6 @@ MaximumDate.parameters = {
210
210
  url: _figmaLinks.FIGMA_LINKS.calendar.maximumDate
211
211
  }
212
212
  };
213
- var Autofocus = function Autofocus(args) {
214
- return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
215
- "aria-label": "calendar-component",
216
- hasAutoFocus: true
217
- }));
218
- };
219
- exports.Autofocus = Autofocus;
220
- Autofocus.parameters = {
221
- design: {
222
- type: 'figma',
223
- url: _figmaLinks.FIGMA_LINKS.calendar.autofocus
224
- }
225
- };
226
213
  var Controlled = function Controlled(args) {
227
214
  var _useState = (0, _react.useState)(null),
228
215
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
@@ -294,4 +294,5 @@ test('should autofocus on current day with hasAutoFocus', function () {
294
294
  return cell.getAttribute('aria-disabled') !== 'true';
295
295
  });
296
296
  expect(focusedDay[0]).toHaveTextContent(day);
297
+ expect(focusedDay[0]).toHaveFocus();
297
298
  });
@@ -29,7 +29,8 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
29
29
  var value = props.value,
30
30
  defaultValue = props.defaultValue,
31
31
  minValue = props.minValue,
32
- maxValue = props.maxValue;
32
+ maxValue = props.maxValue,
33
+ hasAutoFocus = props.hasAutoFocus;
33
34
  var _useLocale = useLocale(),
34
35
  locale = _useLocale.locale;
35
36
  var calenderRef = useRef();
@@ -44,7 +45,9 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
44
45
  maxValue: typeof maxValue === 'string' && parseDate(maxValue) || maxValue,
45
46
  minValue: typeof minValue === 'string' && parseDate(minValue) || minValue
46
47
  };
47
- var state = useCalendarState(_objectSpread(_objectSpread(_objectSpread({}, props), parsedDates), {}, {
48
+ var state = useCalendarState(_objectSpread(_objectSpread(_objectSpread({
49
+ autoFocus: hasAutoFocus
50
+ }, props), parsedDates), {}, {
48
51
  locale: locale,
49
52
  createCalendar: createCalendar
50
53
  }));
@@ -192,18 +192,6 @@ MaximumDate.parameters = {
192
192
  url: FIGMA_LINKS.calendar.maximumDate
193
193
  }
194
194
  };
195
- export var Autofocus = function Autofocus(args) {
196
- return ___EmotionJSX(Calendar, _extends({}, args, {
197
- "aria-label": "calendar-component",
198
- hasAutoFocus: true
199
- }));
200
- };
201
- Autofocus.parameters = {
202
- design: {
203
- type: 'figma',
204
- url: FIGMA_LINKS.calendar.autofocus
205
- }
206
- };
207
195
  export var Controlled = function Controlled(args) {
208
196
  var _useState = useState(null),
209
197
  _useState2 = _slicedToArray(_useState, 2),
@@ -291,4 +291,5 @@ test('should autofocus on current day with hasAutoFocus', function () {
291
291
  return cell.getAttribute('aria-disabled') !== 'true';
292
292
  });
293
293
  expect(focusedDay[0]).toHaveTextContent(day);
294
+ expect(focusedDay[0]).toHaveFocus();
294
295
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.36.0",
3
+ "version": "2.36.1-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",