@pingux/astro 1.27.0 → 1.28.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.
- package/CHANGELOG.md +18 -0
- package/NOTICE.html +2 -2
- package/lib/cjs/components/DataTable/DataTable.js +477 -0
- package/lib/cjs/components/DataTable/DataTable.stories.js +310 -0
- package/lib/cjs/components/DataTable/DataTable.styles.js +156 -0
- package/lib/cjs/components/DataTable/DataTable.test.js +1307 -0
- package/lib/cjs/components/DataTable/DataTableChip.js +63 -0
- package/lib/cjs/components/DataTable/DataTableChip.test.js +38 -0
- package/lib/cjs/components/DataTable/DataTableMenu.js +51 -0
- package/lib/cjs/components/DataTable/DataTableMenu.test.js +20 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.js +75 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +30 -0
- package/lib/cjs/components/DataTable/DataTableVirtualizer.js +188 -0
- package/lib/cjs/components/DataTable/index.js +54 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +8 -2
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +35 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +10 -10
- package/lib/cjs/components/PageHeader/PageHeader.js +7 -1
- package/lib/cjs/context/DataTableContext/index.js +31 -0
- package/lib/cjs/index.js +67 -2
- package/lib/cjs/recipes/CountryPicker.stories.js +25 -12
- package/lib/cjs/recipes/EditableInput.stories.js +55 -46
- package/lib/cjs/recipes/FlippableCaretMenuButton.stories.js +38 -30
- package/lib/cjs/recipes/ListAndPanel.stories.js +102 -87
- package/lib/cjs/recipes/MaskedValue.stories.js +8 -5
- package/lib/cjs/recipes/NeutralInput.stories.js +6 -3
- package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +38 -33
- package/lib/cjs/recipes/PageHeader.stories.js +73 -0
- package/lib/cjs/recipes/RowLineChart.stories.js +58 -70
- package/lib/cjs/recipes/SelectedFieldOverlay.story.js +25 -21
- package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +81 -72
- package/lib/cjs/styles/variants/variants.js +4 -1
- package/lib/components/DataTable/DataTable.js +431 -0
- package/lib/components/DataTable/DataTable.stories.js +273 -0
- package/lib/components/DataTable/DataTable.styles.js +137 -0
- package/lib/components/DataTable/DataTable.test.js +1256 -0
- package/lib/components/DataTable/DataTableChip.js +33 -0
- package/lib/components/DataTable/DataTableChip.test.js +31 -0
- package/lib/components/DataTable/DataTableMenu.js +24 -0
- package/lib/components/DataTable/DataTableMenu.test.js +13 -0
- package/lib/components/DataTable/DataTableMultiLine.js +46 -0
- package/lib/components/DataTable/DataTableMultiLine.test.js +22 -0
- package/lib/components/DataTable/DataTableVirtualizer.js +157 -0
- package/lib/components/DataTable/index.js +5 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +7 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +25 -0
- package/lib/components/MultivaluesField/MultivaluesField.js +10 -10
- package/lib/components/PageHeader/PageHeader.js +8 -1
- package/lib/context/DataTableContext/index.js +5 -0
- package/lib/index.js +4 -1
- package/lib/recipes/CountryPicker.stories.js +24 -12
- package/lib/recipes/EditableInput.stories.js +55 -46
- package/lib/recipes/FlippableCaretMenuButton.stories.js +38 -30
- package/lib/recipes/ListAndPanel.stories.js +102 -87
- package/lib/recipes/MaskedValue.stories.js +8 -5
- package/lib/recipes/NeutralInput.stories.js +6 -3
- package/lib/recipes/OneWayToBidirectionalArrow.stories.js +38 -33
- package/lib/recipes/PageHeader.stories.js +53 -0
- package/lib/recipes/RowLineChart.stories.js +58 -70
- package/lib/recipes/SelectedFieldOverlay.story.js +25 -21
- package/lib/recipes/TrialExperienceStatusBar.stories.js +81 -72
- package/lib/styles/variants/variants.js +3 -1
- package/package.json +56 -50
@@ -84,7 +84,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
84
84
|
|
85
85
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty2(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
86
86
|
|
87
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
87
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context10, _context11; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context10 = ownKeys(Object(source), !0)).call(_context10, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context11 = ownKeys(Object(source))).call(_context11, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
88
88
|
|
89
89
|
/**
|
90
90
|
* Complex control that lets you choose several tags from the dropdown list.
|
@@ -96,7 +96,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
96
96
|
* Stately.
|
97
97
|
*/
|
98
98
|
var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
99
|
-
var
|
99
|
+
var _context7;
|
100
100
|
|
101
101
|
var defaultSelectedKeys = props.defaultSelectedKeys,
|
102
102
|
direction = props.direction,
|
@@ -278,7 +278,7 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
278
278
|
setFilterString('');
|
279
279
|
}
|
280
280
|
} else if (hasCustomValue) {
|
281
|
-
var _context3;
|
281
|
+
var _context3, _context4;
|
282
282
|
|
283
283
|
var _key2 = e.target.value;
|
284
284
|
|
@@ -286,8 +286,8 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
286
286
|
return;
|
287
287
|
}
|
288
288
|
|
289
|
-
selectionManager.
|
290
|
-
setCustomItems((0, _concat["default"])(
|
289
|
+
selectionManager.setSelectedKeys((0, _concat["default"])(_context3 = []).call(_context3, (0, _from["default"])(selectionManager.state.selectedKeys), [_key2]));
|
290
|
+
setCustomItems((0, _concat["default"])(_context4 = []).call(_context4, customItems, [{
|
291
291
|
id: _key2,
|
292
292
|
key: _key2,
|
293
293
|
name: _key2
|
@@ -341,9 +341,9 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
341
341
|
};
|
342
342
|
|
343
343
|
var readOnlyInputEntry = (0, _react2.jsx)(_react["default"].Fragment, null, isReadOnly && (readOnlyKeys.length ? (0, _map["default"])(readOnlyKeys).call(readOnlyKeys, function (key) {
|
344
|
-
var
|
344
|
+
var _context5, _context6;
|
345
345
|
|
346
|
-
var item = (0, _find["default"])(
|
346
|
+
var item = (0, _find["default"])(_context5 = (0, _concat["default"])(_context6 = []).call(_context6, initialItems, customItems)).call(_context5, function (el) {
|
347
347
|
return el.key === key;
|
348
348
|
});
|
349
349
|
|
@@ -377,10 +377,10 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
377
377
|
|
378
378
|
return null;
|
379
379
|
}));
|
380
|
-
var selectedItems = (0, _react2.jsx)(_react["default"].Fragment, null, (0, _map["default"])(
|
381
|
-
var
|
380
|
+
var selectedItems = (0, _react2.jsx)(_react["default"].Fragment, null, (0, _map["default"])(_context7 = (0, _from["default"])(selectionManager.selectedKeys)).call(_context7, function (key) {
|
381
|
+
var _context8, _context9;
|
382
382
|
|
383
|
-
var item = (0, _find["default"])(
|
383
|
+
var item = (0, _find["default"])(_context8 = (0, _concat["default"])(_context9 = []).call(_context9, initialItems, customItems)).call(_context8, function (el) {
|
384
384
|
return el.key === key;
|
385
385
|
});
|
386
386
|
|
@@ -38,11 +38,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
|
|
38
38
|
|
39
39
|
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; }
|
40
40
|
|
41
|
+
/**
|
42
|
+
* A `Page Header` is a composed component using text and icon button.
|
43
|
+
* The component is separated from the body and appears at the top.
|
44
|
+
* For customization,
|
45
|
+
* please see [Page Header](./?path=/story/recipes-page-header--default) recipe docs.
|
46
|
+
*/
|
41
47
|
var PageHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
42
48
|
var title = props.title,
|
43
49
|
children = props.children,
|
44
50
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
45
|
-
(0, _hooks.useDeprecationWarning)('The Page Header component will be deprecated in Astro-UI 2.0.0.');
|
51
|
+
(0, _hooks.useDeprecationWarning)('The Page Header component will be deprecated in Astro-UI 2.0.0. Use Page Header recipe instead.');
|
46
52
|
return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
47
53
|
isRow: true,
|
48
54
|
justifyContent: "space-between",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
4
|
+
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
6
|
+
|
7
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
8
|
+
|
9
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
10
|
+
|
11
|
+
_Object$defineProperty(exports, "__esModule", {
|
12
|
+
value: true
|
13
|
+
});
|
14
|
+
|
15
|
+
exports.useDataTableContext = exports.DataTableContext = void 0;
|
16
|
+
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
18
|
+
|
19
|
+
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); }
|
20
|
+
|
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; }
|
22
|
+
|
23
|
+
var DataTableContext = /*#__PURE__*/_react["default"].createContext(null);
|
24
|
+
|
25
|
+
exports.DataTableContext = DataTableContext;
|
26
|
+
|
27
|
+
var useDataTableContext = function useDataTableContext() {
|
28
|
+
return (0, _react.useContext)(DataTableContext);
|
29
|
+
};
|
30
|
+
|
31
|
+
exports.useDataTableContext = useDataTableContext;
|
package/lib/cjs/index.js
CHANGED
@@ -4,7 +4,7 @@ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
4
4
|
|
5
5
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
6
|
|
7
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60, _context61, _context62, _context63, _context64, _context65, _context66, _context67, _context68;
|
7
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60, _context61, _context62, _context63, _context64, _context65, _context66, _context67, _context68, _context69;
|
8
8
|
|
9
9
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
10
10
|
|
@@ -104,7 +104,13 @@ var _exportNames = {
|
|
104
104
|
OverlayProvider: true,
|
105
105
|
useOverlayPosition: true,
|
106
106
|
useOverlayTrigger: true,
|
107
|
-
useOverlayTriggerState: true
|
107
|
+
useOverlayTriggerState: true,
|
108
|
+
DataTable: true,
|
109
|
+
DataTableCell: true,
|
110
|
+
DataTableColumn: true,
|
111
|
+
DataTableRow: true,
|
112
|
+
DataTableBody: true,
|
113
|
+
DataTableHeader: true
|
108
114
|
};
|
109
115
|
|
110
116
|
_Object$defineProperty(exports, "AccordionGridGroup", {
|
@@ -261,6 +267,48 @@ _Object$defineProperty(exports, "CopyText", {
|
|
261
267
|
}
|
262
268
|
});
|
263
269
|
|
270
|
+
_Object$defineProperty(exports, "DataTable", {
|
271
|
+
enumerable: true,
|
272
|
+
get: function get() {
|
273
|
+
return _DataTable["default"];
|
274
|
+
}
|
275
|
+
});
|
276
|
+
|
277
|
+
_Object$defineProperty(exports, "DataTableBody", {
|
278
|
+
enumerable: true,
|
279
|
+
get: function get() {
|
280
|
+
return _table.TableBody;
|
281
|
+
}
|
282
|
+
});
|
283
|
+
|
284
|
+
_Object$defineProperty(exports, "DataTableCell", {
|
285
|
+
enumerable: true,
|
286
|
+
get: function get() {
|
287
|
+
return _table.Cell;
|
288
|
+
}
|
289
|
+
});
|
290
|
+
|
291
|
+
_Object$defineProperty(exports, "DataTableColumn", {
|
292
|
+
enumerable: true,
|
293
|
+
get: function get() {
|
294
|
+
return _table.Column;
|
295
|
+
}
|
296
|
+
});
|
297
|
+
|
298
|
+
_Object$defineProperty(exports, "DataTableHeader", {
|
299
|
+
enumerable: true,
|
300
|
+
get: function get() {
|
301
|
+
return _table.TableHeader;
|
302
|
+
}
|
303
|
+
});
|
304
|
+
|
305
|
+
_Object$defineProperty(exports, "DataTableRow", {
|
306
|
+
enumerable: true,
|
307
|
+
get: function get() {
|
308
|
+
return _table.Row;
|
309
|
+
}
|
310
|
+
});
|
311
|
+
|
264
312
|
_Object$defineProperty(exports, "EnvironmentBreadcrumb", {
|
265
313
|
enumerable: true,
|
266
314
|
get: function get() {
|
@@ -1741,6 +1789,23 @@ var _overlays = require("@react-aria/overlays");
|
|
1741
1789
|
|
1742
1790
|
var _overlays2 = require("@react-stately/overlays");
|
1743
1791
|
|
1792
|
+
var _DataTable = _interopRequireWildcard(require("./components/DataTable"));
|
1793
|
+
|
1794
|
+
_forEachInstanceProperty(_context69 = _Object$keys(_DataTable)).call(_context69, function (key) {
|
1795
|
+
if (key === "default" || key === "__esModule") return;
|
1796
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1797
|
+
if (key in exports && exports[key] === _DataTable[key]) return;
|
1798
|
+
|
1799
|
+
_Object$defineProperty(exports, key, {
|
1800
|
+
enumerable: true,
|
1801
|
+
get: function get() {
|
1802
|
+
return _DataTable[key];
|
1803
|
+
}
|
1804
|
+
});
|
1805
|
+
});
|
1806
|
+
|
1807
|
+
var _table = require("@react-spectrum/table");
|
1808
|
+
|
1744
1809
|
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); }
|
1745
1810
|
|
1746
1811
|
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; }
|
@@ -50,6 +50,28 @@ var validatePhoneNumber = function validatePhoneNumber(str) {
|
|
50
50
|
return reg.test(str);
|
51
51
|
};
|
52
52
|
|
53
|
+
var sx = {
|
54
|
+
wrapperBox: {
|
55
|
+
width: '100%',
|
56
|
+
maxWidth: 500,
|
57
|
+
position: 'relative'
|
58
|
+
},
|
59
|
+
comboBoxFieldWrapperOpen: {
|
60
|
+
position: 'absolute',
|
61
|
+
transition: '0.2s width ease',
|
62
|
+
width: '100%'
|
63
|
+
},
|
64
|
+
comboBoxFieldWrapperClose: {
|
65
|
+
position: 'absolute',
|
66
|
+
transition: '0.2s width ease',
|
67
|
+
width: '110px'
|
68
|
+
},
|
69
|
+
inputWrapper: {
|
70
|
+
width: '100%',
|
71
|
+
marginLeft: '110px'
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
53
75
|
var Default = function Default() {
|
54
76
|
var _useState = (0, _react.useState)(false),
|
55
77
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -117,22 +139,14 @@ var Default = function Default() {
|
|
117
139
|
|
118
140
|
return (0, _react2.jsx)(_Box["default"], {
|
119
141
|
isRow: true,
|
120
|
-
sx:
|
121
|
-
width: '100%',
|
122
|
-
maxWidth: 500,
|
123
|
-
position: 'relative'
|
124
|
-
}
|
142
|
+
sx: sx.wrapperBox
|
125
143
|
}, (0, _react2.jsx)(_ComboBoxField["default"], {
|
126
144
|
mt: -5,
|
127
145
|
width: "100%",
|
128
146
|
isOpen: isOpen,
|
129
147
|
onOpenChange: setIsOpen,
|
130
148
|
wrapperProps: {
|
131
|
-
sx:
|
132
|
-
position: 'absolute',
|
133
|
-
transition: '0.2s width ease',
|
134
|
-
width: isOpen ? '100%' : 110
|
135
|
-
}
|
149
|
+
sx: isOpen ? sx.comboBoxFieldWrapperOpen : sx.comboBoxFieldWrapperClose
|
136
150
|
},
|
137
151
|
controlProps: {
|
138
152
|
'aria-label': 'Country Picker'
|
@@ -151,8 +165,7 @@ var Default = function Default() {
|
|
151
165
|
key: item[0]
|
152
166
|
}, (0, _concat["default"])(_context = (0, _concat["default"])(_context2 = "".concat(item[1].name)).call(_context2, item[1].name !== item[1]["native"] ? " (".concat(item[1]["native"], ")") : '', " +")).call(_context, item[1].phone.split(',')[0]));
|
153
167
|
}), (0, _react2.jsx)(_Box["default"], {
|
154
|
-
|
155
|
-
ml: 110
|
168
|
+
sx: sx.inputWrapper
|
156
169
|
}, (0, _react2.jsx)(_Input["default"], {
|
157
170
|
placeholder: "Phone number...",
|
158
171
|
onChange: onPhoneNumberValueChange,
|
@@ -70,6 +70,48 @@ var inputProps = {
|
|
70
70
|
label: 'Example label',
|
71
71
|
ariaLabel: 'Example aria label'
|
72
72
|
};
|
73
|
+
var sx = {
|
74
|
+
editablePreview: {
|
75
|
+
whiteSpace: 'pre-line',
|
76
|
+
width: '100%',
|
77
|
+
overflowWrap: 'break-word',
|
78
|
+
minHeight: '45px',
|
79
|
+
paddingLeft: 'xs',
|
80
|
+
justifyContent: 'flex-end',
|
81
|
+
paddingBottom: 'xs',
|
82
|
+
borderBottomColor: 'active',
|
83
|
+
color: 'neutral.10',
|
84
|
+
fontSize: 'md',
|
85
|
+
fontWeight: 1,
|
86
|
+
lineHeight: '18px',
|
87
|
+
'&:focus': {
|
88
|
+
outline: 'none',
|
89
|
+
boxShadow: 'focus',
|
90
|
+
borderColor: 'active',
|
91
|
+
borderWidth: '1px',
|
92
|
+
borderStyle: 'solid'
|
93
|
+
}
|
94
|
+
},
|
95
|
+
editableInputWrapper: {
|
96
|
+
marginRight: '30px',
|
97
|
+
flexGrow: 1
|
98
|
+
},
|
99
|
+
editableInpuTextArea: {
|
100
|
+
maxHeight: '150px'
|
101
|
+
},
|
102
|
+
editableControlWrapper: {
|
103
|
+
position: 'absolute',
|
104
|
+
right: '0',
|
105
|
+
top: '27.5%',
|
106
|
+
alignItems: 'center',
|
107
|
+
justifyContent: 'space-between'
|
108
|
+
},
|
109
|
+
editableControlIconButton: {
|
110
|
+
marginRight: 'md',
|
111
|
+
width: '20px',
|
112
|
+
height: '20px'
|
113
|
+
}
|
114
|
+
};
|
73
115
|
|
74
116
|
var Default = function Default() {
|
75
117
|
return (0, _react2.jsx)(Editable, {
|
@@ -127,6 +169,13 @@ var EditablePreview = function EditablePreview() {
|
|
127
169
|
hasFocus = _useState4[0],
|
128
170
|
setFocus = _useState4[1];
|
129
171
|
|
172
|
+
var editablePreviewDynamicSx = {
|
173
|
+
backgroundColor: hasFocus ? 'accent.95' : 'white',
|
174
|
+
borderBottom: editableContext.isEditing ? '0px' : '1px dashed',
|
175
|
+
'&:hover': {
|
176
|
+
background: editableContext.isEditing ? 'white' : 'accent.95'
|
177
|
+
}
|
178
|
+
};
|
130
179
|
(0, _react.useEffect)(function () {
|
131
180
|
if (hasFocus && editableContext.isEditing) {
|
132
181
|
setFocus(false);
|
@@ -153,8 +202,8 @@ var EditablePreview = function EditablePreview() {
|
|
153
202
|
"aria-hidden": editableContext.isEditing,
|
154
203
|
onClick: handleClick,
|
155
204
|
onKeyDown: handleKeyDown,
|
156
|
-
"aria-readonly": "false",
|
157
205
|
"aria-label": "Inline editable text field",
|
206
|
+
role: "textbox",
|
158
207
|
onFocus: function onFocus() {
|
159
208
|
return setFocus(true);
|
160
209
|
},
|
@@ -162,32 +211,7 @@ var EditablePreview = function EditablePreview() {
|
|
162
211
|
return setFocus(false);
|
163
212
|
},
|
164
213
|
placeholder: "Click or press enter to edit text",
|
165
|
-
sx: {
|
166
|
-
whiteSpace: 'pre-line',
|
167
|
-
backgroundColor: hasFocus ? 'accent.95' : 'white',
|
168
|
-
width: '100%',
|
169
|
-
overflowWrap: 'break-word',
|
170
|
-
minHeight: '45px',
|
171
|
-
paddingLeft: 'xs',
|
172
|
-
justifyContent: 'flex-end',
|
173
|
-
paddingBottom: 'xs',
|
174
|
-
borderBottom: editableContext.isEditing ? '0px' : '1px dashed',
|
175
|
-
borderBottomColor: 'active',
|
176
|
-
color: 'neutral.10',
|
177
|
-
fontSize: 'md',
|
178
|
-
fontWeight: 1,
|
179
|
-
lineHeight: '18px',
|
180
|
-
'&:hover': {
|
181
|
-
background: editableContext.isEditing ? 'white' : 'accent.95'
|
182
|
-
},
|
183
|
-
'&:focus': {
|
184
|
-
outline: 'none',
|
185
|
-
boxShadow: 'focus',
|
186
|
-
borderColor: 'active',
|
187
|
-
borderWidth: '1px',
|
188
|
-
borderStyle: 'solid'
|
189
|
-
}
|
190
|
-
}
|
214
|
+
sx: _objectSpread(_objectSpread({}, editablePreviewDynamicSx), sx.editablePreview)
|
191
215
|
}, editableContext.value);
|
192
216
|
};
|
193
217
|
/**
|
@@ -256,10 +280,7 @@ var EditableInput = function EditableInput(props) {
|
|
256
280
|
return (0, _react2.jsx)(_index.Box, {
|
257
281
|
display: editableContext.isEditing ? 'flex' : 'none',
|
258
282
|
"aria-hidden": !editableContext.isEditing,
|
259
|
-
sx:
|
260
|
-
marginRight: '30px',
|
261
|
-
flexGrow: 1
|
262
|
-
}
|
283
|
+
sx: sx.editableInputWrapper
|
263
284
|
}, (0, _react2.jsx)(_index.TextAreaField, {
|
264
285
|
rows: 1,
|
265
286
|
ref: editableInput,
|
@@ -270,9 +291,7 @@ var EditableInput = function EditableInput(props) {
|
|
270
291
|
onKeyDown: handleKeyDown,
|
271
292
|
value: editingValue,
|
272
293
|
"aria-label": ariaLabel,
|
273
|
-
sx:
|
274
|
-
maxHeight: '150px'
|
275
|
-
},
|
294
|
+
sx: sx.editableInpuTextArea,
|
276
295
|
isUnresizable: true
|
277
296
|
}));
|
278
297
|
};
|
@@ -323,22 +342,12 @@ var EditableControl = function EditableControl(props) {
|
|
323
342
|
display: editableContext.isEditing ? 'flex' : 'none',
|
324
343
|
"aria-hidden": !editableContext.isEditing,
|
325
344
|
isRow: true,
|
326
|
-
sx:
|
327
|
-
position: 'absolute',
|
328
|
-
right: '0',
|
329
|
-
top: '27.5%',
|
330
|
-
alignItems: 'center',
|
331
|
-
justifyContent: 'space-between'
|
332
|
-
}
|
345
|
+
sx: sx.editableControlWrapper
|
333
346
|
}, (0, _react2.jsx)(_index.IconButton, {
|
334
347
|
onPress: handleSubmit,
|
335
348
|
"aria-label": confirmBtn.ariaLabel,
|
336
349
|
variant: confirmBtn.variant,
|
337
|
-
|
338
|
-
sx: {
|
339
|
-
width: '20px',
|
340
|
-
height: '20px'
|
341
|
-
}
|
350
|
+
sx: sx.editableControlIconButton
|
342
351
|
}, (0, _react2.jsx)(_index.Icon, {
|
343
352
|
icon: _CheckIcon["default"]
|
344
353
|
})), (0, _react2.jsx)(_index.IconButton, {
|
@@ -73,6 +73,40 @@ var _default = {
|
|
73
73
|
};
|
74
74
|
exports["default"] = _default;
|
75
75
|
var buttonArray = ['Web App', 'Native App', 'Single Page App', 'Non-Interactive', 'Worker', 'Advanced Configuration', 'Built-in admin console for this environment', 'Built-in Application portal'];
|
76
|
+
var sx = {
|
77
|
+
openButton: {
|
78
|
+
height: '30px',
|
79
|
+
borderRadius: 'md',
|
80
|
+
fontSize: '13px',
|
81
|
+
mb: 'sm'
|
82
|
+
},
|
83
|
+
closeIconButton: {
|
84
|
+
position: 'absolute',
|
85
|
+
top: '14px',
|
86
|
+
right: 'sm'
|
87
|
+
},
|
88
|
+
buttonsContainer: {
|
89
|
+
p: 'lg',
|
90
|
+
flexDirection: 'initial !important',
|
91
|
+
alignContent: 'space-between',
|
92
|
+
flexWrap: 'wrap'
|
93
|
+
},
|
94
|
+
selectedButton: {
|
95
|
+
mb: 'sm',
|
96
|
+
mr: '4px',
|
97
|
+
height: '30px',
|
98
|
+
borderRadius: '15px',
|
99
|
+
fontSize: '13px'
|
100
|
+
},
|
101
|
+
unSelectedButton: {
|
102
|
+
mb: 'sm',
|
103
|
+
mr: '4px',
|
104
|
+
borderColor: 'neutral.80',
|
105
|
+
height: '30px',
|
106
|
+
borderRadius: '15px',
|
107
|
+
fontSize: '13px'
|
108
|
+
}
|
109
|
+
};
|
76
110
|
|
77
111
|
var Default = function Default() {
|
78
112
|
var buttonRef = (0, _react.useRef)();
|
@@ -131,14 +165,9 @@ var Default = function Default() {
|
|
131
165
|
|
132
166
|
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Button, {
|
133
167
|
ref: buttonRef,
|
134
|
-
mb: "sm",
|
135
168
|
variant: "inline",
|
136
169
|
onPress: onChange,
|
137
|
-
sx:
|
138
|
-
height: '30px',
|
139
|
-
borderRadius: '15px',
|
140
|
-
fontSize: '13px'
|
141
|
-
}
|
170
|
+
sx: sx.openButton
|
142
171
|
}, (0, _react2.jsx)(_index.Box, {
|
143
172
|
isRow: true,
|
144
173
|
alignItems: "center"
|
@@ -161,36 +190,15 @@ var Default = function Default() {
|
|
161
190
|
onPress: function onPress() {
|
162
191
|
return setIsOpen(false);
|
163
192
|
},
|
164
|
-
sx:
|
165
|
-
position: 'absolute',
|
166
|
-
top: 14,
|
167
|
-
right: 10
|
168
|
-
}
|
193
|
+
sx: sx.closeIconButton
|
169
194
|
}, (0, _react2.jsx)(_index.Icon, {
|
170
195
|
icon: _CloseIcon["default"]
|
171
196
|
})), (0, _react2.jsx)(_index.Box, {
|
172
|
-
sx:
|
173
|
-
p: 'lg',
|
174
|
-
flexDirection: 'initial !important',
|
175
|
-
alignContent: 'space-between',
|
176
|
-
flexWrap: 'wrap'
|
177
|
-
}
|
197
|
+
sx: sx.buttonsContainer
|
178
198
|
}, (0, _map["default"])(buttonArray).call(buttonArray, function (item) {
|
179
199
|
return (0, _react2.jsx)(_index.Button, {
|
180
|
-
mb: "sm",
|
181
200
|
variant: "inline",
|
182
|
-
sx: (0, _includes["default"])(selectedButtons).call(selectedButtons, item) ?
|
183
|
-
mr: '4px',
|
184
|
-
height: '30px',
|
185
|
-
borderRadius: '15px',
|
186
|
-
fontSize: '13px'
|
187
|
-
} : {
|
188
|
-
mr: '4px',
|
189
|
-
borderColor: 'neutral.80',
|
190
|
-
height: '30px',
|
191
|
-
borderRadius: '15px',
|
192
|
-
fontSize: '13px'
|
193
|
-
},
|
201
|
+
sx: (0, _includes["default"])(selectedButtons).call(selectedButtons, item) ? sx.selectedButton : sx.unSelectedButton,
|
194
202
|
key: item,
|
195
203
|
onPress: function onPress() {
|
196
204
|
return toggleButton(item);
|