@pingux/astro 2.36.0-alpha.2 → 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.
- package/lib/cjs/components/Badge/Badge.d.ts +4 -0
- package/lib/cjs/components/Badge/Badge.js +5 -31
- package/lib/cjs/components/Badge/Badge.stories.js +1 -1
- package/lib/cjs/components/Badge/Badge.styles.d.ts +781 -0
- package/lib/cjs/components/Badge/Badge.test.d.ts +1 -0
- package/lib/cjs/components/Badge/index.d.ts +1 -0
- package/lib/cjs/components/Box/Box.stories.js +1 -1
- package/lib/cjs/context/BadgeContext/index.d.ts +2 -0
- package/lib/cjs/hooks/useField/useField.d.ts +24 -24
- package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +3 -3
- package/lib/cjs/styles/ColorDocumentation.js +1 -1
- package/lib/cjs/styles/colors.d.ts +302 -0
- package/lib/cjs/types/badge.d.ts +27 -0
- package/lib/cjs/types/badge.js +6 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +21 -10
- package/lib/components/Badge/Badge.js +5 -31
- package/lib/components/Badge/Badge.stories.js +1 -1
- package/lib/components/Box/Box.stories.js +1 -1
- package/lib/styles/ColorDocumentation.js +1 -1
- package/lib/types/badge.js +1 -0
- package/lib/types/index.js +1 -0
- package/package.json +2 -1
package/lib/cjs/types/index.js
CHANGED
@@ -1,14 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
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");
|
7
7
|
_Object$defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
9
9
|
});
|
10
|
+
var _badge = require("./badge");
|
11
|
+
_forEachInstanceProperty(_context = _Object$keys(_badge)).call(_context, function (key) {
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
13
|
+
if (key in exports && exports[key] === _badge[key]) return;
|
14
|
+
_Object$defineProperty(exports, key, {
|
15
|
+
enumerable: true,
|
16
|
+
get: function get() {
|
17
|
+
return _badge[key];
|
18
|
+
}
|
19
|
+
});
|
20
|
+
});
|
10
21
|
var _box = require("./box");
|
11
|
-
_forEachInstanceProperty(
|
22
|
+
_forEachInstanceProperty(_context2 = _Object$keys(_box)).call(_context2, function (key) {
|
12
23
|
if (key === "default" || key === "__esModule") return;
|
13
24
|
if (key in exports && exports[key] === _box[key]) return;
|
14
25
|
_Object$defineProperty(exports, key, {
|
@@ -19,7 +30,7 @@ _forEachInstanceProperty(_context = _Object$keys(_box)).call(_context, function
|
|
19
30
|
});
|
20
31
|
});
|
21
32
|
var _button = require("./button");
|
22
|
-
_forEachInstanceProperty(
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_button)).call(_context3, function (key) {
|
23
34
|
if (key === "default" || key === "__esModule") return;
|
24
35
|
if (key in exports && exports[key] === _button[key]) return;
|
25
36
|
_Object$defineProperty(exports, key, {
|
@@ -30,7 +41,7 @@ _forEachInstanceProperty(_context2 = _Object$keys(_button)).call(_context2, func
|
|
30
41
|
});
|
31
42
|
});
|
32
43
|
var _icon = require("./icon");
|
33
|
-
_forEachInstanceProperty(
|
44
|
+
_forEachInstanceProperty(_context4 = _Object$keys(_icon)).call(_context4, function (key) {
|
34
45
|
if (key === "default" || key === "__esModule") return;
|
35
46
|
if (key in exports && exports[key] === _icon[key]) return;
|
36
47
|
_Object$defineProperty(exports, key, {
|
@@ -41,7 +52,7 @@ _forEachInstanceProperty(_context3 = _Object$keys(_icon)).call(_context3, functi
|
|
41
52
|
});
|
42
53
|
});
|
43
54
|
var _item = require("./item");
|
44
|
-
_forEachInstanceProperty(
|
55
|
+
_forEachInstanceProperty(_context5 = _Object$keys(_item)).call(_context5, function (key) {
|
45
56
|
if (key === "default" || key === "__esModule") return;
|
46
57
|
if (key in exports && exports[key] === _item[key]) return;
|
47
58
|
_Object$defineProperty(exports, key, {
|
@@ -52,7 +63,7 @@ _forEachInstanceProperty(_context4 = _Object$keys(_item)).call(_context4, functi
|
|
52
63
|
});
|
53
64
|
});
|
54
65
|
var _loader = require("./loader");
|
55
|
-
_forEachInstanceProperty(
|
66
|
+
_forEachInstanceProperty(_context6 = _Object$keys(_loader)).call(_context6, function (key) {
|
56
67
|
if (key === "default" || key === "__esModule") return;
|
57
68
|
if (key in exports && exports[key] === _loader[key]) return;
|
58
69
|
_Object$defineProperty(exports, key, {
|
@@ -63,7 +74,7 @@ _forEachInstanceProperty(_context5 = _Object$keys(_loader)).call(_context5, func
|
|
63
74
|
});
|
64
75
|
});
|
65
76
|
var _popoverContainer = require("./popoverContainer");
|
66
|
-
_forEachInstanceProperty(
|
77
|
+
_forEachInstanceProperty(_context7 = _Object$keys(_popoverContainer)).call(_context7, function (key) {
|
67
78
|
if (key === "default" || key === "__esModule") return;
|
68
79
|
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
69
80
|
_Object$defineProperty(exports, key, {
|
@@ -74,7 +85,7 @@ _forEachInstanceProperty(_context6 = _Object$keys(_popoverContainer)).call(_cont
|
|
74
85
|
});
|
75
86
|
});
|
76
87
|
var _shared = require("./shared");
|
77
|
-
_forEachInstanceProperty(
|
88
|
+
_forEachInstanceProperty(_context8 = _Object$keys(_shared)).call(_context8, function (key) {
|
78
89
|
if (key === "default" || key === "__esModule") return;
|
79
90
|
if (key in exports && exports[key] === _shared[key]) return;
|
80
91
|
_Object$defineProperty(exports, key, {
|
@@ -85,7 +96,7 @@ _forEachInstanceProperty(_context7 = _Object$keys(_shared)).call(_context7, func
|
|
85
96
|
});
|
86
97
|
});
|
87
98
|
var _tableCell = require("./tableCell");
|
88
|
-
_forEachInstanceProperty(
|
99
|
+
_forEachInstanceProperty(_context9 = _Object$keys(_tableCell)).call(_context9, function (key) {
|
89
100
|
if (key === "default" || key === "__esModule") return;
|
90
101
|
if (key in exports && exports[key] === _tableCell[key]) return;
|
91
102
|
_Object$defineProperty(exports, key, {
|
@@ -96,7 +107,7 @@ _forEachInstanceProperty(_context8 = _Object$keys(_tableCell)).call(_context8, f
|
|
96
107
|
});
|
97
108
|
});
|
98
109
|
var _text = require("./text");
|
99
|
-
_forEachInstanceProperty(
|
110
|
+
_forEachInstanceProperty(_context10 = _Object$keys(_text)).call(_context10, function (key) {
|
100
111
|
if (key === "default" || key === "__esModule") return;
|
101
112
|
if (key in exports && exports[key] === _text[key]) return;
|
102
113
|
_Object$defineProperty(exports, key, {
|
@@ -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,
|
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
|
-
|
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
|
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
|
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';
|
@@ -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
|
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 {};
|
package/lib/types/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "2.36.0-alpha.
|
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",
|