@pingux/astro 2.174.0 → 2.174.2-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.
Files changed (22) hide show
  1. package/lib/cjs/components/Badge/Badge.js +7 -2
  2. package/lib/cjs/components/NumberField/NumberField.js +1 -4
  3. package/lib/cjs/components/NumberField/NumberField.test.js +26 -3
  4. package/lib/cjs/libs/astro/src/hooks/useGetTheme/useGetTheme.d.ts +2 -0
  5. package/lib/cjs/libs/astro/src/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +1 -0
  6. package/lib/cjs/libs/astro/src/styles/themes/astro/customProperties/index.d.ts +1 -0
  7. package/lib/cjs/libs/astro/src/styles/themes/next-gen/customProperties/index.d.ts +1 -0
  8. package/lib/cjs/libs/astro/src/styles/themes/next-gen/next-gen.d.ts +44 -132
  9. package/lib/cjs/libs/astro/src/styles/themes/next-gen/variants/badges.d.ts +44 -132
  10. package/lib/cjs/libs/astro/tsconfig.lib.tsbuildinfo +1 -1
  11. package/lib/cjs/styles/themeOverrides/stories/NumberField.chromatic.stories.js +4 -1
  12. package/lib/cjs/styles/themes/astro/customProperties/index.js +3 -1
  13. package/lib/cjs/styles/themes/next-gen/customProperties/index.js +2 -0
  14. package/lib/cjs/styles/themes/next-gen/variants/badges.js +3 -8
  15. package/lib/components/Badge/Badge.js +7 -2
  16. package/lib/components/NumberField/NumberField.js +1 -4
  17. package/lib/components/NumberField/NumberField.test.js +26 -3
  18. package/lib/styles/themeOverrides/stories/NumberField.chromatic.stories.js +4 -1
  19. package/lib/styles/themes/astro/customProperties/index.js +3 -1
  20. package/lib/styles/themes/next-gen/customProperties/index.js +2 -0
  21. package/lib/styles/themes/next-gen/variants/badges.js +3 -8
  22. package/package.json +1 -1
@@ -16,5 +16,8 @@ var _default = exports["default"] = {
16
16
  decorators: [_withUiLibraryCss["default"]]
17
17
  };
18
18
  var Default = exports.Default = function Default() {
19
- return (0, _react2.jsx)(_index.NumberField, null);
19
+ return (0, _react2.jsx)(_index.NumberField, {
20
+ label: "Example Label",
21
+ defaultValue: 17
22
+ });
20
23
  };
@@ -33,6 +33,7 @@ var defaultIconSize = 'sm';
33
33
  var linkSelectFieldWidth = '10em';
34
34
  var calendarIconSize = 25;
35
35
  var navBarIconSize = 18;
36
+ var badgeTextFontSize = '';
36
37
  var astroThemeValues = exports.astroThemeValues = {
37
38
  accordionItemDefaultLabelTag: accordionItemDefaultLabelTag,
38
39
  navBarIconSize: navBarIconSize,
@@ -63,5 +64,6 @@ var astroThemeValues = exports.astroThemeValues = {
63
64
  blueText: '#FFFFFF',
64
65
  greyText: '#FFFFFF'
65
66
  },
66
- linkSelectFieldWidth: linkSelectFieldWidth
67
+ linkSelectFieldWidth: linkSelectFieldWidth,
68
+ badgeTextFontSize: badgeTextFontSize
67
69
  };
@@ -39,6 +39,7 @@ var badgeStyles = {
39
39
  };
40
40
  var linkSelectFieldWidth = '12em';
41
41
  var calendarIconSize = 'sm';
42
+ var badgeTextFontSize = '75%';
42
43
  var navBarIconSize = '20px';
43
44
  var nextGenThemeValues = exports.nextGenThemeValues = _objectSpread({
44
45
  activeColor: activeColor,
@@ -57,5 +58,6 @@ var nextGenThemeValues = exports.nextGenThemeValues = _objectSpread({
57
58
  calendarIconSize: calendarIconSize,
58
59
  buttonLoaderSize: buttonLoaderSize,
59
60
  badgeStyles: badgeStyles,
61
+ badgeTextFontSize: badgeTextFontSize,
60
62
  linkSelectFieldWidth: linkSelectFieldWidth
61
63
  }, _customSizes["default"]);
@@ -19,9 +19,7 @@ var _button = _interopRequireDefault(require("./button"));
19
19
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
20
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
21
21
  var badgeFont = {
22
- fontSize: _onyxTokens.astroTokens.size.badge,
23
- // @ts-expect-error - font-weight is in default tokens but not in the type definition
24
- fontWeight: _onyxTokens.astroTokens["default"]['font-weight'].badge
22
+ fontWeight: '2'
25
23
  };
26
24
  var badgeIconStyle = {
27
25
  '& span': _objectSpread({}, badgeFont),
@@ -47,12 +45,9 @@ var badgeIconStyle = {
47
45
  var baseBadge = _objectSpread({
48
46
  alignItems: 'center',
49
47
  justifyContent: 'center',
50
- py: _onyxTokens.astroTokens.spacing.badge['padding-y'],
51
- px: _onyxTokens.astroTokens.spacing.badge['padding-x'],
48
+ padding: '.25em .4em',
52
49
  borderRadius: '4px',
53
- maxHeight: '18px',
54
- minHeight: '18px',
55
- fontSize: 'tiny',
50
+ fontSize: 'unset',
56
51
  alignSelf: 'flex-start',
57
52
  display: 'inline-flex !important',
58
53
  width: 'fit-content',
@@ -17,6 +17,7 @@ import React from 'react';
17
17
  import { Badge as ThemeUIBadge } from 'theme-ui';
18
18
  import { Box, Text } from '../..';
19
19
  import { BadgeContext } from '../../context/BadgeContext';
20
+ import { useGetTheme } from '../../hooks';
20
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
22
  var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
22
23
  var align = props.align,
@@ -33,6 +34,8 @@ var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
33
34
  textProps = props.textProps,
34
35
  variant = props.variant,
35
36
  others = _objectWithoutProperties(props, _excluded);
37
+ var _useGetTheme = useGetTheme(),
38
+ badgeTextFontSize = _useGetTheme.badgeTextFontSize;
36
39
  var badgeSx = _objectSpread(_objectSpread(_objectSpread({}, isUppercase && {
37
40
  paddingBottom: '3px'
38
41
  }), align && _defineProperty({
@@ -62,10 +65,12 @@ var Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
62
65
  }, slots.leftIcon), ___EmotionJSX(Text, _extends({
63
66
  variant: "label",
64
67
  color: textColor,
65
- sx: isUppercase ? {
68
+ sx: _objectSpread({
69
+ fontSize: badgeTextFontSize || ''
70
+ }, isUppercase ? {
66
71
  textTransform: 'uppercase',
67
72
  fontSize: '11px'
68
- } : {}
73
+ } : {})
69
74
  }, textProps), label), children));
70
75
  });
71
76
  export default Badge;
@@ -96,10 +96,7 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
96
96
  var helperTextId = uuid();
97
97
  var updatedLabelProps = _objectSpread({}, mergeProps(fieldLabelProps, labelProps));
98
98
  var inputPropsValue = inputProps.value || 0;
99
-
100
- // extract numeric value in case input value use units like '4 inches' or 'USD 45.00'
101
- // aria-valuenow accept only number value type
102
- var inputPropsNumericValue = typeof inputPropsValue === 'string' ? inputPropsValue.match(/[-]{0,1}[\d]*[.]{0,1}[\d]+/g)[0] : inputPropsValue;
99
+ var inputPropsNumericValue = state.numberValue;
103
100
  return ___EmotionJSX(Box, _extends({}, getPendoID('NumberField'), fieldContainerProps), ___EmotionJSX(Label, updatedLabelProps), ___EmotionJSX(Box, _extends({
104
101
  variant: "forms.numberField.noDefaultArrows"
105
102
  }, groupProps), ___EmotionJSX(Box, _extends({
@@ -9,7 +9,7 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
9
9
  import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
10
10
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
11
11
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
12
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var _context8; _forEachInstanceProperty(_context8 = ["next", "throw", "return"]).call(_context8, function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], _forEachInstanceProperty(t).call(t, w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = _Object$create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = _Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { var _context9; if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context9 = this.tryEntries).call(_context9, m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+_sliceInstanceProperty(e).call(e, 1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
12
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof _Symbol ? _Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return _Object$defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = _Object$create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = _Object$getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(l); function g(t) { var _context9; _forEachInstanceProperty(_context9 = ["next", "throw", "return"]).call(_context9, function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], _forEachInstanceProperty(t).call(t, w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = _Object$create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = _Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { var _context0; if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context0 = this.tryEntries).call(_context0, m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+_sliceInstanceProperty(e).call(e, 1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
13
13
  import React from 'react';
14
14
  import { fireEvent } from '@testing-library/react';
15
15
  import userEvent from '@testing-library/user-event';
@@ -278,5 +278,28 @@ test('should extract numeric value from currency format and pass it to aria-valu
278
278
  currencySign: 'accounting'
279
279
  }
280
280
  });
281
- expect(screen.getByRole('spinbutton')).toHaveAttribute('aria-valuenow', String(numericValue.toFixed(2)));
282
- });
281
+ expect(screen.getByRole('spinbutton')).toHaveAttribute('aria-valuenow', String(numericValue));
282
+ });
283
+ it('allows typing a negative sign', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
284
+ var numericValue, numberInput;
285
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
286
+ while (1) switch (_context8.prev = _context8.next) {
287
+ case 0:
288
+ numericValue = 45;
289
+ getComponent({
290
+ defaultValue: numericValue
291
+ });
292
+ numberInput = screen.queryAllByLabelText(testLabel)[1];
293
+ _context8.next = 5;
294
+ return userEvent.clear(numberInput);
295
+ case 5:
296
+ _context8.next = 7;
297
+ return userEvent.type(numberInput, '-45');
298
+ case 7:
299
+ expect(numberInput).toHaveValue('-45');
300
+ case 8:
301
+ case "end":
302
+ return _context8.stop();
303
+ }
304
+ }, _callee8);
305
+ })));
@@ -8,5 +8,8 @@ export default {
8
8
  decorators: [WithUiLibraryCss]
9
9
  };
10
10
  export var Default = function Default() {
11
- return ___EmotionJSX(NumberField, null);
11
+ return ___EmotionJSX(NumberField, {
12
+ label: "Example Label",
13
+ defaultValue: 17
14
+ });
12
15
  };
@@ -21,6 +21,7 @@ var defaultIconSize = 'sm';
21
21
  var linkSelectFieldWidth = '10em';
22
22
  var calendarIconSize = 25;
23
23
  var navBarIconSize = 18;
24
+ var badgeTextFontSize = '';
24
25
  export var astroThemeValues = {
25
26
  accordionItemDefaultLabelTag: accordionItemDefaultLabelTag,
26
27
  navBarIconSize: navBarIconSize,
@@ -51,5 +52,6 @@ export var astroThemeValues = {
51
52
  blueText: '#FFFFFF',
52
53
  greyText: '#FFFFFF'
53
54
  },
54
- linkSelectFieldWidth: linkSelectFieldWidth
55
+ linkSelectFieldWidth: linkSelectFieldWidth,
56
+ badgeTextFontSize: badgeTextFontSize
55
57
  };
@@ -29,6 +29,7 @@ var badgeStyles = {
29
29
  };
30
30
  var linkSelectFieldWidth = '12em';
31
31
  var calendarIconSize = 'sm';
32
+ var badgeTextFontSize = '75%';
32
33
  var navBarIconSize = '20px';
33
34
  export var nextGenThemeValues = _objectSpread({
34
35
  activeColor: activeColor,
@@ -47,5 +48,6 @@ export var nextGenThemeValues = _objectSpread({
47
48
  calendarIconSize: calendarIconSize,
48
49
  buttonLoaderSize: buttonLoaderSize,
49
50
  badgeStyles: badgeStyles,
51
+ badgeTextFontSize: badgeTextFontSize,
50
52
  linkSelectFieldWidth: linkSelectFieldWidth
51
53
  }, customSizes);
@@ -12,9 +12,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
12
12
  import { astroTokens } from '@pingux/onyx-tokens';
13
13
  import buttons from './button';
14
14
  var badgeFont = {
15
- fontSize: astroTokens.size.badge,
16
- // @ts-expect-error - font-weight is in default tokens but not in the type definition
17
- fontWeight: astroTokens["default"]['font-weight'].badge
15
+ fontWeight: '2'
18
16
  };
19
17
  var badgeIconStyle = {
20
18
  '& span': _objectSpread({}, badgeFont),
@@ -40,12 +38,9 @@ var badgeIconStyle = {
40
38
  var baseBadge = _objectSpread({
41
39
  alignItems: 'center',
42
40
  justifyContent: 'center',
43
- py: astroTokens.spacing.badge['padding-y'],
44
- px: astroTokens.spacing.badge['padding-x'],
41
+ padding: '.25em .4em',
45
42
  borderRadius: '4px',
46
- maxHeight: '18px',
47
- minHeight: '18px',
48
- fontSize: 'tiny',
43
+ fontSize: 'unset',
49
44
  alignSelf: 'flex-start',
50
45
  display: 'inline-flex !important',
51
46
  width: 'fit-content',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.174.0",
3
+ "version": "2.174.2-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",