@pingux/astro 2.144.1 → 2.145.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.
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +4 -1
- package/lib/cjs/components/Modal/Modal.stories.js +42 -2
- package/lib/cjs/components/SearchField/SearchAutoComplete.js +6 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +2 -1
- package/lib/components/LinkSelectField/LinkSelectField.js +5 -2
- package/lib/components/Modal/Modal.stories.js +38 -3
- package/lib/components/SearchField/SearchAutoComplete.js +7 -3
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +2 -1
- package/package.json +3 -2
|
@@ -44,6 +44,9 @@ var LinkSelectField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
44
44
|
helperText = props.helperText;
|
|
45
45
|
var _getAriaAttributeProp = (0, _ariaAttributes.getAriaAttributeProps)(props),
|
|
46
46
|
ariaProps = _getAriaAttributeProp.ariaProps;
|
|
47
|
+
var _useGetTheme = (0, _hooks.useGetTheme)(),
|
|
48
|
+
themeState = _useGetTheme.themeState;
|
|
49
|
+
var isOnyx = themeState.isOnyx;
|
|
47
50
|
var helperTextId = (0, _uuid.v4)();
|
|
48
51
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
|
49
52
|
var _useSelectField = (0, _hooks.useSelectField)(_objectSpread(_objectSpread({
|
|
@@ -69,7 +72,7 @@ var LinkSelectField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
|
69
72
|
"aria-describedby": helperText && helperTextId
|
|
70
73
|
}), (0, _react2.jsx)(_.Text, {
|
|
71
74
|
variant: "label",
|
|
72
|
-
color:
|
|
75
|
+
color: isOnyx ? 'font.link' : 'active'
|
|
73
76
|
}, placeholder), (0, _react2.jsx)(_.Box, {
|
|
74
77
|
isRow: true
|
|
75
78
|
}, isLoadingInitial && (0, _react2.jsx)(_.Loader, {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
3
5
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
4
7
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
8
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
9
|
value: true
|
|
7
10
|
});
|
|
8
11
|
exports["default"] = exports.WithInputField = exports.LargeContent = exports.Default = void 0;
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
9
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
10
|
-
var _react =
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
15
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
|
12
16
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
|
13
17
|
var _hooks = require("../../hooks");
|
|
@@ -16,6 +20,8 @@ var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
|
|
16
20
|
var _modalSizes = require("../../utils/devUtils/constants/modalSizes");
|
|
17
21
|
var _Modal = _interopRequireDefault(require("./Modal.mdx"));
|
|
18
22
|
var _react2 = require("@emotion/react");
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
19
25
|
var _default = {
|
|
20
26
|
title: 'Components/Modal',
|
|
21
27
|
component: _index.Modal,
|
|
@@ -167,6 +173,20 @@ var LargeContent = function LargeContent(args) {
|
|
|
167
173
|
exports.LargeContent = LargeContent;
|
|
168
174
|
var WithInputField = function WithInputField() {
|
|
169
175
|
var state = (0, _hooks.useModalState)();
|
|
176
|
+
var _useState = (0, _react.useState)(''),
|
|
177
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
178
|
+
value = _useState2[0],
|
|
179
|
+
setValue = _useState2[1];
|
|
180
|
+
var items = [{
|
|
181
|
+
id: 'apple',
|
|
182
|
+
name: 'Apple'
|
|
183
|
+
}, {
|
|
184
|
+
id: 'banana',
|
|
185
|
+
name: 'Banana'
|
|
186
|
+
}, {
|
|
187
|
+
id: 'blueberry',
|
|
188
|
+
name: 'Blueberry'
|
|
189
|
+
}];
|
|
170
190
|
return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
|
171
191
|
onPress: state.open,
|
|
172
192
|
"aria-label": "Open modal"
|
|
@@ -193,7 +213,27 @@ var WithInputField = function WithInputField() {
|
|
|
193
213
|
label: "Option 3",
|
|
194
214
|
value: "option3",
|
|
195
215
|
"data-testid": "option3"
|
|
196
|
-
})), (0, _react2.jsx)(_index.
|
|
216
|
+
})), (0, _react2.jsx)(_index.SearchField, {
|
|
217
|
+
mode: "autocomplete",
|
|
218
|
+
defaultItems: items,
|
|
219
|
+
value: value,
|
|
220
|
+
onChange: function onChange(val) {
|
|
221
|
+
setValue(val);
|
|
222
|
+
},
|
|
223
|
+
"aria-label": "Search Groups",
|
|
224
|
+
placeholder: "Search",
|
|
225
|
+
onSubmit: function onSubmit(text) {
|
|
226
|
+
return alert(text);
|
|
227
|
+
},
|
|
228
|
+
onClear: function onClear() {
|
|
229
|
+
setValue('');
|
|
230
|
+
}
|
|
231
|
+
}, function (item) {
|
|
232
|
+
return (0, _react2.jsx)(_index.Item, {
|
|
233
|
+
key: item.id,
|
|
234
|
+
textValue: item.name
|
|
235
|
+
}, item.name);
|
|
236
|
+
}), (0, _react2.jsx)(_index.Box, {
|
|
197
237
|
isRow: true,
|
|
198
238
|
variant: "modal.buttonsContainer"
|
|
199
239
|
}, (0, _react2.jsx)(_index.Button, {
|
|
@@ -157,12 +157,16 @@ var SearchAutoComplete = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
|
157
157
|
state: comboBoxState,
|
|
158
158
|
isNonModal: true,
|
|
159
159
|
width: popoverWidth
|
|
160
|
-
}, (0, _react2.jsx)(_.ScrollBox,
|
|
160
|
+
}, (0, _react2.jsx)(_.ScrollBox, {
|
|
161
|
+
maxHeight: 200
|
|
162
|
+
}, (0, _react2.jsx)(_reactAria.FocusScope, {
|
|
163
|
+
restoreFocus: true
|
|
164
|
+
}, (0, _react2.jsx)(_ListBox["default"], (0, _extends2["default"])({
|
|
161
165
|
ref: listBoxRef,
|
|
162
166
|
state: comboBoxState,
|
|
163
167
|
isFocusedOnHover: shouldFocusOnHover,
|
|
164
168
|
isSelectedOnPressUp: shouldSelectOnPressUp,
|
|
165
169
|
shouldShowSelectedOption: false
|
|
166
|
-
}, otherListBoxProps)))));
|
|
170
|
+
}, otherListBoxProps))))));
|
|
167
171
|
});
|
|
168
172
|
exports.SearchAutoComplete = SearchAutoComplete;
|
|
@@ -27,7 +27,8 @@ var overrides = {
|
|
|
27
27
|
exports.overrides = overrides;
|
|
28
28
|
var font = {
|
|
29
29
|
base: _colorTokens.nextGenColors['gray-100'],
|
|
30
|
-
light: _colorTokens.nextGenColors['gray-400']
|
|
30
|
+
light: _colorTokens.nextGenColors['gray-400'],
|
|
31
|
+
link: _colorTokens.nextGenColors['blue-400']
|
|
31
32
|
};
|
|
32
33
|
var hoverDark = _chromaJs["default"].mix('#23282e', 'white', 0.04, 'rgb').hex();
|
|
33
34
|
var border = {
|
|
@@ -17,7 +17,7 @@ import MenuDown from '@pingux/mdi-react/MenuDownIcon';
|
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
|
19
19
|
import { Box, Button, Icon, Loader, Text } from '../..';
|
|
20
|
-
import { usePropWarning, useSelectField } from '../../hooks';
|
|
20
|
+
import { useGetTheme, usePropWarning, useSelectField } from '../../hooks';
|
|
21
21
|
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
|
22
22
|
import statuses from '../../utils/devUtils/constants/statuses';
|
|
23
23
|
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
|
@@ -33,6 +33,9 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
33
|
helperText = props.helperText;
|
|
34
34
|
var _getAriaAttributeProp = getAriaAttributeProps(props),
|
|
35
35
|
ariaProps = _getAriaAttributeProp.ariaProps;
|
|
36
|
+
var _useGetTheme = useGetTheme(),
|
|
37
|
+
themeState = _useGetTheme.themeState;
|
|
38
|
+
var isOnyx = themeState.isOnyx;
|
|
36
39
|
var helperTextId = uuid();
|
|
37
40
|
usePropWarning(props, 'disabled', 'isDisabled');
|
|
38
41
|
var _useSelectField = useSelectField(_objectSpread(_objectSpread({
|
|
@@ -58,7 +61,7 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
58
61
|
"aria-describedby": helperText && helperTextId
|
|
59
62
|
}), ___EmotionJSX(Text, {
|
|
60
63
|
variant: "label",
|
|
61
|
-
color:
|
|
64
|
+
color: isOnyx ? 'font.link' : 'active'
|
|
62
65
|
}, placeholder), ___EmotionJSX(Box, {
|
|
63
66
|
isRow: true
|
|
64
67
|
}, isLoadingInitial && ___EmotionJSX(Loader, {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
1
2
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
3
4
|
import { withDesign } from 'storybook-addon-designs';
|
|
4
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
5
6
|
import { useModalState } from '../../hooks';
|
|
6
|
-
import { Box, Button, Item, Modal, OverlayProvider, RadioField, RadioGroupField, SelectField, Text } from '../../index';
|
|
7
|
+
import { Box, Button, Item, Modal, OverlayProvider, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
|
|
7
8
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
8
9
|
import { modalSizes } from '../../utils/devUtils/constants/modalSizes';
|
|
9
10
|
import ModalReadme from './Modal.mdx';
|
|
@@ -156,6 +157,20 @@ export var LargeContent = function LargeContent(args) {
|
|
|
156
157
|
};
|
|
157
158
|
export var WithInputField = function WithInputField() {
|
|
158
159
|
var state = useModalState();
|
|
160
|
+
var _useState = useState(''),
|
|
161
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
162
|
+
value = _useState2[0],
|
|
163
|
+
setValue = _useState2[1];
|
|
164
|
+
var items = [{
|
|
165
|
+
id: 'apple',
|
|
166
|
+
name: 'Apple'
|
|
167
|
+
}, {
|
|
168
|
+
id: 'banana',
|
|
169
|
+
name: 'Banana'
|
|
170
|
+
}, {
|
|
171
|
+
id: 'blueberry',
|
|
172
|
+
name: 'Blueberry'
|
|
173
|
+
}];
|
|
159
174
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
|
160
175
|
onPress: state.open,
|
|
161
176
|
"aria-label": "Open modal"
|
|
@@ -182,7 +197,27 @@ export var WithInputField = function WithInputField() {
|
|
|
182
197
|
label: "Option 3",
|
|
183
198
|
value: "option3",
|
|
184
199
|
"data-testid": "option3"
|
|
185
|
-
})), ___EmotionJSX(
|
|
200
|
+
})), ___EmotionJSX(SearchField, {
|
|
201
|
+
mode: "autocomplete",
|
|
202
|
+
defaultItems: items,
|
|
203
|
+
value: value,
|
|
204
|
+
onChange: function onChange(val) {
|
|
205
|
+
setValue(val);
|
|
206
|
+
},
|
|
207
|
+
"aria-label": "Search Groups",
|
|
208
|
+
placeholder: "Search",
|
|
209
|
+
onSubmit: function onSubmit(text) {
|
|
210
|
+
return alert(text);
|
|
211
|
+
},
|
|
212
|
+
onClear: function onClear() {
|
|
213
|
+
setValue('');
|
|
214
|
+
}
|
|
215
|
+
}, function (item) {
|
|
216
|
+
return ___EmotionJSX(Item, {
|
|
217
|
+
key: item.id,
|
|
218
|
+
textValue: item.name
|
|
219
|
+
}, item.name);
|
|
220
|
+
}), ___EmotionJSX(Box, {
|
|
186
221
|
isRow: true,
|
|
187
222
|
variant: "modal.buttonsContainer"
|
|
188
223
|
}, ___EmotionJSX(Button, {
|
|
@@ -14,7 +14,7 @@ var _excluded = ["shouldFocusOnHover", "shouldSelectOnPressUp"];
|
|
|
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, { forwardRef, useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
17
|
-
import { useComboBox, useFilter, useSearchField } from 'react-aria';
|
|
17
|
+
import { FocusScope, useComboBox, useFilter, useSearchField } from 'react-aria';
|
|
18
18
|
import { useComboBoxState, useSearchFieldState } from 'react-stately';
|
|
19
19
|
import CloseIcon from '@pingux/mdi-react/CloseIcon';
|
|
20
20
|
import { mergeProps, useResizeObserver } from '@react-aria/utils';
|
|
@@ -146,11 +146,15 @@ export var SearchAutoComplete = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
146
146
|
state: comboBoxState,
|
|
147
147
|
isNonModal: true,
|
|
148
148
|
width: popoverWidth
|
|
149
|
-
}, ___EmotionJSX(ScrollBox,
|
|
149
|
+
}, ___EmotionJSX(ScrollBox, {
|
|
150
|
+
maxHeight: 200
|
|
151
|
+
}, ___EmotionJSX(FocusScope, {
|
|
152
|
+
restoreFocus: true
|
|
153
|
+
}, ___EmotionJSX(ListBox, _extends({
|
|
150
154
|
ref: listBoxRef,
|
|
151
155
|
state: comboBoxState,
|
|
152
156
|
isFocusedOnHover: shouldFocusOnHover,
|
|
153
157
|
isSelectedOnPressUp: shouldSelectOnPressUp,
|
|
154
158
|
shouldShowSelectedOption: false
|
|
155
|
-
}, otherListBoxProps)))));
|
|
159
|
+
}, otherListBoxProps))))));
|
|
156
160
|
});
|
|
@@ -19,7 +19,8 @@ export var overrides = {
|
|
|
19
19
|
};
|
|
20
20
|
var font = {
|
|
21
21
|
base: nextGenColors['gray-100'],
|
|
22
|
-
light: nextGenColors['gray-400']
|
|
22
|
+
light: nextGenColors['gray-400'],
|
|
23
|
+
link: nextGenColors['blue-400']
|
|
23
24
|
};
|
|
24
25
|
var hoverDark = chroma.mix('#23282e', 'white', 0.04, 'rgb').hex();
|
|
25
26
|
var border = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pingux/astro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.145.0-alpha.1",
|
|
4
4
|
"description": "React component library for Ping Identity's design system",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -205,7 +205,8 @@
|
|
|
205
205
|
"jest-canvas-mock": "^2.3.0",
|
|
206
206
|
"jest-emotion": "^11.0.0",
|
|
207
207
|
"jest-pnp-resolver": "^1.2.2",
|
|
208
|
-
"msw": "^2.
|
|
208
|
+
"msw": "^2.11.3",
|
|
209
|
+
"msw-storybook-addon": "^2.0.5",
|
|
209
210
|
"mutationobserver-shim": "^0.3.7",
|
|
210
211
|
"react": "18",
|
|
211
212
|
"react-dom": "18",
|