@pingux/astro 2.46.0-alpha.0 → 2.46.0-alpha.1

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { InputProps } from '../../types';
3
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
4
+ export default Input;
@@ -9,15 +9,16 @@ _Object$defineProperty(exports, "__esModule", {
9
9
  value: true
10
10
  });
11
11
  exports["default"] = void 0;
12
- var _isInteger = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/number/is-integer"));
13
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
13
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
14
+ var _base = _interopRequireDefault(require("@emotion/styled/base"));
15
15
  var _react = _interopRequireWildcard(require("react"));
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _styledSystem = require("styled-system");
17
17
  var _themeUi = require("theme-ui");
18
- var _isValidPositiveInt = _interopRequireDefault(require("../../utils/devUtils/props/isValidPositiveInt"));
19
18
  var _react2 = require("@emotion/react");
20
19
  var _excluded = ["name", "placeholder", "maxLength"];
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
22
  /**
22
23
  * Base input component.
23
24
  *
@@ -28,34 +29,25 @@ var _excluded = ["name", "placeholder", "maxLength"];
28
29
  * We instead encourage developers to utilize our Field components wherever possible.
29
30
  * If this component is used, accessibility is left to the developer.
30
31
  */
31
- function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
+
33
+ var ExtendedInput = /*#__PURE__*/(0, _base["default"])(_themeUi.Input, process.env.NODE_ENV === "production" ? {
34
+ target: "e1lpwkt50"
35
+ } : {
36
+ target: "e1lpwkt50",
37
+ label: "ExtendedInput"
38
+ })(_styledSystem.layout, _styledSystem.flexbox, _styledSystem.typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data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GVyZXZlciBwb3NzaWJsZS5cbiAqIElmIHRoaXMgY29tcG9uZW50IGlzIHVzZWQsIGFjY2Vzc2liaWxpdHkgaXMgbGVmdCB0byB0aGUgZGV2ZWxvcGVyLlxuICovXG5cbmNvbnN0IEV4dGVuZGVkSW5wdXQgPSBzdHlsZWQoVGhlbWVVSUlucHV0KShcbiAgbGF5b3V0LFxuICBmbGV4Ym94LFxuICB0eXBvZ3JhcGh5LFxuKTtcblxuY29uc3QgSW5wdXQgPSBmb3J3YXJkUmVmPEhUTUxJbnB1dEVsZW1lbnQsIElucHV0UHJvcHM+KChwcm9wcywgcmVmKSA9PiB7XG4gIGNvbnN0IHsgbmFtZSwgcGxhY2Vob2xkZXIsIG1heExlbmd0aCwgLi4ub3RoZXJzIH0gPSBwcm9wcztcblxuICByZXR1cm4gKFxuICAgIDxFeHRlbmRlZElucHV0XG4gICAgICByZWY9e3JlZn1cbiAgICAgIG5hbWU9e25hbWV9XG4gICAgICBwbGFjZWhvbGRlcj17cGxhY2Vob2xkZXJ9XG4gICAgICBtYXhMZW5ndGg9e21heExlbmd0aCAmJiBtYXhMZW5ndGh9XG4gICAgICB7Li4ub3RoZXJzfVxuICAgIC8+XG4gICk7XG59KTtcblxuSW5wdXQuZGlzcGxheU5hbWUgPSAnSW5wdXQnO1xuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcbiJdfQ== */");
33
39
  var Input = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
40
  var name = props.name,
35
41
  placeholder = props.placeholder,
36
42
  maxLength = props.maxLength,
37
43
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
38
- return (0, _react2.jsx)(_themeUi.Input, (0, _extends2["default"])({
44
+ return (0, _react2.jsx)(ExtendedInput, (0, _extends2["default"])({
39
45
  ref: ref,
40
46
  name: name,
41
47
  placeholder: placeholder,
42
- maxLength: (0, _isInteger["default"])(maxLength) && maxLength > 0 ? maxLength : undefined
48
+ maxLength: maxLength && maxLength
43
49
  }, others));
44
50
  });
45
51
  Input.displayName = 'Input';
46
- Input.propTypes = {
47
- /** Defines a string value that labels the current element. */
48
- 'aria-label': _propTypes["default"].string,
49
- /** Id of input. */
50
- id: _propTypes["default"].string,
51
- /** Name of input. */
52
- name: _propTypes["default"].string,
53
- /** Max length of input value */
54
- maxLength: _isValidPositiveInt["default"],
55
- /** Type of input. Accepts most [HTML input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) */
56
- type: _propTypes["default"].string,
57
- /** Placeholder for the input */
58
- placeholder: _propTypes["default"].string
59
- };
60
52
  var _default = Input;
61
53
  exports["default"] = _default;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { StoryFn } from '@storybook/react';
3
+ import { InputProps } from '../../types';
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
7
+ argTypes: {
8
+ placeholder: {};
9
+ type: {};
10
+ name: {};
11
+ id: {};
12
+ };
13
+ args: {
14
+ placeholder: string;
15
+ };
16
+ };
17
+ export default _default;
18
+ export declare const Default: StoryFn<InputProps>;
19
+ export declare const Password: StoryFn;
20
+ export declare const LargeInput: StoryFn;
@@ -0,0 +1,8 @@
1
+ import { ThemeUICSSObject } from 'theme-ui';
2
+ export declare const defaultFocus: {
3
+ borderColor: string;
4
+ outline: string;
5
+ outlineColor: string;
6
+ outlineOffset: string;
7
+ };
8
+ export declare const input: ThemeUICSSObject;
@@ -31,7 +31,6 @@ var defaultFocus = {
31
31
  outlineColor: 'accent.60',
32
32
  outlineOffset: '0px'
33
33
  };
34
-
35
34
  // Default input styling
36
35
  exports.defaultFocus = defaultFocus;
37
36
  var input = _objectSpread(_objectSpread({}, _Text.text.inputValue), {}, {
@@ -0,0 +1 @@
1
+ export {};
@@ -45,17 +45,9 @@ test('maxlength field with a set maxlength', function () {
45
45
  _userEvent["default"].type(input, 'banana');
46
46
  expect(input.value.length).toBe(3);
47
47
  });
48
- test('maxlength field is not set as null', function () {
48
+ test('maxlength field is not set as undefined', function () {
49
49
  getComponent({
50
- maxLength: null
51
- });
52
- var input = _react2.screen.getByTestId(testId);
53
- _userEvent["default"].type(input, 'banana');
54
- expect(input.value.length).toBe(6);
55
- });
56
- test('maxlength field is not set as zero', function () {
57
- getComponent({
58
- maxLength: 0
50
+ maxLength: undefined
59
51
  });
60
52
  var input = _react2.screen.getByTestId(testId);
61
53
  _userEvent["default"].type(input, 'banana');
@@ -0,0 +1 @@
1
+ export { default } from './Input';
@@ -8,6 +8,7 @@ export * from './fieldHelperText';
8
8
  export * from './icon';
9
9
  export * from './iconBadge';
10
10
  export * from './iconButton';
11
+ export * from './input';
11
12
  export * from './item';
12
13
  export * from './link';
13
14
  export * from './listItem';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22;
3
+ var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23;
4
4
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
5
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6
6
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
@@ -117,8 +117,19 @@ _forEachInstanceProperty(_context10 = _Object$keys(_iconButton)).call(_context10
117
117
  }
118
118
  });
119
119
  });
120
+ var _input = require("./input");
121
+ _forEachInstanceProperty(_context11 = _Object$keys(_input)).call(_context11, function (key) {
122
+ if (key === "default" || key === "__esModule") return;
123
+ if (key in exports && exports[key] === _input[key]) return;
124
+ _Object$defineProperty(exports, key, {
125
+ enumerable: true,
126
+ get: function get() {
127
+ return _input[key];
128
+ }
129
+ });
130
+ });
120
131
  var _item = require("./item");
121
- _forEachInstanceProperty(_context11 = _Object$keys(_item)).call(_context11, function (key) {
132
+ _forEachInstanceProperty(_context12 = _Object$keys(_item)).call(_context12, function (key) {
122
133
  if (key === "default" || key === "__esModule") return;
123
134
  if (key in exports && exports[key] === _item[key]) return;
124
135
  _Object$defineProperty(exports, key, {
@@ -129,7 +140,7 @@ _forEachInstanceProperty(_context11 = _Object$keys(_item)).call(_context11, func
129
140
  });
130
141
  });
131
142
  var _link = require("./link");
132
- _forEachInstanceProperty(_context12 = _Object$keys(_link)).call(_context12, function (key) {
143
+ _forEachInstanceProperty(_context13 = _Object$keys(_link)).call(_context13, function (key) {
133
144
  if (key === "default" || key === "__esModule") return;
134
145
  if (key in exports && exports[key] === _link[key]) return;
135
146
  _Object$defineProperty(exports, key, {
@@ -140,7 +151,7 @@ _forEachInstanceProperty(_context12 = _Object$keys(_link)).call(_context12, func
140
151
  });
141
152
  });
142
153
  var _listItem = require("./listItem");
143
- _forEachInstanceProperty(_context13 = _Object$keys(_listItem)).call(_context13, function (key) {
154
+ _forEachInstanceProperty(_context14 = _Object$keys(_listItem)).call(_context14, function (key) {
144
155
  if (key === "default" || key === "__esModule") return;
145
156
  if (key in exports && exports[key] === _listItem[key]) return;
146
157
  _Object$defineProperty(exports, key, {
@@ -151,7 +162,7 @@ _forEachInstanceProperty(_context13 = _Object$keys(_listItem)).call(_context13,
151
162
  });
152
163
  });
153
164
  var _loader = require("./loader");
154
- _forEachInstanceProperty(_context14 = _Object$keys(_loader)).call(_context14, function (key) {
165
+ _forEachInstanceProperty(_context15 = _Object$keys(_loader)).call(_context15, function (key) {
155
166
  if (key === "default" || key === "__esModule") return;
156
167
  if (key in exports && exports[key] === _loader[key]) return;
157
168
  _Object$defineProperty(exports, key, {
@@ -162,7 +173,7 @@ _forEachInstanceProperty(_context14 = _Object$keys(_loader)).call(_context14, fu
162
173
  });
163
174
  });
164
175
  var _overlayPanel = require("./overlayPanel");
165
- _forEachInstanceProperty(_context15 = _Object$keys(_overlayPanel)).call(_context15, function (key) {
176
+ _forEachInstanceProperty(_context16 = _Object$keys(_overlayPanel)).call(_context16, function (key) {
166
177
  if (key === "default" || key === "__esModule") return;
167
178
  if (key in exports && exports[key] === _overlayPanel[key]) return;
168
179
  _Object$defineProperty(exports, key, {
@@ -173,7 +184,7 @@ _forEachInstanceProperty(_context15 = _Object$keys(_overlayPanel)).call(_context
173
184
  });
174
185
  });
175
186
  var _popoverContainer = require("./popoverContainer");
176
- _forEachInstanceProperty(_context16 = _Object$keys(_popoverContainer)).call(_context16, function (key) {
187
+ _forEachInstanceProperty(_context17 = _Object$keys(_popoverContainer)).call(_context17, function (key) {
177
188
  if (key === "default" || key === "__esModule") return;
178
189
  if (key in exports && exports[key] === _popoverContainer[key]) return;
179
190
  _Object$defineProperty(exports, key, {
@@ -184,7 +195,7 @@ _forEachInstanceProperty(_context16 = _Object$keys(_popoverContainer)).call(_con
184
195
  });
185
196
  });
186
197
  var _popoverMenu = require("./popoverMenu");
187
- _forEachInstanceProperty(_context17 = _Object$keys(_popoverMenu)).call(_context17, function (key) {
198
+ _forEachInstanceProperty(_context18 = _Object$keys(_popoverMenu)).call(_context18, function (key) {
188
199
  if (key === "default" || key === "__esModule") return;
189
200
  if (key in exports && exports[key] === _popoverMenu[key]) return;
190
201
  _Object$defineProperty(exports, key, {
@@ -195,7 +206,7 @@ _forEachInstanceProperty(_context17 = _Object$keys(_popoverMenu)).call(_context1
195
206
  });
196
207
  });
197
208
  var _separator = require("./separator");
198
- _forEachInstanceProperty(_context18 = _Object$keys(_separator)).call(_context18, function (key) {
209
+ _forEachInstanceProperty(_context19 = _Object$keys(_separator)).call(_context19, function (key) {
199
210
  if (key === "default" || key === "__esModule") return;
200
211
  if (key in exports && exports[key] === _separator[key]) return;
201
212
  _Object$defineProperty(exports, key, {
@@ -206,7 +217,7 @@ _forEachInstanceProperty(_context18 = _Object$keys(_separator)).call(_context18,
206
217
  });
207
218
  });
208
219
  var _shared = require("./shared");
209
- _forEachInstanceProperty(_context19 = _Object$keys(_shared)).call(_context19, function (key) {
220
+ _forEachInstanceProperty(_context20 = _Object$keys(_shared)).call(_context20, function (key) {
210
221
  if (key === "default" || key === "__esModule") return;
211
222
  if (key in exports && exports[key] === _shared[key]) return;
212
223
  _Object$defineProperty(exports, key, {
@@ -217,7 +228,7 @@ _forEachInstanceProperty(_context19 = _Object$keys(_shared)).call(_context19, fu
217
228
  });
218
229
  });
219
230
  var _table = require("./table");
220
- _forEachInstanceProperty(_context20 = _Object$keys(_table)).call(_context20, function (key) {
231
+ _forEachInstanceProperty(_context21 = _Object$keys(_table)).call(_context21, function (key) {
221
232
  if (key === "default" || key === "__esModule") return;
222
233
  if (key in exports && exports[key] === _table[key]) return;
223
234
  _Object$defineProperty(exports, key, {
@@ -228,7 +239,7 @@ _forEachInstanceProperty(_context20 = _Object$keys(_table)).call(_context20, fun
228
239
  });
229
240
  });
230
241
  var _text = require("./text");
231
- _forEachInstanceProperty(_context21 = _Object$keys(_text)).call(_context21, function (key) {
242
+ _forEachInstanceProperty(_context22 = _Object$keys(_text)).call(_context22, function (key) {
232
243
  if (key === "default" || key === "__esModule") return;
233
244
  if (key in exports && exports[key] === _text[key]) return;
234
245
  _Object$defineProperty(exports, key, {
@@ -239,7 +250,7 @@ _forEachInstanceProperty(_context21 = _Object$keys(_text)).call(_context21, func
239
250
  });
240
251
  });
241
252
  var _tooltipTrigger = require("./tooltipTrigger");
242
- _forEachInstanceProperty(_context22 = _Object$keys(_tooltipTrigger)).call(_context22, function (key) {
253
+ _forEachInstanceProperty(_context23 = _Object$keys(_tooltipTrigger)).call(_context23, function (key) {
243
254
  if (key === "default" || key === "__esModule") return;
244
255
  if (key in exports && exports[key] === _tooltipTrigger[key]) return;
245
256
  _Object$defineProperty(exports, key, {
@@ -0,0 +1,18 @@
1
+ import { TestingAttributes } from './shared/test';
2
+ import { DOMAttributes, StyleProps, ValidPositiveInteger } from './shared';
3
+ export interface InputProps extends StyleProps, DOMAttributes, TestingAttributes {
4
+ /** Defines a string value that labels the current element. */
5
+ 'aria-label'?: string;
6
+ /** Id of input. */
7
+ id?: string;
8
+ /** Name of input. */
9
+ name?: string;
10
+ /** Max length of input value */
11
+ maxLength?: ValidPositiveInteger;
12
+ /** Type of input. Accepts most [HTML input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) */
13
+ type?: string;
14
+ /** Placeholder for the input */
15
+ placeholder?: string;
16
+ /** Styling variant for the input */
17
+ variant?: string;
18
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -3,3 +3,4 @@ export * from './events';
3
3
  export * from './orientation';
4
4
  export * from './style';
5
5
  export * from './utils';
6
+ export * from './validPositiveInteger';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _context, _context2, _context3, _context4, _context5;
3
+ var _context, _context2, _context3, _context4, _context5, _context6;
4
4
  var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
5
  var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
6
6
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
@@ -61,4 +61,15 @@ _forEachInstanceProperty(_context5 = _Object$keys(_utils)).call(_context5, funct
61
61
  return _utils[key];
62
62
  }
63
63
  });
64
+ });
65
+ var _validPositiveInteger = require("./validPositiveInteger");
66
+ _forEachInstanceProperty(_context6 = _Object$keys(_validPositiveInteger)).call(_context6, function (key) {
67
+ if (key === "default" || key === "__esModule") return;
68
+ if (key in exports && exports[key] === _validPositiveInteger[key]) return;
69
+ _Object$defineProperty(exports, key, {
70
+ enumerable: true,
71
+ get: function get() {
72
+ return _validPositiveInteger[key];
73
+ }
74
+ });
64
75
  });
@@ -0,0 +1,4 @@
1
+ type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
2
+ type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
3
+ export type ValidPositiveInteger = Range<1, 999>;
4
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -1,11 +1,11 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
+ import _styled from "@emotion/styled/base";
3
4
  var _excluded = ["name", "placeholder", "maxLength"];
4
- import _Number$isInteger from "@babel/runtime-corejs3/core-js-stable/number/is-integer";
5
5
  import React, { forwardRef } from 'react';
6
- import PropTypes from 'prop-types';
6
+ import { flexbox, layout, typography } from 'styled-system';
7
7
  import { Input as ThemeUIInput } from 'theme-ui';
8
- import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
9
  /**
10
10
  * Base input component.
11
11
  *
@@ -16,32 +16,24 @@ import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
16
16
  * We instead encourage developers to utilize our Field components wherever possible.
17
17
  * If this component is used, accessibility is left to the developer.
18
18
  */
19
- import { jsx as ___EmotionJSX } from "@emotion/react";
19
+
20
+ var ExtendedInput = /*#__PURE__*/_styled(ThemeUIInput, process.env.NODE_ENV === "production" ? {
21
+ target: "e1lpwkt50"
22
+ } : {
23
+ target: "e1lpwkt50",
24
+ label: "ExtendedInput"
25
+ })(layout, flexbox, typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0lucHV0L0lucHV0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdz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uZGVkSW5wdXQgPSBzdHlsZWQoVGhlbWVVSUlucHV0KShcbiAgbGF5b3V0LFxuICBmbGV4Ym94LFxuICB0eXBvZ3JhcGh5LFxuKTtcblxuY29uc3QgSW5wdXQgPSBmb3J3YXJkUmVmPEhUTUxJbnB1dEVsZW1lbnQsIElucHV0UHJvcHM+KChwcm9wcywgcmVmKSA9PiB7XG4gIGNvbnN0IHsgbmFtZSwgcGxhY2Vob2xkZXIsIG1heExlbmd0aCwgLi4ub3RoZXJzIH0gPSBwcm9wcztcblxuICByZXR1cm4gKFxuICAgIDxFeHRlbmRlZElucHV0XG4gICAgICByZWY9e3JlZn1cbiAgICAgIG5hbWU9e25hbWV9XG4gICAgICBwbGFjZWhvbGRlcj17cGxhY2Vob2xkZXJ9XG4gICAgICBtYXhMZW5ndGg9e21heExlbmd0aCAmJiBtYXhMZW5ndGh9XG4gICAgICB7Li4ub3RoZXJzfVxuICAgIC8+XG4gICk7XG59KTtcblxuSW5wdXQuZGlzcGxheU5hbWUgPSAnSW5wdXQnO1xuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcbiJdfQ== */");
20
26
  var Input = /*#__PURE__*/forwardRef(function (props, ref) {
21
27
  var name = props.name,
22
28
  placeholder = props.placeholder,
23
29
  maxLength = props.maxLength,
24
30
  others = _objectWithoutProperties(props, _excluded);
25
- return ___EmotionJSX(ThemeUIInput, _extends({
31
+ return ___EmotionJSX(ExtendedInput, _extends({
26
32
  ref: ref,
27
33
  name: name,
28
34
  placeholder: placeholder,
29
- maxLength: _Number$isInteger(maxLength) && maxLength > 0 ? maxLength : undefined
35
+ maxLength: maxLength && maxLength
30
36
  }, others));
31
37
  });
32
38
  Input.displayName = 'Input';
33
- Input.propTypes = {
34
- /** Defines a string value that labels the current element. */
35
- 'aria-label': PropTypes.string,
36
- /** Id of input. */
37
- id: PropTypes.string,
38
- /** Name of input. */
39
- name: PropTypes.string,
40
- /** Max length of input value */
41
- maxLength: isValidPositiveInt,
42
- /** Type of input. Accepts most [HTML input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) */
43
- type: PropTypes.string,
44
- /** Placeholder for the input */
45
- placeholder: PropTypes.string
46
- };
47
39
  export default Input;
@@ -25,7 +25,6 @@ export var defaultFocus = {
25
25
  outlineColor: 'accent.60',
26
26
  outlineOffset: '0px'
27
27
  };
28
-
29
28
  // Default input styling
30
29
  export var input = _objectSpread(_objectSpread({}, text.inputValue), {}, {
31
30
  appearance: 'none',
@@ -42,17 +42,9 @@ test('maxlength field with a set maxlength', function () {
42
42
  userEvent.type(input, 'banana');
43
43
  expect(input.value.length).toBe(3);
44
44
  });
45
- test('maxlength field is not set as null', function () {
45
+ test('maxlength field is not set as undefined', function () {
46
46
  getComponent({
47
- maxLength: null
48
- });
49
- var input = screen.getByTestId(testId);
50
- userEvent.type(input, 'banana');
51
- expect(input.value.length).toBe(6);
52
- });
53
- test('maxlength field is not set as zero', function () {
54
- getComponent({
55
- maxLength: 0
47
+ maxLength: undefined
56
48
  });
57
49
  var input = screen.getByTestId(testId);
58
50
  userEvent.type(input, 'banana');
@@ -8,6 +8,7 @@ export * from './fieldHelperText';
8
8
  export * from './icon';
9
9
  export * from './iconBadge';
10
10
  export * from './iconButton';
11
+ export * from './input';
11
12
  export * from './item';
12
13
  export * from './link';
13
14
  export * from './listItem';
@@ -0,0 +1 @@
1
+ export {};
@@ -2,4 +2,5 @@ export * from './dom';
2
2
  export * from './events';
3
3
  export * from './orientation';
4
4
  export * from './style';
5
- export * from './utils';
5
+ export * from './utils';
6
+ export * from './validPositiveInteger';
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.46.0-alpha.0",
3
+ "version": "2.46.0-alpha.1",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",